From c9ca42aaa96c26c2f84672d962c4172bde36bef3 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Sun, 13 May 2018 18:14:44 +0800 Subject: [PATCH] Support fixing Magisk environment --- app | 2 +- build.gradle | 2 +- native/jni/core/bootstages.c | 9 ++++++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/app b/app index 15ed3e52f..630f2b7d1 160000 --- a/app +++ b/app @@ -1 +1 @@ -Subproject commit 15ed3e52f2b096a5e86b4e245fc969c49f0446d1 +Subproject commit 630f2b7d199808d54b57f22ae0d7794baed51590 diff --git a/build.gradle b/build.gradle index 02fcdba50..ac8f8092b 100644 --- a/build.gradle +++ b/build.gradle @@ -25,7 +25,7 @@ allprojects { ext { compileSdkVersion = 27 - buildToolsVersion = "28.0.0-rc1" + buildToolsVersion = "28.0.0-rc2" supportLibVersion = "27.1.1" } diff --git a/native/jni/core/bootstages.c b/native/jni/core/bootstages.c index 8c9490e95..2fe1a40ca 100644 --- a/native/jni/core/bootstages.c +++ b/native/jni/core/bootstages.c @@ -629,12 +629,15 @@ initialize: #endif } xmkdirs(MIRRDIR "/bin", 0755); + xmkdirs(DATABIN, 0755); bind_mount(DATABIN, MIRRDIR "/bin"); - LOGI("* Setting up internal busybox"); xmkdirs(BBPATH, 0755); - exec_command_sync(MIRRDIR "/bin/busybox", "--install", "-s", BBPATH, NULL); - xsymlink(MIRRDIR "/bin/busybox", BBPATH "/busybox"); + if (access(MIRRDIR "/bin/busybox", X_OK) == 0) { + LOGI("* Setting up internal busybox"); + exec_command_sync(MIRRDIR "/bin/busybox", "--install", "-s", BBPATH, NULL); + xsymlink(MIRRDIR "/bin/busybox", BBPATH "/busybox"); + } // uninstall if (access(UNINSTALLER, F_OK) == 0) {