Skip to content

fix(android): declare background location permission - #2265

Draft
Zarah636 wants to merge 1 commit into
chen08209:mainfrom
Zarah636:agent/android-background-location
Draft

fix(android): declare background location permission#2265
Zarah636 wants to merge 1 commit into
chen08209:mainfrom
Zarah636:agent/android-background-location

Conversation

@Zarah636

Copy link
Copy Markdown

What changed

Added android.permission.ACCESS_BACKGROUND_LOCATION to the Android manifest of the wifi_ssid plugin.

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 null after 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

  • Confirmed the PR diff contains one added line in one file.
  • Parsed the modified Android manifest successfully.
  • git diff --check passes.
  • Built an Android ARM64 release APK from the same upstream commit with this manifest change.
  • Verified with aapt2 that both ACCESS_FINE_LOCATION and ACCESS_BACKGROUND_LOCATION are present in the resulting APK.

Fixes #2233

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.

[BUG] Android端“按需运行”缺少在后台使用位置信息的权限

1 participant