Skip to content

Commit

Permalink
review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
shiqi committed Sep 21, 2019
1 parent a0d0a4a commit aba7b48
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,8 @@ Default to `undefined`.

*** To be deprecated, see `signature-flags` *** Restrict dyld loading. See doc about this [code signature flag](https://developer.apple.com/documentation/security/seccodesignatureflags/kseccodesignaturerestrict?language=objc) for more details. Disabled by default.

`signature-flags` - *String*
comma separated string for [code signature flag](https://developer.apple.com/documentation/security/seccodesignatureflags?language=objc). Default is `underfined`
`signature-flags` - *String|String[]*
comma separated string or array for [code signature flag](https://developer.apple.com/documentation/security/seccodesignatureflags?language=objc). Default is `undefined`

`strict-verify` - *Boolean|String|Array.<String>*

Expand Down
2 changes: 1 addition & 1 deletion bin/electron-osx-sign-usage.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ DESCRIPTION
Flag to enable restrict mode. Disabled by default. (this will be deprecated soon, see --sign-flags)

--signature-flags=flags
code signature flags. Default to none
Code signature flags. Default to none.

--strict-verify, --strict-verify=options, --no-strict-verify
Flag to enable/disable ``--strict'' flag when verifying the signed application bundle.
Expand Down
16 changes: 10 additions & 6 deletions sign.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,16 +158,20 @@ function signApplicationAsync (opts) {
} else {
args.push('--timestamp')
}
var optionsArguments = []
let optionsArguments = []

if (opts['signature-flags']) {
var flags = opts['signature-flags'].split(',').map(function (flag) { return flag.trim() })
flags.forEach(element => {
optionsArguments.push(element)
})
if (Array.isArray(opts['signature-flags'])) {
optionsArguments = [...opts['signature-flags']]
} else {
const flags = opts['signature-flags'].split(',').map(function (flag) { return flag.trim() })
flags.forEach(element => {
optionsArguments.push(element)
})
}
}

if (opts.hardenedRuntime || opts['hardened-runtime' || optionsArguments.includes('runtime')]) {
if (opts.hardenedRuntime || opts['hardened-runtime'] || optionsArguments.includes('runtime')) {
// Hardened runtime since darwin 17.7.0 --> macOS 10.13.6
if (compareVersion(osRelease, '17.7.0') >= 0) {
optionsArguments.push('runtime')
Expand Down

0 comments on commit aba7b48

Please sign in to comment.