My plugin packaged the following path:
./UCTunnel.app/Contents/Library/SystemExtensions/org.uc.UCTunnel.UCPacketTunnel.systemextension/Contents/MacOS/org.uc.UCTunnel.UCPacketTunnel
And I use the System Network Extension XCode Template with a main.m and PacketTunnelProvider.m
int main(int argc, char *argv[])
{
@autoreleasepool {
[NEProvider startSystemExtensionMode];
}
dispatch_main();
}
@implementation PacketTunnelProvider
- (void)startTunnelWithOptions:(NSDictionary *)options completionHandler:(void (^)(NSError *))completionHandler {
// Add code here to start the process of connecting the tunnel.
completionHandler(nil);
}
- (void)stopTunnelWithReason:(NEProviderStopReason)reason completionHandler:(void (^)(void))completionHandler {
// Add code here to start the process of stopping the tunnel.
completionHandler();
}
- (void)handleAppMessage:(NSData *)messageData completionHandler:(void (^)(NSData *))completionHandler {
// Add code here to handle the message.
}
- (void)sleepWithCompletionHandler:(void (^)(void))completionHandler {
// Add code here to get ready to sleep.
completionHandler();
}
- (void)wake {
// Add code here to wake up.
}
@end