backuptool: Remove backup blacklist/whitelist
Change-Id: Ia89e6fa4c31377a429e0dfa912d0b61393696009
diff --git a/config/common.mk b/config/common.mk
index df513d0..9b68803 100644
--- a/config/common.mk
+++ b/config/common.mk
@@ -30,8 +30,7 @@
PRODUCT_COPY_FILES += \
vendor/lineage/prebuilt/common/bin/backuptool.sh:install/bin/backuptool.sh \
vendor/lineage/prebuilt/common/bin/backuptool.functions:install/bin/backuptool.functions \
- vendor/lineage/prebuilt/common/bin/50-lineage.sh:$(TARGET_COPY_OUT_SYSTEM)/addon.d/50-lineage.sh \
- vendor/lineage/prebuilt/common/bin/blacklist:$(TARGET_COPY_OUT_SYSTEM)/addon.d/blacklist
+ vendor/lineage/prebuilt/common/bin/50-lineage.sh:$(TARGET_COPY_OUT_SYSTEM)/addon.d/50-lineage.sh
ifneq ($(AB_OTA_PARTITIONS),)
PRODUCT_COPY_FILES += \
diff --git a/prebuilt/common/bin/backuptool.sh b/prebuilt/common/bin/backuptool.sh
index 4a99e42..d925eb5 100755
--- a/prebuilt/common/bin/backuptool.sh
+++ b/prebuilt/common/bin/backuptool.sh
@@ -33,42 +33,12 @@
check_prereq() {
# If there is no build.prop file the partition is probably empty.
if [ ! -r $S/build.prop ]; then
- return 0
+ exit 127
fi
if ! grep -q "^ro.lineage.version=$V.*" $S/build.prop; then
echo "Not backing up files from incompatible version: $V"
- return 0
+ exit 127
fi
-return 1
-}
-
-check_blacklist() {
- if [ -f $S/addon.d/blacklist -a -d /$1/addon.d/ ]; then
- ## Discard any known bad backup scripts
- for f in /$1/addon.d/*sh; do
- [ -f $f ] || continue
- s=$(md5sum $f | cut -c-32)
- grep -q $s $S/addon.d/blacklist && rm -f $f
- done
- fi
-}
-
-check_whitelist() {
- found=0
- if [ -f $S/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 $S/addon.d/whitelist
- if [ $? -eq 0 ]; then
- found=1
- else
- rm -f $f
- fi
- done
- fi
- return $found
}
# Execute /system/addon.d/*.sh scripts with $1 parameter
@@ -110,13 +80,7 @@
backup)
mount_system
mkdir -p $C
- if check_prereq; then
- if check_whitelist $S; then
- unmount_system
- exit 127
- fi
- fi
- check_blacklist $S
+ check_prereq
preserve_addon_d
run_stage pre-backup
run_stage backup
@@ -125,13 +89,7 @@
;;
restore)
mount_system
- if check_prereq; then
- if check_whitelist tmp; then
- unmount_system
- exit 127
- fi
- fi
- check_blacklist tmp
+ check_prereq
run_stage pre-restore
run_stage restore
run_stage post-restore
diff --git a/prebuilt/common/bin/backuptool_ab.sh b/prebuilt/common/bin/backuptool_ab.sh
index 1765f5d..86bf67a 100755
--- a/prebuilt/common/bin/backuptool_ab.sh
+++ b/prebuilt/common/bin/backuptool_ab.sh
@@ -47,43 +47,13 @@
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 @@
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
diff --git a/prebuilt/common/bin/blacklist b/prebuilt/common/bin/blacklist
deleted file mode 100644
index 03c36c4..0000000
--- a/prebuilt/common/bin/blacklist
+++ /dev/null
@@ -1,4 +0,0 @@
-80f99c594f7b82c4cbe533e3f5447729
-29f4bab6bae5959458678869350dc888
-77d73f73da664f3592e712b7e7c107c1
-a5019b358023a3a6ae8be3f3380ba5ca
diff --git a/prebuilt/common/bin/whitelist b/prebuilt/common/bin/whitelist
deleted file mode 100644
index ca3f017..0000000
--- a/prebuilt/common/bin/whitelist
+++ /dev/null
@@ -1 +0,0 @@
-b0a27bcb5c7504a81e1450a8313e37cb