Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Refresh Ensu mobile READMEs

Manav Rathic2179bbeb172
diff --git a/mobile/native/android/apps/ensu/README.md b/mobile/native/android/apps/ensu/README.md
index c18e56f7c9..6b7d65dc7c 100644
--- a/mobile/native/android/apps/ensu/README.md
+++ b/mobile/native/android/apps/ensu/README.md
@@ -1,112 +1,69 @@
-# Ensu Android
+# Ensu for Android
-## Prerequisites
+Source code for the Ensu Android app.
-- Android Studio or command-line tools
-- JDK 17
-- Android SDK with API level 35 (install in a default location or set `ANDROID_HOME`/`ANDROID_SDK_ROOT`)
-- Android NDK (install via `sdkmanager "ndk;<version>"`; optionally set `NDK_VERSION` to select a specific version)
-- Rust toolchain
+To know more about Ente, see [our main README](../../../../../README.md) or visit [ente.com](https://ente.com).
-## Building
+## Building from source
-### 1. Generate Kotlin bindings
+1. Install [Android Studio](https://developer.android.com/studio), [Rust](https://www.rust-lang.org/tools/install), and CMake (e.g. `brew install cmake`).
-Before building the Android app, generate the UniFFI Kotlin bindings:
+2. Generate the Kotlin bindings:
-```bash
-cd rust
-cargo codegen ensu-android
-```
-
-This refreshes the generated Kotlin sources in:
-- `android/apps/ensu/crypto-auth-core/src/main/java/io/ente/ensu/crypto/core.kt`
-- `android/packages/rust/src/main/kotlin/io/ente/labs/ensu_db/db.kt`
-- `android/packages/rust/src/main/kotlin/io/ente/labs/ensu_sync/sync.kt`
-- `android/packages/rust/src/main/kotlin/io/ente/labs/inference_rs/inference.kt`
-
-### 2. Build Debug APK
-
-```bash
-cd mobile/native/android/apps/ensu
-./gradlew :app-ui:assembleDebug
-```
-
-Gradle builds the Rust JNI libraries automatically for the relevant ABI.
+ ```sh
+ cd rust
+ cargo codegen ensu-android
+ ```
-Output: `app-ui/build/outputs/apk/debug/app-ui-debug.apk`
+3. Open the project in Android Studio and run the `app-ui` module. If the Android NDK is missing, Android Studio will prompt to install it.
-### 3. Build Release APK
+That's it. Apart from the `cargo codegen`, this is a normal Android project.
-```bash
-./gradlew :app-ui:assembleRelease
-```
-
-Release builds include the full shipped ABI set.
-
-Output: `app-ui/build/outputs/apk/release/app-ui-release.apk`
-
-### 4. Build Release AAB
-
-```bash
-./gradlew :app-ui:bundleRelease
-```
+> [!NOTE]
+>
+> Re-run `cargo codegen ensu-android` whenever the UniFFI interface under `rust/uniffi` changes.
+>
+> Gradle cross-compiles the Rust libraries to JNI `.so` files automatically when building the app.
-Output: `app-ui/build/outputs/bundle/release/app-ui-release.aab`
+A custom endpoint can be baked into the build via `./gradlew :app-ui:installDebug -PENTE_API_ENDPOINT=http://localhost:8080`, or by exporting `ENTE_API_ENDPOINT` before running Gradle.
-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`.
+## Terminal builds
-## Installation
+> [!NOTE]
+>
+> If you'd rather not open Android Studio, this section is for you.
-### Install Debug Build
+Build and install a debug APK on a connected device or emulator:
-```bash
+```sh
+cd mobile/native/android/apps/ensu
./gradlew :app-ui:installDebug
-```
-
-Or via adb:
-
-```bash
-adb install -r app-ui/build/outputs/apk/debug/app-ui-debug.apk
-```
-
-Launch the app:
-
-```bash
adb shell am start -n io.ente.ensu/.MainActivity
```
-### Install Release Build
+Release APK:
-```bash
-adb install -r app-ui/build/outputs/apk/release/app-ui-release.apk
+```sh
+./gradlew :app-ui:assembleRelease
```
-To target a specific device, prefix the `adb` commands with `-s <serial>`.
+Output: `app-ui/build/outputs/apk/release/app-ui-release.apk`.
-Note: If upgrading from a differently signed build, uninstall first:
+Release AAB (Play Store bundle):
-```bash
-adb uninstall io.ente.ensu
+```sh
+./gradlew :app-ui:bundleRelease
```
-## Custom API Endpoint
+Output: `app-ui/build/outputs/bundle/release/app-ui-release.aab`.
-Set `ENTE_API_ENDPOINT` to override the default (`https://api.ente.io`).
+Release builds use a debug keystore located at `debug.keystore`. For production releases, configure your own signing keys in `app-ui/build.gradle.kts`.
-```bash
-ENTE_API_ENDPOINT=https://your-endpoint ./gradlew :app-ui:installDebug
-```
-
-Or via Gradle property:
-
-```bash
-./gradlew :app-ui:installDebug -PENTE_API_ENDPOINT=https://your-endpoint
-```
+## Modules
-## Project Structure
+- `app-ui/` β€” Compose UI and app entry point.
+- `domain/` β€” Business logic and state (pure Kotlin).
+- `data/` β€” Repositories, network, storage.
+- `crypto-auth-core/` β€” Cryptographic primitives (UniFFI-wrapped Rust).
-- `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
+The Rust glue for `db` / `sync` / `inference` lives outside this app, at [`mobile/native/android/packages/rust/`](../../packages/rust/).
diff --git a/mobile/native/darwin/Apps/Ensu/README.md b/mobile/native/darwin/Apps/Ensu/README.md
index 2e40e2bb71..99fc3fc89d 100644
--- a/mobile/native/darwin/Apps/Ensu/README.md
+++ b/mobile/native/darwin/Apps/Ensu/README.md
@@ -22,6 +22,8 @@ That's it. Apart from the `cargo codegen`, this is a normal iOS project.
> [!NOTE]
>
> Re-run `cargo codegen ensu-ios` whenever the UniFFI interface under `rust/uniffi` changes.
+>
+> Xcode compiles and statically links the Rust libraries automatically when building the app.
A custom endpoint can be baked into the build via `xcodebuild ENTE_API_ENDPOINT=http://localhost:8080 ...` or by editing the user-defined `ENTE_API_ENDPOINT` build setting in the `Ensu` target.
@@ -35,8 +37,12 @@ Build and run on the simulator:
```sh
open -a Simulator
+
+cd mobile/native/darwin/Apps/Ensu
xcodebuild -scheme Ensu -destination 'platform=iOS Simulator,name=iPhone 17'
-xcrun simctl install booted ~/Library/Developer/Xcode/DerivedData/Ensu-*/Build/Products/Debug-iphonesimulator/Ensu.app
+
+xcrun simctl install booted \
+ ~/Library/Developer/Xcode/DerivedData/Ensu-*/Build/Products/Debug-iphonesimulator/Ensu.app
xcrun simctl launch booted io.ente.ensu
```