@@ -43,6 +43,26 @@ @implementation MTRDeviceController_XPC
43
43
44
44
@synthesize uniqueIdentifier = _uniqueIdentifier;
45
45
46
+ - (NSXPCInterface *)_interfaceForClientProtocol
47
+ {
48
+ NSXPCInterface * interface = [NSXPCInterface interfaceWithProtocol: @protocol (MTRXPCClientProtocol)];
49
+ NSSet * allowedClasses = [NSSet setWithArray: @[
50
+ [NSString class ], [NSNumber class ], [NSData class ], [NSArray class ], [NSDictionary class ], [NSError class ], [MTRAttributePath class ]
51
+ ]];
52
+ [interface setClasses: allowedClasses
53
+ forSelector: @selector (device:receivedAttributeReport: )
54
+ argumentIndex: 1
55
+ ofReply: NO ];
56
+ allowedClasses = [NSSet setWithArray: @[
57
+ [NSString class ], [NSNumber class ], [NSData class ], [NSArray class ], [NSDictionary class ], [NSError class ], [MTREventPath class ]
58
+ ]];
59
+ [interface setClasses: allowedClasses
60
+ forSelector: @selector (device:receivedEventReport: )
61
+ argumentIndex: 1
62
+ ofReply: NO ];
63
+ return interface;
64
+ }
65
+
46
66
- (id )initWithUniqueIdentifier : (NSUUID *)UUID xpConnectionBlock : (NSXPCConnection * (^)(void ) )connectionBlock
47
67
{
48
68
if (self = [super initForSubclasses ]) {
@@ -64,7 +84,7 @@ - (id)initWithUniqueIdentifier:(NSUUID *)UUID xpConnectionBlock:(NSXPCConnection
64
84
if (self.xpcConnection ) {
65
85
self.xpcConnection .remoteObjectInterface = [NSXPCInterface interfaceWithProtocol: @protocol (MTRXPCServerProtocol)];
66
86
67
- self.xpcConnection .exportedInterface = [NSXPCInterface interfaceWithProtocol: @protocol (MTRXPCClientProtocol) ];
87
+ self.xpcConnection .exportedInterface = [self _interfaceForClientProtocol ];
68
88
self.xpcConnection .exportedObject = self;
69
89
70
90
self.xpcConnection .interruptionHandler = ^{
0 commit comments