mirror of
https://github.com/topjohnwu/libsu.git
synced 2024-11-26 21:40:42 +00:00
Add pre-lollipop support
This commit is contained in:
parent
9043cd5c46
commit
01de4f25fe
@ -96,7 +96,7 @@ subprojects {
|
||||
afterEvaluate {
|
||||
android {
|
||||
compileSdkVersion(33)
|
||||
buildToolsVersion = "32.0.0"
|
||||
buildToolsVersion = "33.0.1"
|
||||
|
||||
defaultConfig {
|
||||
if (minSdkVersion == null)
|
||||
|
@ -187,6 +187,9 @@ public final class Utils {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
return Process.is64Bit();
|
||||
}
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
Class<?> classVMRuntime = Class.forName("dalvik.system.VMRuntime");
|
||||
Method getRuntime = classVMRuntime.getDeclaredMethod("getRuntime");
|
||||
|
@ -216,7 +216,10 @@ public class RootServiceManager implements Handler.Callback {
|
||||
}
|
||||
|
||||
// We cannot readlink /proc/self/exe on old kernels
|
||||
String app_process = "/system/bin/app_process" + (Utils.isProcess64Bit() ? "64" : "32");
|
||||
String app_process = "/system/bin/app_process";
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
app_process += Utils.isProcess64Bit() ? "64" : "32";
|
||||
}
|
||||
String cmd = String.format(Locale.ROOT,
|
||||
"(%s CLASSPATH=%s %s %s /system/bin %s " +
|
||||
"com.topjohnwu.superuser.internal.RootServerMain '%s' %d %s >/dev/null 2>&1)&",
|
||||
|
Loading…
Reference in New Issue
Block a user