Commit c6361f2
Modernize build config and add VPN service with tun2socks support (#33)
* Add VPN mode support without requiring root permissions
This implements PR #32 features:
- Add ProxyDroidVpnService extending Android's VpnService API
- Add native tun2socks library for TUN to SOCKS5 conversion
- Add LocalProxyServer for HTTP-to-SOCKS protocol conversion
- Add Tun2SocksHelper JNI wrapper for native library
- Update build.gradle to SDK 33, Gradle 8.x, NDK 25.1
- Add VPN mode toggle in preferences (enabled by default)
- Update AndroidManifest with VPN service declaration and permissions
https://claude.ai/code/session_01XDv7Fhpou2mSbpsV56cWxL
* Add GitHub Actions CI workflow and unit tests
- Add android-build.yml workflow for CI/CD with:
- JDK 17 and Android SDK setup
- Gradle build, unit tests, and lint
- APK and test results artifact upload
- Add LocalHttpProxyTest with comprehensive unit tests for:
- SOCKS5 handshake (auth and no-auth)
- SOCKS5 connect requests (IPv4, domain, IPv6)
- HTTP CONNECT proxy requests
- Protocol parsing and encoding
https://claude.ai/code/session_01XDv7Fhpou2mSbpsV56cWxL
* Add local HTTP proxy tests with Android emulator integration
- Add emulator-test job to GitHub Actions workflow that:
- Starts an HTTP CONNECT proxy server on the host
- Installs the app on Android emulator
- Configures proxy settings via adb
- Verifies VPN service declaration and native libraries
- Tests app startup and configuration handling
- Add test_http_proxy.py: Python HTTP CONNECT proxy for testing
- Supports authentication
- Logs all CONNECT requests
- Relays data between client and target
- Add run_integration_tests.sh: Integration test script
- Automates emulator testing workflow
- Configures preferences via adb
- Runs connectivity verification tests
- Update app/build.gradle with additional androidTest dependencies
https://claude.ai/code/session_01XDv7Fhpou2mSbpsV56cWxL
* Remove unused imports and constants from unit tests
Clean up test file to remove unused imports (ServerSocket, Socket,
InputStream, OutputStream, etc.) and unused port constants that
were left over from the previous socket-based test implementation.
https://claude.ai/code/session_01XDv7Fhpou2mSbpsV56cWxL
* Fix CI lint job by adding NDK/CMake installation
The lint job was failing because it couldn't compile native code
without NDK and CMake installed. Also removed unnecessary dummy
google-services.json from lint job since Firebase is not used.
https://claude.ai/code/session_01XDv7Fhpou2mSbpsV56cWxL
* Fix build error: remove API 34+ foregroundServiceType
The 'specialUse' foregroundServiceType and FOREGROUND_SERVICE_SPECIAL_USE
permission were added in Android 14 (API 34), but the app targets API 33.
VPN services don't need a specific foregroundServiceType since VpnService
has special handling built-in.
https://claude.ai/code/session_01XDv7Fhpou2mSbpsV56cWxL
* Make gradlew executable
https://claude.ai/code/session_01XDv7Fhpou2mSbpsV56cWxL
* Fix JUnit exclusion to not affect test configurations
The previous configuration excluded JUnit from all configurations which
broke unit tests. Now JUnit is only excluded from implementation scope
to prevent json-simple's transitive JUnit dependency from being included
in the APK, while still allowing testImplementation to use JUnit.
https://claude.ai/code/session_01XDv7Fhpou2mSbpsV56cWxL
* Remove Firebase/AdMob dependencies and fix R.id switch statements
- Remove Firebase Analytics from ProxyDroidApplication
- Remove AdMob (AdView, AdSize, AdRequest) from ProxyDroid
- Convert switch statement with R.id.* to if-else in BypassListActivity
(R.id fields are not constant expressions with Android Gradle Plugin)
- Remove unused getLayout method, ViewParent and LinearLayout imports
https://claude.ai/code/session_01XDv7Fhpou2mSbpsV56cWxL
* Remove remaining Firebase Analytics references
Remove firebaseAnalytics calls from:
- AppManager.java
- FileChooser.java
- ProxyDroidService.java (onDestroy and onStart)
https://claude.ai/code/session_01XDv7Fhpou2mSbpsV56cWxL
* Fix configurations syntax in build.gradle
Use configurations.implementation instead of configurations { implementation { } }
to properly exclude JUnit from implementation configuration.
https://claude.ai/code/session_01XDv7Fhpou2mSbpsV56cWxL
* Fix JUnit exclusion: exclude only from json-simple dependency
The previous configuration excluded JUnit from all implementation
configurations which was also blocking it from test configurations.
Now JUnit is only excluded from the json-simple dependency which
incorrectly pulls it in as a compile dependency.
https://claude.ai/code/session_01XDv7Fhpou2mSbpsV56cWxL
* Fix shell quoting in emulator test script
Use heredoc (cat << 'PREFS_EOF') instead of variable assignment
to avoid shell parsing issues with XML special characters.
https://claude.ai/code/session_01XDv7Fhpou2mSbpsV56cWxL
* Fix emulator test: create prefs.xml in separate step
The android-emulator-runner action executes script lines individually,
so heredocs don't work within the script block. Move the prefs.xml
creation to a separate step that runs before the emulator.
https://claude.ai/code/session_01XDv7Fhpou2mSbpsV56cWxL
* Add Python cache to .gitignore
https://claude.ai/code/session_01XDv7Fhpou2mSbpsV56cWxL
* Move emulator test script to separate file
Extract inline emulator test script from workflow YAML into
scripts/run_emulator_tests.sh for easier maintenance and testing.
https://claude.ai/code/session_01XDv7Fhpou2mSbpsV56cWxL
* Enable emulator snapshots in CI
Remove -no-snapshot-save flag to allow emulator snapshots,
which can speed up boot times on subsequent runs.
https://claude.ai/code/session_01XDv7Fhpou2mSbpsV56cWxL
* Fix emulator test script execution
Use 'bash scripts/run_emulator_tests.sh' instead of './scripts/...'
to ensure the script is found and executed correctly.
https://claude.ai/code/session_01XDv7Fhpou2mSbpsV56cWxL
* Fix line endings in emulator test script
Convert CRLF to LF line endings to fix bash syntax error.
https://claude.ai/code/session_01XDv7Fhpou2mSbpsV56cWxL
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 3de979e commit c6361f2
28 files changed
Lines changed: 2844 additions & 124 deletions
File tree
- .github/workflows
- app
- src
- main
- cpp
- tun2socks
- core
- java/org/proxydroid
- utils
- res
- values
- xml-v14
- xml
- test/java/org/proxydroid/utils
- gradle/wrapper
- scripts
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
0 commit comments