Repository navigation
Conversation
Apps change their layouts faster than releases ship, so a broken built-in rule stays broken for every user until the next release, as the LinkedIn and WhatsApp rules just did. A daily JobScheduler job now downloads the flavour's distraction_rules.txt from main on raw.githubusercontent.com and getRules() adds any rule it does not already have. Downloaded rules never replace or remove bundled ones, and navigation rules are never downloaded, since a wrong one taps things. A rule line using a key this version does not know is dropped: the parser would otherwise skip the key and apply the rule more widely than written. HTTPS to that one host only, redirects refused, 256 KiB cap, and the last good copy is kept on any failure. It is on by default and can be turned off in Settings, which also deletes the stored copy. This adds the INTERNET permission; AGENTS.md and the README privacy section now say what the one request is. Claude-Session: https://claude.ai/code/session_01GwnAB5CENNRMKt5vqGLKcS
kasnder
force-pushed
the
ccr-5fcee933-rule-updates
branch
from
October 21, 2026 08:31
d3de182 to
b585169
Compare
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 on #48 (merged), which keeps a row on when a rule is added to it. Without that, every downloaded sibling rule would switch its row off.
Concern addressed: A broken built-in rule stays broken until the next release (as with #46 and #47).
What changed and why:
RuleUpdates+RuleUpdateJobService: a dailyJobSchedulerjob (any network) downloads the flavour'sdistraction_rules.txtfrommain. The URL is a string resource, overridden forgmwaylite. HTTPS toraw.githubusercontent.comonly, redirects refused, 256 KiB cap, written atomically, last good copy kept on failure. On success the running service reloads its rules.ServiceConfig.getRules()adds downloaded rules whose identity is not already bundled. Downloads never replace or remove a bundled rule, and navigation rules are never downloaded.FilterRuleParser.usesOnlyKnownKeys: a downloaded line using a key this version does not know is dropped. Otherwise the parser would skip the key, and since new keys usually narrow a rule, older apps would apply it more widely than written.INTERNETpermission.AGENTS.md(the on-device principle, plus "merging a rule tomainships it") and the README privacy section are updated to match.Evidence: New unit tests: known/unknown keys in
FilterRuleParserTest; inServiceConfigTest, default on, downloaded rule added as built-in, bundled duplicate not added twice, ignored when off, unknown-key line dropped, every bundled rule uses only known keys. CI passes on both flavours. Not run locally (no Android SDK in this container). The download, job scheduling and settings switch are untested on a device.Not in this PR:
maincan ship rules to every user within a day. Rules can only hide or cover things, not send data, but it's worth a follow-up.mainstays in apps that bundle it. Downloads can only add.https://claude.ai/code/session_01GwnAB5CENNRMKt5vqGLKcS
Generated by Claude Code