From d89439d4b84baa4d51c6e0b9d0ea0b070edb6089 Mon Sep 17 00:00:00 2001 From: "Dhanji R. Prasanna" Date: Sat, 17 Jan 2026 11:41:45 +0530 Subject: [PATCH] Fix macOS security policy rejection after install After copying binaries to ~/.local/bin, macOS AppleSystemPolicy would reject them because the linker-signed code signature becomes invalid. Now re-sign binaries with ad-hoc signature after copying on macOS. --- scripts/install.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/install.sh b/scripts/install.sh index c69fd11..b72f100 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -16,6 +16,14 @@ cp target/release/g3 "$INSTALL_DIR/" cp target/release/studio "$INSTALL_DIR/g3-studio" cp target/release/libVisionBridge.dylib "$INSTALL_DIR/" +# Re-sign binaries after copying (required on macOS to avoid security policy rejection) +if [[ "$OSTYPE" == "darwin"* ]]; then + echo "Re-signing binaries for macOS..." + codesign --force --sign - "$INSTALL_DIR/g3" + codesign --force --sign - "$INSTALL_DIR/g3-studio" + codesign --force --sign - "$INSTALL_DIR/libVisionBridge.dylib" +fi + # Create symlink to override Android Studio's 'studio' command # Remove existing symlink if present, but don't remove if it's a different file if [ -L "$INSTALL_DIR/studio" ]; then