mirror of https://github.com/jackwener/wx-cli.git
fix: improve task_for_pid error message and document codesign steps
parent
0e2711dcf8
commit
e4bfc39c8f
14
README.md
14
README.md
|
|
@ -97,10 +97,22 @@ cargo build --release
|
||||||
**macOS**(需要先对微信做 ad-hoc 签名,才能扫描其内存)
|
**macOS**(需要先对微信做 ad-hoc 签名,才能扫描其内存)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo codesign --force --deep --sign - /Applications/WeChat.app
|
# 1. 签名(只需做一次,WeChat 更新后重做)
|
||||||
|
codesign --force --deep --sign - /Applications/WeChat.app
|
||||||
|
|
||||||
|
# 2. 重启微信,等待完全登录
|
||||||
|
killall WeChat && open /Applications/WeChat.app
|
||||||
|
|
||||||
|
# 3. 初始化
|
||||||
sudo wx init
|
sudo wx init
|
||||||
```
|
```
|
||||||
|
|
||||||
|
> 如果 `codesign` 报 `signature in use`,先执行:
|
||||||
|
> ```bash
|
||||||
|
> codesign --remove-signature "/Applications/WeChat.app/Contents/Frameworks/vlc_plugins/librtp_mpeg4_plugin.dylib"
|
||||||
|
> codesign --force --deep --sign - /Applications/WeChat.app
|
||||||
|
> ```
|
||||||
|
|
||||||
**Linux**
|
**Linux**
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|
|
||||||
27
SKILL.md
27
SKILL.md
|
|
@ -47,14 +47,35 @@ wx --version
|
||||||
|
|
||||||
## 初始化(首次使用,只需一次)
|
## 初始化(首次使用,只需一次)
|
||||||
|
|
||||||
**macOS** — 微信需要 ad-hoc 签名才能被扫描内存:
|
### macOS(必须按顺序执行)
|
||||||
|
|
||||||
|
**第一步:对 WeChat 重新签名**(只需做一次,WeChat 更新后需重做)
|
||||||
|
|
||||||
|
```bash
|
||||||
|
codesign --force --deep --sign - /Applications/WeChat.app
|
||||||
|
```
|
||||||
|
|
||||||
|
如果报错 `signature in use` 或某个 dylib 签名损坏,先修复再签名:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
codesign --remove-signature "/Applications/WeChat.app/Contents/Frameworks/vlc_plugins/librtp_mpeg4_plugin.dylib"
|
||||||
|
codesign --force --deep --sign - /Applications/WeChat.app
|
||||||
|
```
|
||||||
|
|
||||||
|
**第二步:重启 WeChat**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
killall WeChat && open /Applications/WeChat.app
|
||||||
|
# 等待微信完全登录后再继续
|
||||||
|
```
|
||||||
|
|
||||||
|
**第三步:初始化**
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo codesign --force --deep --sign - /Applications/WeChat.app
|
|
||||||
sudo wx init
|
sudo wx init
|
||||||
```
|
```
|
||||||
|
|
||||||
**Linux**:
|
### Linux
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo wx init
|
sudo wx init
|
||||||
|
|
|
||||||
|
|
@ -110,7 +110,20 @@ pub fn scan_keys(db_dir: &Path) -> Result<Vec<KeyEntry>> {
|
||||||
let kr = task_for_pid(mach_task_self(), pid, &mut task);
|
let kr = task_for_pid(mach_task_self(), pid, &mut task);
|
||||||
if kr != KERN_SUCCESS {
|
if kr != KERN_SUCCESS {
|
||||||
bail!(
|
bail!(
|
||||||
"task_for_pid 失败 (kr={})\n请确认:(1) 以 root 运行 (2) WeChat 已 ad-hoc 签名",
|
"task_for_pid 失败 (kr={})。请按以下步骤修复:\n\
|
||||||
|
\n\
|
||||||
|
1. 对 WeChat 重新签名(只需做一次):\n\
|
||||||
|
codesign --force --deep --sign - /Applications/WeChat.app\n\
|
||||||
|
\n\
|
||||||
|
2. 重启 WeChat:\n\
|
||||||
|
killall WeChat && open /Applications/WeChat.app\n\
|
||||||
|
\n\
|
||||||
|
3. 再次运行(需要 root):\n\
|
||||||
|
sudo wx init\n\
|
||||||
|
\n\
|
||||||
|
如果 codesign 报 \"signature in use\",先执行:\n\
|
||||||
|
codesign --remove-signature /Applications/WeChat.app/Contents/Frameworks/vlc_plugins/librtp_mpeg4_plugin.dylib\n\
|
||||||
|
codesign --force --deep --sign - /Applications/WeChat.app",
|
||||||
kr
|
kr
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue