diff options
author | cyBerta <cyberta@riseup.net> | 2022-05-17 15:54:22 +0200 |
---|---|---|
committer | cyBerta <cyberta@riseup.net> | 2022-05-18 10:46:21 +0200 |
commit | 8301b4bc5b24561b77d3381ea2e8ff8c72368669 (patch) | |
tree | 1cebba44623701c0ff83ab114916e2e31de3bf7c /app/src/main/java/se/leap/bitmaskclient/eip | |
parent | 18d3cc0ccbaf3bb9e797fcd542d180669b92dbd8 (diff) |
use snowflake if necessary to update invalid vpn cert. Show cert update message in UI
Diffstat (limited to 'app/src/main/java/se/leap/bitmaskclient/eip')
-rw-r--r-- | app/src/main/java/se/leap/bitmaskclient/eip/EipSetupObserver.java | 10 | ||||
-rw-r--r-- | app/src/main/java/se/leap/bitmaskclient/eip/EipStatus.java | 10 |
2 files changed, 19 insertions, 1 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/eip/EipSetupObserver.java b/app/src/main/java/se/leap/bitmaskclient/eip/EipSetupObserver.java index 813b8b62..c71a028d 100644 --- a/app/src/main/java/se/leap/bitmaskclient/eip/EipSetupObserver.java +++ b/app/src/main/java/se/leap/bitmaskclient/eip/EipSetupObserver.java @@ -201,6 +201,10 @@ public class EipSetupObserver extends BroadcastReceiver implements VpnStatus.Sta ProviderObservable.getInstance().updateProvider(provider); PreferenceHelper.storeProviderInPreferences(preferences, provider); EipCommand.startVPN(context, false); + EipStatus.getInstance().setUpdatingVpnCert(false); + if (TorStatusObservable.getStatus() != OFF) { + TorServiceCommand.stopTorServiceAsync(context); + } break; case CORRECTLY_DOWNLOADED_GEOIP_JSON: provider = resultData.getParcelable(PROVIDER_KEY); @@ -211,8 +215,12 @@ public class EipSetupObserver extends BroadcastReceiver implements VpnStatus.Sta case INCORRECTLY_DOWNLOADED_GEOIP_JSON: maybeStartEipService(resultData); break; - case PROVIDER_NOK: case INCORRECTLY_UPDATED_INVALID_VPN_CERTIFICATE: + EipStatus.getInstance().setUpdatingVpnCert(false); + if (TorStatusObservable.getStatus() != OFF) { + TorServiceCommand.stopTorServiceAsync(context); + } + case PROVIDER_NOK: case INCORRECTLY_DOWNLOADED_EIP_SERVICE: case INCORRECTLY_DOWNLOADED_VPN_CERTIFICATE: if (TorStatusObservable.getStatus() != OFF) { diff --git a/app/src/main/java/se/leap/bitmaskclient/eip/EipStatus.java b/app/src/main/java/se/leap/bitmaskclient/eip/EipStatus.java index bc123683..003e396f 100644 --- a/app/src/main/java/se/leap/bitmaskclient/eip/EipStatus.java +++ b/app/src/main/java/se/leap/bitmaskclient/eip/EipStatus.java @@ -56,6 +56,7 @@ public class EipStatus extends Observable implements VpnStatus.StateListener { private int lastErrorLine = 0; private String state, logMessage; private int localizedResId; + private boolean isUpdatingVPNCertificate; public static EipStatus getInstance() { if (currentStatus == null) { @@ -178,6 +179,15 @@ public class EipStatus extends Observable implements VpnStatus.StateListener { } } + public void setUpdatingVpnCert(boolean isUpdating) { + isUpdatingVPNCertificate = isUpdating; + refresh(); + } + + public boolean isUpdatingVpnCert() { + return isUpdatingVPNCertificate; + } + public boolean isConnecting() { return currentEipLevel == EipLevel.CONNECTING; } |