From b96fcb7a47e282e4a70f57b443cf7c3f424e3da3 Mon Sep 17 00:00:00 2001 From: Kyle Neideck Date: Fri, 26 Apr 2024 09:50:08 +1000 Subject: [PATCH] Fix BGMXPCHelper not launching due to Gatekeeper in macOS 14.5. 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. --- pkg/postinstall | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkg/postinstall b/pkg/postinstall index 88aa179..f82d6a1 100644 --- a/pkg/postinstall +++ b/pkg/postinstall @@ -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)" @@ -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 # . -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" "."