Skip to content

Commit

Permalink
Add Ventura support
Browse files Browse the repository at this point in the history
  • Loading branch information
benbaker76 committed Nov 5, 2022
1 parent 37fa859 commit 640affb
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 78 deletions.
8 changes: 4 additions & 4 deletions Hackintool.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@
CODE_SIGN_INJECT_BASE_ENTITLEMENTS = NO;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 0387;
CURRENT_PROJECT_VERSION = 0388;
DEVELOPMENT_TEAM = 5LGHPJM9ZR;
ENABLE_HARDENED_RUNTIME = YES;
ENABLE_STRICT_OBJC_MSGSEND = NO;
Expand All @@ -736,7 +736,7 @@
INFOPLIST_FILE = "Hackintool/Hackintool-Info.plist";
LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks @executable_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.9;
MARKETING_VERSION = 3.8.7;
MARKETING_VERSION = 3.8.8;
PRODUCT_BUNDLE_IDENTIFIER = com.Headsoft.Hackintool;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand All @@ -757,7 +757,7 @@
CODE_SIGN_INJECT_BASE_ENTITLEMENTS = NO;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 0387;
CURRENT_PROJECT_VERSION = 0388;
DEVELOPMENT_TEAM = 5LGHPJM9ZR;
ENABLE_HARDENED_RUNTIME = YES;
ENABLE_STRICT_OBJC_MSGSEND = NO;
Expand All @@ -772,7 +772,7 @@
INFOPLIST_FILE = "Hackintool/Hackintool-Info.plist";
LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks @executable_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.9;
MARKETING_VERSION = 3.8.7;
MARKETING_VERSION = 3.8.8;
PRODUCT_BUNDLE_IDENTIFIER = com.Headsoft.Hackintool;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
Binary file not shown.
56 changes: 30 additions & 26 deletions Hackintool/IORegTools.m
Original file line number Diff line number Diff line change
Expand Up @@ -1988,39 +1988,43 @@ bool getScreenNumberForDisplay(SInt32 myVendorID, SInt32 myProductID, SInt32 myS
{
io_service_t servicePort = CGDisplayIOServicePort(directDisplayIDArray[i]);

if (!servicePort)
continue;

CFDictionaryRef displayInfo = IODisplayCreateInfoDictionary(servicePort, kIODisplayMatchingInfo);

CFNumberRef vendorIDRef = nil;
CFNumberRef productIDRef = nil;
CFNumberRef serialNumberRef = nil;
SInt32 vendorID = 0, productID = 0, serialNumber = 0;
if (servicePort)
{
CFDictionaryRef displayInfo = IODisplayCreateInfoDictionary(servicePort, kIODisplayMatchingInfo);

Boolean success;
success = CFDictionaryGetValueIfPresent(displayInfo, CFSTR(kDisplayVendorID), (const void **)&vendorIDRef);
success &= CFDictionaryGetValueIfPresent(displayInfo, CFSTR(kDisplayProductID), (const void **)&productIDRef);
if (displayInfo)
{
CFNumberRef vendorIDRef = nil;
CFNumberRef productIDRef = nil;
CFNumberRef serialNumberRef = nil;
SInt32 vendorID = 0, productID = 0, serialNumber = 0;

if (success)
{
CFNumberGetValue(vendorIDRef, kCFNumberSInt32Type, &vendorID);
CFNumberGetValue(productIDRef, kCFNumberSInt32Type, &productID);
}
if (CFDictionaryGetValueIfPresent(displayInfo, CFSTR(kDisplayVendorID), (const void **)&vendorIDRef))
{
CFNumberGetValue(vendorIDRef, kCFNumberSInt32Type, &vendorID);
}

if (CFDictionaryGetValueIfPresent(displayInfo, CFSTR(kDisplayProductID), (const void **)&productIDRef))
{
CFNumberGetValue(productIDRef, kCFNumberSInt32Type, &productID);
}

if (CFDictionaryGetValueIfPresent(displayInfo, CFSTR(kDisplaySerialNumber), (const void **)&serialNumberRef))
{
CFNumberGetValue(serialNumberRef, kCFNumberSInt32Type, &serialNumber);
}
if (CFDictionaryGetValueIfPresent(displayInfo, CFSTR(kDisplaySerialNumber), (const void **)&serialNumberRef))
{
CFNumberGetValue(serialNumberRef, kCFNumberSInt32Type, &serialNumber);
}

if (myVendorID == vendorID && myProductID == productID && mySerialNumber == serialNumber)
{
*directDisplayID = directDisplayIDArray[i];
if (myVendorID == vendorID && myProductID == productID && mySerialNumber == serialNumber)
{
*directDisplayID = directDisplayIDArray[i];

retval = true;
retval = true;
}

CFRelease(displayInfo);
}
}

CFRelease(displayInfo);
IOObjectRelease(servicePort);
}

Expand Down
99 changes: 51 additions & 48 deletions Hackintool/MiscTools.m
Original file line number Diff line number Diff line change
Expand Up @@ -664,56 +664,59 @@ unsigned long long binaryToDecimal(NSString *str)
NSOperatingSystemVersion version = [processInfo operatingSystemVersion];
NSString *osVersionString = [processInfo operatingSystemVersionString];
NSString *codeName = @"";

if (version.majorVersion == 10)
{
switch(version.minorVersion)
{
case 4:
codeName = @"Mac OS X Tiger";
break;
case 5:
codeName = @"Mac OS X Leopard";
break;
case 6:
codeName = @"Mac OS X Snow Leopard";
break;
case 7:
codeName = @"Mac OS X Lion";
break;
case 8:
codeName = @"OS X Mountain Lion";
break;
case 9:
codeName = @"OS X Mavericks";
break;
case 10:
codeName = @"OS X Yosemite";
break;
case 11:
codeName = @"OS X El Capitan";
break;
case 12:
codeName = @"macOS Sierra";
break;
case 13:
codeName = @"macOS High Sierra";
break;
case 14:
codeName = @"macOS Mojave";
break;
case 15:
codeName = @"macOS Catalina";
break;
}
}
else if (version.majorVersion == 11)
{
codeName = @"macOS Big Sur";
}
else if (version.majorVersion == 12)

switch(version.majorVersion)
{
case 10:
switch(version.minorVersion)
{
case 4:
codeName = @"Mac OS X Tiger";
break;
case 5:
codeName = @"Mac OS X Leopard";
break;
case 6:
codeName = @"Mac OS X Snow Leopard";
break;
case 7:
codeName = @"Mac OS X Lion";
break;
case 8:
codeName = @"OS X Mountain Lion";
break;
case 9:
codeName = @"OS X Mavericks";
break;
case 10:
codeName = @"OS X Yosemite";
break;
case 11:
codeName = @"OS X El Capitan";
break;
case 12:
codeName = @"macOS Sierra";
break;
case 13:
codeName = @"macOS High Sierra";
break;
case 14:
codeName = @"macOS Mojave";
break;
case 15:
codeName = @"macOS Catalina";
break;
}
break;
case 11:
codeName = @"macOS Big Sur";
break;
case 12:
codeName = @"macOS Monterey";
break;
case 13:
codeName = @"macOS Ventura";
break;
}

return [NSString stringWithFormat:@"%@ %@", codeName, osVersionString];
Expand Down

0 comments on commit 640affb

Please sign in to comment.