From 6dfb02da9cd6c28b8a3016cf78454add6408c13d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Parm=C3=A9nides=20GV?= Date: Tue, 3 Dec 2013 22:26:31 +0100 Subject: Vpn profiles get updated after switching provider. parsedEipSerial wasn't being reset after switching provider, so updating gateways thought there was no real update. After switching provider, we also remove all other vpn profiles. --- src/se/leap/bitmaskclient/EIP.java | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/se/leap/bitmaskclient/EIP.java') diff --git a/src/se/leap/bitmaskclient/EIP.java b/src/se/leap/bitmaskclient/EIP.java index 22f7558d..13261e29 100644 --- a/src/se/leap/bitmaskclient/EIP.java +++ b/src/se/leap/bitmaskclient/EIP.java @@ -252,10 +252,19 @@ public final class EIP extends IntentService { private void updateEIPService() { try { eipDefinition = ConfigHelper.getJsonFromSharedPref(EIP.KEY); + parsedEipSerial = ConfigHelper.getIntFromSharedPref(PARSED_SERIAL); } catch (JSONException e) { // TODO Auto-generated catch block e.printStackTrace(); } + if(parsedEipSerial == 0) { + // Delete all vpn profiles + ProfileManager vpl = ProfileManager.getInstance(context); + Collection profiles = vpl.getProfiles(); + for (VpnProfile profile : profiles){ + vpl.removeProfile(context, profile); + } + } if (eipDefinition.optInt("serial") > parsedEipSerial) updateGateways(); } -- cgit v1.2.3 From 017e493dc7c7e0565000d2afa76eb93c1fa5c2d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Parm=C3=A9nides=20GV?= Date: Tue, 3 Dec 2013 22:43:25 +0100 Subject: Active gateway is updated every eip start. --- src/se/leap/bitmaskclient/EIP.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/se/leap/bitmaskclient/EIP.java') diff --git a/src/se/leap/bitmaskclient/EIP.java b/src/se/leap/bitmaskclient/EIP.java index 13261e29..ec2f6972 100644 --- a/src/se/leap/bitmaskclient/EIP.java +++ b/src/se/leap/bitmaskclient/EIP.java @@ -214,8 +214,7 @@ public final class EIP extends IntentService { * Intent to {@link se.leap.openvpn.LaunchVPN} */ private void startEIP() { - if (activeGateway==null) - activeGateway = selectGateway(); + activeGateway = selectGateway(); Intent intent = new Intent(this,LaunchVPN.class); intent.setAction(Intent.ACTION_MAIN); -- cgit v1.2.3