Skip main executable during first binary codesign round

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
Claudio Cambra 2024-11-22 02:30:04 +08:00
Родитель cc37aa14bc
Коммит bd7c78300a
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: C839200C384636B0
1 изменённых файлов: 3 добавлений и 2 удалений

Просмотреть файл

@ -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)
}