Android Thin-Shell (touched-android)
touched-page/touched-android (MIT License) is a lightweight Android WebView thin-shell designed to work with both https://touched.page and any self-hosted touched-node.
Instead of maintaining a heavy duplicate native UI, it wraps the responsive web app and adds the two capabilities mobile browsers lack: system share-to-capture and zero-CORS on-device metadata extraction.
1. Download Preview APK
Download the latest signed preview build directly from GitHub Releases:
- Direct APK (
v0.1.0-preview.1): touched-android-v0.1.0-preview.1.apk - Release Notes & SHA-256: v0.1.0-preview.1 on GitHub
- Requirements: Android 8.0+ (
minSdk = 26,compileSdk = 35), requests onlyandroid.permission.INTERNET.
2. System Share Capture (ACTION_SEND)
Mobile reading and gaming happen inside native apps—not desktop browsers. touched-android registers an Android ACTION_SEND (text/plain) intent receiver (ShareUrlExtractor.kt):
- Tap Share -> Copy / More -> touched.page inside Qidian (起点读书), Douban (豆瓣), Bilibili, WeRead (微信读书), Steam Mobile, or any browser.
ShareUrlExtractorstrips app-injected promotional noise, extracts the canonical work URL and title, and opens/share?url=...&title=...&text=...on your active node.- The page fetches work metadata directly from your phone via the native bridge (zero server egress), letting you pick a tier, status, tags, and review in seconds.
3. Zero-CORS window.TouchedNative Bridge Contract
NativeBridge.kt injects window.TouchedNative only into pages matching your trusted configured node origin. Third-party sites opened in Chrome Custom Tabs never see the bridge.
| Method / Property | Description |
|---|---|
isNativeShell: boolean | Always true inside the Android shell |
platform: "android" | Identifies the host platform |
fetchPageMetadata(url: string) | On-device metadata extraction helper |
fetchPageHtml(reqId: string, url: string) | Fetches target HTML directly from the device, enforcing strict public-IP SSRF guards (blocks loopback, private RFC1918, link-local, CGNAT, ULA, and IPv4-mapped private addresses), max 5 redirects, and 256 KB body cap—returning strictly <title>, <meta>, <link rel="canonical">, and <script type="application/ld+json"> back to /share |
setStatusBarTheme(theme: "light" | "dark") | Synchronizes Android system status bar icon contrast with touched.page's theme toggle |
openServerSwitcher() | Opens the native server URL dialog to switch between https://touched.page and your self-hosted touched-node |
4. Switching to Your Self-Hosted touched-node
- Defaults to
https://touched.page. - Open the top-right account dropdown inside the app and tap Switch Server (or tap Switch Node on the offline fallback screen).
- Enter your self-hosted
touched-nodehttps://origin (e.g.https://library.example.com) or reset to default anytime. Release builds enforce HTTPS; Debug builds also permitlocalhost,127.0.0.1, and10.0.2.2for local development.
5. Building Locally from Source
Requires JDK 17, Android SDK Platform 35, and Gradle 8.10.2:
git clone https://github.com/touched-page/touched-android.git
cd touched-android
gradle testDebugUnitTest assembleDebug --no-daemon
# Output: app/build/outputs/apk/debug/app-debug.apk