Skip to content

Publish Android APKs with releases and install updates in the app - #384

Merged
quanticstudios merged 4 commits into
mainfrom
apk-release-update
Nov 12, 2026
Merged

quanticstudios merged 4 commits into
mainfrom
apk-release-update

Conversation

@quanticstudios

@quanticstudios quanticstudios commented Nov 12, 2026 •

Copy link
Copy Markdown
Owner

BLUF

Publish signed Android APKs with releases and install phone updates inside the app.

Changes

  • Release script: build the arm64 APK in a clean tagged worktree with the maintainer's existing key.
  • Version check: require the stamped version to match the stable release tag before uploading; skip pre-releases.
  • Manifest: assert both installer inserts, key gogio by the patch hash, and check the built APK before upload.
  • Cleanup: remove the temporary worktree after success or failure and print the retry command on failure.
  • Missing prerequisites: keep tagging successful and print the APK retry command.
  • Settings: Check for updates runs immediately and reports Checking…, Up to date, a failure reason, or an available version.
  • Automatic checks: retain the default-on daily toggle and the quiet session-list offer.
  • Downloads: require HTTPS on GitHub's download hosts, including redirects; restrict github.com paths to this repository's release assets.
  • Size check: require the downloaded byte count to match the release API's asset size.
  • Progress: retain the latest byte count atomically and invalidate the window without filling its UI queue.
  • Cache: sweep partial APKs on idle startup.
  • Installation: use PackageInstaller sessions with an explicit result receiver and REQUEST_INSTALL_PACKAGES.
  • Permission: open pitwall's Install unknown apps screen when needed and continue after the user returns.
  • Results: deliver terminal messages once, then delete the cached APK.
  • Recovery: abandon stale sessions and unlock Install after process death, missing files or missing sessions.
  • Resume: defer Android confirmation until the Activity resumes and replace any dialog tied to an abandoned session.
  • Settings controls: share kit.Switch with desktop settings and group update controls under Updates.
  • Dismissal: clearing a status note keeps the release offer; hide the X while installing.
  • Copy: explain rate limits, missing release APKs and installer recovery.
  • Persistence: retain dismissed versions and the daily-check setting across launches.

Android still displays its own installation confirmation. The user must tap Update in that dialog; this confirmation is unavoidable. The first install also requires allowing pitwall as an installation source. Android PackageInstaller documentation.

Linear

No Linear ticket. The task comes from the local APK release brief.

Verification

  • [verified] Interrupted install: Home and am kill while confirmation is open, then relaunch and retry; Install opens a fresh dialog.

  • [verified] Background download: a 250 ms delay per 64 KiB chunk completes without frames; returning opens confirmation.

  • [verified] Next release: after success and a new process, v0.2.11 replaces the success message with an Install offer.

  • [verified] Linux: formatting, vet and full race tests pass on Omarchy 4.5.0 amd64 with Go 1.27.1.

  • [verified] Scripts: installer, release, APK version and APK upload tests pass.

  • [verified] Android builds: arm64 production and x86_64 emulator APK builds pass.

  • [verified] Manual checks: API 36 emulator shows Checking, Up to date, rate-limit guidance and an available version with daily checks off.

  • [verified] Permission: Install opens pitwall's unknown-app setting and continues after permission is granted.

  • [verified] Confirmation: Android displays its update confirmation dialog.

  • [verified] Cancellation: Cancel reports Installation cancelled and deletes the cached APK.

  • [verified] Upgrade: the same-key APK installs v0.2.10 over v0.2.9, changing versionCode from 209003 to 210000.

  • [verified] App data: the pairing and daily-check setting survive the upgrade.

  • [verified] Success: the cached APK is gone; relaunch consumes the success message once.

  • [verified] Wrong key: Android rejects a v0.2.11 fixture with INSTALL_FAILED_UPDATE_INCOMPATIBLE.

  • [verified] Failure result: the app displays Android's signature error, removes the cached APK and retains installed v0.2.10.

Commands and test coverage

Go commands ran through mise with GOFLAGS=-tags=novulkan and PITWALL_SOCKET, PITWALL_PANE and PITWALL_ATTACH unset.

gofmt -l cmd internal third_party/x-vt
go vet ./...
go test -race ./internal/ui/mobile ./internal/ui/kit ./internal/ui/settings
go test -race -timeout 5m ./...
sh scripts/get_test.sh
sh scripts/release_test.sh
sh scripts/apk_test.sh
sh scripts/apk-release_test.sh
sh scripts/apk.sh
git diff --check

Every listed command exits 0. Review fixes are at 4c1e430. Shell syntax checks pass. The terminal module's vet and race tests pass from the initial release change.

Go tests cover version comparison, missing or invalid assets, dismissal, saved settings, manual checks with automatic checks disabled, HTTP 200/304/403/429, malformed JSON, size limits, download redirects, host restrictions, short/oversized downloads, progress with a full UI queue, cancellation, stale installer state, one-shot success messages, note clearing, switch semantics and partial cache cleanup.

The emulator fetches releases and APKs from a local httptest server through compiled loopback overrides. A temporary clone holds fixture tags; no release tag or asset was published. The production arm64 APK has no fixture overrides.

macOS, Windows and physical phones remain untested locally. The 24-hour interval uses an advanced test clock. Real release upload remains untested. Release upload tests use stub gh commands in disposable repositories.

Screenshots

All four screenshots were retaken from 4c1e430. They remain local and uncommitted.

  • Session list: apk-release-update-shots/01-update-banner.png shows the quiet Install offer.
  • Daily checks off: apk-release-update-shots/02-updates-disabled.png shows the switch off.
  • Settings: apk-release-update-shots/03-installer-settings.png shows the Updates group, switch, manual check and Install button.
  • Android confirmation: apk-release-update-shots/04-android-install-confirm.png shows the system's required confirmation dialog.

@quanticstudios quanticstudios changed the title Publish Android APKs with releases and show phone updates Publish Android APKs with releases and install updates in the app Nov 12, 2026
@quanticstudios
quanticstudios marked this pull request as ready for review November 12, 2026 16:45
@quanticstudios
quanticstudios merged commit 1b12fc7 into main Nov 12, 2026
11 checks passed
@quanticstudios
quanticstudios deleted the apk-release-update branch November 12, 2026 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant