aboutsummaryrefslogtreecommitdiffstats
path: root/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/Preferences.java
diff options
context:
space:
mode:
authormar-v-in <github@rvin.mooo.com>2014-06-24 11:26:52 +0200
committermar-v-in <github@rvin.mooo.com>2014-06-24 11:26:52 +0200
commit04e64ac84e6cda3da380905eb36e1aa50810226a (patch)
treed31511f278d1531120077a7fa33435bde04da919 /OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/Preferences.java
parentf039ef81aebcaed1f321baa7734d57b1e58ffb15 (diff)
downloadopen-keychain-04e64ac84e6cda3da380905eb36e1aa50810226a.tar.gz
open-keychain-04e64ac84e6cda3da380905eb36e1aa50810226a.tar.bz2
open-keychain-04e64ac84e6cda3da380905eb36e1aa50810226a.zip
Update Keyservers to use hkps as needed
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/Preferences.java')
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/Preferences.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/Preferences.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/Preferences.java
index c82c5e115..6f3d38ccd 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/Preferences.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/helper/Preferences.java
@@ -169,4 +169,22 @@ public class Preferences {
editor.putString(Constants.Pref.KEY_SERVERS, rawData);
editor.commit();
}
+
+ public void updateKeyServers() {
+ if (mSharedPreferences.getInt(Constants.Pref.KEY_SERVERS_DEFAULT_VERSION, 0) !=
+ Constants.Defaults.KEY_SERVERS_VERSION) {
+ String[] servers = getKeyServers();
+ for (int i = 0; i < servers.length; i++) {
+ if (servers[i].equals("pool.sks-keyservers.net")) {
+ servers[i] = "hkps://hkps.pool.sks-keyservers.net";
+ } else if (servers[i].equals("pgp.mit.edu")) {
+ servers[i] = "hkps://pgp.mit.edu";
+ }
+ }
+ setKeyServers(servers);
+ mSharedPreferences.edit()
+ .putInt(Constants.Pref.KEY_SERVERS_DEFAULT_VERSION, Constants.Defaults.KEY_SERVERS_VERSION)
+ .commit();
+ }
+ }
}