mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-02-24 23:09:40 +00:00
Fix #5673
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:
parent
7e61716277
commit
2248af00f3
@ -144,16 +144,13 @@ check_boot_ramdisk() {
|
|||||||
# Create boolean ISAB
|
# Create boolean ISAB
|
||||||
[ -z $SLOT ] && ISAB=false || ISAB=true
|
[ -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
|
# If we are A/B, then we must have ramdisk
|
||||||
$ISAB && return 0
|
$ISAB && return 0
|
||||||
|
|
||||||
# If we are using legacy SAR, but not A/B, assume we do not have ramdisk
|
# 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
|
if grep ' / ' /proc/mounts | grep -q '/dev/root'; then
|
||||||
# Override recovery mode to true if not set
|
# Override recovery mode to true
|
||||||
[ -z $RECOVERYMODE ] && RECOVERYMODE=true
|
RECOVERYMODE=true
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -217,10 +214,11 @@ grep_prop() { return; }
|
|||||||
|
|
||||||
app_init() {
|
app_init() {
|
||||||
mount_partitions
|
mount_partitions
|
||||||
|
RAMDISKEXIST=false
|
||||||
|
check_boot_ramdisk && RAMDISKEXIST=true
|
||||||
get_flags
|
get_flags
|
||||||
run_migrations
|
run_migrations
|
||||||
SHA1=$(grep_prop SHA1 $MAGISKTMP/config)
|
SHA1=$(grep_prop SHA1 $MAGISKTMP/config)
|
||||||
check_boot_ramdisk && RAMDISKEXIST=true || RAMDISKEXIST=false
|
|
||||||
check_encryption
|
check_encryption
|
||||||
# Make sure RECOVERYMODE has value
|
# Make sure RECOVERYMODE has value
|
||||||
[ -z $RECOVERYMODE ] && RECOVERYMODE=false
|
[ -z $RECOVERYMODE ] && RECOVERYMODE=false
|
||||||
|
Loading…
x
Reference in New Issue
Block a user