Skip to content

Commit

Permalink
Fix BGMXPCHelper not launching due to Gatekeeper in macOS 14.5.
Browse files Browse the repository at this point in the history
The previous fix was removing the quarantine attribute from the
BGMXPCHelper.xpc dir, but in 14.5 its contents also get the attribute.
(I haven't tested in earlier versions.) This new fix removes the
attribute from the contents as well.
  • Loading branch information
kyleneideck committed Apr 25, 2024
1 parent ad14e1b commit b96fcb7
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion pkg/postinstall
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ function log {
echo "$@"
}

function log_output {
while read line
do
log "$line"
done < /dev/stdin
}

coreaudiod_plist="/System/Library/LaunchDaemons/com.apple.audio.coreaudiod.plist"
dest_volume="$3"
xpc_helper_install_path="$(bash safe_install_dir.sh -y)"
Expand All @@ -52,7 +59,9 @@ cp -Rf "BGMXPCHelper.xpc" "$xpc_helper_install_path"
# TODO: I think, ideally, we should use the new Service Management API to install BGMXPCHelper,
# which would probably avoid this issue. See
# <https://developer.apple.com/documentation/servicemanagement/updating_your_app_package_installer_to_use_the_new_service_management_api>.
sudo xattr -d com.apple.quarantine "${xpc_helper_install_path}/BGMXPCHelper.xpc"
log "Removing com.apple.quarantine attribute from BGMXPCHelper."
sudo xattr -dr com.apple.quarantine "${xpc_helper_install_path}/BGMXPCHelper.xpc" 2>&1 | log_output
ls -lah@ "${xpc_helper_install_path}/BGMXPCHelper.xpc" 2>&1 | log_output

# TODO: Fail the install and show an error message if this fails.
bash "post_install.sh" "$xpc_helper_install_path" "BGMXPCHelper.xpc/Contents/MacOS/BGMXPCHelper" "."
Expand Down

0 comments on commit b96fcb7

Please sign in to comment.