Skip to content

Latest commit

 

History

History
118 lines (74 loc) · 4.67 KB

File metadata and controls

118 lines (74 loc) · 4.67 KB

Trierarch — Developer Docs

User docs | English


For anyone building the Android app from source. All paths are relative to the repository root.

The app loads several native libraries from trierarch-app/app/src/main/jniLibs/arm64-v8a/ and optional assets under trierarch-app/app/src/main/assets/. Below is the monorepo build surface: role → artifact(s) → build entry point → docs.

Quick checks (recommended)

Run this before pushing a PR:

./scripts/dev-check.sh

Generated artifacts (not tracked)

  • trierarch-app/app/src/main/assets/pulse/ is generated by trierarch-audio/build-android/build-pulse-android.sh and intentionally not tracked by git. At runtime the app extracts it to filesDir/pulse/.

Android application (UI & APK)

Runs the Compose UI, bundles assets, and produces the installable APK. You assemble JNI libraries into jniLibs, then run Gradle here.

  • Role: packaging and Java/Kotlin UI.
  • Artifact: e.g. trierarch-app/app/build/outputs/apk/debug/app-debug.apk.
  • Details: trierarch-app/README.md

JNI / native layer (Rust)

Implements proot integration, PTY I/O, rootfs download/extract, etc., exposed to the app as libtrierarch.so.

  • Role: Rust JNI bridge used by the Android code.
  • Artifact: trierarch-native/target/aarch64-linux-android/release/libtrierarch.so → copy to trierarch-app/app/src/main/jniLibs/arm64-v8a/.
  • Details: trierarch-native/README.md

PRoot (Android aarch64)

Builds the proot binary and loader used as libproot.so / libproot_loader.so in the app.

  • Role: userspace chroot/exec inside the Arch rootfs.
  • Artifacts: trierarch-proot/build-android/out/aarch64/prootlibproot.so, loaderlibproot_loader.so (see proot README for exact copy names).
  • Details: trierarch-proot/README.md

In-app Wayland compositor

Builds the minimal Wayland server .so files so Linux GUI clients in the rootfs can render into the app surface.

  • Role: Wayland compositor + dependencies for the in-app view.
  • Artifacts: everything under trierarch-wayland/out/arm64-v8a/*.so → copy into trierarch-app/app/src/main/jniLibs/arm64-v8a/.
  • Details: trierarch-wayland/README.md

In-app X11 server (Xlorie)

Builds the embedded Xorg-based X11 server library used for X11 sessions.

  • Role: X11 server + renderer (libXlorie.so).
  • Source: Git tracks only trierarch-x11/scripts/ (and README); the script clones trierarch-x11/termux-x11/ (gitignored) and can refresh upstream with TX11_UPDATE_UPSTREAM=1 (see that README).
  • Artifacts: trierarch-x11/out/arm64-v8a/libXlorie.so → copy into trierarch-app/app/src/main/jniLibs/arm64-v8a/.
  • Details: trierarch-x11/README.md

Host PulseAudio (optional)

Build a bionic pulseaudio prefix for the app’s internal storage layout (filesDir/pulse/). Guest libpulse connects over a Unix socket exposed by the host daemon.

  • Role: host daemon + guest libpulse over PULSE_SERVER.
  • Artifacts: after meson install, ship bin/, lib/, … under the app’s pulse/ prefix (see pulse_host in trierarch-native).
  • Details: trierarch-audio/README.md

Assemble native libs and build the APK

After building the pieces above (see each README.md), from the repo root:

mkdir -p trierarch-app/app/src/main/jniLibs/arm64-v8a
cp trierarch-proot/build-android/out/aarch64/proot   trierarch-app/app/src/main/jniLibs/arm64-v8a/libproot.so
cp trierarch-proot/build-android/out/aarch64/loader trierarch-app/app/src/main/jniLibs/arm64-v8a/libproot_loader.so
cp trierarch-native/target/aarch64-linux-android/release/libtrierarch.so trierarch-app/app/src/main/jniLibs/arm64-v8a/
cp trierarch-wayland/out/arm64-v8a/*.so trierarch-app/app/src/main/jniLibs/arm64-v8a/
cp trierarch-x11/out/arm64-v8a/libXlorie.so trierarch-app/app/src/main/jniLibs/arm64-v8a/

Optional: build and sync the host PulseAudio prefix into app assets:

cd trierarch-audio/build-android
./build-pulse-android.sh

Ensure trierarch-app/app/src/main/assets/keymap_us.xkb is present (shipped in this repo). Then:

cd trierarch-app
./gradlew assembleDebug
./gradlew installDebug

Output: trierarch-app/app/build/outputs/apk/debug/app-debug.apk.

Notes

  • The app stores its Arch rootfs under data_dir/arch (internal storage). If missing at first launch, it may be auto-downloaded via proot-distro (network required).