updater
[projets/cm-custom.git] / dist-std / cm-data / 99-perso.sh.addon
1 #!/sbin/sh
2 #
3 # $S/addon.d/99-perso.sh
4 #
5
6 # we partially use the script at install, we need to have some fallback
7 # if backuptool functions are not present
8 if [ -e /tmp/backuptool.functions ]
9 then
10   . /tmp/backuptool.functions
11 else
12   S=/system
13 fi
14
15 # path is needed when running from recovery (at install)
16 export PATH="${PATH}:$S/bin:$S/xbin"
17
18 list_files() {
19 cat <<EOF
20 bin/oem-iptables-init.sh
21 lib/libjni_latinimegoogle.so
22 usr/share/zoneinfo/tzdata
23 EOF
24 }
25
26 case "$1" in
27   backup)
28     list_files | while read FILE DUMMY; do
29       backup_file $S/"$FILE"
30     done
31   ;;
32   restore)
33     list_files | while read FILE REPLACEMENT; do
34       R=""
35       [ -n "$REPLACEMENT" ] && R="$S/$REPLACEMENT"
36       [ -f "$C/$S/$FILE" ] && restore_file $S/"$FILE" "$R"
37     done
38   ;;
39   pre-backup)
40     # Stub
41   ;;
42   post-backup)
43     # Stub
44   ;;
45   pre-restore)
46     # Stub
47   ;;
48   post-restore)
49     # mute camera
50     chmod 000 $S/media/audio/ui/camera_*.ogg
51     # remove bloat
52     rm -rf $S/priv-app/AudioFX
53     rm -rf $S/priv-app/CMAccount
54     rm -rf $S/priv-app/CMBugReport
55     rm -rf $S/priv-app/CMUpdater
56     rm -rf $S/priv-app/Updater
57     rm -rf $S/priv-app/LiveLockScreenService
58     rm -rf $S/priv-app/Snap
59     rm -rf $S/priv-app/ThemeChooser
60     rm -rf $S/priv-app/ThemesProvider
61     rm -rf $S/priv-app/Trebuchet
62     rm -rf $S/app/BasicDreams
63     rm -rf $S/app/CMWallpapers
64     rm -rf $S/app/Camera2
65     rm -rf $S/app/Email
66     rm -rf $S/app/Exchange2
67     rm -rf $S/app/Galaxy4
68     rm -rf $S/app/HoloSpiralWallpaper
69     rm -rf $S/app/HexoLibre
70     rm -rf $S/app/Jelly
71     rm -rf $S/app/LiveWallpapers
72     rm -rf $S/app/LiveWallpapersPicker
73     rm -rf $S/app/LockClock
74     rm -rf $S/app/NoiseField
75     rm -rf $S/app/PhaseBeam
76     rm -rf $S/app/PhotoPhase
77     rm -rf $S/app/PhotoTable
78     rm -rf $S/app/Profiles
79     rm -rf $S/app/Stk
80     rm -rf $S/app/Terminal
81     rm -rf $S/app/TimeService
82     rm -rf $S/app/VisualizationWallpapers
83     rm -rf $S/app/WAPPushManager
84     rm -rf $S/app/WhisperPush
85   ;;
86 esac