summaryrefslogtreecommitdiff
path: root/app/src/main/java/se/leap/bitmaskclient/base/models
diff options
context:
space:
mode:
authorcyBerta <cyberta@riseup.net>2022-07-18 18:29:15 +0200
committercyBerta <cyberta@riseup.net>2022-07-18 18:29:15 +0200
commitb9e1f2354520e37f0e2784f156f1288e55e1a993 (patch)
tree8d85663166c1f5772361f77f3cac71d3dc365102 /app/src/main/java/se/leap/bitmaskclient/base/models
parent0ebc7e3a9e84f598a0221fe64f51d0e7906ac377 (diff)
update soon expiring vpn certificates after connecting to the VPN
Diffstat (limited to 'app/src/main/java/se/leap/bitmaskclient/base/models')
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/base/models/Provider.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/base/models/Provider.java b/app/src/main/java/se/leap/bitmaskclient/base/models/Provider.java
index 974aef80..02a9694a 100644
--- a/app/src/main/java/se/leap/bitmaskclient/base/models/Provider.java
+++ b/app/src/main/java/se/leap/bitmaskclient/base/models/Provider.java
@@ -63,6 +63,7 @@ public final class Provider implements Parcelable {
private String vpnCertificate = "";
private long lastEipServiceUpdate = 0L;
private long lastGeoIpUpdate = 0L;
+ private boolean shouldUpdateVpnCertificate;
private boolean allowAnonymous;
private boolean allowRegistered;
@@ -361,6 +362,7 @@ public final class Provider implements Parcelable {
parcel.writeString(getVpnCertificate());
parcel.writeLong(lastEipServiceUpdate);
parcel.writeLong(lastGeoIpUpdate);
+ parcel.writeInt(shouldUpdateVpnCertificate ? 0 : 1);
}
@@ -407,6 +409,7 @@ public final class Provider implements Parcelable {
}
this.lastEipServiceUpdate = in.readLong();
this.lastGeoIpUpdate = in.readLong();
+ this.shouldUpdateVpnCertificate = in.readInt() == 0;
} catch (MalformedURLException | JSONException e) {
e.printStackTrace();
}
@@ -492,6 +495,13 @@ public final class Provider implements Parcelable {
return System.currentTimeMillis() - lastEipServiceUpdate >= EIP_SERVICE_TIMEOUT;
}
+ public void setShouldUpdateVpnCertificate(Boolean update) {
+ shouldUpdateVpnCertificate = update;
+ }
+
+ public boolean shouldUpdateVpnCertificate() {
+ return shouldUpdateVpnCertificate;
+ }
public void setLastGeoIpUpdate(long timestamp) {
lastGeoIpUpdate = timestamp;