Skip to content

Commit

Permalink
Notarize after code signing
Browse files Browse the repository at this point in the history
  • Loading branch information
Rokt33r committed Dec 21, 2020
1 parent 03b7692 commit e16b08e
Show file tree
Hide file tree
Showing 4 changed files with 101 additions and 1 deletion.
35 changes: 35 additions & 0 deletions build-utils/afterSignHook.js
@@ -0,0 +1,35 @@
/* eslint-disable @typescript-eslint/no-var-requires */
const fs = require('fs')
const path = require('path')
const electron_notarize = require('electron-notarize')

module.exports = async function (params) {
if (process.platform !== 'darwin') {
return
}

const appId = 'com.boostio.boostnote'

const appPath = path.join(
params.appOutDir,
`${params.packager.appInfo.productFilename}.app`
)
if (!fs.existsSync(appPath)) {
throw new Error(`Cannot find application at: ${appPath}`)
}

console.log(`Notarizing ${appId} found at ${appPath}`)

try {
await electron_notarize.notarize({
appBundleId: appId,
appPath: appPath,
appleId: process.env.APPLE_ID,
appleIdPassword: process.env.APPLE_ID_PASSWORD,
})
} catch (error) {
console.error(error)
}

console.log(`Done notarizing ${appId}`)
}
12 changes: 12 additions & 0 deletions macOs/entitlements.mac.plist
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.cs.allow-jit</key>
<true/>
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
<true/>
<key>com.apple.security.cs.allow-dyld-environment-variables</key>
<true/>
</dict>
</plist>
48 changes: 48 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion package.json
Expand Up @@ -88,6 +88,7 @@
"css-loader": "^3.2.0",
"electron": "^10.1.5",
"electron-builder": "^22.8.1",
"electron-notarize": "^1.0.0",
"env-cmd": "^10.0.1",
"error-overlay-webpack-plugin": "^0.4.1",
"eslint": "^6.4.0",
Expand Down Expand Up @@ -185,8 +186,12 @@
"app": "electron"
},
"asar": false,
"afterSign": "build-utils/afterSignHook.js",
"mac": {
"icon": "static/icon.icns"
"icon": "static/icon.icns",
"hardenedRuntime": true,
"entitlementsInherit": "macOs/entitlements.mac.plist",
"entitlements": "macOs/entitlements.mac.plist"
},
"linux": {
"icon": "static/icon.icns",
Expand Down

0 comments on commit e16b08e

Please sign in to comment.