mirror of
https://github.com/kvorschk/Magisk.git
synced 2026-12-05 11:30:47 -05:00
Update to libsu 1.2.0
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user