ADFA-4552: remove dead VpnService scaffolding (keep the live proxy)#135
Merged
Conversation
The old VpnService tunnel (TProxyService) is gone; only vestigial, never-reached plumbing remained. Removes the dead parts only; the live SOCKS-proxy feature that is merely named 'VPN' is untouched (rename deferred to the rebrand strings audit). - MainActivity: drop unused 'import android.net.VpnService', the vpnPermissionLauncher field + its registerForActivityResult block (registered but never launched), and connectVpn() (a log-only stub reachable only from that launcher). The launcher's battery-optimization call is already covered by batteryOptLauncher + prepareVpn(), so nothing is lost. - ServiceReceiver: drop the commented-out VpnService/TProxyService boot auto-start and now-unused VpnService/Build imports; keep the receiver as a placeholder seam for boot auto-start (ADFA-3340) with a TODO; header -> AppDevForAll. - strings.xml (all 6 locales): remove vpn_permission_granted (used only by the dead connectVpn); the live vpn_starting/vpn_stopping/vpn_description stay. Behaviour-preserving.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two different things called "VPN"
The old
VpnServicetunnel (TProxyService) no longer exists. Auditing everyvpnreference showed the naming now covers two things:prefs.getEnable()toggle (Control button) that applies a real WebView SOCKS proxy inPortalActivity(WebViewProxyConfigurator.applySocks) and proxied box pings.This PR removes only the dead parts. The live proxy and its "VPN"-flavoured names (
btn_vpn_*colors,vpn_starting/vpn_stopping/vpn_description,control_enable/disable,isVpnActive,prepareVpn()whose body is a live battery prompt) are intentionally left as-is; renaming belongs with the rebrand strings audit.Removed (dead)
MainActivity: unusedimport android.net.VpnService; thevpnPermissionLauncherfield + itsregisterForActivityResult(...)block (registered but never.launch()ed); andconnectVpn()(logsvpn_permission_granted, reachable only from that launcher). ItsBatteryUtils.checkAndPromptOptimizationscall is already covered bybatteryOptLauncher+prepareVpn(), so nothing is lost.ServiceReceiver: the commented-outVpnService/TProxyServiceboot auto-start + now-unusedVpnService/Buildimports. Kept as a placeholder seam for ADFA-3340 (boot auto-start) with a TODO; header → AppDevForAll.strings.xml(values, es, fr, hi, pt, ru-rRU):vpn_permission_grantedremoved from all six locales together (noMissingTranslationrisk).Not touched (live)
prefs.getEnable()/setEnable(), the SOCKS proxy path,checkServerStatusproxy pings,UsageFragmentControl button,btn_vpn_*colors, the three livevpn_*strings,prepareVpn().Verification (sandbox)
connectVpn/vpnPermissionLauncher/vpn_permission_grantedincontroller/app/src.VpnServicegone from code (only inServiceReceivercomments as history).MainActivitybrace balance 383/383;ServiceReceiverimports all used.javacin sandbox (JRE only) — please build:app:lintDebug.Notes
ServiceReceiveris not currently registered in the manifest, so it doesn't fire today; ADFA-3340 will add the<receiver>+RECEIVE_BOOT_COMPLETEDwhen wiring auto-start. Left as the intended hook point.lint-baseline.xmlstill has stalevpnentries; they simply stop matching after removal (baseline is a filter, not a gate).Test (device)
prepareVpn()/batteryOptLauncher).Epic ADFA-1028. Author: AppDevForAll.