Skip to content

Add VPN auto-disable feature for proxy settings#121

Open
SEVENID wants to merge 2 commits intomonogram-android:developfrom
SEVENID:feat/vpn-auto-disable
Open

Add VPN auto-disable feature for proxy settings#121
SEVENID wants to merge 2 commits intomonogram-android:developfrom
SEVENID:feat/vpn-auto-disable

Conversation

@SEVENID
Copy link
Copy Markdown

@SEVENID SEVENID commented Apr 2, 2026

  • Add VpnDetector in data layer using NetworkCallback for TRANSPORT_VPN
  • Add isVpnAutoDisableEnabled and savedProxyBeforeVpn to AppPreferences
  • Implement auto-proxy-disable when system VPN active, restore on disconnect
  • Pause autoBestJob and telegaSwitchJob while VPN monitoring is active
  • Add VPN guard in selectBestProxy() to prevent proxy switching during VPN
  • Add SettingsSwitchTile UI toggle in ProxyContent under Connection section

100% vibecoded with qwen3.5 and opencode. Build successful, new checkbox seems to work but please review first.
Screenshot:
Screenshot_20260402-203531

@gdlbo gdlbo changed the base branch from master to develop April 2, 2026 18:39
@gdlbo
Copy link
Copy Markdown
Member

gdlbo commented Apr 2, 2026

Add translations of other languages ​​+ check for connection via intent https://github.com/monogram-android/monogram/blob/develop/app/src/main/java/org/monogram/app/MainContent.kt#L134-L221

@SEVENID SEVENID force-pushed the feat/vpn-auto-disable branch from 52dfbab to 37944e9 Compare April 2, 2026 21:01
@SEVENID
Copy link
Copy Markdown
Author

SEVENID commented Apr 3, 2026

Seems ready. Please recheck.

@gdlbo
Copy link
Copy Markdown
Member

gdlbo commented Apr 3, 2026

No need to touch modules in gradle

the project was deliberately divided into modules

data module should not be imported into presentation

@SEVENID SEVENID force-pushed the feat/vpn-auto-disable branch 2 times, most recently from a8a212c to 663d4d0 Compare April 4, 2026 20:20
SEVENID added 2 commits April 4, 2026 23:49
- VpnDetector: NetworkCallback-based VPN status detection with debounced checks and idempotent startMonitoring
- ConnectionManager: VPN monitoring flow that auto-disables proxy when VPN is active and restores on disconnect
- ConnectionManager: VPN guard on selectBestProxy() (double check) and eager proxy enable on init
- ConnectionManager: VPN guard on reconnect attempts (runReconnectAttempt) to skip TDLib calls while VPN active
- ConnectionManager: close() method for full lifecycle cleanup (jobs, callbacks, VpnDetector)
- ConnectionManager: ProxyModeState data class replacing nested tuples in combine flow
- Proxy UI: VPN auto-disable toggle in settings screen with Shield icon
- Proxy UI: VPN warning text in proxy confirmation dialog with conditional 'Save for Later' button
- ProxyComponent: sealed EnableProxyResult (Enabled/Skipped/Error) for clear proxy enable outcomes
- ProxyComponent: extracted vpnBlockActive property and showVpnBlockToast() helper to reduce duplication
- Persistent savedProxyBeforeVpn preference survives process death
- Type-safe getSystemService calls in dataModule
- Translations: EN/RU/UK/ZH/SK for all VPN-related strings
@SEVENID SEVENID force-pushed the feat/vpn-auto-disable branch from 663d4d0 to fb9d944 Compare April 4, 2026 20:49
Copy link
Copy Markdown
Member

@gdlbo gdlbo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall good, but the components in MainContent should be separated into a separate components folder

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, you need to split the code into components and move it to app/components

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.

2 participants