aboutsummaryrefslogtreecommitdiffstats
path: root/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider
diff options
context:
space:
mode:
authorVincent Breitmoser <valodim@mugenguild.com>2015-11-15 03:10:30 +0100
committerVincent Breitmoser <valodim@mugenguild.com>2015-11-15 03:10:30 +0100
commita41e6e0c705e8c927d1f905fad9b36e810dc5acc (patch)
treeaf6c1e991b44aeb58304dc7a541af90e02aad5eb /OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider
parentabfa7d743cf159a25f54ddcdc84d375c7a9df21e (diff)
downloadopen-keychain-a41e6e0c705e8c927d1f905fad9b36e810dc5acc.tar.gz
open-keychain-a41e6e0c705e8c927d1f905fad9b36e810dc5acc.tar.bz2
open-keychain-a41e6e0c705e8c927d1f905fad9b36e810dc5acc.zip
allow database downgrade for debug builds
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider')
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/KeychainDatabase.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/KeychainDatabase.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/KeychainDatabase.java
index ff5e64bb6..56081dab9 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/KeychainDatabase.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/KeychainDatabase.java
@@ -320,6 +320,10 @@ public class KeychainDatabase extends SQLiteOpenHelper {
@Override
public void onDowngrade(SQLiteDatabase db, int oldVersion, int newVersion) {
+ // Downgrade is ok for the debug version, makes it easier to work with branches
+ if (Constants.DEBUG) {
+ return;
+ }
// NOTE: downgrading the database is explicitly not allowed to prevent
// someone from exploiting old bugs to export the database
throw new RuntimeException("Downgrading the database is not allowed!");