Back up Orbit to my phone: sealed on the TV, previewed and restored safely, with undo (0.128.0)
Companion More > Back up and restore, in both editions. The file is sealed on the TV (AES-256-GCM, key from the TV's backup code with PBKDF2) and the code is shown and typed only on the TV. No sign-in, token, PIN, phones, room keys or box switches. Versioned header bound into the seal, checksums outside and in. Restore: TV preview, this TV's data kept aside, a journal, then put in place first thing on restart; three failed starts put the old data back. Undo in Settings > Rooms and phones. Also fixes two remote-focus bugs found on the emulator: Right from Emby on the first-launch server step escaped into the hidden sign-in form, and Connect, Add a room and Bring in jumped to Settings > Channels. Report: docs/PHONE-BACKUP-2026-11-10.md (incl. the password-field accessibility finding). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -63,9 +63,9 @@ What still works, in order of preference:
|
||||
4. **Server-side.** Watched status and resume points also live on Emby or Jellyfin when progress reporting is on.
|
||||
5. **Not available on Play:** Android's own backup is off for Orbit (`allowBackup=false`, so tokens never leave the TV), and there's no adb snapshot.
|
||||
|
||||
**Gap worth closing before launch:** a user-run "Back up Orbit to my phone" in the Companion. It would export the
|
||||
schedules, profiles, Taste and Continue Watching, but no sign-in or PIN, and restore them on a Play install without adb.
|
||||
It isn't built. It needs your OK.
|
||||
**Update, later on 10 November:** the gap is closed on branch `phone-backup-0.128`. "Back up Orbit to my phone" is in the
|
||||
Companion (More › Back up and restore), works the same in both editions, and needs no adb. See
|
||||
`docs/PHONE-BACKUP-2026-11-10.md`.
|
||||
|
||||
## 5. Checking the existing key backups, done by you
|
||||
|
||||
|
||||
@@ -0,0 +1,170 @@
|
||||
# Back up Orbit to my phone, the password field, and Play smoke tests (10 November 2026)
|
||||
|
||||
Branch `phone-backup-0.128` (from `editions-0.127`). Development branch and disposable emulator only. No production key was
|
||||
created or used, nothing was signed for release, and nothing was installed on either household TV. The emulator builds were
|
||||
signed with a throwaway key, which was shredded afterwards. Only fictional media (the Silo test server's fixtures) and fictional
|
||||
credentials were used, apart from the Silo test account from silo-test's own settings.
|
||||
|
||||
## 1. What was built
|
||||
|
||||
**For you, in the Companion:** More › Back up and restore. "Back up this TV" saves one file to the phone. "Restore from a
|
||||
backup" sends one back. Everything that matters happens on the TV:
|
||||
|
||||
- **Making a backup.** The TV shows its backup code: 16 letters and numbers in fours, like `K7QM-2XTR-9HFD-W3PA`. It's the
|
||||
same code for every backup from that TV, and it's shown each time.
|
||||
- **Restoring.** You type the code on the TV with the remote. The TV then shows what's in the backup beside what's on the
|
||||
TV now, plus anything to know first. Restore asks for the Adult PIN if one is set. Orbit keeps this TV's data aside, then
|
||||
restarts and puts the backup in place before anything reads the data.
|
||||
- **Undoing.** Settings › Rooms and phones › Undo the restore puts the earlier data back the same way. Undo can itself be
|
||||
undone ("Put the restore back").
|
||||
|
||||
**Same in both editions.** It's in the shared code, so Play and household work the same, and a backup moves between them.
|
||||
|
||||
### Security
|
||||
|
||||
| Requirement | How |
|
||||
| --- | --- |
|
||||
| Local first | Phone to TV over the home Wi-Fi, through the existing Companion link. No cloud, no account. |
|
||||
| Authenticated | Only a joined phone (the Companion's code, plus the Adult PIN when set), Adult only. Changes need the `X-Orbit` header a cross-site page can't send. A large upload is read only after the phone's cookie has been checked. |
|
||||
| Encrypted in transit | The TV seals the file before it leaves (AES-256-GCM, key from the code with PBKDF2-HMAC-SHA256 at 210,000 rounds). The phone only ever holds the sealed file, in both directions. The code is shown on the TV screen and typed on the TV remote, so it never crosses the network. The code card is kept out of screenshots and screen recording (FLAG_SECURE). |
|
||||
| No credentials, tokens or PINs | Never included: the sign-in and its token, the library copy, the Adult PIN, joined phones, the rooms' sync keys, and this box's own switches (sound output, provider catalogue, frame rate, AVI, even volume). Any file containing something shaped like a token is left out, and the preview says so. |
|
||||
| Versioned | Line one is `ORBIT-BACKUP 1`. A newer format, or a backup from a newer Orbit build, is refused with "Update Orbit on this TV". |
|
||||
| Integrity | The header carries the sealed part's size and SHA-256, so a cut-short or damaged file is caught before the code is asked for. The header is bound into the seal, so it can't be changed either. Inside, every file is listed with its SHA-256 and checked. Names outside the allowed folders, extra files and missing files are all refused. |
|
||||
| Compatibility | The preview flags a backup from a different server, a different account, the other edition, or one over 14 days old, plus any files left out. |
|
||||
| Clear preview, nothing silent | Nothing changes until Restore is chosen on the TV, after the preview. This TV's data is kept aside first. The last two copies kept aside are retained. |
|
||||
|
||||
**What goes in:** settings (the look, Arcade bests and the rest), the room's name, profiles, every channel's files
|
||||
(including your own channels), schedules and progress, Taste, Continue Watching (and what's been removed from it), Drive-In
|
||||
bookings and tickets, the Director's Chair decisions, and the Arcade's saves and records. A downstairs-sized household (146
|
||||
files, 19 MB) comes to about 7 MB.
|
||||
|
||||
### How a restore can't be left half done
|
||||
|
||||
1. Keep this TV's data aside in a `.part` folder, then rename it when complete.
|
||||
2. Write `journal.json` whole.
|
||||
3. Restart Orbit.
|
||||
4. First thing on start, swap each folder in with renames, then write the settings. Every step can be run again.
|
||||
|
||||
What an interruption does:
|
||||
|
||||
- **Before the journal:** nothing has changed. The next start clears the part-made copy.
|
||||
- **After the journal:** the next start finishes the restore.
|
||||
- **If a start fails three times:** the data kept aside goes back.
|
||||
|
||||
An opened backup that was never confirmed is removed from the TV.
|
||||
|
||||
## 2. Test results
|
||||
|
||||
### Unit tests
|
||||
|
||||
Run on this PC. Everything in them is made up.
|
||||
|
||||
15 new tests in `PhoneBackupTest` and one in `PhoneLinkTest` cover:
|
||||
|
||||
- What goes in and what never does (no PIN, phones, sync keys, box switches or sign-in, and nothing readable in the sealed file).
|
||||
- A file shaped like a token is left out.
|
||||
- The wrong code opens nothing.
|
||||
- A file cut short, with lines missing, with one character changed, or with its header edited is refused.
|
||||
- Zips with `../` paths, disallowed names, changed checksums or unlisted files are refused, and nothing is written outside.
|
||||
- Restore replaces the household's data, keeps this box's own, and Undo puts back exactly what was there.
|
||||
- A **power cut at each of the 8 steps of putting data in place** is followed by a start that finishes the restore.
|
||||
- A restore that fails three times puts the old data back.
|
||||
- An interrupted keep-aside changes nothing.
|
||||
- Only two copies are kept aside.
|
||||
- The code reads back correctly with O/0 and I/L/1 mix-ups, and the typed code shows in fours with the cursor in the right place.
|
||||
- Backup routes need a joined phone, and only a joined phone may send a large file.
|
||||
|
||||
### On the Android TV 14 emulator
|
||||
|
||||
Builds 400 and 402 with this code, signed with a throwaway key. Silo test server, fictional media only.
|
||||
|
||||
| Check | Result |
|
||||
| --- | --- |
|
||||
| **Programme playback on Play** | Made "Fixture TV" (701) from Silo's fictional film and series through the Companion. It planned and came on by itself, then played full screen, with frames advancing across several programmes. A Catch Up replay also played. |
|
||||
| **Arcade on Play** | Opened from the Companion. Played Star Chase, which saved the record ("New best 80"). The record carried through backup and restore. |
|
||||
| Backup made on Play, during a programme | The code card appeared over the programme with Done focused. The file is 205 KB. |
|
||||
| Opened independently | Opened with Python's `cryptography`, not Orbit's code. All 25 files matched their checksums. The Silo password, any token and any server address are absent from the file. |
|
||||
| Cut in half / lines missing / one character changed / a photo | Each refused, with its reason shown on the phone. The TV stayed as it was. |
|
||||
| Wrong code on the TV | "That code didn't open this backup." |
|
||||
| Restore on the same TV | Removed the profile "Tester", then restored. Orbit restarted by itself and Tester was back. The phone stayed joined. |
|
||||
| Undo | Settings › Undo › Yes, restart Orbit. Tester was gone again ("Undone"). |
|
||||
| **Play backup restored onto a new household install** | Uninstalled Play, installed household 400 and signed in, then restored the Play backup. |
|
||||
| **Interrupted restore** | Force-stopped Orbit 0.6 seconds after Restore, before it restarted. On the next open: "Restored", with profiles and the channel back. |
|
||||
| Data after restore | Compared with a fresh backup of the restored TV: **23 of 25 files byte for byte the same.** The other two are live state: the Director's report (rebuilt at start) and the channel's place (it kept playing). The restored channel played straight away, and the household TV adopted the backup's code. |
|
||||
| Phone page | In the in-app browser: making a backup started the download with the right file name. Restore showed each refusal's reason, then "Now go to the TV…". |
|
||||
|
||||
**Not covered on the emulator:**
|
||||
|
||||
- **Taste and Continue Watching data.** The fixture programmes last 15 seconds. Taste needs 5 to 20 minutes and Continue
|
||||
Watching 3 minutes, so none was created to carry. The unit tests carry them.
|
||||
- **Drive-In tickets.** The Drive-In had no showings.
|
||||
- **A power cut during the start-up swap on a real device.** The unit tests cover every step.
|
||||
|
||||
### Bugs found and fixed on the way
|
||||
|
||||
- **First launch (existing bug):** on "Where are your films and series?", Right from Emby jumped into the hidden sign-in form
|
||||
behind the step and raised the keyboard. The form can no longer take the remote's focus while a step covers it.
|
||||
- **Settings › Rooms and phones (existing since 0.111, seen on the emulator):** Connect, Add a room and Bring in opened Settings
|
||||
› Channels instead. With the button gone, Android handed focus to the first item on the left. The focus now stays on Rooms
|
||||
and phones.
|
||||
- **In the new screens, before you saw them:**
|
||||
- The code card was hidden behind a programme playing full screen.
|
||||
- The on-screen keyboard stopped after one letter.
|
||||
- Letters went in out of order.
|
||||
- The field lost focus while a code was being checked.
|
||||
- Down didn't leave the field.
|
||||
|
||||
## 3. The password field and accessibility
|
||||
|
||||
Tested with fictional credentials only (`fictional-viewer` / `Fictional-Pa55`). Afterwards TalkBack was turned off, Android's
|
||||
setting put back, and the log cleared. The fictional Wi-Fi network used for comparison was not saved.
|
||||
|
||||
| | Orbit's sign-in password | Android's own password field (Wi-Fi) |
|
||||
| --- | --- | --- |
|
||||
| What any accessibility service reads (uiautomator) | **`Fictional-Pa55`, in full**, marked as a password, whatever the setting | `••••••••••••••` in both settings |
|
||||
| TalkBack, "Speak passwords" **on** (this TV image's default) | **Spoken aloud on focus: "Fictional-Pa55, End of field"** | Typed keys spoken one by one. Its focus announcement wasn't captured |
|
||||
| TalkBack, "Speak passwords" off | "Editing, password, 14 characters, Edit box". Typed keys as "Dot" | Dots |
|
||||
|
||||
**Conclusion: yes, the password is exposed.**
|
||||
|
||||
- With TalkBack on and its default setting, the whole password is read out every time the field gets focus.
|
||||
- Any app with accessibility access can read it in full. Android's own fields give those apps only dots.
|
||||
- On screen it's dots, and it isn't logged or saved by Orbit.
|
||||
|
||||
The cause: Compose's `BasicSecureTextField` reports its real text to accessibility. It marks the field as a password, but it
|
||||
doesn't mask the text the way Android's own fields do.
|
||||
|
||||
**Options to fix it (not done, as this was an investigation):**
|
||||
|
||||
1. Use Android's own password field (`EditText`, `textPassword`) inside the Compose form. It masks exactly as the system
|
||||
does. It needs the remote's focus checked on both TVs' Android versions.
|
||||
2. Keep Compose, but replace the field's accessibility text with dots and keep the edit actions TalkBack needs.
|
||||
|
||||
I'd recommend option 1.
|
||||
|
||||
## 4. Remaining security and recovery risks
|
||||
|
||||
1. **A lost backup code makes its backups useless.** That's intended: nobody, Orbit included, can open them without it. The
|
||||
code shows on every backup, and a TV that has restored keeps the same code.
|
||||
2. **The code is stored on the TV in Orbit's private storage, not the Android Keystore.** Android's own backup is off for
|
||||
Orbit, so it isn't copied off the TV, but a rooted box could read it. It could move into the Keystore later.
|
||||
3. **The phone page itself comes over plain http**, as the whole Companion does. Someone already able to tamper with your home
|
||||
network could change the page in transit. They still couldn't open a backup or see the code.
|
||||
4. **Restarting by itself is unverified on the Xiaomi boxes.** It worked on the emulator. If Orbit doesn't reopen, the card
|
||||
says to open it again, and the restore finishes then (tested).
|
||||
5. **A restore needs room for two extra copies of the data** while it runs. For downstairs that's about 40 to 60 MB, briefly.
|
||||
6. **Restoring a backup from a different server is allowed, with a warning.** Titles that server doesn't have won't play
|
||||
until Orbit plans again.
|
||||
7. **Not yet timed on a real box.** That covers building and sealing a full-size (about 7 MB) backup, and opening one, which
|
||||
stretches the code on purpose.
|
||||
8. **The password field exposure (section 3) is unfixed.** It affects the sign-in screen only.
|
||||
|
||||
## 5. Builds and the release gate
|
||||
|
||||
- Version 0.128.0, build 41: household 410, Play 412. Unsigned.
|
||||
- The emulator runs used this code as build 40 (400 and 402), before the number was raised.
|
||||
- **Release gate passed:** household 1,172 tests and Play 1,161, with 0 failures and 0 lint errors. The editions check also
|
||||
passed: Play is still isolated, the household build is intact, and nothing is signed.
|
||||
- SHA-256: household `728e51f1…71b8`, Play APK `b4544c72…8951`, Play bundle `09411b2b…0727`.
|
||||
- **One flaky step:** the gate's packaging of the Play APK failed twice out of four full runs, then passed when run again
|
||||
unchanged. It looks like a Gradle packaging flake, not this change, but I'll watch it in CI.
|
||||
Reference in New Issue
Block a user