testsAndMisc/docs/superpowers/evidence/phone-backup-and-ublock-2026-08-09.json
Krzysztof kuhy Rudnicki 7b1a1656f7 Back up what adb can actually reach, and block YouTube in Firefox too
phone_backup.sh captures package lists (including what was purged for
user 0), every third-party APK with its splits, /sdcard, all three
settings namespaces, and the focus-mode state. Verified: 54/54 packages,
126 APK files, 5.1 GB, splits intact.

It is deliberately not sold as a full-device backup, because on an
unrooted phone it cannot be one: /data/data is unreachable, so logins,
in-app data and device pairings do not survive. It writes a
RESTORE-BY-HAND.md naming each of those, with a restore order that avoids
a lockout -- mObywatel last, because activating it on a new device
deactivates the old one.

The first two runs pulled 1 of 54 APKs and then 6 of 54: `while read <
file` with adb inside the loop lets adb drain the same stdin. Reading
into an array first fixes it, and verify_backup now compares package
count against the manifest rather than only checking that the files it
did pull are valid zips -- integrity alone called the 1-of-54 run a pass.

Also documents the uBlock Origin filters, which block YouTube in Firefox
independently of RethinkDNS: force-stopping the VPN still leaves
youtube.com blocked by ||youtube.com^. And records what this is worth --
Play offers a one-tap Install for YouTube, the VPN is a few taps from
off, and the uBlock page has a Proceed button. Three independent layers,
none of them tamper-proof; only Device Owner removes the off switch.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JxNrcMDcizNB3XrrYpZF23
2026-08-10 19:43:28 +02:00

49 lines
4.0 KiB
JSON

{
"intent": "Add a second, VPN-independent YouTube block in Firefox, and give the phone a backup script covering everything ADB can actually reach before a possible Device Owner factory reset.",
"scope": [
"phone_focus_mode/phone_backup.sh",
"phone_focus_mode/docs/youtube-block-unrooted.md",
"Non-goal: app private data -- unreachable without root, documented rather than faked",
"Non-goal: tamper-resistance; only Device Owner removes the off switch"
],
"changes": [
"phone_backup.sh captures package lists (including what was purged for user 0), every third-party APK with its splits, /sdcard user data, all three settings namespaces, and the focus-mode state. It ships a RESTORE-BY-HAND.md naming what it cannot restore, and --verify re-reads the artefacts.",
"Documented the uBlock Origin layer: the 8 filters, the import procedure, and why `adb shell input text` must not be used to enter them.",
"Documented measured undo costs for all three layers, including the Play Store finding, so the doc does not overstate the block."
],
"verification": [
{
"command": "./phone_backup.sh --out ~/phone-backup",
"result": "pass",
"evidence": "54/54 packages, 126 APK files, 5.1 GB, 'Verify OK'. Split APKs captured in full (com.termux has base + 5 split_config). Spot-checked 3 random APKs with unzip -t: all OK. pl.infakt.infakt, pl.mbank, com.kunzisoft.keepass.libre and org.thoughtcrime.securesms all present."
},
{
"command": "force-stop com.celzero.bravedns, then load youtube.com in Firefox",
"result": "pass",
"evidence": "'uBlock Origin has prevented the following page from loading: https://m.youtube.com/ ... filter ||youtube.com^ ... found in: My filters'. The layers are independent: killing the VPN does not restore YouTube. Control example.com still loads; VPN restored afterwards."
},
{
"command": "market://details?id=com.google.android.youtube",
"result": "fail",
"evidence": "Google Play shows a live Install button, so the app-removal layer is a ONE-TAP undo -- weaker than the VPN toggle. Not installed; state re-confirmed installed=false. Recorded in the doc rather than left implicit."
},
{
"command": "shellcheck + shfmt on phone_backup.sh",
"result": "pass",
"evidence": "Clean."
}
],
"risks": [
"The first two runs of phone_backup.sh pulled 1 of 54 and then 6 of 54 APKs. Cause: `while read < file` with `adb` inside the loop -- adb inherits and drains the same stdin. Fixed by reading into an array with mapfile first; the same bug was fixed in the .kdbx loop. verify_backup now compares package-directory count against packages-third-party.txt, because an integrity-only check called the 1-of-54 run a pass.",
"Backgrounding the script with nohup truncated it mid-run twice; it must be run in the foreground. Not a script defect but worth knowing before trusting an unattended run.",
"No .kdbx is captured: KeePassDX keeps its database in private storage. Confirmed with the user that the canonical copy lives on the PC, so this is expected here -- downgraded from a warning to an info line, which means a genuinely missing database on some other device would be quieter.",
"infakt (pl.infakt.infakt) is device-paired for banking ('Usun powiazanie z telefonem') and holds a live session with funds and an active card. The account is server-side so login works on a new device, but the pairing and app PIN do not survive a wipe; re-pairing is via SMS to the number registered in-app. 2FA method (SMS vs authenticator) still unconfirmed by the user.",
"uBlock filters live in the Firefox profile and are NOT in the backup; they must be re-added by hand after a wipe."
],
"rollback": [
"git revert removes the script and doc changes; no device state is touched by reverting.",
"Delete a backup directory under ~/phone-backup/ to reclaim space -- each full run is ~5 GB.",
"Remove the uBlock filters from uBlock dashboard -> My filters and press apply."
]
}