diff --git a/app/src/full/java/com/topjohnwu/magisk/utils/RootUtils.java b/app/src/full/java/com/topjohnwu/magisk/utils/RootUtils.java index 7c686052e..2c84a45ef 100644 --- a/app/src/full/java/com/topjohnwu/magisk/utils/RootUtils.java +++ b/app/src/full/java/com/topjohnwu/magisk/utils/RootUtils.java @@ -50,7 +50,7 @@ public class RootUtils extends Shell.Initializer { job.add(nonroot); } - job.add("mount_partitions", "get_flags", "run_migrations").exec(); + job.add("mount_partitions", "get_flags", "run_migrations", "export BOOTMODE=true").exec(); Data.keepVerity = Boolean.parseBoolean(ShellUtils.fastCmd("echo $KEEPVERITY")); Data.keepEnc = Boolean.parseBoolean(ShellUtils.fastCmd("echo $KEEPFORCEENCRYPT")); diff --git a/scripts/util_functions.sh b/scripts/util_functions.sh index 4e54515bd..60b81f474 100644 --- a/scripts/util_functions.sh +++ b/scripts/util_functions.sh @@ -10,7 +10,8 @@ #MAGISK_VERSION_STUB # Detect whether in boot mode -ps | grep zygote | grep -qv grep && BOOTMODE=true || BOOTMODE=false +[ -z $BOOTMODE ] && BOOTMODE=false +$BOOTMODE || ps | grep zygote | grep -qv grep && BOOTMODE=true $BOOTMODE || ps -A | grep zygote | grep -qv grep && BOOTMODE=true # Presets