feat/android-apk-deploy #35

Merged
jeroen merged 2 commits from feat/android-apk-deploy into main 2026-08-10 12:32:29 +00:00
Owner
No description provided.
ci(android): build the APK on main and publish it for phone install
Some checks failed
CI / cargo check (push) Has been cancelled
CI / build & test viberfox (push) Has been cancelled
89d9c3dc07
The Android app has been buildable by hand since 2026-08-08 and installable by
nobody: `build-apk.sh` needs an NDK, an SDK, a JDK and cargo-ndk, none of which
are on a phone or on the machine that has the phone. So the artifact existed and
the install path did not.

Publishing lands in the wasm client's web root (/data/viberfox/site/apk/) rather
than a site of its own, which is what makes this a workflow file instead of a
Caddy site, a DNS record and a compose edit. The coupling that buys is invisible
from either job alone, so deploy-web's `rsync --delete` grows an `--exclude
'/apk/'`; without it the next web deploy silently removes the APK.

Filenames are fixed, so each build overwrites the last and the directory stays at
one APK — an install of last week's build is not a thing anyone wants, and the
runner host is at 76% with a 24 GB Actions cache on it. For the same reason the
SDK is fetched per run (124 MB in seconds) rather than cached forever, and the
.so is stripped into the archive.

Signing is the part with a trap in it: Android keys an installed app to its
certificate and refuses an update signed by another, so a per-run debug keystore
would mean uninstalling the app before every install. `build-apk.sh` therefore
takes an `ANDROID_KEY`/`ANDROID_CERT` pair when it is handed one, and the deploy
host keeps a stable self-signed identity outside the web root. It is a .pk8 +
.x509.pem pair because openssl can produce that and keytool cannot, which keeps a
JDK off the host entirely.

The strip is the one step here that can produce an APK that builds, signs,
installs and then does not start: `android_main` is referenced by nothing in Rust
and looked up by name from C. The job re-asserts it out of the packaged archive,
along with the absence of a classes.dex and of a libc++ dependency.
ci(android): fail early when the signing mount is missing
Some checks failed
CI / cargo check (push) Failing after 3m8s
CI / build & test viberfox (push) Failing after 5m50s
CI / cargo check (pull_request) Failing after 2m51s
CI / build & test viberfox (pull_request) Successful in 6m44s
dca666e794
The runner drops a volume that is not in valid_volumes with a warning in its own
log and nothing in the job's, so the only symptom of a misconfigured host is
apksigner's stack trace about a path nobody recognises.
jeroen merged commit 9fe7c13cf7 into main 2026-08-10 12:32:29 +00:00
Sign in to join this conversation.
No description provided.