mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 12:10:49 +00:00
Try package downgrade
This commit is contained in:
parent
ae9bc8a75d
commit
35ab58c440
3 changed files with 11 additions and 28 deletions
17
build.js
17
build.js
|
|
@ -35,25 +35,8 @@ async function bundleSafeChain() {
|
|||
external: ["certifi"],
|
||||
});
|
||||
|
||||
// Post-process: Force node-forge to use pure JavaScript
|
||||
// This prevents segmentation faults in pkg binaries on Linux
|
||||
let bundledContent = await readFile("./build/bin/safe-chain.cjs", "utf-8");
|
||||
|
||||
// 1. Set the option to true
|
||||
bundledContent = bundledContent.replace(
|
||||
/usePureJavaScript:\s*false/g,
|
||||
"usePureJavaScript: true"
|
||||
);
|
||||
|
||||
// 2. Replace all checks that would enable native crypto
|
||||
// Change: if (!forge2.options.usePureJavaScript && ...)
|
||||
// To: if (false && ...)
|
||||
// This makes the native crypto branches unreachable
|
||||
bundledContent = bundledContent.replace(
|
||||
/!forge2\.options\.usePureJavaScript/g,
|
||||
"false"
|
||||
);
|
||||
|
||||
await writeFile("./build/bin/safe-chain.cjs", bundledContent);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue