Skip to content

Fix Android VPN state after APK upgrade#8845

Open
atavism wants to merge 7 commits into
mainfrom
atavism/issue-3538
Open

Fix Android VPN state after APK upgrade#8845
atavism wants to merge 7 commits into
mainfrom
atavism/issue-3538

Conversation

@atavism

@atavism atavism commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Copilot AI review requested due to automatic review settings June 8, 2026 15:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR aims to correct VPN state inconsistencies on Android after an APK upgrade by proactively resetting tunnel-related state the first time the VPN is started post-upgrade.

Changes:

  • Close any existing TUN file descriptor before establishing a new one to avoid stale descriptors surviving restarts/upgrade recovery.
  • Detect APK upgrades via PackageInfo.lastUpdateTime and perform a one-time VPN/tunnel reset (stop VPN, stop network monitor, post disconnected) before the first tunnel start after upgrade.
  • Persist the last-seen APK update timestamp in SharedPreferences to ensure the reset runs at most once per upgrade.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

3 participants