diff --git a/Hackintool.xcodeproj/project.pbxproj b/Hackintool.xcodeproj/project.pbxproj index a8a53a7f..23db5c07 100644 --- a/Hackintool.xcodeproj/project.pbxproj +++ b/Hackintool.xcodeproj/project.pbxproj @@ -714,7 +714,7 @@ CODE_SIGN_INJECT_BASE_ENTITLEMENTS = NO; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 0331; + CURRENT_PROJECT_VERSION = 0332; DEVELOPMENT_TEAM = 5LGHPJM9ZR; ENABLE_HARDENED_RUNTIME = NO; ENABLE_STRICT_OBJC_MSGSEND = NO; @@ -728,7 +728,7 @@ HEADER_SEARCH_PATHS = "$(SDKROOT)/usr/include/libxml2"; INFOPLIST_FILE = "Hackintool/Hackintool-Info.plist"; LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks @executable_path/../Frameworks"; - MARKETING_VERSION = 3.3.1; + MARKETING_VERSION = 3.3.2; PRODUCT_BUNDLE_IDENTIFIER = com.Headsoft.Hackintool; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -748,7 +748,7 @@ CODE_SIGN_INJECT_BASE_ENTITLEMENTS = NO; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 0331; + CURRENT_PROJECT_VERSION = 0332; DEVELOPMENT_TEAM = 5LGHPJM9ZR; ENABLE_HARDENED_RUNTIME = NO; ENABLE_STRICT_OBJC_MSGSEND = NO; @@ -762,7 +762,7 @@ HEADER_SEARCH_PATHS = "$(SDKROOT)/usr/include/libxml2"; INFOPLIST_FILE = "Hackintool/Hackintool-Info.plist"; LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks @executable_path/../Frameworks"; - MARKETING_VERSION = 3.3.1; + MARKETING_VERSION = 3.3.2; PRODUCT_BUNDLE_IDENTIFIER = com.Headsoft.Hackintool; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/Hackintool.xcodeproj/project.xcworkspace/xcuserdata/headsoft.xcuserdatad/UserInterfaceState.xcuserstate b/Hackintool.xcodeproj/project.xcworkspace/xcuserdata/headsoft.xcuserdatad/UserInterfaceState.xcuserstate index 48aa1aea..6eb6b370 100644 Binary files a/Hackintool.xcodeproj/project.xcworkspace/xcuserdata/headsoft.xcuserdatad/UserInterfaceState.xcuserstate and b/Hackintool.xcodeproj/project.xcworkspace/xcuserdata/headsoft.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/Hackintool/USB.m b/Hackintool/USB.m index a2041b0e..91c5226c 100644 --- a/Hackintool/USB.m +++ b/Hackintool/USB.m @@ -272,25 +272,31 @@ void injectDefaultUSBPowerProperties(NSMutableDictionary *ioProviderMergePropert [ioProviderMergePropertiesDictionary setObject:@(5100) forKey:@"kUSBWakePowerSupply"]; } -void injectUSBPowerProperties(AppDelegate *appDelegate, NSMutableDictionary *ioProviderMergePropertiesDictionary) +bool injectUSBPowerProperties(AppDelegate *appDelegate, NSMutableDictionary *ioProviderMergePropertiesDictionary) { - NSFileManager *fileManager = [NSFileManager defaultManager]; + /* NSFileManager *fileManager = [NSFileManager defaultManager]; NSString *ioUSBHostPath = @"/System/Library/Extensions/IOUSBHostFamily.kext/Contents/Info.plist"; if (![fileManager fileExistsAtPath:ioUSBHostPath]) - return; + return false; */ + + NSBundle *mainBundle = [NSBundle mainBundle]; + NSString *filePath = nil; - NSDictionary *ioUSBHostInfoDictionary = [NSDictionary dictionaryWithContentsOfFile:ioUSBHostPath]; + if (!(filePath = [mainBundle pathForResource:@"config_patches" ofType:@"plist" inDirectory:@"Clover"])) + return false; + + NSDictionary *ioUSBHostInfoDictionary = [NSDictionary dictionaryWithContentsOfFile:filePath]; NSDictionary *ioUSBHostIOKitPersonalities = [ioUSBHostInfoDictionary objectForKey:@"IOKitPersonalities"]; NSString *nearestModelIdentifier = nil; // If we already have an entry leave it out if ([[ioUSBHostIOKitPersonalities allKeys] containsObject:appDelegate.modelIdentifier]) - return; + return false; // Get the closest model and use the power entries for it if (![appDelegate tryGetNearestModel:[ioUSBHostIOKitPersonalities allKeys] modelIdentifier:appDelegate.modelIdentifier nearestModelIdentifier:&nearestModelIdentifier]) - return; + return false; //NSLog(@"nearestModelIdentifier: %@", nearestModelIdentifier); @@ -306,6 +312,8 @@ void injectUSBPowerProperties(AppDelegate *appDelegate, NSMutableDictionary *ioP [ioProviderMergePropertiesDictionary setObject:sleepPowerSupply forKey:@"kUSBSleepPowerSupply"]; [ioProviderMergePropertiesDictionary setObject:wakePortCurrentLimit forKey:@"kUSBWakePortCurrentLimit"]; [ioProviderMergePropertiesDictionary setObject:wakePowerSupply forKey:@"kUSBWakePowerSupply"]; + + return true; } void injectUSBControllerProperties(AppDelegate *appDelegate, NSMutableDictionary *ioKitPersonalities, uint32_t usbControllerID) @@ -600,7 +608,8 @@ void addUSBDictionary(AppDelegate *appDelegate, NSMutableDictionary *ioKitPerson } else { - injectUSBPowerProperties(appDelegate, ioProviderMergePropertiesDictionary); + if (!injectUSBPowerProperties(appDelegate, ioProviderMergePropertiesDictionary)) + injectDefaultUSBPowerProperties(ioProviderMergePropertiesDictionary); [modelEntryDictionary setObject:@"com.apple.driver.AppleUSBMergeNub" forKey:@"CFBundleIdentifier"]; [modelEntryDictionary setObject:@"AppleUSBMergeNub" forKey:@"IOClass"];