Create a reproducible build script or container configuration (Containerfile / Dockerfile) containing the required Android SDK, NDK, and Rust toolchain targets to build debug and release APKs without host pollution.
Scope of Work
Provide a Containerfile / Dockerfile:
Base image: almalinux:9 or debian:bookworm-slim.
Install Android Command Line Tools, SDK Platform 34, and NDK (r25c+ or r26+).
Install Rust via rustup with targets aarch64-linux-android and x86_64-linux-android.
Install cargo-apk.
Provide a helper build script (scripts/build-android-apk.sh):
Outputs the generated .apk into target/android-artifacts/.
Acceptance Criteria
Running the build script inside the container produces a signed debug APK that can be deployed via adb install.
No dependencies beyond Podman/Docker required on the host system.
### Description
Create a reproducible build script or container configuration (Containerfile / Dockerfile) containing the required Android SDK, NDK, and Rust toolchain targets to build debug and release APKs without host pollution.
### Scope of Work
1. Provide a `Containerfile` / `Dockerfile`:
- Base image: `almalinux:9` or `debian:bookworm-slim`.
- Install Android Command Line Tools, SDK Platform 34, and NDK (r25c+ or r26+).
- Install Rust via `rustup` with targets `aarch64-linux-android` and `x86_64-linux-android`.
- Install `cargo-apk`.
2. Provide a helper build script (`scripts/build-android-apk.sh`):
- Sets `ANDROID_HOME` and `ANDROID_NDK_HOME`.
- Runs `cargo apk build --target aarch64-linux-android --release`.
- Outputs the generated `.apk` into `target/android-artifacts/`.
### Acceptance Criteria
- Running the build script inside the container produces a signed debug APK that can be deployed via `adb install`.
- No dependencies beyond Podman/Docker required on the host system.
Corrections after checking the code (planned for the future, not started)
cargo-apk is deprecated and unmaintained. Better options:
xbuild (x build --platform android)
cargo-ndk, which builds the .so, plus a minimal Gradle wrapper project that packages and signs it. This is the most future-proof option and also gives a proper AndroidManifest.xml for intents and file access (see #43).
AlmaLinux 9 matches the current CI and build host, so it is a reasonable base image. The NDK also needs unzip, java (JDK 17) for Gradle or sdkmanager, and clang from the NDK as the linker (CC_aarch64_linux_android, CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER).
The Gitea CI already builds .deb and .AppImage for each tag. A later step could build the APK there too, signed with a release key kept as a CI secret, and add it to the release assets with SHA256SUMS and minisign like the others.
Updates: the built-in updater (src/updater.rs) is Linux only. On Android, updates would come from a store or F-Droid repo, or be installed by hand from the APK.
**Corrections after checking the code** (planned for the future, not started)
- `cargo-apk` is deprecated and unmaintained. Better options:
- `xbuild` (`x build --platform android`)
- `cargo-ndk`, which builds the `.so`, plus a minimal Gradle wrapper project that packages and signs it. This is the most future-proof option and also gives a proper `AndroidManifest.xml` for intents and file access (see #43).
- AlmaLinux 9 matches the current CI and build host, so it is a reasonable base image. The NDK also needs `unzip`, `java` (JDK 17) for Gradle or sdkmanager, and `clang` from the NDK as the linker (`CC_aarch64_linux_android`, `CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER`).
- The Gitea CI already builds `.deb` and `.AppImage` for each tag. A later step could build the APK there too, signed with a release key kept as a CI secret, and add it to the release assets with SHA256SUMS and minisign like the others.
- Updates: the built-in updater (`src/updater.rs`) is Linux only. On Android, updates would come from a store or F-Droid repo, or be installed by hand from the APK.
Erster Schritt in v0.39.3: scripts/package-android.sh baut target/ink-notes_<version>_arm64.apk ohne Gradle.
Ablauf: NDK-Build der cdylib, dann aapt2, zipalign und apksigner.
Das Manifest liegt in packaging/android/AndroidManifest.xml.
Signiert wird mit ANDROID_KEYSTORE, ANDROID_KEYSTORE_PASS und ANDROID_KEY_ALIAS; fehlen sie, mit dem Debug-Schlüssel.
Noch offen: Container-Image für den Build, Einbindung in die CI, eigener Release-Schlüssel. Die APK kommt erst ins Release, wenn sie auf einem Gerät getestet ist.
Erster Schritt in **v0.39.3**: `scripts/package-android.sh` baut `target/ink-notes_<version>_arm64.apk` ohne Gradle.
- Ablauf: NDK-Build der `cdylib`, dann `aapt2`, `zipalign` und `apksigner`.
- Das Manifest liegt in `packaging/android/AndroidManifest.xml`.
- Signiert wird mit `ANDROID_KEYSTORE`, `ANDROID_KEYSTORE_PASS` und `ANDROID_KEY_ALIAS`; fehlen sie, mit dem Debug-Schlüssel.
Noch offen: Container-Image für den Build, Einbindung in die CI, eigener Release-Schlüssel. Die APK kommt erst ins Release, wenn sie auf einem Gerät getestet ist.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Description
Create a reproducible build script or container configuration (Containerfile / Dockerfile) containing the required Android SDK, NDK, and Rust toolchain targets to build debug and release APKs without host pollution.
Scope of Work
Containerfile/Dockerfile:almalinux:9ordebian:bookworm-slim.rustupwith targetsaarch64-linux-androidandx86_64-linux-android.cargo-apk.scripts/build-android-apk.sh):ANDROID_HOMEandANDROID_NDK_HOME.cargo apk build --target aarch64-linux-android --release..apkintotarget/android-artifacts/.Acceptance Criteria
adb install.Corrections after checking the code (planned for the future, not started)
cargo-apkis deprecated and unmaintained. Better options:xbuild(x build --platform android)cargo-ndk, which builds the.so, plus a minimal Gradle wrapper project that packages and signs it. This is the most future-proof option and also gives a properAndroidManifest.xmlfor intents and file access (see #43).unzip,java(JDK 17) for Gradle or sdkmanager, andclangfrom the NDK as the linker (CC_aarch64_linux_android,CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER)..deband.AppImagefor each tag. A later step could build the APK there too, signed with a release key kept as a CI secret, and add it to the release assets with SHA256SUMS and minisign like the others.src/updater.rs) is Linux only. On Android, updates would come from a store or F-Droid repo, or be installed by hand from the APK.Erster Schritt in v0.39.3:
scripts/package-android.shbauttarget/ink-notes_<version>_arm64.apkohne Gradle.cdylib, dannaapt2,zipalignundapksigner.packaging/android/AndroidManifest.xml.ANDROID_KEYSTORE,ANDROID_KEYSTORE_PASSundANDROID_KEY_ALIAS; fehlen sie, mit dem Debug-Schlüssel.Noch offen: Container-Image für den Build, Einbindung in die CI, eigener Release-Schlüssel. Die APK kommt erst ins Release, wenn sie auf einem Gerät getestet ist.