android: native humd for Android — cross-compiled daemon + foreground-service host - #53
Open
adiled wants to merge 1 commit into
Open
android: native humd for Android — cross-compiled daemon + foreground-service host#53adiled wants to merge 1 commit into
adiled wants to merge 1 commit into
Conversation
…-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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 anaarch64-linux-androidPIE 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.shcross-compiled the workspace in 65s:libdl.so,libm.so,libc.so) — runs on any API 21+ device, no bundled libs.Layers
WifiP2pManagergives 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.tomllinker + CC/AR, bundles the binary into app assets (gitignored)android/app/.../HumdService.kt— foregrounddataSyncservice: extracts binary, pins XDG_*, writes minimalhum.json+ optionalpeers.json(machine's iroh hint), execs + supervises the daemonandroid/app/.../WifiDirectManager.kt— radio underlayandroid/README.md— port docFollows
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.