Skip to content

Commit cc123e6

Browse files
committed
Resign node binary on macOS
1 parent 5a2d00b commit cc123e6

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

gui/standalone-tests.ts

+11-1
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,16 @@ function extract() {
3737
function createSealessNode() {
3838
const nodeBin = path.join(tmpDir, 'node');
3939

40+
fs.copyFileSync(process.argv[0], nodeBin);
41+
4042
// Find and disable SEA fuse in node binary
4143
const fuseString = 'NODE_SEA_FUSE_' + 'fce680ab2cc467b6e072b8b5df1996b2:';
4244

43-
let buf = fs.readFileSync(process.argv[0]);
45+
if (process.platform === 'darwin') {
46+
child_process.spawnSync('/usr/bin/codesign', ['--remove-signature', nodeBin]);
47+
}
48+
49+
let buf = fs.readFileSync(nodeBin);
4450
const fuseIndex = buf.indexOf(fuseString);
4551

4652
if (fuseIndex !== -1) {
@@ -53,6 +59,10 @@ function createSealessNode() {
5359
}
5460
}
5561

62+
if (process.platform === 'darwin') {
63+
child_process.spawnSync('/usr/bin/codesign', ['--sign', '-', nodeBin]);
64+
}
65+
5666
return nodeBin;
5767
}
5868

0 commit comments

Comments
 (0)