explicitly set secure_delete pragma for SQLite database (#3039)

Conversations stores sensitive data, such as SQLiteAxolotlStore tables, in its database.

secure_delete=ON is the default for newer Android devices:
https://android-review.googlesource.com/c/platform/external/sqlite/+/209123

However, older devices had it disabled by default, so any database created than has this setting disabled and it will not be updated automatically.

Also, the default might be changed in the future (for example, to "FAST", added in 2017), so it is safer to set it explicitly.
This commit is contained in:
Alexander 2018-05-20 17:50:27 +03:00 committed by Daniel Gultsch
parent 219ca9f72b
commit df64d965a0

View file

@ -190,6 +190,7 @@ public class DatabaseBackend extends SQLiteOpenHelper {
@Override @Override
public void onConfigure(SQLiteDatabase db) { public void onConfigure(SQLiteDatabase db) {
db.execSQL("PRAGMA foreign_keys=ON"); db.execSQL("PRAGMA foreign_keys=ON");
db.execSQL("PRAGMA secure_delete=ON");
} }
@Override @Override