You've already forked Magisk
mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-09-06 06:36:58 +00:00
WIP Sync
This commit is contained in:
@@ -68,6 +68,23 @@ public class Shell {
|
||||
return rootStatus > 0;
|
||||
}
|
||||
|
||||
|
||||
public static boolean GetRootStatus() {
|
||||
if (Shell.sh("which su").contains("su")) {
|
||||
Shell.su(("setprop magisk.root 0"));
|
||||
}
|
||||
try {
|
||||
String rootStatus = Shell.su("getprop magisk.root").toString();
|
||||
return Integer.valueOf(rootStatus).equals(1);
|
||||
} catch (NullPointerException e) {
|
||||
e.printStackTrace();
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static List<String> sh(String... commands) {
|
||||
List<String> res = Collections.synchronizedList(new ArrayList<String>());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user