feat(app): the viewer as an Android app, its signed APK on each release #42

Merged
dawid merged 2 commits from android-app into main 2026-11-17 21:28:12 +00:00
Owner

The viewer as an Android app, with its signed APK attached to each release. Stacked on #41 (LFS): merge that first.

What

  • Capacitor 8 (MIT) bundles the viewer's files into the APK (app/, app/android/). Camera, models, hand tracking and pairing work as in the browser.
  • Relay from the app: its pages' origin is https://localhost, so it calls the relay at https://wristmark.apps.ciepiela.org/relay/v1. The Go relay now allows that one origin (CORS, with a test). Every request still needs the channel's token.
  • Scripts:
    • tools/build-app-web.sh assembles the viewer's files, as the Dockerfile does;
    • tools/install-android-sdk.sh installs Google's command-line tools, pinned by SHA-256 (the SHA-1 matches Google's manifest);
    • tools/build-android.sh debug|release builds the APK;
    • tools/generate-app-icons.sh makes the launcher icons and splash from the viewer's icons.
  • Version from the tag: 0.3.0 becomes version code 300.
  • Signing:
    • the keystore and password come from the secrets ANDROID_KEYSTORE and ANDROID_KEYSTORE_PASSWORD, which are already set;
    • the release checks the certificate's SHA-256 (b3295ca0…243b) before attaching the APK.
  • CI: the android job builds the debug APK of every PR and keeps nothing. release.yml adds wristmark-vX.Y.Z.apk to the release.
  • F-Droid-friendly: no Google services plugin, no dependency metadata blob, and app/android/ stays out of LFS.
  • Docs: docs/android.md covers building, signing, installing, and publishing on F-Droid. That needs a public repository, and the hand tracking left out of an F-Droid build or MediaPipe built from source; an F-Droid repository of our own is the quicker path.

Verified locally

  • Debug APK: builds, 16 MB.
  • Release APK: signed by the new key (apksigner verify), org.ciepiela.wristmark 0.2.0 / 200, with the CAMERA permission.
  • Relay: tests pass under -race.

Not done

  • iOS: skipped, as decided.
  • Not tried on a phone yet: the camera permission flow in the WebView, and pairing through the relay from the app.
The viewer as an Android app, with its signed APK attached to each release. **Stacked on #41 (LFS): merge that first.** ## What - **Capacitor 8** (MIT) bundles the viewer's files into the APK (`app/`, `app/android/`). Camera, models, hand tracking and pairing work as in the browser. - **Relay from the app:** its pages' origin is `https://localhost`, so it calls the relay at `https://wristmark.apps.ciepiela.org/relay/v1`. The Go relay now allows that one origin (CORS, with a test). Every request still needs the channel's token. - **Scripts:** - `tools/build-app-web.sh` assembles the viewer's files, as the Dockerfile does; - `tools/install-android-sdk.sh` installs Google's command-line tools, pinned by SHA-256 (the SHA-1 matches Google's manifest); - `tools/build-android.sh debug|release` builds the APK; - `tools/generate-app-icons.sh` makes the launcher icons and splash from the viewer's icons. - **Version from the tag:** 0.3.0 becomes version code 300. - **Signing:** - the keystore and password come from the secrets `ANDROID_KEYSTORE` and `ANDROID_KEYSTORE_PASSWORD`, which are already set; - the release checks the certificate's SHA-256 (`b3295ca0…243b`) before attaching the APK. - **CI:** the `android` job builds the debug APK of every PR and keeps nothing. `release.yml` adds `wristmark-vX.Y.Z.apk` to the release. - **F-Droid-friendly:** no Google services plugin, no dependency metadata blob, and `app/android/` stays out of LFS. - **Docs:** `docs/android.md` covers building, signing, installing, and **publishing on F-Droid**. That needs a public repository, and the hand tracking left out of an F-Droid build or MediaPipe built from source; an F-Droid repository of our own is the quicker path. ## Verified locally - **Debug APK:** builds, 16 MB. - **Release APK:** signed by the new key (`apksigner verify`), `org.ciepiela.wristmark` 0.2.0 / 200, with the CAMERA permission. - **Relay:** tests pass under `-race`. ## Not done - **iOS:** skipped, as decided. - **Not tried on a phone yet:** the camera permission flow in the WebView, and pairing through the relay from the app.
Capacitor 8 puts the viewer's files into the APK (app/, app/android/) and
shows them in the WebView: the camera, the models, hand tracking and pairing
work as in the browser. Its pages' origin is https://localhost, so the relay
is called at the viewer's public address and allows that origin (CORS, with
a test); every request still needs its channel's token.

- tools/build-app-web.sh assembles the files as the viewer's Dockerfile does;
  tools/install-android-sdk.sh fetches Google's tools pinned by SHA-256;
  tools/build-android.sh builds debug or release; tools/generate-app-icons.sh
  makes the launcher icons and splash from the viewer's icons.
- The version from the tag (0.2.0 is code 200); release signing from the
  secrets ANDROID_KEYSTORE and ANDROID_KEYSTORE_PASSWORD, the certificate
  checked against the documented SHA-256 before the APK goes out.
- CI builds the debug APK of every pull request; release.yml attaches
  wristmark-vX.Y.Z.apk to the release.
- No Google services plugin, no dependency metadata blob (F-Droid).
- docs/android.md: building, signing, installing, and publishing on F-Droid.

No iOS app: it needs macOS and an Apple developer account.
build: the Android project's files stay in Git, not LFS: F-Droid clones without it
Some checks failed
CI / checks (pull_request) Failing after 6s
CI / e2e (pull_request) Failing after 53s
CI / android (pull_request) Successful in 5m9s
CI / relay (pull_request) Successful in 50s
CI / image (pull_request) Successful in 56s
CI / watch (pull_request) Successful in 15s
2cf8c05060
dawid merged commit e95f08b9c9 into main 2026-11-17 21:28:12 +00:00
dawid deleted branch android-app 2026-11-17 21:28:13 +00:00
Sign in to join this conversation.
No description provided.