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; }