dsh-mobile-apk README

The project's README from github.com/kelai141/dsh-mobile-apk. As one markdown file: README.md.

dsh-mobile-apk — DeepSeek Harness Android Shell APK

🌐 中文说明 / 中文 README

DeepSeek Harness Android

dsh-mobile 生态 · dsh-shell-termux(shell)· dsh-client-ui-responsive(移动 UI)· dsh-host-web-compat(浏览器兼容)

0.13.0 — official release: the ADB real channel (pairing / port discovery / shell execution / authorization gates / audit) is fully implemented and device-verified.

  • Plugin-marketplace caveat: the built-in marketplace covers many third-party plugins, and most of them are likely unavailable or buggy on phones (mobile vs desktop differ in WebView engine / filesystem / permission model / runtime). Mobile adaptation is long-term work — treat this beta as usability validation & feedback, not a production dependency. Report plugin issues to the issue tracker with device model / version / reproduction steps.

Android shell for DeepSeek Harness: WebView UI over an embedded Termux runtime snapshot (extract-and-run, no Termux app needed), SAF directory bridge, keep-alive foreground service, engine watchdog, and online runtime updates. One APK to install: it boots a full dsh web agent that can really execute bash. App name DeepCode (icon text DeepSearch), package com.dsharnessmobile.shell, version 0.13.0-fx-1 (versionCode 26).

Features

Download / Install

Release v0.13.0-fx-1 ships two ABI variants (plus snapshot archives, plugin packages, MANIFEST checksums and release notes):

APK Target
dsh-mobile-apk-v0.13.0-fx-1-arm64.apk arm64 devices (real phones)
dsh-mobile-apk-v0.13.0-fx-1-x86_64.apk x86_64 emulators / devices
adb install -r -t <apk>    # same-signature overwrite install

ABI must match the device. A mismatched snapshot crashes the engine at startup — node ELF EM_X86_64 vs EM_AARCH64. Pick arm64 for real phones, x86_64 for emulators.

Build

Snapshot build & packaging live in the coordination repo (dsh-mobile); this repo is the shell. Requirements: JDK 17+, Android SDK (compileSdk 36); Gradle 8.11.1 via wrapper.

# Snapshot build (Termux sources + dependency closure + pnpm + cordis overrides + slimming):
node scripts\build-snapshot-013.mjs <arm64|x86_64>

# One-shot packaging (snapshot → injection → gates → gradle):
pwsh scripts\build-apk-013.ps1 -Suffix "-preview"
# output: out\v0.13.0\dsh-mobile-apk-v<ver>-<abi>.apk

Gates (inside build-apk-013.ps1): third-party compliance (check-third-party.mjs, GPL obligations) / secrets / ELF / cordis mount-set ⊇ injected set / LICENSES self-check (Python streaming) — any failure rejects the build.

Bridge protocol v1 (window.androidBridge)

App name DeepCode (icon text DeepSearch), package com.dsharnessmobile.shell. androidBridge.version returns the app version (currently 0.13.0-fx-1, versionCode 26); pages feature-detect on it. The ADB methods below are the preview authorization surface — the real channel completes in the 0.13.0 official release.

Synchronous

method signature description
version () → string app version (0.13.0-fx-1) for feature detection
getSystemDark () → boolean system dark mode (bypasses vendor WebViews whose matchMedia is stuck on light; used by the first-frame theme bridge)
checkEngine () → string probes 127.0.0.1:3080; JSON {running, latencyMs, error?}
hasAllFilesAccess () → boolean whether All Files Access is granted (external workspace requirement)
getPickToken () → string one-shot token for the directory-picker bridge (validated by the engine-side pick endpoint)
copyText (text) → boolean native clipboard write (WebView clipboard.writeText is always rejected; page falls back to this)
getDevLogEnabled () → boolean dev debug-log toggle state
getAdbState () → string ADB authorization state view (gate state machine): JSON {fullAccess, allowSwitch, paired, wirelessDebugOn, message} (preview)
discoverAdbPorts () → string wireless-debug port auto-scan (native TCP sweep): pairing-port candidates as JSONArray; [] while wireless debugging is off (preview)
setAdbPair (code, pairPort, connectPort) → boolean gate-3 pairing: real adb pair handshake; the code goes to argv only — never into the audit log (preview)
adbShell (cmd) → string ADB shell primitive: JSON {ok, stdout?, stderr?, guidance?}; fail-closed when not authorized (preview)

Commands

method signature description
keepScreenOn (enable) screen-on wake lock
showNotification (title, text) test notification channel (POST_NOTIFICATIONS)
pickDirectory (callbackId) SAF tree picker; result async via window.__dshBridge.onDirectoryPicked(callbackId, path)
pickImage (callbackId) SAF image picker; result async via the same callback
setTextZoom (percent) WebView font scale (50–200; Settings → General slider)
setImmersiveMode (enable) immersive status bar toggle (true = status bar normally hidden)
downloadDebugLogs () exports engine logs + environment info (zipped, system download/share dialog)
requestAllFilesAccess () opens the system All Files Access grant page (special permission)
restartEngine () restarts the engine process (EngineService watchdog brings it back)
shutdownToGuide () stops the engine and falls back to the test screen (no auto-restart)
reloadWebUI () reloads the Web UI
openConsole () opens the built-in console
setDevLogEnabled (enabled) sets the dev debug-log toggle (logs go under dshdata/log/ when on)
setAdbAllow (enable) gate-2 "allow access" switch (default off; off ⇒ channel fail-closed) (preview)
revokeAdbPair () revoke pairing (disconnect + delete adbkey + clear state; audited) (preview)

The bridge decouples the APK from the dsh version: pages feature-detect on androidBridge.version.

Online update protocol

  1. App fetches manifest.json: {url, sha256, size} (default http://10.0.2.2:8899/manifest.json for emulator testing; production points at a release server);
  2. Downloads the snapshot, verifies SHA-256, extracts to a staging dir (never touching the live tree), atomically swaps usr → usr-old → new usr, then kills the old engine — the watchdog restarts it from the new runtime.

Test trigger: adb shell am start -n com.dsharnessmobile.shell/.MainActivity -a com.dsharnessmobile.shell.action.UPDATE; status is written to files/update-status.txt. Test server: serve manifest.json + the snapshot from any local HTTP server (default endpoint http://10.0.2.2:8899/manifest.json maps the host from the emulator).

Permissions

permission purpose
INTERNET WebView + engine probe
POST_NOTIFICATIONS notification channel (runtime request on API 33+)
FOREGROUND_SERVICE + FOREGROUND_SERVICE_DATA_SYNC keep-alive foreground service
MANAGE_EXTERNAL_STORAGE All Files Access (external workspace requirement; special permission, user-granted)

SAF picking needs no permission.

ABI & pagesize

arm64 and x86_64 are both verified end-to-end; APKs are distributed per-ABI (the embedded snapshot is arch-specific). A 16KB-page build must be produced on a 16KB device (see docs/design.md §ABI).

License

MIT. Contains third-party components under their own licenses (see dependency declarations). GPL compliance: copyleft license texts ship in all three forms — snapshot usr/share/LICENSES/, repo LICENSES/, and APK assets/licenses/. Design rationale: docs/design.md.

Acknowledgments & invitation

Thanks to the community for feedback and contributions — especially cdwlll (environment issues), haitunlang (MIUI 12 compatibility), TACONailoong (legacy-WebView compat), X-SCI-TECH (PRs), Yangerwei (file race feedback), gr12-cmd (armv7l demand), cmyfqwq (coverage-install compatibility feedback).

Contributors welcome: Android compatibility testing (Huawei / Honor / Xiaomi custom WebViews), armv7l and more device support, completing the ADB channel, and growing the plugin ecosystem. Development & contribution guidelines live in each repo's AGENTS.md.

dsh-mobile-apk (kelai141/dsh-mobile-apk)

Searching Database…

这是什么?这是“dsh-mobile-apk”,一个 DeepSeek Harness(dsh)的 Android 壳应用:用 WebView 界面包住内嵌的 Termux 运行时快照,让你在手机上得到一个能真正执行 bash 的完整 dsh Web 智能体,不需要电脑,也不用单独装 Termux。
这是独立应用,还是得另外装 Termux?它是一个自包含的 APK(应用名 DeepCode),自带 Termux 运行时快照——包括 node、git、bash、coreutils、dsh、插件、pnpm、python/perl/ruby——所以不需要单独的 Termux 应用。
要为我的设备选对 APK 变体吗?要——ABI 必须和你的设备完全匹配;装错变体(arm64 和 x8664 弄反)会让引擎在启动时崩溃,而不只是安装失败。
插件市场在手机上好用吗?还不太可靠——内置市场里大多数第三方插件在移动端很可能用不了或有 bug,因为 WebView 引擎、文件系统和权限模型都和桌面端不同;项目把这一点当作 Beta 可用性测试,而不是可依赖的生产功能。
运行需要联网吗?不需要——运行时快照解压好之后,dsh 引擎完全离线运行;只有可选的在线运行时更新清单才需要联网。
这个应用需要哪些权限?它请求 INTERNET 和 POST_NOTIFICATIONS、保活引擎服务所需的前台服务权限,以及外部工作区所需的 MANAGE_EXTERNAL_STORAGE(“所有文件访问”);SAF 目录选择本身不需要额外权限。
ADB 真机通道是干什么用的?0.13.0 新增的功能,通过无线调试与设备配对(adb pair 的 SPAKE2 握手加 mDNS 端口发现),经 adbd 执行 shell 命令;受三步授权流程(所有文件访问、应用内开关、配对码)、危险命令黑名单和设备端审计日志的约束。
主 dsh 引擎崩溃了会怎样?即使引擎挂了,内置的独立 bash 控制台(由内嵌 Termux 支撑)仍可用于诊断;5 秒看门狗加上崩溃自动回滚门控会尝试自动重启引擎。
运行时能不装新 APK 就自我更新吗?能——它会拉取包含 URL 和 SHA-256 的 manifest.json,下载并校验新的快照,原子化地完成替换,然后重启引擎,全程不需要更新 APK。
文件转会话(F5)功能是做什么的?通过 Android 的分享/打开方式打开一个文件会跳进本应用,并为该文件开一个全新的临时工作区会话,会话在 7 天 TTL 后自动清理。
Creator
kelai141
Size
33.5 MB
Stars
769
Age
2mo
Commits · 90 Days