From f770e90caa59a72d0d730efc5994e7516828fa63 Mon Sep 17 00:00:00 2001 From: Christopher Snowhill Date: Fri, 28 Mar 2025 01:45:00 -0700 Subject: [PATCH] Sandbox Security: Disable library validation Apparently, this was preventing some signed plugins from being loaded into the process, preventing their use as MIDI plugins. And this may be needed for future AudioUnit DSP filter support, for third party plugins there, as well. Signed-off-by: Christopher Snowhill --- Cog.entitlements | 2 ++ Preferences/Preferences/MIDIPane.m | 54 ------------------------------ 2 files changed, 2 insertions(+), 54 deletions(-) delete mode 100644 Preferences/Preferences/MIDIPane.m diff --git a/Cog.entitlements b/Cog.entitlements index 2cd7845d7..78919d0a1 100644 --- a/Cog.entitlements +++ b/Cog.entitlements @@ -4,6 +4,8 @@ com.apple.security.app-sandbox + com.apple.security.cs.disable-library-validation + com.apple.security.cs.allow-jit com.apple.security.files.user-selected.read-write diff --git a/Preferences/Preferences/MIDIPane.m b/Preferences/Preferences/MIDIPane.m deleted file mode 100644 index 40bfaa55a..000000000 --- a/Preferences/Preferences/MIDIPane.m +++ /dev/null @@ -1,54 +0,0 @@ -// -// MIDIPane.m -// General -// -// Created by Christopher Snowhill on 10/15/13. -// -// - -#import "MIDIPane.h" - -#import "SandboxBroker.h" - -#import "AppController.h" - -@implementation MIDIPane - -- (NSString *)title { - return NSLocalizedPrefString(@"Synthesis"); -} - -- (NSImage *)icon { - if(@available(macOS 11.0, *)) - return [NSImage imageWithSystemSymbolName:@"pianokeys" accessibilityDescription:nil]; - return [[NSImage alloc] initWithContentsOfFile:[[NSBundle bundleForClass:[self class]] pathForImageResource:@"midi"]]; -} - -- (IBAction)setSoundFont:(id)sender { - NSArray *fileTypes = @[@"sf2", @"sf2pack", @"sflist", @"sf3"]; - NSOpenPanel *panel = [NSOpenPanel openPanel]; - [panel setAllowsMultipleSelection:NO]; - [panel setCanChooseDirectories:NO]; - [panel setCanChooseFiles:YES]; - [panel setFloatingPanel:YES]; - [panel setAllowedFileTypes:fileTypes]; - NSString *oldPath = [[NSUserDefaults standardUserDefaults] stringForKey:@"soundFontPath"]; - if(oldPath != nil) - [panel setDirectoryURL:[NSURL fileURLWithPath:oldPath]]; - NSInteger result = [panel runModal]; - if(result == NSModalResponseOK) { - [[NSUserDefaults standardUserDefaults] setValue:[[panel URL] path] forKey:@"soundFontPath"]; - - id sandboxBrokerClass = NSClassFromString(@"SandboxBroker"); - NSURL *pathUrl = [panel URL]; - if(![[sandboxBrokerClass sharedSandboxBroker] areAllPathsSafe:@[pathUrl]]) { - id appControllerClass = NSClassFromString(@"AppController"); - [appControllerClass globalShowPathSuggester]; - } - } -} - -- (IBAction)setMidiPlugin:(id)sender { -} - -@end