summaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/java')
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/eip/EIP.java1
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/eip/GatewaysManager.java11
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/eip/VpnConfigGenerator.java2
3 files changed, 10 insertions, 4 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/eip/EIP.java b/app/src/main/java/se/leap/bitmaskclient/eip/EIP.java
index 5b72a4e7..eb83814a 100644
--- a/app/src/main/java/se/leap/bitmaskclient/eip/EIP.java
+++ b/app/src/main/java/se/leap/bitmaskclient/eip/EIP.java
@@ -170,6 +170,7 @@ public final class EIP extends IntentService {
}
private void updateGateways() {
+ gateways_manager.clearGatewaysAndProfiles();
gateways_manager.fromEipServiceJson(eip_definition);
gatewaysToPreferences();
}
diff --git a/app/src/main/java/se/leap/bitmaskclient/eip/GatewaysManager.java b/app/src/main/java/se/leap/bitmaskclient/eip/GatewaysManager.java
index f41049c5..6a7e3d0b 100644
--- a/app/src/main/java/se/leap/bitmaskclient/eip/GatewaysManager.java
+++ b/app/src/main/java/se/leap/bitmaskclient/eip/GatewaysManager.java
@@ -143,15 +143,20 @@ public class GatewaysManager {
return result;
}
+ protected void clearGatewaysAndProfiles() {
+ gateways.clear();
+ ArrayList<VpnProfile> profiles = new ArrayList<>(profile_manager.getProfiles());
+ for (VpnProfile profile : profiles) {
+ profile_manager.removeProfile(context, profile);
+ }
+ }
+
private void addGateway(Gateway gateway) {
removeDuplicatedGateway(gateway);
-
gateways.add(gateway);
VpnProfile profile = gateway.getProfile();
profile_manager.addProfile(profile);
- //profile_manager.saveProfile(context, profile);
- //profile_manager.saveProfileList(context);
}
private void removeDuplicatedGateway(Gateway gateway) {
diff --git a/app/src/main/java/se/leap/bitmaskclient/eip/VpnConfigGenerator.java b/app/src/main/java/se/leap/bitmaskclient/eip/VpnConfigGenerator.java
index 0b9c5832..10a95dfb 100644
--- a/app/src/main/java/se/leap/bitmaskclient/eip/VpnConfigGenerator.java
+++ b/app/src/main/java/se/leap/bitmaskclient/eip/VpnConfigGenerator.java
@@ -56,7 +56,7 @@ public class VpnConfigGenerator {
String key = keys.next().toString();
common_options += key + " ";
- for (String word : general_configuration.getString(key).split(" "))
+ for (String word : String.valueOf(general_configuration.get(key)).split(" "))
common_options += word + " ";
common_options += new_line;