Update scripts for PATCHVBMETAFLAG

This commit is contained in:
topjohnwu
2022-01-12 02:21:26 -08:00
committed by John Wu
parent ba6e6cc15a
commit 21505a7470
2 changed files with 16 additions and 10 deletions

View File

@@ -179,12 +179,6 @@ check_encryption() {
fi
}
check_vbmeta_partition() {
if [ -e /dev/block/by-name/vbmeta_a ] || [ -e /dev/block/by-name/vbmeta ]; then
VBMETAEXIST=true
fi
}
##########################
# Non-root util_functions
##########################
@@ -199,6 +193,14 @@ get_flags() {
KEEPVERITY=$SYSTEM_ROOT
[ "$(getprop ro.crypto.state)" = "encrypted" ] && ISENCRYPTED=true || ISENCRYPTED=false
KEEPFORCEENCRYPT=$ISENCRYPTED
# Although this most certainly won't work without root, keep it just in case
if [ -e /dev/block/by-name/vbmeta_a ] || [ -e /dev/block/by-name/vbmeta ]; then
VBMETAEXIST=true
else
VBMETAEXIST=false
fi
# Preset PATCHVBMETAFLAG to false in the non-root case
PATCHVBMETAFLAG=false
# Do NOT preset RECOVERYMODE here
}
@@ -217,7 +219,6 @@ app_init() {
SHA1=$(grep_prop SHA1 $MAGISKTMP/config)
check_boot_ramdisk && RAMDISKEXIST=true || RAMDISKEXIST=false
check_encryption
check_vbmeta_partition
# Make sure RECOVERYMODE has value
[ -z $RECOVERYMODE ] && RECOVERYMODE=false
}