backuptool: Remove backup blacklist/whitelist

Change-Id: Ia89e6fa4c31377a429e0dfa912d0b61393696009
gugelfrei
Wang Han 4 years ago committed by Luca Stefani
parent b532825214
commit e43d699cfe

@ -30,8 +30,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:$(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 += \

@ -33,42 +33,12 @@ 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
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 @@ case "$1" in
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 @@ 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

@ -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

@ -1,4 +0,0 @@
80f99c594f7b82c4cbe533e3f5447729
29f4bab6bae5959458678869350dc888
77d73f73da664f3592e712b7e7c107c1
a5019b358023a3a6ae8be3f3380ba5ca

@ -1 +0,0 @@
b0a27bcb5c7504a81e1450a8313e37cb
Loading…
Cancel
Save