From eb0c0f1a9fc06d05ea0ecaa9361e0beb49eee68e Mon Sep 17 00:00:00 2001 From: haoyuren <13851610112@163.com> Date: Fri, 13 Mar 2026 16:00:14 -0500 Subject: Fix DMG code signing with afterPack re-sign hook Co-Authored-By: Claude Opus 4.6 --- electron-builder.yml | 2 ++ scripts/afterPack.js | 9 +++++++++ 2 files changed, 11 insertions(+) create mode 100644 scripts/afterPack.js diff --git a/electron-builder.yml b/electron-builder.yml index 5d1d3b4..991af70 100644 --- a/electron-builder.yml +++ b/electron-builder.yml @@ -25,8 +25,10 @@ files: - node_modules/binary-extensions/**/* asarUnpack: - node_modules/node-pty/**/* +afterPack: ./scripts/afterPack.js mac: icon: resources/icon.icns + identity: null target: - dmg category: public.app-category.productivity diff --git a/scripts/afterPack.js b/scripts/afterPack.js new file mode 100644 index 0000000..979ba14 --- /dev/null +++ b/scripts/afterPack.js @@ -0,0 +1,9 @@ +const { execSync } = require('child_process') +const path = require('path') + +exports.default = async function (context) { + if (context.electronPlatformName !== 'darwin') return + const appPath = path.join(context.appOutDir, `${context.packager.appInfo.productFilename}.app`) + console.log(`Re-signing ${appPath}`) + execSync(`codesign --force --deep --sign - "${appPath}"`) +} -- cgit v1.2.3