mobile/native/android/apps/ensu/README.md
ANDROID_HOME/ANDROID_SDK_ROOT)sdkmanager "ndk;<version>"; optionally set NDK_VERSION to select a specific version)cargo-ndk (cargo install cargo-ndk)From mobile/native/android/apps/ensu:
./build.sh # builds Rust + debug APK
./build.sh apk # builds Rust + release APK
./build.sh aab # builds Rust + release AAB (app bundle)
./run.sh # builds + installs + launches on connected adb device
Helpful flags:
--skip-rust to skip Rust/jni rebuild--endpoint <url> to set ENTE_API_ENDPOINT--device <serial> for run.shrelease/release-apk and bundle/release-aabRun ./build.sh --help or ./run.sh --help for full options.
Before building the Android app, compile the Rust native libraries. Ensure the SDK is installed in a default location or set ANDROID_HOME/ANDROID_SDK_ROOT to the SDK containing an NDK. Optionally set NDK_VERSION to select a specific version. The build script applies the llama.cpp mtmd patch; set APPLY_LLAMA_MTMD_PATCH=0 to skip it.
cd mobile/native/android/packages/rust/tool
./build_android.sh
This script produces the JNI .so artifacts in android/packages/rust/src/main/jniLibs/ (including libcore.so, libinference.so, libdb.so, and libsync.so).
It also generates the UniFFI Kotlin bindings into:
android/apps/ensu/crypto-auth-core/src/main/java/io/ente/ensu/crypto/core.ktandroid/packages/rust/src/main/kotlin/io/ente/labs/ensu_db/db.ktandroid/packages/rust/src/main/kotlin/io/ente/labs/ensu_sync/sync.ktandroid/packages/rust/src/main/kotlin/io/ente/labs/inference_rs/inference.ktThese generated files are gitignored and are refreshed each time build_android.sh runs.
cd mobile/native/android/apps/ensu
./gradlew :app-ui:assembleDebug
Output: app-ui/build/outputs/apk/debug/app-ui-debug.apk
./gradlew :app-ui:assembleRelease
Output: app-ui/build/outputs/apk/release/app-ui-release.apk
Note: Release builds use a debug keystore located at debug.keystore. For production releases, configure your own signing keys in app-ui/build.gradle.kts.
To verify these fingerprints, use the following command:
apksigner verify --print-certs <path_to_apk>
./gradlew :app-ui:installDebug
Or via adb:
adb install -r app-ui/build/outputs/apk/debug/app-ui-debug.apk
adb install -r app-ui/build/outputs/apk/release/app-ui-release.apk
Note: If upgrading from a differently signed build, uninstall first:
adb uninstall io.ente.ensu
Set ENTE_API_ENDPOINT to override the default (https://api.ente.io).
ENTE_API_ENDPOINT=https://your-endpoint ./gradlew :app-ui:installDebug
Or via Gradle property:
./gradlew :app-ui:installDebug -PENTE_API_ENDPOINT=https://your-endpoint
app-ui/ - Main application module (Compose UI)domain/ - Domain layer (business logic, state management)data/ - Data layer (repositories, network, storage)crypto-auth-core/ - Cryptographic authentication utilities