From: Claudio Cambra Date: Wed, 11 Sep 2024 13:54:49 +0000 (+0800) Subject: Add convenience method to save the entitlements of a bundle to a file as XML X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~5^2~202^2~7 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=76fbf012ea2115b85de61139fdf732605c41350c;p=nextcloud-desktop.git Add convenience method to save the entitlements of a bundle to a file as XML Signed-off-by: Claudio Cambra --- diff --git a/admin/osx/mac-crafter/Sources/Utils/Codesign.swift b/admin/osx/mac-crafter/Sources/Utils/Codesign.swift index 16da33eb3..027d99c32 100644 --- a/admin/osx/mac-crafter/Sources/Utils/Codesign.swift +++ b/admin/osx/mac-crafter/Sources/Utils/Codesign.swift @@ -56,6 +56,13 @@ func recursivelyCodesign(path: String, identity: String) throws { } } +func saveCodesignEntitlements(target: String, path: String) throws { + let command = "codesign -d --entitlements \(path) --xml \(target)" + guard shell(command) == 0 else { + throw CodeSigningError.failedToCodeSign("Failed to save entitlements for \(target).") + } +} + func codesignClientAppBundle( at clientAppDir: String, withCodeSignIdentity codeSignIdentity: String ) throws {