Skip to content

Commit

Permalink
Possibly a working osx signing
Browse files Browse the repository at this point in the history
  • Loading branch information
mayfield committed Dec 14, 2022
1 parent 5b7f472 commit e4e722f
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
27 changes: 27 additions & 0 deletions build/scripts/patch-sign.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/* Remove these hacks when this bug is fixed
* https://github.com/electron-userland/electron-builder/issues/7317
*/

exports.default = async function patchSign(context) {
if (context.electronPlatformName !== 'darwin') {
return;
}
const asoSave = context.packager.adjustSignOptions;
if (asoSave.patched) {
return;
}
console.log("Applying adjustSignOptions hack");
context.packager.adjustSignOptions = async function(signOptions, masOptions) {
await asoSave.call(this, signOptions, masOptions);
if (typeof signOptions.identity === 'object' && signOptions.identity.name) {
console.warn("Applying signOptions hack for signing identity.");
signOptions.identity = signOptions.identity.name;
}
if (signOptions['identity-validation'] != undefined) {
console.warn("Applying identity validation hack.");
signOptions.identityValidation = signOptions['identity-validation'];
delete signOptions['identity-validation'];
}
};
context.packager.adjustSignOptions.patched = true;
};
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@
"universal"
]
},
"notarize": false,
"category": "public.app-category.healthcare-fitness",
"identity": "Sauce, LLC (7P47F44SKP)",
"hardenedRuntime": true,
Expand All @@ -127,6 +128,7 @@
"target": "AppImage",
"category": "Game"
},
"afterPack": "build/scripts/patch-sign.js",
"afterSign": "build/scripts/notarize.js"
}
}

0 comments on commit e4e722f

Please sign in to comment.