Reproducible Builds
Build releases in the container. Native macOS and Windows builds are not byte-for-byte identical to Linux builds - the Rust compiler, Android NDK and JDK each ship separate host toolchains - so they do not match the F-Droid APK. Build the release APK in the provided Docker builder or on a Linux CI runner, not with Android Studio's native toolchain.
The builder image is pinned to
linux/amd64because the Android NDK only ships x86_64 Linux host tools. On Apple Silicon, ARM Windows and ARM Linux hosts Docker runs it through x86_64 emulation: Docker Desktop does this automatically (Rosetta on Apple Silicon), while ARM Linux needsqemu-user-static/binfmt support for x86_64 containers. Docker prints a platform-mismatch warning on ARM hosts; it is expected and the build still runs.Run the commands below from the repository root, so the mounted
/workspacecontainsgradlewandrust-toolchain.toml.
This project uses reproducible builds. Release APKs should be built from a clean tree at the tagged commit in the container:
docker build -t android-ip-camera:builder .
docker run --rm \
-v "$PWD":/workspace \
-v "$HOME/.cache":/cache \
android-ip-camera:builder release #-PenableAbiSplits=false
The container keeps the Android SDK, NDK, Gradle caches and Rust toolchain in $HOME/.cache (android-sdk/, gradle/, cargo/ and rustup/) and installs them on the first run, so later builds start quickly. Delete those directories to force a clean reinstall. Gradle's daemon is disabled in the container because it cannot survive the end of a docker run.
Signed app bundle build (verified afterwards like the APK release):
docker run --rm \
-v "$PWD":/workspace \
-v "$HOME/.cache":/cache \
android-ip-camera:builder releaseBundle
Debug build:
docker run --rm \
-v "$PWD":/workspace \
-v "$HOME/.cache":/cache \
android-ip-camera:builder debug
Clean the Gradle build outputs, or wipe the cached toolchains to force a fresh install:
docker run --rm \
-v "$PWD":/workspace \
-v "$HOME/.cache":/cache \
android-ip-camera:builder clean
docker run --rm \
-v "$HOME/.cache":/cache \
android-ip-camera:builder clean-cache
Signing: copy signing.properties.default to signing.properties, set storeFile to your keystore (for example app/signing-key.jks) and fill in the passwords. Without signing.properties, add -PskipSigning to the release or releaseBundle command to produce an unsigned APK or bundle.
The release variant will automatically sign the APK and app bundle builds. Build-tools 35+ is known to produce signatures that fail reproducibility verification.
The OpenTunnel client is compiled from opentunnel-native by the Gradle build, so a local build also needs the Android NDK 27.2.12479018 and a Rust toolchain with the aarch64-linux-android and armv7-linux-androideabi targets. The Docker builder installs both.
Build Variants
By default, release builds generate architecture-specific APK splits for arm64-v8a and armeabi-v7a (the Rust OpenTunnel client is built for both) in addition to a universal APK. For F-Droid and other scenarios where a single universal APK is preferred, you can disable ABI splits:
F-Droid builds (single universal APK):
./gradlew clean assembleRelease -PenableAbiSplits=false
Release builds with architecture-specific APKs (default):
./gradlew clean assembleRelease
Release build as an app bundle:
./gradlew clean bundleRelease
The Docker builder wraps this as apic-build releaseBundle, which also verifies the bundle's signature and certificate after the build.
The enableAbiSplits property defaults to true. Set it to false to generate only the universal APK, which is the recommended approach for F-Droid to avoid unnecessary complexity in the build pipeline.
Every APK only packages the arm64-v8a and armeabi-v7a ABIs (ndk.abiFilters in app/build.gradle). CameraX ships an x86/x86_64 build of libimage_processing_util_jni.so, but the OpenTunnel client is only built for ARM. Packaging the CameraX x86 libraries would advertise x86 support (for example in the F-Droid listing) even though remote access would not work there.
To verify that two unsigned builds from the same source are identical:
mkdir -p build/unsigned
./gradlew clean assembleRelease -PskipSigning --no-daemon --max-workers=1 -Dorg.gradle.parallel=false
cp app/build/outputs/apk/release/*universal-release.apk build/unsigned/build1.apk
./gradlew clean assembleRelease -PskipSigning --no-daemon --max-workers=1 -Dorg.gradle.parallel=false
cp app/build/outputs/apk/release/*universal-release.apk build/unsigned/build2.apk
cmp -s build/unsigned/build1.apk build/unsigned/build2.apk && echo OK
# or: shasum -a 256 build/unsigned/build1.apk build/unsigned/build2.apk
If they differ, inspect with diffoscope build/unsigned/build1.apk build/unsigned/build2.apk.
To verify your signed release APK matches an unsigned rebuild use apksigcopier - the first APK must be signed:
./gradlew clean assembleRelease
apksigcopier compare app/build/outputs/apk/release/*universal-release.apk --unsigned build/unsigned/build1.apk && echo OK
CI runs this check automatically via the Reproducible Build workflow.
Builds downloaded from the official repository should match the following signing certificate:
apksigner verify --print-certs app/build/outputs/apk/release/*universal-release.apk
Signer #1 certificate DN: CN=DigitallyRefined
Signer #1 certificate SHA-256 digest: 1111be81c861e199c6485d367c37680c4b778fba301980d2f0f9a2800f77f70a
Signer #1 certificate SHA-1 digest: 1560ceccdd719b2b97d431ad9a4c877abf5c2f32
Signer #1 certificate MD5 digest: 5fdf04f5b6bab9fdacbe28aa6dc85abb
Regenerate store assets
The stylised store screenshots and feature graphic are rendered from the raw captures in fastlane/metadata/android/en-US/images/phoneScreenshots/ with Pillow in Docker:
docker run --rm -v "$(pwd):/work" -w /work python:3.12-slim bash -c \
"apt-get update -qq && apt-get install -y -qq fonts-noto-core fonts-dejavu-core > /dev/null 2>&1 && \
pip install -q pillow && \
python fastlane/scripts/store_assets.py"
Outputs are written to fastlane/metadata/android/en-US/images/phoneScreenshots/stylised/.