Skip to content

Commit

Permalink
Merge branch 'master' into fix/hardened-runtime-opt-type
Browse files Browse the repository at this point in the history
  • Loading branch information
sethlu authored Nov 8, 2019
2 parents 24f413e + 4a47bba commit 8157085
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/test
/yarn.lock
/.*
3 changes: 2 additions & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ declare module "electron-osx-sign" {
'entitlements-inherit'?: string;
'gatekeeper-assess'?: boolean;
hardenedRuntime?: boolean;
'identity-validation'?: boolean;
ignore?: string;
'pre-auto-entitlements'?: boolean;
'pre-embed-provisioning-profile'?: boolean;
Expand All @@ -20,14 +21,14 @@ declare module "electron-osx-sign" {
'signature-size'?: number;
'type'?: string;
version?: string;
'identity-validation'?: boolean;
}

export function sign(opts: SignOptions, callback: (error: Error) => void): void;

export function signAsync(opts: SignOptions): Promise<any>;

interface FlatOptions extends BaseSignOptions {
'identity-validation'?: boolean;
install?: string;
pkg?: string;
scripts?: string;
Expand Down
15 changes: 11 additions & 4 deletions util-provisioning-profiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,21 @@ Object.defineProperty(ProvisioningProfile.prototype, 'type', {
* Returns a promise resolving to a ProvisioningProfile instance based on file.
* @function
* @param {string} filePath - Path to provisioning profile.
* @param {string} keychain - Keychain to use when unlocking provisioning profile.
* @returns {Promise} Promise.
*/
var getProvisioningProfileAsync = module.exports.getProvisioningProfileAsync = function (filePath) {
return execFileAsync('security', [
var getProvisioningProfileAsync = module.exports.getProvisioningProfileAsync = function (filePath, keychain = null) {
var securityArgs = [
'cms',
'-D', // Decode a CMS message
'-i', filePath // Use infile as source of data
])
]

if (keychain) {
securityArgs.push('-k', keychain)
}

return execFileAsync('security', securityArgs)
.then(function (result) {
var provisioningProfile = new ProvisioningProfile(filePath, plist.parse(result))
debuglog('Provisioning profile:', '\n',
Expand Down Expand Up @@ -144,7 +151,7 @@ module.exports.preEmbedProvisioningProfile = function (opts) {
if (opts['provisioning-profile'] instanceof ProvisioningProfile) {
return embedProvisioningProfile()
} else {
return getProvisioningProfileAsync(opts['provisioning-profile'])
return getProvisioningProfileAsync(opts['provisioning-profile'], opts['keychain'])
.then(function (provisioningProfile) {
opts['provisioning-profile'] = provisioningProfile
})
Expand Down

0 comments on commit 8157085

Please sign in to comment.