Skip to content

Android app releases

The app is released with the server, but has its own version: the release where mobile/ last changed. scripts/build-release.sh v0.12.0 works out which that is (say v0.11.0), builds the app from that tag as version 0.11.0, signs it, and adds it to the image with its version, where Settings → Server → About offers it (/version's android_app_version). A release that didn't change the app carries the same one as before, so phones are only asked to update when there's something new. Each app version is built once and kept in ~/.cache/nessie/apk (NESSIE_APK_CACHE), so later releases reuse it without the Android tools or the key.

It needs the build tools from Building the Android app (the script looks for the SDK in ~/Android/Sdk and the JDK in ~/.local/share/jdk-21 unless ANDROID_HOME and JAVA_HOME say otherwise) and a signing key, made once:

export PATH=~/.local/share/jdk-21/bin:$PATH   # keytool comes with the JDK
mkdir -p ~/.config/nessie && chmod 700 ~/.config/nessie
keytool -genkeypair -keystore ~/.config/nessie/android-release.jks -alias nessie \
    -keyalg RSA -keysize 4096 -validity 10000 -dname "CN=Nessie"   # asks for a password
chmod 600 ~/.config/nessie/android-release.jks
# storeFile must be a whole path (no ~); $HOME fills it in
printf 'storeFile=%s\nstorePassword=\nkeyAlias=nessie\nkeyPassword=\n' "$HOME/.config/nessie/android-release.jks" \
    > ~/.config/nessie/android-signing.properties
chmod 600 ~/.config/nessie/android-signing.properties
# then add the password after both storePassword= and keyPassword= in an editor

(NESSIE_ANDROID_SIGNING can point at the properties file elsewhere.) Back the key up, with its password: every update must be signed with it, or Android won't install it over the app already there, and the only way out is uninstalling, which loses the app's downloads. Kept, the same key can also be the app's key on Google Play later (Play App Signing, with your own key), so phones that installed it from the server can update from there.

Without the properties file the script builds the image without the app, and About offers none; NESSIE_ANDROID=no does that on purpose.