From 0833b379bacdd0ae8c39c8bfdc8951ff69b5c69b Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Mon, 3 Feb 2025 10:48:32 +0000 Subject: [PATCH 1/2] Fix strictVerify not working with true value And extend it to support string-specified restrictions --- src/sign.ts | 4 ++-- src/types.ts | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/sign.ts b/src/sign.ts index 576ac6e..615f07a 100644 --- a/src/sign.ts +++ b/src/sign.ts @@ -78,8 +78,8 @@ async function verifySignApplication (opts: ValidatedSignOptions) { opts.strictVerify !== false && compareVersion(osRelease, '15.0.0') >= 0 // Strict flag since darwin 15.0.0 --> OS X 10.11.0 El Capitan ? [ '--strict' + - (opts.strictVerify - ? '=' + opts.strictVerify // Array should be converted to a comma separated string + (opts.strictVerify !== true + ? '=' + opts.strictVerify : '') ] : [], diff --git a/src/types.ts b/src/types.ts index 3c32d2b..c57bc6d 100644 --- a/src/types.ts +++ b/src/types.ts @@ -174,10 +174,11 @@ export type OnlySignOptions = { provisioningProfile?: string; /** * Flag to enable/disable the `--strict` flag when verifying the signed application bundle. + * Also supports string values to specify which strict restrictions to use, see codesign man page for supported values. * * @defaultValue `true` */ - strictVerify?: boolean; + strictVerify?: boolean | string; /** * Type of certificate to use when signing a MAS app. * @defaultValue `"distribution"` From 86a3b7f02eed3eef9bc9f6f453be2e5d40f30b60 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 26 Feb 2025 09:35:11 +0000 Subject: [PATCH 2/2] Fix handling of `strictVerify=undefined` --- src/sign.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/sign.ts b/src/sign.ts index 615f07a..a25c40b 100644 --- a/src/sign.ts +++ b/src/sign.ts @@ -72,15 +72,14 @@ async function verifySignApplication (opts: ValidatedSignOptions) { // Verify with codesign debugLog('Verifying application bundle with codesign...'); + const strictVerify = opts.strictVerify !== undefined ? opts.strictVerify : true; await execFileAsync( 'codesign', ['--verify', '--deep'].concat( - opts.strictVerify !== false && compareVersion(osRelease, '15.0.0') >= 0 // Strict flag since darwin 15.0.0 --> OS X 10.11.0 El Capitan + strictVerify !== false && compareVersion(osRelease, '15.0.0') >= 0 // Strict flag since darwin 15.0.0 --> OS X 10.11.0 El Capitan ? [ '--strict' + - (opts.strictVerify !== true - ? '=' + opts.strictVerify - : '') + (strictVerify !== true ? '=' + strictVerify : '') ] : [], ['--verbose=2', opts.app]