Proper detect MagiskHide status

This commit is contained in:
topjohnwu 2018-07-27 22:32:47 +08:00
parent 41c0721159
commit 473902f5f4

View File

@ -181,7 +181,7 @@ public class MagiskManager extends Application {
magiskVersionCode = Integer.parseInt(ShellUtils.fastCmd("magisk -V")); magiskVersionCode = Integer.parseInt(ShellUtils.fastCmd("magisk -V"));
String s = ShellUtils.fastCmd((magiskVersionCode >= Const.MAGISK_VER.RESETPROP_PERSIST ? String s = ShellUtils.fastCmd((magiskVersionCode >= Const.MAGISK_VER.RESETPROP_PERSIST ?
"resetprop -p " : "getprop ") + Const.MAGISKHIDE_PROP); "resetprop -p " : "getprop ") + Const.MAGISKHIDE_PROP);
magiskHide = Integer.parseInt(s) != 0; magiskHide = s.isEmpty() || Integer.parseInt(s) != 0;
} catch (Exception ignored) {} } catch (Exception ignored) {}
} }