Update to libsu 1.2.0

This commit is contained in:
topjohnwu
2018-06-20 04:48:56 +08:00
parent 1df41003ec
commit 4ff39f8817
13 changed files with 72 additions and 77 deletions
@@ -8,26 +8,18 @@ import com.topjohnwu.superuser.io.SuFile;
public class RootUtils {
public static void init() {
Const.MAGISK_DISABLE_FILE = new SuFile("/cache/.disable_magisk", true);
SuFile file = new SuFile("/sbin/.core/img", true);
Const.MAGISK_DISABLE_FILE = new SuFile("/cache/.disable_magisk");
SuFile file = new SuFile("/sbin/.core/img");
if (file.exists()) {
Const.MAGISK_PATH = file;
} else if ((file = new SuFile("/dev/magisk/img", true)).exists()) {
} else if ((file = new SuFile("/dev/magisk/img")).exists()) {
Const.MAGISK_PATH = file;
} else {
Const.MAGISK_PATH = new SuFile("/magisk", true);
Const.MAGISK_PATH = new SuFile("/magisk");
}
Const.MAGISK_HOST_FILE = new SuFile(Const.MAGISK_PATH + "/.core/hosts");
}
public static String cmd(String cmd) {
return ShellUtils.fastCmd(Shell.getShell(), cmd);
}
public static boolean cmdResult(String cmd) {
return ShellUtils.fastCmdResult(Shell.getShell(), cmd);
}
public static void uninstallPkg(String pkg) {
Shell.Sync.su("db_clean " + Const.USER_ID, "pm uninstall " + pkg);
}