Skip to content

Navigation Menu

Sign in
Sign up

android: native humd for Android — cross-compiled daemon + foreground-service host - #53

Open
adiled wants to merge 1 commit into
main from
android/native-humd
Open

android: native humd for Android — cross-compiled daemon + foreground-service host #53
adiled wants to merge 1 commit into
main from
android/native-humd

Conversation

@adiled

@adiled adiled commented Aug 22, 2026

Copy link
Copy Markdown
Owner

android: native humd for Android

humd itself, compiled for Android — not a thin thrum client, not a hive bee. The full Rust workspace (humd + ensemble + config + thrum-core + hum-paths + ...) cross-compiles to an aarch64-linux-android PIE ELF and is hosted by a native foreground service.

Why

The ensemble is the mesh of cooperating humds. To bring a phone into it without Termux, the phone must run humd, not just dial one. Rust was chosen because it runs everywhere — so the portability problem is build engineering, not a rewrite. humd's boot is entirely XDG-driven (hum-paths), so zero Rust code changes; the host just points XDG_* at app-private storage.

Proof this works

./android/scripts/build-humd.sh cross-compiled the workspace in 65s:

  • 30MB ARM aarch64 PIE ELF, dynamically linked against Bionic base libs only (libdl.so, libm.so, libc.so) — runs on any API 21+ device, no bundled libs.
  • iroh QUIC + rustls + aws-lc all build for Android via the NDK r27d.

Layers

  • Overlay — ensemble mesh: iroh (QUIC + Noise + relay hole-punching) reaches the machine's humd over internet/relay. The "thrum is the end of TCP" path — no TCP seam added.
  • Underlay — WiFi Direct: WifiP2pManager gives phones an ad-hoc p2p0 link (phone↔phone meetup); the native daemon's iroh runs on p2p0 when a group forms.

Files

  • android/scripts/build-humd.sh — NDK cross-compile, wires .cargo/config.toml linker + CC/AR, bundles the binary into app assets (gitignored)
  • android/app/.../HumdService.kt — foreground dataSync service: extracts binary, pins XDG_*, writes minimal hum.json + optional peers.json (machine's iroh hint), execs + supervises the daemon
  • android/app/.../WifiDirectManager.kt — radio underlay
  • android/README.md — port doc

Follows hives/wifi-p2p (the radio-underlay prototype). This is the daemon itself; the next step is sideloading and watching the phone humd join the machine's mesh over iroh.

...-service host
humd itself, compiled for aarch64-linux-android (PIE ELF, Bionic), not a
thin thrum client. The Rust workspace cross-compiles as-is (iroh QUIC +
rustls + aws-lc all build for Android via the NDK); humd's XDG-driven
boot needs zero code changes.
- scripts/build-humd.sh: NDK cross-compile, wires .cargo/config.toml
 linker + CC/AR, bundles 30MB PIE humd into app assets (gitignored)
- HumdService.kt: foreground dataSync service — extracts binary, pins
 XDG_* to app-private storage, writes minimal hum.json + optional
 peers.json (iroh hint of the machine), execs + supervises the daemon
- WifiDirectManager.kt: radio underlay — WifiP2pManager discovery +
 groups, hands p2p0 IP up to the host
Layers: ensemble mesh (iroh QUIC+relay) is the overlay reaching the
machine; WiFi Direct is the ad-hoc phone↔phone underlay.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

AltStyle によって変換されたページ (->オリジナル) /