More precise sudb management

This commit is contained in:
topjohnwu
2017-12-22 02:36:15 +08:00
parent 5ee49ba065
commit a7ed6c15d3
8 changed files with 33 additions and 31 deletions
@@ -106,16 +106,7 @@ public class MagiskManager extends Application {
} catch (PackageManager.NameNotFoundException ignored) { /* Expected */ }
}
suDB = new SuDatabaseHelper(true);
if (getPackageName().equals(Const.ORIG_PKG_NAME)) {
String pkg = suDB.getStrings(Const.Key.SU_REQUESTER, null);
if (pkg != null) {
Utils.uninstallPkg(pkg);
suDB.setStrings(Const.Key.SU_REQUESTER, null);
}
}
suDB = new SuDatabaseHelper(false);
repoDB = new RepoDatabaseHelper(this);
defaultLocale = Locale.getDefault();
setLocale();
@@ -212,7 +203,7 @@ public class MagiskManager extends Application {
keepEnc = false;
}
if (suDB != null) {
if (suDB != null && !SuDatabaseHelper.verified) {
suDB.close();
suDB = new SuDatabaseHelper();
}