From e4e722f07573d75ddd7bef63b24b7650e5ea4011 Mon Sep 17 00:00:00 2001 From: Justin Mayfield Date: Wed, 14 Dec 2022 04:34:39 -0700 Subject: [PATCH] Possibly a working osx signing --- build/scripts/patch-sign.js | 27 +++++++++++++++++++++++++++ package.json | 2 ++ 2 files changed, 29 insertions(+) create mode 100644 build/scripts/patch-sign.js diff --git a/build/scripts/patch-sign.js b/build/scripts/patch-sign.js new file mode 100644 index 00000000..f8696987 --- /dev/null +++ b/build/scripts/patch-sign.js @@ -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; +}; diff --git a/package.json b/package.json index d2a8fb0b..8617f999 100644 --- a/package.json +++ b/package.json @@ -116,6 +116,7 @@ "universal" ] }, + "notarize": false, "category": "public.app-category.healthcare-fitness", "identity": "Sauce, LLC (7P47F44SKP)", "hardenedRuntime": true, @@ -127,6 +128,7 @@ "target": "AppImage", "category": "Game" }, + "afterPack": "build/scripts/patch-sign.js", "afterSign": "build/scripts/notarize.js" } }