File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ const { execSync } = require ( "child_process" ) ;
2+ const path = require ( "path" ) ;
3+
4+ // electron-builder v26 no longer re-signs bundled frameworks when no certificate is
5+ // provided. The Electron Framework ships pre-signed with the Electron project's Apple
6+ // Team ID, causing macOS 26+ to reject the load because the main executable has no
7+ // Team ID. Re-sign everything with ad-hoc ("-") so all binaries share a consistent
8+ // (empty) Team ID and dyld's validation passes.
9+ //
10+ // This must be afterSign (not afterPack) for --universal builds: afterPack fires once
11+ // per arch on the temporary per-arch outputs before @electron/universal merges them.
12+ // Re-signing those temps makes CodeResources differ between architectures, causing the
13+ // merge to fail with "non-binary files have different SHAs". afterSign fires once on
14+ // the final merged universal .app, after the merge succeeds.
15+ exports . default = async function afterSignMac ( context ) {
16+ if ( context . electronPlatformName !== "darwin" ) return ;
17+
18+ const appPath = path . join ( context . appOutDir , `${ context . packager . appInfo . productFilename } .app` ) ;
19+
20+ console . log ( `[afterSignMac] Ad-hoc re-signing for macOS 26+ Team ID compatibility:` ) ;
21+ console . log ( `[afterSignMac] ${ appPath } ` ) ;
22+
23+ execSync ( `codesign --force --deep --sign - "${ appPath } "` , { stdio : "inherit" } ) ;
24+
25+ console . log ( `[afterSignMac] Done.` ) ;
26+ } ;
Original file line number Diff line number Diff line change @@ -12,8 +12,11 @@ module.exports = {
1212 } ,
1313 appId : "com.stereum.launcher" ,
1414 productName : "Stereum-Launcher" ,
15- ...( shouldNotarize ? { afterSign : "@sapien99/vue-cli-plugin-electron-builder-notarize" } : { } ) ,
16- ...( ! isSigned ? { afterPack : "./afterPackMac.js" } : { } ) ,
15+ ...( shouldNotarize
16+ ? { afterSign : "@sapien99/vue-cli-plugin-electron-builder-notarize" }
17+ : ! isSigned
18+ ? { afterSign : "./afterSignMac.js" }
19+ : { } ) ,
1720 buildDependenciesFromSource : false ,
1821 nodeGypRebuild : false ,
1922 npmRebuild : false ,
You can’t perform that action at this time.
0 commit comments