Restore a pulled snapshot onto a TV (0.108.108)
Audit U12: Android 14 refuses to install an older Orbit, so until now a bad install could only be fixed forward. The adb-only receiver (DUMP permission) gains 'restore': only with confirm RESTORE, only while Orbit's screen isn't open, only the files a snapshot takes (schedules, settings and profiles prefs; never the catalogue, sign-in or PIN), every file checked against restore.txt before anything changes, the current data kept aside as before-restore-<time> (last two), and schedules swapped in by rename. tools/restore-tv.sh drives it from the PC. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Executable
+25
@@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env bash
|
||||
# Put a pulled Orbit snapshot back on a TV (8 November 2026, audit U12).
|
||||
# tools/restore-tv.sh <adb-device> <snapshot-folder> e.g. 192.168.0.252:5555 backups/install-0.108.107-.../before
|
||||
# The snapshot folder is one pulled by the install procedure (no_backup/schedule and shared_prefs inside it).
|
||||
# Orbit is force-stopped first; the TV keeps what it had in no_backup/before-restore-<time> (the last two are kept).
|
||||
# Only schedules, settings and profiles come back; never the library catalogue, the sign-in or the PIN.
|
||||
set -euo pipefail
|
||||
A=${ADB:-/opt/android-sdk/platform-tools/adb}; D=$1; SNAP=$(cd "$2" && pwd)
|
||||
[ -d "$SNAP/no_backup/schedule" ] || { echo "Not a snapshot folder: $SNAP"; exit 1; }
|
||||
REMOTE=/sdcard/Android/data/tv.orbit.classic/files/install-restore
|
||||
STAGE=$(mktemp -d); trap 'rm -rf "$STAGE"' EXIT
|
||||
( cd "$SNAP" && find no_backup/schedule -type f; for p in shared_prefs/orbit_settings.xml shared_prefs/orbit_profiles.xml; do [ -f "$p" ] && echo "$p"; done ) | sort > "$STAGE/list"
|
||||
( cd "$SNAP" && xargs -d '\n' sha256sum < "$STAGE/list" ) > "$STAGE/restore.txt"
|
||||
echo "restoring $(wc -l < "$STAGE/list") files from $SNAP"
|
||||
read -r -p "Type RESTORE to put this snapshot back on $D: " ok; [ "$ok" = "RESTORE" ] || { echo "Not restored."; exit 1; }
|
||||
$A -s "$D" shell am force-stop tv.orbit.classic
|
||||
$A -s "$D" shell rm -rf "$REMOTE"
|
||||
$A -s "$D" push "$SNAP/no_backup" "$REMOTE/no_backup" >/dev/null
|
||||
[ -d "$SNAP/shared_prefs" ] && $A -s "$D" push "$SNAP/shared_prefs" "$REMOTE/shared_prefs" >/dev/null
|
||||
$A -s "$D" push "$STAGE/restore.txt" "$REMOTE/restore.txt" >/dev/null
|
||||
$A -s "$D" shell am broadcast -f 0x20 -n tv.orbit.classic/.InstallSnapshotReceiver -a tv.orbit.classic.INSTALL_SNAPSHOT --es do restore --es confirm RESTORE | grep -o 'data="[^"]*"'
|
||||
$A -s "$D" shell am force-stop tv.orbit.classic
|
||||
$A -s "$D" shell rm -rf "$REMOTE"
|
||||
$A -s "$D" shell am start -n tv.orbit.classic/.MainActivity >/dev/null
|
||||
echo "Orbit restarted. Take a snapshot and compare it with $SNAP to check."
|
||||
Reference in New Issue
Block a user