-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
83 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,39 @@ | ||
diff --git a/app/src/main/java/com/topjohnwu/magisk/ui/MainActivity.kt b/app/src/main/java/com/topjohnwu/magisk/ui/MainActivity.kt | ||
index 227a6065..95885d83 100644 | ||
index 0c7e64024..71fdb361e 100644 | ||
--- a/app/src/main/java/com/topjohnwu/magisk/ui/MainActivity.kt | ||
+++ b/app/src/main/java/com/topjohnwu/magisk/ui/MainActivity.kt | ||
@@ -193,7 +193,7 @@ open class MainActivity : BaseUIActivity<MainViewModel, ActivityMainMd2Binding>( | ||
@@ -168,7 +168,7 @@ class MainActivity : SplashActivity<ActivityMainMd2Binding>() { | ||
if (!Info.isEmulator && Info.env.isActive && System.getenv("PATH") | ||
?.split(':') | ||
?.filterNot { File("$it/magisk").exists() } | ||
- ?.any { File("$it/su").exists() } == true) { | ||
+ ?.any { File("$it/suu").exists() } == true) { | ||
MagiskDialog(this) | ||
.applyTitle(R.string.unsupport_general_title) | ||
.applyMessage(R.string.unsupport_other_su_msg) | ||
MagiskDialog(this).apply { | ||
setTitle(R.string.unsupport_general_title) | ||
setMessage(R.string.unsupport_other_su_msg) | ||
diff --git a/native/jni/core/applets.cpp b/native/jni/core/applets.cpp | ||
index 8d0d81446..41b8e8b01 100644 | ||
--- a/native/jni/core/applets.cpp | ||
+++ b/native/jni/core/applets.cpp | ||
@@ -10,7 +10,7 @@ using namespace std; | ||
|
||
using main_fun = int (*)(int, char *[]); | ||
|
||
-constexpr const char *applets[] = { "su", "resetprop", "zygisk", nullptr }; | ||
+constexpr const char *applets[] = { "suu", "resetprop", "zygisk", nullptr }; | ||
static main_fun applet_mains[] = { su_client_main, resetprop_main, zygisk_main, nullptr }; | ||
|
||
static int call_applet(int argc, char *argv[]) { | ||
diff --git a/native/jni/include/magisk.hpp b/native/jni/include/magisk.hpp | ||
index f954f10e..384a2914 100644 | ||
index 466e5f439..4ff87265a 100644 | ||
--- a/native/jni/include/magisk.hpp | ||
+++ b/native/jni/include/magisk.hpp | ||
@@ -24,7 +24,7 @@ extern std::string MAGISKTMP; | ||
#define ROOTOVL INTLROOT "/rootdir" | ||
#define ROOTMNT ROOTOVL "/.mount_list" | ||
@@ -28,7 +28,7 @@ extern std::string MAGISKTMP; | ||
#define ZYGISKBIN INTLROOT "/zygisk" | ||
#define SELINUXMOCK INTLROOT "/selinux" | ||
|
||
-constexpr const char *applet_names[] = { "su", "resetprop", "magiskhide", nullptr }; | ||
+constexpr const char *applet_names[] = { "suu", "resetprop", "magiskhide", nullptr }; | ||
constexpr const char *init_applet[] = { "magiskpolicy", "supolicy", nullptr }; | ||
-constexpr const char *applet_names[] = { "su", "resetprop", nullptr }; | ||
+constexpr const char *applet_names[] = { "suu", "resetprop", nullptr }; | ||
|
||
#define POST_FS_DATA_WAIT_TIME 40 | ||
#define POST_FS_DATA_SCRIPT_MAX_TIME 35 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
diff --git a/scripts/boot_patch.sh b/scripts/boot_patch.sh | ||
index c334e8d84..53766851a 100644 | ||
--- a/scripts/boot_patch.sh | ||
+++ b/scripts/boot_patch.sh | ||
@@ -205,6 +205,11 @@ if [ -f kernel ]; then | ||
# After: [mov w2, #-32768] | ||
./magiskboot hexpatch kernel 821B8012 E2FF8F12 | ||
|
||
+ # patch vivo do_mount_check | ||
+ # /system -> /syswxl | ||
+ # python3 -c "print(hex(int.from_bytes(b'/system', 'big')^int('bdbcbbbab9b8b7', 16)))" | ||
+ ./magiskboot hexpatch kernel 0092CFC2C9CDDDDA00 0092CFC2C9CEC0DB00 | ||
+ | ||
# Force kernel to load rootfs | ||
# skip_initramfs -> want_initramfs | ||
./magiskboot hexpatch kernel \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,28 @@ | ||
diff --git a/app/build.gradle.kts b/app/build.gradle.kts | ||
index 4c50bed2..64c27c3d 100644 | ||
index 71007e627..1880339b8 100644 | ||
--- a/app/build.gradle.kts | ||
+++ b/app/build.gradle.kts | ||
@@ -181,7 +181,7 @@ android.applicationVariants.all { | ||
@@ -66,6 +66,8 @@ configurations.all { | ||
} | ||
|
||
dependencies { | ||
- implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar")))) | ||
+ implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar", "*.aar")))) | ||
implementation(kotlin("stdlib")) | ||
// Some dependencies request JDK 8 stdlib, specify manually here to prevent version mismatch | ||
implementation(kotlin("stdlib-jdk8")) | ||
@@ -208,8 +208,8 @@ dependencies { | ||
implementation("com.caverock:androidsvg:1.4") | ||
+ | ||
implementation(project(":app:shared")) | ||
|
||
val vLibsu = "3.1.2" | ||
implementation("com.github.topjohnwu:jtar:1.0.0") | ||
@@ -78,10 +80,10 @@ dependencies { | ||
implementation("dev.rikka.rikkax.recyclerview:recyclerview-ktx:1.3.1") | ||
implementation("io.noties.markwon:core:4.6.2") | ||
|
||
- val vLibsu = "5.0.2" | ||
- implementation("com.github.topjohnwu.libsu:core:${vLibsu}") | ||
- implementation("com.github.topjohnwu.libsu:io:${vLibsu}") | ||
- implementation("com.github.topjohnwu.libsu:service:${vLibsu}") | ||
- implementation("com.github.topjohnwu.libsu:nio:${vLibsu}") | ||
+ //val vLibsu = "5.0.2" | ||
+ //implementation("com.github.topjohnwu.libsu:core:${vLibsu}") | ||
+ //implementation("com.github.topjohnwu.libsu:io:${vLibsu}") | ||
+ //implementation("com.github.topjohnwu.libsu:service:${vLibsu}") | ||
+ //implementation("com.github.topjohnwu.libsu:nio:${vLibsu}") | ||
|
||
val vRetrofit = "2.9.0" | ||
implementation("com.squareup.retrofit2:retrofit:${vRetrofit}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,35 @@ | ||
diff --git a/core/src/main/java/com/topjohnwu/superuser/internal/BuilderImpl.java b/core/src/main/java/com/topjohnwu/superuser/internal/BuilderImpl.java | ||
index 90a4dbd..dda4b9c 100644 | ||
index ae18065..fff8a79 100644 | ||
--- a/core/src/main/java/com/topjohnwu/superuser/internal/BuilderImpl.java | ||
+++ b/core/src/main/java/com/topjohnwu/superuser/internal/BuilderImpl.java | ||
@@ -47,7 +47,7 @@ public class BuilderImpl extends Shell.Builder { | ||
@@ -100,7 +100,7 @@ public final class BuilderImpl extends Shell.Builder { | ||
// Root mount master | ||
if (!hasFlags(FLAG_NON_ROOT_SHELL) && hasFlags(FLAG_MOUNT_MASTER)) { | ||
try { | ||
- shell = build("su", "--mount-master"); | ||
+ shell = build("suu", "--mount-master"); | ||
if (shell.getStatus() != Shell.ROOT_MOUNT_MASTER) | ||
if (!shell.isRoot()) | ||
shell = null; | ||
} catch (NoShellException ignore) {} | ||
@@ -56,7 +56,7 @@ public class BuilderImpl extends Shell.Builder { | ||
@@ -109,7 +109,7 @@ public final class BuilderImpl extends Shell.Builder { | ||
// Normal root shell | ||
if (shell == null && !hasFlags(FLAG_NON_ROOT_SHELL)) { | ||
try { | ||
- shell = build("su"); | ||
+ shell = build("suu"); | ||
if (shell.getStatus() != ROOT_SHELL) | ||
if (!shell.isRoot()) { | ||
shell = null; | ||
} catch (NoShellException ignore) {} | ||
} | ||
diff --git a/core/src/main/java/com/topjohnwu/superuser/internal/Utils.java b/core/src/main/java/com/topjohnwu/superuser/internal/Utils.java | ||
index 9c08d72..6129b7c 100644 | ||
index 1e3575f..7a5a0fb 100644 | ||
--- a/core/src/main/java/com/topjohnwu/superuser/internal/Utils.java | ||
+++ b/core/src/main/java/com/topjohnwu/superuser/internal/Utils.java | ||
@@ -34,7 +34,7 @@ import java.nio.charset.StandardCharsets; | ||
import java.util.Collection; | ||
import java.util.Collections; | ||
|
||
-@RestrictTo(RestrictTo.Scope.LIBRARY) | ||
+//@RestrictTo(RestrictTo.Scope.LIBRARY) | ||
public final class Utils { | ||
|
||
@SuppressLint("StaticFieldLeak") | ||
@@ -151,7 +151,7 @@ public final class Utils { | ||
} | ||
// noinspection ConstantConditions | ||
for (String path : System.getenv("PATH").split(":")) { | ||
- File su = new File(path, "su"); | ||
+ File su = new File(path, "suu"); | ||
if (su.canExecute()) { | ||
// We don't actually know whether the app has been granted root access. | ||
// Do NOT set the value as a confirmed state. |