Use user-confirmed package sessions for TV updates

Stage the verified download with Android PackageInstaller rather than launching a loose APK file. Label the package source accurately, require user confirmation, and return to Luma after a self-update.
This commit is contained in:
Elijah Kuntz 2026-10-18 09:00:55 -07:00
parent 0d1a11d943
commit c04dcca60d
10 changed files with 147 additions and 28 deletions

View file

@ -2,7 +2,7 @@
A native, remote-first launcher built for the onn. 4K Plus Streaming device (Android 14, 2 GB RAM). It is installed alongside Projectivy as `tv.luma.launcher`. Home now opens Luma; Projectivy remains installed and enabled as a fallback.
Version **1.1.1** adds updates directly from the TV and includes the wake fix introduced in 1.0.1. Every resume restores missing images, including when Android briefly pauses the launcher without stopping it. Already-loaded tiles and images are kept on pause-only resumes; leaving the launcher still releases image memory.
Version **1.1.3** adds updates directly from the TV and includes the wake fix introduced in 1.0.1. Every resume restores missing images, including when Android briefly pauses the launcher without stopping it. Already-loaded tiles and images are kept on pause-only resumes; leaving the launcher still releases image memory.
## Use it
@ -82,7 +82,7 @@ The default public HTTPS feed is:
https://git.elijahkuntz.com/Elijah/Luma/raw/branch/main/output/update.json
```
No SSH key or Forgejo account token is stored on the TV. For branch-based Forgejo URLs, Luma resolves the branch to a commit first, then reads both the manifest and APK from that immutable commit. It bounds metadata to 64 KiB and APK downloads to 32 MiB. Before opening the installer, it checks the expected SHA-256 and file size, package name, increasing version code, Android compatibility, and the installed signing certificate. A different signing key is rejected. The provider grants read-only access to exactly the verified APK URI. Interrupted downloads are removed; completed APKs are removed after the updated app starts.
No SSH key or Forgejo account token is stored on the TV. For branch-based Forgejo URLs, Luma resolves the branch to a commit first, then reads both the manifest and APK from that immutable commit. It bounds metadata to 64 KiB and APK downloads to 32 MiB. Before opening the installer, it checks the expected SHA-256 and file size, package name, increasing version code, Android compatibility, and the installed signing certificate. A different signing key is rejected. The verified APK is copied into a private Android PackageInstaller session marked as a downloaded file, with user confirmation required. Interrupted downloads are removed; completed APKs are removed after the updated app starts.
### Publish an update