$ show geph-official/geph-android
Geph Android is a production VPN client that wraps a Rust-based circumvention engine (geph5-client) and a web UI (gephgui) inside a native Android application. The architecture is a hybrid of a WebView-hosted UI and a native daemon process: the main activity loads a local HTML/JS UI via WebViewAssetLoader, and a JavaScript bridge (init.js) communicates with Kotlin through @JavascriptInterface to invoke RPC calls over a Unix socket to the daemon. The daemon is spawned as a separate process (libgeph.so) and manages the VPN tunnel via Android's VpnService. The app supports multiple build variants (debug, releaseAPK for sideloading with auto-update, releasePlay for Google Play with Firebase Analytics and Play In-App Review) using a factory pattern to inject platform-specific features. Key data flows include user authentication via broker RPC, VPN start/stop lifecycle, and periodic update checks that download and verify APK signatures. External dependencies include the Rust engine binary, a prebuilt web UI, JNA for native access, and Firebase services for the Play variant.
The LLM identified 2 files worth highlighting for reuse:
Defines an interface for tracking account events (e.g., Plus tier purchases). The interface is implemented per build variant: debug/releaseAPK use a no-op implementation, while releasePlay integrates with Firebase Analytics. This pattern cleanly separates platform-specific analytics from core logic and can be extracted to inject any event sink into an Android app.
Defines an interface for triggering in-app review prompts. The releasePlay variant uses Google Play In-App Review API, while other variants use a no-op. This factory pattern allows the core app to request reviews without coupling to Play Services, and can be reused in any Android app that needs conditional review prompting.