From 9e6fe0e215e32343b38cdf20080de209a31287dd Mon Sep 17 00:00:00 2001 From: Fup Duck Date: Fri, 9 Feb 2018 12:46:06 +0100 Subject: 8827 - merge request discussions * add NullPointer checks to EipFragment * add Provider to DownloadFailedDialog * remove unused code * store certificates for pinning in SharedPreferences --- app/src/insecure/java/se/leap/bitmaskclient/ProviderApiManager.java | 6 ++---- .../insecure/java/se/leap/bitmaskclient/ProviderListActivity.java | 3 ++- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'app/src/insecure/java/se/leap') 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()); -- cgit v1.2.3