From c5598d23619a72dbf62ad6ee0d35e3e652457340 Mon Sep 17 00:00:00 2001 From: Carter Li Date: Wed, 26 Aug 2026 15:21:04 +0800 Subject: [PATCH] LM (macOS): adds support --- CMakeLists.txt | 2 +- src/detection/lm/lm_apple.m | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 src/detection/lm/lm_apple.m diff --git a/CMakeLists.txt b/CMakeLists.txt index 33e72853b..be5f4d764 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1050,7 +1050,7 @@ elseif(APPLE) src/detection/icons/icons_nosupport.c src/detection/initsystem/initsystem_linux.c src/detection/keyboard/keyboard_apple.c - src/detection/lm/lm_nosupport.c + src/detection/lm/lm_apple.m src/detection/loadavg/loadavg_bsd.c src/detection/libc/libc_apple.c src/detection/locale/locale_linux.c diff --git a/src/detection/lm/lm_apple.m b/src/detection/lm/lm_apple.m new file mode 100644 index 000000000..d600058d4 --- /dev/null +++ b/src/detection/lm/lm_apple.m @@ -0,0 +1,18 @@ +#include "lm.h" + +#import + +const char* ffDetectLM(FFLMResult* result) { + ffStrbufSetStatic(&result->service, "loginwindow"); + ffStrbufSetStatic(&result->prettyName, "Login Window"); + + NSError* error; + NSDictionary* dict = [NSDictionary dictionaryWithContentsOfURL:[NSURL fileURLWithPath:@"/System/Library/CoreServices/loginwindow.app/Contents/Info.plist" isDirectory:NO] + error:&error]; + + if (dict) { + ffStrbufSetS(&result->version, ((NSString*) dict[@"CFBundleShortVersionString"]).UTF8String); + } + + return nullptr; +}