|
|
@ -13,6 +13,8 @@ |
|
|
|
#import "pEpMacOSAdapter.h" |
|
|
|
#import "pEpUpdater.h" |
|
|
|
|
|
|
|
const NSString *kMachServiceName=@"pEp.foundation.pEpMacOSAdapter"; |
|
|
|
|
|
|
|
pEpUpdater* updater = nil; |
|
|
|
|
|
|
|
@interface ServiceDelegate : NSObject <NSXPCListenerDelegate> |
|
|
@ -59,7 +61,8 @@ BOOL start_helper(void) |
|
|
|
NSURL *url = [NSURL |
|
|
|
fileURLWithPath:@"/Library/Application Support/pEp/pEp.app/Contents/Library/LoginItems/p≡p updates.app"]; |
|
|
|
|
|
|
|
return [[NSWorkspace sharedWorkspace] openURL:url]; |
|
|
|
//return [[NSWorkspace sharedWorkspace] openURL:url]; |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
void signal_TERM(int signal) |
|
|
@ -77,16 +80,15 @@ int main(int argc, const char *argv[]) |
|
|
|
ServiceDelegate *delegate = [ServiceDelegate new]; |
|
|
|
|
|
|
|
// Set up the one NSXPCListener for this service. It will handle all incoming connections. |
|
|
|
// NSXPCListener *listener = [[NSXPCListener alloc] initWithMachServiceName:@"pEp.foundation.pEpMacOSAdapter"/*@"foundation.pEp.adapter.macOS"*/]; |
|
|
|
NSXPCListener *listener = [NSXPCListener serviceListener]; |
|
|
|
NSLog(@"starting agent"); |
|
|
|
NSXPCListener *listener = [[NSXPCListener alloc] initWithMachServiceName:kMachServiceName/*@"foundation.pEp.adapter.macOS"*/]; |
|
|
|
NSLog(@"Starting service [%@] ...", kMachServiceName); |
|
|
|
listener.delegate = delegate; |
|
|
|
[listener resume]; |
|
|
|
|
|
|
|
// start the GUI helper app |
|
|
|
BOOL opened = start_helper(); |
|
|
|
/* FIXME: Modification to be reverted */ |
|
|
|
//assert(opened); |
|
|
|
assert(opened); |
|
|
|
|
|
|
|
NSLog(@"going into main runLoop"); |
|
|
|
NSRunLoop* runLoop = [NSRunLoop currentRunLoop]; |
|
|
|