From 407e3767744e39a59845423246a9ad427d933304 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Parm=C3=A9nides=20GV?= Date: Fri, 2 Jan 2015 01:32:22 +0100 Subject: Update vpn profiles correctly. Before we add a new profile, we check if there are any duplicated ones with the same server IPs and ports. If they've the same credentials of the new one, we don't add anything; if not, we remove the old ones and add the new. --- app/src/main/java/se/leap/bitmaskclient/eip/Gateway.java | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'app/src/main/java/se/leap/bitmaskclient/eip/Gateway.java') diff --git a/app/src/main/java/se/leap/bitmaskclient/eip/Gateway.java b/app/src/main/java/se/leap/bitmaskclient/eip/Gateway.java index e23f67c7..005d0eec 100644 --- a/app/src/main/java/se/leap/bitmaskclient/eip/Gateway.java +++ b/app/src/main/java/se/leap/bitmaskclient/eip/Gateway.java @@ -25,6 +25,7 @@ import org.json.JSONException; import org.json.JSONObject; import java.io.IOException; +import java.io.Serializable; import java.io.StringReader; import java.util.Collection; import java.util.Iterator; @@ -42,7 +43,7 @@ import se.leap.bitmaskclient.Dashboard; * @author Sean Leonard * @author Parménides GV */ -public class Gateway { +public class Gateway implements Serializable { private String TAG = Gateway.class.getSimpleName(); @@ -137,16 +138,4 @@ public class Gateway { public int getTimezone() { return timezone; } - - @Override - public boolean equals(Object o) { - if(o instanceof Gateway) { - VpnProfile compared_profile = ((Gateway) o).getProfile(); - return compared_profile.mConnections.equals(mVpnProfile.mConnections) - && compared_profile.mClientCertFilename != mVpnProfile.mClientCertFilename - && compared_profile.mClientKeyFilename != mVpnProfile.mClientKeyFilename; - } - else - return super.equals(o); - } } -- cgit v1.2.3