Mark DB current after backup upgrade process

Fixes #7596
This commit is contained in:
Moxie Marlinspike 2018-04-02 06:27:50 -07:00
parent c0da061072
commit 2c82b3610d
2 changed files with 5 additions and 0 deletions

View File

@ -136,6 +136,7 @@ public class DatabaseFactory {
public static void upgradeRestored(Context context, SQLiteDatabase database){
getInstance(context).databaseHelper.onUpgrade(database, database.getVersion(), -1);
getInstance(context).databaseHelper.markCurrent(database);
}
private DatabaseFactory(@NonNull Context context) {

View File

@ -185,6 +185,10 @@ public class SQLCipherOpenHelper extends SQLiteOpenHelper {
return getWritableDatabase(databaseSecret.asString());
}
public void markCurrent(SQLiteDatabase db) {
db.setVersion(DATABASE_VERSION);
}
private void executeStatements(SQLiteDatabase db, String[] statements) {
for (String statement : statements)
db.execSQL(statement);