From 3bceb0d8ec4f07a6f10ee8979cd6b6db531f96b9 Mon Sep 17 00:00:00 2001 From: Moxie Marlinspike Date: Wed, 4 Apr 2018 05:09:43 -0700 Subject: [PATCH] Delete old message DB --- .../thoughtcrime/securesms/DatabaseUpgradeActivity.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/org/thoughtcrime/securesms/DatabaseUpgradeActivity.java b/src/org/thoughtcrime/securesms/DatabaseUpgradeActivity.java index 0e0ca86e3e..dac892c6e2 100644 --- a/src/org/thoughtcrime/securesms/DatabaseUpgradeActivity.java +++ b/src/org/thoughtcrime/securesms/DatabaseUpgradeActivity.java @@ -76,6 +76,7 @@ public class DatabaseUpgradeActivity extends BaseActivity { public static final int PERSISTENT_BLOBS = 317; public static final int INTERNALIZE_CONTACTS = 317; public static final int SQLCIPHER = 334; + public static final int SQLCIPHER_COMPLETE = 352; private static final SortedSet UPGRADE_VERSIONS = new TreeSet() {{ add(NO_MORE_KEY_EXCHANGE_PREFIX_VERSION); @@ -94,6 +95,7 @@ public class DatabaseUpgradeActivity extends BaseActivity { add(INTERNALIZE_CONTACTS); add(PERSISTENT_BLOBS); add(SQLCIPHER); + add(SQLCIPHER_COMPLETE); }}; private MasterSecret masterSecret; @@ -277,6 +279,11 @@ public class DatabaseUpgradeActivity extends BaseActivity { scheduleMessagesInPushDatabase(context); } + if (params[0] < SQLCIPHER_COMPLETE) { + File file = context.getDatabasePath("messages.db"); + if (file != null && file.exists()) file.delete(); + } + return null; }