Commit 7e7c31d
WIP: Rewrite project in Kotlin - core classes and utilities (#34)
* WIP: Rewrite project in Kotlin - core classes and utilities
- Add Kotlin plugin to build.gradle files
- Convert core app classes: ProxyDroidApplication, Profile, ProxyedApp
- Convert services: ProxyDroidService, ProxyDroidVpnService
- Convert receivers: ProxyDroidReceiver, ConnectivityBroadcastReceiver
- Convert widget: ProxyDroidWidgetProvider
- Convert JNI interfaces: Exec, Tun2SocksHelper
- Convert utility classes: Utils, Constraints, Option, ImageLoader,
ImageLoaderFactory, RegexValidator, LocalProxyServer
- Convert helper: InnerSocketBuilder
This is work in progress - remaining files to convert:
- UI activities (ProxyDroid, AppManager, BypassListActivity, FileChooser)
- PAC selector classes
- Adapters and validators
- Test files
https://claude.ai/code/session_01A8JRXuv4RL3LWQCZq4QDr9
* Complete Kotlin rewrite of ProxyDroid project
This commit completes the full conversion of the ProxyDroid Android
project from Java to Kotlin.
Changes include:
- Updated build.gradle files with Kotlin plugin and dependencies
- Converted all 36 Java source files to Kotlin
- Converted all test files to Kotlin
- Removed all original Java files
Converted files by package:
org.proxydroid:
- ProxyDroid, ProxyDroidApplication, Profile, ProxyedApp
- ProxyDroidService, ProxyDroidVpnService
- AppManager, BypassListActivity, FileChooser, FileArrayAdapter
- ConnectivityBroadcastReceiver, ProxyDroidReceiver
- ProxyDroidWidgetProvider
- Exec, InnerSocketBuilder, DomainValidator
org.proxydroid.utils:
- Utils, Constraints, Option, Base64
- ImageLoader, ImageLoaderFactory
- LocalProxyServer, Tun2SocksHelper, RegexValidator
com.btr.proxy.selector.pac:
- PacProxySelector, PacScriptParser, PacScriptSource
- RhinoPacScriptParser, UrlPacScriptSource
- PacScriptMethods, ScriptMethods
- Proxy, ProxyException, ProxyEvaluationException
com.ksmaze.android.preference:
- ListPreferenceMultiSelect
Test files:
- ExampleUnitTest, ExampleInstrumentedTest
- LocalHttpProxyTest
https://claude.ai/code/session_01A8JRXuv4RL3LWQCZq4QDr9
* Fix Kotlin compilation errors
- Add missing Base64.kt utility class that wraps android.util.Base64
- Fix duplicate companion object in AppManager.kt (merged into one)
- Add missing vpn_running string resource
https://claude.ai/code/session_01A8JRXuv4RL3LWQCZq4QDr9
* Add missing init() method to Profile class
The ProxyDroid activity calls mProfile.init() to reset profile values,
but this method was missing after the Kotlin conversion.
https://claude.ai/code/session_01A8JRXuv4RL3LWQCZq4QDr9
* Fix Kotlin compilation errors
- Change androidx.preference.PreferenceManager to android.preference.PreferenceManager
(androidx.preference requires additional dependency)
- Add explicit type parameter to emptyList<String>() in ConnectivityBroadcastReceiver
https://claude.ai/code/session_01A8JRXuv4RL3LWQCZq4QDr9
* Fix ProxyedApp and AppManager compilation errors
- Add missing isProxyed and isEnabled properties to ProxyedApp
- Make username, procname, name nullable in ProxyedApp
- Fix OnScrollListener reference to use AbsListView.OnScrollListener
- Add null check before Arrays.binarySearch for nullable username
https://claude.ai/code/session_01A8JRXuv4RL3LWQCZq4QDr9
* Fix Kotlin compilation error in ImageLoader.kt
Cast lock object to Object before calling notifyAll() since Kotlin's Any
type doesn't have the notifyAll() method. This is consistent with the
existing wait() call pattern on line 121.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Max Lv <mlv@MaxdeMac-mini.local>1 parent c6361f2 commit 7e7c31d
81 files changed
Lines changed: 4796 additions & 11480 deletions
File tree
- app
- src
- androidTest/java/org/proxydroid
- main
- java
- com
- btr/proxy/selector/pac
- ksmaze/android/preference
- org/proxydroid
- utils
- res/values
- test/java/org/proxydroid
- utils
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
38 | 43 | | |
39 | 44 | | |
40 | 45 | | |
| |||
51 | 56 | | |
52 | 57 | | |
53 | 58 | | |
| 59 | + | |
| 60 | + | |
54 | 61 | | |
55 | 62 | | |
56 | 63 | | |
| |||
Lines changed: 0 additions & 27 deletions
This file was deleted.
Lines changed: 16 additions & 0 deletions
| 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 | + | |
Lines changed: 0 additions & 144 deletions
This file was deleted.
Lines changed: 89 additions & 0 deletions
| 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 | + | |
0 commit comments