Browse Source

Merge branch 'APPLEMAIL-58'

* APPLEMAIL-58:
  APPLEMAIL-58 Code review modifications.
  APPLEMAIL-58 Add encrypt myself in xpc client.
  APPLEMAIL-58 Add encrypt myself xpc into protocol.
APPLEMAIL-55
David Alarcon 1 year ago
parent
commit
ebc1caaeec
4 changed files with 61 additions and 1 deletions
  1. +17
    -0
      Subprojects/PEPObjCAdapterXPCService/PEPObjCAdapterXPCApiClient/XPCService/PEPObjCAdapterXPCApiClientService.m
  2. +20
    -0
      Subprojects/PEPObjCAdapterXPCService/PEPObjCAdapterXPCService/XPCService/PEPObjCAdapterXPCApi.m
  3. +5
    -0
      Subprojects/PEPObjCAdapterXPCService/Shared/PEPObjCAdapterXpcApiProtocol.h
  4. +19
    -1
      pEpMacOSAdapter.xcodeproj/xcshareddata/xcschemes/pEpMacOSAdapter.xcscheme

+ 17
- 0
Subprojects/PEPObjCAdapterXPCService/PEPObjCAdapterXPCApiClient/XPCService/PEPObjCAdapterXPCApiClientService.m View File

@ -87,6 +87,23 @@ successCallback:(nonnull void (^)(PEPIdentity * _Nonnull))successCallback {
}];
}
- (void)encryptMessage:(PEPMessage *)message
forSelf:(PEPIdentity *)ownIdentity
extraKeys:(PEPStringList *_Nullable)extraKeys
errorCallback:(void (^)(NSError *error))errorCallback
successCallback:(void (^)(PEPMessage *srcMessage,
PEPMessage *destMessage))successCallback {
[[self.connection remoteObjectProxyWithErrorHandler:^(NSError * _Nonnull error) {
errorCallback(error);
}] encryptMessage:message forSelf:ownIdentity extraKeys:extraKeys
resultBlock:^(PEPObjCAdapterXpcApiResult * _Nonnull result) {
PEPMessage *srcMessage = result.result[0];
PEPMessage *destMessage = result.result[1];
successCallback(srcMessage, destMessage);
}];
}
- (void)outgoingRatingForMessage:(PEPMessage *)theMessage
errorCallback:(void (^)(NSError * _Nonnull))errorCallback
successCallback:(void (^)(PEPRating))successCallback {


+ 20
- 0
Subprojects/PEPObjCAdapterXPCService/PEPObjCAdapterXPCService/XPCService/PEPObjCAdapterXPCApi.m View File

@ -75,4 +75,24 @@
resultCallback(result);
}
- (void)encryptMessage:(PEPMessage *)message
forSelf:(PEPIdentity *)ownIdentity
extraKeys:(PEPStringList *)extraKeys
resultBlock:(void (^)(PEPObjCAdapterXpcApiResult * _Nonnull))resultCallback {
NSLog(@"%s", __PRETTY_FUNCTION__);
PEPSession *session = [PEPSession new];
[session encryptMessage:message forSelf:ownIdentity extraKeys:extraKeys errorCallback:^(NSError * _Nonnull error) {
PEPObjCAdapterXpcApiResult *result = [[PEPObjCAdapterXpcApiResult alloc]
initWithResult:nil
error:error];
resultCallback(result);
} successCallback:^(PEPMessage * _Nonnull srcMessage, PEPMessage * _Nonnull destMessage) {
PEPObjCAdapterXpcApiResult *result = [[PEPObjCAdapterXpcApiResult alloc]
initWithResult:@[srcMessage, destMessage]
error:nil];
resultCallback(result);
}];
}
@end

+ 5
- 0
Subprojects/PEPObjCAdapterXPCService/Shared/PEPObjCAdapterXpcApiProtocol.h View File

@ -30,6 +30,11 @@ NS_ASSUME_NONNULL_BEGIN
- (void)colorFromRating:(PEPRating)rating
resultBlock:(void (^)(PEPObjCAdapterXpcApiResult *))resultCallback;
- (void)encryptMessage:(PEPMessage *)message
forSelf:(PEPIdentity *)ownIdentity
extraKeys:(PEPStringList *_Nullable)extraKeys
resultBlock:(void (^)(PEPObjCAdapterXpcApiResult *))resultCallback;
@end
NS_ASSUME_NONNULL_END

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

@ -1,10 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1200"
version = "1.3">
version = "1.7">
<BuildAction
parallelizeBuildables = "NO"
buildImplicitDependencies = "NO">
<PreActions>
<ExecutionAction
ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction">
<ActionContent
title = "Clean before build"
scriptText = "rm -rf ${BUILT_PRODUCTS_DIR}&#10;">
<EnvironmentBuildable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "35DC18D1244DA19100FB2002"
BuildableName = "foundation.pEp.adapter.macOS.xpc"
BlueprintName = "foundation.pEp.adapter.macOS"
ReferencedContainer = "container:pEpMacOSAdapter.xcodeproj">
</BuildableReference>
</EnvironmentBuildable>
</ActionContent>
</ExecutionAction>
</PreActions>
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"


Loading…
Cancel
Save