mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-11-23 18:15:30 +00:00
Update scripts for PATCHVBMETAFLAG
This commit is contained in:
parent
ba6e6cc15a
commit
21505a7470
@ -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
|
||||
}
|
||||
|
@ -377,8 +377,10 @@ umount_apex() {
|
||||
unset BOOTCLASSPATH
|
||||
}
|
||||
|
||||
# After calling this method, the following variables will be set:
|
||||
# KEEPVERITY, KEEPFORCEENCRYPT, RECOVERYMODE, PATCHVBMETAFLAG,
|
||||
# ISENCRYPTED, VBMETAEXIST
|
||||
get_flags() {
|
||||
# override variables
|
||||
getvar KEEPVERITY
|
||||
getvar KEEPFORCEENCRYPT
|
||||
getvar RECOVERYMODE
|
||||
@ -403,12 +405,15 @@ get_flags() {
|
||||
KEEPFORCEENCRYPT=false
|
||||
fi
|
||||
fi
|
||||
VBMETAEXIST=false
|
||||
local VBMETAIMG=$(find_block vbmeta vbmeta_a)
|
||||
[ -n "$VBMETAIMG" ] && VBMETAEXIST=true
|
||||
if [ -z $PATCHVBMETAFLAG ]; then
|
||||
if [ -e /dev/block/by-name/vbmeta_a ] || [ -e /dev/block/by-name/vbmeta ]; then
|
||||
if $VBMETAEXIST; then
|
||||
PATCHVBMETAFLAG=false
|
||||
else
|
||||
PATCHVBMETAFLAG=true
|
||||
ui_print "- Not found vbmeta partition, patch vbmetaflag"
|
||||
ui_print "- Cannot find vbmeta partition, patch vbmeta in boot image"
|
||||
fi
|
||||
fi
|
||||
[ -z $RECOVERYMODE ] && RECOVERYMODE=false
|
||||
|
Loading…
Reference in New Issue
Block a user