So it turns out I had to #include HIDDriverKit/IOUserHIDEventService.iig which solved everything.
can close this issue.
Post
Replies
Boosts
Views
Activity
OK so I figured that I should have marked both targets for my IPCConnection class.
I'v created an App project, then under that project I created another "Network Extension" target which created another folder in my App project.
The IPCConnection class is within this NetworkExtension target, and I'm trying to access it through the ViewController in my App project
Okay I figured that it was my problem all the time, I had a return statement before without authorizing this event which causes the hang.
Thank you for your time!
I'll pay more attention next time :-)
OK. You should definitely retest with both the latest 10.15.x and the latest 11.0 beta.
Tested on macOS 10.15.6 and got the same results.
When using
ES_EVENT_TYPE_NOTIFY_MMAP
everything seems to work good except I need to block this call instead of getting notified.
I'm wondering if I'm missing anything?!
I can post the entire code in my project if that's somehow helpful.
I'm running it on macOS 10.15.4
It seems that my extensionMachServiceName(from:) method does return what it should.This is my Info.plist file's content<?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>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>NetworkExtension</key>
<dict>
<key>NEMachServiceName</key>
<string>com.example.apple-samplecode.SimpleFirewall</string>
<key>NEProviderClasses</key>
<dict>
<key>com.apple.networkextension.filter-data</key>
<string>MyNetworkExtension.FilterDataProvider</string>
</dict>
</dict>
</dict>
</plist>Just to make sure, I'm not running it as an app bundle, but as a command line project, so the part of the ViewController & AppCommunication I assume is pretty useless for me right?
I'm trying to use the code sample as a starting point with NetworkExtensionthough I'm having some troubles when trying to execute the "register" function in IPCConnectionBTW I'm new to swift (never had any expirience with it before, I'm coming from low level C so I'm not that familiar with this syntax).I'm getting an error for the lines guard let providerProxy = newConnection.remoteObjectProxyWithErrorHandler({ registerError in
os_log("Failed to register with the provider: %@", registerError.localizedDescription)
self.currentConnection?.invalidate()
self.currentConnection = nil
completionHandler(false)
}) as? ProviderCommunication else {
fatalError("Failed to create a remote object proxy for the provider")
}the "fatalError" line is the one I'm reaching, and I haven't got an idea regarding the cause of the issue.--- EDIT:Okay, so I figured I forgot to actually set the provider using the linenewConnection.remoteObjectInterface = NSXPCInterface(with: ProviderCommunication.self)and now it's running without any fatal errors, but I'm still getting the next errorFailed to register with the provider: %@ Couldn’t communicate with a helper application.Not sure what's "helper application" means
Hi,After digging a bit, I understand that it is not possible to create NetworkExtension using native C command line And I'd rather do it in swift.Is there any good tutorial on how It can be done?Since it has much differences than writing EnpointSecurity SystemExtension, this one requires IPC Communication.And from the code sample on Filter Network Traffic there's a little I can understand.Thanks!