From df64d965a0ed4dc91962ee533b51b2d2d52cb72f Mon Sep 17 00:00:00 2001 From: Alexander Date: Sun, 20 May 2018 17:50:27 +0300 Subject: [PATCH] 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. --- .../java/eu/siacs/conversations/persistance/DatabaseBackend.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/eu/siacs/conversations/persistance/DatabaseBackend.java b/src/main/java/eu/siacs/conversations/persistance/DatabaseBackend.java index 3fd34d5ca..35f4bef3a 100644 --- a/src/main/java/eu/siacs/conversations/persistance/DatabaseBackend.java +++ b/src/main/java/eu/siacs/conversations/persistance/DatabaseBackend.java @@ -190,6 +190,7 @@ public class DatabaseBackend extends SQLiteOpenHelper { @Override public void onConfigure(SQLiteDatabase db) { db.execSQL("PRAGMA foreign_keys=ON"); + db.execSQL("PRAGMA secure_delete=ON"); } @Override