Fix notarisation issues for Sparkle in mac-crafter
authorClaudio Cambra <claudio.cambra@nextcloud.com>
Wed, 11 Sep 2024 13:55:27 +0000 (21:55 +0800)
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>
Thu, 12 Sep 2024 05:17:36 +0000 (05:17 +0000)
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
admin/osx/mac-crafter/Sources/Utils/Codesign.swift

index 027d99c32cb5e6eb54c4f1ba9dfe42f4fd6350fd..61dfe123764df061c35745f1ecb7396b253cdf4f 100644 (file)
@@ -74,6 +74,16 @@ func codesignClientAppBundle(
     try recursivelyCodesign(path: "\(clientContentsDir)/PlugIns", identity: codeSignIdentity)
     try recursivelyCodesign(path: "\(clientContentsDir)/Resources", identity: codeSignIdentity)
 
-    print("Code-signing Nextcloud Desktop Client app bundle...")
-    try codesign(identity: codeSignIdentity, path: clientAppDir)
+    // Time to fix notarisation issues.
+    // Multiple components of the app will now have the get-task-allow entitlements.
+    // We need to strip these out manually.
+
+    print("Code-signing Sparkle autoupdater app (without entitlements)...")
+    let sparkleFrameworkPath = "\(clientContentsDir)/Frameworks/Sparkle.framework"
+    try codesign(identity: codeSignIdentity,
+                 path: "\(sparkleFrameworkPath)/Resources/Autoupdate.app/Contents/MacOS/*",
+                 options: "--timestamp --force --verbose=4 --options runtime")
+
+    print("Re-codesigning Sparkle library...")
+    try codesign(identity: codeSignIdentity, path: "\(sparkleFrameworkPath)/Sparkle")
 }