@dsh-mobile/mobile-remote 0.0.0-stage → 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.
Files changed (73) hide show
  1. package/CHANGELOG.md +1273 -0
  2. package/CONTRIBUTING.md +59 -0
  3. package/FAQ.md +115 -0
  4. package/LICENSE +21 -0
  5. package/README.md +293 -2
  6. package/cordis.patch.yml +22 -0
  7. package/docs/00-/345/274/200/345/217/221/346/200/273/347/272/262.md +121 -0
  8. package/docs/01-PRD.md +148 -0
  9. package/docs/02-architecture.md +249 -0
  10. package/docs/03-api.md +882 -0
  11. package/docs/04-security.md +109 -0
  12. package/docs/05-test-cases.md +376 -0
  13. package/docs/06-install-run.md +349 -0
  14. package/docs/07-user-manual.md +92 -0
  15. package/docs/08-/346/211/251/345/261/225/345/274/200/345/217/221/346/214/207/345/215/227.md +86 -0
  16. package/docs/09-compatibility.md +201 -0
  17. package/docs/10-remote-access-and-launch-plan.md +216 -0
  18. package/docs/11-remote-relay-guide.md +82 -0
  19. package/docs/APP-ENCRYPTION-DESCRIPTION.md +50 -0
  20. package/docs/APP-ENCRYPTION-DESCRIPTION.pdf +0 -0
  21. package/docs/ARCHITECTURE-CURRENT.md +229 -0
  22. package/docs/AUDIT-2026-11-node.md +181 -0
  23. package/docs/AUDIT-2026-11.md +167 -0
  24. package/docs/BRAND-ASSETS.md +142 -0
  25. package/docs/BUILD-ENVIRONMENT.md +180 -0
  26. package/docs/FEATURE-PARITY.md +195 -0
  27. package/docs/PRIVACY-POLICY.en.md +143 -0
  28. package/docs/PRIVACY-POLICY.md +143 -0
  29. package/docs/REA-UNDERSTANDING.md +246 -0
  30. package/docs/STORE-LAUNCH.md +278 -0
  31. package/docs/STORE-LISTING.md +150 -0
  32. package/docs/SUPPORT.md +43 -0
  33. package/docs/TERMS-OF-SERVICE.en.md +70 -0
  34. package/docs/TERMS-OF-SERVICE.md +70 -0
  35. package/docs/screenshots/01-home.png +0 -0
  36. package/docs/screenshots/02-notifications.png +0 -0
  37. package/docs/screenshots/03-sessions.png +0 -0
  38. package/docs/screenshots/04-chat.png +0 -0
  39. package/docs/screenshots/05-settings.png +0 -0
  40. package/docs/screenshots/06-new-session.png +0 -0
  41. package/docs/screenshots/07-connect.png +0 -0
  42. package/docs/screenshots/pgy-appstore.jpg +0 -0
  43. package/docs/screenshots/pgy-mobile-app.jpg +0 -0
  44. package/docs/screenshots/pgy-pc-client.jpg +0 -0
  45. package/lib/account-usage-query.js +278 -0
  46. package/lib/account-usage.js +145 -0
  47. package/lib/api-helpers.js +333 -0
  48. package/lib/auto-config.js +107 -0
  49. package/lib/client.js +586 -0
  50. package/lib/config.js +211 -0
  51. package/lib/git-read-bundled-provider.js +255 -0
  52. package/lib/git-read-service.js +322 -0
  53. package/lib/host-compat.js +133 -0
  54. package/lib/http-util.js +69 -0
  55. package/lib/index.js +5729 -0
  56. package/lib/push.js +73 -0
  57. package/lib/rate-limit.js +46 -0
  58. package/lib/relay/connector.js +300 -0
  59. package/lib/relay/crypto.js +117 -0
  60. package/lib/relay/devices.js +138 -0
  61. package/lib/relay/identity.js +60 -0
  62. package/lib/relay/mux.js +411 -0
  63. package/lib/relay/noise.js +178 -0
  64. package/lib/relay/pairing.js +64 -0
  65. package/lib/relay/phone.js +114 -0
  66. package/lib/relay/serve.js +105 -0
  67. package/lib/rpc-adapter.js +88 -0
  68. package/lib/session-list.js +77 -0
  69. package/lib/session-title-cache.js +123 -0
  70. package/lib/session-title-refresh.js +261 -0
  71. package/lib/timeline.js +476 -0
  72. package/lib/turn-outline.js +289 -0
  73. package/package.json +62 -4
@@ -0,0 +1,142 @@
1
+ # Brand assets: provenance, contents, regeneration
2
+
3
+ **Status.** Two kinds of art ship in DSH Mobile:
4
+
5
+ 1. **Pictures** (not code): the avatar **logo** and the full-body **illustration**
6
+ (`dsh-mobile-app/tools/brand/source/logo.png`, `illustration.png`). They are used as the default launcher icon, the
7
+ in-app logo (app bar, drawer, connect screen, pet panel) and the home-screen character.
8
+ 2. **Drawn by code in this repository** (`dsh-mobile-app/lib/brand/`): a "D" chat-bubble mark, seven alternative launcher
9
+ icons and a fish mascot, which also drives the 16 Android floating-pet clips.
10
+
11
+ No DeepSeek artwork remains: the previous whale logo and the launcher icons derived from it were deleted (see "History"
12
+ at the end).
13
+
14
+ | | |
15
+ |---|---|
16
+ | Licence | Code-drawn art: MIT like the rest of the repository (`LICENSE`) |
17
+ | Source of truth | Code-drawn art: `dsh-mobile-app/lib/brand/*.dart` (Flutter `CustomPainter`s). Pictures: `dsh-mobile-app/tools/brand/source/*.png` |
18
+ | Generated by | `dsh-mobile-app/tools/brand/build.sh` (Flutter test renderer + `supplied_art.py` + `assemble.py`, Pillow) |
19
+ | Inputs | the two source pictures in `tools/brand/source/`; no downloaded images, no font or icon packs |
20
+
21
+ ## What the art is
22
+
23
+ **Code-drawn brand mark** (`lib/brand/brand_mark.dart`; the basis of the seven alternative launcher icons). An abstract chat bubble shaped like a "D" (flat spine, round bowl, one
24
+ square corner) that holds a terminal prompt `>_` and an "online" status dot. It describes the product (a phone
25
+ companion for an AI coding agent). It is a flat 2-3 colour geometric shape: brand blue `#426EFE` (light) /
26
+ `#6C8CFF` (dark) with a green dot, prompt cut out of the bubble (transparent). It is deliberately not a whale or any
27
+ animal and shares no silhouette or composition with DeepSeek's logo.
28
+
29
+ **Launcher icons** (ids unchanged: `default, deepsea, shell, moon, sticker, stamp, neon, mono`). `default` is the logo
30
+ (see below). The other seven are code-drawn treatments (`lib/brand/app_icon_art.dart`): glowing deep-sea; scalloped
31
+ shell badge; moonlit night with a moon as the status dot; die-cut sticker of the fish mascot; postage stamp; neon tube;
32
+ monochrome (also the Android 13 themed-icon layer). The code-drawn "blue gradient tile" variant (`BrandVariant.tile`)
33
+ is no longer shipped as an icon.
34
+
35
+ **Code-drawn fish mascot** (`lib/brand/mascot.dart`). A chubby, round, non-humanoid fish built from ellipses,
36
+ leaf paths and arcs: flat fills, one outline colour, a crescent shade, a belly bib and a few highlights; expressive
37
+ eyes, brows, mouth, blush, fins, crest and forked tail. It is the source of the 16 Android floating-pet clips and of
38
+ the "sticker" launcher icon; the home screen no longer uses it. Colours follow the skin (`MascotColors.forSkin`):
39
+ `dsh` blue + teal, `abyss` teal, `soda` coral + blue fins, `whale` violet + gold fins, each for light and dark.
40
+
41
+ ## Logo and illustration (`tools/brand/supplied_art.py`)
42
+
43
+ | Source | Used for | Derived files |
44
+ |---|---|---|
45
+ | `tools/brand/source/logo.png` (1254 x 1254, opaque) | default launcher icon, in-app logo | iOS `AppIcon.appiconset/*` (every size, opaque RGB, full-bleed square), `assets/icon-1024.png`, `assets/icons/default.png`, Android `mipmap-*/ic_launcher.png`, `ic_launcher_default{,_foreground,_background}.png`, `assets/brand/logo.png` (512) |
46
+ | `tools/brand/source/illustration.png` (1254 x 1254, transparent) | home-screen character (`HomePet`) | `assets/brand/illustration.webp` (trimmed to the character, 717 x 900, lossy WebP with alpha, ~170 KB) |
47
+
48
+ - The Android adaptive foreground is the logo with its white sticker background keyed out, scaled so the artwork stays
49
+ inside the 72 dp mask circle (about 52 % of the canvas); the background layer is plain white. Your artwork is cropped
50
+ flat at the bottom of the source image, and that edge is visible inside a circular launcher mask.
51
+ - The source pictures are **not** bundled in the app (they live outside `pubspec.yaml`'s asset list); only the derived
52
+ files above ship. The in-app widgets are `BrandAvatar` and `BrandIllustration` in `lib/brand/brand_art.dart`.
53
+ - A still picture cannot drive the Android floating pet's 16 animated clips, so those remain the code-drawn fish.
54
+ The home-screen character is animated procedurally (idle float, pat / poke / tail reactions) in `lib/widgets/home_pet.dart`.
55
+
56
+ ## Files
57
+
58
+ | Asset | Path | Notes |
59
+ |---|---|---|
60
+ | Vector art | `dsh-mobile-app/lib/brand/{brand_mark,app_icon_art,mascot,brand_util}.dart` | `BrandMark`, `Mascot`, `MascotAvatar`, painters |
61
+ | Home screen character | `dsh-mobile-app/lib/widgets/home_pet.dart`, `lib/brand/brand_art.dart` | `HomePet` animates the illustration (`BrandIllustration`) |
62
+ | Store / source icon | `dsh-mobile-app/assets/icon-1024.png` | 1024 x 1024, opaque RGB, the logo |
63
+ | In-app logo | `dsh-mobile-app/assets/brand/logo.png` | 512 x 512 opaque, shown by `BrandAvatar` as a rounded tile |
64
+ | Code-drawn mark (transparent) | `dsh-mobile-app/assets/brand/logo-mark.png` | 512 x 512, used by the icon pipeline and previews |
65
+ | Home illustration | `dsh-mobile-app/assets/brand/illustration.webp` | 717 x 900, transparent |
66
+ | Icon previews | `dsh-mobile-app/assets/icons/<id>.png` | 256 x 256 opaque, shown by the settings icon picker |
67
+ | Android launcher | `android/app/src/main/res/mipmap-*/ic_launcher[_<id>][_foreground\|_background].png`, `ic_launcher_mono_monochrome.png` | legacy 48/72/96/144/192, adaptive layers 108/162/216/324/432 (art inside the 66 dp safe zone), verified |
68
+ | Notification icon | `android/app/src/main/res/drawable/ic_stat_dsh.png` | 200 x 200 white silhouette of the "D" mark, used as the status-bar small icon by both `FloatingBubbleService.kt` and the Flutter local notifications (Android draws only the alpha channel, so a coloured launcher icon would show as a white square) |
69
+ | iOS app icon | `ios/Runner/Assets.xcassets/AppIcon.appiconset/*.png` | every size in `Contents.json`, opaque RGB (no alpha), rendered natively per size |
70
+ | Android overlay pet | `android/app/src/main/assets/pet/<clip>.webp` + `pet-manifest.json` | 16 animated WebP clips, 288 x 229, 84 ms/frame, each at most 260 KB (about 2.6 MB in total) |
71
+ | Pet licence note | `android/app/src/main/assets/PET-LICENSE.txt` | states the MIT terms for the code-drawn pet animations |
72
+
73
+ ### Android overlay clips
74
+
75
+ Frame count, `frameMs` and loop come from the `MascotPose` enum in `mascot.dart`; the build script writes them into
76
+ `pet-manifest.json` and checks every file against it (frame count, per-frame duration, loop flag, size).
77
+ Clip names, `stateMap`, `workingActivityMap`, micro-idle settings and the canvas size are unchanged, so the Kotlin
78
+ code needs no change.
79
+
80
+ | Clip | Frames | Duration | Loop | What it shows |
81
+ |---|---|---|---|---|
82
+ | `idle` | 40 | 3.4 s | yes | breathing, blinking, rising bubbles |
83
+ | `idle_stretch` / `idle_yawn` | 40 / 44 | 3.4 / 3.7 s | no | stretch with raised fins / yawn with a tear |
84
+ | `head_pat` / `poke` / `tail` | 20 / 18 / 20 | 1.7 / 1.5 / 1.7 s | no | happy squint and hearts / startled with "!" / tail flick |
85
+ | `thinking` | 40 | 3.4 s | yes | looks up, thought cloud |
86
+ | `working` / `working_command` / `working_search` | 40 | 3.4 s | yes | typing on a laptop with gears / terminal card / magnifier |
87
+ | `waiting` | 40 | 3.4 s | yes | raised fin and a "?" bubble |
88
+ | `success` | 48 | 4.0 s | no | three hops, confetti, check badge |
89
+ | `error` | 56 | 4.7 s | no | shock, then sad with tears and a warning badge |
90
+ | `eat_token` | 48 | 4.0 s | no | catches a token coin, chews, happy |
91
+ | `dragging` / `dragging_release` | 40 / 25 | 3.4 s / 2.1 s | yes / no | dangling and swinging / drop, squash, dizzy stars |
92
+
93
+ The previous clips were 121 frames (10.2 s) and about 1 MB each. The new one-shot clips are shorter. `success` now lasts
94
+ 4.0 s instead of 10.2 s, and `error` 4.7 s instead of 5.0 s (`FloatingBubbleService.kt` uses the clip duration as the
95
+ pulse time of those two states, so the celebration and error pulses are shorter than before).
96
+
97
+ ## Regenerating everything
98
+
99
+ ```bash
100
+ cd dsh-mobile-app
101
+ tools/brand/build.sh # all rasters + verification (about 30 s, headless)
102
+ SHEETS=/tmp/brand-sheets tools/brand/build.sh # additionally render visual QA contact sheets
103
+ ```
104
+
105
+ Requirements: Flutter SDK on `PATH` (or `FLUTTER=/path/to/flutter`), `python3` with Pillow
106
+ (`pip install pillow`; animated WebP support is needed). No Android SDK, Xcode or network is required.
107
+
108
+ Stages:
109
+
110
+ 1. `tools/brand/render_brand_test.dart` (`flutter test`, headless): renders icons, logo and iOS icons straight into the
111
+ asset locations and the overlay frames (2x, PNG) into `build/brand/frames/` (git-ignored) plus `clips.json`.
112
+ 2. `tools/brand/assemble.py`: drops the alpha channel where an asset must be opaque, assembles the animated WebP clips
113
+ (2x2 box downsample, lossy quality 50 / alpha quality 30), writes `pet-manifest.json`, then **verifies**: WebP frame
114
+ count, per-frame duration and loop flag read from the RIFF chunks, 300 KB budget per clip, no frame touching the
115
+ canvas edge, iOS icons are RGB at the exact sizes of `Contents.json`, every Android density size, adaptive
116
+ foreground / monochrome art inside the safe zone, and that the old assets are gone. `python3 tools/brand/assemble.py
117
+ --verify-only` runs just the checks.
118
+ 3. `tools/brand/contact_sheets_test.dart` (optional, `SHEETS=<dir>`): contact sheets of the mark at 256 / 180 / 120 / 60
119
+ / 29 px on light and dark, the 8 icons with an iOS mask and at small sizes, adaptive layers on a circular mask,
120
+ all 16 mascot poses on every skin (light / dark), avatars and motion strips.
121
+
122
+ Output is deterministic: the same code produces the same pixels. Unit tests in `test/brand_art_test.dart` keep the
123
+ Dart pose table and `pet-manifest.json` in sync and check that every pose draws on every skin, that loops are
124
+ seamless, that no two consecutive clip frames are identical (the WebP encoder would merge them) and the `HomePet`
125
+ tap zones.
126
+
127
+ To change the artwork, edit the painters in `lib/brand/`, run `tools/brand/build.sh`, review the contact sheets and
128
+ commit the regenerated files together with the code.
129
+
130
+ ## What was not verified in this environment
131
+
132
+ * Android native rendering (`AnimatedImageDrawable`, adaptive-icon masks on real launchers, themed icons) and the Kotlin
133
+ build: there is no Android SDK or device here. The files follow the same contract as before (names, sizes,
134
+ manifest keys); the checks above are file-level.
135
+ * iOS: icons are validated as RGB PNGs at the right sizes only; no Xcode / App Store validation was run.
136
+
137
+ ## History
138
+
139
+ The git history still contains the removed files (the DeepSeek-derived logo and icons and the imported mascot frames,
140
+ for example `assets/deepseek-logo.png` and `assets/pet/*` at commit `d80c1a4`). They are not part of the current tree
141
+ or of any build. If the history itself must be free of them, rewrite it (for example `git filter-repo`) before
142
+ publishing.
@@ -0,0 +1,180 @@
1
+ # DSH Mobile 构建环境记录
2
+
3
+ 这份记录把本机、CI 和商店发布之间的工具链边界固定下来,避免把“配置已生成”误写成“构建或上架已验证”。它是项目理解阶段的环境证据,后续每次工具链或构建命令发生变化时应在这里更新;Windows 与 macOS 的职责分界保留,是因为 Xcode 只能在 macOS 上运行。
4
+
5
+ > 记录时间:2026-11-01(Asia/Shanghai)
6
+ > 适用基线:插件 `3.2.4`,Flutter App `3.2.4+32`
7
+
8
+ ## 1. 当前工作区
9
+
10
+ - 工作区:`D:/Project_Vibe_Coding/DSH Mobile`
11
+ - 唯一代码基线:`dsh-mobile-remote-main/`
12
+ - 当前目录不是 Git 仓库:`git -C dsh-mobile-remote-main status --short --branch` 返回 `fatal: not a git repository`。
13
+ - 本轮没有执行克隆、切换分支、提交或公开发布。
14
+
15
+ ## 2. 源码声明的版本要求
16
+
17
+ | 组件 | 源码/文档要求或锁定值 | 证据 |
18
+ |---|---|---|
19
+ | Node.js | `>=20.3.0`(`package.json` `engines`;推荐 22 LTS,`toolchain.json` 固定 22.23.4) | `package.json`、`CONTRIBUTING.md` |
20
+ | npm | 随 Node.js | 当前环境检查 |
21
+ | Dart | `^3.13.0` | `dsh-mobile-app/pubspec.yaml` |
22
+ | Flutter | `3.47.9` stable | `toolchain.json`、Flutter 官方发布索引 |
23
+ | Java | Java 17 | `android/app/build.gradle.kts` 的 `sourceCompatibility`、`targetCompatibility`、Kotlin JVM target |
24
+ | Android Gradle Plugin | `9.1.0` | `android/settings.gradle.kts` |
25
+ | Kotlin Gradle Plugin | `2.4.0` | `android/settings.gradle.kts` |
26
+ | Gradle | `9.3.1`(`gradlew`/`gradlew.bat`/wrapper JAR 已生成并通过 `gradlew --version`) | `android/gradle/wrapper/` |
27
+ | Android applicationId | `com.mrdayone.dshmobile` | `android/app/build.gradle.kts` |
28
+ | App 当前显示名 | `DSH Mobile` | Android manifest placeholder、iOS Info.plist |
29
+ | App 版本 | `3.2.4+32` | `dsh-mobile-app/pubspec.yaml` |
30
+ | 插件版本 | `3.2.4` | 根 `package.json` |
31
+ | iOS Bundle Identifier | `com.mrdayone.dshmobile` | `ios/Runner.xcodeproj/project.pbxproj` |
32
+ | iOS deployment target | `15.0` | `toolchain.json`、`ios/Runner.xcodeproj/project.pbxproj` |
33
+
34
+ Flutter 版本已固定为 `3.47.9`;其生成的 Swift Package 最低 iOS 版本为 15.0,Runner 和 CI 已统一到该版本。
35
+
36
+ ## 3. Windows 本机初始检查(2026-11-01)
37
+
38
+ 执行环境:Windows 10 x86_64,Git Bash(`MINGW64_NT-10.0-19045`)。
39
+
40
+ | 工具 | 实际结果 |
41
+ |---|---|
42
+ | Node.js | `v22.14.0`,可用 |
43
+ | npm | `10.9.2`,可用 |
44
+ | Git | `2.55.0.windows.4`,可用;目标目录本身无 `.git` |
45
+ | Flutter | 缺失 |
46
+ | Dart | 缺失 |
47
+ | Java/JDK | 缺失 |
48
+ | adb | 缺失 |
49
+ | Android SDK / sdkmanager | 缺失 |
50
+ | Gradle 全局命令 | 缺失;仓库包含 wrapper,但缺 Flutter SDK 和 Java 时无法执行 |
51
+ | Xcode / xcodebuild | Windows 不可用 |
52
+ | CocoaPods / pod | Windows 不可用 |
53
+ | FVM | 缺失 |
54
+ | `JAVA_HOME` | 未设置 |
55
+ | `ANDROID_HOME` | 未设置 |
56
+ | `ANDROID_SDK_ROOT` | 未设置 |
57
+
58
+ Node 依赖安装命令:
59
+
60
+ ```text
61
+ cd dsh-mobile-remote-main && npm install --no-package-lock
62
+ ```
63
+
64
+ 结果:成功安装 46 个包。仓库没有 `package-lock.json` 或 `pnpm-lock.yaml`;`npm ls --depth=0` 显示核心 peer 包和 `qrcode@1.5.4` 已安装,`dsh-codex-connect` 是声明的可选依赖且当前未安装。
65
+
66
+ ## 4. 已运行的检查
67
+
68
+ ### 4.1 Node 插件初始检查
69
+
70
+ 命令:
71
+
72
+ ```text
73
+ cd dsh-mobile-remote-main && node --check lib/index.js && node --test test/*.js test/*.mjs
74
+ ```
75
+
76
+ 结果:
77
+
78
+ - `node --check lib/index.js` 通过。
79
+ - 测试共 223 项:213 通过、6 失败、4 跳过。
80
+ - 失败不是单一业务错误,已单独复现并分为:
81
+ - Windows 临时目录/资源释放:`EBUSY` 删除临时目录;
82
+ - Windows 创建符号链接:`EPERM`;
83
+ - 特殊文件名测试:测试夹具直接打开包含制表符/换行的路径时出现 `ENOENT`;
84
+ - Node `22.14.0` 不提供 `node:zlib` 的 `zstdCompressSync`:`session-list-title-refresh.test.mjs` 无法加载。
85
+ - `test/git-read-api.test.js` 单独运行:1/1 通过。
86
+ - `test/session-title-refresh.test.mjs` 单独运行:9/9 通过。
87
+
88
+ 这些失败必须在 Windows/CI 兼容性处理阶段决定是修复测试夹具、提高平台条件声明,还是把需要更高 Node 版本的测试放到对应 CI 运行矩阵;当前不能宣称 Node 测试门禁通过。
89
+
90
+ ### 4.2 Flutter / Android / iOS 初始检查
91
+
92
+ 初始检查时无法执行以下命令,因为 Flutter、Dart、JDK、Android SDK 均缺失;后续安装固定工具链后已在第 8 节补充最终结果:
93
+
94
+ ```text
95
+ flutter pub get
96
+ dart format --output=none --set-exit-if-changed .
97
+ flutter analyze
98
+ flutter test
99
+ flutter build apk --debug
100
+ flutter build appbundle --release
101
+ ```
102
+
103
+ Windows 无法执行:
104
+
105
+ ```text
106
+ flutter build ios --no-codesign
107
+ flutter build ipa --no-codesign
108
+ ```
109
+
110
+ 原因是 iOS 工具链需要 macOS/Xcode。此限制不阻止 Windows 端完成 Dart/Android/CI 配置,但 iOS 编译必须交给 macOS 或 GitHub Actions macOS runner。
111
+
112
+ ## 5. REA 状态与证据边界
113
+
114
+ - 当前会话工具列表没有 REA MCP 分析工具。
115
+ - 仓库内没有找到 `.apk`、`.aab`、`.ipa`、`.app` 或 `.tgz` 构建 artifact。
116
+ - `rea` CLI 未安装。
117
+ - 尝试使用 CLI fallback:
118
+
119
+ ```text
120
+ npx -y rea-agents@latest doctor --client codex --json
121
+ ```
122
+
123
+ 结果:失败。当前 Node `v22.14.0` 低于 `rea-agents@6.8.0` 要求的 `^22.23.4 || ^24.22.1 || >=26.12.1`,并在加载 `node:zlib` 的 `zstdDecompress` 导出时抛出 `SyntaxError`。
124
+
125
+ 因此本项目没有本轮 REA artifact 或运行时观察证据。后续理解文档只把源码、测试和实际运行输出写成对应证据;不会把静态源码推断冒充 REA 运行事实。
126
+
127
+ ## 6. 已发现的发布阻塞
128
+
129
+ - 初始检查时 Flutter、Dart、JDK 和 Android SDK 均未安装;本轮已安装固定 Flutter/Dart/Node/JDK,并下载 Android 命令行工具。
130
+ - Windows 无法执行 Xcode/CocoaPods/iOS 构建。
131
+ - iOS Runner 和 Bundle Identifier 已生成并固定;Apple 签名证书、provisioning profile 和 App Store Connect 凭据仍缺失。
132
+ - 当前没有 Android 正式签名:`android/key.properties` 和 `android/app/release.jks` 均不存在;v3.2.4 起 Gradle 在无 key.properties 时让 release 构建失败,只有显式 `DSH_ALLOW_DEBUG_SIGNING=1` 才用 debug 签名出候选包(只适合开发/测试,不适合商店上传)。
133
+ - Android `applicationId` 已固定为 `com.mrdayone.dshmobile`。
134
+ - **GitHub Actions**:本仓库现有三个 workflow——`ci.yml`(Linux:Node 语法检查 + 测试、Flutter 格式/分析/测试,外加开启远程访问开关的中继测试)、`ios-build.yml`(仅手动触发,macOS 无签名构建 + 产物核对)和 `android-build.yml`(仅手动触发,Kotlin 单测 + AAB/APK + 产物核对,**尚未在 GitHub 上运行过**,需 `ANDROID_SDK_LICENSES_ACCEPTED=true`)。`release.yml`(含 Play / TestFlight 条件上传)**不在本仓库**,`STORE-LAUNCH` §9 的描述是设计记录,没有实现也未验证。
135
+
136
+ ## 7. Windows / macOS / CI 职责边界
137
+
138
+ | 工作 | Windows | macOS runner | 需要用户凭据或人工操作 |
139
+ |---|---:|---:|---:|
140
+ | Node 插件开发与测试 | 可做 | 可做 | 否 |
141
+ | Flutter/Dart 开发、格式化、分析、单测 | 安装 Flutter/JDK 后可做 | 可做 | 否 |
142
+ | Android debug/release 无签名构建 | 安装 Android SDK/JDK 后可做 | 可做 | 否 |
143
+ | Android 商店签名 AAB | 可在本地构建 | 可做 | 需要用户保管的 keystore/Secrets |
144
+ | iOS 无签名编译 | 不可 | 可做 | 否 |
145
+ | iOS 签名/TestFlight | 不可 | 可做 | Apple 账号、证书、provisioning、App Store Connect 权限 |
146
+ | Google Play 上传 | 可由 CI 做 | 可由 CI 做 | Google Play 服务账号/发布权限 |
147
+ | App Store 公开发布 | 不可自动完成 | CI 可构建和上传 | 用户确认、Apple 账号和不可逆商店操作 |
148
+
149
+ ## 8. 本轮最终门禁更新(2026-11-01)
150
+
151
+ - 固定工具链已安装到用户级目录:Flutter `3.47.9` / Dart `3.13.7`、Node `22.23.4` / npm `10.9.9`、Temurin JDK `17.0.20.1`。
152
+ - `flutter analyze`:通过,`No issues found!`。
153
+ - `flutter test`:通过,593 项全部通过。
154
+ - 本地无签名发布门禁:通过,版本、Android/iOS Bundle ID、文档、Keychain entitlement 和当时记录的四个 workflow 均通过检查(本仓库现仅 `ci.yml` 与 `ios-build.yml`,见第 6 节)。
155
+ - Node 最终套件:239 项中 230 通过、5 失败、4 跳过。5 个失败仍是 Windows 临时目录锁定、符号链接权限和特殊文件名夹具边界;不是本次 Flutter/iOS 改动引入的错误。Node 语法检查通过。
156
+ - Android SDK 命令行工具下载和 SHA-256 校验通过;Gradle wrapper 已用 Gradle `9.3.1` 官方发行包生成,`gradlew --version` 通过。Flutter `3.47.9` 的真实 Gradle 配置要求 NDK `28.2.13676358`,已同步到 `toolchain.json`、Android CI 和 release workflow。当前 SDK 根目录只有 `cmdline-tools/latest`,`platform-tools`、`platforms/android-36`、`build-tools/36.0.0` 和 `ndk/28.2.13676358` 均未安装;sdkmanager 明确因未接受 `android-sdk-license` 拒绝安装,因此 `flutter build apk --debug` 仍被工具链阻塞。两个 Android workflow 现在要求仓库 Variable `ANDROID_SDK_LICENSES_ACCEPTED=true`,不会无条件代替维护者接受许可证。
157
+ - iOS deployment target 已统一为 `15.0`,与 Flutter `3.47.9` 生成的 Swift Package 要求一致。Windows 没有 Xcode/Swift,未执行 `flutter build ios`、IPA、模拟器或真机测试;macOS GitHub Actions 是下一验证面。
158
+ - **无签名构建(`--no-codesign`)的 `Runner.app` 只能证明能编译,不能安装运行**:它不带任何 entitlements,Keychain 调用返回 `-34018 errSecMissingEntitlement`,连接页点「连接」只会显示「安全存储不可用」(2026-10-31 在模拟器上实测)。在模拟器里运行请**去掉** `--no-codesign`(Xcode 会 ad-hoc 签名并带上权限,同一天实测可以连接并进入首页);真机需要正式签名。
159
+ - 无签名 iOS 流程已改为验证 `Runner.app`,不再把 Flutter `--no-codesign` 路径误报成可分发 IPA。带签名的 IPA 仍需 Apple Secrets。
160
+ - iOS 文件桥接使用 CoreFoundation 的 IANA charset converter 处理 GB18030/GBK;Android 与 iOS 的文件预览编码路径已对齐。
161
+ - token 在安全存储不可用时不再回退写入 SharedPreferences;旧值只在成功写入 Keychain/Keystore 后完成一次性迁移。
162
+ - 发布打包脚本现在检查 `npm pack` 退出码、tgz 存在性和非空大小,插件包缺失会使脚本失败。
163
+ - Dart CI 格式门禁已实际执行并修复 75 个需要格式化的源码/测试文件;现在 `dart format --output=none --set-exit-if-changed lib test`、`flutter analyze` 和 `flutter test` 均通过。
164
+ - `release-check.ps1 -StoreSubmission` 已加入严格模式;当前按预期因缺少 keystore、真实 HTTPS URL、支持邮箱和签名 AAB/IPA 失败,不会把 unsigned/debug candidate 当成可上架包。
165
+ - release workflow 已加入条件上传:正式签名 AAB 和 `GOOGLE_PLAY_SERVICE_ACCOUNT_JSON` 存在时上传 Google Play internal track;正式签名 IPA、Apple signing Secrets 和 App Store Connect API key 存在时上传 TestFlight;其他情况只保留候选产物并输出跳过原因。两个上传 action 均固定到已核验 commit SHA。
166
+ - 当前文档品牌已统一为 `DSH Mobile`;Android 内部 Kotlin namespace `com.dsh.remote` 与商店 applicationId `com.mrdayone.dshmobile` 的区别已在兼容性文档中明确,避免把源码包名误当成商店包名。
167
+ - 平台静态审查确认 `Runner.entitlements` 的空 Keychain Sharing group 符合 `flutter_secure_storage` 官方 iOS 配置;Android 明文 HTTP 仍是动态局域网/私有组网 IP 的兼容取舍,公网使用要求 HTTPS,文档矩阵已同步当前实现事实。
168
+
169
+ 下一步不是继续扩大 Windows 本地安装范围,而是在 GitHub macOS/Android runner 上执行 workflow;签名和商店上传仍需要发布者自己的 Secrets 与人工确认。
170
+
171
+ ## 9. macOS 上的 Android 构建(2026-11-02 实测)
172
+
173
+ 此前的记录说 macOS 开发机上没有 Android SDK / Java,**不准确**:
174
+
175
+ - Android SDK 在 `~/Library/Android/sdk`(platforms 35/36、build-tools 36.0.0、NDK 28.2.13676358、AVD `dsh_pixel_36`);`/usr/bin/java` 只是占位,真正的 JDK 17 在 `~/.local/jdk-17/Contents/Home`(`toolchain.json` 要求 17)。
176
+ - 用法:`JAVA_HOME=~/.local/jdk-17/Contents/Home DSH_ALLOW_DEBUG_SIGNING=1 flutter build appbundle --release`(约 2 分钟;产物由 debug 密钥签名,不能上架)。**在仓库的临时副本里构建**(`rsync` 排除 `build/`、`.dart_tool/`),避免弄脏工作区和必须保持 CRLF 的 `project.pbxproj`。
177
+ - 检查产物:`python3 tools/verify-release-artifacts.py --apk …`(见 `docs/STORE-LAUNCH.md` §8)。
178
+ - 模拟器:主机负载很高(> 25)时软件渲染的模拟器会 ANR,对话框关不掉;线程转储显示应用主线程空闲,是资源饥饿而非应用问题。关掉 iOS 模拟器面板、等负载降下来再测。
179
+ - Kotlin 单元测试 `./gradlew :app:testDebugUnitTest` 不在 `ci.yml` 里;见 `android-build.yml`。
180
+
@@ -0,0 +1,195 @@
1
+ # DSH Mobile 双端功能矩阵
2
+
3
+ 这份矩阵把现有 Android 功能逐项带入 iOS 交付,防止“补 iOS”被误解成只做几个核心页面。它是源码理解阶段的验收基线:平台不等价时必须写清替代路径和证据,不能通过隐藏入口或静默删功能来缩小 MVP。
4
+
5
+ > 记录时间:2026-11-01(Asia/Shanghai)
6
+ > 基线:插件 `3.2.4`,Flutter App `3.2.4+31`
7
+
8
+ 本矩阵以现有 Android App 的源码功能集为完整基线。`Android 状态`描述当前源码是否保留该能力;`iOS 状态`区分 Dart 业务可复用、需要 iOS 原生实现、只能提供等价替代和当前未知。历史文档中的真机结果是项目既有记录,本轮 Windows 没有 Android/iOS 设备,因此不把它们重新写成当前运行验证。
9
+
10
+ 状态含义:
11
+
12
+ - **源码存在**:在当前基线中有实现入口;本轮未在设备上重新运行。
13
+ - **待 iOS 构建验证**:源码和工程实现已存在,但必须在 macOS/Xcode 或真实设备上验证。
14
+ - **等价替代**:Android 交互没有 iOS 同等系统能力,首版必须保留入口并提供平台合适的结果。
15
+ - **未知**:需要真实宿主、设备或商店构建验证。
16
+
17
+ ## 1. 连接、状态与导航
18
+
19
+ | 功能 | Android 状态 | iOS 状态 | 证据 / 差异与后续 |
20
+ |---|---|---|---|
21
+ | 首次连接页 | 源码存在 | Dart 可复用 | `lib/main.dart:329-688`;iOS Runner 已生成,待设备验证 |
22
+ | 扫码连接 | 源码存在 | iOS 相机权限已配置,待扫描构建与设备验证 | `lib/scan_screen.dart` 使用 `mobile_scanner`;`Info.plist` 已有 `NSCameraUsageDescription` |
23
+ | 手动输入地址和访问口令 | 源码存在 | Dart 可复用 | `main.dart:690-1069`、`api.dart`;token 使用 `flutter_secure_storage`,待设备验证 |
24
+ | 二维码 path/地址/token 解析 | 源码存在 | Dart 可复用 | `scan_screen.dart`、`api.dart`;协议由插件 `/m/api/qr-config` 提供 |
25
+ | 局域网连接 | 源码存在 | Dart 可复用 | HTTP/SSE 不依赖 Android;真实 iOS 网络权限与明文策略待验证 |
26
+ | 远程组网/多地址候选 | 源码存在 | Dart 可复用 | `api.dart` 地址候选、`store.dart` 轮换;iOS 仍需本地网络/网络恢复验证 |
27
+ | 连接状态显示 | 源码存在 | Dart 可复用 | `store.dart` 的 connected/connecting/offline |
28
+ | 断线重连与地址轮换 | 源码存在 | Dart 可复用,后台语义待补 | `store.dart:1128-1608`;iOS 回前台补拉必须验证 |
29
+ | 前台恢复同步 | 源码存在 | Dart 可复用 | `main.dart` 生命周期、`store.dart` bootstrap/catch-up;未在设备验证 |
30
+ | 抽屉导航 | 源码存在 | Dart 可复用 | `main.dart`;iOS Runner 已生成,待设备验证 |
31
+ | 工作区切换 | 源码存在 | Dart 可复用 | `main.dart:735-822`、`api.dart` |
32
+ | 深色/浅色/跟随系统 | 源码存在 | Dart 可复用 | `theme.dart`、`store.dart`;iOS 主题映射待构建检查 |
33
+ | 中英文切换 | 源码存在 | Dart 可复用 | `l10n.dart`、`store.dart`;系统语言和商店本地化待补 |
34
+
35
+ ## 2. 首页、会话和消息
36
+
37
+ | 功能 | Android 状态 | iOS 状态 | 证据 / 差异与后续 |
38
+ |---|---|---|---|
39
+ | 首页欢迎语与最近会话 | 源码存在 | Dart 可复用 | `screens/home_screen.dart` |
40
+ | 新建会话入口 | 源码存在 | Dart 可复用 | `screens/home_screen.dart`、`api.dart:/api/sessions` |
41
+ | 会话列表 | 源码存在 | Dart 可复用 | `screens/sessions_screen.dart`、`session_list.dart` |
42
+ | 按工作区查看会话 | 源码存在 | Dart 可复用 | `models.dart`、`main.dart` 工作区选择 |
43
+ | 会话标题、时间、cwd、归档状态 | 源码存在 | Dart 可复用 | `models.dart`、`screens/sessions_screen.dart` |
44
+ | 会话 touch/归档/恢复 | 源码存在 | Dart 可复用 | `api.dart` 会话生命周期端点 |
45
+ | 继续会话 | 源码存在 | Dart 可复用 | `screens/chat_screen.dart`、`/api/send` |
46
+ | fork 分支会话 | 源码存在 | Dart 可复用 | `api.dart:/api/sessions/fork`、聊天页会话操作 |
47
+ | 流式回复 | 源码存在 | Dart 可复用 | `api.dart:/api/events`、`store.dart`、`chat_screen.dart` |
48
+ | Markdown 标题、列表、引用 | 源码存在 | Dart 可复用 | `md.dart`、聊天页渲染 |
49
+ | 代码块展示和复制 | 源码存在 | Dart 可复用 | `md.dart`、`chat_copy.dart`、相关测试 |
50
+ | 表格展示和横向滚动 | 源码存在 | Dart 可复用 | `md.dart`、`test/md_table_test.dart`、`issue33_wide_table_swipe_test.dart` |
51
+ | 链接 scheme 白名单 | 源码存在 | Dart 可复用 | `md.dart`、`test/md_link_test.dart`;iOS 外部打开策略待验证 |
52
+ | 长消息和流式跟随 | 源码存在 | Dart 可复用 | `chat_screen.dart`、`test/chat_scroll_regression_test.dart` |
53
+ | 历史分页/无限上翻 | 源码存在 | Dart 可复用 | `chat_screen.dart:1071-1619`、`/api/history` |
54
+ | 轮次导航和大纲 | 源码存在 | Dart 可复用,性能待验证 | `turn_navigation.dart`、`turn_outline.dart`、`/api/turn-outline` |
55
+ | 消息复制完整对话 | 源码存在 | Dart 可复用 | `chat_screen.dart:1809-1820`、`chat_copy.dart` |
56
+ | 聊天草稿保留 | 源码存在 | Dart 可复用 | `store.dart`/`chat_screen.dart`;当前主要是内存状态,进程被杀后行为待确认 |
57
+ | 运行中状态活动条 | 源码存在 | Dart 可复用 | `chat_screen.dart`、`store.dart` |
58
+ | Agent 思考状态和思维链折叠 | 源码存在 | Dart 可复用 | `store.dart`、`chat_screen.dart`、`reasoningOverrides` |
59
+ | 工具调用状态 | 源码存在 | Dart 可复用 | `session/event` 转发、`chat_screen.dart` |
60
+ | 上下文窗口和 token 用量 | 源码存在 | Dart 可复用 | `store.dart:session/context`、`api.dart:/api/usage` |
61
+ | 停止运行中的任务 | 源码存在 | Dart 可复用 | `chat_screen.dart`、`/api/sessions/stop` |
62
+ | 消息反馈 | 源码存在 | Dart 可复用 | `api.dart:/api/feedback` |
63
+
64
+ ## 3. 问询、审批、队列与任务
65
+
66
+ | 功能 | Android 状态 | iOS 状态 | 证据 / 差异与后续 |
67
+ |---|---|---|---|
68
+ | 问询卡片 | 源码存在 | Dart 可复用 | `chat_screen.dart:7700-8053`、`store.dart:mobile/frame` |
69
+ | 多问题问询 | 源码存在 | Dart 可复用 | `models.dart` 问询结构、聊天页 |
70
+ | 选项/多选/自定义回答 | 源码存在 | Dart 可复用 | `models.dart:652-722`、`/api/respond` |
71
+ | 取消问询 | 源码存在 | Dart 可复用 | `chat_screen.dart`、`test/conversation_action_order_test.dart` |
72
+ | 工具审批卡片 | 源码存在 | Dart 可复用 | `chat_screen.dart`、`mobile/frame` |
73
+ | 允许一次/拒绝 | 源码存在 | Dart 可复用 | `chat_screen.dart`、`/api/respond` |
74
+ | 审批/问询 resolved 精确撤销 | 源码存在 | Dart 可复用 | `attention.dart`、`store.dart`;服务端重复帧待真实连接验证 |
75
+ | 断线后 pending 回放 | 源码存在 | Dart 可复用 | `store.dart`、`docs/02-architecture.md`;未运行验证 |
76
+ | 队列查看 | 源码存在 | Dart 可复用 | `api.dart:/api/queue`、`store.dart:mobile/queue` |
77
+ | 队列编辑/删除/steer | 源码存在 | Dart 可复用 | `chat_screen.dart:2094-2330`、`/api/messages` |
78
+ | 后台 jobs 列表和终止 | 源码存在 | Dart 可复用 | `session_tools_sheet.dart:115-242`、`/api/jobs` |
79
+ | 子代理列表和中断 | 源码存在 | Dart 可复用 | `session_tools_sheet.dart:244-424`、`/api/subagents` |
80
+ | 目标查看、创建、暂停、继续、完成 | 源码存在 | Dart 可复用 | `session_tools_sheet.dart:425-488`、`/api/goal` |
81
+ | 任务进度实时更新 | 源码存在 | Dart 可复用 | `store.dart:session/jobs`、`session_tools_sheet.dart` |
82
+ | 斜杠命令目录和发送 | 源码存在 | Dart 可复用 | `chat_screen.dart:2923-3305`、`/api/commands` |
83
+ | 插件动作清单和执行 | 源码存在 | Dart 可复用 | `api.dart:/api/actions`、`session_tools_sheet.dart`;真实插件动作需宿主验证 |
84
+
85
+ ## 4. 通知、后台和生命周期
86
+
87
+ | 功能 | Android 状态 | iOS 状态 | 证据 / 差异与后续 |
88
+ |---|---|---|---|
89
+ | 通知中心列表 | 源码存在 | Dart 可复用 | `screens/notifications_screen.dart`、`/api/notifications` |
90
+ | 未读计数和全部已读 | 源码存在 | Dart 可复用 | `store.dart`、notifications API |
91
+ | 单条/批量/全部删除 | 源码存在 | Dart 可复用 | `api.dart:/api/notifications/delete` |
92
+ | 通知跳转对应会话 | 源码存在 | Dart 可复用 | `main.dart` 导航、通知页 |
93
+ | App 内横幅 | 源码存在 | Dart 可复用 | `main.dart`、`attention.dart` |
94
+ | 在线审批/问询本地系统通知 | Android 源码存在 | iOS Darwin 初始化、权限请求、通知展示和点击路由已接入;待设备验证 | `local_notifications.dart`;iOS 使用 `UNUserNotificationCenter`,Android 使用通知渠道 |
95
+ | 离线推送桥 | 服务端配置存在 | App 端可复用,但 APNs/第三方通道需实测 | `lib/index.js`、`docs/06-install-run.md`;不能用 Flutter 常驻进程替代 iOS 后台通知 |
96
+ | 通知去重与精确撤销 | Dart 源码存在 | Dart 可复用 | `attention.dart`、`AttentionLedger`;平台展示需 iOS 实测 |
97
+ | Android 前台保活通知 | Android 源码存在 | 无等价常驻进程 | `keep_alive.dart`、`KeepAliveService.kt`;iOS 改用 APNs + 回前台补拉,保留设置说明 |
98
+ | Android 桌面宠物/悬浮窗 | Android 源码存在 | 无系统等价 overlay | `floating.dart`、`FloatingBubbleService.kt`;iOS 保留 App 内状态入口,不能静默删除“后台提醒”能力说明 |
99
+ | App 前台/后台生命周期 | Android 源码存在 | Dart 可复用,iOS 生命周期需补齐 | `main.dart`、`MainActivity.onStart/onStop`;iOS 需 scene phase |
100
+ | App 被系统杀掉后恢复 | Android 历史记录存在 | 未知 | Android KeepAlive 默认关闭;iOS 必须靠通知点击/启动补拉,需真机验证 |
101
+ | 省电设置引导 | Android 源码存在 | iOS 不需要同类设置 | `settings_screen.dart`、`KeepAliveService`;iOS 提供后台通知说明即可 |
102
+
103
+ ## 5. 文件、图片、工作区和 Git
104
+
105
+ | 功能 | Android 状态 | iOS 状态 | 证据 / 差异与后续 |
106
+ |---|---|---|---|
107
+ | 工作区浏览 | 源码存在 | Dart 可复用 | `api.dart:/api/workspaces`、`main.dart` |
108
+ | 目录浏览和新建目录 | 源码存在 | Dart 可复用 | `api.dart:/api/directories`、`sheets.dart` |
109
+ | 新建会话选择 cwd | 源码存在 | Dart 可复用 | `screens/sheets.dart`、`/api/sessions` |
110
+ | 文件选择上传 | Android 原生通道存在 | 待 iOS 补 UIDocumentPicker | `dsh/files`、`chat_screen.dart:4354-4370` |
111
+ | 相机拍照 | Android/Flutter 源码存在 | 依赖相机权限和插件 iOS 构建 | `image_picker`、`chat_screen.dart:4633-4645` |
112
+ | 相册多选 | Android/Flutter 源码存在 | 待 iOS 权限和插件验证 | `image_picker`;需 `NSPhotoLibraryUsageDescription` |
113
+ | 图文消息发送 | Dart/协议源码存在 | Dart 可复用 | `api.dart`、`chat_screen.dart`;真实服务端图片链路待运行验证 |
114
+ | 图片消息展示/全屏/LRU | Dart 源码存在 | Dart 可复用 | `api.dart:917-990`、`chat_screen.dart` |
115
+ | 文件下载进度/取消/续传 | Android 源码存在 | Dart 可复用,系统保存/打开需 iOS 实现 | `download.dart`、`MainActivity.kt` 文件通道 |
116
+ | Markdown 文件预览/源码 | Dart 源码存在 | Dart 可复用 | `session_files_screen.dart`、`session_files_logic.dart` |
117
+ | 文件保存到系统下载目录 | Android 原生实现 | iOS 改用 Files/分享面板 | `MainActivity.saveFileFromPath`;iOS 没有 Android MediaStore 等价物 |
118
+ | 文件打开/分享 | Android 原生实现 | 待 UIDocumentInteractionController/Share Sheet | `dsh/files` |
119
+ | 原生文本解码 | Android 原生实现 | Dart 或 iOS Foundation 等价实现 | `MainActivity.decodeText`、`session_files_controller.dart` |
120
+ | Git 仓库能力 | Dart/API 源码存在 | Dart 可复用 | `git_browser_sheet.dart`、`api.dart:1246-1360` |
121
+ | Git 分支/提交图 | Dart/API 源码存在 | Dart 可复用 | `git_graph_logic.dart`、`git_graph_presentation.dart` |
122
+ | Git 提交详情和文件预览 | Dart/API 源码存在 | Dart 可复用 | `git_browser_sheet.dart`、服务端 `lib/git-read-service.js` |
123
+ | Git worktree 状态 | Dart/API 源码存在 | Dart 可复用 | `git_browser_controller.dart`、`/api/git/worktree` |
124
+
125
+ ## 6. 模型、权限、提供商、用量与诊断
126
+
127
+ | 功能 | Android 状态 | iOS 状态 | 证据 / 差异与后续 |
128
+ |---|---|---|---|
129
+ | 模型目录 | 源码存在 | Dart 可复用 | `models.dart`、`api.dart:/api/catalog` |
130
+ | 推理强度 | 源码存在 | Dart 可复用 | `models.dart`、会话配置页 |
131
+ | Agent 预设 | 源码存在 | Dart 可复用 | `models.dart`、`/api/defaults`、新建会话 |
132
+ | 权限预设 | 源码存在 | Dart 可复用 | `models.dart`、`/api/session-config` |
133
+ | Full Access 风险确认 | 源码存在 | Dart 可复用 | `settings_screen.dart`、权限配置逻辑 |
134
+ | 模型提供商列表/搜索/编辑 | 源码存在 | Dart 可复用 | `providers_screen.dart:18-540`、`/api/llm-providers` |
135
+ | Provider 探测模型 | 源码存在 | Dart 可复用 | `api.dart:/api/llm-providers/probe` |
136
+ | Provider 密钥删除 | 源码存在 | Dart 可复用 | `providers_screen.dart`;密钥只应在服务端/安全存储边界处理 |
137
+ | DeepSeek/第三方额度 | 源码存在 | Dart 可复用 | `usage_screen.dart`、`/api/account-usage` |
138
+ | 余额与余额预警(不含充值入口) | 源码存在 | Dart 可复用 | `api.dart:/api/balance`、`Floating.notifyBalance`;iOS 不提供 overlay 余额气泡,保留 App 内提醒 |
139
+ | 会话 token/context 用量 | 源码存在 | Dart 可复用 | `api.dart:/api/usage` |
140
+ | 环境诊断 | 源码存在 | Dart 可复用 | `notify_diag.dart`、`/api/diagnostics`;iOS 需要加入平台能力和通知状态 |
141
+ | 版本信息 | 源码存在 | Dart 可复用 | `package_info_plus`、设置页 |
142
+ | 日志和诊断计数 | 源码存在 | Dart 可复用 | `logger.dart`、`notify_diag.dart`;日志路径和轮转本轮未运行确认 |
143
+
144
+ ## 7. 外观、图标和资产
145
+
146
+ | 功能 | Android 状态 | iOS 状态 | 证据 / 差异与后续 |
147
+ |---|---|---|---|
148
+ | 默认 DSH 主题 | 源码存在 | Dart 可复用 | `theme.dart` |
149
+ | 三套额外皮肤与动态首页背景 | 源码存在 | Dart 可复用,性能待 iOS 设备验证 | `theme.dart`、`widgets/dsh_dynamic_background.dart`、`home_screen.dart` |
150
+ | 8 款 Android App 图标 | 源码存在 | 不同机制 | `app_icon_switcher.dart`、Manifest 8 个 activity-alias |
151
+ | iOS 固定 App Icon | Android alias 已保留 | 静态 AppIcon(DSH 原创品牌标;由 `dsh-mobile-app/tools/brand/build.sh` 按每个尺寸原生渲染,不透明 RGB——App Store 不接受带透明通道的图标) | iOS Runner 的 `Assets.xcassets/AppIcon.appiconset`;不把 Android alias 直接复制到 iOS |
152
+ | iOS alternate icons | Android 不适用 | 可选后续 | 如果保留图标切换入口,需使用 iOS 官方 alternate icon 能力并验证审核要求;否则首版显示固定图标且保留功能说明 |
153
+ | 启动图/Launch Screen | Android 资源存在 | 已生成 LaunchScreen/Main storyboard | `android/app/src/main/res/drawable*/launch_background.xml`、`ios/Runner/Base.lproj/LaunchScreen.storyboard` |
154
+ | App Logo 和宠物素材 | Android assets 存在 | Dart 资产可复用;宠物 overlay 不可复用 | `assets/`、`pubspec.yaml`;品牌素材需检查商店关系声明 |
155
+
156
+ ## 8. 安全、发布与验证状态
157
+
158
+ | 项目 | Android 当前状态 | iOS 当前状态 | 证据 / 后续 |
159
+ |---|---|---|---|
160
+ | Token 不进入普通日志 | 需审查 | 需审查 | `logger.dart`、`api.dart`;本轮没有完整日志路径运行证据 |
161
+ | Token 安全存储 | `flutter_secure_storage` → Android Keystore | `flutter_secure_storage` → iOS Keychain | `api.dart`、`Runner.entitlements`;安全存储失败不再回退到普通偏好 |
162
+ | Android Keystore | Gradle release keystore 机制存在 | 不适用 | `android/app/build.gradle.kts`;当前无 `key.properties`/`release.jks` |
163
+ | iOS Keychain | 不适用 | 已接入,待 macOS/Xcode 签名构建验证 | `flutter_secure_storage`、`ios/Runner/Runner.entitlements`;空 Keychain Sharing group 符合插件要求 |
164
+ | HTTP/HTTPS 策略 | `usesCleartextTraffic=true`,支持动态局域网/私有组网 IP,公网须 HTTPS | ATS `NSAllowsLocalNetworking` | AndroidManifest、`ios/Runner/Info.plist`、`docs/04-security.md`;保留现有局域网协议并明确公网风险 |
165
+ | 相机/通知权限 | Manifest + 运行时通知权限 | Info.plist + `UNUserNotificationCenter`/Darwin 初始化 | AndroidManifest、`ios/Runner/Info.plist`、`local_notifications.dart`;需设备验证系统弹窗和点击 |
166
+ | Android applicationId | `com.mrdayone.dshmobile` | Bundle ID `com.mrdayone.dshmobile` | `android/app/build.gradle.kts`、`ios/Runner.xcodeproj/project.pbxproj`;首次上传前仍需商店账号确认 |
167
+ | 双端构建 | 工具链已固定,SDK 平台包受 License 阻塞 | Windows 无法运行 Xcode;macOS workflow 已配置 | `toolchain.json`、`.github/workflows/ci.yml` 与 `ios-build.yml`、`docs/BUILD-ENVIRONMENT.md`;需 runner 实跑 |
168
+ | 商店签名与上传 | 缺少 keystore/Play 凭据 | 缺少 Apple 证书/账号 | 只能配置 CI,不能声称已经上传 |
169
+ | 真实端到端链路 | 现有文档有历史 Android 记录,本轮未复核 | 未知 | 需要测试 DSH 宿主、token、Android/macOS 真机 |
170
+
171
+ ## 9. iOS 首版明确差异
172
+
173
+ iOS 首版必须保留以下业务入口:连接、会话、聊天、历史、流式事件、任务、子代理、目标、问询/审批、通知中心、文件/图片、工作区、Git、模型/权限/provider、用量、诊断、主题和语言。
174
+
175
+ 平台差异只能集中在以下能力,并在 UI 中明确状态:
176
+
177
+ 1. Android 桌面宠物/系统悬浮窗:iOS 改为 App 内状态入口,不申请无关权限。
178
+ 2. Android 前台服务保活:iOS 改为 APNs/服务端推送 + 回前台补拉,不承诺常驻 SSE。
179
+ 3. Android activity-alias 图标切换:iOS 首版使用固定图标;若后续实现 alternate icon,再单独验证权限和审核要求。
180
+ 4. Android MediaStore 下载:iOS 改为 Files/分享面板/应用沙盒,并在保存成功后给出真实路径或分享结果。
181
+ 5. Android 原生文本解码:优先移到 Dart 跨平台实现,必要时用 iOS Foundation;不能让页面直接依赖 Android channel。
182
+
183
+ 任何差异都不得删除原 Android 入口,也不得用静态页面或演示数据代替真实 API。
184
+
185
+ ## 10. 本轮 iOS 实现更新(2026-11-01)
186
+
187
+ 本矩阵建立后已完成以下平台实现:
188
+
189
+ - Flutter 官方 `ios/` Runner 工程已生成,Bundle ID 固定为 `com.mrdayone.dshmobile`,显示名为 `DSH Mobile`,最低 iOS 版本为 15.0(Flutter 3.47.9 生成的 Swift Package 要求)。
190
+ - `AppDelegate.swift` 已实现 `dsh/files` 的 iOS 文件选择、Files 导出、文件预览、分享和文本解码;Android-only 的 `dsh/floating`、`dsh/keepalive`、`dsh/app_icon` 返回明确不支持,不伪装为等价系统能力。
191
+ - `flutter_secure_storage 11.2.0` 已接入:Android 使用 Keystore,iOS 使用 Keychain;旧 SharedPreferences token 只在迁移时读取,成功写入安全存储后删除。
192
+ - 本地通知已同时配置 Android 与 iOS;iOS 使用 `UNUserNotificationCenter` 通过 `flutter_local_notifications` 请求权限和展示提醒。
193
+ - iOS 网络配置只允许本地网络访问(`NSAllowsLocalNetworking`),没有打开任意公网 HTTP;相机、照片、本地网络和通知用途说明已写入 `Info.plist`。
194
+
195
+ 这些实现已通过 Windows 上 `flutter analyze` 和 593 项 Flutter 测试;iOS Swift/Xcode 编译、模拟器、真机、通知点击和 Files Provider 行为仍需 macOS runner 验证。