summaryrefslogtreecommitdiff
path: root/app/src/main/java/se/leap
diff options
context:
space:
mode:
authorcyberta <cyberta@riseup.net>2020-01-23 01:08:15 -0600
committercyberta <cyberta@riseup.net>2020-01-23 01:08:15 -0600
commit584853ee94723e2fec102b1058984fdfc4aedc22 (patch)
tree9aa9994d7f31399bc1714c67edce42bc216abfda /app/src/main/java/se/leap
parente9b8f43f4ae597417eff986c50c1a3f30b0a39ee (diff)
save provider api ip to shared preferences
Diffstat (limited to 'app/src/main/java/se/leap')
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/utils/PreferenceHelper.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/utils/PreferenceHelper.java b/app/src/main/java/se/leap/bitmaskclient/utils/PreferenceHelper.java
index b6e39c50..a376ac69 100644
--- a/app/src/main/java/se/leap/bitmaskclient/utils/PreferenceHelper.java
+++ b/app/src/main/java/se/leap/bitmaskclient/utils/PreferenceHelper.java
@@ -48,6 +48,7 @@ public class PreferenceHelper {
try {
provider.setMainUrl(new URL(preferences.getString(Provider.MAIN_URL, "")));
provider.setProviderIp(preferences.getString(Provider.PROVIDER_IP, ""));
+ provider.setProviderApiIp(preferences.getString(Provider.PROVIDER_API_IP, ""));
provider.define(new JSONObject(preferences.getString(Provider.KEY, "")));
provider.setCaCert(preferences.getString(Provider.CA_CERT, ""));
provider.setVpnCertificate(preferences.getString(PROVIDER_VPN_CERTIFICATE, ""));
@@ -132,6 +133,7 @@ public class PreferenceHelper {
public static void storeProviderInPreferences(SharedPreferences preferences, Provider provider) {
preferences.edit().putBoolean(PROVIDER_CONFIGURED, true).
putString(Provider.PROVIDER_IP, provider.getProviderIp()).
+ putString(Provider.PROVIDER_API_IP, provider.getProviderApiIp()).
putString(Provider.MAIN_URL, provider.getMainUrlString()).
putString(Provider.KEY, provider.getDefinitionString()).
putString(Provider.CA_CERT, provider.getCaCert()).
@@ -143,6 +145,7 @@ public class PreferenceHelper {
String providerDomain = provider.getDomain();
preferences.edit().putBoolean(PROVIDER_CONFIGURED, true).
putString(Provider.PROVIDER_IP + "." + providerDomain, provider.getProviderIp()).
+ putString(Provider.PROVIDER_API_IP + "." + providerDomain, provider.getProviderApiIp()).
putString(Provider.MAIN_URL + "." + providerDomain, provider.getMainUrlString()).
putString(Provider.KEY + "." + providerDomain, provider.getDefinitionString()).
putString(Provider.CA_CERT + "." + providerDomain, provider.getCaCert()).
@@ -207,11 +210,9 @@ public class PreferenceHelper {
preferences.edit().
remove(Provider.KEY + "." + providerDomain).
remove(Provider.CA_CERT + "." + providerDomain).
- remove(Provider.CA_CERT_FINGERPRINT + "." + providerDomain).
remove(Provider.PROVIDER_IP + "." + providerDomain).
+ remove(Provider.PROVIDER_API_IP + "." + providerDomain).
remove(Provider.MAIN_URL + "." + providerDomain).
- remove(Provider.KEY + "." + providerDomain).
- remove(Provider.CA_CERT + "." + providerDomain).
remove(PROVIDER_EIP_DEFINITION + "." + providerDomain).
remove(PROVIDER_PRIVATE_KEY + "." + providerDomain).
remove(PROVIDER_VPN_CERTIFICATE + "." + providerDomain).