From 3f87f6aee3aeb6c202c21a8375775c5a45e739f4 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Thu, 20 Sep 2018 16:21:22 -0400 Subject: [PATCH] Fix output in Magisk Manager if no root exists --- app/src/full/java/com/topjohnwu/magisk/utils/RootUtils.java | 2 +- scripts/util_functions.sh | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) 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