fix(macos): frameworks being signed with entitlements unnecessarily (#12423)

This commit is contained in:
Trey Smith 2025-01-23 06:14:33 -05:00 committed by GitHub
parent 9d02c18ac2
commit 9a30bed98c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 1 deletions

View File

@ -0,0 +1,5 @@
---
'tauri-cli': 'patch:enhance'
---
Added conditional logic to MacOS codesigning where only executables get the entitlements file when being signed. This solves an issue where the app may not launch when using 3rd party frameworks if certain entitlements are added. Ex: multicast support (must be applied for through apple developer, and the framework would not have that capability).

View File

@ -48,9 +48,14 @@ pub fn sign(
log::info!(action = "Signing"; "with identity \"{}\"", keychain.signing_identity());
for target in targets {
let entitlements_path = if target.is_an_executable {
settings.macos().entitlements.as_ref().map(Path::new)
} else {
None
};
keychain.sign(
&target.path,
settings.macos().entitlements.as_ref().map(Path::new),
entitlements_path,
target.is_an_executable && settings.macos().hardened_runtime,
)?;
}