See [Configuration Reference](https://cli.vuejs.org/config/).
## Sign and Notarize
-Running notarize.js will sign and notarize the app. Further information is in that file.
+
+Prerequisites:
+* Apple Developer Account ($99)
+* Valid Apple Developer ID Application Certificate on keychain
+
+Clear debris from app before signing:
+
+ xattr -cr Electron.app
+
+Sign and Notarize:
+
+ node notarize.js
+
+Debug electron-osx-sign:
+
+ export DEBUG=electron-osx-sign*
+
+### Some things to note:
+
+#### Gatekeeper Assess
+Electron-osx-sign seems to have a bug where the sign will fail if "gatekeeper-assess" is true (default).
+
+#### Entitlements.plist
+Not to be confused with Info.plist, this file specifies entitlements the app can have in hardened runtime (e.g. Can I use the microphone?). Only including the ones Electron reccommends seems to work (including audio of course and omitting allow-unsigned-executable-memory).
+
+#### The Benifit of Electron OSX Sign
+Without this package, we would have to manually go in and figure out how to sign each level of the app. While it didn't work out of the box (gatekeeper-assess) it's proven to be good otherwise. However, there is a bug where it puts multiple runtime flags on each command - not catastrophic though.
+
+#### Apple Password
+This must be an app specific password, not your normal Apple ID password.
+
+#### --Signiture-Flags OSX Sign
+Not exactly sure what this does or why its important, but Electron includes it.
+const exec = require('child_process').exec;
const sign = require("electron-osx-sign").signAsync;
const notarize = require("electron-notarize").notarize;
-const path = __dirname + "/Electron.app/Contents/Resources/app/node_modules";
+const app = "Electron.app";
-const addons = [
- `${path}/@crimata/nodeaudio/build/Release/libportaudio.dylib`,
- `${path}/@crimata/nodeaudio/build/Release/nodeAudio.node`
-];
+const runShellCommand = (cmd) => (new Promise((resolve, reject) => {
+ exec(cmd, (error, stdout, stderr) => {
+ error ? reject(stderr) : resolve(stdout);
+ });
+}));
const signConfig = {
- "app": "Electron.app",
- "platform": "darwin",
- "binaries": addons,
+ "app": app,
"hardened-runtime": true,
+ "gatekeeper-assess": false,
+ "signature-flags": "library",
"entitlements": "entitlements.plist",
"entitlements-inherit": "entitlements.plist",
- "signature-flags": "library",
- "gatekeeper-assess": false
};
const notarizeConfig = {
- appBundleId: "com.github.Electron",
- appPath: "Electron.app",
+ appPath: app,
appleId: "gundersena@crimata.com",
- appleIdPassword: "wdeb-cbcq-rujb-ldgo"
+ appBundleId: "com.github.Electron",
+ appleIdPassword: process.env["AC_PASSWORD"]
};
(async function () {
try
{
+ console.log("Cleaning App...");
+ await runShellCommand(`xattr -cr ${app}`);
+
+ console.log("Signing...");
await sign(signConfig);
+
console.log("Notarizing...");
await notarize(notarizeConfig);
}
}
})();
-
-/* Clear debris from .app before running or it will complain:
- * xattr -cr Electron.app
- *
- * Paste this in terminal to debug electron-osx-sign:
- * export DEBUG=electron-osx-sign*
- *
- * Some important things to note:
- * - In order to notarize, you need a valid Apple Developer ID Application * Certificate.
- * - All flags in current signing config are required for notarization (to
- * my knowledge).
- */
\ No newline at end of file