@dsh-mobile/mobile-remote 3.2.4 → 3.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +204 -0
- package/FAQ.md +4 -0
- package/README.md +21 -14
- package/docs/01-PRD.md +4 -4
- package/docs/02-architecture.md +1 -1
- package/docs/03-api.md +49 -1
- package/docs/05-test-cases.md +7 -7
- package/docs/06-install-run.md +16 -3
- package/docs/07-user-manual.md +23 -1
- package/docs/08-/346/211/251/345/261/225/345/274/200/345/217/221/346/214/207/345/215/227.md +2 -2
- package/docs/09-compatibility.md +3 -3
- package/docs/10-remote-access-and-launch-plan.md +216 -0
- package/docs/11-remote-relay-guide.md +82 -0
- package/docs/APP-ENCRYPTION-DESCRIPTION.md +50 -0
- package/docs/APP-ENCRYPTION-DESCRIPTION.pdf +0 -0
- package/docs/AUDIT-2026-11-node.md +181 -0
- package/docs/AUDIT-2026-11.md +167 -0
- package/docs/BRAND-ASSETS.md +142 -0
- package/docs/BUILD-ENVIRONMENT.md +15 -4
- package/docs/FEATURE-PARITY.md +2 -2
- package/docs/PRIVACY-POLICY.en.md +143 -0
- package/docs/PRIVACY-POLICY.md +108 -30
- package/docs/STORE-LAUNCH.md +169 -21
- package/docs/STORE-LISTING.md +150 -0
- package/docs/SUPPORT.md +4 -3
- package/docs/TERMS-OF-SERVICE.en.md +70 -0
- package/docs/TERMS-OF-SERVICE.md +70 -0
- package/docs/screenshots/01-home.png +0 -0
- package/docs/screenshots/02-notifications.png +0 -0
- package/docs/screenshots/03-sessions.png +0 -0
- package/docs/screenshots/04-chat.png +0 -0
- package/docs/screenshots/05-settings.png +0 -0
- package/docs/screenshots/06-new-session.png +0 -0
- package/docs/screenshots/07-connect.png +0 -0
- package/lib/account-usage-query.js +278 -0
- package/lib/api-helpers.js +333 -0
- package/lib/client.js +284 -1
- package/lib/config.js +211 -0
- package/lib/host-compat.js +133 -0
- package/lib/http-util.js +69 -0
- package/lib/index.js +179 -2009
- package/lib/push.js +73 -0
- package/lib/rate-limit.js +46 -0
- package/lib/relay/connector.js +300 -0
- package/lib/relay/crypto.js +117 -0
- package/lib/relay/devices.js +138 -0
- package/lib/relay/identity.js +60 -0
- package/lib/relay/mux.js +411 -0
- package/lib/relay/noise.js +178 -0
- package/lib/relay/pairing.js +64 -0
- package/lib/relay/phone.js +114 -0
- package/lib/relay/serve.js +105 -0
- package/lib/rpc-adapter.js +88 -0
- package/lib/session-list.js +77 -0
- package/lib/timeline.js +476 -0
- package/lib/turn-outline.js +289 -0
- package/package.json +1 -1
package/docs/06-install-run.md
CHANGED
|
@@ -83,7 +83,7 @@ corepack pnpm install
|
|
|
83
83
|
|
|
84
84
|
**web 版(`dsh --profile web`)**:步骤 1 同上(profile 换 `web`),步骤 3 为重启 `dsh web` 进程;**web 版 webserver 默认即 `0.0.0.0:3080`**(局域网直连开箱即用;无需覆盖 webserver 行,见 §4 警示)。注:web 版直连 webserver 时插件路由在同一个 webserver 上;桌面版见 §4b LAN 桥。
|
|
85
85
|
|
|
86
|
-
## 4.
|
|
86
|
+
## 4. 变更配置(口令/路径)
|
|
87
87
|
|
|
88
88
|
编辑 `cordis.patch.yml` 改 `mobile-remote` 行的 `config`,然后重启:
|
|
89
89
|
|
|
@@ -94,7 +94,6 @@ corepack pnpm install
|
|
|
94
94
|
config:
|
|
95
95
|
path: /m
|
|
96
96
|
authToken: <新口令,留空=关闭认证>
|
|
97
|
-
rechargeUrl: https://platform.deepseek.com/top_up
|
|
98
97
|
```
|
|
99
98
|
|
|
100
99
|
口令生成建议:`node -e "console.log(require('crypto').randomBytes(24).toString('base64url'))"`
|
|
@@ -308,7 +307,7 @@ flutter build apk --release
|
|
|
308
307
|
```
|
|
309
308
|
|
|
310
309
|
> 首次构建需下载 Gradle 依赖(约 5-10 分钟);若报 Kotlin 增量缓存损坏(`Could not close incremental caches`),`android/gradle.properties` 已设 `kotlin.incremental=false`,删除 `build` 与 `.dart_tool` 后重试。
|
|
311
|
-
>
|
|
310
|
+
> 更换图标:修改 `lib/brand/` 里的绘制代码后运行 `dsh-mobile-app/tools/brand/build.sh`(一次生成 Android / iOS 全部图标与桌宠动画,详见 `docs/BRAND-ASSETS.md`),再重新构建。
|
|
312
311
|
> 多品牌/兼容性注意事项见 docs/09-compatibility.md。
|
|
313
312
|
### 8.3 安装与使用
|
|
314
313
|
1. 把 APK 传到手机(微信文件传输/网盘/USB),点击安装(需允许"安装未知来源应用")。
|
|
@@ -320,6 +319,20 @@ flutter build apk --release
|
|
|
320
319
|
- 插件/网页端改动 → 按 §3 同步并重启 DSH。
|
|
321
320
|
- App 改动 → 重新 `flutter build apk --release` 并重装(同签名覆盖安装,保留连接信息)。
|
|
322
321
|
|
|
322
|
+
### 8.5 首页广告(Gravity)
|
|
323
|
+
|
|
324
|
+
首页底部有一个广告位,由 Gravity 的 iOS / Android 原生 SDK 直接从手机请求广告,**没有自己的后端**。配置不进 git:
|
|
325
|
+
|
|
326
|
+
1. 在 `dsh-mobile-app/` 下建 `dart-defines.local.json`(已 gitignore):
|
|
327
|
+
```json
|
|
328
|
+
{ "GRAVITY_API_KEY": "<Gravity 后台 Settings → Platform Settings 的 Key>", "GRAVITY_PRODUCTION": "false" }
|
|
329
|
+
```
|
|
330
|
+
2. 构建 / 运行时带上它:`flutter run --dart-define-from-file=dart-defines.local.json`,`flutter build appbundle --release --dart-define-from-file=dart-defines.local.json`,`flutter build ipa --dart-define-from-file=dart-defines.local.json`(`scripts/build-ios.sh` 会自动带)。
|
|
331
|
+
3. **没有这个文件也能构建**:没有 Key 时广告位直接不显示(测试、CI、别人的 fork 都是这样)。**忘了带参数 = 这个包没有广告**,发布前请确认。
|
|
332
|
+
4. `GRAVITY_PRODUCTION`:`false` 时 Gravity 只返回测试广告(不计费,内容是 "Test Ad");`true` 才是真广告,但 Gravity 审核通过平台之前会返回 403,广告位保持空白。送 Gravity 审核的构建用 `false`(审核员看到测试广告);审核通过后再发 `true` 的构建,**不要把 `false` 的构建当正式版长期留给用户**。
|
|
333
|
+
5. 广告位必须先在 Gravity 后台 **Placements** 登记:类型 `bottom_page`,ID `home-bottom`(与 `lib/ads/gravity_config.dart` 一致)。后台登记过广告位后,没登记的广告位会被**静默丢弃**,没有报错,只是没有广告。
|
|
334
|
+
6. 发给 Gravity 的内容只有一句固定的应用描述(`GravityConfig.appContext`)、随机安装 ID、设备信息、IP 和 GPC 信号;**不含任何会话内容**。改动这几项之前先改隐私政策和两个商店的隐私申报。
|
|
335
|
+
|
|
323
336
|
## 9. 验收清单(已执行 ✅)
|
|
324
337
|
|
|
325
338
|
- [x] `--dump-config` 含 mobile-remote 行;启动日志含 lanBridge 监听行(桌面版)
|
package/docs/07-user-manual.md
CHANGED
|
@@ -2,6 +2,28 @@
|
|
|
2
2
|
|
|
3
3
|
> 版本:v2.7.0 · 配套:06-install-run.md · 面向使用手机 App 的最终用户
|
|
4
4
|
## 1. 快速开始
|
|
5
|
+
|
|
6
|
+
### 1.0 第一次使用:先在电脑上装好插件
|
|
7
|
+
|
|
8
|
+
**电脑端先装好插件**(在装有 DeepSeek Harness 的电脑上,终端里依次运行):
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
# 1. 安装插件(装上即自动启用,不用改配置文件)
|
|
12
|
+
npx @deepseek-ai/dsh plugin --profile web add @dsh-mobile/mobile-remote
|
|
13
|
+
# 2. 启动 DSH(--no-open = 不自动打开浏览器)
|
|
14
|
+
npx @deepseek-ai/dsh web --no-open
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
用 DSH Desktop 的话把 `--profile web` 换成 `--profile desktop`,装完重启 DSH Desktop(Desktop 形态作者没有实测过)。
|
|
18
|
+
|
|
19
|
+
**连接地址和访问口令在哪里看:**
|
|
20
|
+
- 启动后终端会打印「手机 App 连接信息 / Phone app connection」:`电脑地址 Address` 和 `访问口令 Token`。口令首次启动自动生成并保存,重启不变;如果你在配置里自己写了 `authToken`,终端不会打印它,用你设置的那个。
|
|
21
|
+
- 也可以在 DSH 里打开 **设置 → 连接移动端设备**:有二维码、地址和口令,都带复制按钮。
|
|
22
|
+
|
|
23
|
+
**第一次打开 App**:进入连接页时会自动弹出「怎么连接你的电脑」,用六步讲清楚怎么连:① 下载安装电脑版 DeepSeek Harness 并登录;② 打开第三方插件页面并添加插件(更多 → 浏览更多插件 → 添加插件);③ 输入插件下载地址 `@dsh-mobile/mobile-remote`(可一键复制,只填这个名字,不用填整条命令);④ 彻底重新启动电脑版 DeepSeek Harness;⑤ 点击左下角的用户名,打开设置页;⑥ 打开「连接移动端设备」页面扫码连接。关掉后不再自动弹出;想再看,点连接页上的「怎么连接?」,或在 **设置 → 连接** 里点「怎么连接电脑?」。
|
|
24
|
+
|
|
25
|
+
### 1.1 连接
|
|
26
|
+
|
|
5
27
|
1. 确认电脑端 dsh(DeepSeek Harness)正在运行。
|
|
6
28
|
2. 手机与电脑连接**同一 WiFi**;**人不在家**时用蒲公英组网(电脑+手机装蒲公英客户端、同一组网,见 06-install-run.md §5)。
|
|
7
29
|
3. 打开 DSH Mobile:
|
|
@@ -31,7 +53,7 @@
|
|
|
31
53
|
**修改默认配置**:设置 → 默认 Agent 预设 / 默认权限预设 → 选择(作用于之后新建的会话,与 PC 端同一写入通道)。
|
|
32
54
|
**深色模式**:设置 → 深色模式:跟随系统 / 深色 / 浅色。
|
|
33
55
|
**换皮肤**:设置 → 外观 → 主题皮肤,四选一:默认(原 DSH 令牌)/ 深潜夜航 / 海盐汽水 / 鲸落星海。后三套会把首页换成大肥鱼角色 + 动态背景,角色可点头部(摸头)、点身体(戳一下)、点尾巴(甩尾),长按打开迷你面板。每套皮肤都含明暗两套配色,跟随「深色模式」切换。
|
|
34
|
-
**换图标**:设置 → 外观 → App 图标,8 款任选(默认 /
|
|
56
|
+
**换图标**:设置 → 外观 → App 图标,8 款任选(默认 / 深海荧光 / 贝壳徽章 / 月夜潮线 / 奶油贴纸 / 邮票 / 霓虹灯牌 / 单色剪影)。切换后若桌面没变,回桌面刷新一次即可。升级到这版后**桌面上的旧快捷方式可能失效一次**,删掉从抽屉重拖一个即可。
|
|
35
57
|
**减少动效**:设置 → 外观 → 减少动效,把桌面宠物、首页角色与首页背景动画一起关掉;系统的「移除动画」开关优先级更高。
|
|
36
58
|
**桌面宠物**:设置 → 桌面宠物 → 开启后常驻系统上层;「App 在前台时收起」(默认开)会切回 App 时自动隐藏宠物,返回桌面再出现。
|
|
37
59
|
**外出使用**:电脑和手机都装蒲公英客户端登录同一账号、加入同一组网(电脑保持开机)。首次在 App 里手动填一次电脑的蒲公英虚拟 IP(`http://172.16.x.x:3080`),之后 App 自动切换:出门走蒲公英、回家走局域网(设置 → 电脑地址显示「共 N 个地址自动切换」)。详见 06-install-run.md §5。
|
|
@@ -46,11 +46,11 @@ pushUrls:
|
|
|
46
46
|
```
|
|
47
47
|
|
|
48
48
|
想加一个**正式通道**(像 serverchan/ntfy 那样有专属格式):
|
|
49
|
-
1. 在 `lib/
|
|
49
|
+
1. 在 `lib/push.js` 的 `pushToChannel` 加一个 `else if (target.format === "xxx")`,并在 `test/push-channels.test.mjs` 里钉住请求形状
|
|
50
50
|
2. `docs/03-api.md` 与 README 推送节补说明
|
|
51
51
|
## 4. App 定制(dsh-mobile-app)
|
|
52
52
|
- **主题**:`lib/theme.dart` —— DeepSeek 设计令牌集中在这一个文件(浅色/深色两套),换色只改这里
|
|
53
|
-
-
|
|
53
|
+
- **图标与吉祥物**:品牌标、8 款图标和大肥鱼都是 `lib/brand/` 里的 Dart 绘制代码;改完运行 `tools/brand/build.sh` 重新生成全部位图(见 `docs/BRAND-ASSETS.md`)→ 重新构建
|
|
54
54
|
- **页面**:`lib/screens/` 每页一个文件,结构清晰
|
|
55
55
|
- **状态/事件**:`lib/store.dart` 全局状态 + SSE 事件桥;`lib/api.dart` 全部 API 调用
|
|
56
56
|
- **构建**:见 App README(`flutter analyze` + `flutter build apk --release`)
|
package/docs/09-compatibility.md
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
| 字段级兼容(v3.1.0 候选) | `reasoning`/`title` 为纯增量字段:新插件+旧 App 无影响(忽略新字段);新 App+旧插件自动回退(不渲染折叠块 / 桌面宠物标题兜底短码)——任意组合均可使用 |
|
|
17
17
|
| 字段级兼容(v3.1.1) | `/m/api/directories` 根视图新增 `sep`(服务端路径分隔符);新插件+旧 App 忽略该字段即可(旧 App 在 WSL 上仍按 `\` 拼接,由服务端`normalizeServerPath` 归一化兜底,浏览/建夹/建会话均可用);新 App+旧插件缺少 `sep` 时按根视图推断分隔符——任意组合均可使用 |
|
|
18
18
|
| 用量与额度(v3.2) | 新插件+新 App 通过 `/m/api/account-usage` 显示 DeepSeek/Codex/OpenCode Go;旧 App 忽略新端点。新 App+旧插件进入该入口会显示“电脑端插件版本过旧”,不影响其它功能;升级插件后无需重新配置凭据 |
|
|
19
|
-
| 桌面宠物面板用量与额度(v3.2) | 新 App+新插件:面板展开时按需展示三来源区块(金额行文字 + 配额行细条/颜色),整块可点进详情页。新 App
|
|
19
|
+
| 桌面宠物面板用量与额度(v3.2) | 新 App+新插件:面板展开时按需展示三来源区块(金额行文字 + 配额行细条/颜色),整块可点进详情页。新 App+旧插件:区块整体降级为原有单行余额(点击打开用量与额度页),其余面板功能不受影响;旧 App 忽略新端点。无新增服务端契约 |
|
|
20
20
|
| 外观:皮肤与图标(v3.2.2 build 27) | **纯 App 侧,无服务端契约变化**。皮肤是 `ThemeExtension` 令牌,旧插件照常工作;默认皮肤令牌与旧版逐值一致。App 图标用 8 个 `activity-alias`,只在 Android 生效(其它平台隐藏入口) |
|
|
21
21
|
| 图标入口迁移(build 27) | 启动入口从 `com.dsh.remote.MainActivity` 改为 `com.dsh.remote.IconDefault`:**升级后桌面旧快捷方式可能失效一次**(组件名变化,桌面固定的是组件名),首次启动有一次性说明引导重拖。抽屉入口不受影响 |
|
|
22
22
|
| 桌面宠物前台联动(build 27) | `MainActivity.onStart/onStop` → 服务根视图 `GONE`:App 在前台时收起宠物与状态气泡/迷你面板;`设置 → 桌面宠物 → App 在前台时收起` 可关。旧系统不涉及(仅原生层行为) |
|
|
@@ -188,10 +188,10 @@ Flutter 官方 Runner 工程已生成,Bundle ID 为 `com.mrdayone.dshmobile`
|
|
|
188
188
|
|---|---|---|
|
|
189
189
|
| 设计令牌(有意) | 品牌色 `#426EFE` / 深色 `#0E1116` 等(App `theme.dart`)、Android namespace `com.dsh.remote`、商店包名 `com.mrdayone.dshmobile`、QR 协议 `DSHREMOTE\|地址\|口令`、`EnableImpeller=true` | 产品设计/通信契约,勿随意改 |
|
|
190
190
|
| 内核耦合词(有意) | 系统消息过滤词 `Current runtime context` / `This snapshot supersedes` / `background job `(App `chat_screen.dart`) | 与内核/PC 端保持一致的隐藏规则 |
|
|
191
|
-
| 插件可配置项 | `path` / `authToken` / `cookieName` / `sessionTtlMs` / `
|
|
191
|
+
| 插件可配置项 | `path` / `authToken` / `cookieName` / `sessionTtlMs` / `maxConnections` / `pushUrls` / `pushCooldownMs` / `pushContent` / `rateLimit` / `trustedHosts` / `doneGraceMs`(v2.8.0)/ `lanBridge`(v3.0.0:`{enabled, port, host}`,默认关)/ `approvalMode`(v3.1.3:`both` 默认 \| `mobile` \| `desktop`)/ `turnOutlineTimeoutMs`(轮次导航:轮次大纲端点有界等待,默认 5000ms,契约门禁可调短) | schema 默认值,改配置即可 |
|
|
192
192
|
| 插件内置常量 | 通知上限 100、catalog 缓存 15s、SSE 心跳 25s、SSE 超时 15s、登录限流默认 10 次/60s(`rateLimit` 可配)、状态文件 `~/.dsh/mobile-remote/` | 合理默认,无需配置 |
|
|
193
193
|
| App 内置常量 | HTTP 超时 15/20s(余额 25s)、连接/探测超时 8s、地址表上限 8、重试退避 1s→15s、看门狗 15s 检查 / 心跳 75s(3 周期)、日志保留 15 天/256KB、聊天初始窗口 50 条、历史分段 30 条、上下文圆环阈值 70%/90%、思维链折叠手动状态键 `dsh_mr_reasoning_overrides`(按会话持久化,每会话软上限 100 条) | 合理默认;修改点集中在各文件顶部常量 |
|
|
194
|
-
|
|
|
194
|
+
| 已移除的功能 | 充值入口(App 与插件) | v3.3 起 App 不再提供任何充值链接(Apple 3.1.1),插件也不再下发 `catalog.rechargeUrl`;旧配置里的 `rechargeUrl` 字段会被忽略,不影响启动;新 App 连旧插件时忽略该字段 |
|
|
195
195
|
|
|
196
196
|
## 7. 发布签名
|
|
197
197
|
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
# 10 — Off-LAN access design and store-launch readiness
|
|
2
|
+
|
|
3
|
+
> Status (updated 2026-11-01): **designed, implemented and tested in code; not deployed anywhere.** The relay server, the
|
|
4
|
+
> plugin connector with pairing and the desktop panel, the phone-side client and the in-app pairing flow all exist
|
|
5
|
+
> (section 1.8 lists exactly what is verified and what is not). Section 2 is the store-readiness audit as of the first
|
|
6
|
+
> audit date; its code-side items have since been addressed (see section 2.5).
|
|
7
|
+
>
|
|
8
|
+
> **Launch scope (decided 2026-11-01): the first store release is LAN-only.** The relay code, protocol, tests and docs stay in the
|
|
9
|
+
> tree, but every user-facing entry point is hidden: the app's `Features.remoteAccess` (`lib/features.dart`) defaults to `false`
|
|
10
|
+
> and the desktop panel's `relayUi.advertiseWhenOff` (`lib/client.js`) defaults to `false`. Phones that were already paired through
|
|
11
|
+
> a relay keep working and can still unpair. Because the relay's own cipher code still ships inside the binary, the iOS export
|
|
12
|
+
> declaration stays `true` (section 3c of `STORE-LAUNCH.md`). Turning remote access on for a later release is two one-line changes
|
|
13
|
+
> plus the deployment steps in section 1.9 and `11-remote-relay-guide.md`.
|
|
14
|
+
>
|
|
15
|
+
> Evidence for the original audit was gathered at App `3.2.4+31` / plugin `3.2.4` and from the Android release build of that day.
|
|
16
|
+
> Items marked **(verify)** rest on a source that is not Apple's or Google's own text; check them in the live console.
|
|
17
|
+
|
|
18
|
+
## 0. Decisions needed from you before any code
|
|
19
|
+
|
|
20
|
+
| # | Decision | Why it blocks |
|
|
21
|
+
|---|---|---|
|
|
22
|
+
| D1 | **Which Apple program are the accounts in?** Apple's Enterprise Program is for internal employee apps only; Apple tells anyone shipping to the public to enroll in the standard Apple Developer Program ([Apple](https://developer.apple.com/programs/enterprise/)). App Store Connect / TestFlight / App Store release need the standard program (Organization). | If the account is Enterprise, nothing in section 3 can be submitted. |
|
|
23
|
+
| D2 | **Who runs the relay** (your company, or customers self-host) and **in which region** (mainland China needs ICP filing; Hong Kong / Singapore does not but adds latency). | Sets hosting, legal and privacy-label answers. |
|
|
24
|
+
| D3 | **DeepSeek branding.** The app icon and home screen use a whale mark that reads as DeepSeek's logo, the README calls it the "official logo", and the store subtitle names DeepSeek. Do you have written permission? *(Update 2026-11-01: the whale mark is gone from the app; what remains is the nominative use of the name "DeepSeek Harness" — see `docs/STORE-LAUNCH.md` §3c.)* | Apple 5.2 (intellectual property) and Google Play's impersonation policy are common rejection reasons. |
|
|
25
|
+
| D4 | **Push strategy**: APNs + FCM through the relay, or keep user-configured webhooks only. | iOS cannot deliver notifications while suspended without APNs. |
|
|
26
|
+
|
|
27
|
+
**Where these stand (2026-11-01).** D1: resolved by the owner (accounts are in order). D2: the code supports both; Cloudflare
|
|
28
|
+
is a suitable host (section 1.9) and a self-hosted Node relay is the fallback, procurement is the owner's. D3: **unresolved** and not
|
|
29
|
+
a code question. D4: open; push over the relay is not built (section 1.8).
|
|
30
|
+
|
|
31
|
+
## 1. Part A — Making the app work off the home network
|
|
32
|
+
|
|
33
|
+
### 1.1 Requirements
|
|
34
|
+
|
|
35
|
+
1. Works from any network with **no VPN app** on the phone and **no extra software** on the PC beyond the plugin that is already installed.
|
|
36
|
+
2. A compromised relay must **not** be able to control a PC (the agent can run commands, so this is the key risk).
|
|
37
|
+
3. Prefer a **direct LAN** connection when it exists (speed, privacy, no relay cost).
|
|
38
|
+
4. **Reuse the existing HTTP + SSE API** (`/m/api/*`); do not rewrite the screens.
|
|
39
|
+
5. **Per-device revocation** (today one shared token authorises every phone).
|
|
40
|
+
6. Notifications while the app is suspended.
|
|
41
|
+
7. Store-compliant: encrypted in transit, claims in the listing are true.
|
|
42
|
+
|
|
43
|
+
### 1.2 Options considered
|
|
44
|
+
|
|
45
|
+
| Option | Phone software | PC software | Secure if the middle is hostile? | Verdict |
|
|
46
|
+
|---|---|---|---|---|
|
|
47
|
+
| Virtual LAN (Pgyer, ZeroTier, EasyTier, WireGuard) | VPN app | VPN app | yes | works today; fails requirement 1 |
|
|
48
|
+
| Public tunnel (frp, Cloudflare Tunnel) + bearer token | none | tunnel tool | no — tunnel sees plaintext; one shared token guards remote code execution | acceptable stop-gap only |
|
|
49
|
+
| Cloud relay that terminates TLS | none | none | **no** — relay sees and can alter everything | rejected |
|
|
50
|
+
| **End-to-end-encrypted rendezvous relay (chosen)** | none | none | **yes** — relay forwards ciphertext only | recommended |
|
|
51
|
+
| WebRTC peer-to-peer | none | none | yes | still needs a signalling server and a TURN relay for symmetric NATs; keep as a later optimisation |
|
|
52
|
+
| Embed a WireGuard/Tailscale stack in the app | none | daemon needed on PC | yes | heavy, Go/native on both sides, Tailscale control plane is not reachable from mainland China per the existing docs |
|
|
53
|
+
|
|
54
|
+
### 1.3 Chosen design: outbound-only E2EE relay with request tunnelling
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
Phone app Relay (ciphertext only) PC plugin
|
|
58
|
+
───────── ─────────────────────── ─────────
|
|
59
|
+
RelayClient ──WSS (outbound)──▶ rooms[roomId] ◀──WSS (outbound)── relay connector
|
|
60
|
+
│ forwards frames │
|
|
61
|
+
└────────── Noise_IK end-to-end encrypted channel ───────────────────────┘
|
|
62
|
+
(HTTP requests / SSE streams tunnelled inside) │
|
|
63
|
+
loopback ──▶ existing /m/api handlers
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
* **Both sides dial out.** The PC opens no inbound port, so it works behind any NAT or home router.
|
|
67
|
+
* **Relay** is a small WebSocket router: it knows `roomId` and byte counts, never keys or plaintext. It stores nothing on disk.
|
|
68
|
+
* **Channel security**: `Noise_IK_25519_ChaChaPoly_BLAKE2s`. The phone already knows the PC's static public key from the pairing QR; the first message carries the phone's static key encrypted. Mutual authentication, forward secrecy, one round trip per reconnect. Primitives come from audited libraries (Dart: `cryptography`; Node: `@noble/*` or libsodium); the handshake is verified against the official Noise test vectors in CI so no custom crypto is trusted on faith.
|
|
69
|
+
* **Tunnelling**: inside the encrypted channel a small stream multiplexer carries `OPEN(streamId, method, path, headers)`, `DATA`, `END`, `RST`, `WINDOW`. SSE is just a long-lived response whose `DATA` frames arrive over time. Credit-based flow control (e.g. 256 KiB per stream, 4 MiB per connection), 16 KiB frames, so a 20 MB image upload cannot stall `hello`/heartbeat frames.
|
|
70
|
+
* **Pairing**: the desktop settings page ("连接移动端设备") already renders a QR. It would encode `dsh://pair?v=1&relay=<wss urls>&pc=<roomId>&pk=<PC public key>&otp=<one-time secret>&lan=<lan urls>`. The OTP is single-use and expires in minutes; the phone's key is stored in the PC's device list, shown in the desktop UI with a **Revoke** button. After pairing, no reusable bearer token crosses the network.
|
|
71
|
+
* **Path selection**: candidates are tried in order LAN → any virtual-network address → relay, with short timeouts, and re-probed on a network change. The app already stores several addresses and rotates between them (`Api.baseUrls`, `rotateBaseUrl()`, `AppStore.switchBase`); the relay becomes one more candidate, and the (still unreleased) fix that makes the live stream follow the saved address is what makes switching safe.
|
|
72
|
+
* **Optional later hardening**: run the *same* Noise channel directly over the LAN as well. That removes cleartext HTTP and the shared token entirely (answers "encrypted in transit: yes" for both stores).
|
|
73
|
+
|
|
74
|
+
### 1.4 Where it plugs into the existing code (checked, not assumed)
|
|
75
|
+
|
|
76
|
+
| Area | Fact found | Change |
|
|
77
|
+
|---|---|---|
|
|
78
|
+
| App networking | Every request goes through one injectable `http.Client`: `Api({http.Client? client})` (`api.dart:84`); file downloads take an injectable `downloadClient` (`api.dart:498-500`, `:586`). No raw `WebSocket`, `HttpClient` or `Image.network` elsewhere in `lib/`. | Add `TransportClient extends http.BaseClient` that dispatches `http(s)://` to the normal client and `dsh-relay://<roomId>` to the tunnel. Screens stay untouched. |
|
|
79
|
+
| Live stream | `AppStore.connect()` / `_connectedBase` (added by the unreleased live-stream fix) rebuild the SSE when the address changes. | No change; relay base URLs just flow through it. |
|
|
80
|
+
| Plugin auth | The LAN bridge already forwards to the webserver with a per-process nonce header (`CLIENT_IP_HEADER`, `lib/index.js` ~7236) that outsiders cannot forge. | The relay connector replays decrypted requests to loopback with a second nonce header meaning "device already authenticated by Noise"; the bridge strips that header from any external request. |
|
|
81
|
+
| Desktop UI | `lib/client.js` injects the settings section that shows the QR. | Add the new QR payload and a paired-devices list. |
|
|
82
|
+
|
|
83
|
+
### 1.5 Security and threat model
|
|
84
|
+
|
|
85
|
+
| Threat | Outcome with this design |
|
|
86
|
+
|---|---|
|
|
87
|
+
| Relay operator or attacker controls the relay | Sees only metadata (room id, IPs, sizes, timing). Cannot read, alter or inject traffic, and cannot impersonate the phone (needs its private key) or the PC. Can deny service. |
|
|
88
|
+
| Network attacker between phone and relay | TLS (WSS) outside, Noise inside. |
|
|
89
|
+
| Stolen phone | Revoke the device on the PC. Device key lives in Keychain / Keystore (optionally biometric-gated). |
|
|
90
|
+
| QR photographed | OTP is single-use and short-lived; useless afterwards. |
|
|
91
|
+
| Malicious device on the LAN | Unchanged from today: loopback-only webserver, LAN bridge needs a token ≥ 16 chars; to be superseded by LAN Noise (phase 3). |
|
|
92
|
+
| Replay / downgrade | Noise nonces, per-stream counters, version in the handshake prologue, no plaintext fallback. |
|
|
93
|
+
| Relay abuse | Per-IP join rate limits, per-room caps, byte quotas, bound on unauthenticated bytes before handshake completes. |
|
|
94
|
+
| Malware already on the PC | Out of scope (it could already run the agent). |
|
|
95
|
+
|
|
96
|
+
### 1.6 Operations and compliance
|
|
97
|
+
|
|
98
|
+
* Relay: stateless Node (or Go) service, in-memory room table, sticky routing by `roomId` for horizontal scaling; or Cloudflare Durable Objects. Docker image so enterprises can self-host. Expect thousands of idle WebSockets per small node, **to be load-tested**; this is an estimate, not a measurement.
|
|
99
|
+
* Encryption export rules: using Noise/ChaCha20 from third-party libraries is *custom encryption* for App Store Connect export-compliance purposes, so the "uses non-exempt encryption" answer and annual self-classification paperwork likely apply. Decide this early with legal advice. The app now declares `ITSAppUsesNonExemptEncryption = true` because the relay client ships its own Noise / X25519 / ChaCha20-Poly1305 (see `docs/STORE-LAUNCH.md` section 3c); the paperwork itself is the publisher's to file.
|
|
100
|
+
* Privacy labels change: the relay processes IP addresses and room identifiers, even though it cannot read content.
|
|
101
|
+
* Mainland-China hosting needs ICP filing; cross-border handling of data is a separate legal question.
|
|
102
|
+
|
|
103
|
+
### 1.7 Phases (rough planning estimates for one senior engineer, not commitments)
|
|
104
|
+
|
|
105
|
+
| Phase | Scope | Estimate |
|
|
106
|
+
|---|---|---|
|
|
107
|
+
| 0 | Docs: say "same Wi-Fi needs nothing; away from home is optional, here are the choices"; in-app hint; correct the "from anywhere" subtitle until phase 1 ships | 1–2 days |
|
|
108
|
+
| 1 | Noise implementation + test vectors; relay MVP; plugin connector; `TransportClient`; pairing QR + paired-devices UI; path selection; tests with real sockets | 4–6 weeks |
|
|
109
|
+
| 2 | Push: APNs (+ notification-service extension that fetches and shows real text locally), FCM; keep user webhooks; device management polish | 3–4 weeks |
|
|
110
|
+
| 3 | Noise over LAN (drop cleartext HTTP and shared token); optional WebRTC direct upgrade; relay observability | 2–3 weeks |
|
|
111
|
+
|
|
112
|
+
### 1.8 Implementation status
|
|
113
|
+
|
|
114
|
+
| Piece | State | Evidence | Not verified |
|
|
115
|
+
|---|---|---|---|
|
|
116
|
+
| Relay hub (platform-neutral routing, host auth by Ed25519, pre-verification budget, limits) | Done | `relay-hub` 18 tests, mutation-checked | No load test |
|
|
117
|
+
| Node/`ws` adapter and Cloudflare Worker + Durable Object adapter | Done | `relay-node-server` 8 (real sockets), `relay-cloudflare` 6 (fake runtime) | **Never run on real Cloudflare** |
|
|
118
|
+
| Noise_IK / mux / pairing link (Node reference) | Done | `relay-noise` 15, `relay-mux` 17, deterministic vectors | **Official Noise test vectors** (none available offline) |
|
|
119
|
+
| Plugin connector, device store, one-time pairing codes, revocation, `/m/api/relay/*` | Done, disabled by default | `relay-state` 14, `relay-e2e` 18 through the real plugin and HTTP server | Real network conditions |
|
|
120
|
+
| Desktop settings panel (status, pairing QR, devices, revoke) | Done | `client-relay-panel` 16 (tiny renderer, 8 mutations on the panel plus 3 on the launch gate) | **Not looked at inside a real DSH Desktop** |
|
|
121
|
+
| Phone crypto in pure Dart (X25519, ChaCha20-Poly1305, HKDF) | Done, **hand-written** | 90+ vectors from OpenSSL, RFC vectors, BigInt differential, 18 mutations | **Not audited; Dart gives no constant-time guarantee.** Replace with an audited package before launch (one file: `lib/relay/crypto.dart`) |
|
|
122
|
+
| Phone Noise / mux / relay client / `TransportClient` exit | Done | Dart unit 76, **Dart-to-Node end-to-end against a real relay and the real plugin** 19 | Real devices |
|
|
123
|
+
| App pairing flow (scan or paste link), Keychain/Keystore storage, settings (status, unpair), fresh-install purge | Done | `relay_store` 8, `relay_messages` 6, `api_relay` 15, `relay_pairing_ui` 19 (includes the launch gate: switch off hides the entry points, switch on restores them), mutation-checked | iOS/Android hardware, camera scan of the real QR |
|
|
124
|
+
| Path selection | **Partial.** A relay-paired phone uses the relay everywhere, including at home. If the phone also has a LAN token, LAN and relay are both rotation candidates. | `api_relay` rotation tests | **No automatic "prefer LAN when reachable".** A direct Noise-over-LAN path (phase 3) is the clean fix |
|
|
125
|
+
| Push notifications over the relay (APNs/FCM) | **Not built** | n/a | iOS cannot deliver while suspended without it |
|
|
126
|
+
| Login / accounts | **Not built, and not needed** (section 2.4) | n/a | n/a |
|
|
127
|
+
|
|
128
|
+
Two defects found only because the second implementation existed: a cancelled-before-response request hung forever in the Node
|
|
129
|
+
mux, and the paste dialog disposed its controller while the route was still animating. Both fixed with tests.
|
|
130
|
+
|
|
131
|
+
### 1.9 Is Cloudflare a suitable relay host?
|
|
132
|
+
|
|
133
|
+
**Yes, with four caveats.** The relay only forwards opaque frames, keeps no database and holds no secrets, which is the shape
|
|
134
|
+
Workers + Durable Objects handles well: global TLS termination, no server to patch, built-in DDoS absorption, and one Durable
|
|
135
|
+
Object per room gives the "all sockets of a room land in one place" property the hub needs.
|
|
136
|
+
|
|
137
|
+
1. **Untested on the real platform.** The adapter is contract-tested against a fake runtime. The first deploy must be followed
|
|
138
|
+
by `node relay/smoke.mjs wss://<host>`; the most likely first failure is the WebCrypto name for Ed25519 on Workers.
|
|
139
|
+
2. **Cost shape.** The adapter uses the standard `accept()`, so a Durable Object stays resident and is billed for duration while
|
|
140
|
+
any socket is open. Hibernation would cut that but means moving hub state into socket attachments. Check current pricing and
|
|
141
|
+
plan limits in Cloudflare's own documentation **(verify)**; they were not looked up in this session.
|
|
142
|
+
3. **Mainland China.** Cloudflare is not reliably reachable or fast from the mainland. If most users are there, also run the
|
|
143
|
+
Node relay on a Hong Kong or ICP-filed host; the pairing link already carries up to four relay URLs and the client fails over.
|
|
144
|
+
4. **Privacy label.** Cloudflare's own request logs may retain IPs. If they do, the App Privacy answer is no longer
|
|
145
|
+
"Data Not Collected" (see `docs/STORE-LAUNCH.md` section 3c).
|
|
146
|
+
|
|
147
|
+
Neither choice is lock-in: the hub is shared, and the Node adapter is a drop-in for a small VPS.
|
|
148
|
+
|
|
149
|
+
## 2. Part B — Store-launch readiness (development side only)
|
|
150
|
+
|
|
151
|
+
### 2.1 Verdict
|
|
152
|
+
|
|
153
|
+
The client itself is in good technical shape: the Android release APK and AAB build, 612 automated tests pass, `flutter analyze` and `dart format` are clean, and Android meets the 16 KB page-size rule. **It is not ready to submit.** The gaps are: account type (D1), no review path for Apple/Google reviewers, no release signing, a branding risk, and two claims in the listing that are not true yet ("from anywhere", "receive notifications" on iOS). Most of the remaining list is quick.
|
|
154
|
+
|
|
155
|
+
### 2.2 Evidence table
|
|
156
|
+
|
|
157
|
+
Legend: OK = verified; GAP = needs work; YOU = only you can do it.
|
|
158
|
+
|
|
159
|
+
| Area | Finding | Status |
|
|
160
|
+
|---|---|---|
|
|
161
|
+
| Apple account | Enterprise Program cannot publish to the App Store (see D1). | **YOU — blocker** |
|
|
162
|
+
| Review access | No demo mode exists in the app (searched `lib/`). A reviewer cannot run a DSH host, so Apple 2.1 (app completeness) and Play "app access" will fail without a built-in demo mode or hosted demo host + review notes. | **GAP — blocker** (≈ 3–5 days) |
|
|
163
|
+
| Release signing | No `key.properties`; builds are debug-signed (`CN=Android Debug`). `release.yml` / `android-build.yml` do not exist in the repo (the launch notes say so). | **YOU / GAP** |
|
|
164
|
+
| Branding / IP | ~~Whale mark resembles DeepSeek's logo; README says "官方 logo"~~ — **resolved 2026-11-01**: the DeepSeek logo and the icons derived from it were removed; the default icon, logo and home character are now the project's own pictures and the other icons and the pet are code-drawn (`docs/BRAND-ASSETS.md`). Still open for the publisher: the listing names DeepSeek (nominative use + non-affiliation statement), and git history still contains the old files. | **Mostly closed — publisher to confirm name usage (D3)** |
|
|
165
|
+
| Listing accuracy | Subtitle "DeepSeek Harness from anywhere" but the app only works on a shared/virtual network today. Description says "receive notifications"; iOS has no background mode or push entitlement, so notifications arrive only while the app is open or through user webhooks. | **GAP** (Apple 2.3) |
|
|
166
|
+
| Android target / format | `targetSdk 36`, `minSdk 24`, AAB builds (96 MB universal; Play serves per-ABI splits), R8 mapping produced, `allowBackup=false`. | OK |
|
|
167
|
+
| 16 KB pages | All 64-bit native libraries have LOAD alignment ≥ 0x4000 (checked with `llvm-readelf` on arm64-v8a and x86_64). One 32-bit ML Kit library is 4 KB-aligned; 16 KB devices run 64-bit only, so it does not matter. | OK |
|
|
168
|
+
| Android permissions | `INTERNET`, `CAMERA`, `POST_NOTIFICATIONS`, `SYSTEM_ALERT_WINDOW`, `FOREGROUND_SERVICE(+_SPECIAL_USE)`, plus harmless `ACCESS_NETWORK_STATE`, `VIBRATE`. Matches the launch notes except those two. | OK |
|
|
169
|
+
| Foreground services | Two services, both `specialUse`. Play requires every foreground-service type to be declared in Play Console with a video demonstrating the feature, and all types are reviewed ([Google](https://support.google.com/googleplay/android-developer/answer/16965181)). Whether `specialUse` needs the video is **(verify)**. Both features are opt-in (keep-alive defaults off; overlay needs the user to grant "display over other apps"). | **GAP** — prepare declarations, or ship the Play build without them |
|
|
170
|
+
| Cleartext traffic | Android `usesCleartextTraffic=true`; iOS `NSAllowsLocalNetworking`. Fine for LAN, but off-LAN must be TLS/E2EE, and the Data-safety "encrypted in transit" answer depends on it. | **GAP** (solved by phase 1/3) |
|
|
171
|
+
| iOS privacy manifest | App target has none. The app's Swift code uses no Apple required-reason API (`fileSizeKey` is not on the list); seven plugins and `Flutter.framework` ship their own manifests. | Low risk; add a minimal one anyway |
|
|
172
|
+
| iOS Info.plist | Camera, photo, local-network strings present but **Chinese only**; `NSUserNotificationUsageDescription` has no effect on iOS as far as I know, since notification permission needs no Info.plist string (harmless); `ITSAppUsesNonExemptEncryption` missing. | **GAP** (small) |
|
|
173
|
+
| iOS devices | `TARGETED_DEVICE_FAMILY = "1,2"`: iPad is supported, so iPad screenshots and layouts are required; restrict to iPhone if you do not want to test iPad. | **GAP** (decision) |
|
|
174
|
+
| iOS real-device behaviour | CHANGELOG states real-device behaviour is unverified; unsigned builds cannot use the Keychain (error −34018); only simulator runs have been done. | **GAP** — TestFlight smoke test |
|
|
175
|
+
| Background on iOS | No `UIBackgroundModes`, no `aps-environment` entitlement, no APNs code. | **GAP** (phase 2) |
|
|
176
|
+
| Google Play new-account testing | Google requires a closed test with at least 12 testers opted in for 14 days before production access; reports say organization accounts are exempt, but that exemption is in third-party sources only **(verify)** ([Google](https://support.google.com/googleplay/android-developer/answer/14151465)). | YOU |
|
|
177
|
+
| Store URLs and policies | Privacy-policy and support URLs, support e-mail, App Privacy / Data-safety forms, content rating. Draft text exists (`PRIVACY-POLICY.md`, `SUPPORT.md`, `STORE-LAUNCH.md`). | YOU |
|
|
178
|
+
| Robustness found during testing | One mistyped field makes the whole session list fail to parse (`'String' is not a subtype of 'num?'`), so version skew between the store app and the separately installed plugin could blank the list. The first-run "old shortcut" dialog also appears on brand-new Android installs. | **GAP** (small) |
|
|
179
|
+
|
|
180
|
+
### 2.3 Suggested order of work
|
|
181
|
+
|
|
182
|
+
1. **You:** settle D1 and D3; create the Apple Developer Program (Organization) enrolment if needed; Android upload keystore with Play App Signing; public privacy / support URLs.
|
|
183
|
+
2. **Quick code fixes (≈ 3–4 days):** English `InfoPlist` strings, `ITSAppUsesNonExemptEncryption`, minimal `PrivacyInfo.xcprivacy`, tolerant session parsing, hide the upgrade-only dialog on fresh installs, decide iPad scope, correct the listing claims.
|
|
184
|
+
3. **Review path (≈ 3–5 days):** an in-app demo mode with canned sessions and a scripted conversation, plus a short review-notes template.
|
|
185
|
+
4. **Branding** resolved (permission or replacement assets).
|
|
186
|
+
5. **Relay phase 1**, then push (phase 2), then TestFlight / Play internal-track smoke tests on real devices.
|
|
187
|
+
|
|
188
|
+
A realistic path to a *submittable* build without the relay is roughly 2–3 weeks once the account and branding questions are answered; with relay phase 1 it is roughly 6–8 weeks. These are planning estimates.
|
|
189
|
+
|
|
190
|
+
### 2.4 Does either store require a user login?
|
|
191
|
+
|
|
192
|
+
**No.** Neither Apple nor Google requires an app to have accounts. The relevant rules only apply if you add them:
|
|
193
|
+
|
|
194
|
+
* Apple App Review 5.1.1(v): an app that lets users create an account must also let them delete it inside the app.
|
|
195
|
+
Guideline 4.8 (Sign in with Apple as an equal option) applies only if you offer a third-party social login.
|
|
196
|
+
* Google Play's account-deletion and "App access" requirements likewise apply to apps with accounts or gated content.
|
|
197
|
+
* What reviewers do need is a way to see the app working (Apple 2.1, Play "App access"). The built-in demo mode covers that
|
|
198
|
+
without credentials.
|
|
199
|
+
|
|
200
|
+
DSH Mobile has no developer-side account: the "login" is the pairing between one phone and one computer (a per-computer key in the
|
|
201
|
+
Keychain/Keystore, revocable from the computer). Adding accounts would create a server, stored personal data, deletion flows
|
|
202
|
+
and a larger privacy label, with no feature that needs it. Revisit only if you add something that does (paid plans, a
|
|
203
|
+
publisher-run relay that needs per-customer quotas).
|
|
204
|
+
|
|
205
|
+
### 2.5 What happened to the original blockers (code side)
|
|
206
|
+
|
|
207
|
+
Done: demo mode, iOS en/zh-Hans permission strings and privacy manifest, iPhone-only, export-compliance declaration (now `true`),
|
|
208
|
+
Play foreground-service and overlay text, Data-safety draft, upload-key script with a verified signing chain, privacy policy
|
|
209
|
+
sections for demo mode and the relay. **Still open and not code:** DeepSeek branding permission (D3), the export-compliance filings,
|
|
210
|
+
store-console forms, real-device and TestFlight testing, iPad support (not attempted), push (D4).
|
|
211
|
+
|
|
212
|
+
## 3. Sources
|
|
213
|
+
|
|
214
|
+
* Apple, Developer Enterprise Program: <https://developer.apple.com/programs/enterprise/>
|
|
215
|
+
* Google Play, testing requirement for new personal accounts: <https://support.google.com/googleplay/android-developer/answer/14151465>
|
|
216
|
+
* Google Play, foreground-service declaration: <https://support.google.com/googleplay/android-developer/answer/16965181>
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# 11 — 远程访问(加密中继)使用指南
|
|
2
|
+
|
|
3
|
+
> **状态:已实现并测试,但没有在真机上验证过,也没有部署过任何中继服务。** 默认关闭。想要稳定可用,需要你先部署一个中继
|
|
4
|
+
> (见下),并用自己的手机和电脑完整走一遍。设计、威胁模型与"哪些已验证、哪些没有"见
|
|
5
|
+
> [`10-remote-access-and-launch-plan.md`](10-remote-access-and-launch-plan.md) §1.8。
|
|
6
|
+
>
|
|
7
|
+
> **首发版本不开放这个入口(2026-11-01 决定:首发只做同一 Wi-Fi)。** 代码、协议和测试都在,只是默认看不到:
|
|
8
|
+
> - **电脑端**:没启用中继时,桌面设置页不会出现「远程访问」面板。在 `cordis.patch.yml` 里设置 `relay.enabled` 与
|
|
9
|
+
> `relay.urls` 并重启 DSH 后,面板才会出现,管理方式不变。
|
|
10
|
+
> - **手机端**:连接页没有「粘贴配对链接」,扫码页也不会处理配对二维码。要在自己的手机上试,用
|
|
11
|
+
> `flutter build apk --dart-define=DSH_REMOTE_ACCESS=true`(或 `flutter run --dart-define=...`)构建一个打开的版本。
|
|
12
|
+
> - 以下全文描述的是打开之后的行为。
|
|
13
|
+
|
|
14
|
+
## 它解决什么
|
|
15
|
+
|
|
16
|
+
手机和电脑**不在同一个 Wi-Fi** 时也能连:4G/5G、公司网络、出差都行。**两边都不用装 VPN 软件**,电脑**不开放任何端口**——
|
|
17
|
+
手机和电脑都是主动向外连到同一个中继服务器,中继只负责转发。
|
|
18
|
+
|
|
19
|
+
内容(消息、会话、文件、审批)是**手机和电脑之间端到端加密**的,中继看不到。中继能看到的是元数据:来源 IP、房间标识
|
|
20
|
+
(电脑公钥的哈希)、数据量和时间。
|
|
21
|
+
|
|
22
|
+
同一个局域网里,原来的"扫码 + 口令"直连方式照常可用,两种方式可以并存。
|
|
23
|
+
|
|
24
|
+
## 四步用起来
|
|
25
|
+
|
|
26
|
+
**1. 部署一个中继**(一次性;二选一)
|
|
27
|
+
|
|
28
|
+
- **自己的服务器 / 小 VPS**:`relay/` 目录,`cd relay && npm install && node run.js`,放在 TLS 终结(Caddy / nginx)之后,对外是
|
|
29
|
+
`wss://relay.你的域名`。详见 `relay/README.md`。
|
|
30
|
+
- **Cloudflare**:`relay/cloudflare/`,`wrangler deploy`,详见 `relay/cloudflare/README.md`(含部署后必须跑的自检
|
|
31
|
+
`node relay/smoke.mjs wss://你的域名`)。
|
|
32
|
+
|
|
33
|
+
> 中继地址必须是 `wss://`(加密)。App 与插件都会拒绝 `ws://`(仅本机测试用的回环地址除外)。
|
|
34
|
+
|
|
35
|
+
**2. 在电脑上启用**——`cordis.patch.yml` 里 mobile-remote 的 `config:` 加入:
|
|
36
|
+
|
|
37
|
+
```yaml
|
|
38
|
+
relay:
|
|
39
|
+
enabled: true
|
|
40
|
+
urls:
|
|
41
|
+
- wss://relay.你的域名 # 可以配多个做备份,最多 4 个
|
|
42
|
+
name: 办公室电脑 # 可选:配对时显示给手机的名字
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
重启 DSH。桌面设置页的"远程访问"面板会显示中继是否"已连接"。
|
|
46
|
+
|
|
47
|
+
**3. 配对手机**——桌面设置页 → "远程访问" → **生成配对二维码**;手机 App → 连接页 → **扫码连接**(对准这个二维码),
|
|
48
|
+
或在电脑上点**复制配对链接**,手机上点**粘贴配对链接**。
|
|
49
|
+
|
|
50
|
+
- 配对码**只能用一次、5 分钟内有效**;二维码里没有任何长期口令。
|
|
51
|
+
- 配对成功后二维码自动收起,手机直接进入主界面,**不需要输入口令**。
|
|
52
|
+
|
|
53
|
+
**4. 日常使用**——什么都不用做。App 会按需连接;断线自动重连。
|
|
54
|
+
|
|
55
|
+
## 管理
|
|
56
|
+
|
|
57
|
+
| 想做的事 | 怎么做 |
|
|
58
|
+
|---|---|
|
|
59
|
+
| 手机丢了 | 电脑端设置页 → 远程访问 → 已配对的手机 → **撤销**。立即踢掉,其它手机不受影响 |
|
|
60
|
+
| 不再用这台电脑 | 手机 → 设置 → **解除与这台电脑的配对**(删除本机密钥);最好也在电脑端撤销一次 |
|
|
61
|
+
| 换手机 | 新手机重新配对;旧手机撤销 |
|
|
62
|
+
| 查看谁连着 | 电脑端设置页的设备列表(名称、最近连接时间) |
|
|
63
|
+
|
|
64
|
+
## 出问题时
|
|
65
|
+
|
|
66
|
+
| 手机上的提示 | 通常是 |
|
|
67
|
+
|---|---|
|
|
68
|
+
| 找不到电脑 | 电脑没开机、DSH 没运行、没启用 `relay.enabled`,或电脑到中继的连接断了(看电脑端面板状态) |
|
|
69
|
+
| 配对码无效、已过期或已被使用 | 配对码 5 分钟过期或已被用过;重新生成 |
|
|
70
|
+
| 电脑不认这台手机 | 这台手机已被撤销;重新配对 |
|
|
71
|
+
| 连不上中继服务器 | 手机网络问题,或中继宕机;配了多个中继时会自动换下一个 |
|
|
72
|
+
| 安全握手失败 | 二维码被改动过,或电脑端插件版本过旧;升级插件 |
|
|
73
|
+
|
|
74
|
+
## 当前限制(诚实版)
|
|
75
|
+
|
|
76
|
+
- **没有"同一 Wi-Fi 时自动走局域网"**:只用中继配对的手机在家里也经中继走。想要局域网直连,仍可同时扫一次"连接移动端设备"的二维码
|
|
77
|
+
(需要口令),两者互为备份。局域网直连加密是后续阶段(见 `docs/10` §1.7 phase 3)。
|
|
78
|
+
- **没有 APNs / FCM 系统推送**:App 在前台或后台保持连接时才能收到提醒;iOS 被系统挂起后收不到。原有的 Server酱 / Bark / ntfy 等
|
|
79
|
+
推送通道仍然可用。
|
|
80
|
+
- 手机端的 X25519 / ChaCha20-Poly1305 是**自己实现的**(环境限制,没有审计过的包可用),上架前建议换成审计过的实现;
|
|
81
|
+
Noise 实现没有对照官方测试向量。
|
|
82
|
+
- Cloudflare 适配器从未在真实 Cloudflare 上运行;没有做负载测试;没有真机和 TestFlight 验证。
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# DSH Mobile: Description of Encryption Functionality
|
|
2
|
+
|
|
3
|
+
Technical description supplied with the App Store Connect "App Encryption Documentation" for DSH Mobile.
|
|
4
|
+
|
|
5
|
+
| | |
|
|
6
|
+
| --- | --- |
|
|
7
|
+
| App | DSH Mobile - DeepSeek Harness (iOS) |
|
|
8
|
+
| Bundle ID | com.mrdayone.dshmobile |
|
|
9
|
+
| Version / build | 3.2.4 (32) |
|
|
10
|
+
| Publisher | Digital Bang Intelligence LLC., 30 N Gould St Ste R, Sheridan, WY 82801, USA |
|
|
11
|
+
| Contact | support@claud.ing |
|
|
12
|
+
| Date | 2026-11-02 |
|
|
13
|
+
|
|
14
|
+
## 1. What the app does
|
|
15
|
+
|
|
16
|
+
DSH Mobile is a mobile companion for DeepSeek Harness, desktop software that users run on their own computer. The app connects to that computer, shows the user's agent chat sessions, lets the user send messages and images, follow task progress, and approve or deny the tool actions the desktop software asks for.
|
|
17
|
+
|
|
18
|
+
It is not a messaging service, a VPN, a file-encryption tool or a security product. It has no user accounts and no in-app purchases, and the publisher does not receive or store user content.
|
|
19
|
+
|
|
20
|
+
## 2. Where encryption is used
|
|
21
|
+
|
|
22
|
+
| # | Function | What is used | Implemented by | Status in 3.2.4 |
|
|
23
|
+
| --- | --- | --- | --- | --- |
|
|
24
|
+
| 1 | TLS for connections the app opens (HTTPS, WSS) | Standard TLS with the platform default certificate validation; the app code does not override certificate checks | BoringSSL, statically linked into the Flutter engine and reached through Dart's `dart:io` | Used when the user enters an `https://` address, for example a TLS reverse proxy the user runs. In the default local-network setup the app speaks plain HTTP to the user's own computer and does not encrypt that traffic itself |
|
|
25
|
+
| 2 | End-to-end encrypted channel between the phone and the user's computer through an optional relay | Noise_IK_25519_ChaChaPoly_SHA256: X25519 key agreement (RFC 7748), ChaCha20-Poly1305 AEAD (RFC 8439), SHA-256, HMAC-SHA-256 and the HKDF construction of the Noise specification (section 4.3) | Written in Dart by the publisher from the public specifications (`lib/relay/crypto.dart`, `lib/relay/noise.dart`); SHA-256 and HMAC come from the open-source Dart `crypto` package. Checked against published RFC test vectors and against vectors generated with OpenSSL | The code is included in the app, but its user-facing entry point is switched off by default in this version (build flag `DSH_REMOTE_ACCESS`) and is planned for a later release |
|
|
26
|
+
| 3 | Storage of the access token and, for relay pairing, the phone's device key pairs | Apple Keychain | Apple Security framework through the `flutter_secure_storage` plugin; the app does not implement its own storage encryption | Used |
|
|
27
|
+
| 4 | Random numbers for keys and nonces | The platform's cryptographically secure random source | Dart `Random.secure()` | Used by item 2 |
|
|
28
|
+
|
|
29
|
+
## 3. Parameters
|
|
30
|
+
|
|
31
|
+
- X25519: 256-bit keys. Static and ephemeral key pairs, mutual authentication and forward secrecy come from the Noise IK handshake (`-> e, es, s, ss` and `<- e, ee, se`).
|
|
32
|
+
- ChaCha20-Poly1305: 256-bit key, 96-bit nonce built from a 64-bit message counter, 128-bit authentication tag. A counter that reaches its limit is refused, so a nonce is never reused.
|
|
33
|
+
- SHA-256: 256-bit digest. HMAC-SHA-256 for key derivation.
|
|
34
|
+
- Key lengths and algorithms are fixed in the code. There are no settings to change them.
|
|
35
|
+
- A relay, if one is used, only forwards ciphertext. It can see connection metadata (source IP address, room identifier, data volume and timing), but not the content.
|
|
36
|
+
|
|
37
|
+
## 4. What the app does not do
|
|
38
|
+
|
|
39
|
+
- It has no feature that lets a user encrypt or decrypt data of their choice, choose an algorithm, or change a key length, and it does not expose its cryptographic functions to other apps.
|
|
40
|
+
- It does not use proprietary or unpublished algorithms. Every algorithm in section 2 is a published standard (IETF RFC or NIST FIPS). The Noise handshake follows the publicly published Noise Protocol Framework specification (noiseprotocol.org), which is not an IETF, ISO or ITU document.
|
|
41
|
+
- It does not encrypt data at rest itself. Stored secrets go to the Apple Keychain.
|
|
42
|
+
- It does not provide a VPN, tunnel, firewall, intrusion-detection or digital-rights-management function. Encryption only protects the connection between the phone and the user's own computer.
|
|
43
|
+
|
|
44
|
+
## 5. Data protected
|
|
45
|
+
|
|
46
|
+
Messages, images, files and approval decisions that the user exchanges with their own computer. None of it is sent to the publisher.
|
|
47
|
+
|
|
48
|
+
## 6. Scope of this document
|
|
49
|
+
|
|
50
|
+
This is a technical description of the app's encryption functionality only. It makes no export classification (ECCN), license-exception or other legal determination. Any classification, French encryption declaration or filing with a government authority is handled separately by the publisher.
|
|
Binary file
|