Switch to DB based su configs

This commit is contained in:
topjohnwu
2017-06-01 03:18:41 +08:00
parent 1e4425b30f
commit ff6938280e
3 changed files with 31 additions and 27 deletions

View File

@@ -161,18 +161,8 @@ public class MagiskManager extends Application {
isSuClient = suVersion.toUpperCase().contains("MAGISK");
}
if (isSuClient) {
ret = Shell.sh("getprop " + ROOT_ACCESS_PROP);
if (Utils.isValidShellResponse(ret)) {
suAccessState = Integer.parseInt(ret.get(0));
} else {
suAccessState = 0;
}
ret = Shell.sh("getprop " + MULTIUSER_MODE_PROP);
if (Utils.isValidShellResponse(ret)) {
multiuserMode = Integer.parseInt(ret.get(0));
} else {
multiuserMode = 0;
}
suAccessState = suDB.getSettings(SuDatabaseHelper.ROOT_ACCESS, 3);
multiuserMode = suDB.getSettings(SuDatabaseHelper.MULTIUSER_MODE, 0);
}
}