Commit Graph

17 Commits

Author SHA1 Message Date
c80f7cc112 morning_routine: unified alarm+lock orchestrator, fix alarm audio/reliability
- New python_pkg/morning_routine package: sequential orchestrator runs wake
  alarm then workout lock as blocking subprocesses (one fullscreen owner at
  a time). Deployed as morning-routine.service; sleep hook updated to start
  it on hibernate-resume instead of the standalone wake-alarm.service.

- wake_alarm: force G27Q HDMI card profile on at alarm time, poll up to 6s
  for sink to appear, set as default + unmute 100%. Alarm now persists until
  the typeable code is entered (no more silent 30-min give-up). Service gets
  DISPLAY=:0 + ExecStartPre sleep 1 to fix cold-boot Tkinter crash.

- phone_focus_mode/config.sh: whitelist Revolut, mObywatel, VaultKitBypass.

- 100% branch coverage maintained across wake_alarm and morning_routine.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-25 18:55:27 +02:00
dd3191d961 phone_focus_mode: fix YouTube DNS blocking via netd cache restart
- Added restart_netd_for_hosts_cache() to hosts_enforcer.sh with PID-stamp
  deduplication to prevent double-restarts across enforcer invocations
- Removed explicit netd restart from deploy.sh (caused double-restart
  that broke ConnectivityService binder link and dropped default route)
- deploy.sh: wait 10s after starting focus_daemon.sh for enforcer to
  complete its single netd restart before companion app install
- Misc updates to dns_enforcer.sh and config.sh
2026-05-22 15:58:36 +02:00
84632cef34 chore: spring-clean repo root (move docs, relocate batch3 script, drop stale outputs)
- Move 7 loose top-level Markdown reports under docs/cleanup-2026-05/.
- Relocate batch3_bloatware_uninstall.sh into phone_focus_mode/ where its
  ADB/phone wiring belongs.
- Delete tracked out.json (empty puzzle_solver fixture).
- Remove untracked clutter (mp4/wav/lcov/log/txt) from the working tree.
2026-05-14 20:01:09 +02:00
c9923542fc Optimize polling/runtime scripts, add regressions, and sync verification artifacts 2026-05-10 02:58:11 +02:00
00c383008a phone_focus_mode: prevent Magisk app from disabling Systemless Hosts module
The Magisk app's Modules tab "Disable" / "Remove" buttons work by
creating marker files (disable, remove) in /data/adb/modules/hosts/.
Tapping Disable in the app on next boot would skip the module's
magic-mount of /system/etc/hosts, silently disabling all hosts-file
blocking.

Defense in depth:

1. deploy.sh chattr +i's the module dir + its hosts file so the
   Magisk app cannot create disable/remove markers (kernel returns
   EPERM). The +i attribute survives reboot.

2. hosts_enforcer.sh adds protect_magisk_module(): every poll cycle
   (and on startup) scans for disable/remove/update markers, deletes
   them, logs TAMPER, and re-asserts +i on the dir. Safety net in
   case the lock is bypassed.

3. sync_magisk_module() now drops +i briefly before its cp and
   re-locks via protect_magisk_module() so workout-state hosts
   swaps still work.

4. deploy.sh detects the previously-silent failure mode of the
   module being enabled on disk but not yet magic-mounted (no
   /system/etc/hosts) and aborts with a clear reboot-required
   message instead of producing a deploy that does nothing.

5. focus_ctl.sh hosts-status now prints the lock state and warns
   about any present markers.

Verified end-to-end on BL9000EEA0000102:
- Pre-reboot: chattr +i set, touch /data/adb/modules/hosts/disable
  returns Operation not permitted.
- Post-reboot: /system/etc/hosts magic-mounted (178303 lines, sha
  matches canonical), lock survives reboot, ping youtube.com -> 127.0.0.1.
- Tamper test: chattr -i + touch disable -> enforcer logs
  'TAMPER: removed Magisk module marker' within 15s and re-locks.

Documented intentional override path inline (focus_ctl.sh hosts-stop;
chattr -i; touch disable).
2026-05-06 21:40:51 +02:00
fa24f22ca0 Apply focus-mode, screen-locker, and steam backlog updates 2026-05-03 22:41:53 +02:00
589e059eee feat(phone-focus): add recovery workflow, automation scripts, and docs 2026-05-01 19:07:27 +02:00
135ef0c62d phone_focus_mode: add persistent home-mode status notification
- New companion Android app (com.kuhy.focusstatus) under
  phone_focus_mode/focus_status_app/ with a pure-Java, Gradle-less
  command-line build pipeline (build.sh). Shows an ongoing
  notification titled 'Focus: HOME / AWAY / DAEMON DOWN' with
  distance, GPS, disabled-app count, last check, daemon checkmarks,
  and a 'Re-check now' action button.
- focus_daemon.sh: write_status_snapshot() + sleep_with_recheck()
  for JSON status + early-wake on trigger file. init() chmods
  STATE_DIR 777 so the app can drop the trigger file.
- config.sh: new STATUS_FILE / RECHECK_TRIGGER; WHITELIST expanded
  with com.kuhy.focusstatus and 11 more user-requested apps
  (podcini X, mpv, bible/openbible, pkp/portalpasazera, orange,
  runnerup, splitbills/splitwise, xiaomi smarthome).
- focus_ctl.sh: new 'recheck' + 'notif-status' subcommands.
- deploy.sh: new step [7/7] builds APK, installs, grants
  POST_NOTIFICATIONS, pre-approves Magisk SU policy, launches
  foreground service.
- .gitignore: exclude focus_status_app/build symlink + debug.keystore.

End-to-end verified on device: notification live with real values;
Re-check button triggers a daemon location check within ~1s.
2026-04-20 15:33:46 +02:00
fe0b915f88 feat: make horatio audio work on android 2026-03-30 20:18:33 +02:00
ccb40ae635 fix: phone focus mode daemon survival across reboots
- Fix PID reuse bug: validate /proc/cmdline before assuming daemon is running
- Add log rotation using existing LOG_MAX_LINES config (was 7MB/70K lines)
- chmod 666 state files on init and deploy to prevent permission drift
2026-03-27 16:04:50 +01:00
ee68d47a4c feat: improvements in hosts bluetooth focus mode and backglog scripts 2026-03-11 20:47:03 +01:00
de98faafc9 feat: robotgo improvements in phone focus bluetooth and printer scripts 2026-03-09 18:34:15 +01:00
e76c2c68ee feat: steam 100 percent extension 2026-03-02 20:29:32 +01:00
253b327b72 fix: bluetooth optimze arch desktop phone foucs mode and no secres 2026-03-02 19:13:22 +01:00
bf4a8ce173 refactor: move home coordinates to gitignored secrets file 2026-03-02 12:57:34 +01:00
2a8d61088b chore: added delio option 2026-02-23 22:09:52 +01:00
f4f25821e5 feat: shell scripts 2026-02-22 16:57:36 +01:00