summaryrefslogtreecommitdiff
path: root/app/src/production/java
diff options
context:
space:
mode:
authorcyBerta <cyberta@riseup.net>2019-08-01 23:25:01 +0200
committercyBerta <cyberta@riseup.net>2019-08-02 01:49:37 +0200
commit3875f27f432c4327f3b4c068622986d13432c80c (patch)
tree8552fe3b8bb5ac8338289ffba88b9a7be234ff48 /app/src/production/java
parentf9cc2de8be331cf3eeb1efefea5fa6ecfda41d72 (diff)
add provider/gateway setup infos to LogView in debug builds
Diffstat (limited to 'app/src/production/java')
-rw-r--r--app/src/production/java/se/leap/bitmaskclient/ProviderApiManager.java14
1 files changed, 13 insertions, 1 deletions
diff --git a/app/src/production/java/se/leap/bitmaskclient/ProviderApiManager.java b/app/src/production/java/se/leap/bitmaskclient/ProviderApiManager.java
index 6d9671b1..41c51dc9 100644
--- a/app/src/production/java/se/leap/bitmaskclient/ProviderApiManager.java
+++ b/app/src/production/java/se/leap/bitmaskclient/ProviderApiManager.java
@@ -29,6 +29,7 @@ import java.io.IOException;
import java.net.URL;
import java.util.List;
+import de.blinkt.openvpn.core.VpnStatus;
import okhttp3.OkHttpClient;
import se.leap.bitmaskclient.eip.EIP;
import se.leap.bitmaskclient.utils.ConfigHelper;
@@ -134,6 +135,9 @@ public class ProviderApiManager extends ProviderApiManagerBase {
return result;
}
+ if (BuildConfig.DEBUG) {
+ VpnStatus.logDebug("PROVIDER JSON: " + providerDotJsonString);
+ }
try {
JSONObject providerJson = new JSONObject(providerDotJsonString);
if (provider.define(providerJson)) {
@@ -163,7 +167,9 @@ public class ProviderApiManager extends ProviderApiManagerBase {
String eipServiceUrl = providerJson.getString(Provider.API_URL) + "/" + providerJson.getString(Provider.API_VERSION) + "/" + EIP.SERVICE_API_PATH;
eipServiceJsonString = downloadWithProviderCA(provider.getCaCert(), eipServiceUrl);
JSONObject eipServiceJson = new JSONObject(eipServiceJsonString);
-
+ if (BuildConfig.DEBUG) {
+ VpnStatus.logDebug("EIP SERVICE JSON: " + eipServiceJsonString);
+ }
provider.setEipServiceJson(eipServiceJson);
result.putBoolean(BROADCAST_RESULT_KEY, true);
@@ -187,6 +193,9 @@ public class ProviderApiManager extends ProviderApiManagerBase {
URL newCertStringUrl = new URL(provider.getApiUrlWithVersion() + "/" + PROVIDER_VPN_CERTIFICATE);
String certString = downloadWithProviderCA(provider.getCaCert(), newCertStringUrl.toString());
+ if (BuildConfig.DEBUG) {
+ VpnStatus.logDebug("VPN CERT: " + certString);
+ }
if (ConfigHelper.checkErroneousDownload(certString)) {
if (certString == null || certString.isEmpty()) {
// probably 204
@@ -217,6 +226,9 @@ public class ProviderApiManager extends ProviderApiManagerBase {
if (validCertificate(provider, certString)) {
provider.setCaCert(certString);
preferences.edit().putString(Provider.CA_CERT + "." + providerDomain, certString).apply();
+ if (BuildConfig.DEBUG) {
+ VpnStatus.logDebug("CA CERT: " + certString);
+ }
result.putBoolean(BROADCAST_RESULT_KEY, true);
} else {
setErrorResult(result, warning_corrupted_provider_cert, ERROR_CERTIFICATE_PINNING.toString());