Skip to content

Commit

Permalink
fix: App rejected when Mac Developer certificate is in keychain
Browse files Browse the repository at this point in the history
  • Loading branch information
develar committed Nov 11, 2016
1 parent 5c39d67 commit a034706
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 4 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,11 @@ Default to system default keychain.
Regex or function that signals ignoring a file before signing.
Default to `undefined`.

`gatekeeper-assess` - *Boolean*

Flag to enable Gatekeeper assessment after signing the app. Disabling it is useful for signing with self-signed certificates.
Gatekeeper assessment is enabled by default.

`platform` - *String*

Build platform of Electron.
Expand Down
4 changes: 4 additions & 0 deletions bin/electron-osx-sign-usage.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ DESCRIPTION
The keychain name.
Default to system default keychain.

--gatekeeper-assess, --no-gatekeeper-assess
Flag to enable Gatekeeper assessment after signing the app. Disabling it is useful for signing with self-signed certificates.
Gatekeeper assessment is enabled by default.

--platform=platform
Build platform of Electron.
Allowed values: ``darwin'', ``mas''.
Expand Down
6 changes: 4 additions & 2 deletions bin/electron-osx-sign.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ var args = require('minimist')(process.argv.slice(2), {
'boolean': [
'help',
'pre-auto-entitlements',
'pre-embed-provisioning-profile'
'pre-embed-provisioning-profile',
'gatekeeper-assess'
],
'default': {
'pre-auto-entitlements': true,
'pre-embed-provisioning-profile': true
'pre-embed-provisioning-profile': true,
'gatekeeper-assess': true
}
})
var usage = fs.readFileSync(path.join(__dirname, 'electron-osx-sign-usage.txt')).toString()
Expand Down
1 change: 1 addition & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ declare module "electron-macos-sign" {
binaries?: string[];
entitlements?: string;
'entitlements-inherit'?: string;
'gatekeeper-check'?: boolean;
}

export function sign(opts: SignOptions, callback: (error: Error) => void): void;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "electron-macos-sign",
"version": "1.2.1",
"version": "1.2.3",
"description": "Codesign Electron macOS apps",
"main": "index.js",
"files": ["bin", "*.js", "*.d.ts", "*.plist"],
Expand Down
2 changes: 1 addition & 1 deletion sign.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ function verifySignApplicationAsync (opts) {
])

// Additionally test Gatekeeper acceptance for darwin platform
if (opts.platform === 'darwin') {
if (opts.platform === 'darwin' && opts['gatekeeper-assess'] !== false) {
promise = promise
.then(function () {
debuglog('Verifying Gatekeeper acceptance for darwin platform...')
Expand Down

0 comments on commit a034706

Please sign in to comment.