summaryrefslogtreecommitdiffstats
path: root/prebuilt/common/bin/backuptool_ab.sh
diff options
context:
space:
mode:
authorWang Han <416810799@qq.com>2020-02-05 16:45:15 +0800
committerAaron Kling <webgeek1234@gmail.com>2020-08-12 22:53:54 -0500
commit400e4fa40d8a7538d893f1e2a3fc813f95f64df4 (patch)
treed7c5c1186ab018b6defcc2198910e55cbc18fb7a /prebuilt/common/bin/backuptool_ab.sh
parenta0583ca7a24aaf5a0914f8314fa5e45cc872cef4 (diff)
downloadexternal_wget-400e4fa40d8a7538d893f1e2a3fc813f95f64df4.tar.gz
external_wget-400e4fa40d8a7538d893f1e2a3fc813f95f64df4.tar.bz2
external_wget-400e4fa40d8a7538d893f1e2a3fc813f95f64df4.zip
backuptool: Remove backup blacklist/whitelist
Change-Id: Ia89e6fa4c31377a429e0dfa912d0b61393696009
Diffstat (limited to 'prebuilt/common/bin/backuptool_ab.sh')
-rwxr-xr-xprebuilt/common/bin/backuptool_ab.sh48
1 files changed, 4 insertions, 44 deletions
diff --git a/prebuilt/common/bin/backuptool_ab.sh b/prebuilt/common/bin/backuptool_ab.sh
index 157110f8..5b0dc08e 100755
--- a/prebuilt/common/bin/backuptool_ab.sh
+++ b/prebuilt/common/bin/backuptool_ab.sh
@@ -47,43 +47,13 @@ restore_addon_d() {
check_prereq() {
# If there is no build.prop file the partition is probably empty.
if [ ! -r /system/build.prop ]; then
- return 0
+ exit 127
fi
grep -q "^ro.lineage.version=$V.*" /system/build.prop && return 1
echo "Not backing up files from incompatible version: $V"
-return 0
-}
-
-check_blacklist() {
- if [ -f /system/addon.d/blacklist -a -d /$1/addon.d/ ]; then
- ## Discard any known bad backup scripts
- cd /$1/addon.d/
- for f in *sh; do
- [ -f $f ] || continue
- s=$(md5sum $f | cut -c-32)
- grep -q $s /system/addon.d/blacklist && rm -f $f
- done
- fi
-}
-
-check_whitelist() {
- found=0
- if [ -f /system/addon.d/whitelist ];then
- ## forcefully keep any version-independent stuff
- cd /$1/addon.d/
- for f in *sh; do
- s=$(md5sum $f | cut -c-32)
- grep -q $s /system/addon.d/whitelist
- if [ $? -eq 0 ]; then
- found=1
- else
- rm -f $f
- fi
- done
- fi
- return $found
+exit 127
}
# Execute /system/addon.d/*.sh scripts with $1 parameter
@@ -104,24 +74,14 @@ fi
case "$1" in
backup)
mkdir -p $C
- if check_prereq; then
- if check_whitelist postinstall/system; then
- exit 127
- fi
- fi
- check_blacklist postinstall/system
+ check_prereq
preserve_addon_d
run_stage pre-backup
run_stage backup
run_stage post-backup
;;
restore)
- if check_prereq; then
- if check_whitelist postinstall/tmp; then
- exit 127
- fi
- fi
- check_blacklist postinstall/tmp
+ check_prereq
run_stage pre-restore
run_stage restore
run_stage post-restore