testsAndMisc/docs/superpowers/specs/DOCS-2026-05-01-phone-focus-recovery-design.md
Krzysztof kuhy Rudnicki 49d82511c3 Adopt the four markdown namespaces and gate them
Renames this repo's markdown onto README.md / CLAUDE*.md / DOCS*.md /
TODO*.md so a future session can tell a live task from a finished
record without reading the file to find out.

TODO files carry the literal "REMOVE ME AFTER FINISH" and are deleted
when the work lands. Enforced by the md-naming pre-commit hook and CI
workflow, both delegating to the shared gate in kuhyx/utils so this
repo's idea of a valid name cannot drift from every other repo's.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A47aX5DJwmA3QFn3pkEWi7
2026-08-24 15:55:46 +02:00

52 lines
2.1 KiB
Markdown

---
post_title: "Phone focus recovery design"
author1: "GitHub Copilot"
post_slug: "phone-focus-recovery-design"
microsoft_alias: "copilot"
featured_image: ""
categories:
- "Documentation"
tags:
- "android"
- "adb"
- "backup"
- "shell"
ai_note: "AI-assisted design document"
summary: "Design for a rooted-Android recovery, backup, monitoring, and one-command orchestration workflow built on phone_focus_mode."
post_date: "2026-05-01"
---
## Goal
Create a repeatable rooted-Android management workflow that can:
- restore a freshly formatted phone to the previously hardened state
- back up important phone state whenever the phone appears on this PC
- monitor security and device-health drift over time
- expose one highly visible entrypoint at `scripts/run_all/run_phone.sh`
The design must build on the existing `phone_focus_mode/` deployment system
instead of replacing it with a second parallel toolchain.
## Existing foundation
The existing `phone_focus_mode/` implementation already provides the core
security stack:
- `deploy.sh` deploys the focus scripts and companion app over ADB
- `focus_daemon.sh` enforces location-based focus restrictions
- `hosts_enforcer.sh` protects `/system/etc/hosts`
- `dns_enforcer.sh` forces DNS behavior that respects the hosts file
- `launcher_enforcer.sh` keeps the approved launcher installed and pinned
- `magisk_service.sh` restores the protections automatically on boot
The new workflow should reuse these assets rather than re-implement them.
Split into one file per area to stay under the 250-line cap.
- [Approved user experience, file layout and backup storage](2026-05-01-phone-focus-recovery/01-experience-and-layout.md)
- [Command modes, repair policy and device detection](2026-05-01-phone-focus-recovery/02-commands-and-repair.md)
- [Monitoring scope and the report contract](2026-05-01-phone-focus-recovery/03-monitoring.md)
- [Restore priority, backup policy and documentation requirements](2026-05-01-phone-focus-recovery/04-restore-and-policy.md)
- [Automation safety rules, testing expectations and non-goals](2026-05-01-phone-focus-recovery/05-safety-and-testing.md)