From b4bfd827ce54a7513477038632506fab53996718 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Mon, 2 May 2022 16:53:23 -0600 Subject: [PATCH] Remove unused variables --- resources/constants.py | 14 -------------- resources/sys_patch.py | 16 ++-------------- resources/sys_patch_detect.py | 18 +----------------- 3 files changed, 3 insertions(+), 45 deletions(-) diff --git a/resources/constants.py b/resources/constants.py index 1b7e2e515..fbcffbe11 100644 --- a/resources/constants.py +++ b/resources/constants.py @@ -209,11 +209,6 @@ class Constants: @property def plist_template(self): return self.payload_path / Path("Config/config.plist") - - # Mount Location - @property - def payload_mnt1_path(self): - return self.payload_path / Path("mnt1") # Launch Agent @property @@ -600,15 +595,6 @@ class Constants: # "x86legacy", # non-T2 Macs/VMs, Monterey's boot.efi enforces this on all Macs ] - sandy_board_id = [ - "Mac-E43C1C25D4880AD6", # MacBookPro12,1 - "Mac-06F11F11946D27C5", # MacBookPro11,5 - "Mac-9F18E312C5C2BF0B", # MacBookAir7,1 - "Mac-937CB26E2E02BB01", # MacBookAir7,2 - "Mac-35C5E08120C7EEAF", # Macmini7,1 - "Mac-7BA5B2D9E42DDD94", # iMacPro1,1 - ] - sandy_board_id_stock = [ "Mac-94245B3640C91C81", # MacBookPro8,1 "Mac-94245A3940C91C80", # MacBookPro8,2 diff --git a/resources/sys_patch.py b/resources/sys_patch.py index e8d86559f..c97591744 100644 --- a/resources/sys_patch.py +++ b/resources/sys_patch.py @@ -21,8 +21,6 @@ class PatchSysVolume: self.constants: constants.Constants() = versions self.computer = self.constants.computer self.root_mount_path = None - self.validate = False - self.added_legacy_kexts = False self.root_supports_snapshot = utilities.check_if_root_is_apfs_snapshot() self.constants.root_patcher_succeded = False # Reset Variable each time we start @@ -34,16 +32,6 @@ class PatchSysVolume: self.init_pathing(custom_root_mount_path=None, custom_data_mount_path=None) def init_hardware_patches(self, hardware_details): - - self.amfi_must_disable = hardware_details["Settings: Requires AMFI exemption"] - self.check_board_id = hardware_details["Settings: Requires Board ID validation"] - self.sip_enabled = hardware_details["Validation: SIP is enabled"] - self.sbm_enabled = hardware_details["Validation: SBM is enabled"] - self.amfi_enabled = hardware_details["Validation: AMFI is enabled"] - self.fv_enabled = hardware_details["Validation: FileVault is enabled"] - self.dosdude_patched = hardware_details["Validation: System is dosdude1 patched"] - self.bad_board_id = hardware_details[f"Validation: Board ID is unsupported \n({self.computer.reported_board_id})"] - self.nvidia_legacy = hardware_details["Graphics: Nvidia Tesla"] self.kepler_gpu = hardware_details["Graphics: Nvidia Kepler"] self.amd_ts1 = hardware_details["Graphics: AMD TeraScale 1"] @@ -312,7 +300,7 @@ class PatchSysVolume: required_patches.update({"Legacy Keyboard Backlight": all_hardware_patchset["Miscellaneous"]["Legacy Keyboard Backlight"]}) return required_patches - + def execute_patchset(self, required_patches): source_files_path = str(self.constants.payload_local_binaries_root_path) @@ -535,7 +523,7 @@ class PatchSysVolume: def start_unpatch(self): print("- Starting Unpatch Process") - if sys_patch_detect.detect_root_patch(self.computer.real_model, self.constants).verify_patch_allowed(print_errors=not self.constants.wxpython_variant) is True: + if sys_patch_detect.detect_root_patch(self.computer.real_model, self.constants).verify_patch_allowed(print_errors=True) is True: self.find_mount_root_vol(False) if self.constants.gui_mode is False: input("\nPress [ENTER] to return to the main menu") diff --git a/resources/sys_patch_detect.py b/resources/sys_patch_detect.py index 2689a9f7e..0fecd8f6a 100644 --- a/resources/sys_patch_detect.py +++ b/resources/sys_patch_detect.py @@ -30,7 +30,6 @@ class detect_root_patch: # Patch Requirements self.amfi_must_disable= False - self.check_board_id= False self.supports_metal= False # Validation Checks @@ -39,7 +38,6 @@ class detect_root_patch: self.amfi_enabled = False self.fv_enabled = False self.dosdude_patched = False - self.bad_board_id = False def detect_gpus(self): @@ -80,7 +78,6 @@ class detect_root_patch: if self.constants.detected_os > non_metal_os: self.sandy_gpu = True self.amfi_must_disable = True - self.check_board_id = True self.legacy_keyboard_backlight = self.check_legacy_keyboard_backlight() elif gpu.arch == device_probe.Intel.Archs.Ivy_Bridge: if self.constants.detected_os > os_data.os_data.big_sur: @@ -170,14 +167,12 @@ class detect_root_patch: "Miscellaneous: Legacy GMUX": self.legacy_gmux, "Miscellaneous: Legacy Keyboard Backlight": self.legacy_keyboard_backlight, "Settings: Requires AMFI exemption": self.amfi_must_disable, - "Settings: Requires Board ID validation": self.check_board_id, "Validation: Patching Possible": self.verify_patch_allowed(), "Validation: SIP is enabled": self.sip_enabled, "Validation: SBM is enabled": self.sbm_enabled, "Validation: AMFI is enabled": self.amfi_enabled if self.amfi_must_disable else False, "Validation: FileVault is enabled": self.fv_enabled, "Validation: System is dosdude1 patched": self.dosdude_patched, - f"Validation: Board ID is unsupported \n({self.computer.reported_board_id})": self.bad_board_id, } return self.root_patch_dict @@ -216,20 +211,9 @@ class detect_root_patch: if self.dosdude_patched is True: print("\nCannot patch! Detected machine has already been patched by another patcher") print("Please ensure your install is either clean or patched with OpenCore Legacy Patcher") - - if self.check_board_id is True and (self.computer.reported_board_id not in self.constants.sandy_board_id and self.computer.reported_board_id not in self.constants.sandy_board_id_stock): - self.bad_board_id = True - if print_errors is True: - print("\nCannot patch! Board ID not supported by AppleIntelSNBGraphicsFB") - print(f"Detected Board ID: {self.computer.reported_board_id}") - print("Please ensure your Board ID is listed below:") - for board in self.constants.sandy_board_id: - print(f"- {board} ({generate_smbios.find_model_off_board(board)})") - for board in self.constants.sandy_board_id_stock: - print(f"- {board} ({generate_smbios.find_model_off_board(board)})") if any( - [self.sip_enabled, self.sbm_enabled, self.fv_enabled, self.dosdude_patched, self.amfi_enabled if self.amfi_must_disable else False, self.bad_board_id if self.check_board_id else False] + [self.sip_enabled, self.sbm_enabled, self.fv_enabled, self.dosdude_patched, self.amfi_enabled if self.amfi_must_disable else False] ): return False else: