Publish a signed Android APK with GitHub releases

Build the ARM64 app on version tags alongside the desktop builds. Stamp
the APK with the tag version and the Release workflow run number so that
updates advance and reruns keep the same code. Sign with the repository's
persistent PKCS12 key in a separate step. Only the verified APK goes into
the run artifact and the release. Require it for both creation and reruns.

Use the same NDK for Cargo and Gradle's native strip step. Check the actual
APK's package, version, release mode, ARM64 library, alignment and signature.
Keep local debug version defaults. Document the two signing secrets, key
backup and the effect of switching from the debug build on a mesh identity.

On macOS, built the debug and release APKs, signed the release with a
throwaway key, and verified its certificate. Checked rejection of missing
credentials, a wrong password, an unsigned APK, a debug APK, incorrect
versions and an unstripped native library. Exercised the release-create
and rerun paths with a local gh stand-in, including a missing artifact.
Actionlint, ShellCheck, cargo fmt, locked all-target workspace Clippy with
warnings denied, and workspace tests passed (547 passed, 2 ignored).
No live release or signing credentials were created in GitHub.
This commit is contained in:
Aleksandr Bogomiakov committed 2026-11-24 17:41:44 +02:00
1 parent ef67e1c0ae
commit 429fa36e3e
5 files changed
+139 -7

No files matched your search

+24
View File
@@ -1,5 +1,9 @@
# Android client
Download `tsunagi-android-<version>-arm64-v8a.apk` from the project's GitHub release and open it on an ARM64 phone running Android 8 or later. If prompted, allow the app that opened the file to install it. Later releases can update the installed app and preserve the mesh identity. A prototype signed with a local debug key requires a fresh install to switch to the release signer. Uninstalling the prototype removes its local identity and saved networks. [GitHub Releases](https://github.com/house-of-vanity/tsunagi/releases)
## Build from source
Open this directory in Android Studio. The debug prototype targets ARM64 devices running Android 8 or later with OpenGL ES 3. Install SDK Platform 35 and the NDK with the SDK Manager. Point `ANDROID_HOME` at your SDK and `ANDROID_NDK_HOME` at the installed NDK directory. The Gradle launcher needs a JDK, such as the one bundled with Android Studio.
From the repository root, with Cargo and cargo-ndk on your PATH:
@@ -21,3 +25,23 @@ Applications using Android’s system resolver can connect to `<member>.<network
The tray and Android use the same egui network tiles, join form, device list, VIP editor and live traffic diagram from `crates/tsunagi-ui`. On Android, the Rust activity view opens each form in the current viewport. Kotlin handles the service, connectivity, rendering surface, input and clipboard.
Open **Exit node…** on a network tile to compare remote gateways by control RTT and data path. Tap a row and confirm to route IPv4 internet traffic through it. The selected exit has an ongoing notification, including when the peer is offline. **Disconnect exit node** restores the ordinary internet route and keeps mesh access and DNS active. Mesh-only mode has no persistent app notification. Android controls the system VPN indicator. Android 13 and later request notification permission for the exit notice. Starting with Android 14, an unlocked device allows an individual swipe to dismiss an ongoing VPN notification. [Android notification behavior](https://developer.android.com/about/versions/14/behavior-changes-all#non-dismissable-notifications)
## Configure GitHub release signing
The GitHub `Release` workflow builds and signs the ARM64 APK for each `v*` tag. The tag supplies the version name and the workflow run number supplies the Android version code. A rerun of the same workflow run keeps that code. The publish job attaches the verified APK alongside the desktop packages.
Before the first release, configure two repository Actions secrets. Use a dedicated single-key PKCS12 keystore with the same password for the keystore and key. Keep a private backup of the file and password so future releases can update existing installations. To create the first key, run this command once.
```sh
keytool -genkeypair -storetype PKCS12 -keystore "$HOME/tsunagi-release.p12" \
-alias tsunagi -keyalg RSA -keysize 3072 -validity 10000
```
From this repository, upload the keystore. Enter its password when the second command prompts for it.
```sh
base64 < "$HOME/tsunagi-release.p12" | gh secret set ANDROID_KEYSTORE_BASE64
gh secret set ANDROID_KEYSTORE_PASSWORD
```
Missing signing credentials or a failed APK check stop publication. After correcting the secrets, rerun the failed release jobs for the same tag.