Post

Replies

Boosts

Views

Activity

Reply to Could not build module 'NetworkExtension' error
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?
Apr ’20
Reply to Could not build module 'NetworkExtension' error
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
Apr ’20
Reply to Could not build module 'NetworkExtension' error
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!
Mar ’20