Skip to content

Commit

Permalink
mac-crafter: Only attempt sparkle codesign if it exists in the app bu…
Browse files Browse the repository at this point in the history
…ndle

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
  • Loading branch information
claucambra authored and backportbot[bot] committed Dec 9, 2024
1 parent 9fcbd42 commit db11d46
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions admin/osx/mac-crafter/Sources/Utils/Codesign.swift
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,21 @@ func codesignClientAppBundle(
// 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 = "\(frameworksPath)/Sparkle.framework"
try recursivelyCodesign(path: "\(sparkleFrameworkPath)/Resources/Autoupdate.app",
identity: codeSignIdentity,
options: "--timestamp --force --verbose=4 --options runtime --deep")
if FileManager.default.fileExists(atPath: "\(sparkleFrameworkPath)/Resources/Autoupdate.app") {
print("Code-signing Sparkle autoupdater app (without entitlements)...")

print("Re-codesigning Sparkle library...")
try codesign(identity: codeSignIdentity, path: "\(sparkleFrameworkPath)/Sparkle")
try recursivelyCodesign(
path: "\(sparkleFrameworkPath)/Resources/Autoupdate.app",
identity: codeSignIdentity,
options: "--timestamp --force --verbose=4 --options runtime --deep"
)

print("Re-codesigning Sparkle library...")
try codesign(identity: codeSignIdentity, path: "\(sparkleFrameworkPath)/Sparkle")
} else {
print("Build does not have Sparkle, skipping.")
}

print("Code-signing app extensions (removing get-task-allow entitlements)...")
let fm = FileManager.default
Expand Down

0 comments on commit db11d46

Please sign in to comment.