summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcyberta <cyberta@riseup.net>2022-01-31 23:32:41 +0000
committercyberta <cyberta@riseup.net>2022-01-31 23:32:41 +0000
commite631257d3f0e55bfb77e32d25a798bd3d0d3ff25 (patch)
tree41796be8a9b56f5a66ab803b8a98a10f9d43f6af
parent77908103f7d6d5bd6c8bd20c8e2ca0c9ac45da4d (diff)
parent30cedf1f95f4f430ddc378d963e8cd46c1bd0903 (diff)
Merge branch 'update_tor-android-buildTools' into 'master'
Some cleanup See merge request leap/bitmask_android!167
-rw-r--r--.gitmodules2
-rw-r--r--app/build.gradle22
-rw-r--r--app/src/fatweb/java/se.leap.bitmaskclient/appUpdate/DownloadNotificationManager.java1
-rw-r--r--app/src/insecure/java/se/leap/bitmaskclient/providersetup/ProviderApiManager.java7
-rw-r--r--app/src/test/java/se/leap/bitmaskclient/eip/ProviderApiManagerTest.java4
m---------tor-android0
6 files changed, 20 insertions, 16 deletions
diff --git a/.gitmodules b/.gitmodules
index b8f0e8d3..eb8fc432 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -7,4 +7,4 @@
url = https://0xacab.org/leap/android_libs/bitmaskcore.git
[submodule "tor-android"]
path = tor-android
- url = https://0xacab.org/leap/android_snowflake/tor-android.git
+ url = https://0xacab.org/leap/android_libs/tor-android.git
diff --git a/app/build.gradle b/app/build.gradle
index 4d5ce050..df1634c7 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -6,6 +6,7 @@ apply plugin: 'com.android.application'
android {
compileSdkVersion 30
ndkVersion "21.4.7075529"
+ buildToolsVersion '30.0.3'
compileOptions {
targetCompatibility 1.8
@@ -369,21 +370,20 @@ android {
dependencies {
testImplementation 'junit:junit:4.12'
//outdated mockito-core version due to powermock dependency
- testImplementation 'org.mockito:mockito-core:2.8.9'
- testImplementation('org.powermock:powermock-api-mockito2:1.7.3')
- { exclude group: 'junit' exclude group: 'org.mockito' }
- testImplementation 'org.powermock:powermock-module-junit4:1.7.3'
- testImplementation 'org.powermock:powermock-core:1.7.3'
- testImplementation 'org.powermock:powermock-module-junit4-rule:1.7.3'
+ testImplementation 'org.mockito:mockito-core:3.6.0'
+ testImplementation('org.powermock:powermock-api-mockito2:2.0.9')
+ // { exclude group: 'junit' exclude group: 'org.mockito' }
+ testImplementation 'org.powermock:powermock-module-junit4:2.0.9'
+ testImplementation 'org.powermock:powermock-core:2.0.9'
+ testImplementation 'org.powermock:powermock-module-junit4-rule:2.0.9'
testImplementation group: 'com.tngtech.java', name: 'junit-dataprovider', version: '1.10.0'
- androidTestImplementation 'org.mockito:mockito-core:2.8.9'
- androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
- androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.1.0'
- androidTestImplementation 'androidx.test.espresso:espresso-intents:3.1.0'
+ androidTestImplementation 'org.mockito:mockito-core:3.6.0'
+ androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
+ androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.4.0'
+ androidTestImplementation 'androidx.test.espresso:espresso-intents:3.4.0'
//TODO: remove that library
androidTestImplementation 'com.jayway.android.robotium:robotium-solo:5.6.3'
- testImplementation 'junit:junit:4.12'
testImplementation 'org.json:json:20180813'
debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.6.2'
releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.6.2'
diff --git a/app/src/fatweb/java/se.leap.bitmaskclient/appUpdate/DownloadNotificationManager.java b/app/src/fatweb/java/se.leap.bitmaskclient/appUpdate/DownloadNotificationManager.java
index 939ed852..e7e871fd 100644
--- a/app/src/fatweb/java/se.leap.bitmaskclient/appUpdate/DownloadNotificationManager.java
+++ b/app/src/fatweb/java/se.leap.bitmaskclient/appUpdate/DownloadNotificationManager.java
@@ -23,6 +23,7 @@ import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
+import android.graphics.Color;
import android.os.Build;
import androidx.annotation.NonNull;
diff --git a/app/src/insecure/java/se/leap/bitmaskclient/providersetup/ProviderApiManager.java b/app/src/insecure/java/se/leap/bitmaskclient/providersetup/ProviderApiManager.java
index dfb5346b..221871ef 100644
--- a/app/src/insecure/java/se/leap/bitmaskclient/providersetup/ProviderApiManager.java
+++ b/app/src/insecure/java/se/leap/bitmaskclient/providersetup/ProviderApiManager.java
@@ -69,6 +69,7 @@ import static se.leap.bitmaskclient.base.utils.ConfigHelper.getProviderFormatted
import static se.leap.bitmaskclient.providersetup.ProviderAPI.ERRORS;
import static se.leap.bitmaskclient.providersetup.ProviderSetupFailedDialog.DOWNLOAD_ERRORS.ERROR_CERTIFICATE_PINNING;
import static se.leap.bitmaskclient.providersetup.ProviderSetupFailedDialog.DOWNLOAD_ERRORS.ERROR_CORRUPTED_PROVIDER_JSON;
+import static se.leap.bitmaskclient.tor.TorStatusObservable.getProxyPort;
/**
* Created by cyberta on 04.01.18.
@@ -325,7 +326,7 @@ public class ProviderApiManager extends ProviderApiManagerBase {
String responseString;
JSONObject errorJson = new JSONObject();
- OkHttpClient okHttpClient = clientGenerator.initCommercialCAHttpClient(errorJson);
+ OkHttpClient okHttpClient = clientGenerator.initCommercialCAHttpClient(errorJson, getProxyPort());
if (okHttpClient == null) {
return errorJson.toString();
}
@@ -360,7 +361,7 @@ public class ProviderApiManager extends ProviderApiManagerBase {
private String downloadFromUrlWithProviderCA(String urlString, Provider provider, boolean dangerOn) {
String responseString;
JSONObject errorJson = new JSONObject();
- OkHttpClient okHttpClient = clientGenerator.initSelfSignedCAHttpClient(provider.getCaCert(), errorJson);
+ OkHttpClient okHttpClient = clientGenerator.initSelfSignedCAHttpClient(provider.getCaCert(), getProxyPort(), errorJson);
if (okHttpClient == null) {
return errorJson.toString();
}
@@ -395,7 +396,7 @@ public class ProviderApiManager extends ProviderApiManagerBase {
JSONObject initError = new JSONObject();
String responseString;
- OkHttpClient okHttpClient = clientGenerator.initSelfSignedCAHttpClient(caCert, initError);
+ OkHttpClient okHttpClient = clientGenerator.initSelfSignedCAHttpClient(caCert, getProxyPort(), initError);
if (okHttpClient == null) {
return initError.toString();
}
diff --git a/app/src/test/java/se/leap/bitmaskclient/eip/ProviderApiManagerTest.java b/app/src/test/java/se/leap/bitmaskclient/eip/ProviderApiManagerTest.java
index 4b523edb..31d6ae89 100644
--- a/app/src/test/java/se/leap/bitmaskclient/eip/ProviderApiManagerTest.java
+++ b/app/src/test/java/se/leap/bitmaskclient/eip/ProviderApiManagerTest.java
@@ -439,7 +439,9 @@ public class ProviderApiManagerTest {
@Test
public void test_handleIntentSetupProvider_preseededCustomProviderAndCA_failedConfiguration() throws IOException, CertificateEncodingException, NoSuchAlgorithmException, JSONException {
-
+ if ("insecure".equals(BuildConfig.FLAVOR_implementation )) {
+ return;
+ }
Provider provider = getConfiguredProvider();
mockProviderApiConnector(ERROR_CASE_MICONFIGURED_PROVIDER);
diff --git a/tor-android b/tor-android
-Subproject 2ba958276d8dbbdfd5a003ed9423a2a74e643de
+Subproject 0173fc7610a69b8282ffad680e36f1105e872d6