From 454e755d71b7c7a3f62bc1f6ab76b860fa4dfb3d Mon Sep 17 00:00:00 2001 From: cyBerta Date: Sun, 6 Oct 2019 00:18:20 +0200 Subject: show error dialog if no valid gateway configuration can be found for a provider --- app/src/main/java/se/leap/bitmaskclient/eip/EIP.java | 8 +++++++- app/src/main/res/values/strings.xml | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'app') diff --git a/app/src/main/java/se/leap/bitmaskclient/eip/EIP.java b/app/src/main/java/se/leap/bitmaskclient/eip/EIP.java index 19c539e8..474e639e 100644 --- a/app/src/main/java/se/leap/bitmaskclient/eip/EIP.java +++ b/app/src/main/java/se/leap/bitmaskclient/eip/EIP.java @@ -77,6 +77,7 @@ import static se.leap.bitmaskclient.Constants.PROVIDER_VPN_CERTIFICATE; import static se.leap.bitmaskclient.Constants.SHARED_PREFERENCES; import static se.leap.bitmaskclient.MainActivityErrorDialog.DOWNLOAD_ERRORS.ERROR_INVALID_VPN_CERTIFICATE; import static se.leap.bitmaskclient.R.string.vpn_certificate_is_invalid; +import static se.leap.bitmaskclient.R.string.warning_client_parsing_error_gateways; import static se.leap.bitmaskclient.utils.ConfigHelper.ensureNotOnMainThread; import static se.leap.bitmaskclient.utils.PreferenceHelper.getUsePluggableTransports; @@ -206,6 +207,12 @@ public final class EIP extends JobIntentService implements Observer { } GatewaysManager gatewaysManager = gatewaysFromPreferences(); + if (gatewaysManager.isEmpty()) { + setErrorResult(result, warning_client_parsing_error_gateways, null); + tellToReceiverOrBroadcast(EIP_ACTION_START, RESULT_CANCELED, result); + return; + } + Gateway gateway = gatewaysManager.select(nClosestGateway); if (launchActiveGateway(gateway, nClosestGateway)) { @@ -377,7 +384,6 @@ public final class EIP extends JobIntentService implements Observer { result.putBoolean(BROADCAST_RESULT_KEY, false); } - /** * disable Bitmask starting on after phone reboot * then stop VPN diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 27f508d5..be763133 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -94,6 +94,7 @@ Update certificate Updating provider configuration failed. Updating provider configuration failed. Please log in to try again. + The provider gateways could not be recognized. They may be configured incorrectly. Stored provider details are corrupted. You can either update %s (recommended) or update the provider details using a commercial CA certificate. Stored provider certificate is invalid. You can either update %s (recommended) or update the provider certificate using a commercial CA certificate. Stored provider certificate is expired. You can either update %s (recommended) or update the provider certificate using a commercial CA certificate. -- cgit v1.2.3