From e03c4b04d5a4be689827b10b86d1dc92dbd3db8a Mon Sep 17 00:00:00 2001 From: Eugene Fryntov Date: Mon, 25 Apr 2022 09:14:53 -0400 Subject: [PATCH 1/3] Add a rule to keep ca.psiphon.* classes to Android library build. --- MobileLibrary/Android/make.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MobileLibrary/Android/make.bash b/MobileLibrary/Android/make.bash index ad2e724f1..61105526f 100755 --- a/MobileLibrary/Android/make.bash +++ b/MobileLibrary/Android/make.bash @@ -119,7 +119,7 @@ fi cd - cd build-tmp/psi -echo -e "-keep class psi.** { *; }\n" >> proguard.txt +echo -e "-keep class psi.** { *; }\n-keep class ca.psiphon.** {*;}\n" >> proguard.txt rm -f ../../ca.psiphon.aar zip -r ../../ca.psiphon.aar ./ cd - From 44c6154f5f07d4aa0db2639d9fe0b73f3cb9e4e2 Mon Sep 17 00:00:00 2001 From: Eugene Fryntov Date: Mon, 25 Apr 2022 09:38:19 -0400 Subject: [PATCH 2/3] Update Android sample app. --- .../SampleApps/TunneledWebView/app/build.gradle | 10 +++------- .../java/ca/psiphon/tunneledwebview/MainActivity.java | 2 +- .../Android/SampleApps/TunneledWebView/build.gradle | 2 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/MobileLibrary/Android/SampleApps/TunneledWebView/app/build.gradle b/MobileLibrary/Android/SampleApps/TunneledWebView/app/build.gradle index 573d3abef..62d433924 100644 --- a/MobileLibrary/Android/SampleApps/TunneledWebView/app/build.gradle +++ b/MobileLibrary/Android/SampleApps/TunneledWebView/app/build.gradle @@ -1,20 +1,20 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 29 + compileSdkVersion 30 useLibrary 'org.apache.http.legacy' defaultConfig { applicationId "ca.psiphon.tunneledwebview" minSdkVersion 15 - targetSdkVersion 29 + targetSdkVersion 30 versionCode 1 versionName "1.0" } buildTypes { release { - minifyEnabled false + minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } @@ -25,16 +25,12 @@ android { } repositories { - flatDir { - dirs 'libs' - } maven { url "https://raw.github.com/Psiphon-Labs/psiphon-tunnel-core-Android-library/master" } } dependencies { - implementation fileTree(dir: 'libs', include: ['*.jar']) testImplementation 'junit:junit:4.12' implementation 'androidx.appcompat:appcompat:1.0.0' // always specify exact library version in your real project to avoid non-deterministic builds diff --git a/MobileLibrary/Android/SampleApps/TunneledWebView/app/src/main/java/ca/psiphon/tunneledwebview/MainActivity.java b/MobileLibrary/Android/SampleApps/TunneledWebView/app/src/main/java/ca/psiphon/tunneledwebview/MainActivity.java index 728b8c58d..8acdfcee0 100644 --- a/MobileLibrary/Android/SampleApps/TunneledWebView/app/src/main/java/ca/psiphon/tunneledwebview/MainActivity.java +++ b/MobileLibrary/Android/SampleApps/TunneledWebView/app/src/main/java/ca/psiphon/tunneledwebview/MainActivity.java @@ -142,7 +142,7 @@ private void loadWebView() { public void run() { WebViewProxySettings.setLocalProxy( MainActivity.this, mLocalHttpProxyPort.get()); - mWebView.loadUrl("https://freegeoip.app/"); + mWebView.loadUrl("https://psip.me/"); } }); } diff --git a/MobileLibrary/Android/SampleApps/TunneledWebView/build.gradle b/MobileLibrary/Android/SampleApps/TunneledWebView/build.gradle index de39396f1..1779a2bc9 100644 --- a/MobileLibrary/Android/SampleApps/TunneledWebView/build.gradle +++ b/MobileLibrary/Android/SampleApps/TunneledWebView/build.gradle @@ -6,7 +6,7 @@ buildscript { google() } dependencies { - classpath 'com.android.tools.build:gradle:3.4.1' + classpath 'com.android.tools.build:gradle:7.1.3' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/MobileLibrary/Android/SampleApps/TunneledWebView/gradle/wrapper/gradle-wrapper.properties b/MobileLibrary/Android/SampleApps/TunneledWebView/gradle/wrapper/gradle-wrapper.properties index bf58df38f..8a2f8c2a0 100644 --- a/MobileLibrary/Android/SampleApps/TunneledWebView/gradle/wrapper/gradle-wrapper.properties +++ b/MobileLibrary/Android/SampleApps/TunneledWebView/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip From 578a4b554a6d18a50f4eedb90b8921c05e777621 Mon Sep 17 00:00:00 2001 From: Eugene Fryntov Date: Mon, 25 Apr 2022 09:43:30 -0400 Subject: [PATCH 3/3] Minor formatting. --- MobileLibrary/Android/make.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MobileLibrary/Android/make.bash b/MobileLibrary/Android/make.bash index 61105526f..5b27b1d20 100755 --- a/MobileLibrary/Android/make.bash +++ b/MobileLibrary/Android/make.bash @@ -119,7 +119,7 @@ fi cd - cd build-tmp/psi -echo -e "-keep class psi.** { *; }\n-keep class ca.psiphon.** {*;}\n" >> proguard.txt +echo -e "-keep class psi.** { *; }\n-keep class ca.psiphon.** { *; }\n" >> proguard.txt rm -f ../../ca.psiphon.aar zip -r ../../ca.psiphon.aar ./ cd -