diff --git a/CHANGELOG.md b/CHANGELOG.md index 197654c39..2816f234e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - Resolves Install USB Creation using incorrect installer - Resolves `installer` failing to extract InstallAssistant in older OSes - Resolves certain Samsung NVMe drives appearing as external on Mac Pros +- Add FeatureUnlock configurability ## 0.3.3 - Disable Asset Caching support with spoofless approach diff --git a/payloads/Tools/OCLP-Helper b/payloads/Tools/OCLP-Helper new file mode 100755 index 000000000..76924f73a Binary files /dev/null and b/payloads/Tools/OCLP-Helper differ diff --git a/resources/build.py b/resources/build.py index 395a341c4..5e951ab20 100644 --- a/resources/build.py +++ b/resources/build.py @@ -139,12 +139,6 @@ class BuildOpenCore: # IDE patch ("AppleIntelPIIXATA.kext", self.constants.piixata_version, self.constants.piixata_path, lambda: "PATA" in smbios_data.smbios_dictionary[self.model]["Stock Storage"]), # Misc - ( - "FeatureUnlock.kext", - self.constants.featureunlock_version, - self.constants.featureunlock_path, - lambda: smbios_data.smbios_dictionary[self.model]["CPU Generation"] <= cpu_data.cpu_data.kaby_lake.value, - ), ("DebugEnhancer.kext", self.constants.debugenhancer_version, self.constants.debugenhancer_path, lambda: self.constants.kext_debug is True), ("AppleUSBTrackpad.kext", self.constants.apple_trackpad, self.constants.apple_trackpad_path, lambda: self.model in ["MacBook4,1", "MacBook5,2"]), ]: @@ -175,6 +169,14 @@ class BuildOpenCore: # Required for Lilu in 11.0+ self.config["Kernel"]["Quirks"]["DisableLinkeditJettison"] = True + if smbios_data.smbios_dictionary[self.model]["CPU Generation"] <= cpu_data.cpu_data.kaby_lake.value: + if self.constants.fu_status is True: + # Enable FeatureUnlock.kext + self.enable_kext("FeatureUnlock.kext", self.constants.featureunlock_version, self.constants.featureunlock_path) + if self.constants.fu_arguments is not None: + print(f"- Adding additional FeatureUnlock args: {self.constants.fu_arguments}") + self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += self.constants.fu_arguments + if self.model in ["MacBookPro6,1", "MacBookPro6,2", "MacBookPro9,1", "MacBookPro10,1"]: # Modded RestrictEvents with displaypolicyd blocked to fix dGPU switching self.enable_kext("RestrictEvents.kext", self.constants.restrictevents_mbp_version, self.constants.restrictevents_mbp_path) diff --git a/resources/cli_menu.py b/resources/cli_menu.py index 47f3e3a21..03a7bd1fd 100644 --- a/resources/cli_menu.py +++ b/resources/cli_menu.py @@ -831,7 +831,41 @@ To disable SIP outright, set it to 0xFEF except ValueError: print("Invalid input, returning to previous menu") self.set_custom_sip_value() + + def set_fu_settings(self): + utilities.cls() + utilities.header(["Set FeatureUnlock Settings"]) + print( + """ +By default OCLP will add a kext called FeatureUnlock to enable +features locked out from older models. Including: +- AirPlay to Mac +- SideCar +- Night Shift + +However for systems experiencing memory instability, disabling this +kext can help. + +Supported Options: + +1. Enable FeatureUnlock and all patches +2. Enable FeatureUnlock and disable AirPlay to Mac and SideCar +3. Disable FeatureUnlock + """ + ) + change_menu = input("Set FeatreUnlock (ie. 1): ") + if change_menu == "1": + self.constants.fu_status = True + self.constants.fu_arguments = "" + elif change_menu == "2": + self.constants.fu_status = True + self.constants.fu_arguments = " -disable_sidecar_mac" + elif change_menu == "3": + self.constants.fu_status = False + else: + print("Invalid input, returning to previous menu") + self.set_fu_settings() def credits(self): utilities.TUIOnlyPrint( @@ -1054,7 +1088,7 @@ system_profiler SPHardwareDataType | grep 'Model Identifier' [f"Set Hibernation Workaround:\tCurrently {self.constants.disable_connectdrivers}", MenuOptions(self.constants.custom_model or self.constants.computer.real_model, self.constants).set_hibernation_workaround], [f"Disable Battery Throttling:\tCurrently {self.constants.disable_msr_power_ctl}", MenuOptions(self.constants.custom_model or self.constants.computer.real_model, self.constants).set_battery_throttle], [f"Set Software Demux:\tCurrently {self.constants.software_demux}", MenuOptions(self.constants.custom_model or self.constants.computer.real_model, self.constants).set_software_demux], - + [f"Set FeatureUnlock: \tCurrently {self.constants.fu_status}", MenuOptions(self.constants.custom_model or self.constants.computer.real_model, self.constants).set_fu_settings], ] for option in options: diff --git a/resources/constants.py b/resources/constants.py index 0ea6c6b8d..c99c953ca 100644 --- a/resources/constants.py +++ b/resources/constants.py @@ -120,6 +120,10 @@ class Constants: self.serial_settings = "None" # Set SMBIOS level used self.override_smbios = "Default" # Set SMBIOS model used + ## FeatureUnlock Settings + self.fu_status = True # Enable FeatureUnlock + self.fu_arguments = "" # Set FeatureUnlock arguments + ## Latebloom Settings self.latebloom_status = False # Latebloom Enabled self.latebloom_delay = 0 # Delay between each PCIe Probe @@ -224,6 +228,10 @@ class Constants: @property def list_txt_path(self): return self.payload_path / Path("List.txt") + + @property + def installer_sh_path(self): + return self.payload_path / Path("Installer.sh") # Kexts @property @@ -479,6 +487,10 @@ class Constants: @property def ocvalidate_path(self): return self.payload_path / Path(f"Tools/ocvalidate-{self.opencore_version}") + + @property + def oclp_helper_path(self): + return self.payload_path / Path("Tools/OCLP-Helper") # Icons @property