mirror of https://github.com/jackwener/wx-cli.git
review: stop overstating the trade-off and condition the init warning
Per codex review on PR #64: 1. src/cli/init.rs warning was unconditional but the wording presumed the user had taken the ad-hoc re-sign path. If init goes through the tier 2 path (Apple-signed WeChat + GUI Terminal + Developer Tools TCC authorization), the warning would mis-fire. Reword conditionally and point to the GitHub URL of the doc instead of a relative path that release-binary / npm-installed users won't have on disk. 2. docs/macos-permission-guide.md §六 and the matching README callout said "restoring official WeChat = giving up macOS memory-scan". This contradicts the same guide's §一 实测表 which shows "Apple 签名 + 本机 Terminal sudo = ✅". Restoring the official signature only gives up the default re-sign path; the local-Terminal + Developer-Tools route still works on Apple-signed WeChat. Only SSH + Apple-signed WeChat actually requires re-signing.pull/64/head
parent
66d63e36a1
commit
84a3108df3
|
|
@ -121,7 +121,7 @@ sudo wx init
|
|||
>
|
||||
> 重签名后 macOS 的 TCC 隐私授权按新 code signature 重新校验,旧记录会失效。如果跳过 `tccutil reset`,微信截图/视频通话/麦克风等权限可能"看起来已开启但实际拒绝"。详见 [macOS 权限与签名指南](docs/macos-permission-guide.md#五重签名后微信权限-silent-失效)。
|
||||
|
||||
> **副作用提示**:完成上面的 ad-hoc 重签后,macOS 会比较频繁地弹 `"微信" 想访问其他 App 的数据`(在微信里打开公众号文章时尤其容易触发)。这是当前 macOS invasive init 路径的已知副作用:重签后 WeChat 的 code identity 变了,它再访问自己原来的 container / 缓存数据会被系统识别为"跨 App 访问"。点"允许"通常只是放行当前 WeChat 进程;想彻底不弹得恢复官方 WeChat(代价是这条 macOS memory-scan init 会失效)。详见 [macOS 权限与签名指南 §六](docs/macos-permission-guide.md#六微信-想访问其他-app-的数据-弹窗)。
|
||||
> **副作用提示**:完成上面的 ad-hoc 重签后,macOS 会比较频繁地弹 `"微信" 想访问其他 App 的数据`(在微信里打开公众号文章时尤其容易触发)。这是当前 macOS invasive init 路径的已知副作用:重签后 WeChat 的 code identity 变了,它再访问自己原来的 container / 缓存数据会被系统识别为"跨 App 访问"。点"允许"通常只是放行当前 WeChat 进程;想彻底不弹得恢复官方 WeChat——这只放弃**当前依赖重签的默认路径**,**不等于放弃 memory-scan**:在本机 GUI Terminal 下、Terminal.app 拿到「开发者工具」TCC 授权后,对 Apple 官方签名的 WeChat 仍可以走通;只有 SSH 远程 + Apple 签名 WeChat 这种组合才必须重签。详见 [macOS 权限与签名指南 §六](docs/macos-permission-guide.md#六微信-想访问其他-app-的数据-弹窗)。
|
||||
|
||||
**Linux**
|
||||
|
||||
|
|
|
|||
|
|
@ -311,10 +311,10 @@ codesign --force --deep --sign - /Applications/WeChat.app
|
|||
- 点"允许"通常只是放行**当前这次** WeChat 进程;下一次 WeChat 启动权限会 reset,可能还会再弹
|
||||
- 该授权一般不会在 System Settings 里留下显式开关,因为它绑定的是动态的 code identity
|
||||
|
||||
彻底不弹(代价是放弃 macOS memory-scan):
|
||||
- 把 `/Applications/WeChat.app` 恢复成官方签名(重装官方 WeChat 包)
|
||||
- 不再执行 `codesign --force --deep --sign -`
|
||||
- 后果:`task_for_pid` 在 Apple 签名的 hardened runtime 下会失败,当前 macOS 这条「扫内存提取 raw key」的 init 路径就用不了
|
||||
彻底不弹:
|
||||
- 把 `/Applications/WeChat.app` 恢复成官方签名(重装官方 WeChat 包),不再执行 `codesign --force --deep --sign -`
|
||||
- 这一步只是放弃**当前依赖 ad-hoc 重签的默认路径**,并不等于放弃 macOS memory-scan:在本机 GUI Terminal 下、对 Terminal.app 授予「开发者工具」TCC 权限后,`task_for_pid` 对 Apple 官方签名(hardened runtime)的 WeChat 仍能走通——参考 §一 实测表里的"Apple 签名 + 本机 Terminal sudo = ✅"
|
||||
- 真正受限的场景是 SSH 远程 + Apple 签名 WeChat:`sshd` 拿不到 TCC 开发者工具授权,这时才必须走重签路径
|
||||
|
||||
长期方向:
|
||||
- 这条副作用的真正修复是改造 macOS 端 init,让它不再修改 `/Applications/WeChat.app`。在那之前,这是已知 trade-off。
|
||||
- 这条副作用的真正修复是把 `wx init` 重新设计成 `safe → assisted → invasive fallback` 三层:默认不动 WeChat,只有在前两条都不可行时才走 ad-hoc 重签,并先打出完整副作用清单让用户显式确认。在那之前,这是已知 trade-off。
|
||||
|
|
|
|||
|
|
@ -101,10 +101,13 @@ pub fn cmd_init(force: bool) -> Result<()> {
|
|||
{
|
||||
eprintln!();
|
||||
eprintln!("⚠️ macOS 副作用提示:");
|
||||
eprintln!(" 你刚才对 /Applications/WeChat.app 做过 ad-hoc 重签,之后 macOS 可能");
|
||||
eprintln!(" 弹 \"微信\" 想访问其他 App 的数据(在微信里打开公众号文章时尤其常见)。");
|
||||
eprintln!(" 这是当前 macOS invasive init 路径的已知副作用,不是 wx-cli 在读其他 App 数据。");
|
||||
eprintln!(" 详见 docs/macos-permission-guide.md 第六节。");
|
||||
eprintln!(" 如果你是通过对 /Applications/WeChat.app 做 ad-hoc 重签来让 init 走通的,");
|
||||
eprintln!(" 之后 macOS 可能弹 \"微信\" 想访问其他 App 的数据(在微信里打开公众号文章");
|
||||
eprintln!(" 时尤其常见)。这是 ad-hoc 重签后 WeChat 的 code identity 变了导致的,");
|
||||
eprintln!(" 不是 wx-cli 在读其他 App 数据。");
|
||||
eprintln!(" 完整说明:https://github.com/jackwener/wx-cli/blob/main/docs/macos-permission-guide.md#六微信-想访问其他-app-的数据-弹窗");
|
||||
eprintln!(" (如果你的 WeChat 仍是 Apple 官方签名、init 是靠 GUI Terminal + 开发者工具");
|
||||
eprintln!(" 授权走通的,则不会出现这个弹窗,可以忽略本提示。)");
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
|
|
|||
Loading…
Reference in New Issue