hope2333.github.io / wiki

architecture


Architecture

Transplant Pipeline

The core innovation: graft OpenCode's JavaScript module graph into the official Android Bun ELF, then run a "revive surgery" to produce a single Bionic executable.

Official Bun ELF → Extract → Module graph insertion → Patch → Assemble → Revive → Working binary

Key insight: the original failure ("zero glibc is impossible") was caused by assemble never patching BUN_COMPILED.size in the .bun section. Fixed in the transplant pipeline.

Seccomp SIGSYS Shim

Dual-layer protection:

This ensures the binary can handle Android's seccomp restrictions gracefully.

TUI (libopentui.so)

A self-built bionic libopentui.so (compiled with NDK) provides terminal UI rendering. Swapped into the binary via tools/transplant/swap_tui.py at equal length.

Native Watcher

tools/watcher/ provides a standalone file watching daemon:

Package Format