summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcyBerta <cyberta@riseup.net>2019-10-06 00:18:20 +0200
committercyBerta <cyberta@riseup.net>2019-10-06 00:18:20 +0200
commit454e755d71b7c7a3f62bc1f6ab76b860fa4dfb3d (patch)
tree8e57a517c2234b14c9c4c4a84acf248e8ef2651b
parentc637bffe1c9843b9de7366eee3584c51360e3867 (diff)
show error dialog if no valid gateway configuration can be found for a provider
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/eip/EIP.java8
-rw-r--r--app/src/main/res/values/strings.xml1
2 files changed, 8 insertions, 1 deletions
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 @@
<string name="update_certificate">Update certificate</string>
<string name="warning_eip_json_corrupted">Updating provider configuration failed.</string>
<string name="eip_json_corrupted_user_message">Updating provider configuration failed. Please log in to try again.</string>
+ <string name="warning_client_parsing_error_gateways">The provider gateways could not be recognized. They may be configured incorrectly.</string>
<string name="warning_corrupted_provider_details">Stored provider details are corrupted. You can either update %s (recommended) or update the provider details using a commercial CA certificate.</string>
<string name="warning_corrupted_provider_cert">Stored provider certificate is invalid. You can either update %s (recommended) or update the provider certificate using a commercial CA certificate.</string>
<string name="warning_expired_provider_cert">Stored provider certificate is expired. You can either update %s (recommended) or update the provider certificate using a commercial CA certificate.</string>