From 89ea93eadc7f79d01f8fcfa91c316dc8b3dc470a Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Fri, 22 Nov 2024 02:30:04 +0800 Subject: [PATCH] Skip main executable during first binary codesign round Signed-off-by: Claudio Cambra --- admin/osx/mac-crafter/Sources/Utils/Codesign.swift | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/admin/osx/mac-crafter/Sources/Utils/Codesign.swift b/admin/osx/mac-crafter/Sources/Utils/Codesign.swift index 1e31b244c58af..be7eb586d6da9 100644 --- a/admin/osx/mac-crafter/Sources/Utils/Codesign.swift +++ b/admin/osx/mac-crafter/Sources/Utils/Codesign.swift @@ -152,7 +152,6 @@ func codesignClientAppBundle( // Now we do the final codesign bit let binariesDir = "\(clientContentsDir)/MacOS" print("Code-signing Nextcloud Desktop Client binaries...") - try recursivelyCodesign(path: binariesDir, identity: codeSignIdentity) guard let appName = clientAppDir.components(separatedBy: "/").last, clientAppDir.hasSuffix(".app") else { throw AppBundleSigningError.couldNotEnumerate("Failed to determine main executable name.") @@ -160,5 +159,7 @@ func codesignClientAppBundle( // Sign the main executable last let mainExecutableName = String(appName.dropLast(".app".count)) - try codesign(identity: codeSignIdentity, path: "\(binariesDir)/\(mainExecutableName)") + let mainExecutablePath = "\(binariesDir)/\(mainExecutableName)" + try recursivelyCodesign(path: binariesDir, identity: codeSignIdentity, skip: [mainExecutablePath]) + try codesign(identity: codeSignIdentity, path: mainExecutablePath) }