Browse Source

APPLEMAIL-33 Rename pEpNotifications to PEPUpdatesApp. Create PEPUpdatesXPCService. Add PEPUpdateDownloadXPCService and PEPNotificationXPCService services.

APPLEMAIL-33
David Alarcon 2 years ago
parent
commit
9718556d94
56 changed files with 1708 additions and 53 deletions
  1. +12
    -0
      Submodules/PEPMacOSAdapterXPCService/PEPMacOSAdapterXPCService/PEPMacOSAdapterXPCService.h
  2. +12
    -0
      Submodules/PEPMacOSAdapterXPCService/PEPMacOSAdapterXPCService/PEPMacOSAdapterXPCService.m
  3. +30
    -0
      Submodules/PEPMacOSAdapterXPCService/PEPMacOSAdapterXPCService/PEPNotificationXPCService/Interface/PEPNotificationXPCApiProtocol.h
  4. +20
    -0
      Submodules/PEPMacOSAdapterXPCService/PEPMacOSAdapterXPCService/PEPNotificationXPCService/XPCService/PEPNotificationXPCService.h
  5. +13
    -0
      Submodules/PEPMacOSAdapterXPCService/PEPMacOSAdapterXPCService/PEPNotificationXPCService/XPCService/PEPNotificationXPCService.m
  6. +35
    -0
      Submodules/PEPMacOSAdapterXPCService/PEPMacOSAdapterXPCService/PEPUpdateDownloadXPCService/Interface/PEPUpdateDownloadXPCApiProtocol.h
  7. +4
    -4
      Submodules/PEPMacOSAdapterXPCService/PEPMacOSAdapterXPCService/PEPUpdateDownloadXPCService/PEPUpdateDownloader.h
  8. +147
    -0
      Submodules/PEPMacOSAdapterXPCService/PEPMacOSAdapterXPCService/PEPUpdateDownloadXPCService/PEPUpdateDownloader.mm
  9. +19
    -0
      Submodules/PEPMacOSAdapterXPCService/PEPMacOSAdapterXPCService/PEPUpdateDownloadXPCService/XPCService/PEPUpdateDownloadXPCApi.h
  10. +67
    -0
      Submodules/PEPMacOSAdapterXPCService/PEPMacOSAdapterXPCService/PEPUpdateDownloadXPCService/XPCService/PEPUpdateDownloadXPCApi.m
  11. +20
    -0
      Submodules/PEPMacOSAdapterXPCService/PEPMacOSAdapterXPCService/PEPUpdateDownloadXPCService/XPCService/PEPUpdateDownloadXPCService.h
  12. +78
    -0
      Submodules/PEPMacOSAdapterXPCService/PEPMacOSAdapterXPCService/PEPUpdateDownloadXPCService/XPCService/PEPUpdateDownloadXPCService.m
  13. +467
    -0
      Submodules/PEPUpdatesXPCService/PEPUpdatesXPCService.xcodeproj/project.pbxproj
  14. +0
    -0
      Submodules/PEPUpdatesXPCService/PEPUpdatesXPCService.xcodeproj/project.xcworkspace/contents.xcworkspacedata
  15. +0
    -0
      Submodules/PEPUpdatesXPCService/PEPUpdatesXPCService.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
  16. +81
    -0
      Submodules/PEPUpdatesXPCService/PEPUpdatesXPCService.xcodeproj/xcshareddata/xcschemes/PEPUpdatesXPCService.xcscheme
  17. +30
    -0
      Submodules/PEPUpdatesXPCService/PEPUpdatesXPCService/PEPNotificationXPCService/Interface/PEPNotificationXPCApiProtocol.h
  18. +20
    -0
      Submodules/PEPUpdatesXPCService/PEPUpdatesXPCService/PEPNotificationXPCService/XPCService/PEPNotificationXPCService.h
  19. +13
    -0
      Submodules/PEPUpdatesXPCService/PEPUpdatesXPCService/PEPNotificationXPCService/XPCService/PEPNotificationXPCService.m
  20. +21
    -0
      Submodules/PEPUpdatesXPCService/PEPUpdatesXPCService/PEPUpdateDownloadXPCService/PEPUpdateDownloadXPCApiClient/Interface/PEPUpdateDownloadApiClientService.h
  21. +78
    -0
      Submodules/PEPUpdatesXPCService/PEPUpdatesXPCService/PEPUpdateDownloadXPCService/PEPUpdateDownloadXPCApiClient/XPCService/PEPUpdateDownloadApiClientService.m
  22. +20
    -0
      Submodules/PEPUpdatesXPCService/PEPUpdatesXPCService/PEPUpdateDownloadXPCService/PEPUpdateDownloadXPCService/Interface/PEPUpdateDownloadXPCService.h
  23. +43
    -0
      Submodules/PEPUpdatesXPCService/PEPUpdatesXPCService/PEPUpdateDownloadXPCService/PEPUpdateDownloadXPCService/UpdateDownloader/PEPUpdateDownloader.h
  24. +147
    -0
      Submodules/PEPUpdatesXPCService/PEPUpdatesXPCService/PEPUpdateDownloadXPCService/PEPUpdateDownloadXPCService/UpdateDownloader/PEPUpdateDownloader.mm
  25. +19
    -0
      Submodules/PEPUpdatesXPCService/PEPUpdatesXPCService/PEPUpdateDownloadXPCService/PEPUpdateDownloadXPCService/XPCService/PEPUpdateDownloadXPCApi.h
  26. +81
    -0
      Submodules/PEPUpdatesXPCService/PEPUpdatesXPCService/PEPUpdateDownloadXPCService/PEPUpdateDownloadXPCService/XPCService/PEPUpdateDownloadXPCApi.m
  27. +78
    -0
      Submodules/PEPUpdatesXPCService/PEPUpdatesXPCService/PEPUpdateDownloadXPCService/PEPUpdateDownloadXPCService/XPCService/PEPUpdateDownloadXPCService.m
  28. +37
    -0
      Submodules/PEPUpdatesXPCService/PEPUpdatesXPCService/PEPUpdateDownloadXPCService/Shared/PEPUpdateDownloadXPCApiProtocol.h
  29. +12
    -0
      Submodules/PEPUpdatesXPCService/PEPUpdatesXPCService/PEPUpdatesXPCService.h
  30. +12
    -0
      Submodules/PEPUpdatesXPCService/PEPUpdatesXPCService/PEPUpdatesXPCService.m
  31. +8
    -8
      Submodules/pEpNotifications/PEPUpdatesApp.xcodeproj/project.pbxproj
  32. +7
    -0
      Submodules/pEpNotifications/PEPUpdatesApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata
  33. +8
    -0
      Submodules/pEpNotifications/PEPUpdatesApp.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
  34. +1
    -21
      Submodules/pEpNotifications/PEPUpdatesApp.xcodeproj/xcshareddata/xcschemes/p≡p updates.xcscheme
  35. +0
    -0
      Submodules/pEpNotifications/PEPUpdatesApp/AppDelegate.swift
  36. +0
    -0
      Submodules/pEpNotifications/PEPUpdatesApp/Assets.xcassets/AppIcon.appiconset/AppStore1024x1024-2.png
  37. +0
    -0
      Submodules/pEpNotifications/PEPUpdatesApp/Assets.xcassets/AppIcon.appiconset/Contents.json
  38. +0
    -0
      Submodules/pEpNotifications/PEPUpdatesApp/Assets.xcassets/Contents.json
  39. +0
    -0
      Submodules/pEpNotifications/PEPUpdatesApp/Base.lproj/Main.storyboard
  40. +0
    -0
      Submodules/pEpNotifications/PEPUpdatesApp/DownloadNotificationManager.swift
  41. +0
    -0
      Submodules/pEpNotifications/PEPUpdatesApp/DownloadStateNotifier.swift
  42. +0
    -0
      Submodules/pEpNotifications/PEPUpdatesApp/Info.plist
  43. +0
    -0
      Submodules/pEpNotifications/PEPUpdatesApp/PEPNotification.swift
  44. +0
    -0
      Submodules/pEpNotifications/PEPUpdatesApp/Preview Content/Preview Assets.xcassets/Contents.json
  45. +0
    -0
      Submodules/pEpNotifications/PEPUpdatesApp/de.lproj/Localizable.strings
  46. +0
    -0
      Submodules/pEpNotifications/PEPUpdatesApp/de.lproj/Main.strings
  47. +0
    -0
      Submodules/pEpNotifications/PEPUpdatesApp/en.lproj/Localizable.strings
  48. +0
    -0
      Submodules/pEpNotifications/PEPUpdatesApp/en.lproj/Main.strings
  49. +0
    -0
      Submodules/pEpNotifications/PEPUpdatesApp/pEpNotifications.entitlements
  50. +0
    -0
      Submodules/pEpNotifications/PEPUpdatesAppTests/Info.plist
  51. +0
    -0
      Submodules/pEpNotifications/PEPUpdatesAppTests/pEpNotificationsTests.swift
  52. +10
    -8
      pEpMacOSAdapter.xcodeproj/project.pbxproj
  53. +43
    -0
      pEpMacOSAdapter/PEPUpdateDownloadXPCService/PEPUpdateDownloader.h
  54. +5
    -5
      pEpMacOSAdapter/PEPUpdateDownloadXPCService/PEPUpdateDownloader.mm
  55. +7
    -4
      pEpMacOSAdapter/PEPUpdateDownloadXPCService/XPCService/PEPUpdateDownloadXPCApi.m
  56. +3
    -3
      pEpMacOSAdapter/main.m

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

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

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

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

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

@ -0,0 +1,30 @@
//
// 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

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

@ -0,0 +1,20 @@
//
// 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

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

@ -0,0 +1,13 @@
//
// 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

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

@ -0,0 +1,35 @@
//
// 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

pEpMacOSAdapter/pEpUpdater.h → Submodules/PEPMacOSAdapterXPCService/PEPMacOSAdapterXPCService/PEPUpdateDownloadXPCService/PEPUpdateDownloader.h View File


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

@ -0,0 +1,147 @@
//
// 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

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

@ -0,0 +1,19 @@
//
// 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

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

@ -0,0 +1,67 @@
//
// 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

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

@ -0,0 +1,20 @@
//
// 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

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

@ -0,0 +1,78 @@
//
// 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

+ 467
- 0
Submodules/PEPUpdatesXPCService/PEPUpdatesXPCService.xcodeproj/project.pbxproj View File

@ -0,0 +1,467 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 50;
objects = {
/* Begin PBXBuildFile section */
4E61821525D58162007E040F /* PEPUpdateDownloadApiClientService.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E61821325D58162007E040F /* PEPUpdateDownloadApiClientService.h */; settings = {ATTRIBUTES = (Public, ); }; };
4E61821625D58162007E040F /* PEPUpdateDownloadApiClientService.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E61821425D58162007E040F /* PEPUpdateDownloadApiClientService.m */; };
4E797B9725D523FD0090F900 /* PEPUpdatesXPCService.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E797B9625D523FD0090F900 /* PEPUpdatesXPCService.h */; };
4E797B9925D523FD0090F900 /* PEPUpdatesXPCService.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E797B9825D523FD0090F900 /* PEPUpdatesXPCService.m */; };
4E797BB825D5255F0090F900 /* PEPNotificationXPCApiProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E797BAA25D5255F0090F900 /* PEPNotificationXPCApiProtocol.h */; };
4E797BB925D5255F0090F900 /* PEPNotificationXPCService.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E797BAC25D5255F0090F900 /* PEPNotificationXPCService.m */; };
4E797BBA25D5255F0090F900 /* PEPNotificationXPCService.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E797BAD25D5255F0090F900 /* PEPNotificationXPCService.h */; };
4E797BBB25D5255F0090F900 /* PEPUpdateDownloadXPCApiProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E797BB025D5255F0090F900 /* PEPUpdateDownloadXPCApiProtocol.h */; };
4E797BBC25D5255F0090F900 /* PEPUpdateDownloader.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4E797BB125D5255F0090F900 /* PEPUpdateDownloader.mm */; };
4E797BBD25D5255F0090F900 /* PEPUpdateDownloadXPCApi.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E797BB325D5255F0090F900 /* PEPUpdateDownloadXPCApi.h */; };
4E797BBE25D5255F0090F900 /* PEPUpdateDownloadXPCService.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E797BB425D5255F0090F900 /* PEPUpdateDownloadXPCService.m */; };
4E797BBF25D5255F0090F900 /* PEPUpdateDownloadXPCApi.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E797BB525D5255F0090F900 /* PEPUpdateDownloadXPCApi.m */; };
4E797BC025D5255F0090F900 /* PEPUpdateDownloadXPCService.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E797BB625D5255F0090F900 /* PEPUpdateDownloadXPCService.h */; settings = {ATTRIBUTES = (Public, ); }; };
4E797BC125D5255F0090F900 /* PEPUpdateDownloader.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E797BB725D5255F0090F900 /* PEPUpdateDownloader.h */; };
4E797D8C25D543520090F900 /* libdownloadclient.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4E797D2225D53CCC0090F900 /* libdownloadclient.a */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
4E61821325D58162007E040F /* PEPUpdateDownloadApiClientService.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PEPUpdateDownloadApiClientService.h; sourceTree = "<group>"; };
4E61821425D58162007E040F /* PEPUpdateDownloadApiClientService.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PEPUpdateDownloadApiClientService.m; sourceTree = "<group>"; };
4E797B9325D523FD0090F900 /* libPEPUpdatesXPCService.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPEPUpdatesXPCService.a; sourceTree = BUILT_PRODUCTS_DIR; };
4E797B9625D523FD0090F900 /* PEPUpdatesXPCService.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PEPUpdatesXPCService.h; sourceTree = "<group>"; };
4E797B9825D523FD0090F900 /* PEPUpdatesXPCService.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PEPUpdatesXPCService.m; sourceTree = "<group>"; };
4E797BAA25D5255F0090F900 /* PEPNotificationXPCApiProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PEPNotificationXPCApiProtocol.h; sourceTree = "<group>"; };
4E797BAC25D5255F0090F900 /* PEPNotificationXPCService.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PEPNotificationXPCService.m; sourceTree = "<group>"; };
4E797BAD25D5255F0090F900 /* PEPNotificationXPCService.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PEPNotificationXPCService.h; sourceTree = "<group>"; };
4E797BB025D5255F0090F900 /* PEPUpdateDownloadXPCApiProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PEPUpdateDownloadXPCApiProtocol.h; sourceTree = "<group>"; };
4E797BB125D5255F0090F900 /* PEPUpdateDownloader.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PEPUpdateDownloader.mm; sourceTree = "<group>"; };
4E797BB325D5255F0090F900 /* PEPUpdateDownloadXPCApi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PEPUpdateDownloadXPCApi.h; sourceTree = "<group>"; };
4E797BB425D5255F0090F900 /* PEPUpdateDownloadXPCService.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PEPUpdateDownloadXPCService.m; sourceTree = "<group>"; };
4E797BB525D5255F0090F900 /* PEPUpdateDownloadXPCApi.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PEPUpdateDownloadXPCApi.m; sourceTree = "<group>"; };
4E797BB625D5255F0090F900 /* PEPUpdateDownloadXPCService.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PEPUpdateDownloadXPCService.h; sourceTree = "<group>"; };
4E797BB725D5255F0090F900 /* PEPUpdateDownloader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PEPUpdateDownloader.h; sourceTree = "<group>"; };
4E797BC625D526640090F900 /* libdownloadclient.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libdownloadclient.a; sourceTree = BUILT_PRODUCTS_DIR; };
4E797D2225D53CCC0090F900 /* libdownloadclient.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libdownloadclient.a; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
4E797B9125D523FD0090F900 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
4E797D8C25D543520090F900 /* libdownloadclient.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
4E61820925D57E19007E040F /* PEPUpdateDownloadXPCApiClient */ = {
isa = PBXGroup;
children = (
4E797BAF25D5255F0090F900 /* Interface */,
4E797BB225D5255F0090F900 /* XPCService */,
);
path = PEPUpdateDownloadXPCApiClient;
sourceTree = "<group>";
};
4E61820A25D57EBE007E040F /* PEPUpdateDownloadXPCService */ = {
isa = PBXGroup;
children = (
4E61820B25D57EEC007E040F /* Interface */,
4E61820C25D57EF3007E040F /* XPCService */,
4E61823525D591A2007E040F /* UpdateDownloader */,
);
path = PEPUpdateDownloadXPCService;
sourceTree = "<group>";
};
4E61820B25D57EEC007E040F /* Interface */ = {
isa = PBXGroup;
children = (
4E797BB625D5255F0090F900 /* PEPUpdateDownloadXPCService.h */,
);
path = Interface;
sourceTree = "<group>";
};
4E61820C25D57EF3007E040F /* XPCService */ = {
isa = PBXGroup;
children = (
4E797BB425D5255F0090F900 /* PEPUpdateDownloadXPCService.m */,
4E797BB325D5255F0090F900 /* PEPUpdateDownloadXPCApi.h */,
4E797BB525D5255F0090F900 /* PEPUpdateDownloadXPCApi.m */,
);
path = XPCService;
sourceTree = "<group>";
};
4E61820D25D57F21007E040F /* Shared */ = {
isa = PBXGroup;
children = (
4E797BB025D5255F0090F900 /* PEPUpdateDownloadXPCApiProtocol.h */,
);
path = Shared;
sourceTree = "<group>";
};
4E61823525D591A2007E040F /* UpdateDownloader */ = {
isa = PBXGroup;
children = (
4E797BB725D5255F0090F900 /* PEPUpdateDownloader.h */,
4E797BB125D5255F0090F900 /* PEPUpdateDownloader.mm */,
);
path = UpdateDownloader;
sourceTree = "<group>";
};
4E797B8A25D523FD0090F900 = {
isa = PBXGroup;
children = (
4E797B9525D523FD0090F900 /* PEPUpdatesXPCService */,
4E797B9425D523FD0090F900 /* Products */,
4E797BC525D526640090F900 /* Frameworks */,
);
sourceTree = "<group>";
};
4E797B9425D523FD0090F900 /* Products */ = {
isa = PBXGroup;
children = (
4E797B9325D523FD0090F900 /* libPEPUpdatesXPCService.a */,
);
name = Products;
sourceTree = "<group>";
};
4E797B9525D523FD0090F900 /* PEPUpdatesXPCService */ = {
isa = PBXGroup;
children = (
4E797BAE25D5255F0090F900 /* PEPUpdateDownloadXPCService */,
4E797BA825D5255F0090F900 /* PEPNotificationXPCService */,
4E797B9625D523FD0090F900 /* PEPUpdatesXPCService.h */,
4E797B9825D523FD0090F900 /* PEPUpdatesXPCService.m */,
);
path = PEPUpdatesXPCService;
sourceTree = "<group>";
};
4E797BA825D5255F0090F900 /* PEPNotificationXPCService */ = {
isa = PBXGroup;
children = (
4E797BA925D5255F0090F900 /* Interface */,
4E797BAB25D5255F0090F900 /* XPCService */,
);
path = PEPNotificationXPCService;
sourceTree = "<group>";
};
4E797BA925D5255F0090F900 /* Interface */ = {
isa = PBXGroup;
children = (
4E797BAA25D5255F0090F900 /* PEPNotificationXPCApiProtocol.h */,
);
path = Interface;
sourceTree = "<group>";
};
4E797BAB25D5255F0090F900 /* XPCService */ = {
isa = PBXGroup;
children = (
4E797BAC25D5255F0090F900 /* PEPNotificationXPCService.m */,
4E797BAD25D5255F0090F900 /* PEPNotificationXPCService.h */,
);
path = XPCService;
sourceTree = "<group>";
};
4E797BAE25D5255F0090F900 /* PEPUpdateDownloadXPCService */ = {
isa = PBXGroup;
children = (
4E61820D25D57F21007E040F /* Shared */,
4E61820925D57E19007E040F /* PEPUpdateDownloadXPCApiClient */,
4E61820A25D57EBE007E040F /* PEPUpdateDownloadXPCService */,
);
path = PEPUpdateDownloadXPCService;
sourceTree = "<group>";
};
4E797BAF25D5255F0090F900 /* Interface */ = {
isa = PBXGroup;
children = (
4E61821325D58162007E040F /* PEPUpdateDownloadApiClientService.h */,
);
path = Interface;
sourceTree = "<group>";
};
4E797BB225D5255F0090F900 /* XPCService */ = {
isa = PBXGroup;
children = (
4E61821425D58162007E040F /* PEPUpdateDownloadApiClientService.m */,
);
path = XPCService;
sourceTree = "<group>";
};
4E797BC525D526640090F900 /* Frameworks */ = {
isa = PBXGroup;
children = (
4E797D2225D53CCC0090F900 /* libdownloadclient.a */,
4E797BC625D526640090F900 /* libdownloadclient.a */,
);
name = Frameworks;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXHeadersBuildPhase section */
4E797B8F25D523FD0090F900 /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
4E797BC125D5255F0090F900 /* PEPUpdateDownloader.h in Headers */,
4E797BBA25D5255F0090F900 /* PEPNotificationXPCService.h in Headers */,
4E797BB825D5255F0090F900 /* PEPNotificationXPCApiProtocol.h in Headers */,
4E61821525D58162007E040F /* PEPUpdateDownloadApiClientService.h in Headers */,
4E797BBD25D5255F0090F900 /* PEPUpdateDownloadXPCApi.h in Headers */,
4E797BC025D5255F0090F900 /* PEPUpdateDownloadXPCService.h in Headers */,
4E797BBB25D5255F0090F900 /* PEPUpdateDownloadXPCApiProtocol.h in Headers */,
4E797B9725D523FD0090F900 /* PEPUpdatesXPCService.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXHeadersBuildPhase section */
/* Begin PBXNativeTarget section */
4E797B9225D523FD0090F900 /* PEPUpdatesXPCService */ = {
isa = PBXNativeTarget;
buildConfigurationList = 4E797B9C25D523FD0090F900 /* Build configuration list for PBXNativeTarget "PEPUpdatesXPCService" */;
buildPhases = (
4E797B8F25D523FD0090F900 /* Headers */,
4E797B9025D523FD0090F900 /* Sources */,
4E797B9125D523FD0090F900 /* Frameworks */,
);
buildRules = (
);
dependencies = (
);
name = PEPUpdatesXPCService;
productName = PEPUpdatesXPCService;
productReference = 4E797B9325D523FD0090F900 /* libPEPUpdatesXPCService.a */;
productType = "com.apple.product-type.library.static";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
4E797B8B25D523FD0090F900 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1240;
TargetAttributes = {
4E797B9225D523FD0090F900 = {
CreatedOnToolsVersion = 12.4;
};
};
};
buildConfigurationList = 4E797B8E25D523FD0090F900 /* Build configuration list for PBXProject "PEPUpdatesXPCService" */;
compatibilityVersion = "Xcode 9.3";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 4E797B8A25D523FD0090F900;
productRefGroup = 4E797B9425D523FD0090F900 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
4E797B9225D523FD0090F900 /* PEPUpdatesXPCService */,
);
};
/* End PBXProject section */
/* Begin PBXSourcesBuildPhase section */
4E797B9025D523FD0090F900 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
4E797BBE25D5255F0090F900 /* PEPUpdateDownloadXPCService.m in Sources */,
4E797BB925D5255F0090F900 /* PEPNotificationXPCService.m in Sources */,
4E61821625D58162007E040F /* PEPUpdateDownloadApiClientService.m in Sources */,
4E797BBF25D5255F0090F900 /* PEPUpdateDownloadXPCApi.m in Sources */,
4E797B9925D523FD0090F900 /* PEPUpdatesXPCService.m in Sources */,
4E797BBC25D5255F0090F900 /* PEPUpdateDownloader.mm in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin XCBuildConfiguration section */
4E797B9A25D523FD0090F900 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = (
"$(PROJECT_DIR)/../../../local/include",
"$(PROJECT_DIR)/../../../downloadclient",
);
MACOSX_DEPLOYMENT_TARGET = 11.1;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = "$(OTHER_LDFLAGS)";
SDKROOT = macosx;
USER_HEADER_SEARCH_PATHS = "";
};
name = Debug;
};
4E797B9B25D523FD0090F900 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = (
"$(PROJECT_DIR)/../../../local/include",
"$(PROJECT_DIR)/../../../downloadclient",
);
MACOSX_DEPLOYMENT_TARGET = 11.1;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
OTHER_LDFLAGS = "$(OTHER_LDFLAGS)";
SDKROOT = macosx;
USER_HEADER_SEARCH_PATHS = "";
};
name = Release;
};
4E797B9D25D523FD0090F900 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = NQLYU6MGPN;
EXECUTABLE_PREFIX = lib;
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)",
);
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
USER_HEADER_SEARCH_PATHS = "$(inherited)";
};
name = Debug;
};
4E797B9E25D523FD0090F900 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = NQLYU6MGPN;
EXECUTABLE_PREFIX = lib;
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)",
);
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
USER_HEADER_SEARCH_PATHS = "$(inherited)";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
4E797B8E25D523FD0090F900 /* Build configuration list for PBXProject "PEPUpdatesXPCService" */ = {
isa = XCConfigurationList;
buildConfigurations = (
4E797B9A25D523FD0090F900 /* Debug */,
4E797B9B25D523FD0090F900 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
4E797B9C25D523FD0090F900 /* Build configuration list for PBXNativeTarget "PEPUpdatesXPCService" */ = {
isa = XCConfigurationList;
buildConfigurations = (
4E797B9D25D523FD0090F900 /* Debug */,
4E797B9E25D523FD0090F900 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 4E797B8B25D523FD0090F900 /* Project object */;
}

Submodules/pEpNotifications/pEpNotifications.xcodeproj/project.xcworkspace/contents.xcworkspacedata → Submodules/PEPUpdatesXPCService/PEPUpdatesXPCService.xcodeproj/project.xcworkspace/contents.xcworkspacedata View File


Submodules/pEpNotifications/pEpNotifications.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist → Submodules/PEPUpdatesXPCService/PEPUpdatesXPCService.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist View File


+ 81
- 0
Submodules/PEPUpdatesXPCService/PEPUpdatesXPCService.xcodeproj/xcshareddata/xcschemes/PEPUpdatesXPCService.xcscheme View File

@ -0,0 +1,81 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1240"
version = "1.3">
<BuildAction
parallelizeBuildables = "NO"
buildImplicitDependencies = "NO">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "35380AC5247BBB03004A08A6"
BuildableName = "libdownloadclient.a"
BlueprintName = "downloadclient"
ReferencedContainer = "container:../../../downloadclient/downloadclient.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:PEPUpdatesXPCService.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "4E797B9225D523FD0090F900"
BuildableName = "libPEPUpdatesXPCService.a"
BlueprintName = "PEPUpdatesXPCService"
ReferencedContainer = "container:PEPUpdatesXPCService.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

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

@ -0,0 +1,30 @@
//
// 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

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

@ -0,0 +1,20 @@
//
// 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

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

@ -0,0 +1,13 @@
//
// 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

+ 21
- 0
Submodules/PEPUpdatesXPCService/PEPUpdatesXPCService/PEPUpdateDownloadXPCService/PEPUpdateDownloadXPCApiClient/Interface/PEPUpdateDownloadApiClientService.h View File

@ -0,0 +1,21 @@
//
// PEPUpdateDownloadApiClientService.h
// PEPUpdatesXPCService
//
// Created by David Alarcon on 11/2/21.
//
#import <Foundation/Foundation.h>
#import "PEPUpdateDownloadXPCApiProtocol.h"
NS_ASSUME_NONNULL_BEGIN
@interface PEPUpdateDownloadApiClientService : NSObject <PEPUpdateDownloadXPCApiProtocol>
- (void)start;
- (void)stop;
@end
NS_ASSUME_NONNULL_END

+ 78
- 0
Submodules/PEPUpdatesXPCService/PEPUpdatesXPCService/PEPUpdateDownloadXPCService/PEPUpdateDownloadXPCApiClient/XPCService/PEPUpdateDownloadApiClientService.m View File

@ -0,0 +1,78 @@
//
// PEPUpdateDownloadApiClientService.m
// PEPUpdatesXPCService
//
// Created by David Alarcon on 11/2/21.
//
#import "PEPUpdateDownloadApiClientService.h"
@interface PEPUpdateDownloadApiClientService ()
@property (nonatomic, strong) NSXPCConnection *connection;
@property (nonatomic) id<PEPUpdateDownloadXPCApiProtocol> pEpUpdateDownload;
@end
@implementation PEPUpdateDownloadApiClientService
- (void)start {
[self connectToXPCService];
}
- (void)stop {
self.connection = nil;
}
// MARK: - Private
- (void)connectToXPCService {
self.connection = [[NSXPCConnection alloc] initWithMachServiceName:pEpUpdateDownloadXPCMachName
options:0];
NSXPCInterface *remoteObjectInterface = [NSXPCInterface interfaceWithProtocol:@protocol(PEPUpdateDownloadXPCApiProtocol)];
self.connection.remoteObjectInterface = remoteObjectInterface;
__weak typeof(self) weakSelf = self;
self.connection.invalidationHandler = ^{
__strong typeof(weakSelf) strongSelf = weakSelf;
strongSelf.connection = nil;
NSLog(@"Connection has been invalidated.\n");
};
self.connection.interruptionHandler = ^{
__strong typeof(self) strongSelf = weakSelf;
strongSelf.connection.interruptionHandler = nil;
NSLog(@"Connection has been interrupted.\n");
};
// New connections always start in a suspended state
[self.connection resume];
// The remote object
self.pEpUpdateDownload = [self.connection remoteObjectProxyWithErrorHandler:^(NSError * _Nonnull error) {
}];
}
// MARK: - PEPUpdateDownloadXPCApiProtocol
- (void)subscribeForUpdate:(NSXPCListenerEndpoint *)endpoint {
[self.pEpUpdateDownload subscribeForUpdate:endpoint];
}
- (void)unsubscribeForUpdate {
[self.pEpUpdateDownload unsubscribeForUpdate];
}
- (void)scheduleUpdates {
[self.pEpUpdateDownload scheduleUpdates];
}
- (void)stopUpdates {
[self.pEpUpdateDownload stopUpdates];
}
- (void)updateNow {
[self.pEpUpdateDownload updateNow];
}
@end

+ 20
- 0
Submodules/PEPUpdatesXPCService/PEPUpdatesXPCService/PEPUpdateDownloadXPCService/PEPUpdateDownloadXPCService/Interface/PEPUpdateDownloadXPCService.h View File

@ -0,0 +1,20 @@
//
// 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

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

@ -0,0 +1,43 @@
//
// 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

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

@ -0,0 +1,147 @@
//
// 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

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

@ -0,0 +1,19 @@
//
// 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

+ 81
- 0
Submodules/PEPUpdatesXPCService/PEPUpdatesXPCService/PEPUpdateDownloadXPCService/PEPUpdateDownloadXPCService/XPCService/PEPUpdateDownloadXPCApi.m View File

@ -0,0 +1,81 @@
//
// 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;
@interface PEPUpdateDownloadXPCApi ()
@property (nonatomic) PEPUpdateDownloader *updater;
@end
@implementation PEPUpdateDownloadXPCApi
- (void)subscribeForUpdate:(NSXPCListenerEndpoint*)endpoint {
NSLog(@"subscribeForUpdate called");
if (!self.updater) {
self.updater = [PEPUpdateDownloader new];
}
///NotificationXPCService *service = ....
///[service start];
if (self.updater) {
_clientConnection = [[NSXPCConnection alloc] initWithListenerEndpoint:endpoint];
_clientConnection.remoteObjectInterface = [NSXPCInterface
interfaceWithProtocol:@protocol(PEPNotificationXPCApiProtocol)];
__weak typeof(self) weakSelf = self;
_clientConnection.interruptionHandler = ^(){
__strong typeof(self) strongSelf = weakSelf;
NSLog(@"interruption");
strongSelf.updater.subscriber = nil;
};
_clientConnection.invalidationHandler = ^(){
__strong typeof(self) strongSelf = weakSelf;
NSLog(@"invalidation");
strongSelf.updater.subscriber = nil;
};
[_clientConnection resume];
PEPNotification* downloadNotification = [_clientConnection remoteObjectProxyWithErrorHandler:^(NSError*err) {
NSLog(@"%@", err);
}];
self.updater.subscriber = downloadNotification;
if (downloadNotification) {
[downloadNotification notifyDownload:ready withName:@"" withFilename:@""];
}
}
}
- (void)unsubscribeForUpdate {
NSLog(@"unsubscribeForUpdate called");
if (self.updater) self.updater.subscriber = nil;
}
- (void)updateNow {
NSLog(@"updateNow called");
if (self.updater) [self.updater updateAll];
}
- (void)scheduleUpdates {
NSLog(@"scheduleUpdates called");
if (self.updater) [self.updater scheduleUpdates];
}
- (void)stopUpdates {
NSLog(@"stopUpdates called");
if (self.updater) [self.updater stopUpdates];
}
@end

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

@ -0,0 +1,78 @@
//
// 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:pEpUpdateDownloadXPCMachName];
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

+ 37
- 0
Submodules/PEPUpdatesXPCService/PEPUpdatesXPCService/PEPUpdateDownloadXPCService/Shared/PEPUpdateDownloadXPCApiProtocol.h View File

@ -0,0 +1,37 @@
//
// 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>
static NSString *pEpUpdateDownloadXPCMachName = @"foundation.pEp.adapter.macOS_OpenStep";
/// 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

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

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

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

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

Submodules/pEpNotifications/pEpNotifications.xcodeproj/project.pbxproj → Submodules/pEpNotifications/PEPUpdatesApp.xcodeproj/project.pbxproj View File


+ 7
- 0
Submodules/pEpNotifications/PEPUpdatesApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:">
</FileRef>
</Workspace>

+ 8
- 0
Submodules/pEpNotifications/PEPUpdatesApp.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>

Submodules/pEpNotifications/pEpNotifications.xcodeproj/xcshareddata/xcschemes/p≡p updates.xcscheme → Submodules/pEpNotifications/PEPUpdatesApp.xcodeproj/xcshareddata/xcschemes/p≡p updates.xcscheme View File


Submodules/pEpNotifications/pEpNotifications/AppDelegate.swift → Submodules/pEpNotifications/PEPUpdatesApp/AppDelegate.swift View File


Submodules/pEpNotifications/pEpNotifications/Assets.xcassets/AppIcon.appiconset/AppStore1024x1024-2.png → Submodules/pEpNotifications/PEPUpdatesApp/Assets.xcassets/AppIcon.appiconset/AppStore1024x1024-2.png View File


Submodules/pEpNotifications/pEpNotifications/Assets.xcassets/AppIcon.appiconset/Contents.json → Submodules/pEpNotifications/PEPUpdatesApp/Assets.xcassets/AppIcon.appiconset/Contents.json View File


Submodules/pEpNotifications/pEpNotifications/Assets.xcassets/Contents.json → Submodules/pEpNotifications/PEPUpdatesApp/Assets.xcassets/Contents.json View File


Submodules/pEpNotifications/pEpNotifications/Base.lproj/Main.storyboard → Submodules/pEpNotifications/PEPUpdatesApp/Base.lproj/Main.storyboard View File


Submodules/pEpNotifications/pEpNotifications/DownloadNotificationManager.swift → Submodules/pEpNotifications/PEPUpdatesApp/DownloadNotificationManager.swift View File


Submodules/pEpNotifications/pEpNotifications/DownloadStateNotifier.swift → Submodules/pEpNotifications/PEPUpdatesApp/DownloadStateNotifier.swift View File


Submodules/pEpNotifications/pEpNotifications/Info.plist → Submodules/pEpNotifications/PEPUpdatesApp/Info.plist View File


Submodules/pEpNotifications/pEpNotifications/PEPNotification.swift → Submodules/pEpNotifications/PEPUpdatesApp/PEPNotification.swift View File


Submodules/pEpNotifications/pEpNotifications/Preview Content/Preview Assets.xcassets/Contents.json → Submodules/pEpNotifications/PEPUpdatesApp/Preview Content/Preview Assets.xcassets/Contents.json View File


Submodules/pEpNotifications/pEpNotifications/de.lproj/Localizable.strings → Submodules/pEpNotifications/PEPUpdatesApp/de.lproj/Localizable.strings View File


Submodules/pEpNotifications/pEpNotifications/de.lproj/Main.strings → Submodules/pEpNotifications/PEPUpdatesApp/de.lproj/Main.strings View File


Submodules/pEpNotifications/pEpNotifications/en.lproj/Localizable.strings → Submodules/pEpNotifications/PEPUpdatesApp/en.lproj/Localizable.strings View File


Submodules/pEpNotifications/pEpNotifications/en.lproj/Main.strings → Submodules/pEpNotifications/PEPUpdatesApp/en.lproj/Main.strings View File


Submodules/pEpNotifications/pEpNotifications/pEpNotifications.entitlements → Submodules/pEpNotifications/PEPUpdatesApp/pEpNotifications.entitlements View File


Submodules/pEpNotifications/pEpNotificationsTests/Info.plist → Submodules/pEpNotifications/PEPUpdatesAppTests/Info.plist View File


Submodules/pEpNotifications/pEpNotificationsTests/pEpNotificationsTests.swift → Submodules/pEpNotifications/PEPUpdatesAppTests/pEpNotificationsTests.swift View File


+ 10
- 8
pEpMacOSAdapter.xcodeproj/project.pbxproj View File

@ -7,15 +7,15 @@
objects = {
/* Begin PBXBuildFile section */
15AC46BC254EE19600AA18DE /* libdownloadclient.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15AC46BB254EE19600AA18DE /* libdownloadclient.a */; };
35380AE7247BD13A004A08A6 /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = 35380AE6247BD13A004A08A6 /* README.md */; };
35380AEA247C784E004A08A6 /* pEpUpdater.mm in Sources */ = {isa = PBXBuildFile; fileRef = 35380AE9247C784E004A08A6 /* pEpUpdater.mm */; };
35380AEA247C784E004A08A6 /* PEPUpdateDownloader.mm in Sources */ = {isa = PBXBuildFile; fileRef = 35380AE9247C784E004A08A6 /* PEPUpdateDownloader.mm */; };
35DC18DA244DA19100FB2002 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 35DC18D9244DA19100FB2002 /* main.m */; };
4E2F30F425D2A9B0002AFD0C /* PEPUpdateDownloadXPCService.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E2F30F325D2A9B0002AFD0C /* PEPUpdateDownloadXPCService.m */; };
4E2F30F925D2A9CC002AFD0C /* PEPNotificationXPCService.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E2F30F825D2A9CC002AFD0C /* PEPNotificationXPCService.m */; };
4E2F30FE25D2AE1E002AFD0C /* PEPUpdateDownloadXPCApi.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E2F30FD25D2AE1E002AFD0C /* PEPUpdateDownloadXPCApi.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 */; };
4E797BCB25D526740090F900 /* libPEPUpdatesXPCService.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4E797BCA25D526740090F900 /* libPEPUpdatesXPCService.a */; };
4E9F55D025D3D4B8005BD46F /* libPEPObjCAdapterXPCService.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4E9F55CF25D3D4B8005BD46F /* libPEPObjCAdapterXPCService.a */; };
/* End PBXBuildFile section */
@ -27,8 +27,8 @@
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; };
35380AE8247C784E004A08A6 /* pEpUpdater.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = pEpUpdater.h; sourceTree = "<group>"; };
35380AE9247C784E004A08A6 /* pEpUpdater.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = pEpUpdater.mm; sourceTree = "<group>"; };
35380AE8247C784E004A08A6 /* PEPUpdateDownloader.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PEPUpdateDownloader.h; sourceTree = "<group>"; };
35380AE9247C784E004A08A6 /* PEPUpdateDownloader.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = PEPUpdateDownloader.mm; sourceTree = "<group>"; };
35DC18D2244DA19100FB2002 /* foundation.pEp.adapter.macOS.xpc */ = {isa = PBXFileReference; explicitFileType = "wrapper.xpc-service"; includeInIndex = 0; path = foundation.pEp.adapter.macOS.xpc; sourceTree = BUILT_PRODUCTS_DIR; };
35DC18D5244DA19100FB2002 /* PEPUpdateDownloadXPCApiProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PEPUpdateDownloadXPCApiProtocol.h; sourceTree = "<group>"; };
35DC18D9244DA19100FB2002 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
@ -43,6 +43,7 @@
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; };
/* End PBXFileReference section */