Skip to content

Commit 09bef5f

Browse files
committed
OS (macOS): removes fallback parsing of legacy macOS license file
Doesn't work on Tahoe anymore
1 parent e394efd commit 09bef5f

File tree

1 file changed

+1
-23
lines changed

1 file changed

+1
-23
lines changed

src/detection/os/os_apple.m

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -80,27 +80,6 @@ static bool detectOSCodeName(FFOSResult* os)
8080
return false;
8181
}
8282

83-
static void parseOSXSoftwareLicense(FFOSResult* os)
84-
{
85-
FF_AUTO_CLOSE_FILE FILE* rtf = fopen("/System/Library/CoreServices/Setup Assistant.app/Contents/Resources/en.lproj/OSXSoftwareLicense.rtf", "r");
86-
if(rtf == NULL)
87-
return;
88-
89-
FF_AUTO_FREE char* line = NULL;
90-
size_t len = 0;
91-
const char* searchStr = "\\f0\\b SOFTWARE LICENSE AGREEMENT FOR macOS ";
92-
while(getline(&line, &len, rtf) != EOF)
93-
{
94-
if (ffStrStartsWith(line, searchStr))
95-
{
96-
ffStrbufAppendS(&os->codename, line + strlen(searchStr));
97-
ffStrbufTrimRight(&os->codename, '\n');
98-
ffStrbufTrimRight(&os->codename, '\\');
99-
break;
100-
}
101-
}
102-
}
103-
10483
void ffDetectOSImpl(FFOSResult* os)
10584
{
10685
parseSystemVersion(os);
@@ -115,6 +94,5 @@ void ffDetectOSImpl(FFOSResult* os)
11594

11695
ffStrbufAppend(&os->versionID, &os->version);
11796

118-
if(!detectOSCodeName(os))
119-
parseOSXSoftwareLicense(os);
97+
detectOSCodeName(os);
12098
}

0 commit comments

Comments
 (0)