docs(android): update README files to reflect changes in APK build process and remove references to product flavors

This commit is contained in:
Ivan
2026-04-24 15:02:55 -05:00
parent 4f4fbc204a
commit 76ba39f1e1
7 changed files with 77 additions and 285 deletions
+9 -17
View File
@@ -245,34 +245,26 @@ From repo root:
# 1) Build Chaquopy wheels used by android/app/build.gradle
bash scripts/build-android-wheels-local.sh
# 2) Build default slim APKs (universal packaging: one APK per flavor+type)
# 2) Build universal APKs (one debug + one release per run; see android/README.md)
cd android
./gradlew --no-daemon :app:assembleSlimDebug :app:assembleSlimRelease
./gradlew --no-daemon :app:assembleDebug :app:assembleRelease
```
APK layout uses **product flavors** `slim` and `full` (Python tree size) plus **ABI packaging** `universal` (default) or `split` (see `android/app/build.gradle`).
There is a **single** Android variant. Gradle syncs the full `meshchatx/` tree into `app/src/main/python/meshchatx/`, including the offline repository wheel bundle. **ABI packaging** is `universal` (default) or `split` (see `android/app/build.gradle`).
With **`-PmeshchatxAbiPackaging=universal`** (default), each variant is a single APK containing every selected ABI:
With **`-PmeshchatxAbiPackaging=universal`** (default), each build type is one APK with every selected ABI:
Debug (`android/app/build/outputs/apk/slim/debug/`):
- Debug: `android/app/build/outputs/apk/debug/app-debug.apk`
- Release: `android/app/build/outputs/apk/release/app-release-unsigned.apk`
- `app-slim-debug.apk`
Release (`android/app/build/outputs/apk/slim/release/`):
- `app-slim-release-unsigned.apk`
Use `:app:assembleFullDebug` / `:app:assembleFullRelease` for the larger `full` Python bundle (offline repository wheels, bundled docs, Vue sources, etc.).
With **`-PmeshchatxAbiPackaging=split`** and more than one ABI in `-PmeshchatxAbis`, Gradle also emits per-ABI APKs under the same flavor folders, plus a universal split APK when enabled.
With **`-PmeshchatxAbiPackaging=split`** and more than one ABI in `-PmeshchatxAbis`, Gradle may emit per-ABI APKs as documented in `android/README.md`.
Notes:
- Release outputs are unsigned by default unless you configure signing.
- If you only need one build, run for example `:app:assembleSlimDebug` or `:app:assembleSlimRelease`.
- Release outputs are unsigned by default unless you configure signing (`scripts/sign-android-apks.sh`).
- Android targets the ABIs listed in `android/app/build.gradle` (including `armeabi-v7a` when enabled). Building wheels for `armeabi-v7a` needs an Android SDK on `ANDROID_HOME` (see `android/README.md`).
- Override ABI selection with `-PmeshchatxAbis=<comma-separated list>` or `MESHCHATX_ABIS`. Override packaging with `-PmeshchatxAbiPackaging=universal|split` or `MESHCHATX_ABI_PACKAGING`.
- Chaquopy bundle size: **`slim`** flavor (default) syncs a smaller `meshchatx/` tree into `src/slim/python/`; **`full`** flavor syncs the complete tree into `src/full/python/` (including offline repository wheels after fetch when needed). See `android/README.md`.
- If repo root `dist/reticulum_meshchatx-*.whl` exists (for example from `python -m build --wheel -o dist .`), bundled repository refresh prefers that wheel over PyPI for the MeshChatX package. CI builds that wheel before the Android Gradle step.
Additional docs:
+26 -186
View File
@@ -1,205 +1,45 @@
# MeshChatX Android App
# MeshChatX Android (Chaquopy)
This directory contains the Android app build configuration using Chaquopy to embed the Python MeshChatX server.
Native APK with embedded Python (`meshchatx/`) and a WebView UI.
## Architecture
## Prerequisites
The app uses a **WebView** to display the existing Vue.js frontend. The Python server runs in the background via Chaquopy and serves the web interface on `https://127.0.0.1:8000`.
- Android SDK (`ANDROID_HOME` / `ANDROID_SDK_ROOT`) with `cmdline-tools` and a matching **NDK** (see `android/app/build.gradle` for the pinned NDK version used in CI).
- **JDK 17** (Temurin or compatible).
- Chaquopy vendor wheels under `android/vendor/` (build locally with `bash scripts/build-android-wheels-local.sh` from repo root, or use CI artifacts).
## Build debug APK
## Build
Prerequisites:
- **JDK 17 or newer** (required by the Android Gradle Plugin used in this project). On distributions with multiple JDKs, point the build at JDK 17+ (for example `JAVA_HOME` for the Gradle invocation).
- **Android SDK** with API **34** platform and **Build-Tools 34** installed. Set `ANDROID_HOME` and `ANDROID_SDK_ROOT` to the SDK root (the same directory for both is fine).
- **Host build tools for wheel patching**: `patchelf`, `cmake`, `pkg-config`, `unzip`, and build essentials (`gcc`, `make`, headers). On Arch-based systems, install `patchelf cmake pkgconf base-devel rustup unzip`.
- **`android/vendor/`** must contain the Chaquopy vendor wheels (see [Updating Android Python ABI Wheels](#updating-android-python-abi-wheels-python-311)). The build fails fast if this directory is missing or incomplete.
- **MeshChatX Python sources** at the repository root (`meshchatx/`). The build syncs them into the app before compiling.
SDK licenses:
- Use **Command-line Tools** `sdkmanager`, not the legacy `tools/bin/sdkmanager` from old SDK layouts. The legacy tool loads JAXB classes that were removed from the JDK in Java 11, so running it on JDK 17+ fails with `NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema`.
- Install Command-line Tools if needed: download the package for your OS from [Android Studio command-line tools](https://developer.android.com/studio#command-tools), extract it so you have `cmdline-tools/latest/bin/sdkmanager` under `ANDROID_HOME` (the inner folder is often named `latest`; see Googles layout for that zip).
- Accept licenses (writes under the SDK; use sudo if the SDK is root-owned):
From repo root:
```bash
yes | path/to/cmdline-tools/latest/bin/sdkmanager --licenses
bash scripts/build-android-wheels-local.sh
cd android
./gradlew --no-daemon :app:assembleDebug :app:assembleRelease
```
- Install missing packages if the build still complains (platform 34, build-tools 34, etc.):
There is a **single** application variant (no product flavors). Gradle syncs the **entire** `meshchatx/` tree into `app/src/main/python/meshchatx/` (including `public/repository-server-bundled` for the in-app repository server). The `fetchRepositoryBundledWheels` task runs before sync when bundled wheels are missing; if repo root `dist/reticulum_meshchatx-*.whl` exists (e.g. from `python -m build --wheel -o dist .`), that wheel is preferred over PyPI for the bundled set.
```bash
path/to/cmdline-tools/latest/bin/sdkmanager "platforms;android-34" "build-tools;34.0.0"
```
### ABI selection and packaging
Build from the `android/` directory (default **slim** flavor, **universal** ABI packaging):
- **`-PmeshchatxAbis=...`** or **`MESHCHATX_ABIS`**: comma-separated list from `arm64-v8a`, `x86_64`, `armeabi-v7a` (default: all three).
- **`-PmeshchatxAbiPackaging=universal|split`** or **`MESHCHATX_ABI_PACKAGING`**: `universal` (default) emits one APK per build type; `split` may emit per-ABI splits when more than one ABI is selected.
```bash
./gradlew :app:assembleSlimDebug
```
### Outputs
Debug APK example path:
With default **universal** packaging:
- `app/build/outputs/apk/slim/debug/app-slim-debug.apk`
- Debug: `app/build/outputs/apk/debug/app-debug.apk`
- Release (unsigned until you sign): `app/build/outputs/apk/release/app-release-unsigned.apk`
By default all ABIs are included in that single universal APK. To build only specific ABIs:
### Signing release APKs
```bash
./gradlew :app:assembleSlimDebug -PmeshchatxAbis=armeabi-v7a
./gradlew :app:assembleSlimDebug -PmeshchatxAbis=arm64-v8a,x86_64
```
See repo root `scripts/sign-android-apks.sh` (default glob targets `outputs/apk/release/`).
To emit **per-ABI split APKs** (and a universal split when Gradle enables it), set:
## Troubleshooting
```bash
./gradlew :app:assembleSlimDebug -PmeshchatxAbiPackaging=split
```
1. Confirm `android/vendor/` contains required `.whl` files from the wheel build script.
2. Run `./gradlew :app:assembleDebug` with `--stacktrace` if Python sync or Chaquopy pip steps fail.
3. Re-run `./gradlew :app:assembleDebug` after changing `meshchatx/` assets; sync runs on merge Python sources tasks.
Same property accepts `MESHCHATX_ABI_PACKAGING`.
### Python bundle: `slim` vs `full` flavors
The Chaquopy layer packs `meshchatx/` into `assets/chaquopy/app.imy`. These are **Android product flavors** (separate Gradle variants):
| Flavor | Meaning |
|--------|--------|
| **`slim`** (default `isDefault`) | Smaller APK: sync omits Vue sources (`src/frontend`), bundled Reticulum HTML manual (`public/reticulum-docs-bundled`), RNode flasher static files, and **offline repository wheels** (`public/repository-server-bundled`). |
| **`full`** | Syncs the whole `meshchatx/` tree (Gradle runs `fetchRepositoryBundledWheels` first when bundled wheels are missing). Use when the APK must ship the offline repository mirror and bundled docs. |
Assemble the matching variant:
```bash
./gradlew :app:assembleSlimDebug -PmeshchatxAbis=arm64-v8a
./gradlew :app:assembleFullDebug
./gradlew :app:assembleFullRelease
```
## Signing Release APKs (optional SourceStamp)
Build release APKs first:
```bash
./gradlew --no-daemon :app:assembleSlimRelease
```
Create a release signing key (one time):
```bash
mkdir -p android/keystore
keytool -genkeypair -v \
-keystore android/keystore/meshchatx-release.jks \
-alias meshchatx-release \
-keyalg RSA \
-keysize 4096 \
-validity 9125
```
Optional: create a separate SourceStamp key (recommended if you use SourceStamp):
```bash
keytool -genkeypair -v \
-keystore android/keystore/meshchatx-stamp.jks \
-alias meshchatx-stamp \
-keyalg RSA \
-keysize 4096 \
-validity 9125
```
Sign all `*-unsigned.apk` release artifacts:
```bash
ANDROID_HOME="$HOME/Android/sdk" \
SIGNING_KEYSTORE_PATH=android/keystore/meshchatx-release.jks \
SIGNING_KEY_ALIAS=meshchatx-release \
SIGNING_KEYSTORE_PASSWORD='<release-keystore-password>' \
SIGNING_KEY_PASSWORD='<release-key-password>' \
bash scripts/sign-android-apks.sh
```
Sign with SourceStamp enabled:
```bash
ANDROID_HOME="$HOME/Android/sdk" \
SIGNING_KEYSTORE_PATH=android/keystore/meshchatx-release.jks \
SIGNING_KEY_ALIAS=meshchatx-release \
SIGNING_KEYSTORE_PASSWORD='<release-keystore-password>' \
SIGNING_KEY_PASSWORD='<release-key-password>' \
ENABLE_SOURCESTAMP=true \
SOURCESTAMP_KEYSTORE_PATH=android/keystore/meshchatx-stamp.jks \
SOURCESTAMP_KEY_ALIAS=meshchatx-stamp \
SOURCESTAMP_KEYSTORE_PASSWORD='<stamp-keystore-password>' \
SOURCESTAMP_KEY_PASSWORD='<stamp-key-password>' \
bash scripts/sign-android-apks.sh
```
The helper script auto-detects the newest Android Build-Tools, runs `zipalign`, signs with `apksigner`, and verifies each output certificate/signature block.
## Updating Android Python ABI Wheels (Python 3.11)
Use this workflow when a dependency (for example `cryptography`) requires custom Android wheels for the ABIs listed in `app/build.gradle` (`ndk.abiFilters`).
For **`armeabi-v7a`**, Chaquopy usually has no prebuilt NumPy wheel; `scripts/build-android-wheels-local.sh` builds NumPy from source and must cache the official `chaquopy-openblas` wheel (handled in the script) and run with **`ANDROID_HOME`** pointing at an SDK that includes **Command-line Tools** and NDK **27.3.13750724** (Chaquopys `target/android-env.sh` installs the NDK via `sdkmanager` if missing).
1. Build wheels in a Podman Python 3.11 container to avoid host Python mismatches:
- Use `docker.io/library/python:3.11-bookworm`.
- Mount project root to `/work` and Android SDK to `/opt/android-sdk`.
- Export `ANDROID_HOME` and `ANDROID_SDK_ROOT` to `/opt/android-sdk`.
- Example container entry:
`podman run --rm --network host -e ANDROID_HOME=/opt/android-sdk -e ANDROID_SDK_ROOT=/opt/android-sdk -v "/opt/android-sdk:/opt/android-sdk" -v "<repo>:/work" -w /work docker.io/library/python:3.11-bookworm bash`
2. Keep custom Chaquopy recipes in `android/chaquopy-recipes/<package>-<major>/`:
- Define package/version in `meta.yaml`.
- Store source patches in `patches/`.
3. Build the configured ABIs with Chaquopy `build-wheel.py` (via `scripts/build-android-wheels-local.sh`) and place final wheels in `android/vendor/`.
4. Update `android/app/build.gradle` `pip` installs to the new pinned version.
5. Rebuild with `./gradlew :app:assembleSlimDebug` (or `-PmeshchatxAbiPackaging=split` when you need per-ABI artifacts) and confirm the expected APK under `app/build/outputs/apk/`.
Local host build example (no shell startup files required):
```bash
cd /path/to/reticulum-meshchatX
ANDROID_HOME="$HOME/Android/sdk" \
ANDROID_SDK_ROOT="$HOME/Android/sdk" \
PYTHON_BIN="$(uv python find 3.11)" \
bash scripts/build-android-wheels-local.sh --abis armeabi-v7a
```
If `uv` does not have Python 3.11 yet, install it first:
```bash
uv python install 3.11
```
If the wheel build fails with `No such file or directory: 'patchelf'`, install `patchelf` and re-run the same command.
Notes:
- For Rust-backed wheels (such as modern `cryptography`), build inside the container with Rust toolchain available.
- Keep recipe files and patches versioned; keep generated build artifacts untracked.
## Custom Recipes and Patches
This project keeps Android-specific Chaquopy recipes in `android/chaquopy-recipes/` to bridge gaps between desktop Python dependencies and Android wheel availability.
- `cryptography-46`
- Purpose: provide Android ABI wheels for `cryptography 46.0.7` for each ABI in the wheel script (for example `arm64-v8a`, `x86_64`, `armeabi-v7a`) because upstream Chaquopy index only provided older builds.
- `patches/openssl_no_legacy.patch`: disables OpenSSL legacy provider loading, which is unavailable in the bundled Android OpenSSL runtime.
- `patches/pyo3_no_interpreter.patch`: enables compatible `pyo3` ABI settings for Chaquopy Python 3.11 Android builds.
- `aiohttp-3.13`
- Purpose: align Android with desktop dependency line (`aiohttp 3.13.3`) by building fresh ABI wheels with Chaquopy.
- No source patch is required; recipe pins the newer upstream version for Android wheel generation.
- `psutil-7.2`
- Purpose: align Android with desktop dependency line (`psutil 7.2.2`) while preserving Android runtime behavior.
- `patches/chaquopy.patch`: treats `android` platform as Linux in psutil internals and forces a safe partition enumeration path because `/proc/filesystems` can be restricted by SELinux on some Android API levels.
- `bcrypt-5`
- Purpose: tracks attempted upgrade path to desktop-equivalent bcrypt.
- Status: currently not enabled in Android app dependencies; `bcrypt==3.1.7` remains pinned for stable APK builds.
## License
This directory is part of the main project licensing split:
- project-owned portions: 0BSD
- original upstream MeshChat portions: MIT
See [`../LICENSE`](../LICENSE) for full text and notices.
See [`../LICENSE`](../LICENSE) for full text and notices.
+8 -16
View File
@@ -219,31 +219,23 @@ Vom Repository-Root:
# 1) Chaquopy-Wheels gemaess android/app/build.gradle bauen
bash scripts/build-android-wheels-local.sh
# 2) Standard-Slim-APKs bauen (universal: ein APK pro Flavor und Build-Typ)
# 2) Universal-APKs bauen (ein Debug- und ein Release-APK; siehe android/README.md)
cd android
./gradlew --no-daemon :app:assembleSlimDebug :app:assembleSlimRelease
./gradlew --no-daemon :app:assembleDebug :app:assembleRelease
```
Ausgaben richten sich nach **Product Flavors** `slim` / `full` (Groesse des Python-Baums) und **ABI-Packaging** `universal` (Standard) oder `split` (siehe `android/app/build.gradle`).
Es gibt nur eine Android-Variante (keine `slim`-/`full`-Flavors). Gradle synchronisiert den gesamten `meshchatx/`-Baum nach `app/src/main/python/meshchatx/`, inklusive Offline-Repository-Raeder. **ABI-Packaging:** `universal` (Standard) oder `split` (siehe `android/app/build.gradle`).
Mit **`-PmeshchatxAbiPackaging=universal`** (Standard) enthaelt ein APK alle gewaehlten ABIs.
Mit **`-PmeshchatxAbiPackaging=universal`** (Standard):
Debug (`android/app/build/outputs/apk/slim/debug/`):
- `app-slim-debug.apk`
Release (`android/app/build/outputs/apk/slim/release/`):
- `app-slim-release-unsigned.apk`
Fuer den vollen Python-Baum: `:app:assembleFullDebug` oder `:app:assembleFullRelease`.
- Debug: `android/app/build/outputs/apk/debug/app-debug.apk`
- Release: `android/app/build/outputs/apk/release/app-release-unsigned.apk`
Hinweise:
- Release-Ausgaben sind standardmaessig unsigniert, sofern keine Signatur konfiguriert ist.
- Fuer eine einzelne Build-Variante z. B.: `:app:assembleSlimDebug` oder `:app:assembleSlimRelease`.
- Release-Ausgaben sind standardmaessig unsigniert (`scripts/sign-android-apks.sh`).
- ABI: `-PmeshchatxAbis` oder `MESHCHATX_ABIS`; Packaging: `-PmeshchatxAbiPackaging` oder `MESHCHATX_ABI_PACKAGING`.
- Chaquopy-Baum `meshchatx/`: **`slim`** nach `src/slim/python/`, **`full`** nach `src/full/python/`. Details in [`android/README.md`](../android/README.md).
- Existiert im Repo-Root `dist/reticulum_meshchatx-*.whl` (z. B. nach `python -m build --wheel -o dist .`), wird dieses Rad beim Bundling bevorzugt. Details in [`android/README.md`](../android/README.md).
Weitere Dokumentation:
+8 -16
View File
@@ -219,31 +219,23 @@ Dalla root del repository:
# 1) Build delle wheel Chaquopy usate da android/app/build.gradle
bash scripts/build-android-wheels-local.sh
# 2) Build degli APK slim predefiniti (universal: un APK per flavor e tipo di build)
# 2) Build APK universali (un debug e una release; vedi android/README.md)
cd android
./gradlew --no-daemon :app:assembleSlimDebug :app:assembleSlimRelease
./gradlew --no-daemon :app:assembleDebug :app:assembleRelease
```
Gli output dipendono dai **product flavors** `slim` / `full` (dimensione dell'albero Python) e dall **imballaggio ABI** `universal` (predefinito) o `split` (vedi `android/app/build.gradle`).
Esiste una sola variante Android (niente flavor `slim` / `full`). Gradle sincronizza l'intero albero `meshchatx/` in `app/src/main/python/meshchatx/`, incluse le wheel offline del repository. **Imballaggio ABI:** `universal` (predefinito) o `split` (vedi `android/app/build.gradle`).
Con **`-PmeshchatxAbiPackaging=universal`** (predefinito), un solo APK contiene tutti gli ABI selezionati.
Con **`-PmeshchatxAbiPackaging=universal`** (predefinito):
Debug (`android/app/build/outputs/apk/slim/debug/`):
- `app-slim-debug.apk`
Release (`android/app/build/outputs/apk/slim/release/`):
- `app-slim-release-unsigned.apk`
Per il bundle Python completo: `:app:assembleFullDebug` o `:app:assembleFullRelease`.
- Debug: `android/app/build/outputs/apk/debug/app-debug.apk`
- Release: `android/app/build/outputs/apk/release/app-release-unsigned.apk`
Note:
- Gli output release sono non firmati di default se non configurate le firme.
- Per una sola build, ad esempio: `:app:assembleSlimDebug` o `:app:assembleSlimRelease`.
- Le release sono non firmate di default (`scripts/sign-android-apks.sh`).
- ABI: `-PmeshchatxAbis` o `MESHCHATX_ABIS`; imballaggio: `-PmeshchatxAbiPackaging` o `MESHCHATX_ABI_PACKAGING`.
- Albero `meshchatx/` per Chaquopy: **`slim`** in `src/slim/python/`, **`full`** in `src/full/python/`. Dettagli in [`android/README.md`](../android/README.md).
- Se nella root del repo esiste `dist/reticulum_meshchatx-*.whl` (es. dopo `python -m build --wheel -o dist .`), quella wheel ha priorita nel bundle. Dettagli in [`android/README.md`](../android/README.md).
Documentazione aggiuntiva:
+9 -17
View File
@@ -219,31 +219,23 @@ MeshChatX はネイティブ Android APK のビルドに対応しています(
# 1) android/app/build.gradle で使う Chaquopy 用ホイールをビルド
bash scripts/build-android-wheels-local.sh
# 2) 既定の slim APK をビルド(universal: フレーバーとビルドタイプごとに 1 つの APK
# 2) 汎用 APK をビルド(debug と release 各 1 つ;android/README.md 参照
cd android
./gradlew --no-daemon :app:assembleSlimDebug :app:assembleSlimRelease
./gradlew --no-daemon :app:assembleDebug :app:assembleRelease
```
**product flavors** `slim` / `full`Python ツリーの大きさ)と **ABI パッケージング** `universal`(既定)または `split``android/app/build.gradle`で出力が決まります
Android は単一バリアント(`slim` / `full` フレーバーなし)。Gradle が `meshchatx/` 全体を `app/src/main/python/meshchatx/` に同期し、オフラインリポジトリ用ホイールも含みます。**ABI パッケージング:** `universal`(既定)または `split``android/app/build.gradle`)。
**`-PmeshchatxAbiPackaging=universal`**(既定)では、選択した ABI がすべて入った単一 APK です。
**`-PmeshchatxAbiPackaging=universal`**(既定)のとき:
デバッグ`android/app/build/outputs/apk/slim/debug/`:
- `app-slim-debug.apk`
リリース(`android/app/build/outputs/apk/slim/release/`:
- `app-slim-release-unsigned.apk`
より大きい Python バンドルが必要なら `:app:assembleFullDebug` または `:app:assembleFullRelease`
- デバッグ: `android/app/build/outputs/apk/debug/app-debug.apk`
- リリース: `android/app/build/outputs/apk/release/app-release-unsigned.apk`
備考:
- リリース出力は署名を設定しない限りデフォルトで未署名です
- 1 種類だけ欲しい場合は例: `:app:assembleSlimDebug` または `:app:assembleSlimRelease`
- ABI は `-PmeshchatxAbis` または `MESHCHATX_ABIS`、パッケージングは `-PmeshchatxAbiPackaging` または `MESHCHATX_ABI_PACKAGING` で上書きできます
- Chaquopy の `meshchatx/` ツリー: **`slim`** は `src/slim/python/` に小さい同期、**`full`** は `src/full/python/` に完全同期。詳細は [`android/README.md`](../android/README.md)。
- リリースは既定で未署名(`scripts/sign-android-apks.sh`
- ABI は `-PmeshchatxAbis` または `MESHCHATX_ABIS`、パッケージングは `-PmeshchatxAbiPackaging` または `MESHCHATX_ABI_PACKAGING`
- リポジトリルートに `dist/reticulum_meshchatx-*.whl` がある場合(例: `python -m build --wheel -o dist .` の後)、バンドルではそれが優先されます。詳細は [`android/README.md`](../android/README.md)
追加ドキュメント:
+8 -16
View File
@@ -219,31 +219,23 @@ MeshChatX поддерживает нативные Android APK (не тольк
# 1) Собрать колёса Chaquopy для android/app/build.gradle
bash scripts/build-android-wheels-local.sh
# 2) Собрать slim APK по умолчанию (universal: один APK на flavor и тип сборки)
# 2) Собрать универсальные APK (debug и release; см. android/README.md)
cd android
./gradlew --no-daemon :app:assembleSlimDebug :app:assembleSlimRelease
./gradlew --no-daemon :app:assembleDebug :app:assembleRelease
```
Выходы определяются **product flavors** `slim` / `full` (размер дерева Python) и **ABI-упаковкой** `universal` (по умолчанию) или `split` (см. `android/app/build.gradle`).
Одна вариант-сборка Android (без flavor `slim` / `full`). Gradle синхронизирует весь `meshchatx/` в `app/src/main/python/meshchatx/`, включая офлайн-колёса репозитория. **ABI-упаковка:** `universal` (по умолчанию) или `split` (см. `android/app/build.gradle`).
При **`-PmeshchatxAbiPackaging=universal`** (по умолчанию) один APK содержит все выбранные ABI.
При **`-PmeshchatxAbiPackaging=universal`** (по умолчанию):
Отладка (`android/app/build/outputs/apk/slim/debug/`):
- `app-slim-debug.apk`
Релиз (`android/app/build/outputs/apk/slim/release/`):
- `app-slim-release-unsigned.apk`
Для полного Python-бандла: `:app:assembleFullDebug` или `:app:assembleFullRelease`.
- Отладка: `android/app/build/outputs/apk/debug/app-debug.apk`
- Релиз: `android/app/build/outputs/apk/release/app-release-unsigned.apk`
Примечания:
- Релизные артефакты по умолчанию не подписаны, если не настроена подпись.
- Для одной сборки, например: `:app:assembleSlimDebug` или `:app:assembleSlimRelease`.
- Релизы по умолчанию не подписаны (`scripts/sign-android-apks.sh`).
- ABI: `-PmeshchatxAbis` или `MESHCHATX_ABIS`; упаковка: `-PmeshchatxAbiPackaging` или `MESHCHATX_ABI_PACKAGING`.
- Дерево `meshchatx/` для Chaquopy: **`slim`** синхронизируется в `src/slim/python/`, **`full`** в `src/full/python/`. Подробнее в [`android/README.md`](../android/README.md).
- Если в корне репозитория есть `dist/reticulum_meshchatx-*.whl` (например после `python -m build --wheel -o dist .`), оно предпочитается при бандле. Подробнее в [`android/README.md`](../android/README.md).
Дополнительная документация:
+9 -17
View File
@@ -219,31 +219,23 @@ MeshChatX 支持构建原生 Android APK(不仅限于 Termux)。
# 1) 构建 android/app/build.gradle 所需的 Chaquopy 轮子
bash scripts/build-android-wheels-local.sh
# 2) 构建默认 slim APKuniversal:每种 flavor + 构建类型一个 APK
# 2) 构建通用 APK(一次 debug + 一次 release;见 android/README.md
cd android
./gradlew --no-daemon :app:assembleSlimDebug :app:assembleSlimRelease
./gradlew --no-daemon :app:assembleDebug :app:assembleRelease
```
输出由 **product flavors** `slim` / `full`Python 树大小)和 **ABI 打包** `universal`(默认)或 `split`(见 `android/app/build.gradle`决定
仅一种 Android 变体(无 `slim` / `full` flavor)。Gradle 将完整 `meshchatx/` 同步到 `app/src/main/python/meshchatx/`,含离线仓库 wheel。**ABI 打包** `universal`(默认)或 `split`(见 `android/app/build.gradle`)。
**`-PmeshchatxAbiPackaging=universal`**(默认)下,单个 APK 包含所选的全部 ABI。
**`-PmeshchatxAbiPackaging=universal`**(默认)时:
调试`android/app/build/outputs/apk/slim/debug/`:
- `app-slim-debug.apk`
发布(`android/app/build/outputs/apk/slim/release/`:
- `app-slim-release-unsigned.apk`
需要更大 Python 包时用 `:app:assembleFullDebug``:app:assembleFullRelease`
- 调试`android/app/build/outputs/apk/debug/app-debug.apk`
- 发布:`android/app/build/outputs/apk/release/app-release-unsigned.apk`
说明:
- 若未配置签名,发布构建默认未签名。
- 若只需一种构建,可运行例如 `:app:assembleSlimDebug``:app:assembleSlimRelease`
- ABI 可用 `-PmeshchatxAbis``MESHCHATX_ABIS` 覆盖;打包方式用 `-PmeshchatxAbiPackaging``MESHCHATX_ABI_PACKAGING`
- Chaquopy 的 `meshchatx/` 树:**`slim`** 同步到 `src/slim/python/`(较小),**`full`** 同步到 `src/full/python/`(完整)。详见 [`android/README.md`](../android/README.md)。
- 发布构建默认未签名`scripts/sign-android-apks.sh`
- ABI`-PmeshchatxAbis``MESHCHATX_ABIS`;打包:`-PmeshchatxAbiPackaging``MESHCHATX_ABI_PACKAGING`
- 若仓库根存在 `dist/reticulum_meshchatx-*.whl`(例如 `python -m build --wheel -o dist .` 后),捆绑时优先使用该 wheel。详见 [`android/README.md`](../android/README.md)
更多文档: