summaryrefslogtreecommitdiff
path: root/app/src/insecure
diff options
context:
space:
mode:
authorcyBerta <cyberta@riseup.net>2018-01-10 17:14:45 +0100
committercyBerta <cyberta@riseup.net>2018-01-10 17:14:45 +0100
commitae8341cf1f563fbcf2bdd6a4eff9525f42e9e995 (patch)
tree43f7da97aa2d8dd1313fe90a69df93f7b96749f0 /app/src/insecure
parent0b647ea5e7ff67747080b2ffcebc948da0fbecb5 (diff)
8773 more test cases and clean-up
Diffstat (limited to 'app/src/insecure')
-rw-r--r--app/src/insecure/java/se/leap/bitmaskclient/ProviderApiManager.java11
1 files changed, 4 insertions, 7 deletions
diff --git a/app/src/insecure/java/se/leap/bitmaskclient/ProviderApiManager.java b/app/src/insecure/java/se/leap/bitmaskclient/ProviderApiManager.java
index 9c27fd1f..6105c4b7 100644
--- a/app/src/insecure/java/se/leap/bitmaskclient/ProviderApiManager.java
+++ b/app/src/insecure/java/se/leap/bitmaskclient/ProviderApiManager.java
@@ -49,11 +49,11 @@ import se.leap.bitmaskclient.eip.EIP;
import static android.text.TextUtils.isEmpty;
import static se.leap.bitmaskclient.DownloadFailedDialog.DOWNLOAD_ERRORS.ERROR_CERTIFICATE_PINNING;
-import static se.leap.bitmaskclient.DownloadFailedDialog.DOWNLOAD_ERRORS.ERROR_CORRUPTED_PROVIDER_JSON;
import static se.leap.bitmaskclient.ProviderAPI.ERRORS;
import static se.leap.bitmaskclient.ProviderAPI.RESULT_KEY;
import static se.leap.bitmaskclient.R.string.certificate_error;
import static se.leap.bitmaskclient.R.string.malformed_url;
+import static se.leap.bitmaskclient.R.string.warning_corrupted_provider_cert;
/**
* Created by cyberta on 04.01.18.
@@ -89,8 +89,7 @@ public class ProviderApiManager extends ProviderApiManagerBase {
"";
if (isEmpty(lastProviderMainUrl)) {
- currentDownload.putBoolean(RESULT_KEY, false);
- setErrorResult(currentDownload, resources.getString(R.string.malformed_url), null);
+ setErrorResult(currentDownload, malformed_url, null);
return currentDownload;
}
@@ -260,12 +259,10 @@ public class ProviderApiManager extends ProviderApiManagerBase {
preferences.edit().putString(Provider.CA_CERT + "." + providerDomain, certString).commit();
result.putBoolean(RESULT_KEY, true);
} else {
- setErrorResult(result, resources.getString(R.string.warning_corrupted_provider_cert), ERROR_CERTIFICATE_PINNING.toString());
- result.putBoolean(RESULT_KEY, false);
+ setErrorResult(result, warning_corrupted_provider_cert, ERROR_CERTIFICATE_PINNING.toString());
}
} catch (JSONException e) {
- setErrorResult(result, resources.getString(malformed_url), null);
- result.putBoolean(RESULT_KEY, false);
+ setErrorResult(result, malformed_url, null);
}
return result;