mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-11-27 20:15:29 +00:00
Use BusyBox standalone mode if available
This commit is contained in:
parent
4066e5bf14
commit
e165a1e65c
@ -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)
|
||||
|
@ -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))
|
||||
|
Loading…
Reference in New Issue
Block a user