Add Android Always-On VPN support - #47
Open
Tosko4 wants to merge 1 commit into
Open
Conversation
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.
Community Contribution License Agreement
By creating this pull request, I grant the project maintainers an unlimited,
perpetual license to use, modify, and redistribute these contributions under any terms they
choose, including both the AGPLv3 and the Fossorial Commercial license terms. I
represent that I have the right to grant this license for all contributed content.
Description
Adds complete Android Always-On VPN support rather than only exposing the manifest setting.
Android can create the VPN service after boot without opening an activity, so the manager graph now lives in
PangolinApplicationand is shared withMainActivity. A system-started tunnel reuses the existing encrypted account, session, and OLM state without starting an interactive credential flow or adding another credential store.The change also:
systemExemptedforeground VPN service with a status notification;Connectedonly after registration, Android-applied network settings, and a connected private peer or exit node are all present.This is related to #12 and intentionally stays separate from the DNS filtering, tunnel permission, and network-settings acknowledgement changes in #44, #45, and #46.
How to test?
ANDROID_HOME=/path/to/android-sdk ./gradlew test assembleReleaseFocused regression coverage includes Always-On ownership and restart policy, bounded reconnect backoff, permanent versus retryable startup failures, manual-disconnect policy, and strict tunnel readiness.
I also ran an Android 15 / API 35 emulator lifecycle test. It verified that the VPN service can start without an activity, is accepted as a
systemExemptedforeground service, survives the foreground-service deadline, creates its notification channel, and keeps a manual start non-Always-On. The emulator did not have an authenticated Pangolin account, so this does not claim a real server registration, peer handshake, or OEM-specific background-management result.The tunnel module has existing release-lint failures on
dev. The clean base reports 7 errors and 6 warnings; this branch reports 4 errors and 6 warnings. The remaining four are the existingACCESS_NETWORK_STATEfindings handled separately by #45, and this change introduces no new lint finding.