Repository navigation
Reload rules when apps on external storage become available - #998
Merged
Merged
Conversation
Apps on an SD card or adopted storage are announced only once the volume mounts, which on boot is after the service has built its rules. They stayed without network access until the app list was refreshed by hand. Listen for ACTION_EXTERNAL_APPLICATIONS_AVAILABLE/UNAVAILABLE in the service and the main activity, reload the rules, and resolve any saved settings that were still pending for the newly visible packages. Fixes #975 Claude-Session: https://claude.ai/code/session_014q8SwK4eSqqhJWWVKN6VJW
Member
Author
|
The Generated by Claude Code |
kasnder
marked this pull request as ready for review
October 25, 2026 22:47
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.
Fixes #975.
Problem
Apps installed on an SD card or adopted storage only become visible once the volume mounts. On boot that happens after
ServiceSinkholehas built its rules, so those apps are unknown to the VPN and get no network access until the user refreshes the app list.Change
Android announces the mount with
ACTION_EXTERNAL_APPLICATIONS_AVAILABLE(and the unmount with..._UNAVAILABLE). These broadcasts carry no data URI, so the existingpackage-scheme filter never matches them.ServiceSinkhole: register a second, scheme-less filter onpackageChangedReceiver. On available, clear the rule cache, resolve any pending internet/tracker settings for the packages inEXTRA_CHANGED_PACKAGE_LIST(they could not be mapped to a UID while the volume was missing), save if changed, and reload. On unavailable, clear the cache and reload, keeping settings, since the apps are still installed.ActivityMain: same filter, so an open app list refreshes as well.Testing
./gradlew :app:compileGithubDebugJavaWithJavacin CI.https://claude.ai/code/session_014q8SwK4eSqqhJWWVKN6VJW
Generated by Claude Code