Closed xilu-wang closed 10 months ago
Ah, this also checks the app's name:
#define APP_NAME @"DNSMonitor.app"
if(YES != [NSBundle.mainBundle.bundlePath isEqualToString:[@"/Applications" stringByAppendingPathComponent:APP_NAME]]) {
NSLog(@"\n\nERROR: As %@ uses a System Extension, Apple requires it must be located in /Applications\n\n", [APP_NAME stringByDeletingPathExtension]);
}
I'll update it to just check for /Applications
so you can name it whatever you want ...but for now, to "fix" this issue, just make sure the app is called "DNSMonitor.app" or if you're recompiling, change APP_NAME
to your app's name.
Hi @objective-see , Thanks so much for the quick response! The new code doesn't have the error now. But I see another error:
Here is the application layout on my setup:
I didn't change anything in consts.h
I am new to the network extension. Any help would be very appreciated :). Thanks
Well, if you changing the name of the app (and maybe other things), the OS won't be happy
Also, you'll have to build your own profile so you can load the extension.
You can't use an extension named com.objective-see...
that is in a non-Obj-See app.
I'd recommend watching: Network Extensions for the Modern Mac.
There are several prerequisites that you have to fulfill for your own extension:
...so its better to start by building you own from scratch, vs. trying to change/modify this one.
I've given detailed on talk on how to do this, so I'd recommend starting there too: "Nothing but Net: Leveraging macOS's Networking Frameworks to Heuristically Detect Malware"
(base) [/Applications]$ DNSMonitor.app/Contents/MacOS/DNSMonitor 2023-11-17 13:57:15.748 DNSMonitor[39355:804331] Started dnsmon.app (pid: 39355, parent: com.apple.Terminal) 2023-11-17 13:57:15.748 DNSMonitor[39355:804331]
ERROR: As dnsmon uses a System Extension, Apple requires it must be located in /Applications
(base) [/Applications]$
env:
Apple M1 Max, Version 14.0 (23A344)