SMJobBlessXPC
SMJobBlessXPC copied to clipboard
How to write on /Library/Fonts folder on Mac with SMJobBless function
I try to use SMJobBless function to authenticate for my application can do write on /Library/Fonts but not working,
if (![self blessHelperWithLabel:@"com.apple.bsd.SMJobBlessHelper" error:&error]) { NSLog(@"Something went wrong! %@ / %d", [error domain], (int) [error code]); } else { //Access to this point. /* At this point, the job is available. However, this is a very * simple sample, and there is no IPC infrastructure set up to * make it launch-on-demand. You would normally achieve this by * using XPC (via a MachServices dictionary in your launchd.plist). */ NSLog(@"Job is available!"); bool result = false; result = [[NSFileManager defaultManager] isWritableFileAtPath:@"/Library/Fonts"]; [self->_textField setHidden:false]; } My application printed "Job is available" but when i check authorities write on /Library/Fonts, result is false Thanks in advance.