-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1835 from webtorrent/osx-notarize
Add macOS Notarization
- Loading branch information
Showing
3 changed files
with
37 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.debugger</key> | ||
<true/> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -266,6 +266,7 @@ function buildDarwin (cb) { | |
|
||
function signApp (cb) { | ||
const sign = require('electron-osx-sign') | ||
const { notarize } = require('electron-notarize') | ||
|
||
/* | ||
* Sign the app with Apple Developer ID certificates. We sign the app for 2 reasons: | ||
|
@@ -281,16 +282,37 @@ function buildDarwin (cb) { | |
* - Membership in the Apple Developer Program | ||
*/ | ||
const signOpts = { | ||
verbose: true, | ||
app: appPath, | ||
platform: 'darwin', | ||
verbose: true | ||
identity: 'Developer ID Application: WebTorrent, LLC (5MAMC8G3L8)', | ||
hardenedRuntime: true, | ||
entitlements: path.join(config.ROOT_PATH, 'bin', 'darwin-entitlements.plist'), | ||
'entitlements-inherit': path.join(config.ROOT_PATH, 'bin', 'darwin-entitlements.plist'), | ||
'signature-flags': 'library' | ||
} | ||
|
||
const notarizeOpts = { | ||
appBundleId: darwin.appBundleId, | ||
appPath, | ||
appleId: '[email protected]', | ||
appleIdPassword: '@keychain:AC_PASSWORD' | ||
} | ||
|
||
console.log('Mac: Signing app...') | ||
sign(signOpts, function (err) { | ||
if (err) return cb(err) | ||
console.log('Mac: Signed app.') | ||
cb(null) | ||
|
||
console.log('Mac: Notarizing app...') | ||
notarize(notarizeOpts).then( | ||
function () { | ||
console.log('Mac: Notarized app.') | ||
cb(null) | ||
}, | ||
function (err) { | ||
cb(err) | ||
}) | ||
}) | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters