fix(android): declare background location permission - #2265
Draft
Zarah636 wants to merge 1 commit into
Draft
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.
What changed
Added
android.permission.ACCESS_BACKGROUND_LOCATIONto the Android manifest of thewifi_ssidplugin.Why
FlClash's on-demand mode reads the current Wi-Fi SSID to decide whether the proxy should run. On Android 10 and later, users cannot grant “Allow all the time” location access unless the app explicitly declares
ACCESS_BACKGROUND_LOCATION.Without that declaration, SSID reads may return
nullafter FlClash moves to the background, so Wi-Fi-based on-demand rules do not run reliably.Scope
This is a manifest-only change. It does not modify VPN lifecycle handling, background services, or code for other platforms. The permission is used to allow background Wi-Fi SSID access; this change does not add location-coordinate collection.
Users still need to grant “Allow all the time” location access in Android system settings. Device-specific battery restrictions or process termination may still affect background execution.
Verification
git diff --checkpasses.aapt2that bothACCESS_FINE_LOCATIONandACCESS_BACKGROUND_LOCATIONare present in the resulting APK.Fixes #2233