Skip to content

Commit 69eec81

Browse files
madeyeclaude
andcommitted
Drop unused validators + dead AppManager.getProxyedApps companion
DomainValidator + utils/RegexValidator have no inbound references under the VPN-first Compose UI. The legacy AppManager.getProxyedApps companion method was superseded by the local Compose loadApps() in the same file; the ProxyedApp data class only existed to serve that dead method. Drops: - DomainValidator.kt - utils/RegexValidator.kt - ProxyedApp.kt - AppManager.getProxyedApps companion (plus the lone `username!!`) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 308a867 commit 69eec81

4 files changed

Lines changed: 2 additions & 239 deletions

File tree

app/src/main/java/org/proxydroid/AppManager.kt

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import android.graphics.drawable.Drawable
88
import android.os.Bundle
99
import android.preference.PreferenceManager
1010
import androidx.activity.ComponentActivity
11+
// (Legacy `getProxyedApps` companion + the `ProxyedApp` data class were
12+
// removed; the in-file Compose `loadApps` is the only enumerator.)
1113
import androidx.activity.compose.setContent
1214
import androidx.activity.enableEdgeToEdge
1315
import androidx.compose.foundation.Image
@@ -58,31 +60,6 @@ class AppManager : ComponentActivity() {
5860

5961
companion object {
6062
const val PREFS_KEY_PROXYED = "Proxyed"
61-
62-
@JvmStatic
63-
fun getProxyedApps(context: Context, self: Boolean): Array<ProxyedApp> {
64-
val prefs = PreferenceManager.getDefaultSharedPreferences(context)
65-
val raw = prefs.getString(PREFS_KEY_PROXYED, "") ?: ""
66-
val st = StringTokenizer(raw, "|")
67-
val tokens = Array(st.countTokens()) { st.nextToken() }.also { it.sort() }
68-
69-
val pMgr = context.packageManager
70-
val out = mutableListOf<ProxyedApp>()
71-
for (info in pMgr.getInstalledApplications(0)) {
72-
if (info.uid < 10000) continue
73-
val app = ProxyedApp().apply {
74-
uid = info.uid
75-
username = pMgr.getNameForUid(uid)
76-
isProxyed = when {
77-
info.packageName == "org.proxydroid" -> self
78-
username != null && tokens.binarySearch(username!!) >= 0 -> true
79-
else -> false
80-
}
81-
}
82-
if (app.isProxyed) out.add(app)
83-
}
84-
return out.toTypedArray()
85-
}
8663
}
8764

8865
override fun onCreate(savedInstanceState: Bundle?) {

app/src/main/java/org/proxydroid/DomainValidator.kt

Lines changed: 0 additions & 95 deletions
This file was deleted.

app/src/main/java/org/proxydroid/ProxyedApp.kt

Lines changed: 0 additions & 30 deletions
This file was deleted.

app/src/main/java/org/proxydroid/utils/RegexValidator.kt

Lines changed: 0 additions & 89 deletions
This file was deleted.

0 commit comments

Comments
 (0)