fix: resolve native keccak via Electron resourcesPath (5.1.1) - #26
Merged
AthrunArthur merged 1 commit intoAug 12, 2026
Merged
Conversation
Packaged Electron apps often have cwd outside node_modules, so prefer app.asar.unpacked paths and warn clearly when falling back to JS keccak. Co-authored-by: Cursor <cursoragent@cursor.com>
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.
修复 Electron 安装包中 native keccak 因 process.cwd() 解析失败而静默回退纯 JS,导致加密吞吐大幅下降的问题。
createPackageRequire() 优先通过 process.resourcesPath/app.asar.unpacked/.../meta-encryptor 定位本包,不再依赖打包后常为 / 或安装目录的 cwd。
JS fallback 改为明确 warn,并带上 reason / cwd / resourcesPath,便于客户端日志确认实现选型。
版本 bump 至 5.1.1。