diff --git a/CHANGELOG.md b/CHANGELOG.md index e7d72b25b..82e8f0a0d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ - AirPortBrcmFixup 2.1.6 - release - DebugEnhancer 1.0.7 - release - FeatureUnlock 1.1.0 - rolling (2bb3c50) + - RestrictEvents 1.0.9 - rolling (f3db795) ## 0.5.1 - Add support for `APPLE SSD TS0128F/256F` SSDs in macOS Ventura diff --git a/payloads/Kexts/Acidanthera/RestrictEvents-MBP91-v1.0.6-DEBUG.zip b/payloads/Kexts/Acidanthera/RestrictEvents-MBP91-v1.0.6-DEBUG.zip deleted file mode 100644 index 89862ac40..000000000 Binary files a/payloads/Kexts/Acidanthera/RestrictEvents-MBP91-v1.0.6-DEBUG.zip and /dev/null differ diff --git a/payloads/Kexts/Acidanthera/RestrictEvents-MBP91-v1.0.6-RELEASE.zip b/payloads/Kexts/Acidanthera/RestrictEvents-MBP91-v1.0.6-RELEASE.zip deleted file mode 100644 index 510f9647c..000000000 Binary files a/payloads/Kexts/Acidanthera/RestrictEvents-MBP91-v1.0.6-RELEASE.zip and /dev/null differ diff --git a/payloads/Kexts/Acidanthera/RestrictEvents-MBP91.patch b/payloads/Kexts/Acidanthera/RestrictEvents-MBP91.patch deleted file mode 100644 index e5f85965b..000000000 --- a/payloads/Kexts/Acidanthera/RestrictEvents-MBP91.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/RestrictEvents/RestrictEvents.cpp b/RestrictEvents/RestrictEvents.cpp -index 27562f0..66365a3 100644 ---- a/RestrictEvents/RestrictEvents.cpp -+++ b/RestrictEvents/RestrictEvents.cpp -@@ -61,6 +61,7 @@ struct RestrictEventsPolicy { - static const char *procBlacklist[] { - "/System/Library/CoreServices/ExpansionSlotNotification", - "/System/Library/CoreServices/MemorySlotNotification", -+ "/usr/libexec/displaypolicyd", - }; - - char pathbuf[MAXPATHLEN]; diff --git a/payloads/Kexts/Acidanthera/RestrictEvents-v1.0.6-DEBUG.zip b/payloads/Kexts/Acidanthera/RestrictEvents-v1.0.6-DEBUG.zip deleted file mode 100644 index a1209ec2d..000000000 Binary files a/payloads/Kexts/Acidanthera/RestrictEvents-v1.0.6-DEBUG.zip and /dev/null differ diff --git a/payloads/Kexts/Acidanthera/RestrictEvents-v1.0.6-RELEASE.zip b/payloads/Kexts/Acidanthera/RestrictEvents-v1.0.6-RELEASE.zip deleted file mode 100644 index f82da9e90..000000000 Binary files a/payloads/Kexts/Acidanthera/RestrictEvents-v1.0.6-RELEASE.zip and /dev/null differ diff --git a/payloads/Kexts/Acidanthera/RestrictEvents-v1.0.9-DEBUG.zip b/payloads/Kexts/Acidanthera/RestrictEvents-v1.0.9-DEBUG.zip new file mode 100644 index 000000000..084314340 Binary files /dev/null and b/payloads/Kexts/Acidanthera/RestrictEvents-v1.0.9-DEBUG.zip differ diff --git a/payloads/Kexts/Acidanthera/RestrictEvents-v1.0.9-RELEASE.zip b/payloads/Kexts/Acidanthera/RestrictEvents-v1.0.9-RELEASE.zip new file mode 100644 index 000000000..362bb30f4 Binary files /dev/null and b/payloads/Kexts/Acidanthera/RestrictEvents-v1.0.9-RELEASE.zip differ diff --git a/resources/build.py b/resources/build.py index 79a6f17b4..0190322cb 100644 --- a/resources/build.py +++ b/resources/build.py @@ -109,16 +109,9 @@ class BuildOpenCore: # Essential kexts ("Lilu.kext", self.constants.lilu_version, self.constants.lilu_path, lambda: True), ("WhateverGreen.kext", self.constants.whatevergreen_version, self.constants.whatevergreen_path, lambda: self.constants.allow_oc_everywhere is False and self.constants.serial_settings != "None"), - ("RestrictEvents.kext", self.constants.restrictevents_version, self.constants.restrictevents_path, lambda: self.model in model_array.MacPro), ("SMC-Spoof.kext", self.constants.smcspoof_version, self.constants.smcspoof_path, lambda: self.constants.allow_oc_everywhere is False and self.constants.serial_settings != "None"), # CPU patches ("AAAMouSSE.kext", self.constants.mousse_version, self.constants.mousse_path, lambda: smbios_data.smbios_dictionary[self.model]["CPU Generation"] <= cpu_data.cpu_data.penryn.value), - ( - "telemetrap.kext", - self.constants.telemetrap_version, - self.constants.telemetrap_path, - lambda: smbios_data.smbios_dictionary[self.model]["CPU Generation"] <= cpu_data.cpu_data.penryn.value, - ), ( "CPUFriend.kext", self.constants.cpufriend_version, @@ -195,10 +188,6 @@ class BuildOpenCore: # Only inject on older OSes if user requests self.get_item_by_kv(self.config["Kernel"]["Add"], "BundlePath", "ASPP-Override.kext")["MinKernel"] = "" - 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) - if not self.constants.custom_model and self.constants.computer.ethernet: for controller in self.constants.computer.ethernet: if isinstance(controller, device_probe.BroadcomEthernet) and controller.chipset == device_probe.BroadcomEthernet.Chipsets.AppleBCM5701Ethernet: @@ -917,23 +906,6 @@ class BuildOpenCore: except KeyError: pass - # With macOS 13, Ventura, Apple removed the Skylake graphics stack. However due to the lack of inovation - # with the Kaby lake and Coffee Lake iGPUs, we're able to spoof ourselves to natively support them - - # Currently the following iGPUs we need to be considerate of: - # - HD530 (mobile): 0x191B0006 - - - # | GPU | Model | Device ID | Platform ID | New Device ID | New Platform ID | - # | -------- | ---------------- | --------- | ----------- | ------------- | --------------- | - # | HD 515 | MacBook9,1 | 0x191E | 0x131E0003 | - # | Iris 540 | MacBookPro13,1/2 | 0x1926 | 0x19160002 | 0x5926 | 0x59260002 - # | HD 530 | MacBookPro13,3 | 0x191B | 0x191B0006 | 0x591B | 0x591B0006 | - # | HD 530 | iMac17,1 | 0x1912 | 0x19120001 | 0x5912 | 0x59120003 | - - - - if self.constants.xhci_boot is True: print("- Adding USB 3.0 Controller Patch") print("- Adding XhciDxe.efi and UsbBusDxe.efi") @@ -996,6 +968,44 @@ class BuildOpenCore: self.config["UEFI"]["Quirks"]["ForgeUefiSupport"] = True self.config["UEFI"]["Quirks"]["ReloadOptionRoms"] = True + # RestrictEvents handling + block_args = "" + if smbios_data.smbios_dictionary[self.model]["CPU Generation"] <= cpu_data.cpu_data.penryn.value: + block_args += "telemetry," + if self.model in ["MacBookPro6,1", "MacBookPro6,2", "MacBookPro9,1", "MacBookPro10,1"]: + block_args += "gmux," + if self.model in model_array.MacPro: + block_args += "pcie," + gpu_dict = [] + if not self.constants.custom_model: + gpu_dict = self.constants.computer.gpus + else: + if self.model in smbios_data.smbios_dictionary: + gpu_dict = smbios_data.smbios_dictionary[self.model]["Stock GPUs"] + for gpu in gpu_dict: + if gpu in [ + device_probe.Intel.Archs.Ivy_Bridge, + device_probe.Intel.Archs.Haswell, + device_probe.NVIDIA.Archs.Kepler, + ]: + block_args += "media," + break + if block_args.endswith(","): + block_args = block_args[:-1] + + if block_args != "": + print(f"- Setting RestrictEvents block arguments: {block_args}") + if self.get_kext_by_bundle_path("RestrictEvents.kext")["Enabled"] is False: + self.enable_kext("RestrictEvents.kext", self.constants.restrictevents_version, self.constants.restrictevents_path) + self.config["NVRAM"]["Add"]["4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102"]["revblock"] = block_args + + if self.get_item_by_kv(self.config["Kernel"]["Patch"], "Comment", "Reroute kern.hv_vmm_present patch (1)")["Enabled"] is True and self.constants.set_content_caching is True: + # Add Content Caching patch + print("- Fixing Content Caching support") + if self.get_kext_by_bundle_path("RestrictEvents.kext")["Enabled"] is False: + self.enable_kext("RestrictEvents.kext", self.constants.restrictevents_version, self.constants.restrictevents_path) + self.config["NVRAM"]["Add"]["4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102"]["revpatch"] = "asset" + # DEBUG Settings if self.constants.verbose_debug is True: print("- Enabling Verbose boot") @@ -1123,12 +1133,6 @@ class BuildOpenCore: if self.constants.nvram_write is False: print("- Disabling Hardware NVRAM Write") self.config["NVRAM"]["WriteFlash"] = False - if self.get_item_by_kv(self.config["Kernel"]["Patch"], "Comment", "Reroute kern.hv_vmm_present patch (1)")["Enabled"] is True and self.constants.set_content_caching is True: - # Add Content Caching patch - print("- Fixing Content Caching support") - if self.get_kext_by_bundle_path("RestrictEvents.kext")["Enabled"] is False: - self.enable_kext("RestrictEvents.kext", self.constants.restrictevents_version, self.constants.restrictevents_path) - self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += " -revasset" if self.get_kext_by_bundle_path("RestrictEvents.kext")["Enabled"] is False: # Ensure this is done at the end so all previous RestrictEvents patches are applied # RestrictEvents and EFICheckDisabler will conflict if both are injected diff --git a/resources/constants.py b/resources/constants.py index fb0b581c6..454e13354 100644 --- a/resources/constants.py +++ b/resources/constants.py @@ -37,8 +37,7 @@ class Constants: self.airportbcrmfixup_version = "2.1.6" # AirPortBrcmFixup self.nvmefix_version = "1.0.9" # NVMeFix self.applealc_version = "1.6.3" # AppleALC - self.restrictevents_version = "1.0.6" # RestrictEvents - self.restrictevents_mbp_version = "1.0.6" # RestrictEvents blocking displaypolicyd (see RestrictEvents-MBP91.patch) + self.restrictevents_version = "1.0.9" # RestrictEvents self.featureunlock_version = "1.1.0" # FeatureUnlock self.debugenhancer_version = "1.0.7" # DebugEnhancer self.cpufriend_version = "1.2.5" # CPUFriend @@ -294,10 +293,6 @@ class Constants: def efi_disabler_path(self): return self.payload_kexts_path / Path(f"Acidanthera/EFICheckDisabler-v{self.restrictevents_version}.zip") - @property - def restrictevents_mbp_path(self): - return self.payload_kexts_path / Path(f"Acidanthera/RestrictEvents-MBP91-v{self.restrictevents_mbp_version}-{self.kext_variant}.zip") - @property def bcm570_path(self): return self.payload_kexts_path / Path(f"Ethernet/CatalinaBCM5701Ethernet-v{self.bcm570_version}.zip")