I am trying to remove the "com.apple.quarantine" attribute in files placed in
~/Library/Containers/....../Library/Application Support.
Using NSTask and xattr leads to "Operation not permitted" messages in console. As second option I tried the header xattr.h using removexattr().
I also tried to add LSFileQuarantineEnabled to Info.plist. Calling xattr manually from Terminal works.
Seems like sandbox prevents xattr from deleting attributes using Objective-C.
Run a helper binary inside a sandboxed app...
For first tests:
codesign -s <certificate A> <binary>
If you want to send it to the Mac App Store, use the correct certificate.
The code I'm using to start/call the helper binary is as follows:
NSString * resourcePath = [[NSBundle mainBundle] resourcePath];
NSTask *testbin = [[NSTask alloc] init];
NSString * path = [resourcePath stringByAppendingString:@"/testbin"];
[testbin setLaunchPath:path];
[testbin launch];
[testbin waitUntilExit];
No need to copy or move a file ;-)