0
I wrote the code to migrate the db from 3.x to 4.2 in my Android app, and I have upgraded my DB Browser for SQLite Windows app.
I can open the file in the app. However, after downloading the db file from Device Explorer, I can no longer open the db file in DB Browser.
Could not open database file. Reason: file is not a database
What am I doing wrong?
private static void migrate(String passKey) {
final boolean[] status = {false};
try {
SQLiteDatabaseHook hook = new SQLiteDatabaseHook() {
public void preKey(SQLiteDatabase database) {
}
public void postKey(SQLiteDatabase database) {
String value = QueryHelper.singleValueFromQuery(database, "PRAGMA cipher_migrate");
status[0] = Integer.parseInt(value) == 0;
}
};
SQLiteDatabase database = SQLiteDatabase.openOrCreateDatabase(MyApp.dbFile,
passKey, null, hook);
database.close();
} catch (Exception e) {
Log.i(TAG, "error", e);
}
}