From 0909af1675c210ca10474d3b51503cbab4690b32 Mon Sep 17 00:00:00 2001 From: haonan Date: Fri, 13 Nov 2026 18:09:29 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E5=8F=91=E5=B8=83=201.11.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/release-notes/versions/1.11.0.md | 85 +++++++++++++++++++++ Cargo.lock | 10 +-- apps/shellsmith-mcp/Cargo.toml | 2 +- apps/shield-cli/Cargo.toml | 2 +- apps/shield-gui/package-lock.json | 4 +- apps/shield-gui/package.json | 2 +- apps/shield-gui/src-tauri/Cargo.toml | 2 +- apps/shield-gui/src-tauri/tauri.conf.json | 2 +- apps/shield-gui/src/hooks/use-about-page.ts | 2 +- crates/shield-core/Cargo.toml | 2 +- shield-stub/compat/api19-rust/Cargo.lock | 2 +- shield-stub/compat/api19-rust/Cargo.toml | 2 +- shield-stub/src/main/rust/Cargo.toml | 2 +- 13 files changed, 102 insertions(+), 17 deletions(-) create mode 100644 .github/release-notes/versions/1.11.0.md diff --git a/.github/release-notes/versions/1.11.0.md b/.github/release-notes/versions/1.11.0.md new file mode 100644 index 0000000..2d3d219 --- /dev/null +++ b/.github/release-notes/versions/1.11.0.md @@ -0,0 +1,85 @@ +### 重点新增:完整 MCP Server + +- 新增 `shellsmith-mcp`,通过本地 stdio 向其他 Agent 暴露 Shellsmith 当前全部 CLI 能力;不包含独立 Agent、模型调用或 UI,加固核心仍由 `shield` CLI 执行。 +- 提供 16 个 MCP 工具: + - 版本与检查:`shellsmith_version`、`shellsmith_check_apk`、`shellsmith_check_aab`、`shellsmith_check_ios`、`shellsmith_check_keystore` + - 加固与签名:`shellsmith_protect_apk`、`shellsmith_protect_aab`、`shellsmith_protect_xop`、`shellsmith_protect_ios`、`shellsmith_sign_apk` + - 安装与报告:`shellsmith_install_apks`、`shellsmith_read_report` + - 任务管理:`shellsmith_job_status`、`shellsmith_job_result`、`shellsmith_job_cancel`、`shellsmith_job_list` +- 长任务立即返回 `job_id`;支持进度通知、状态查询、终态结果、取消和进程树回收,不阻塞 MCP 请求循环。 +- `shellsmith_protect_apk` 支持加固与自动签名组成同一任务;自动签名前会校验输入 APK、keystore 与 `runtime_cert_sha256` 的证书一致性,避免载荷绑定证书与最终签名证书不一致。 +- MCP 参数不接受明文密码:只接受 `password_env` / `key_password_env` / `byos_api_key_env`,密码从 MCP 进程环境读取。 +- 加固、签名和安装要求显式 `confirm: true`;原地覆盖还要求 `allow_in_place: true`。 +- 支持 `--allow-root` / `SHELLSMITH_MCP_ALLOWED_ROOTS` 路径白名单;输入、输出、iOS 配置引用、工程 bundle 内部链接和报告路径都会校验真实位置。 +- 同步检查移出协议读循环并支持超时;MCP 关闭 stdin、收到 `exit` 或 `shutdown` 时,会取消并回收活动任务和同步检查。 +- 默认本地运行、离线处理;不上传 APK、AAB、证书、密码或报告。BYOS 仅在显式配置时访问用户自建服务。 + +### GitHub Release 新增 CLI + MCP 完整包 + +- Release 成功后自动构建并上传 Linux x86_64、macOS universal、Windows x86_64 的 `Shellsmith-cli--` 包。 +- 包内同时包含 `shield` 和 `shellsmith-mcp`,以及 apktool、apksigner、XOP PVM2 packer、runtime resources、许可证和 README。 +- 生成 SHA-256 校验和;`shellsmith-mcp` 默认自动查找同目录 `shield`,解压后无需额外传 `--cli`。 +- Release 说明改为带引号模板渲染,修复反引号被 shell 执行、说明文字丢字的问题。 + +### Android 加固与性能 + +- 优化 PVM2 字符串处理:增加 ASCII 字符串快速路径,减少通用编码路径的分配和拷贝。 +- 优化静态零参数跳板,移除不必要的 `NEW_ARRAY` 指令。 +- 分配探针结果:生产字符串处理从 **176.62 B/次降至 48.53 B/次(-72.5%)**,GC 次数从 **8.0 降至 5.67**(BRP-AN00 / API 35 / arm64 测试环境)。 +- DEXB v6 格式、PVM2 协议版本和加固产物结构未改变;性能收益需要重新执行加固后生效。 + +### 签名与产物生命周期 + +- 统一 APK/AAB 签名文件生命周期:暂存 APK、V4 `.idsig`、保护报告和旧附件按同一事务提交;失败时恢复旧产物,避免半替换状态。 +- 修复签名取消和失败清理:口令文件、暂存 APK、报告、V4 附件和恢复目录按实际使用路径清理;回滚失败时明确保留恢复副本,MCP 任务清理不会删除该副本。 +- V4 签名附件随最终产物正确迁移;关闭 V4 时清理旧附件,开启时验证附件非空。 +- 修复签名凭证编码、密码文件传递、Swift 启动入口定位、条件编译识别和取消读取竞态。 +- iOS 工作副本、签名取消和凭据传递路径统一;拒绝条件编译包装的 UIKit 回调,保留迟到取消错误。 +- 普通 `shellsmith_sign_apk` 只在保护报告实际存在时返回 `report`,不再返回不存在的 `.protection.json`。 +- 自定义 `apksigner` 现在贯穿证书预检和最终签名:`sign.apksigner` 优先,未填写时沿用顶层 `apksigner`。 +- `check-keystore` 的密码支持 `MOCIKA_SHIELD_KS_PASS` 环境变量,密码不进入 argv。 + +### iOS 加固与检查 + +- 修复 `protect-ios --ios-config` 与全局 `--config` 的 clap 参数 ID 冲突;合法 iOS TOML 不再被当作通用 CLI 配置读取。 +- iOS 配置中的 `project.path`、实际启用的 `project.entrypoint`、`confidential.config` 以及工程/工作区内部文件均受允许目录约束。 +- 支持 `.xcodeproj` / `.xcworkspace` 主入口别名:按原始入口扩展名识别工程类型,再校验规范化后的真实路径。 +- 修复 workspace 扫描边界:只允许 workspace 时不再读取同级工程;需要开放源码根目录时会明确提示。 +- 目录链接按 CLI 遍历语义递归校验,覆盖链接目标内部的 `project.pbxproj` 和 scheme 链接;使用深度/条目限制并保留循环保护。 +- `.git`、`Pods`、`.build`、`DerivedData` 的跳过规则统一应用于普通目录和目录链接。 +- CocoaPods 预检实际读取的 `Podfile.lock`、`Pods/Manifest.lock` 以及内部 workspace 父工程 `project.pbxproj` 会在读取前校验路径和普通文件类型。 +- 修复大小写不敏感文件系统上的绕过:按 CLI 实际打开的小写路径检查 `project.pbxproj` / `contents.xcworkspacedata`,大写目录项也会被正确识别。 +- 命名管道、设备文件、同名目录等非普通文件会立即拒绝,不再阻塞检查或保护预检;必需文件的失效链接明确报错,无关的失效普通文件链接保持忽略。 +- `compat` 模式不再校验实际不会使用的 `entrypoint` / Swift Confidential 配置;`balanced` / `strict` 保持原有启用语义。 +- 修复 `check-ios` 多行 JSON 报告被截断成单个字符串的问题;现在完整保留 `project_path`、`source_root`、`schemes`、`targets`、`xcode`、`checks` 等字段。 +- 修正 macOS 上共享 scheme、CocoaPods 依赖和 iOS 工程路径检查的错误处理。 + +### BYOS 桌面配置 + +- 桌面端重启后会恢复上次选择的 BYOS 服务或本地离线模式。 +- BYOS 服务详情和构建 API key 加密保存在本地;编辑服务时留空 key 会沿用已保存的凭据。 +- 加固任务仍按提交时固定的 BYOS 配置执行,不会因运行中切换界面选项而改变本次任务。 +- 被加固的 APK 每次启动仍按服务端策略取钥;本版本不改变 BYOS 协议和运行时授权模型。 + +### MCP 安全与任务生命周期修复 + +- 同步检查、异步任务和 MCP 退出统一使用独立进程组/进程树回收;Windows 使用 `taskkill /PID /T /F`。 +- 子进程显式移除继承的 BYOS/keystore 密码环境变量,再按任务注入,避免普通离线任务被父进程预设的 BYOS key 破坏。 +- 取消时由 MCP 持有任务私有 `TMPDIR` 和暂存根目录,任务结束后清理口令和 staging;签名回滚保留的恢复副本位于输出目录,不受清理影响。 +- 修复同步检查阻塞取消、持有任务锁等待进程退出、stdout 提前关闭后无法取消等问题。 +- 相对 `--cli ./bin/shield` 路径会先按 MCP 启动目录解析,再切换子进程工作目录;裸程序名仍通过 `PATH` 查找。 + +### 工程与发布 + +- 新增 MCP 测试:协议初始化、工具清单、检查、加固、自动签名、任务取消、失败结果、进度通知、路径白名单、符号链接逃逸、秘密环境变量、FIFO/非普通文件、iOS 配置/工程路径、兼容性回归等。 +- 新增 CLI/MCP 发布包构建与校验工作流;Release 说明、CLI 本地发布脚本、Makefile 和构建文档同步更新。 +- 新增 `SHELLSMITH_MCP_SYNC_TIMEOUT_SECS`(默认 600 秒)控制同步检查超时。 +- 未自动升级依赖;Dependabot 依赖升级 PR 已关闭并删除分支,避免在发布周期内引入未经验证的依赖变更。 + +### 升级说明 + +- MCP 用户需要更新 `shellsmith-mcp` 及其配套 `shield` CLI;如果使用发布页的 CLI 包,直接下载新的 `Shellsmith-cli--` 包即可。 +- PVM2 字符串/跳板性能优化只对重新加固后的 APK 生效;已加固产物无需仅因本版本重新加固。 +- iOS 路径校验比旧版本更严格:如果工程实际源码根目录、CocoaPods 锁文件或工程内部链接位于 `--allow-root` 之外,需要显式增加对应允许目录。 +- 普通签名结果不再包含不存在的保护报告;如果输入 APK 带有保护报告,签名后仍会返回实际迁移后的报告路径。 +- DEXB 格式、PVM2 协议、BYOS 协议和 Android/iOS 运行时资源版本未改变。 diff --git a/Cargo.lock b/Cargo.lock index db74bb0..bc2458e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2202,7 +2202,7 @@ dependencies = [ [[package]] name = "mocika-shield" -version = "1.10.1" +version = "1.11.0" dependencies = [ "dunce", "reqwest 0.12.28", @@ -2230,7 +2230,7 @@ dependencies = [ [[package]] name = "mocikashield" -version = "1.10.1" +version = "1.11.0" dependencies = [ "cc", "chacha20poly1305", @@ -3649,7 +3649,7 @@ dependencies = [ [[package]] name = "shellsmith-mcp" -version = "1.10.1" +version = "1.11.0" dependencies = [ "anyhow", "clap", @@ -3662,7 +3662,7 @@ dependencies = [ [[package]] name = "shield-cli" -version = "1.10.1" +version = "1.11.0" dependencies = [ "anyhow", "clap", @@ -3680,7 +3680,7 @@ dependencies = [ [[package]] name = "shield-core" -version = "1.10.1" +version = "1.11.0" dependencies = [ "anyhow", "base64 0.22.1", diff --git a/apps/shellsmith-mcp/Cargo.toml b/apps/shellsmith-mcp/Cargo.toml index c016638..8d95593 100644 --- a/apps/shellsmith-mcp/Cargo.toml +++ b/apps/shellsmith-mcp/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "shellsmith-mcp" -version = "1.10.1" +version = "1.11.0" edition = "2021" authors = ["MocikaDev"] license = "MIT OR Apache-2.0" diff --git a/apps/shield-cli/Cargo.toml b/apps/shield-cli/Cargo.toml index 83d04ff..a7e8dcc 100644 --- a/apps/shield-cli/Cargo.toml +++ b/apps/shield-cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "shield-cli" -version = "1.10.1" +version = "1.11.0" edition = "2021" authors = ["MocikaDev"] license = "MIT OR Apache-2.0" diff --git a/apps/shield-gui/package-lock.json b/apps/shield-gui/package-lock.json index bba6612..97ad447 100644 --- a/apps/shield-gui/package-lock.json +++ b/apps/shield-gui/package-lock.json @@ -1,12 +1,12 @@ { "name": "mocika-shield-gui", - "version": "1.10.1", + "version": "1.11.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "mocika-shield-gui", - "version": "1.10.1", + "version": "1.11.0", "license": "MIT OR Apache-2.0", "dependencies": { "@radix-ui/react-dialog": "^1.1.19", diff --git a/apps/shield-gui/package.json b/apps/shield-gui/package.json index fe8ecd8..9cb220a 100644 --- a/apps/shield-gui/package.json +++ b/apps/shield-gui/package.json @@ -1,6 +1,6 @@ { "name": "mocika-shield-gui", - "version": "1.10.1", + "version": "1.11.0", "license": "MIT OR Apache-2.0", "private": true, "type": "module", diff --git a/apps/shield-gui/src-tauri/Cargo.toml b/apps/shield-gui/src-tauri/Cargo.toml index a6f358c..74fd95c 100644 --- a/apps/shield-gui/src-tauri/Cargo.toml +++ b/apps/shield-gui/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mocika-shield" -version = "1.10.1" +version = "1.11.0" edition = "2021" license = "MIT OR Apache-2.0" publish = false diff --git a/apps/shield-gui/src-tauri/tauri.conf.json b/apps/shield-gui/src-tauri/tauri.conf.json index 80a8906..1efd413 100644 --- a/apps/shield-gui/src-tauri/tauri.conf.json +++ b/apps/shield-gui/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "https://schema.tauri.app/config/2", "productName": "Shellsmith", - "version": "1.10.1", + "version": "1.11.0", "identifier": "dev.mocika.shield-gui", "build": { "beforeDevCommand": "npm run dev -- --host 127.0.0.1", diff --git a/apps/shield-gui/src/hooks/use-about-page.ts b/apps/shield-gui/src/hooks/use-about-page.ts index ab321b8..a953600 100644 --- a/apps/shield-gui/src/hooks/use-about-page.ts +++ b/apps/shield-gui/src/hooks/use-about-page.ts @@ -9,7 +9,7 @@ type AppInfo = { }; const defaultAppInfo: AppInfo = { - version: "1.10.1", + version: "1.11.0", git_hash: "dev", build_date: "unknown", }; diff --git a/crates/shield-core/Cargo.toml b/crates/shield-core/Cargo.toml index 64e02b9..699a05a 100644 --- a/crates/shield-core/Cargo.toml +++ b/crates/shield-core/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "shield-core" -version = "1.10.1" +version = "1.11.0" edition = "2021" authors = ["MocikaDev"] license = "MIT OR Apache-2.0" diff --git a/shield-stub/compat/api19-rust/Cargo.lock b/shield-stub/compat/api19-rust/Cargo.lock index 7664992..0758511 100644 --- a/shield-stub/compat/api19-rust/Cargo.lock +++ b/shield-stub/compat/api19-rust/Cargo.lock @@ -242,7 +242,7 @@ checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98" [[package]] name = "mocikashield-api19" -version = "1.10.1" +version = "1.11.0" dependencies = [ "cc", "chacha20poly1305", diff --git a/shield-stub/compat/api19-rust/Cargo.toml b/shield-stub/compat/api19-rust/Cargo.toml index 350c4b9..9bdb790 100644 --- a/shield-stub/compat/api19-rust/Cargo.toml +++ b/shield-stub/compat/api19-rust/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mocikashield-api19" -version = "1.10.1" +version = "1.11.0" edition = "2021" license = "MIT OR Apache-2.0" build = "../../src/main/rust/build.rs" diff --git a/shield-stub/src/main/rust/Cargo.toml b/shield-stub/src/main/rust/Cargo.toml index c681729..8872a59 100644 --- a/shield-stub/src/main/rust/Cargo.toml +++ b/shield-stub/src/main/rust/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mocikashield" -version = "1.10.1" +version = "1.11.0" edition = "2021" license = "MIT OR Apache-2.0"