diff options
author | Wang Han <416810799@qq.com> | 2020-02-05 16:45:15 +0800 |
---|---|---|
committer | Aaron Kling <webgeek1234@gmail.com> | 2020-08-12 22:53:54 -0500 |
commit | 400e4fa40d8a7538d893f1e2a3fc813f95f64df4 (patch) | |
tree | d7c5c1186ab018b6defcc2198910e55cbc18fb7a | |
parent | a0583ca7a24aaf5a0914f8314fa5e45cc872cef4 (diff) | |
download | external_wget-400e4fa40d8a7538d893f1e2a3fc813f95f64df4.tar.gz external_wget-400e4fa40d8a7538d893f1e2a3fc813f95f64df4.tar.bz2 external_wget-400e4fa40d8a7538d893f1e2a3fc813f95f64df4.zip |
backuptool: Remove backup blacklist/whitelist
Change-Id: Ia89e6fa4c31377a429e0dfa912d0b61393696009
-rw-r--r-- | config/common.mk | 3 | ||||
-rwxr-xr-x | prebuilt/common/bin/backuptool.sh | 50 | ||||
-rwxr-xr-x | prebuilt/common/bin/backuptool_ab.sh | 48 | ||||
-rw-r--r-- | prebuilt/common/bin/blacklist | 4 | ||||
-rw-r--r-- | prebuilt/common/bin/whitelist | 1 |
5 files changed, 9 insertions, 97 deletions
diff --git a/config/common.mk b/config/common.mk index 19571c0e..1e649082 100644 --- a/config/common.mk +++ b/config/common.mk @@ -28,8 +28,7 @@ endif 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:system/addon.d/50-lineage.sh \ - vendor/lineage/prebuilt/common/bin/blacklist:system/addon.d/blacklist + vendor/lineage/prebuilt/common/bin/50-lineage.sh:system/addon.d/50-lineage.sh ifeq ($(AB_OTA_UPDATER),true) PRODUCT_COPY_FILES += \ diff --git a/prebuilt/common/bin/backuptool.sh b/prebuilt/common/bin/backuptool.sh index 7966853b..719473e8 100755 --- a/prebuilt/common/bin/backuptool.sh +++ b/prebuilt/common/bin/backuptool.sh @@ -47,45 +47,15 @@ restore_addon_d() { 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 - cd /$1/addon.d/ - for f in *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 run_stage() { if [ -d /tmp/addon.d/ ]; then @@ -124,13 +94,7 @@ case "$1" in backup) mount_system mkdir -p $C - if check_prereq; then - if check_whitelist system; then - unmount_system - exit 127 - fi - fi - check_blacklist system + check_prereq preserve_addon_d run_stage pre-backup run_stage backup @@ -139,13 +103,7 @@ case "$1" in ;; 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 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 diff --git a/prebuilt/common/bin/blacklist b/prebuilt/common/bin/blacklist deleted file mode 100644 index 03c36c4c..00000000 --- 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 ca3f0172..00000000 --- a/prebuilt/common/bin/whitelist +++ /dev/null @@ -1 +0,0 @@ -b0a27bcb5c7504a81e1450a8313e37cb |