@dsh-mobile/mobile-remote 3.2.4 → 3.2.6

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.
Files changed (63) hide show
  1. package/CHANGELOG.md +267 -0
  2. package/CONTRIBUTING.md +3 -1
  3. package/FAQ.md +4 -0
  4. package/README.md +25 -18
  5. package/cordis.patch.yml +10 -2
  6. package/docs/00-/345/274/200/345/217/221/346/200/273/347/272/262.md +413 -102
  7. package/docs/01-PRD.md +4 -4
  8. package/docs/02-architecture.md +2 -2
  9. package/docs/03-api.md +49 -1
  10. package/docs/04-security.md +2 -1
  11. package/docs/05-test-cases.md +7 -7
  12. package/docs/06-install-run.md +16 -3
  13. package/docs/07-user-manual.md +23 -1
  14. package/docs/08-/346/211/251/345/261/225/345/274/200/345/217/221/346/214/207/345/215/227.md +2 -2
  15. package/docs/09-compatibility.md +3 -3
  16. package/docs/11-remote-relay-guide.md +85 -0
  17. package/docs/APP-ENCRYPTION-DESCRIPTION.md +50 -0
  18. package/docs/APP-ENCRYPTION-DESCRIPTION.pdf +0 -0
  19. package/docs/APP-REVIEW-NOTES.md +135 -0
  20. package/docs/BRAND-ASSETS.md +142 -0
  21. package/docs/PRIVACY-POLICY.en.md +165 -0
  22. package/docs/PRIVACY-POLICY.md +133 -33
  23. package/docs/STORE-LAUNCH.md +196 -21
  24. package/docs/STORE-LISTING.md +150 -0
  25. package/docs/SUPPORT.md +4 -3
  26. package/docs/TERMS-OF-SERVICE.en.md +102 -0
  27. package/docs/TERMS-OF-SERVICE.md +102 -0
  28. package/lib/account-usage-query.js +278 -0
  29. package/lib/api-helpers.js +333 -0
  30. package/lib/client.js +283 -1
  31. package/lib/config.js +213 -0
  32. package/lib/host-compat.js +133 -0
  33. package/lib/http-util.js +69 -0
  34. package/lib/index.js +249 -2023
  35. package/lib/push.js +73 -0
  36. package/lib/rate-limit.js +46 -0
  37. package/lib/relay/connector.js +300 -0
  38. package/lib/relay/crypto.js +117 -0
  39. package/lib/relay/devices.js +138 -0
  40. package/lib/relay/identity.js +60 -0
  41. package/lib/relay/mux.js +419 -0
  42. package/lib/relay/noise.js +178 -0
  43. package/lib/relay/pairing.js +64 -0
  44. package/lib/relay/phone.js +114 -0
  45. package/lib/relay/serve.js +105 -0
  46. package/lib/rpc-adapter.js +88 -0
  47. package/lib/session-list.js +77 -0
  48. package/lib/timeline.js +492 -0
  49. package/lib/turn-outline.js +289 -0
  50. package/package.json +7 -1
  51. package/docs/ARCHITECTURE-CURRENT.md +0 -229
  52. package/docs/BUILD-ENVIRONMENT.md +0 -169
  53. package/docs/FEATURE-PARITY.md +0 -195
  54. package/docs/REA-UNDERSTANDING.md +0 -246
  55. package/docs/screenshots/01-home.png +0 -0
  56. package/docs/screenshots/02-notifications.png +0 -0
  57. package/docs/screenshots/03-sessions.png +0 -0
  58. package/docs/screenshots/04-chat.png +0 -0
  59. package/docs/screenshots/05-settings.png +0 -0
  60. package/docs/screenshots/06-new-session.png +0 -0
  61. package/docs/screenshots/pgy-appstore.jpg +0 -0
  62. package/docs/screenshots/pgy-mobile-app.jpg +0 -0
  63. package/docs/screenshots/pgy-pc-client.jpg +0 -0
package/docs/03-api.md CHANGED
@@ -6,7 +6,7 @@
6
6
  ## 1. 通用约定
7
7
 
8
8
  - **内容类型**:JSON API 一律 `application/json; charset=utf-8`;错误统一 `{ "error": string, "detail"?: string }`。
9
- - **鉴权**:`authToken` 配置为空 → 无鉴权;非空 → 除 `GET /m/api/qr-config`(仅 loopback)外,所有端点要求凭证。
9
+ - **鉴权**:`authToken` 配置为空 → 无鉴权;非空 → 除 `GET /m/api/qr-config` 与 `/m/api/relay/*`(均仅 loopback 桌面 GUI)外,所有端点要求凭证;经中继到达的设备已在加密握手里认证,不再要口令。
10
10
  - **凭证形式**(二选一,任一通过即可):
11
11
  - 请求头:`X-Mobile-Token: <token>`(App 使用)
12
12
  - Cookie:`dsh_mobile_token=<token>`(兼容保留,无登录入口)
@@ -51,6 +51,7 @@
51
51
  | GET/POST | `/m/api/llm-providers` | 模型提供商列表 / 保存配置(v2.6) | 是 |
52
52
  | POST | `/m/api/llm-providers/probe` | 探测端点模型列表(v2.6) | 是 |
53
53
  | GET | `/m/qr.png` | 二维码 PNG(与 qr-config 同一仅本机闸门,见 §6.10) | 否(仅本机) |
54
+ | GET/POST | `/m/api/relay/status` · `/pairing` · `/revoke` | 中继状态 / 生成一次性配对二维码 / 撤销手机(仅本机桌面 GUI,见 §6.23) | 否(仅本机) |
54
55
  | GET | `/m/api/jobs` | 会话后台任务列表(v2.7,内核 jobs 同源) | 是 |
55
56
  | POST | `/m/api/jobs/kill` | 取消任务(v2.7,映射 `jobs.kill`) | 是 |
56
57
  | GET | `/m/api/subagents` | 子代理列表(v2.7,按父会话 `subagent.list`) | 是 |
@@ -832,3 +833,50 @@
832
833
  ### 6.22 POST /m/api/dev/approval-test(合成审批,仅供本机验证脚本)
833
834
 
834
835
  把一条伪造的「`write` 需要审批」推进 live agent 的审批瀑布,用来验证「手机接卡 → 批准/拒绝 → `/respond` 结算」整条链路而不依赖模型行为。**除口令外还要求本机直连**(与 `/qr-config` 同一闸门,但不套用 `trustedHosts` 规则,见 §6.10);非本机 → `403`。请求体可带 `sessionId`;没有 live agent → `404 no-live-agent`,没有 `agents` 服务 → `503 agents-unavailable`。
836
+
837
+ ### 6.23 中继管理端点(v3.3,`/m/api/relay/*`,仅本机桌面 GUI)
838
+
839
+ 给桌面设置页「远程访问」面板用的三个端点。**免口令,闸门与 `/qr-config` 相同**(`localDesktopGate`:回环对端、回环 Host、无代理头、非跨站;见 §6.10);写操作额外拒绝浏览器跨站请求。经 LAN 桥或中继进来的请求一律 `403`——手机**不能**自己给自己配对或撤销别人。中继回放层还会在路径白名单里直接拒绝 `/api/relay/*`(设计见 `docs/10` §1.5 与 `lib/relay/serve.js`),所以这里是两道独立的门。
840
+
841
+ | 方法 | 路径 | 说明 |
842
+ |---|---|---|
843
+ | GET | `/m/api/relay/status` | 中继状态与已配对设备 |
844
+ | POST | `/m/api/relay/pairing` | 生成一次性配对二维码 |
845
+ | POST | `/m/api/relay/revoke` | 撤销一台已配对手机 |
846
+
847
+ **GET `/relay/status`** → `200`
848
+
849
+ ```json
850
+ {
851
+ "ok": true,
852
+ "enabled": true,
853
+ "roomId": "<32 位十六进制:Ed25519 公钥 SHA-256 的前 16 字节>",
854
+ "publicKey": "<电脑的 X25519 公钥,base64url>",
855
+ "relays": [{ "url": "wss://relay.example.com", "state": "online|connecting|offline|idle", "since": 1700000000000, "lastError": "", "phones": 0 }],
856
+ "devices": [{ "id": "<公钥指纹前 16 位十六进制>", "name": "Pixel 8", "createdAt": 1700000000000, "lastSeen": 1700000000000 }],
857
+ "pendingPairings": 0
858
+ }
859
+ ```
860
+
861
+ 未启用时只有 `{ "ok": true, "enabled": false }`。`devices` 里**没有**公钥全文,`id` 只是指纹。
862
+
863
+ **POST `/relay/pairing`**,请求体 `{}`(可选 `deviceName`,作为这台手机的默认名称,最长 40 字符)。
864
+
865
+ - `200 { "ok": true, "uri": "dsh://pair?v=1&room=…&pk=…&otp=…&r=wss%3A%2F%2F…&n=<电脑名>", "qr": "data:image/png;base64,…", "expiresAt": <毫秒时间戳> }`,`Cache-Control: no-store`。
866
+ - 配对码:16 字节随机数,**5 分钟内有效、只能用一次**,同时最多 5 个(再生成会挤掉最旧的),服务端只保存它的 SHA-256。二维码里没有任何长期口令;电脑的公钥本来就不是秘密。
867
+ - 未启用 → `409 relay-disabled`。
868
+
869
+ **POST `/relay/revoke`**,请求体 `{ "id": "<设备 id>" }` → `200 { "ok": true, "revoked": true|false }`。撤销会**立即踢掉**该手机所有在线会话(`revoked:false` 表示名单里本来就没有它,无害);缺少 `id` → `400 bad-request`;未启用 → `409 relay-disabled`。
870
+
871
+ **配置**(`cordis.patch.yml` 里 mobile-remote 的 `config:`):
872
+
873
+ ```yaml
874
+ relay:
875
+ enabled: false # 默认关闭
876
+ urls: [] # 必须是 wss://(仅本机测试允许回环地址的 ws://);可配多个做备份
877
+ name: "" # 配对时显示给手机的电脑名称;空 = 主机名
878
+ ```
879
+
880
+ `enabled: true` 但没有任何合法地址 → 记一条警告,中继不启用。身份与设备名单存在插件状态目录的 `relay/` 下(`identity.json`、`devices.json`,权限 0600;损坏的身份文件会改名留档再重新生成,不是原地覆盖)。
881
+
882
+ **经中继到达电脑的请求**(手机侧看到的就是普通的 `/m/api/*`)会被连接器改写后回放给本机 HTTP 服务:只放行 `${basePath}/api/…`;丢弃手机自带的口令 / cookie / 代理 / 浏览器来源头;写入只存在于本进程内存的随机令牌头(`x-dsh-relay-peer`、`x-dsh-mobile-client-ip`),使设备**免口令**通过 `authorized()`(身份已在 Noise 握手里确认),同时让桌面闸门因有效来源 IP 为 `relay:<设备 id>` 而判为非本机。LAN 桥会剥掉 `x-dsh-relay-peer`,口令阶段不会被局域网内的人伪造。
@@ -85,7 +85,8 @@
85
85
  - `trustedHosts`(v2.4.2+):隧道/中继类方案(frp/SakuraFrp 托管)下请求 Host 是中继地址,需在此显式放行(配合强口令);纯虚拟组网/局域网无需配置。**v3.2.4 起配置它会同时关闭 `/qr-config` 二维码端点**(见 §6),更推荐让隧道指向 LAN 桥端口——桥重写 Host,不需要 `trustedHosts`。
86
86
  ## 6. 数据安全
87
87
 
88
- - 插件**持久化仅限最小移动端状态**(`~/.dsh/mobile-remote/`:通知已读 id、会话最近活跃时间),不含会话内容;口令只存在于 profile 配置。
88
+ - 插件**持久化仅限最小移动端状态**,目录是 `$DSH_HOME/mobile-remote/`(未设置 `DSH_HOME` 时即 `~/.dsh/mobile-remote/`):`auth-token`(自动生成的口令)、`relay-identity.json`(中继身份)、`read-notifs.json`(通知已读)、`session-titles.json`、`activity.json`、`message-time.json`、`held-queue.json`(运行中排队的消息,含图片 base64)、`send-receipts.json`(15 分钟幂等回执)。文件权限 0600、目录 0700,均原子写;不含会话内容。
89
+ - **升级提示(本次改动)**:此前 held 队列 / 回执 / 已读 / 活动 / 标题这几类状态写死 `~/.dsh`,不跟随 `DSH_HOME`——两个隔离实例会共用同一份。现在统一跟随 `DSH_HOME`;**设置了 `DSH_HOME` 的用户升级后会看到一次空的已读 / 排队 / 回执 / 活动状态**(默认路径的用户不受影响)。
89
90
  - 会话内容沿用 dsh 现有策略存储;插件仅在请求处理期间持有内存副本。
90
91
  - **二维码数据端点 `/m/api/qr-config`(与 `/m/qr.png`、`/m/api/dev/approval-test`)只给电脑本机桌面 GUI**。它免口令且返回口令,所以不能只看 TCP 对端:本机反代/隧道客户端同样从 127.0.0.1 回连(T7,v3.2.3 及以前据此泄露口令)。现闸门要求:回环对端 + 回环 Host + 无代理来源头 + 非跨站,且**配置了 `trustedHosts`(中继形态)时默认整体关闭**(`qrConfigBehindRelay` 显式放行)。
91
92
  - **残余风险**:闸门的 Host/来源头检查对「裸 TCP 隧道(frp tcp 型、socat、`ssh -L/-R`)里的攻击者」可被自己伪造;中继形态下由 `trustedHosts` 规则兜底。因此**反代/隧道一律指向 LAN 桥端口,不要指向 webserver 端口**——桥永不转发这些端点(§3b)。
@@ -185,7 +185,7 @@
185
185
  | 预期 | ① 根视图(POSIX)显示「根目录」、根项 `/`;进入 `home` 后路径为 `/home`(**回归:旧版拼成 `/\home` 并报「读取失败」**);② 目录可逐级浏览、可新建文件夹;③ 新建会话 cwd 为所选真实路径;④ 「已注册工作区」显示服务端原始路径(非 `\home\user` 归一形态),点选直接可用 |
186
186
  | 变体 A | Windows 服务端回归:根视图盘符、`C:\` 逐级浏览、新建文件夹、cwd 与 v3.1.0 行为一致 |
187
187
  | 变体 B | 旧版 App(≤v3.0.0)+ 新版插件:浏览路径为 `/\home` 形态,服务端归一化后仍可正常进入/选择(`//home` 在 POSIX 与 `/home` 等价) |
188
- | 单测 | `flutter test test/dirpicker_logic_test.dart`(joinDirPath/dirSepOf);`node tools/wsl-path-check.mjs`(normalizeServerPath,8/8) |
188
+ | 单测 | `flutter test test/dirpicker_logic_test.dart`(joinDirPath/dirSepOf);`node --test test/pure-helpers.test.mjs`(normalizeServerPath 等纯函数;原 `tools/wsl-path-check.mjs` 已并入) |
189
189
 
190
190
  ### F-24 用量与额度投影:DeepSeek(#18 用量与额度)
191
191
 
@@ -246,7 +246,7 @@
246
246
  |---|---|
247
247
  | 前置 | 场景 A:旧插件(无 `/account-usage`,404);场景 B:全部来源未配置;场景 C:单次拉取失败 |
248
248
  | 步骤 | 展开面板,分别观察 A / B / C |
249
- | 预期 | A/B/C 下区块整体不出现、不显示任何报错,原有单行余额原位显示且点击仍=去充值(A 不退化现有功能);C 曾成功过 → 区块保留旧值并以小灰字标注相对时间(超过 10 分钟才标注);C 从未成功过 → 退回单行余额;不产生本地持久化额度文件 |
249
+ | 预期 | A/B/C 下区块整体不出现、不显示任何报错,原有单行余额原位显示且点击打开用量与额度页(A 不退化现有功能);C 曾成功过 → 区块保留旧值并以小灰字标注相对时间(超过 10 分钟才标注);C 从未成功过 → 退回单行余额;不产生本地持久化额度文件 |
250
250
 
251
251
  ### F-32 桌面宠物面板隐私边界(#18 用量与额度)
252
252
 
@@ -294,7 +294,7 @@
294
294
  |---|---|
295
295
  | 前置 | App 已授权悬浮窗,设置开启桌面宠物;准备一条可触发完成/失败/审批的任务 |
296
296
  | 步骤 | 观察空闲;发消息看思考/处理;触发审批看等待;完成/失败看 pulse;点头部/身体/尾巴、双击、拖拽、长按;静置 5 秒;改大小/减少动效/贴边开关 |
297
- | 预期 | 动作随状态切换(思考/搜索/命令/等待/完成/出错);完成/失败 pulse 后回到最新状态;互动有台词与 1.2 秒冷却;拖拽播放悬空、松手落地并吸附最近边缘;长按打开旧面板;贴边 5 秒后只露 45% 并降低透明度/模糊,点露出部分滑出;完成/等待/出错自动探头;旧面板保留运行中会话/通知/用量/余额/打开 App/去充值;减少动效固定姿势;三档大小即时生效;App 被杀后宠物仍工作 |
297
+ | 预期 | 动作随状态切换(思考/搜索/命令/等待/完成/出错);完成/失败 pulse 后回到最新状态;互动有台词与 1.2 秒冷却;拖拽播放悬空、松手落地并吸附最近边缘;长按打开旧面板;贴边 5 秒后只露 45% 并降低透明度/模糊,点露出部分滑出;完成/等待/出错自动探头;旧面板保留运行中会话/通知/用量/余额/打开 App;减少动效固定姿势;三档大小即时生效;App 被杀后宠物仍工作 |
298
298
  | 变体 | Android 8 以下无 animated WebP 解码 → 静态首帧,互动与状态文字仍工作 |
299
299
  | 单测 | `./gradlew :app:testDebugUnitTest --tests "com.dsh.remote.PetAnimationModelTest" --tests "com.dsh.remote.PetStateReducerTest"`(状态机、pulse、互动冷却、拖拽保护、空闲微动作、SSE 状态收敛) |
300
300
 
@@ -304,7 +304,7 @@
304
304
  |---|---|
305
305
  | 前置 | 已连接;进入 `设置 → 外观` |
306
306
  | 步骤 | 依次切「默认 / 深潜夜航 / 海盐汽水 / 鲸落星海」,每次回首页看主视觉;再在 `设置 → 显示 → 深色模式`(跟随系统 / 深色 / 浅色)各看一遍 |
307
- | 预期 | ① 默认皮肤:首页仍是原 DSH logo + 「今天打算设计什么?」欢迎语,与原版逐项一致;② 深潜夜航:墨绿黑底、右上声呐环、冷光气泡、底部潮汐波、角色在右侧、主按钮薄荷绿 + 深色字;③ 海盐汽水:奶油底、可乐蓝主按钮、淡气泡与光束;④ 鲸落星海:靛蓝底、右上月亮 + 星尘星座、金色主按钮(字为深色);⑤ 每套 × 明暗共 8 组合下文字/卡片/按钮都可读(无白底白字、无黑底黑字);⑥ 发送按钮在薄荷/金色底上为深色图标 |
307
+ | 预期 | ① 默认皮肤:首页是 DSH 品牌标 + 「要让 Harness 做点什么?」问候 + 在线状态胶囊(不出现吉祥物);② 深潜夜航:墨绿黑底、右上声呐环、冷光气泡、底部潮汐波、角色在右侧、主按钮薄荷绿 + 深色字;③ 海盐汽水:奶油底、可乐蓝主按钮、淡气泡与光束;④ 鲸落星海:靛蓝底、右上月亮 + 星尘星座、金色主按钮(字为深色);⑤ 每套 × 明暗共 8 组合下文字/卡片/按钮都可读(无白底白字、无黑底黑字);⑥ 发送按钮在薄荷/金色底上为深色图标 |
308
308
  | 变体 | 系统「移除动画」开启 → 首页背景与角色静止,皮肤配色仍生效 |
309
309
  | 单测 | `test/skin_home_test.dart`(三套皮肤首页渲染且不溢出 + 默认皮肤保持旧首页)、`test/skin_settings_test.dart`(外观卡在手机宽度不溢出、浅色模式下可切换皮肤) |
310
310
 
@@ -313,8 +313,8 @@
313
313
  | 项目 | 内容 |
314
314
  |---|---|
315
315
  | 前置 | Android 真机,已安装 build 27;进入 `设置 → 外观 → App 图标` |
316
- | 步骤 | 依次点选 深海头像 → 贝壳徽章 → 月夜潮线 → 奶油贴纸 → 鲸邮票 → 霓虹灯牌 → 鲸尾剪影 → DSH 原图标;每次回桌面看图标;最后杀进程重启 App |
317
- | 预期 | ① 每次切换后桌面图标随之变化(个别启动器需回桌面刷新一次,设置页已有小字提示);② 桌面上**始终只有一个** DSH Mobile 图标(`activity-alias` 同一时刻只启用一个);③ 重启后保持上次选择;④ 选「DSH 原图标」时与原 `ic_launcher` 外观一致(仅重编码差异);⑤ 非 Android 平台显示「当前平台不支持切换桌面图标」 |
316
+ | 步骤 | 依次点选 深海荧光 → 贝壳徽章 → 月夜潮线 → 奶油贴纸 → 邮票 → 霓虹灯牌 → 单色剪影 → DSH 默认;每次回桌面看图标;最后杀进程重启 App |
317
+ | 预期 | ① 每次切换后桌面图标随之变化(个别启动器需回桌面刷新一次,设置页已有小字提示);② 桌面上**始终只有一个** DSH Mobile 图标(`activity-alias` 同一时刻只启用一个);③ 重启后保持上次选择;④ 选「DSH 默认」时与 `ic_launcher` 外观一致(同一张图,由 `tools/brand/build.sh` 生成);⑤ 非 Android 平台显示「当前平台不支持切换桌面图标」 |
318
318
  | 已知限制 | Android 13 主题图标(monochrome 层)与 `roundIcon` 未提供,圆形图标机型会退化为方形 |
319
319
 
320
320
  ### F-39 外观:图标入口迁移提示与宠物前台联动(v3.2.2 build 27)
@@ -358,7 +358,7 @@
358
358
 
359
359
  ## 4. 回归执行建议
360
360
 
361
- - 每次修改插件源码后:`cd C:\Users\<用户>\.dsh\profiles\desktop && corepack pnpm install`(同步 file: 副本)→ 重启 DSH Desktop → 跑 `tools/e2e-check.mjs` 与 `node tools/account-usage-check.mjs` → 手机 App 冒烟(连接/发消息/通知/新建会话/图片发送/用量与额度)。
361
+ - 每次修改插件源码后:`cd C:\Users\<用户>\.dsh\profiles\desktop && corepack pnpm install`(同步 file: 副本)→ 重启 DSH Desktop → 跑 `tools/e2e-check.mjs` 与 `node --test test/account-usage.test.mjs`(原 `tools/account-usage-check.mjs` 已并入) → 手机 App 冒烟(连接/发消息/通知/新建会话/图片发送/用量与额度)。
362
362
  - 修改 App 后:`flutter analyze` → `flutter test`(新增 `test/usage_model_test.dart`;另含 `test/api_logic_test.dart`:多地址合并/轮换、回环与链路本地排除,5 用例;`test/md_link_test.dart`:链接 scheme 白名单;外观相关 `test/skin_home_test.dart` / `test/skin_settings_test.dart`)→ `flutter build apk --release` → 覆盖安装。
363
363
  - 修改原生桌面宠物后:`cd dsh-mobile-app/android && ./gradlew :app:testDebugUnitTest --tests "com.dsh.remote.PetAnimationModelTest" --tests "com.dsh.remote.PetStateReducerTest" --tests "com.dsh.remote.UsagePanelModelTest"`(动画状态机 / SSE 状态收敛 / 面板模型)→ 真机冒烟(F-29~F-32 面板区块;F-36 动作、互动、贴边与大小;F-37~F-39 皮肤、图标与前台联动)。
364
364
  - 修改原生侧(Kotlin/manifest/资源)后至少跑一次 `./gradlew :app:compileDebugKotlin`,确认 alias/资源引用无编译期断裂(图标与前台联动改动即属此类)。
@@ -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
- > 更换图标:把 1024×1024 PNG 覆盖到 `assets/icon-1024.png`,运行 `python tools/make_icon.py` 后重新构建。
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 监听行(桌面版)
@@ -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/index.js` 的 `pushToChannel` 加一个 `else if (target.format === "xxx")`
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
- - **图标**:覆盖 `assets/icon-1024.png` → `python tools/make_icon.py` → 重新构建
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`)
@@ -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+旧插件:区块整体降级为原有单行余额(点击仍=去充值),其余面板功能不受影响;旧 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` / `rechargeUrl` / `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 默认值,改配置即可 |
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
- | 已消除的写死 | 充值链接(原 App 硬编码 `platform.deepseek.com/top_up`) | v2.4.2 起走 `catalog.rechargeUrl`(插件配置为准) |
194
+ | 已移除的功能 | 充值入口(App 与插件) | v3.3 起 App 不再提供任何充值链接(Apple 3.1.1),插件也不再下发 `catalog.rechargeUrl`;旧配置里的 `rechargeUrl` 字段会被忽略,不影响启动;新 App 连旧插件时忽略该字段 |
195
195
 
196
196
  ## 7. 发布签名
197
197
 
@@ -0,0 +1,85 @@
1
+ # 11 — 远程访问(加密中继)使用指南
2
+
3
+ > **状态:已实现并测试,公开中继已部署(`wss://dsh.claud.ing`,2026-11-16 上线并通过六步冒烟);插件 3.2.6 起默认开启。**
4
+ > 设计、威胁模型与"哪些已验证、哪些没有"见 [`00-开发总纲.md`](00-开发总纲.md) §4。
5
+ >
6
+ > **默认行为:** 电脑端装好插件后自动出站连接 `wss://dsh.claud.ing`,桌面设置页直接出现「远程访问」;
7
+ > **局域网直连的地址与口令完全不变**,两种连接可以并存。不需要远程访问时设 `relay.enabled: false`。
8
+ >
9
+ > **手机端:** 商店版目前仍按首发决定隐藏配对入口;要在自己手机上试,用
10
+ > `flutter build apk --dart-define=DSH_REMOTE_ACCESS=true`(或 `flutter run --dart-define=...`)构建一个打开的版本。
11
+ > 以下全文描述的是打开之后的行为。
12
+
13
+ ## 它解决什么
14
+
15
+ 手机和电脑**不在同一个 Wi-Fi** 时也能连:4G/5G、公司网络、出差都行。**两边都不用装 VPN 软件**,电脑**不开放任何端口**——
16
+ 手机和电脑都是主动向外连到同一个中继服务器,中继只负责转发。
17
+
18
+ 内容(消息、会话、文件、审批)是**手机和电脑之间端到端加密**的,中继看不到。中继能看到的是元数据:来源 IP、房间标识
19
+ (电脑公钥的哈希)、数据量和时间。
20
+
21
+ 同一个局域网里,原来的"扫码 + 口令"直连方式照常可用,两种方式可以并存。
22
+
23
+ ## 四步用起来
24
+
25
+ **1. 部署一个中继**(一次性;二选一)
26
+
27
+ - **自己的服务器 / 小 VPS**:`relay/` 目录,`cd relay && npm install && node run.js`,放在 TLS 终结(Caddy / nginx)之后,对外是
28
+ `wss://relay.你的域名`。详见 `relay/README.md`。
29
+ - **Cloudflare**:`relay/cloudflare/`,`wrangler deploy`,详见 `relay/cloudflare/README.md`(含部署后必须跑的自检
30
+ `node relay/smoke.mjs wss://你的域名`)。
31
+
32
+ > 中继地址必须是 `wss://`(加密)。App 与插件都会拒绝 `ws://`(仅本机测试用的回环地址除外)。
33
+
34
+ **2. 在电脑上确认**——3.2.6 起随包补丁默认已开启并指向公共中继;要改地址、加备份或关闭,在 profile 的 `cordis.patch.yml` 里覆盖同名条目:
35
+
36
+ ```yaml
37
+ relay:
38
+ enabled: true
39
+ urls:
40
+ - wss://dsh.claud.ing # 本项目已部署;也可配多个做备份,最多 4 个
41
+ name: 办公室电脑 # 可选:配对时显示给手机的名字
42
+ ```
43
+
44
+ 本项目已部署的公开中继是 `wss://dsh.claud.ing`(Cloudflare Worker `dsh-cloud`,2026-11-16 上线,
45
+ `node relay/smoke.mjs wss://dsh.claud.ing` 冒烟通过)。电脑侧挂房间免费;手机侧在
46
+ `RELAY_REQUIRE_ENTITLEMENT=1` 时才需要订阅票据。
47
+
48
+ 装好或改完重启 DSH。桌面设置页的"远程访问"面板会显示中继是否"已连接"。
49
+
50
+ **3. 配对手机**——桌面设置页 → "远程访问" → **生成配对二维码**;手机 App → 连接页 → **扫码连接**(对准这个二维码),
51
+ 或在电脑上点**复制配对链接**,手机上点**粘贴配对链接**。
52
+
53
+ - 配对码**只能用一次、5 分钟内有效**;二维码里没有任何长期口令。
54
+ - 配对成功后二维码自动收起,手机直接进入主界面,**不需要输入口令**。
55
+
56
+ **4. 日常使用**——什么都不用做。App 会按需连接;断线自动重连。
57
+
58
+ ## 管理
59
+
60
+ | 想做的事 | 怎么做 |
61
+ |---|---|
62
+ | 手机丢了 | 电脑端设置页 → 远程访问 → 已配对的手机 → **撤销**。立即踢掉,其它手机不受影响 |
63
+ | 不再用这台电脑 | 手机 → 设置 → **解除与这台电脑的配对**(删除本机密钥);最好也在电脑端撤销一次 |
64
+ | 换手机 | 新手机重新配对;旧手机撤销 |
65
+ | 查看谁连着 | 电脑端设置页的设备列表(名称、最近连接时间) |
66
+
67
+ ## 出问题时
68
+
69
+ | 手机上的提示 | 通常是 |
70
+ |---|---|
71
+ | 找不到电脑 | 电脑没开机、DSH 没运行、被显式设置成 `relay.enabled: false`,或电脑到中继的连接断了(看电脑端面板状态) |
72
+ | 配对码无效、已过期或已被使用 | 配对码 5 分钟过期或已被用过;重新生成 |
73
+ | 电脑不认这台手机 | 这台手机已被撤销;重新配对 |
74
+ | 连不上中继服务器 | 手机网络问题,或中继宕机;配了多个中继时会自动换下一个 |
75
+ | 安全握手失败 | 二维码被改动过,或电脑端插件版本过旧;升级插件 |
76
+
77
+ ## 当前限制(诚实版)
78
+
79
+ - **没有"同一 Wi-Fi 时自动走局域网"**:只用中继配对的手机在家里也经中继走。想要局域网直连,仍可同时扫一次"连接移动端设备"的二维码
80
+ (需要口令),两者互为备份。局域网直连加密是后续阶段(见 `docs/10` §1.7 phase 3)。
81
+ - **没有 APNs / FCM 系统推送**:App 在前台或后台保持连接时才能收到提醒;iOS 被系统挂起后收不到。原有的 Server酱 / Bark / ntfy 等
82
+ 推送通道仍然可用。
83
+ - 手机端的 X25519 / ChaCha20-Poly1305 是**自己实现的**(环境限制,没有审计过的包可用),上架前建议换成审计过的实现;
84
+ Noise 实现没有对照官方测试向量。
85
+ - 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.
@@ -0,0 +1,135 @@
1
+ # App Review 补充材料(2.1 Information Needed,2026-11-04)
2
+
3
+ 苹果要求把下面六项写进 App Store Connect → 版本 → App Review Information → **Notes**(上限 4000 字符),并重新提交。
4
+
5
+ - 第 1 项(真机录屏)由发布者录制,脚本见文末「录屏脚本」。
6
+ - Notes 里写的 `<VIDEO_URL>` 要换成真实链接;同时把视频文件作为 Attachment 上传(App Review Information 里有附件框,更稳)。
7
+ - 先在构建页把 build 选为 **3.2.4 (32)**(或更新的),版本记录从 1.0 改成 3.2.4,否则 Notes 里写的版本对不上。
8
+ - Sign-in required 一栏**不要勾**(没有账号,不需要演示账号)。
9
+
10
+ ---
11
+
12
+ ## 粘贴到 Notes 的英文正文(约 3,900 字符)
13
+
14
+ ```text
15
+ SCREEN RECORDING
16
+ A recording captured on a physical iPhone running the latest iOS is attached and also at <VIDEO_URL>. It starts with launching the app and shows the typical flow: first-run connection guide, the built-in demo (sessions, streaming reply, tool-approval card, notifications, settings), then connecting to a real DeepSeek Harness on a computer by QR code and approving a real tool action.
17
+ The app has NO account system (no registration, login or account deletion), NO user-generated content shared between users (nothing is posted or visible to anyone else, so there is nothing to report or block), and NO in-app purchases, subscriptions, paid features or purchase links. Those flows do not exist, so they are not in the recording.
18
+
19
+ 1. PURPOSE AND TARGET AUDIENCE
20
+ DSH Mobile is a mobile companion for DeepSeek Harness (DSH), AI coding-agent software that developers run on their own computer. Agent tasks run for minutes or hours and often pause to ask approval before running a command or changing files, which keeps the developer tied to the computer. DSH Mobile lets them continue the conversation, answer the agent's questions, allow or deny tool actions with one tap, follow progress and get alerts from their iPhone while the work keeps running on their own computer. Audience: developers and power users who already run DeepSeek Harness. It is not a standalone AI app, so a demo mode is included for review.
21
+
22
+ 2. HOW TO ACCESS THE MAIN FEATURES (no login, credentials or sample files)
23
+ Demo mode needs no computer, account or network:
24
+ a. Launch the app and tap "Got it" on the first-run connection guide.
25
+ b. On the connection screen tap "Try the demo first (no computer needed)". A banner reads "Demo mode · sample data"; "Leave demo" returns to the connection screen.
26
+ c. Open a sample session and send "run the tests". A scripted reply streams in, then a tool-approval card appears; tap "Allow once" or "Reject".
27
+ d. Also in demo: new session, notification center, session list with archive, usage, Settings (language, theme skin, privacy policy).
28
+ Real mode (needs desktop software we cannot host): install DeepSeek Harness on a computer, add the plugin @dsh-mobile/mobile-remote, restart, open Settings > Connect mobile device, scan the QR code with the app (same Wi-Fi). The recording shows this. Guide: https://dsh.claud.ing/en/support/
29
+
30
+ 3. EXTERNAL SERVICES AND PLATFORMS
31
+ - DeepSeek Harness on the user's own computer, reached directly over the local network. It is the only backend; sessions, files and images go only between phone and computer.
32
+ - AI models (DeepSeek and others) are configured and called by DeepSeek Harness on the computer. The app never calls an AI API and holds no AI key.
33
+ - No developer-operated server, analytics or tracking SDK, payment processor, authentication service or APNs push. Alerts are local notifications created on the device.
34
+ - Advertising: the home screen shows one ad from Gravity (trygravity.ai), through Gravity's own SDK, requested directly from the device. It is contextual only: the request carries one fixed sentence describing the app, never any session content, and a Global Privacy Control signal. The app does not show the App Tracking Transparency prompt and does not read the advertising identifier. The ad is also shown in demo mode, so it can be seen without a computer.
35
+ - Apple frameworks only: camera (QR scan), photo library (images the user picks to send), Keychain (access token), Local Network.
36
+ - Optional, off by default: end-to-end encrypted relay pairing (Noise protocol) for use away from home. No relay connection is opened unless the user pairs one.
37
+
38
+ 4. REGIONAL DIFFERENCES
39
+ None. The app works identically in all regions, with no region-specific features or content. The interface follows the device language (English or Simplified Chinese).
40
+
41
+ 5. REGULATED INDUSTRY / THIRD-PARTY MATERIAL
42
+ Not a regulated-industry app and contains no protected third-party content; it only shows what the user's own agent produces on the user's own computer. "DeepSeek" names the product we connect to. DSH Mobile is an independent mobile companion for DeepSeek Harness. It is not affiliated with or endorsed by DeepSeek.
43
+
44
+ Developer: Digital Bang Intelligence LLC. support@claud.ing, https://dsh.claud.ing/en/privacy/
45
+ ```
46
+
47
+ > 发布前请你确认三件事(我无法替你核实):
48
+ > 1. 第 3 条「APNs 没有」——工程里 `Runner.entitlements` 没有 `aps-environment`,确认属实;
49
+ > 2. 第 3 条「中继默认关闭」——**App 侧**仍默认隐藏配对入口(`Features.remoteAccess=false`),App 不发起中继连接;电脑端插件 3.2.6 起默认连接公共中继。如果回复里的这句话指整个产品,请改成「App 默认不发起中继连接」;
50
+ > 3. 录屏里真的演示了「扫码连接真电脑并审批」。如果你不录这一段,请把第一段里 "then connecting to a real … " 那半句删掉,别写录屏里没有的东西。
51
+
52
+ ---
53
+
54
+ ## 录屏脚本(真机,iPhone,最新 iOS,建议 2–4 分钟)
55
+
56
+ 录制:控制中心 → 屏幕录制,**从桌面开始录**,这样「启动 App」会被录进去。可开麦克风旁白(英文),也可不说话但在画面上停留够久。
57
+
58
+ **准备**
59
+ - 卸载旧版再装 3.2.4 (32),保证首次启动引导会出现。
60
+ - 电脑上先装好 DeepSeek Harness 和插件、启动 `npx @deepseek-ai/dsh web --no-open`,手机与电脑同一 Wi-Fi。
61
+ - 开勿扰,避免录到私人通知。
62
+
63
+ **A. 启动与演示(约 1.5 分钟)**
64
+ 1. 桌面点 DSH Mobile 图标启动。
65
+ 2. 首次引导弹窗:停 3 秒,点「Got it」。
66
+ 3. 连接页点「Try the demo first (no computer needed)」。
67
+ 4. 首页 → 打开一个示例会话 → 发送 `run the tests` → 流式回复 → 审批卡点 **Allow once**,再发一次点 **Reject**。
68
+ 5. 新建会话(选 Agent 模式和工作目录)。
69
+ 6. 通知页:打开、单删一条。
70
+ 7. 设置页:切语言(中/英)、主题皮肤,滚到隐私政策点开。
71
+ 8. 点「Leave demo」回到连接页。
72
+
73
+ **B. 连接真电脑(约 1 分钟,推荐,说明不是空壳)**
74
+ 9. 连接页点扫码 → 允许相机 → 扫电脑上「Connect mobile device」页的二维码。
75
+ 10. 连上后打开真实会话,发一句需要执行命令的话,手机弹审批卡,点 Allow once,电脑端同步消失。
76
+ 11. 电脑上任务完成时,手机收到本地通知(App 在后台时,下拉通知中心给镜头)。
77
+
78
+ **C. 苹果点名要看的三类(本 App 都没有,口头/字幕说明即可)**
79
+ - 账号注册、登录、删除账号:无账号。
80
+ - 用户生成内容与举报/屏蔽:无用户间共享内容。
81
+ - 付费内容:无内购。
82
+ 可以在录屏最后加一屏字幕或旁白:“No accounts, no user-generated content, no purchases.”
83
+
84
+ **D. 上传**
85
+ - 视频传到 `site/static/media/`(已 gitignore)后 `cd site && wrangler deploy`,或用任何可公开访问的链接;同时把文件传到 App Review Information 的 Attachment。
86
+ - 把 Notes 里的 `<VIDEO_URL>` 换成真实链接,重新提交。
87
+
88
+ ---
89
+
90
+ ## 回应 Prevent Common Issues
91
+
92
+ | 条目 | 状态 |
93
+ | --- | --- |
94
+ | 2.1 崩溃/真机 | 录屏就是在真机上完成;录前用 TestFlight 装同一个 build 走一遍 |
95
+ | 2.1 访问 App | 无账号;演示模式免电脑,Notes 里已写步骤 |
96
+ | 2.3.3 截图 | 现有截图是 App 实际界面(`store/screenshots/apple/`),不是标题图/登录页;Header 图 `header_3840x1646` 是宣传图,不属于「截图」栏,若审核提到再核对 |
97
+ | 3.1.1 内购 | 无内购,无充值入口 |
98
+ | 3.2 其他商业模式 | 面向个人开发者公开发布,不是企业内部 App |
99
+
100
+ ---
101
+
102
+ ## 真机当天准备清单(2026-11-05)
103
+
104
+ 本机现状(已检查):Mac 在 Wi-Fi `172.16.6.197`;`~/.dsh` 里已装好 `@dsh-mobile/mobile-remote` 插件;DSH 目前**没有在运行**;Mac 防火墙关闭;Xcode 有一个 Apple Development 证书,但按 `project-ios-release-status` 的记录团队里**还没有注册任何测试设备**。
105
+
106
+ ### 1. 数据线连上后(手机上)
107
+ 1. 解锁 iPhone,插线,弹窗点「信任此电脑」并输入锁屏密码。
108
+ 2. 确认 Mac 看得到手机:`xcrun devicectl list devices`(现在输出 "No devices found")。
109
+ 3. 系统语言切成 English(设置 → 通用 → 语言与地区),审核员看到的是英文界面,录屏要一致。
110
+ 4. 关掉勿扰以外的私人通知预览,或先开一个干净的专注模式;录屏里要能看到本地通知,所以通知总开关要开。
111
+
112
+ ### 2. 把 App 装到手机:两条路,推荐 A
113
+ **A. TestFlight(推荐)**:装的就是已上传的 3.2.4 (32),和审核员拿到的是同一个二进制,不用注册设备、不用签名。
114
+ - App Store Connect → TestFlight:把你的 Apple ID 加进内部测试组;build 32 如果还在「缺少合规信息」,先回答出口合规问卷。
115
+ - iPhone 上装 TestFlight,用同一 Apple ID 登录,安装 DSH Mobile。
116
+ - 这次只补 Notes,不需要新 build,可直接用 build 32 重新提交。
117
+
118
+ **B. 数据线直装(备选)**:需要把这台手机的 UDID 注册进开发者账号。API Key 只有 App Manager 权限,做不了;要用 Xcode(已登录管理员 Apple ID)打开 `dsh-mobile-app/ios/Runner.xcworkspace`,选中手机,Signing 勾自动管理,Run 时让 Xcode 自动注册设备。Flutter 的 debug 包拔线后在主屏点开会闪退,要装 release:`flutter run --release`。
119
+
120
+ ### 3. 电脑端(录「连接真电脑」那一段才需要)
121
+ ```bash
122
+ npx @deepseek-ai/dsh web --no-open
123
+ ```
124
+ - 终端会打印「手机 App 连接信息」(地址 + 口令);DSH 设置 → 连接移动端设备 页面有二维码。
125
+ - 手机和 Mac 必须在同一 Wi-Fi(Mac 是 `172.16.6.x` 网段,手机也要是)。
126
+ - Mac 开着一个代理/VPN(utun4,198.18.x 假 IP)。如果扫码连不上,在 App 里手动输入「Mac 局域网 IP:端口」和口令,不要用域名。
127
+ - 首次连接 iOS 会弹两个权限:本地网络、相机,都点允许;通知权限也点允许。
128
+
129
+ ### 4. 录屏方式
130
+ - **最省事**:iPhone 控制中心的屏幕录制(设置 → 控制中心 → 添加「屏幕录制」)。**在主屏上先开始录,再点 App 图标**,这样「从启动开始」就被录进去了。录完在相册里看,AirDrop 或数据线拷到 Mac。
131
+ - **用线的好处**:QuickTime Player → 文件 → 新建影片录制 → 录制按钮旁的箭头选 iPhone 为摄像头,画面更稳,可同时录 Mac 麦克风旁白。
132
+ - 在设置里不要开「显示触摸」之类的辅助功能,也不要出现你的 Apple ID、账单信息。
133
+
134
+ ### 5. 录完
135
+ 按上面「录屏脚本」A、B、C 段走,传视频、替换 Notes 里的 `<VIDEO_URL>`、版本记录改成 3.2.4、选 build 32、重新提交。