summaryrefslogtreecommitdiff
path: root/app/src/main
diff options
context:
space:
mode:
authorcyBerta <cyberta@riseup.net>2022-05-20 13:03:25 +0200
committercyBerta <cyberta@riseup.net>2022-05-20 13:03:25 +0200
commit840fc607b987825f2b362ae6838d42ef4fda5e7b (patch)
tree322ecc9e64d2c615d97152384c842248ed5694fe /app/src/main
parent2ba5e0faa0e576703fa80b36a480e93a0a7a26b6 (diff)
show error message if tor failed to start during the VPN certificate update
Diffstat (limited to 'app/src/main')
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/base/MainActivity.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/base/MainActivity.java b/app/src/main/java/se/leap/bitmaskclient/base/MainActivity.java
index e9a5032c..8cb12652 100644
--- a/app/src/main/java/se/leap/bitmaskclient/base/MainActivity.java
+++ b/app/src/main/java/se/leap/bitmaskclient/base/MainActivity.java
@@ -49,6 +49,8 @@ import se.leap.bitmaskclient.eip.EIP;
import se.leap.bitmaskclient.eip.EipCommand;
import se.leap.bitmaskclient.eip.EipSetupListener;
import se.leap.bitmaskclient.eip.EipSetupObserver;
+import se.leap.bitmaskclient.eip.EipStatus;
+import se.leap.bitmaskclient.providersetup.ProviderAPI;
import se.leap.bitmaskclient.providersetup.activities.LoginActivity;
import se.leap.bitmaskclient.providersetup.models.LeapSRPSession;
@@ -74,6 +76,9 @@ import static se.leap.bitmaskclient.providersetup.ProviderAPI.ERRORID;
import static se.leap.bitmaskclient.providersetup.ProviderAPI.ERRORS;
import static se.leap.bitmaskclient.providersetup.ProviderAPI.INCORRECTLY_DOWNLOADED_EIP_SERVICE;
import static se.leap.bitmaskclient.providersetup.ProviderAPI.INCORRECTLY_UPDATED_INVALID_VPN_CERTIFICATE;
+import static se.leap.bitmaskclient.providersetup.ProviderAPI.TOR_EXCEPTION;
+import static se.leap.bitmaskclient.providersetup.ProviderAPI.TOR_TIMEOUT;
+import static se.leap.bitmaskclient.providersetup.ProviderAPI.UPDATE_INVALID_VPN_CERTIFICATE;
import static se.leap.bitmaskclient.providersetup.ProviderAPI.USER_MESSAGE;
@@ -303,6 +308,19 @@ public class MainActivity extends AppCompatActivity implements EipSetupListener,
askUserToLogIn(getString(vpn_certificate_user_message));
}
break;
+ case TOR_TIMEOUT:
+ case TOR_EXCEPTION:
+ try {
+ Bundle resultData = intent.getParcelableExtra(BROADCAST_RESULT_KEY);
+ JSONObject jsonObject = new JSONObject(resultData.getString(ProviderAPI.ERRORS));
+ String initialAction = jsonObject.optString(ProviderAPI.INITIAL_ACTION);
+ if (UPDATE_INVALID_VPN_CERTIFICATE.equals(initialAction)) {
+ showMainActivityErrorDialog(getString(downloading_vpn_certificate_failed));
+ }
+ } catch (Exception e) {
+ //ignore
+ }
+ break;
}
}