-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Open
Conversation
非 root 运行是 kr=5 最常见原因,先提示加 sudo; 仅当已是 root 仍失败(SIP 开启 + 官方签名)才提示 codesign 重签。 原提示无脑让用户重签,对关闭 SIP 的用户是误导。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
wx init抓密钥时若task_for_pid失败(kr=5),无论什么原因都提示用户去codesign重签微信。但 kr=5 (KERN_FAILURE) 最常见的原因是没加 sudo ——
task_for_pid读取其他进程内存始终需要 root,这跟签名/SIP 无关。对于已关闭 SIP 的用户,重签完全没必要,他们只是缺一个sudo,旧提示是误导。改动
在
src/scanner/macos.rs里按geteuid()分流:sudo wx init(最常见情形),并附注「若已 sudo 仍失败才是 SIP+签名问题」。验证
cargo build通过。wx init --force现在正确显示「请改用 sudo 重新运行」。