Skip to content

ADFA-4552: remove dead VpnService scaffolding (keep the live proxy)#135

Merged
luisguzman-adfa merged 1 commit into
mainfrom
feat/ADFA-4552-remove-dead-vpn
Jul 4, 2026
Merged

ADFA-4552: remove dead VpnService scaffolding (keep the live proxy)#135
luisguzman-adfa merged 1 commit into
mainfrom
feat/ADFA-4552-remove-dead-vpn

Conversation

@luisguzman-adfa

Copy link
Copy Markdown
Collaborator

Two different things called "VPN"

The old VpnService tunnel (TProxyService) no longer exists. Auditing every vpn reference showed the naming now covers two things:

  • Dead / vestigial — never-reached VpnService permission plumbing + a log-only stub.
  • Live — the prefs.getEnable() toggle (Control button) that applies a real WebView SOCKS proxy in PortalActivity (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: unused import android.net.VpnService; the vpnPermissionLauncher field + its registerForActivityResult(...) block (registered but never .launch()ed); and connectVpn() (logs vpn_permission_granted, reachable only from that launcher). Its BatteryUtils.checkAndPromptOptimizations call is already covered by batteryOptLauncher + prepareVpn(), so nothing is lost.
  • ServiceReceiver: the commented-out VpnService/TProxyService boot auto-start + now-unused VpnService/Build imports. 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_granted removed from all six locales together (no MissingTranslation risk).

Not touched (live)

prefs.getEnable()/setEnable(), the SOCKS proxy path, checkServerStatus proxy pings, UsageFragment Control button, btn_vpn_* colors, the three live vpn_* strings, prepareVpn().

Verification (sandbox)

  • No remaining ref to connectVpn / vpnPermissionLauncher / vpn_permission_granted in controller/app/src.
  • VpnService gone from code (only in ServiceReceiver comments as history).
  • MainActivity brace balance 383/383; ServiceReceiver imports all used.
  • No javac in sandbox (JRE only) — please build :app:lintDebug.

Notes

  • ServiceReceiver is not currently registered in the manifest, so it doesn't fire today; ADFA-3340 will add the <receiver> + RECEIVE_BOOT_COMPLETED when wiring auto-start. Left as the intended hook point.
  • lint-baseline.xml still has stale vpn entries; they simply stop matching after removal (baseline is a filter, not a gate).

Test (device)

  1. Build + lint pass.
  2. Control button still toggles the tunnel/proxy on/off (label + red/green), portal routes through the SOCKS proxy when enabled, box pings work — unchanged.
  3. First-run permission prompts → battery-optimization prompt still appears (via prepareVpn()/batteryOptLauncher).

Epic ADFA-1028. Author: AppDevForAll.

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.
@luisguzman-adfa luisguzman-adfa merged commit ece04df into main Jul 4, 2026
1 check passed
@luisguzman-adfa luisguzman-adfa deleted the feat/ADFA-4552-remove-dead-vpn branch July 4, 2026 01:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant