mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-12-24 23:57:38 +00:00
Try to flush database before uninstalling
This commit is contained in:
parent
e7e580e177
commit
6557070ae1
@ -111,6 +111,7 @@ public class PatchAPK {
|
||||
repack.delete();
|
||||
|
||||
mm.mDB.setStrings(Const.Key.SU_MANAGER, pkg);
|
||||
mm.mDB.flush();
|
||||
Data.exportPrefs();
|
||||
RootUtils.uninstallPkg(Const.ORIG_PKG_NAME);
|
||||
|
||||
|
@ -57,6 +57,10 @@ public class MagiskDatabaseHelper {
|
||||
|
||||
private MagiskDatabaseHelper() {
|
||||
pm = Data.MM().getPackageManager();
|
||||
init();
|
||||
}
|
||||
|
||||
private void init() {
|
||||
db = openDatabase();
|
||||
db.disableWriteAheadLogging();
|
||||
int version = Data.magiskVersionCode >= Const.MAGISK_VER.DBVER_SIX ? DATABASE_VER : OLD_DATABASE_VER;
|
||||
@ -171,6 +175,11 @@ public class MagiskDatabaseHelper {
|
||||
"(key TEXT, value INT, PRIMARY KEY(key))");
|
||||
}
|
||||
|
||||
public void flush() {
|
||||
db.close();
|
||||
init();
|
||||
}
|
||||
|
||||
public void clearOutdated() {
|
||||
// Clear outdated policies
|
||||
db.delete(POLICY_TABLE, Utils.fmt("until > 0 AND until < %d", System.currentTimeMillis() / 1000), null);
|
||||
|
Loading…
x
Reference in New Issue
Block a user