From 98ca3ac56a8c2a097e5b0c6bde21b27a571aaf8b Mon Sep 17 00:00:00 2001 From: Krzysztof kuhy Rudnicki Date: Sat, 22 Aug 2026 16:26:52 +0200 Subject: [PATCH] Whitelist com.kuhy.lyricanki in focus mode Focus Owner hides every package absent from the allowlist, so a newly installed lyricanki was installed=true but hidden=true: absent from the launcher and from `pm list packages`, and `am start` reported the activity did not exist even though dumpsys listed its MAIN/LAUNCHER filter. Nothing about the app itself was wrong. policy.json is regenerated from config.sh by python_pkg.focus_policy, never hand-edited. Also drops com.android.launcher3 and com.android.camera2 from SYSTEM_NEVER_DISABLE. That list is prefix-matched and both are strict supersets of entries already in it, so coverage is byte-identical; this keeps config.sh under the 250-line cap without weakening the policy. com.android.settings stays: its only shorter match is com.android.se, an accidental substring rather than intent. Verified on the phone: signer matched so the Device Owner upgraded in place, dpm still reports DeviceOwner, lyricanki flipped to hidden=false, and workout_app + the dialer are untouched. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01RAEChhK3sWGxd6ucsUQmcT --- .../lyricanki-focus-whitelist-2026-08-22.json | 45 +++++++++++++++++++ focus_owner/assets/policy.json | 3 +- phone_focus_mode/config.sh | 3 +- 3 files changed, 47 insertions(+), 4 deletions(-) create mode 100644 docs/superpowers/evidence/lyricanki-focus-whitelist-2026-08-22.json diff --git a/docs/superpowers/evidence/lyricanki-focus-whitelist-2026-08-22.json b/docs/superpowers/evidence/lyricanki-focus-whitelist-2026-08-22.json new file mode 100644 index 00000000..1fa21200 --- /dev/null +++ b/docs/superpowers/evidence/lyricanki-focus-whitelist-2026-08-22.json @@ -0,0 +1,45 @@ +{ + "intent": "Let a newly installed lyricanki appear on the phone. Focus Owner hides every package absent from the allowlist, so lyricanki installed as installed=true hidden=true: missing from the launcher and from `pm list packages`, and `am start` reported the activity did not exist even though dumpsys listed its MAIN/LAUNCHER filter.", + "scope": [ + "phone_focus_mode/config.sh - add com.kuhy.lyricanki to WHITELIST", + "focus_owner/assets/policy.json - regenerated, never hand-edited", + "Non-goal: night curfew. lyricanki is a day-list app only.", + "Non-goal: any change to enforcement logic." + ], + "changes": [ + "Added com.kuhy.lyricanki to the 'kuhy's own apps' block of WHITELIST, alphabetically.", + "Regenerated policy.json via `python3 -m python_pkg.focus_policy --redact-home`; the diff is the single added entry in allowed_packages.", + "Dropped com.android.launcher3 and com.android.camera2 from SYSTEM_NEVER_DISABLE. Both are strict supersets of entries already present (com.android.launcher, com.android.camera) and that list is prefix-matched, so coverage is unchanged; this kept config.sh under the 250-line cap without weakening the policy. com.android.settings was NOT removed: its only shorter match is com.android.se, an accidental substring rather than intent." + ], + "verification": [ + { + "command": "python3 -c \"json ... never_disable_prefixes coverage check\"", + "result": "pass", + "evidence": "launcher3 covered: True, camera2 covered: True, settings covered: True - prefix semantics identical before and after the two removals." + }, + { + "command": "bash ~/.claude/scripts/phone_deploy.sh ~/testsAndMisc/focus_owner --release", + "result": "pass", + "evidence": "release signer 9dcc2e6c...f846 matched the installed APK's signer, so `adb install -r` was an in-place upgrade with no uninstall. 'Success'." + }, + { + "command": "adb shell dpm list-owners", + "result": "pass", + "evidence": "User 0: admin=com.kuhy.focus_owner/.FocusDeviceAdminReceiver,DeviceOwner - Device Owner survived the upgrade." + }, + { + "command": "adb shell dumpsys package | grep hidden", + "result": "pass", + "evidence": "com.kuhy.lyricanki hidden=false (was true). Regression spot-checks: com.kuhy.workout_app hidden=false, org.fossify.phone hidden=false." + } + ], + "risks": [ + "Reinstalling the Device Owner app is unrecoverable if the signature ever differs: DO cannot be re-provisioned on an unrooted Pixel without a factory reset. Mitigated by comparing the keystore's SHA-256 against the installed APK's before building, and by pulling the live versionCode 2 APK as a rollback artifact first.", + "A misparsed allowlist could hide the dialer or launcher. Checked explicitly after install rather than assuming." + ], + "rollback": [ + "adb install -r /focus_owner-installed-vc2.apk (pulled from the device before the upgrade; same signer, so it reinstalls in place).", + "git revert the config.sh + policy.json commit and regenerate.", + "After rollback confirm: dpm list-owners still reports DeviceOwner, and org.fossify.phone is hidden=false." + ] +} diff --git a/focus_owner/assets/policy.json b/focus_owner/assets/policy.json index b622476a..7358e942 100644 --- a/focus_owner/assets/policy.json +++ b/focus_owner/assets/policy.json @@ -11,6 +11,7 @@ "com.kuhy.diet_guard_app", "com.kuhy.focus_owner", "com.kuhy.home_inventory", + "com.kuhy.lyricanki", "com.kuhy.untools", "com.kuhy.wake_alarm_sync", "com.kuhy.workout_app", @@ -65,7 +66,6 @@ "android", "com.android.bluetooth", "com.android.camera", - "com.android.camera2", "com.android.captiveportallogin", "com.android.certinstaller", "com.android.contacts", @@ -76,7 +76,6 @@ "com.android.inputmethod", "com.android.keychain", "com.android.launcher", - "com.android.launcher3", "com.android.location", "com.android.messaging", "com.android.mms", diff --git a/phone_focus_mode/config.sh b/phone_focus_mode/config.sh index 5717ce88..ea04aa7e 100755 --- a/phone_focus_mode/config.sh +++ b/phone_focus_mode/config.sh @@ -123,6 +123,7 @@ com.kunzisoft.keepass.libre # --- kuhy's own apps --- com.kuhy.diet_guard_app com.kuhy.home_inventory +com.kuhy.lyricanki com.kuhy.untools com.kuhy.wake_alarm_sync com.kuhy.workout_app @@ -204,7 +205,6 @@ pl.infakt.infakt # just the filter. Must outrank every enforcement branch. com.celzero.bravedns com.android.launcher -com.android.launcher3 com.android.settings com.android.systemui com.android.phone @@ -224,7 +224,6 @@ com.android.vpndialogs com.android.se com.android.emergency com.android.camera -com.android.camera2 com.android.documentsui com.android.externalstorage com.android.keychain