summaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
authorFup Duck <fupduck@sacknagel.com>2018-02-12 13:31:13 +0100
committerFup Duck <fupduck@sacknagel.com>2018-02-12 13:31:13 +0100
commite9d3260f6439c4b00c6708658d6edd61a246ea67 (patch)
treef7ec4cc9ec9229e6e17cdc3ce6365b2e623f4d4e /app/src/main/java
parentfde2fbd9de3b014bd77a517b2cb7faf7beb4a560 (diff)
8827 - fix equals for Provider
Diffstat (limited to 'app/src/main/java')
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/DefaultedURL.java9
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/Provider.java4
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/ProviderApiManagerBase.java1
3 files changed, 11 insertions, 3 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/DefaultedURL.java b/app/src/main/java/se/leap/bitmaskclient/DefaultedURL.java
index 57ff1fd8..0cbb0d72 100644
--- a/app/src/main/java/se/leap/bitmaskclient/DefaultedURL.java
+++ b/app/src/main/java/se/leap/bitmaskclient/DefaultedURL.java
@@ -36,4 +36,13 @@ public class DefaultedURL {
public String toString() {
return url.toString();
}
+
+ @Override
+ public boolean equals(Object o) {
+ if (o instanceof DefaultedURL) {
+ return url.equals(((DefaultedURL) o).getUrl());
+ }
+ return false;
+ }
+
}
diff --git a/app/src/main/java/se/leap/bitmaskclient/Provider.java b/app/src/main/java/se/leap/bitmaskclient/Provider.java
index 4937ed58..7aa2f398 100644
--- a/app/src/main/java/se/leap/bitmaskclient/Provider.java
+++ b/app/src/main/java/se/leap/bitmaskclient/Provider.java
@@ -287,8 +287,8 @@ public final class Provider implements Parcelable {
if (o instanceof Provider) {
Provider p = (Provider) o;
return p.getDomain().equals(getDomain()) &&
- definition.equals(p.getDefinition()) &&
- eipServiceJson.equals(p.getEipServiceJson())&&
+ definition.toString().equals(p.getDefinition().toString()) &&
+ eipServiceJson.toString().equals(p.getEipServiceJson().toString())&&
mainUrl.equals(p.getMainUrl()) &&
apiUrl.equals(p.getApiUrl()) &&
certificatePin.equals(p.getCertificatePin()) &&
diff --git a/app/src/main/java/se/leap/bitmaskclient/ProviderApiManagerBase.java b/app/src/main/java/se/leap/bitmaskclient/ProviderApiManagerBase.java
index 09e0faa8..f4fee635 100644
--- a/app/src/main/java/se/leap/bitmaskclient/ProviderApiManagerBase.java
+++ b/app/src/main/java/se/leap/bitmaskclient/ProviderApiManagerBase.java
@@ -660,7 +660,6 @@ public abstract class ProviderApiManagerBase {
if (hasUpdatedProviderDetails(providerDomain)) {
provider.setCaCert(getPersistedProviderCA(providerDomain));
provider.define(getPersistedProviderDefinition(providerDomain));
- provider.setCaCertFingerprint(getPersistedCaCertFingerprint(providerDomain));
provider.setPrivateKey(getPersistedPrivateKey(providerDomain));
provider.setVpnCertificate(getPersistedVPNCertificate(providerDomain));
}