File tree Expand file tree Collapse file tree 3 files changed +16
-6
lines changed
src/main/java/tech/httptoolkit/android Expand file tree Collapse file tree 3 files changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -2,8 +2,8 @@ language: android
22dist : trusty
33android :
44 components :
5- - build-tools-29.0.2
6- - android-28
5+ - build-tools-29.0.3
6+ - android-29
77before_install :
88- openssl aes-256-cbc -K $encrypted_410c058128c0_key -iv $encrypted_410c058128c0_iv
99 -in android-travis-cert-store.enc -out ./android-travis-cert-store.jks -d
@@ -12,7 +12,7 @@ script:
1212- jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -storepass $CERT_STORE_PWD
1313 -keypass $CERT_STORE_PWD -keystore ./android-travis-cert-store.jks app/build/outputs/apk/release/app-release-unsigned.apk
1414 $CERT_ALIAS
15- - ${ANDROID_HOME}/build-tools/29.0.2 /zipalign -v 4 app/build/outputs/apk/release/app-release-unsigned.apk ./httptoolkit.apk
15+ - ${ANDROID_HOME}/build-tools/29.0.3 /zipalign -v 4 app/build/outputs/apk/release/app-release-unsigned.apk ./httptoolkit.apk
1616deploy :
1717 provider : releases
1818 api_key :
Original file line number Diff line number Diff line change @@ -4,12 +4,12 @@ apply plugin: 'kotlin-android-extensions'
44
55android {
66
7- compileSdkVersion 28
8- buildToolsVersion " 29.0.2 "
7+ compileSdkVersion 29
8+ buildToolsVersion " 29.0.3 "
99 defaultConfig {
1010 applicationId " tech.httptoolkit.android.v1"
1111 minSdkVersion 21
12- targetSdkVersion 28
12+ targetSdkVersion 29
1313 versionCode 9
1414 versionName " 1.0.0-alpha9"
1515
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import android.content.Intent
55import android.app.*
66import android.content.pm.PackageManager
77import android.graphics.BitmapFactory
8+ import android.net.ProxyInfo
89import android.os.Build
910import android.os.ParcelFileDescriptor
1011import android.util.Log
@@ -148,6 +149,15 @@ class ProxyVpnService : VpnService(), IProtectSocket {
148149 vpnInterface = Builder ()
149150 .addAddress(VPN_IP_ADDRESS , 32 )
150151 .addRoute(ALL_ROUTES , 0 )
152+ .apply {
153+ if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .Q ) {
154+ // Where possible, we want to explicitly set the proxy in addition to
155+ // manually redirecting traffic. This is useful because it captures HTTP sent
156+ // to non-default ports. We still need to do both though, as not all clients
157+ // will use the proxy settings.
158+ setHttpProxy(ProxyInfo .buildDirectProxy(proxyConfig.ip, proxyConfig.port))
159+ }
160+ }
151161
152162 .setMtu(MAX_PACKET_LEN ) // Limit the packet size to the buffer used by ProxyVpnRunnable
153163 .setBlocking(true ) // We use a blocking loop to read in ProxyVpnRunnable
You can’t perform that action at this time.
0 commit comments