-
Notifications
You must be signed in to change notification settings - Fork 13
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
HelperTool Integration Steps #1
Comments
Did you get it working? If not maybe join this task #2 , someone else is having a problem, maybe they can help or, my helping them can help you |
Hello, Thank you for writing back. Yes, luckily I got it working up to 2 days ago. Not able to trace the issue why it stop working all of sudden. I am using this code#pragma unused(sender)
But every time now it keeps giving me CFErrorDomainLaunchd Code=4 error. |
Are you using the provided python tool? |
I am following EvenBetterAuthorizationSample code provided by apple. |
But you are using this correct?
Its been a while, but I believe you have to use this to clean and create all the plists |
Is this tool create all plist file for us so we do not need to create any plist file, right? |
I will close this and discuss it on #2 since you both have the same problem, (maybe) |
The script helps you build the correct plists. I am gonna go to lunch. When I get back I will try and remember how it is done from my working sample and will write a small how to. |
Thanks for the help @brenwell |
I have the same identifier as you said in XPCService Info.plist. |
In can you show me the snippet of the code you are using to communicate with the helper tool? |
here is the code [self connectAndExecuteCommandBlock:^(NSError * connectError) {
if (connectError != nil) {
[self logError:connectError];
} else {
[[self.helperToolConnection remoteObjectProxyWithErrorHandler:^(NSError * proxyError) {
[self logError:proxyError];
[self callAlert:proxyError.localizedDescription andDelegate:nil withAlertTitle:@""];
}] writeLicenseKey:licenseKey authorization:self.authorization withReply:^(NSError *error) {
#pragma unused(licenseKey)
if (error != nil) {
[self callAlert:@"Helper Tool Connection Error" andDelegate:nil withAlertTitle:@""];
} else {
[self logWithFormat:@"success\n"]; |
Alright I decided to share my https://gist.github.com/brenwell/03fad0a7f79dee564ea1 I have add 3 methods to the https://github.com/brenwell/EvenBetterAuthorizationSample/blob/master/HelperTool/HelperTool.h HelperTool.h - (void)toggleProxyWithReply:(void(^)(BOOL enabled, BOOL success))reply;
- (void)turnOnProxyWithReply:(void(^)(BOOL success))reply;
- (void)turnOffProxyWithReply:(void(^)(BOOL success))reply; HelperTool.m - (void)toggleProxyWithReply:(void(^)(BOOL enabled, BOOL success))reply
{
BOOL setProxyResult = YES;
if(_proxyEnabled)
{
setProxyResult = [self setGlobalProxyHost:ProxyHost port:ProxyPort enable:NO];
if (setProxyResult) {
_proxyEnabled = NO;
}
}
else
{
setProxyResult = [self setGlobalProxyHost:ProxyHost port:ProxyPort enable:YES];
if (setProxyResult) {
_proxyEnabled = YES;
}
}
if (setProxyResult) {
reply(_proxyEnabled,YES);
}else{
reply(_proxyEnabled,NO);
}
}
////////////////////////////////////////////////////////////////
- (void)turnOnProxyWithReply:(void(^)(BOOL success))reply
{
BOOL setProxyResult = [self setGlobalProxyHost:ProxyHost port:ProxyPort enable:YES];
if (setProxyResult) {
_proxyEnabled = YES;
reply(YES);
}else{
reply(NO);
}
}
////////////////////////////////////////////////////////////////
- (void)turnOffProxyWithReply:(void(^)(BOOL success))reply
{
BOOL setProxyResult = [self setGlobalProxyHost:ProxyHost port:ProxyPort enable:NO];
if (setProxyResult) {
_proxyEnabled = NO;
reply(YES);
}else{
reply(NO);
}
} |
Does this look right to you guys? HelperTool + XPCService Project SetupIn this example the 3 identifiers for the 3 targets are
1 Add Copy File build phaseMain App XPCService 2 Modify Info.plistsXPCService-Info.plist (Tools owned after installation) Add a new key value pair to the XPCService's
Inside this new dictionary add a another key value pair:
HelperTool-Info.plist (Clients allowed to add and remove tool) Add a new key value pair the HelperTools's
As this is an array, we will add a new item to the 0 index:
3 Developer IDChoose Developer ID:* in Code Signing Identity in build settings for each targets. Main App XPCService HelperTool 4 BuildBuild the app. 5 SMJobBlessUtil.pyUse Update Info.plist: Format: ./SMJobBlessUtil.py setreq Build/Products/Debug/com.blackwellapps.XPCService.xpc XPCService/XPCService-Info.plist BrokerHelper/HelperTool-Info.plist HelperTool/HelperTool-Info.plist Check Code Signing status: Format: ./SMJobBlessUtil.py check Build/Products/Debug/com.blackwellapps.XPCService.xpc Troubleshooting
CreditGot some of this from this gist https://gist.github.com/xiao99xiao/0509091001bdd6259249 |
Thanks for your help Yesterday. |
Can you tell me what is your target dependency for all the target for your application? |
Can you tell me how did you add new methods in helper tool as i tried to add new method but it always returns : CocoaDomainError 4097 "Couldn’t communicate with a helper application mac application" |
Hello,
I am new to GitHub so I hope that it is the right place to ask for help.
I am working on Mac OS application in which I have to create VPN Connection direct through my application and for that I have to store PASSWORD and SHAREDSECRETKEY in SYSTEM KEYCHAIN.
After lot of research I came to know about this sample code "EvanBetterAuthorizationExample”, I have gone throughout the code but didn't understand how I can implement this sample to my existing application.I have read the readme file but not much idea.
As I am new to this Network Programming can anyone please help me with proper integration steps?
Thanks in advance.
The text was updated successfully, but these errors were encountered: