diff --git a/app/src/main/java/com/topjohnwu/magisk/core/App.kt b/app/src/main/java/com/topjohnwu/magisk/core/App.kt index 3e6a6251a..394c54f9d 100644 --- a/app/src/main/java/com/topjohnwu/magisk/core/App.kt +++ b/app/src/main/java/com/topjohnwu/magisk/core/App.kt @@ -30,7 +30,7 @@ open class App() : Application() { init { AppCompatDelegate.setCompatVectorFromResourcesEnabled(true) - Shell.Config.setFlags(Shell.FLAG_MOUNT_MASTER or Shell.FLAG_USE_MAGISK_BUSYBOX) + Shell.Config.setFlags(Shell.FLAG_MOUNT_MASTER) Shell.Config.verboseLogging(BuildConfig.DEBUG) Shell.Config.addInitializers(RootInit::class.java) Shell.Config.setTimeout(2) diff --git a/app/src/main/java/com/topjohnwu/magisk/core/utils/RootInit.kt b/app/src/main/java/com/topjohnwu/magisk/core/utils/RootInit.kt index b031199fb..21b30b218 100644 --- a/app/src/main/java/com/topjohnwu/magisk/core/utils/RootInit.kt +++ b/app/src/main/java/com/topjohnwu/magisk/core/utils/RootInit.kt @@ -18,10 +18,14 @@ class RootInit : Shell.Initializer() { fun init(context: Context, shell: Shell): Boolean { val job = shell.newJob() - if (Info.env.magiskVersionCode >= Const.Version.DYNAMIC_PATH) - job.add("MAGISKTMP=$(magisk --path)/.magisk") - else - job.add("MAGISKTMP=/sbin/.magisk") + if (Info.env.magiskVersionCode >= Const.Version.DYNAMIC_PATH) { + job.add("export ASH_STANDALONE=1") + .add("[ -x /data/adb/magisk/busybox ] && exec /data/adb/magisk/busybox sh") + .add("MAGISKTMP=$(magisk --path)/.magisk") + } else { + job.add("export PATH=\"/sbin/.magisk/busybox:\$PATH\"") + .add("MAGISKTMP=/sbin/.magisk") + } job.add(context.rawResource(R.raw.manager)) if (shell.isRoot) { job.add(context.rawResource(R.raw.util_functions))