mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-10-25 11:38:51 +00:00
Add CLI to detect MagiskHide status
This commit is contained in:
@@ -44,11 +44,11 @@ public class Const {
|
||||
public static final int USER_ID = Process.myUid() / 100000;
|
||||
|
||||
public static final class MAGISK_VER {
|
||||
public static final int REMOVE_LEGACY_LINK = 1630;
|
||||
public static final int SEPOL_REFACTOR = 1640;
|
||||
public static final int FIX_ENV = 1650;
|
||||
public static final int DBVER_SIX = 17000;
|
||||
public static final int CMDLINE_DB = 17305;
|
||||
public static final int HIDE_STATUS = 17315;
|
||||
}
|
||||
|
||||
public static class ID {
|
||||
|
||||
@@ -91,8 +91,12 @@ public class Data {
|
||||
try {
|
||||
magiskVersionString = ShellUtils.fastCmd("magisk -v").split(":")[0];
|
||||
magiskVersionCode = Integer.parseInt(ShellUtils.fastCmd("magisk -V"));
|
||||
String s = ShellUtils.fastCmd(("resetprop -p ") + Const.MAGISKHIDE_PROP);
|
||||
magiskHide = s.isEmpty() || Integer.parseInt(s) != 0;
|
||||
if (magiskVersionCode >= Const.MAGISK_VER.HIDE_STATUS) {
|
||||
magiskHide = Shell.su("magiskhide --status").exec().isSuccess();
|
||||
} else {
|
||||
String s = ShellUtils.fastCmd(("resetprop -p ") + Const.MAGISKHIDE_PROP);
|
||||
magiskHide = s.isEmpty() || Integer.parseInt(s) != 0;
|
||||
}
|
||||
} catch (NumberFormatException ignored) {}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user