Skip to content

fix: resolve native keccak via Electron resourcesPath (5.1.1) - #26

Merged
AthrunArthur merged 1 commit into
YeeZTech:mainfrom
freeof123:fix/electron-keccak-native-resolve
Aug 12, 2026
Merged

fix: resolve native keccak via Electron resourcesPath (5.1.1)#26
AthrunArthur merged 1 commit into
YeeZTech:mainfrom
freeof123:fix/electron-keccak-native-resolve

Conversation

@freeof123

Copy link
Copy Markdown
Member

修复 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。

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>
@AthrunArthur
AthrunArthur merged commit c388855 into YeeZTech:main Aug 12, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants