Browse Source

APPLEMAIL-33 Clean main.m of unused code. Delete old folder PEPMacOSAdapterXPCService.

APPLEMAIL-33
David Alarcon 2 years ago
parent
commit
f598edabc8
19 changed files with 63 additions and 544 deletions
  1. +0
    -12
      Submodules/PEPMacOSAdapterXPCService/PEPMacOSAdapterXPCService/PEPMacOSAdapterXPCService.h
  2. +0
    -12
      Submodules/PEPMacOSAdapterXPCService/PEPMacOSAdapterXPCService/PEPMacOSAdapterXPCService.m
  3. +0
    -30
      Submodules/PEPMacOSAdapterXPCService/PEPMacOSAdapterXPCService/PEPNotificationXPCService/Interface/PEPNotificationXPCApiProtocol.h
  4. +0
    -20
      Submodules/PEPMacOSAdapterXPCService/PEPMacOSAdapterXPCService/PEPNotificationXPCService/XPCService/PEPNotificationXPCService.h
  5. +0
    -13
      Submodules/PEPMacOSAdapterXPCService/PEPMacOSAdapterXPCService/PEPNotificationXPCService/XPCService/PEPNotificationXPCService.m
  6. +0
    -35
      Submodules/PEPMacOSAdapterXPCService/PEPMacOSAdapterXPCService/PEPUpdateDownloadXPCService/Interface/PEPUpdateDownloadXPCApiProtocol.h
  7. +0
    -43
      Submodules/PEPMacOSAdapterXPCService/PEPMacOSAdapterXPCService/PEPUpdateDownloadXPCService/PEPUpdateDownloader.h
  8. +0
    -147
      Submodules/PEPMacOSAdapterXPCService/PEPMacOSAdapterXPCService/PEPUpdateDownloadXPCService/PEPUpdateDownloader.mm
  9. +0
    -19
      Submodules/PEPMacOSAdapterXPCService/PEPMacOSAdapterXPCService/PEPUpdateDownloadXPCService/XPCService/PEPUpdateDownloadXPCApi.h
  10. +0
    -67
      Submodules/PEPMacOSAdapterXPCService/PEPMacOSAdapterXPCService/PEPUpdateDownloadXPCService/XPCService/PEPUpdateDownloadXPCApi.m
  11. +0
    -20
      Submodules/PEPMacOSAdapterXPCService/PEPMacOSAdapterXPCService/PEPUpdateDownloadXPCService/XPCService/PEPUpdateDownloadXPCService.h
  12. +0
    -78
      Submodules/PEPMacOSAdapterXPCService/PEPMacOSAdapterXPCService/PEPUpdateDownloadXPCService/XPCService/PEPUpdateDownloadXPCService.m
  13. +2
    -2
      Submodules/PEPUpdatesXPCService/PEPUpdatesXPCService.xcodeproj/project.pbxproj
  14. +7
    -11
      Submodules/PEPUpdatesXPCService/PEPUpdatesXPCService/PEPNotificationXPCService/Shared/PEPNotificationXPCApiProtocol.h
  15. +1
    -1
      Submodules/PEPUpdatesXPCService/PEPUpdatesXPCService/Shared/PEPUpdateDownloader.h
  16. +2
    -2
      Submodules/pEpNotifications/PEPUpdatesApp.xcodeproj/project.pbxproj
  17. +14
    -28
      pEpMacOSAdapter.xcodeproj/project.pbxproj
  18. +29
    -1
      pEpMacOSAdapter.xcodeproj/xcshareddata/xcschemes/pEpMacOSAdapter.xcscheme
  19. +8
    -3
      pEpMacOSAdapter/main.m

+ 0
- 12
Submodules/PEPMacOSAdapterXPCService/PEPMacOSAdapterXPCService/PEPMacOSAdapterXPCService.h View File

@ -1,12 +0,0 @@
//
// PEPMacOSAdapterXPCService.h
// PEPMacOSAdapterXPCService
//
// Created by David Alarcon on 10/2/21.
//
#import <Foundation/Foundation.h>
@interface PEPMacOSAdapterXPCService : NSObject
@end

+ 0
- 12
Submodules/PEPMacOSAdapterXPCService/PEPMacOSAdapterXPCService/PEPMacOSAdapterXPCService.m View File

@ -1,12 +0,0 @@
//
// PEPMacOSAdapterXPCService.m
// PEPMacOSAdapterXPCService
//
// Created by David Alarcon on 10/2/21.
//
#import "PEPMacOSAdapterXPCService.h"
@implementation PEPMacOSAdapterXPCService
@end

+ 0
- 30
Submodules/PEPMacOSAdapterXPCService/PEPMacOSAdapterXPCService/PEPNotificationXPCService/Interface/PEPNotificationXPCApiProtocol.h View File

@ -1,30 +0,0 @@
//
// PEPNotificationXPCApiProtocol.h
// foundation.pEp.adapter.macOS
//
// Created by David Alarcon on 9/2/21.
// Copyright © 2021 pp foundation. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
/// Notification types
// TODO: Maybe does not belong to this protocol
typedef enum { ready = 0, downloading, downloadArrived, noDownloadAvailable } DNType;
/// Callback protocol to notify about download events
@protocol PEPNotificationXPCApiProtocol <NSObject>
/// notification about download events
- (void)notifyDownload:(int)type withName:(NSString*)name withFilename:(NSString*)filename;
@end
/// This is the object from the client where we deliver notifications to
@interface PEPNotification : NSObject <PEPNotificationXPCApiProtocol>
@end
NS_ASSUME_NONNULL_END

+ 0
- 20
Submodules/PEPMacOSAdapterXPCService/PEPMacOSAdapterXPCService/PEPNotificationXPCService/XPCService/PEPNotificationXPCService.h View File

@ -1,20 +0,0 @@
//
// PEPNotificationXPCService.h
// foundation.pEp.adapter.macOS
//
// Created by David Alarcon on 9/2/21.
// Copyright © 2021 pp foundation. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface PEPNotificationXPCService : NSObject
/// Begin listening for incoming XPC connections
- (void)start;
@end
NS_ASSUME_NONNULL_END

+ 0
- 13
Submodules/PEPMacOSAdapterXPCService/PEPMacOSAdapterXPCService/PEPNotificationXPCService/XPCService/PEPNotificationXPCService.m View File

@ -1,13 +0,0 @@
//
// PEPNotificationXPCService.m
// foundation.pEp.adapter.macOS
//
// Created by David Alarcon on 9/2/21.
// Copyright © 2021 pp foundation. All rights reserved.
//
#import "PEPNotificationXPCService.h"
@implementation PEPNotificationXPCService
@end

+ 0
- 35
Submodules/PEPMacOSAdapterXPCService/PEPMacOSAdapterXPCService/PEPUpdateDownloadXPCService/Interface/PEPUpdateDownloadXPCApiProtocol.h View File

@ -1,35 +0,0 @@
//
// PEPMacOSAdapterProtocol.h
// pEpMacOSAdapter
//
// Created by Volker Birk on 20.04.20.
// Copyleft © 2020 pp foundation.
// This file is under GNU General Public License 3.0
//
#import <Foundation/Foundation.h>
/// This protocol is providing the XPC interface to the User Interface program pEpNotifications
@protocol PEPUpdateDownloadXPCApiProtocol
/**
subscribe to the published notifications about downloads arriving
- Parameter downloading: block to call back when a download is going to happen
- Parameter downloadArrived: block to call back when a download arrived
*/
- (void)subscribeForUpdate:(NSXPCListenerEndpoint*)endpoint;
/// unsubscribe from receiving notifications about downloads arriving
- (void)unsubscribeForUpdate;
/// search for immediate updates
- (void)updateNow;
/// schedules updates each 2 hours
- (void)scheduleUpdates;
/// stop auto updates
- (void)stopUpdates;
@end

+ 0
- 43
Submodules/PEPMacOSAdapterXPCService/PEPMacOSAdapterXPCService/PEPUpdateDownloadXPCService/PEPUpdateDownloader.h View File

@ -1,43 +0,0 @@
//
// PEPUpdateDownloader.h
// pEpMacOSAdapter
//
// Created by Volker Birk on 26.05.20.
// Copyright © 2020 pp foundation. All rights reserved.
// This file is under GNU General Public License 3.0
//
#import <Foundation/Foundation.h>
#import "PEPNotificationXPCApiProtocol.h"
/// object encapsulating the update client functionality of downloadclient
@interface PEPUpdateDownloader : NSObject
/// default 2 hours = 7200 seconds
@property (retain) NSTimer* timer;
/// path with config files
@property (retain) NSString* configPath;
/// subscriber for notifications
@property (retain) PEPNotification* subscriber;
/// initializes the PEPUpdateDownloader
- (id)init;
/// schedules updates each 2 hours
- (void)scheduleUpdates;
/// stop auto updates
- (void)stopUpdates;
/// update all configured software
- (void)updateAll;
/// update software described by config file
- (void)updateWithFile:(NSString*)configFile error:(NSError **)err;
/// update a product from URL of update server
- (void)update:(NSString*)name usingUrl:(NSString*)url;
@end

+ 0
- 147
Submodules/PEPMacOSAdapterXPCService/PEPMacOSAdapterXPCService/PEPUpdateDownloadXPCService/PEPUpdateDownloader.mm View File

@ -1,147 +0,0 @@
//
// PEPUpdateDownloader.mm
// pEpMacOSAdapter
//
// Created by Volker Birk on 26.05.20.
// Copyright © 2020 p≡p foundation. All rights reserved.
// This file is under GNU General Public License 3.0
//
#import "PEPUpdateDownloader.h"
#include "downloadclient.hh"
const double CYCLE = 7200.0; // 7200 seconds = 2 hours
NSString* CONFIG_PATH = @"/Library/Application Support/pEp/Updater";
@implementation PEPUpdateDownloader
- (id)init
{
self = [super init];
if (self) {
self.configPath = CONFIG_PATH;
}
return self;
}
- (void)scheduleUpdates
{
if (!self.timer) {
NSLog(@"schedule updates");
dispatch_async(dispatch_get_main_queue(), ^{
self.timer = [NSTimer scheduledTimerWithTimeInterval:CYCLE
target:self
selector:@selector(updateAll)
userInfo:nil
repeats:YES];
});
}
else {
NSLog(@"timer already there");
}
}
- (void)stopUpdates
{
if (self.timer) {
NSLog(@"stop auto updates");
[self.timer invalidate];
self.timer = nil;
}
}
- (void)updateAll
{
NSLog(@"update all registered products");
NSFileManager *localFileManager=[NSFileManager new];
NSDirectoryEnumerator *dirEnum = [localFileManager enumeratorAtPath:_configPath];
NSString *configFile;
while (dirEnum && (configFile = [dirEnum nextObject])) {
if ([[configFile pathExtension] isEqualToString: @"plist"]) {
NSError *err = nil;
[self updateWithFile:[NSString stringWithFormat:@"%@/%@", _configPath, configFile] error:&err];
}
}
}
- (void)updateWithFile:(NSString*)configFile error:(NSError **)err
{
NSLog(@"update product with config file %@", configFile);
NSInputStream *is = [NSInputStream inputStreamWithFileAtPath:configFile];
[is open];
NSDictionary* plist = [NSPropertyListSerialization
propertyListWithStream:is options:NSPropertyListMutableContainers
format:nil error:err];
[is close];
if (plist) {
NSString* name = [plist objectForKey:@"name"];
NSString* url = [plist objectForKey:@"url"];
if (name && url) {
[self update:name usingUrl:url];
}
}
else if (err) {
NSLog(@"%@ %@ %@ %@", (*err).localizedDescription,
(*err).localizedFailureReason, (*err).localizedRecoveryOptions,
(*err).localizedRecoverySuggestion);
}
}
- (void)update:(NSString*)name usingUrl:(NSString*)url
{
NSLog(@"update %@ using %@", name, url);
pEp::UpdateClient::product p = { name.UTF8String, url.UTF8String };
std::string keyfile = _configPath.UTF8String;
keyfile += std::string("/");
keyfile += p.name;
keyfile += std::string(".der");
NSLog(@"using key from %s", keyfile.c_str());
NSString* cwd = [NSFileManager defaultManager].currentDirectoryPath;
NSString* dir = @"/tmp";
[[NSFileManager defaultManager] changeCurrentDirectoryPath:dir];
std::string _filename;
pEp::notifyRead_t notifyRead = [=]()->void{
NSLog(@"downloading: %@", name);
if (_subscriber) {
[_subscriber notifyDownload:(int)downloading withName:name withFilename:@""];
}
};
try {
_filename = pEp::UpdateClient::update(p, keyfile, notifyRead);
if (_filename.length()) {
NSString* filename = [NSString stringWithUTF8String:_filename.c_str()];
NSString* download = [NSString stringWithFormat:@"%@/%@", dir, filename];
[[NSFileManager defaultManager] changeCurrentDirectoryPath:cwd];
NSLog(@"download arrived %@", download);
if (_subscriber) {
[_subscriber notifyDownload:(int)downloadArrived withName:name withFilename:download];
}
}
else {
NSLog(@"no download available for %@", name);
if (_subscriber) {
[_subscriber notifyDownload:(int)noDownloadAvailable withName:name withFilename:@""];
}
}
}
catch (std::exception& e) {
NSLog(@"pEp::UpdateClient::update({\"%s\", \"%s\"}, \"%s\"): %s",
p.name.c_str(), p.url.c_str(), keyfile.c_str(), e.what());
}
}
@end

+ 0
- 19
Submodules/PEPMacOSAdapterXPCService/PEPMacOSAdapterXPCService/PEPUpdateDownloadXPCService/XPCService/PEPUpdateDownloadXPCApi.h View File

@ -1,19 +0,0 @@
//
// PEPUpdateDownloadXPCApi.h
// foundation.pEp.adapter.macOS
//
// Created by David Alarcon on 9/2/21.
// Copyright © 2021 pp foundation. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "PEPUpdateDownloadXPCApiProtocol.h"
NS_ASSUME_NONNULL_BEGIN
@interface PEPUpdateDownloadXPCApi : NSObject <PEPUpdateDownloadXPCApiProtocol>
@property (retain) NSXPCConnection* clientConnection;
@end
NS_ASSUME_NONNULL_END

+ 0
- 67
Submodules/PEPMacOSAdapterXPCService/PEPMacOSAdapterXPCService/PEPUpdateDownloadXPCService/XPCService/PEPUpdateDownloadXPCApi.m View File

@ -1,67 +0,0 @@
//
// PEPUpdateDownloadXPCApi.m
// foundation.pEp.adapter.macOS
//
// Created by David Alarcon on 9/2/21.
// Copyright © 2021 pp foundation. All rights reserved.
//
#import "PEPUpdateDownloadXPCApi.h"
#import "PEPNotificationXPCApiProtocol.h"
#import "PEPUpdateDownloader.h"
extern PEPUpdateDownloader* updater;
@implementation PEPUpdateDownloadXPCApi
- (void)subscribeForUpdate:(NSXPCListenerEndpoint*)endpoint {
NSLog(@"subscribeForUpdate called");
if (!updater) {
updater = [PEPUpdateDownloader new];
}
///NotificationXPCService *service = ....
///[service start];
if (updater) {
_clientConnection = [[NSXPCConnection alloc] initWithListenerEndpoint:endpoint];
_clientConnection.remoteObjectInterface = [NSXPCInterface
interfaceWithProtocol:@protocol(PEPNotificationXPCApiProtocol)];
_clientConnection.interruptionHandler = ^(){NSLog(@"interruption"); updater.subscriber=nil;};
_clientConnection.invalidationHandler = ^(){NSLog(@"invalidation"); updater.subscriber=nil;};
[_clientConnection resume];
PEPNotification* downloadNotification = [_clientConnection remoteObjectProxyWithErrorHandler:^(NSError*err) {
NSLog(@"%@", err);
}];
updater.subscriber = downloadNotification;
if (downloadNotification) {
[downloadNotification notifyDownload:ready withName:@"" withFilename:@""];
}
}
}
- (void)unsubscribeForUpdate {
NSLog(@"unsubscribeForUpdate called");
if (updater) updater.subscriber = nil;
}
- (void)updateNow {
NSLog(@"updateNow called");
if (updater) [updater updateAll];
}
- (void)scheduleUpdates {
NSLog(@"scheduleUpdates called");
if (updater) [updater scheduleUpdates];
}
- (void)stopUpdates {
NSLog(@"stopUpdates called");
if (updater) [updater stopUpdates];
}
@end

+ 0
- 20
Submodules/PEPMacOSAdapterXPCService/PEPMacOSAdapterXPCService/PEPUpdateDownloadXPCService/XPCService/PEPUpdateDownloadXPCService.h View File

@ -1,20 +0,0 @@
//
// PEPUpdateDownloadXPCService.h
// foundation.pEp.adapter.macOS
//
// Created by David Alarcon on 9/2/21.
// Copyright © 2021 pp foundation. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface PEPUpdateDownloadXPCService : NSObject <NSXPCListenerDelegate>
/// Begin listening for incoming XPC connections
- (void)start;
@end
NS_ASSUME_NONNULL_END

+ 0
- 78
Submodules/PEPMacOSAdapterXPCService/PEPMacOSAdapterXPCService/PEPUpdateDownloadXPCService/XPCService/PEPUpdateDownloadXPCService.m View File

@ -1,78 +0,0 @@
//
// PEPUpdateDownloadXPCService.m
// foundation.pEp.adapter.macOS
//
// Created by David Alarcon on 9/2/21.
// Copyright © 2021 pp foundation. All rights reserved.
//
#import "PEPUpdateDownloadXPCService.h"
@import AppKit;
#import "PEPUpdateDownloadXPCApiProtocol.h"
#import "PEPUpdateDownloadXPCApi.h"
@interface PEPUpdateDownloadXPCService ()
@property (nonatomic, strong, readwrite) NSXPCListener *listener;
@end
@implementation PEPUpdateDownloadXPCService
- (instancetype)init {
if (self = [super init]) {
_listener = [[NSXPCListener alloc] initWithMachServiceName:@"foundation.pEp.adapter.macOS_OpenStep"];
NSLog(@"starting agent");
_listener.delegate = self;
}
return self;
}
- (void)start {
[self.listener resume];
BOOL opened = [self startPEPUpdatesApp];
assert(opened);
}
// MARK: - Private
- (BOOL)startPEPUpdatesApp {
NSURL *url = [NSURL
fileURLWithPath:@"/Library/Application Support/pEp/pEp.app/Contents/Library/LoginItems/pp updates.app"];
return [[NSWorkspace sharedWorkspace] openURL:url];
}
// MARK: - NSXPCListenerDelegate
- (BOOL)listener:(NSXPCListener *)listener shouldAcceptNewConnection:(NSXPCConnection *)newConnection {
// This method is where the NSXPCListener configures, accepts, and resumes a new incoming NSXPCConnection.
NSLog(@"incoming connection");
// Configure the connection.
// First, set the interface that the exported object implements.
newConnection.exportedInterface = [NSXPCInterface interfaceWithProtocol:@protocol(PEPUpdateDownloadXPCApiProtocol)];
// Next, set the object that the connection exports. All messages sent on
// the connection to this service will be sent to the exported object to
// handle. The connection retains the exported object.
PEPUpdateDownloadXPCApi *exportedObject = [PEPUpdateDownloadXPCApi new];
newConnection.exportedObject = exportedObject;
if (!newConnection.exportedInterface || !newConnection.exportedObject) {
NSLog(@"failed to allocate object and interface");
return NO;
}
// Resuming the connection allows the system to deliver more incoming messages.
[newConnection resume];
// Returning YES from this method tells the system that you have accepted this connection. If you want to reject the connection for some reason, call -invalidate on the connection and return NO.
NSLog(@"connection accepted");
return YES;
}
@end

+ 2
- 2
Submodules/PEPUpdatesXPCService/PEPUpdatesXPCService.xcodeproj/project.pbxproj View File

@ -409,7 +409,7 @@
"$(PROJECT_DIR)/../../../local/include",
"$(PROJECT_DIR)/../../../downloadclient",
);
MACOSX_DEPLOYMENT_TARGET = 11.1;
MACOSX_DEPLOYMENT_TARGET = 10.10;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
@ -468,7 +468,7 @@
"$(PROJECT_DIR)/../../../local/include",
"$(PROJECT_DIR)/../../../downloadclient",
);
MACOSX_DEPLOYMENT_TARGET = 11.1;
MACOSX_DEPLOYMENT_TARGET = 10.10;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
OTHER_LDFLAGS = "$(OTHER_LDFLAGS)";


+ 7
- 11
Submodules/PEPUpdatesXPCService/PEPUpdatesXPCService/PEPNotificationXPCService/Shared/PEPNotificationXPCApiProtocol.h View File

@ -12,13 +12,13 @@ NS_ASSUME_NONNULL_BEGIN
/// Notification types
// TODO: Maybe does not belong to this protocol
NS_ENUM(int, DNType) {
ready = 0,
downloading,
downloadArrived,
noDownloadAvailable
};
//typedef enum { ready = 0, downloading, downloadArrived, noDownloadAvailable } DNType;
//NS_ENUM(int, DNType) {
// ready = 0,
// downloading,
// downloadArrived,
// noDownloadAvailable
//};
typedef enum { ready = 0, downloading, downloadArrived, noDownloadAvailable } DNType;
/// Callback protocol to notify about download events
@protocol PEPNotificationXPCApiProtocol <NSObject>
@ -28,9 +28,5 @@ NS_ENUM(int, DNType) {
@end
/// This is the object from the client where we deliver notifications to
@interface PEPNotification : NSObject <PEPNotificationXPCApiProtocol>
@end
NS_ASSUME_NONNULL_END

+ 1
- 1
Submodules/PEPUpdatesXPCService/PEPUpdatesXPCService/Shared/PEPUpdateDownloader.h View File

@ -20,7 +20,7 @@
@property (retain) NSString* configPath;
/// subscriber for notifications
@property (retain) PEPNotification* subscriber;
@property (retain) id<PEPNotificationXPCApiProtocol> subscriber;
/// initializes the PEPUpdateDownloader
- (id)init;


+ 2
- 2
Submodules/pEpNotifications/PEPUpdatesApp.xcodeproj/project.pbxproj View File

@ -277,7 +277,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.8;
MACOSX_DEPLOYMENT_TARGET = 10.10;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
@ -337,7 +337,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.8;
MACOSX_DEPLOYMENT_TARGET = 10.10;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
PRODUCT_MODULE_NAME = pEp_updater;


+ 14
- 28
pEpMacOSAdapter.xcodeproj/project.pbxproj View File

@ -9,28 +9,23 @@
/* Begin PBXBuildFile section */
35380AE7247BD13A004A08A6 /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = 35380AE6247BD13A004A08A6 /* README.md */; };
35DC18DA244DA19100FB2002 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 35DC18D9244DA19100FB2002 /* main.m */; };
4E5FC0EB25B9D212000DF12C /* libiconv.2.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 4E5FC0EA25B9D212000DF12C /* libiconv.2.tbd */; };
4E5FC0F225B9D2E0000DF12C /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 4E5FC0F025B9D2CF000DF12C /* libz.tbd */; };
4E9F55D025D3D4B8005BD46F /* libPEPObjCAdapterXPCService.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4E9F55CF25D3D4B8005BD46F /* libPEPObjCAdapterXPCService.a */; };
4EA193F325D6876700F5D802 /* libPEPUpdatesXPCService.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4EA193F225D6876700F5D802 /* libPEPUpdatesXPCService.a */; };
4EA193F825D6893A00F5D802 /* libiconv.2.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 4EA193F625D688EA00F5D802 /* libiconv.2.tbd */; };
4EA1945E25D6943500F5D802 /* libc++.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 4EA1945D25D6942D00F5D802 /* libc++.tbd */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
150D91D1254732B600010463 /* libboost_regex.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libboost_regex.a; path = ../local/lib/libboost_regex.a; sourceTree = "<group>"; };
150D91D4254732E800010463 /* libcryptopp.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libcryptopp.a; path = ../local/lib/libcryptopp.a; sourceTree = "<group>"; };
150D91D62547330100010463 /* libcrypto.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libcrypto.a; path = ../local/lib/libcrypto.a; sourceTree = "<group>"; };
150D91D82547331D00010463 /* libssl.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libssl.a; path = ../local/lib/libssl.a; sourceTree = "<group>"; };
15AC46BB254EE19600AA18DE /* libdownloadclient.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libdownloadclient.a; sourceTree = BUILT_PRODUCTS_DIR; };
15CC85A62546D71A00DC43A1 /* libdownloadclient.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libdownloadclient.a; sourceTree = BUILT_PRODUCTS_DIR; };
35380AE6247BD13A004A08A6 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = SOURCE_ROOT; };
35DC18D2244DA19100FB2002 /* foundation.pEp.adapter.macOS.xpc */ = {isa = PBXFileReference; explicitFileType = "wrapper.xpc-service"; includeInIndex = 0; path = foundation.pEp.adapter.macOS.xpc; sourceTree = BUILT_PRODUCTS_DIR; };
35DC18D9244DA19100FB2002 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
35DC18DB244DA19100FB2002 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
4E5FC0CF25B9C351000DF12C /* libPEPObjCAdapter_macOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libPEPObjCAdapter_macOS.a; sourceTree = BUILT_PRODUCTS_DIR; };
4E5FC0EA25B9D212000DF12C /* libiconv.2.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libiconv.2.tbd; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.3.sdk/usr/lib/libiconv.2.tbd; sourceTree = DEVELOPER_DIR; };
4E5FC0F025B9D2CF000DF12C /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; };
4E797BCA25D526740090F900 /* libPEPUpdatesXPCService.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libPEPUpdatesXPCService.a; sourceTree = BUILT_PRODUCTS_DIR; };
4E9F55CF25D3D4B8005BD46F /* libPEPObjCAdapterXPCService.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libPEPObjCAdapterXPCService.a; sourceTree = BUILT_PRODUCTS_DIR; };
4ED6F6CF25D2E283008BCE79 /* PEPObjCAdapterXPCService.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = PEPObjCAdapterXPCService.framework; sourceTree = BUILT_PRODUCTS_DIR; };
4EA193F225D6876700F5D802 /* libPEPUpdatesXPCService.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libPEPUpdatesXPCService.a; sourceTree = BUILT_PRODUCTS_DIR; };
4EA193F625D688EA00F5D802 /* libiconv.2.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libiconv.2.tbd; path = usr/lib/libiconv.2.tbd; sourceTree = SDKROOT; };
4EA1945D25D6942D00F5D802 /* libc++.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = "libc++.tbd"; path = "usr/lib/libc++.tbd"; sourceTree = SDKROOT; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@ -38,8 +33,10 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
4E5FC0EB25B9D212000DF12C /* libiconv.2.tbd in Frameworks */,
4EA193F825D6893A00F5D802 /* libiconv.2.tbd in Frameworks */,
4EA1945E25D6943500F5D802 /* libc++.tbd in Frameworks */,
4E5FC0F225B9D2E0000DF12C /* libz.tbd in Frameworks */,
4EA193F325D6876700F5D802 /* libPEPUpdatesXPCService.a in Frameworks */,
4E9F55D025D3D4B8005BD46F /* libPEPObjCAdapterXPCService.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
@ -77,18 +74,11 @@
35F06969247D58C800543884 /* Frameworks */ = {
isa = PBXGroup;
children = (
4EA1945D25D6942D00F5D802 /* libc++.tbd */,
4EA193F625D688EA00F5D802 /* libiconv.2.tbd */,
4E9F55CF25D3D4B8005BD46F /* libPEPObjCAdapterXPCService.a */,
4ED6F6CF25D2E283008BCE79 /* PEPObjCAdapterXPCService.framework */,
4E5FC0F025B9D2CF000DF12C /* libz.tbd */,
4E797BCA25D526740090F900 /* libPEPUpdatesXPCService.a */,
15AC46BB254EE19600AA18DE /* libdownloadclient.a */,
4E5FC0CF25B9C351000DF12C /* libPEPObjCAdapter_macOS.a */,
4E5FC0EA25B9D212000DF12C /* libiconv.2.tbd */,
150D91D82547331D00010463 /* libssl.a */,
150D91D62547330100010463 /* libcrypto.a */,
150D91D4254732E800010463 /* libcryptopp.a */,
150D91D1254732B600010463 /* libboost_regex.a */,
15CC85A62546D71A00DC43A1 /* libdownloadclient.a */,
4EA193F225D6876700F5D802 /* libPEPUpdatesXPCService.a */,
);
name = Frameworks;
sourceTree = "<group>";
@ -244,6 +234,7 @@
HEADER_SEARCH_PATHS = (
"${PROJECT_DIR}/../local/include",
"$(PROJECT_DIR)/../../src_pEp4AppleMail/pep4applemail/PEPObjCAdapterXpcApiClient/PEPObjCAdapterXPCService/Interface",
"$(PROJECT_DIR)/Submodules/PEPUpdatesXPCService/PEPUpdatesXPCService/PEPUpdateDownloadXPCService/PEPUpdateDownloadXPCService/Interface/",
);
LIBRARY_SEARCH_PATHS = "";
MACOSX_DEPLOYMENT_TARGET = 10.10;
@ -253,9 +244,6 @@
OTHER_LDFLAGS = (
"$(OTHER_LDFLAGS)",
"-ObjC",
"${PROJECT_DIR}/../local/lib/libcrypto.a",
"${PROJECT_DIR}/../local/lib/libssl.a",
"${PROJECT_DIR}/../local/lib/libcryptopp.a",
);
SDKROOT = macosx;
};
@ -309,6 +297,7 @@
HEADER_SEARCH_PATHS = (
"${PROJECT_DIR}/../local/include",
"$(PROJECT_DIR)/../../src_pEp4AppleMail/pep4applemail/PEPObjCAdapterXpcApiClient/PEPObjCAdapterXPCService/Interface",
"$(PROJECT_DIR)/Submodules/PEPUpdatesXPCService/PEPUpdatesXPCService/PEPUpdateDownloadXPCService/PEPUpdateDownloadXPCService/Interface/",
);
LIBRARY_SEARCH_PATHS = "";
MACOSX_DEPLOYMENT_TARGET = 10.10;
@ -317,9 +306,6 @@
OTHER_LDFLAGS = (
"$(OTHER_LDFLAGS)",
"-ObjC",
"${PROJECT_DIR}/../local/lib/libcrypto.a",
"${PROJECT_DIR}/../local/lib/libssl.a",
"${PROJECT_DIR}/../local/lib/libcryptopp.a",
);
SDKROOT = macosx;
};


+ 29
- 1
pEpMacOSAdapter.xcodeproj/xcshareddata/xcschemes/pEpMacOSAdapter.xcscheme View File

@ -4,8 +4,36 @@
version = "1.3">
<BuildAction
parallelizeBuildables = "NO"
buildImplicitDependencies = "YES">
buildImplicitDependencies = "NO">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "4ED6F72425D2ECE5008BCE79"
BuildableName = "libPEPObjCAdapterXPCService.a"
BlueprintName = "PEPObjCAdapterXPCService"
ReferencedContainer = "container:../pep4applemail/PEPObjCAdapterXpcApiClient/PEPObjCAdapterXPCService.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "4E797B9225D523FD0090F900"
BuildableName = "libPEPUpdatesXPCService.a"
BlueprintName = "PEPUpdatesXPCService"
ReferencedContainer = "container:Submodules/PEPUpdatesXPCService/PEPUpdatesXPCService.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"


+ 8
- 3
pEpMacOSAdapter/main.m View File

@ -9,7 +9,8 @@
@import Foundation;
#import "PEPObjCAdapterXPCService.h"
#import <PEPObjCAdapterXPCService.h>
#import <PEPUpdateDownloadXPCService.h>
#include <signal.h>
void signal_TERM(int signal)
@ -22,9 +23,13 @@ int main(int argc, const char *argv[])
{
signal(SIGTERM, signal_TERM);
// Create an instance of the PEP updatedownload service and start it
PEPUpdateDownloadXPCService *updateDownloadService = [PEPUpdateDownloadXPCService new];
[updateDownloadService start];
// Create an instance of the PEP ObjC wrapper Adapter and start it
PEPObjCAdapterXPCService *adapter = [[PEPObjCAdapterXPCService alloc] init];
[adapter start];
PEPObjCAdapterXPCService *objCAdapterService = [[PEPObjCAdapterXPCService alloc] init];
[objCAdapterService start];
NSLog(@"going into main runLoop");
NSRunLoop* runLoop = [NSRunLoop currentRunLoop];


Loading…
Cancel
Save