forked from JohnJ80/Karoo-App-Sideloading
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Karoo_Backup.sh
85 lines (57 loc) · 2.27 KB
/
Karoo_Backup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
SECONDS=0
printf "*____________________________________________*\n"
printf "* *\n"
printf "* Karoo apps and Nav Backup script *\n"
printf "* *\n"
printf "*____________________________________________*\n"
printf "\n\n\n"
printf "Setting up directory for backup.\n"
if (mkdir ./Karoo/apps_backup)
then
printf "Created backup directory with no issues. \n"
else
printf "Using backup directory to backup current apps backup.\n"
fi
printf "Copying previous backup to backup directory.\n"
rm -r ./Karoo/apps_backup
cp -R -v ./Karoo/apps ./Karoo/apps_backup
printf "Backup of apps backed up using ES File Explored installed on Karoo.\n\n"
rm -r ./Karoo/apps
mkdir ./Karoo/apps
./adb pull /sdcard/backups/apps ./Karoo
printf "\n\n Backing up of Osmand data and maps.\n\n"
if (mkdir ./Karoo/data_backup)
then
printf "Created map data backup directory with no issues. \n"
else
printf "Using map data backup directory to backup current data backup.\n"
fi
printf "\n Backing up old Osmand data and maps. \n\n"
rm -r ./Karoo/data_backup
cp -R -v ./Karoo/Android/data ./Karoo/data_backup
rm -r ./Karoo/Android/data
mkdir ./Karoo/Android/data
./adb pull -a /sdcard/Android/data/net.osmand.plus ./Karoo/Android/data
printf "Backing up of Komoot Data."
./adb pull -a /sdcard/Android/data/de.komoot.android ./Karoo/Android/data
printf "\n\nBacking up Nova Launcher data including backups.\n\n"
./adb pull -a /sdcard/data/com.teslacoilsw.launcher ./Karoo/data/
printf "\n\nAll done backup up Karoo apps plus Osmand and Komoot data.\n"
printf "Renaming backed up apps without spaces in their names for easy re-install.\n"
printf "Starting to Rename files \n"
for karoo_file in ./Karoo/apps/*;
do
echo "removing spaces from apk file:" $karoo_file
mv "$karoo_file" "${karoo_file// /_}";
done
printf "\nList of backed up apps.\n\n"
ls ./Karoo/apps
printf "\nList of backed up Osmand maps.\n"
ls -al ./Karoo/Android/data/net.osmand.plus/files/*.obf
printf "\n List of other files backed up.\n"
ls -al ./Karoo/data
printf "\n\n\n --------All Done!---------\n\n\n"
duration=$SECONDS
duration=$SECONDS
echo " $(($duration / 60)) minutes and $(($duration % 60)) seconds elapsed."
printf "\n\n"