Repository navigation
Trusted Wi-Fi: open locked apps on networks you trust - #8
Merged
Merged
Conversation
Builds option A of the trusted-Wi-Fi feature request into the app: while the phone is on a trusted Wi-Fi network, the lock backends let locked apps open, so protection can follow home Wi-Fi without an automation app. TrustedNetworkMonitor follows the connected Wi-Fi through a network callback and fails closed throughout, since it switches locking off: - trust is kept in memory only, so a reboot or restart stays protected until Android reports a trusted network; - a name that can't be read (Location off, no location access, or access only while in use) counts as untrusted, and turning Location off drops trust at once; - when the screen turns on or the phone unlocks, the name is read again and anything but a trusted name drops trust. That check never grants trust, and unlike a timer it costs no wake-ups. The three backends now check isProtectionActive(): the shield is on and no trusted network is relaxing it. The shield and the automation intents still read and write only the shield flag, so the two features stay independent. Anti-uninstall runs before that check and is unaffected. Leaving a trusted network re-locks through relockAll, moved out of AutomationReceiver.setProtection, so both paths clear unlocks and restart the services the same way. Off by default; the Settings screen that turns it on comes next. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HVGZVKJhw7t1rVQitX1sFz
A Trusted Wi-Fi section in Settings turns the feature on and manages the networks. Turning it on asks for precise location, then for "Allow all the time" (from Android 11 on its own settings page, after a short explanation), because Android only shares the Wi-Fi name with apps that have location access, and only in the background with that grant. The switch stays off until both are granted. A network can only be added while connected to it, never typed, so the stored name always matches what Android reports: quoted, or hex for names that aren't valid UTF-8. The dialog says plainly that networks are matched by name. The status line under the switch follows the monitor, and location access and the Location switch are re-read whenever the screen resumes. With Location off, the dialog offers a button to Android's Location settings. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HVGZVKJhw7t1rVQitX1sFz
Otherwise the shield says ON at home while locked apps open freely. Tapping it still toggles the same flag, so at home it cycles HOME, OFF, HOME. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HVGZVKJhw7t1rVQitX1sFz
Covers setup, why location access is needed, the fail-closed rules including the screen-on check, how it combines with the automation intents, and the limits of matching networks by name. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HVGZVKJhw7t1rVQitX1sFz
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.
Builds option A of aload0#243 into the app. While the phone is on a trusted Wi-Fi network, locked apps open without authentication. Anywhere else, or whenever the state is unknown, they stay locked. No automation app is needed, and the automation intents from #1 keep working unchanged.
What changed
16b89d2TrustedNetworkMonitor;isProtectionActive()in all three backends;relockAll, shared withAutomationReceiver; location permissionsb6911d63adb41da281900AUTOMATION.mdsection on built-in trusted Wi-FiHow it behaves
relockAllused when the shield is turned back on.Testing
Not compiled locally; CI is the first build.
On the phone, first turn off any automation that sends
DISABLE_PROTECTION, or it will hide the result. Then:🤖 Generated with Claude Code
https://claude.ai/code/session_01HVGZVKJhw7t1rVQitX1sFz