From 0ac19e3a4e99aa17c5bb7a7a791fc8f2114ddf1e Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Sat, 7 May 2022 01:16:55 -0700 Subject: [PATCH] Fix app running without root --- app/src/main/java/com/topjohnwu/magisk/core/utils/RootUtils.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/topjohnwu/magisk/core/utils/RootUtils.kt b/app/src/main/java/com/topjohnwu/magisk/core/utils/RootUtils.kt index c99bd76f9..7fd34fb90 100644 --- a/app/src/main/java/com/topjohnwu/magisk/core/utils/RootUtils.kt +++ b/app/src/main/java/com/topjohnwu/magisk/core/utils/RootUtils.kt @@ -6,6 +6,7 @@ import android.content.Intent import android.content.ServiceConnection import android.os.IBinder import androidx.core.content.getSystemService +import com.topjohnwu.magisk.core.Info import com.topjohnwu.superuser.Shell import com.topjohnwu.superuser.ShellUtils import com.topjohnwu.superuser.ipc.RootService @@ -105,7 +106,7 @@ class RootUtils(stub: Any?) : RootService() { fun await() { // We cannot await on the main thread - if (!ShellUtils.onMainThread()) + if (Info.isRooted && !ShellUtils.onMainThread()) acquireSharedInterruptibly(1) } }