diff --git a/app/core/src/main/java/com/topjohnwu/magisk/core/utils/ShellInit.kt b/app/core/src/main/java/com/topjohnwu/magisk/core/utils/ShellInit.kt index 77850f84d013b..62796aedd6d55 100644 --- a/app/core/src/main/java/com/topjohnwu/magisk/core/utils/ShellInit.kt +++ b/app/core/src/main/java/com/topjohnwu/magisk/core/utils/ShellInit.kt @@ -9,6 +9,7 @@ import com.topjohnwu.magisk.core.ktx.cachedFile import com.topjohnwu.magisk.core.ktx.deviceProtectedContext import com.topjohnwu.magisk.core.ktx.writeTo import com.topjohnwu.superuser.Shell +import com.topjohnwu.superuser.ShellUtils.fastCmdResult import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.runBlocking import java.io.File @@ -16,7 +17,7 @@ import java.util.jar.JarFile class ShellInit : Shell.Initializer() { override fun onInit(context: Context, shell: Shell): Boolean { - if (shell.isRoot) { + if (shell.isRoot && fastCmdResult(shell, "magisk")) { Info.isRooted = true RootUtils.bindTask?.let { shell.execTask(it) } RootUtils.bindTask = null