Zip Autoflash; Massive refactor

This commit is contained in:
topjohnwu
2016-08-29 06:35:07 +08:00
parent 1f02d0f6d0
commit e21131d67e
20 changed files with 551 additions and 480 deletions

View File

@@ -17,7 +17,6 @@ public class Shell {
// -1 = problematic/unknown issue; 0 = not rooted; 1 = properly rooted; 2 = improperly rooted;
public static int rootStatus;
public static int magiskVersion;
private static Process rootShell;
private static DataOutputStream rootSTDIN;
@@ -30,13 +29,6 @@ public class Shell {
private static void init() {
List<String> ret = sh("getprop magisk.version");
if (ret.get(0).replaceAll("\\s", "").isEmpty()) {
magiskVersion = -1;
} else {
magiskVersion = Integer.parseInt(ret.get(0));
}
try {
rootShell = Runtime.getRuntime().exec(sh("getprop magisk.supath").get(0) + "/su");
rootStatus = 1;
@@ -56,7 +48,7 @@ public class Shell {
rootSTDOUT = new StreamGobbler(rootShell.getInputStream(), rootOutList);
rootSTDOUT.start();
ret = su("echo -BOC-", "id");
List<String> ret = su("echo -BOC-", "id");
if (ret == null) {
// Something wrong with root, not allowed?
rootStatus = -1;