Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error On Mountain Lion #2

Open
KingOfBrian opened this issue Jun 13, 2012 · 12 comments
Open

Error On Mountain Lion #2

KingOfBrian opened this issue Jun 13, 2012 · 12 comments

Comments

@KingOfBrian
Copy link

Not sure what this error is, but on mountain lion, I'm getting:

Failed to bless helper. Error: Error Domain=kSMErrorDomainFramework Code=3 "The operation couldn’t be completed. (kSMErrorDomainFramework error 3 - The client and tool did not match requirements.)" UserInfo=0x1001577b0 {NSDescription=The client and tool did not match requirements.}

@KingOfBrian
Copy link
Author

I got the XPC part working without privilege escalation by using SMJobSubmit instead of Bless. I realize that this is different than the purpose of this demo app, but it's all I need - XPC Between my background menu item and forground viewer.

- (BOOL)startUserAgentWithLabel:(NSString *)label
                          error:(NSError **)error
{    
    CFDictionaryRef job = SMJobCopyDictionary(kSMDomainUserLaunchd, (CFStringRef)label);
    NSLog(@"Job = %@", (NSDictionary *)job);
    if (job == NULL)
    {
        NSMutableDictionary *plist = [NSMutableDictionary dictionary];
        [plist setObject:@"com.apple.bsd.SMJobBlessHelper" forKey:@"Label"];
        [plist setObject:@"com.apple.bsd.SMJobBlessHelper" forKey:@"Program"];
        [plist setObject:[NSDictionary dictionaryWithObject:[NSNumber numberWithBool:NO]
                                                    forKey:@"com.apple.bsd.SMJobBlessHelper"]
                  forKey:@"MachServices"];

        BOOL ok = SMJobSubmit(kSMDomainUserLaunchd, (CFDictionaryRef)plist, NULL, (CFErrorRef *)error);

        return ok;
    }
    return YES;

}

@KingOfBrian
Copy link
Author

Actually, I retract that. It got a bit farther but was complaining:

Helper available.
Sending request: Hi there, helper service.
XPC connection invalid, releasing.
Received response: (null).

If I wasn't half asleep, I would of noticed ;)

@davidsielert
Copy link

Did you ever figure out the original problem? I got the same exact error myself..

@davidsielert
Copy link

Noticed in ASL 11/27/12 6:20:03.581 PM launchdadd[56637]: FAILURE: Code <SecCode 0x7fc0e31005e0 [0x7fff7bed5fd0]> failed requirement (identifier "com.apple.bsd.SMJobBlessApp" and certificate leaf[subject.CN] = "Mac Developer: Nathan de Vries (T3RB9JQ8KZ)") with error "The operation couldn’t be completed. (OSStatus error -67050.)"
11/27/12 6:20:03.581 PM launchdadd[56637]: FAILURE: Code <SecStaticCode 0x7fc0e3600870 [0x7fff7bed5fd0]> failed requirement (identifier "com.apple.bsd.SMJobBlessHelper" and certificate leaf[subject.CN] = "Mac Developer: Nathan de Vries (T3RB9JQ8KZ)") with error "The operation couldn’t be completed. (OSStatus error -67050.)"
11/27/12 6:20:03.582 PM launchdadd[56637]: FAILURE: Job com.apple.bsd.SMJobBlessHelper could not be installed from /Users/david/Library/Developer/Xcode/DerivedData/SMJobBless-eatewdvwqlbljaakruwdobjxswkj/Build/Products/Debug/SMJobBlessApp.app/Contents/Library/LaunchServices/com.apple.bsd.SMJobBlessHelper, reason 3.

@davidsielert
Copy link

OK I figured this out .. You have to change the Identity in the info.plist's (as Nathan Says) and also in the build settings.. Nathan Signed with his appstore certificate which we of course do not have so it will not work

@socketwiz
Copy link

I changed my identity in both plist files, the one for the app and the one for the helper, and I also changed the code signing identitys in each project. I still get the error:

Failed to bless helper. Error: Error Domain=kSMErrorDomainFramework Code=3 "The operation couldn’t be completed. (kSMErrorDomainFramework error 3 - The client and tool did not match requirements.)" UserInfo=0x101d20130 {NSDescription=The client and tool did not match requirements.}

Any ideas why it might not be working for me?

@socketwiz
Copy link

I can't explain why, but this started working for me when I tried to reproduce the problem so I could post another question on StackOverflow. It could be that I moved the project to another directory and did a clean build. I'm not sure. All I know is not only is this project working for me, but I've been able to also replicate in a project of my own.

@mmichaa
Copy link

mmichaa commented Mar 15, 2013

A Product -> Clean (shift+cmd+k) may help ;)

@wookiee
Copy link

wookiee commented May 3, 2013

Is a Mac Developer profile sufficient for this, or must it be an App Store profile?

@davidsielert
Copy link

Mac developer will work

On May 3, 2013, at 8:29 AM, "Michael L. Ward" [email protected] wrote:

Is a Mac Developer profile sufficient for this, or must it be an App Store profile?


Reply to this email directly or view it on GitHub.

@mmichaa
Copy link

mmichaa commented May 3, 2013

A self-signing certificate suffices. Take a look at: https://developer.apple.com/library/mac/#documentation/security/Conceptual/CodeSigningGuide/Procedures/Procedures.html -- "To use the Certificate Assistant to create a self-signed signing identity"

@RudyAramayo
Copy link

Use Developer ID signatures.. apple changed their SMJobBless Samplecode to reflect this based on my DTS response/request

Developer ID will allow the app to run without GateKeeper complaining about an unknown developer...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants