util_functions.sh overrides `get_flags` function (defined in manager.sh), which sets `RECOVERYMODE` and causes `check_boot_ramdisk` not overriding the incorrect value.
This commit is contained in:
残页 2022-06-12 15:32:34 +08:00 committed by GitHub
parent 7e61716277
commit 2248af00f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -144,16 +144,13 @@ check_boot_ramdisk() {
# Create boolean ISAB
[ -z $SLOT ] && ISAB=false || ISAB=true
# If we are running as recovery mode, then we do not have ramdisk
[ "$RECOVERYMODE" = "true" ] && return 1
# If we are A/B, then we must have ramdisk
$ISAB && return 0
# If we are using legacy SAR, but not A/B, assume we do not have ramdisk
if grep ' / ' /proc/mounts | grep -q '/dev/root'; then
# Override recovery mode to true if not set
[ -z $RECOVERYMODE ] && RECOVERYMODE=true
# Override recovery mode to true
RECOVERYMODE=true
return 1
fi
@ -217,10 +214,11 @@ grep_prop() { return; }
app_init() {
mount_partitions
RAMDISKEXIST=false
check_boot_ramdisk && RAMDISKEXIST=true
get_flags
run_migrations
SHA1=$(grep_prop SHA1 $MAGISKTMP/config)
check_boot_ramdisk && RAMDISKEXIST=true || RAMDISKEXIST=false
check_encryption
# Make sure RECOVERYMODE has value
[ -z $RECOVERYMODE ] && RECOVERYMODE=false