Remote Access App
This project is a SSH client for Android that hopefully works better than existing clients.
Native: libghostty-vt (Zig)
The app bundles libghostty-vt from ghostty-org/ghostty, built with Zig and the Android NDK. The :app:buildGhosttyNative task (Kotlin in app/build.gradle.kts) runs before each build via preBuild.
The Ghostling demo is C-only and uses CMake, but it still builds the library via Ghostty’s zig build (see Ghostling’s CMakeLists.txt). The README line about “zero-dependency” describes what the VT core can look like in minimal configurations; the default native build enables SIMD and pulls in C++ (highway, simdutf, utfcpp). This project passes -Dsimd=false to Zig so that C++ stack is omitted (same idea as Ghostty’s c-vt-cmake-static example and the note in Ghostty’s root CMakeLists.txt about simd). Tradeoff: less SIMD-accelerated text/UTF-8 work; you still need Zig and the Android NDK for this cross-compile.
Requirements
- Zig on
PATH, version matching Ghostty’sbuild.zig.zon(currently 0.15.2+). Override the binary withZIG=/path/to/zigif needed. - Android SDK with
sdk.dirinlocal.properties(orANDROID_HOME/ANDROID_SDK_ROOT). - NDK installed for the version pinned in
app/build.gradle.ktsasandroid { ndkVersion = "…" }(under$sdk/ndk/<version>).
Pinning the Ghostty revision
Edit native/ghostty/ghostty.version: first non-comment line is a Git branch, tag, or full commit SHA. To pull a newer tip of a branch (e.g. main), delete native/ghostty/.ghostty-build-stamp so the next Gradle build refetches and rebuilds.
ABIs
Only arm64-v8a and x86_64 are built and packaged today. (-Dsimd=false avoids the old 32-bit ARM float-ABI failure in the C++ SIMD deps; enabling more ABIs would need a separate check.)
Outputs
Built libghostty-vt.so (ignored by git) is copied into app/src/main/jniLibs/<abi>/. Zig sets DT_SONAME to libghostty-vt.so.0, which would make libremote_ghostty_jni.so depend on that filename (not packaged by AGP as a single *.so). The CMake post-link step runs patchelf --replace-needed libghostty-vt.so.0 libghostty-vt.so on the JNI library when patchelf is on the host PATH (e.g. Arch: pacman -S patchelf). Install it so debug/release APKs load libghostty-vt.so correctly.