Notarize app on macOS

Change-type: patch
Changelog-entry: Notarize app on macOS
This commit is contained in:
Lorenzo Alberto Maria Ambrosi 2019-10-18 19:18:30 +02:00 committed by Alexis Svinartchouk
parent 6fd696546c
commit c4944f31d6
7 changed files with 758 additions and 376 deletions

1
.gitattributes vendored
View File

@ -26,6 +26,7 @@ Makefile text
*.patch text *.patch text
*.txt text *.txt text
CODEOWNERS text CODEOWNERS text
*.plist text
# Binary files (no line-ending conversions) # Binary files (no line-ending conversions)
*.bz2 binary diff=hex *.bz2 binary diff=hex

View File

@ -78,8 +78,12 @@
"node_modules/roboto-fontface/fonts/roboto/Roboto-Medium.woff", "node_modules/roboto-fontface/fonts/roboto/Roboto-Medium.woff",
"node_modules/roboto-fontface/fonts/roboto/Roboto-Bold.woff" "node_modules/roboto-fontface/fonts/roboto/Roboto-Bold.woff"
], ],
"afterSign": "./afterSignHook.js",
"mac": { "mac": {
"category": "public.app-category.developer-tools" "category": "public.app-category.developer-tools",
"hardenedRuntime": true,
"entitlements": "entitlements.mac.plist",
"entitlementsInherit": "entitlements.mac.plist"
}, },
"dmg": { "dmg": {
"iconSize": 110, "iconSize": 110,

22
afterSignHook.js Normal file
View File

@ -0,0 +1,22 @@
'use strict'
const { notarize } = require('electron-notarize')
async function main(context) {
const { electronPlatformName, appOutDir } = context
if (electronPlatformName !== 'darwin') {
return
}
const appName = context.packager.appInfo.productFilename
const appleId = 'accounts+apple@balena.io'
await notarize({
appBundleId: 'io.balena.etcher',
appPath: `${appOutDir}/${appName}.app`,
appleId,
appleIdPassword: `@keychain:Application Loader: ${appleId}`
})
}
exports.default = main

View File

@ -14,6 +14,9 @@ files:
mac: mac:
icon: assets/icon.icns icon: assets/icon.icns
category: public.app-category.developer-tools category: public.app-category.developer-tools
hardenedRuntime: true
entitlements: "entitlements.mac.plist"
entitlementsInherit: "entitlements.mac.plist"
dmg: dmg:
background: assets/dmg/background.tiff background: assets/dmg/background.tiff
icon: assets/icon.icns icon: assets/icon.icns

18
entitlements.mac.plist Normal file
View File

@ -0,0 +1,18 @@
<?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/>
<key>com.apple.security.device.usb</key>
<true/>
<key>com.apple.security.files.user-selected.read-only</key>
<true/>
<key>com.apple.security.network.client</key>
<true/>
</dict>
</plist>

1079
npm-shrinkwrap.json generated

File diff suppressed because it is too large Load Diff

View File

@ -92,8 +92,9 @@
"babel-loader": "^8.0.4", "babel-loader": "^8.0.4",
"chalk": "^1.1.3", "chalk": "^1.1.3",
"electron": "3.1.9", "electron": "3.1.9",
"electron-builder": "^20.40.2", "electron-builder": "^20.44.4",
"electron-mocha": "^6.0.4", "electron-mocha": "^6.0.4",
"electron-notarize": "^0.1.1",
"eslint": "^4.17.0", "eslint": "^4.17.0",
"eslint-config-standard": "^10.2.1", "eslint-config-standard": "^10.2.1",
"eslint-plugin-import": "^2.9.0", "eslint-plugin-import": "^2.9.0",