A change to phone_focus_mode/config.sh — the location-based Android focus enforcer. Commit 7e59abd, 2026-07-11.
phone_focus_mode is a set of shell scripts running as root (via Magisk) on a rooted Android phone. A daemon polls your GPS location every few seconds. When you're within ~150 m of home, it enters focus mode and disables distracting apps; when you walk away, it re-enables them. The idea is that home should be low-distraction, but you're not locked out of everything when you're out.
"Disable" here means pm disable-user — Android's built-in way to make an app vanish from the launcher and stop running, without uninstalling it. The reverse is pm enable.
Everything hangs off two plain-text lists in config.sh:
WHITELIST — apps that stay enabled during ordinary daytime focus mode.NIGHT_WHITELIST — a much stricter list used only during the night curfew window, 23:00–05:00. It is not a subset expression of the daytime list; it's a separate, deliberately short allow-list. "When in doubt, leave it out."On startup the daemon flattens each list into a state file (whitelist.txt, night_whitelist.txt) and a function is_allowed(pkg) checks the appropriate one for the current time.
The disable sweep only ever looks at third-party packages:
pm list packages -3 -e # -3 = third-party only, -e = currently enabled
System apps (anything preinstalled — Gmail, Google Photos, the stock Clock, the dialer) are never touched by the sweep. The only lever that could disable a system app is a separate list, BLOCKED_SYSTEM_APPS — and on this device that list is intentionally empty, with a blunt warning in the file:
pm disable-user state persists across reboots. A disabled system package across a reboot can trip MediaTek's bootloop protection → recovery → factory wipe (confirmed on the BL9000). So system distraction is handled at the network layer (DNS/iptables), never by disabling the package.
Keep that fact in your pocket — it's why half of this request could not be done in code.
The user wanted three things:
They're third-party apps that weren't on any whitelist. So every time the user got home, the sweep found them via pm list packages -3, saw is_allowed return false, and disabled them. From the user's point of view the app "disappeared." The fix is simply: add them to WHITELIST, and the sweep skips them.
is_allowed now returns true → sweep skips it → stays visibleMetrolist (the music player) was already on the daytime WHITELIST. But a real run might happen at 23:30 — inside the curfew — and the curfew uses the other list. Metrolist wasn't on it, so it got disabled after 23:00. Adding com.metrolist.music to NIGHT_WHITELIST is what actually closes the "run with music" gap.
Gmail, Photos, Keep, the stock Clock, the dialer — all system apps. The sweep can't reach them, and forcing them off means BLOCKED_SYSTEM_APPS, which risks wiping the phone. So that half was declined in code: the safe way to hide a system app is the launcher's own "hide apps" screen, which removes it from view without disabling the package. The diff only does the safe half.
The night list already had org.fossify.clock for morning alarms — but that package isn't installed. The user's actual clock is com.bnyro.clock. So nothing clock-related actually survived the curfew: a dead entry guarding a real need. The change swaps the dead package for the installed one.
The whole system is just: where are you, what time is it, is the app third-party, and which list is it on. Flip the controls and watch each app flip between enabled and disabled. Toggle Before / After to see exactly what this diff changed.
All of it lands in two string arrays in config.sh. Grouped by intent:
WHITELIST)Five open-source apps added, and the dead org.fossify.clock removed from this spot (the installed clock takes its place):
org.mozilla.fenix
-org.fossify.clock
+# --- FOSS replacements for stock/Google apps (unhidden per request; hide the
+# Google originals in the launcher, NOT via package-disable — see the
+# BLOCKED_SYSTEM_APPS note about MTK bootloop/wipe risk on BL9000) ---
+com.bnyro.clock # Clock You
+com.vayunmathur.camera # Camera
+com.rama.teyin # Teyin file manager (replaces Google Files)
+com.yoshi.rain # Rain weather
+com.jksalcedo.librefind # LibreFind (replaces Google Search)
ws.xsoh.etar
(Inline labels shown for clarity; in the file the comments are on their own lines, because the parser only strips whole # lines.)
# --- Email & communication ---
+net.thunderbird.android.beta
com.microsoft.office.outlook
A football-predictions app, wanted during the day but not the night curfew — so it goes on WHITELIST only:
# --- Fitness ---
org.runnerup
+
+# --- Sports / football predictions ---
+de.kicktipp.mbookmark
NIGHT_WHITELIST)Music survives the curfew, and the dead alarm-clock entry is replaced with the installed one:
# Calendar
com.google.android.calendar
ws.xsoh.etar
-# Alarm clock
-org.fossify.clock
+# Alarm clock (Clock You — the installed clock; org.fossify.clock is not present)
+com.bnyro.clock
...
com.kuhy.workout_app
org.runnerup
+# Music player — kept so a night run has music in the background
+com.metrolist.music
enabled=3 (disabled-by-user) to enabled=1 (enabled), and night_whitelist.txt gained com.metrolist.music and com.bnyro.clock with no org.fossify.clock. Package names (e.g. de.kicktipp.mbookmark, and that "Rain" is a weather app) were confirmed off the device, not guessed.
/explain-diff. Grounded in the actual focus_daemon.sh disable sweep and config.sh — behavior verified on device BL9000EEA0000102.