From d84990e91d9ae0bf974a903f2f8d60e48e09efa4 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk <48863253+khronokernel@users.noreply.github.com> Date: Fri, 17 Sep 2021 22:41:33 -0600 Subject: [PATCH] Add IO80211ElCap verification --- Resources/SysPatch.py | 7 +++---- Resources/Utilities.py | 17 ++++++++++++++--- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/Resources/SysPatch.py b/Resources/SysPatch.py index 21a0ea521..5d09b46d3 100644 --- a/Resources/SysPatch.py +++ b/Resources/SysPatch.py @@ -294,13 +294,12 @@ set million colour before rebooting""" def add_audio_patch(self): self.delete_old_binaries(SysPatchArray.DeleteVolumeControl) self.add_new_binaries(SysPatchArray.AddVolumeControl, self.constants.audio_path) - + def add_wifi_patch(self): print("- Merging Wireless CoreSerices patches") self.elevated(["rsync", "-r", "-i", "-a", f"{self.constants.legacy_wifi_coreservices}/", self.mount_coreservices], stdout=subprocess.PIPE) print("- Merging Wireless usr/libexec patches") self.elevated(["rsync", "-r", "-i", "-a", f"{self.constants.legacy_wifi_libexec}/", self.mount_libexec], stdout=subprocess.PIPE) - def gpu_accel_legacy(self): if self.constants.detected_os == self.constants.mojave: @@ -513,7 +512,7 @@ set million colour before rebooting""" if self.legacy_audio is True: print("- Fixing Volume Control Support") self.add_audio_patch() - + if self.legacy_wifi is True: print("- Installing legacy Wireless support") self.add_wifi_patch() @@ -637,7 +636,7 @@ set million colour before rebooting""" isinstance(self.constants.computer.wifi, device_probe.Broadcom) and self.computer.wifi.chipset in [device_probe.Broadcom.Chipsets.AirPortBrcm4331, device_probe.Broadcom.Chipsets.AirPortBrcm43224] ) or (isinstance(self.computer.wifi, device_probe.Atheros) and self.computer.wifi.chipset == device_probe.Atheros.Chipsets.AirPortAtheros40): - if self.constants.detected_os > self.constants.big_sur: + if self.constants.detected_os > self.constants.big_sur and Utilities.check_monterey_wifi is True: self.legacy_wifi = True Utilities.cls() diff --git a/Resources/Utilities.py b/Resources/Utilities.py index ab5776fe1..cbefeb792 100644 --- a/Resources/Utilities.py +++ b/Resources/Utilities.py @@ -135,6 +135,7 @@ def amfi_status(): return False return True + def check_oclp_boot(): if get_nvram("OCLP-Version", "4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102", decode=False): return True @@ -142,6 +143,16 @@ def check_oclp_boot(): return False +def check_monterey_wifi(): + IO80211ElCap = "com.apple.iokit.IO80211ElCap (1110.26)" + CoreCaptureElCap = "com.apple.driver.corecaptureElCap (1.0.4)" + loaded_kexts: str = subprocess.run("kextcache".split(), stdout=subprocess.PIPE, stderr=subprocess.STDOUT).stdout.decode() + if IO80211ElCap in loaded_kexts and CoreCaptureElCap in loaded_kexts: + return True + else: + return False + + def patching_status(os_sip, os): # Detection for Root Patching sip_enabled = True # System Integrity Protection @@ -244,10 +255,10 @@ def download_file(link, location): chunk = file.read(1024 * 1024 * 16) return checksum -def enable_apfs(fw_feature, fw_mask): - fw_feature |= 2**19 - fw_mask |= 2**19 +def enable_apfs(fw_feature, fw_mask): + fw_feature |= 2 ** 19 + fw_mask |= 2 ** 19 # def menu(title, prompt, menu_options, add_quit=True, auto_number=False, in_between=[], top_level=False):