summaryrefslogtreecommitdiff
path: root/app/src/insecure/java
diff options
context:
space:
mode:
authorFup Duck <fupduck@sacknagel.com>2018-02-09 12:46:06 +0100
committerFup Duck <fupduck@sacknagel.com>2018-02-09 12:48:20 +0100
commit9e6fe0e215e32343b38cdf20080de209a31287dd (patch)
treed4a8bf8aa9fc7caf06486bd2342ef28007329618 /app/src/insecure/java
parent73854e7fcdab77eaa408741b7353dea35b4803e1 (diff)
8827 - merge request discussions
* add NullPointer checks to EipFragment * add Provider to DownloadFailedDialog * remove unused code * store certificates for pinning in SharedPreferences
Diffstat (limited to 'app/src/insecure/java')
-rw-r--r--app/src/insecure/java/se/leap/bitmaskclient/ProviderApiManager.java6
-rw-r--r--app/src/insecure/java/se/leap/bitmaskclient/ProviderListActivity.java3
2 files changed, 4 insertions, 5 deletions
diff --git a/app/src/insecure/java/se/leap/bitmaskclient/ProviderApiManager.java b/app/src/insecure/java/se/leap/bitmaskclient/ProviderApiManager.java
index 83a3044e..624b797b 100644
--- a/app/src/insecure/java/se/leap/bitmaskclient/ProviderApiManager.java
+++ b/app/src/insecure/java/se/leap/bitmaskclient/ProviderApiManager.java
@@ -174,10 +174,8 @@ public class ProviderApiManager extends ProviderApiManagerBase {
JSONObject providerDefinition = provider.getDefinition();
String eipServiceUrl = providerDefinition.getString(Provider.API_URL) + "/" + providerDefinition.getString(Provider.API_VERSION) + "/" + EIP.SERVICE_API_PATH;
eipServiceJsonString = downloadWithProviderCA(provider.getCaCert(), eipServiceUrl, lastDangerOn);
- JSONObject eipServiceJson = new JSONObject(eipServiceJsonString);
- eipServiceJson.getInt(Provider.API_RETURN_SERIAL);
- //preferences.edit().putString(PROVIDER_KEY, eipServiceJson.toString()).commit();
+ JSONObject eipServiceJson = new JSONObject(eipServiceJsonString);
provider.setEipServiceJson(eipServiceJson);
result.putBoolean(BROADCAST_RESULT_KEY, true);
@@ -285,7 +283,7 @@ public class ProviderApiManager extends ProviderApiManagerBase {
String responseString;
JSONObject errorJson = new JSONObject();
String baseUrl = getApiUrl(providerDefinition);
- OkHttpClient okHttpClient = clientGenerator.initSelfSignedCAHttpClient(errorJson, caCert);
+ OkHttpClient okHttpClient = clientGenerator.initSelfSignedCAHttpClient(caCert, errorJson);
if (okHttpClient == null) {
return errorJson.toString();
}
diff --git a/app/src/insecure/java/se/leap/bitmaskclient/ProviderListActivity.java b/app/src/insecure/java/se/leap/bitmaskclient/ProviderListActivity.java
index 554085b1..531c438a 100644
--- a/app/src/insecure/java/se/leap/bitmaskclient/ProviderListActivity.java
+++ b/app/src/insecure/java/se/leap/bitmaskclient/ProviderListActivity.java
@@ -17,6 +17,7 @@
package se.leap.bitmaskclient;
import android.os.Bundle;
+import android.support.annotation.NonNull;
import android.support.v4.app.DialogFragment;
import android.support.v4.app.FragmentTransaction;
@@ -99,7 +100,7 @@ public class ProviderListActivity extends ProviderListBaseActivity {
* Retrys setup of last used provider, allows bypassing ca certificate validation.
*/
@Override
- public void retrySetUpProvider(Provider provider) {
+ public void retrySetUpProvider(@NonNull Provider provider) {
cancelSettingUpProvider();
if (!provider.hasCaCert()) {
addAndSelectNewProvider(provider.getMainUrlString(), ProviderAPI.lastDangerOn());