android: the focus guard on the phone itself
The Guard screen shows the shared policy; two Android facilities enforce it. An accessibility service reads the browser's URL bar (no /etc/hosts exists, and the VPN slot belongs to the user's always-on VPN), sends blocked pages home and records the attempt; UsageStatsManager spots blocked apps in front and the service presses home — 'kill' cannot mean force-stop, and the KDoc says so. Masks mean what they mean on every client: a bare '*' in the expansion list makes '*.site' cover every subdomain, and masks no hosts file can express are matched as ordinary globs against every URL, so they work here even where the desktop cannot route them. Offline, the kept blocker settings are re-evaluated with :core's evaluatePolicy, so losing signal does not lose the guard. Two limits are documented rather than papered over: in-app WebViews are invisible to the URL-bar reader, and blocking degrades to reporting without the service. Core keeps the policy/matcher semantics testable on a plain JVM: 190 core and 44 app tests. The screen's copy says junk labels are ignored, a '*' is kept, and unroutable masks are enforced on this phone only.
This commit is contained in:
24 files changed
+1996
-65
No files matched your search
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"settings": {
|
||||
"pomodoro": {
|
||||
"work_minutes": 25,
|
||||
"short_break_minutes": 5,
|
||||
"long_break_minutes": 15,
|
||||
"cycles_before_long_break": 4,
|
||||
"daily_goal_pomodoros": 8,
|
||||
"timer_enabled": true,
|
||||
"strict_mode": false,
|
||||
"allow_pause": true,
|
||||
"auto_start_breaks": false,
|
||||
"auto_start_work": false,
|
||||
"presets": [
|
||||
{"name": "deep", "work_minutes": 50, "short_break_minutes": 10, "long_break_minutes": 20, "cycles_before_long_break": 4}
|
||||
]
|
||||
},
|
||||
"blocker": {
|
||||
"enabled": true,
|
||||
"mode": "scheduled",
|
||||
"block_during_breaks": true,
|
||||
"blocked_domains": ["youtube.com", "*.reddit.com", "*gram*"],
|
||||
"allowed_domains": ["music.youtube.com"],
|
||||
"subdomain_expansions": ["www", "m", "web", "*"],
|
||||
"blocked_apps": ["*discord*", "instagram"],
|
||||
"kill_blocked_apps": false,
|
||||
"schedule": [
|
||||
{"label": "Work mornings", "start": "09:00:00", "end": "12:00:00", "days": [0, 1, 2, 3, 4]}
|
||||
],
|
||||
"strict": true,
|
||||
"notify_on_block": false,
|
||||
"redirect_ip": "0.0.0.0",
|
||||
"app_poll_seconds": 5
|
||||
},
|
||||
"timezone": "Europe/Kyiv"
|
||||
},
|
||||
"defaults": {
|
||||
"blocked_domains": ["*.youtube.com", "twitter.com", "x.com"],
|
||||
"blocked_apps": ["steam*", "discord", "telegram-desktop", "spotify"]
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user