Format py files

This commit is contained in:
Mykola Grymalyuk
2021-04-11 08:46:42 -06:00
parent 1d8d3ef757
commit 70b5399126
7 changed files with 322 additions and 314 deletions

View File

@@ -41,14 +41,14 @@ class OpenCoreLegacyPatcher():
self.current_model = true_model
def build_opencore(self):
build.BuildOpenCore(self.constants.custom_model or self.current_model, self.constants).build_opencore()
Build.BuildOpenCore(self.constants.custom_model or self.current_model, self.constants).build_opencore()
def install_opencore(self):
build.BuildOpenCore(self.constants.custom_model or self.current_model, self.constants).copy_efi()
Build.BuildOpenCore(self.constants.custom_model or self.current_model, self.constants).copy_efi()
def change_model(self):
utilities.cls()
utilities.header(["Select Different Model"])
Utilities.cls()
Utilities.header(["Select Different Model"])
print("""
Tip: Run the following command on the target machine to find the model identifier:
@@ -66,15 +66,13 @@ system_profiler SPHardwareDataType | grep 'Model Identifier'
if self.constants.custom_model in ModelArray.NoAPFSsupport:
self.constants.serial_settings = "Moderate"
def patcher_settings(self):
response = None
while not (response and response == -1):
title = [
"Adjust Patcher Settings"
]
menu = utilities.TUIMenu(title, "Please select an option: ", auto_number=True, top_level=True)
menu = Utilities.TUIMenu(title, "Please select an option: ", auto_number=True, top_level=True)
options = [
# TODO: Enable setting OS target when more OSes become supported by the patcher
#[f"Change OS version:\t\t\tCurrently macOS {self.constants.os_support}", self.change_os],
@@ -97,7 +95,7 @@ system_profiler SPHardwareDataType | grep 'Model Identifier'
response = menu.start()
def credits(self):
utilities.TUIOnlyPrint(["Credits"], "Press [Enter] to go back.\n",
Utilities.TUIOnlyPrint(["Credits"], "Press [Enter] to go back.\n",
["""Many thanks to the following:
- Acidanthera:\tOpenCore, kexts and other tools
@@ -109,8 +107,8 @@ system_profiler SPHardwareDataType | grep 'Model Identifier'
- cdf:\t\tNightShiftEnabler"""]).start()
def PatchVolume(self):
utilities.cls()
utilities.header(["Patching System Volume"])
Utilities.cls()
Utilities.header(["Patching System Volume"])
print("""Patches Root volume to fix misc issues such as:
- Brightness control for non-Metal GPUs
@@ -134,7 +132,6 @@ B. Exit
else:
print("Returning to main menu")
def main_menu(self):
response = None
ModelArray.SupportedSMBIOS = ModelArray.SupportedSMBIOS11
@@ -165,7 +162,7 @@ B. Exit
else:
in_between = ["This model is supported"]
menu = utilities.TUIMenu(title, "Please select an option: ", in_between=in_between, auto_number=True, top_level=True)
menu = Utilities.TUIMenu(title, "Please select an option: ", in_between=in_between, auto_number=True, top_level=True)
options = (
[["Build OpenCore", self.build_opencore]] if ((self.constants.custom_model or self.current_model) in ModelArray.SupportedSMBIOS) else []) + [

View File

@@ -42,7 +42,7 @@ class BuildOpenCore:
return hex_str.upper()
def build_efi(self):
utilities.cls()
Utilities.cls()
if not Path(self.constants.build_path).exists():
Path(self.constants.build_path).mkdir()
print("Created build folder")
@@ -144,7 +144,7 @@ class BuildOpenCore:
print("- Found supported WiFi card, skipping wifi patches")
elif not self.constants.custom_model and wifi_devices and wifi_vendor == "E414" and wifi_device in ModelArray.BCM94331Wifi:
wifi_fake_id(self)
elif not self.constants.custom_model and wifi_devices and wifi_vendor== "E414" and wifi_device in ModelArray.BCM94322Wifi:
elif not self.constants.custom_model and wifi_devices and wifi_vendor == "E414" and wifi_device in ModelArray.BCM94322Wifi:
self.enable_kext("IO80211Mojave.kext", self.constants.io80211mojave_version, self.constants.io80211mojave_path)
self.get_kext_by_bundle_path("IO80211Mojave.kext/Contents/PlugIns/AirPortBrcm4331.kext")["Enabled"] = True
elif not self.constants.custom_model and wifi_devices and wifi_vendor == "E414" and wifi_device in ModelArray.BCM94328Wifi:
@@ -234,9 +234,9 @@ class BuildOpenCore:
hdef_path = "PciRoot(0x0)/Pci(0x8,0x0)" if self.model in ModelArray.nvidiaHDEF else "PciRoot(0x0)/Pci(0x1b,0x0)"
# In AppleALC, MacPro3,1's original layout is already in use, forcing layout 13 instead
if self.model == "MacPro3,1":
self.config["DeviceProperties"]["Add"][hdef_path] = {"apple-layout-id": 90, "use-apple-layout-id": 1, "alc-layout-id": 13,}
self.config["DeviceProperties"]["Add"][hdef_path] = {"apple-layout-id": 90, "use-apple-layout-id": 1, "alc-layout-id": 13, }
else:
self.config["DeviceProperties"]["Add"][hdef_path] = {"apple-layout-id": 90, "use-apple-layout-id": 1, "use-layout-id": 1,}
self.config["DeviceProperties"]["Add"][hdef_path] = {"apple-layout-id": 90, "use-apple-layout-id": 1, "use-layout-id": 1, }
def nvidia_patch(self):
self.constants.custom_mxm_gpu = True
@@ -264,7 +264,6 @@ class BuildOpenCore:
print("- Disabling unsupported iGPU")
self.config["DeviceProperties"]["Add"]["PciRoot(0x0)/Pci(0x2,0x0)"] = {"name": binascii.unhexlify("23646973706C6179"), "IOName": "#display", "class-code": binascii.unhexlify("FFFFFFFF")}
# Check GPU Vendor
if self.constants.metal_build is True:
print("- Adding Metal GPU patches on request")
@@ -287,7 +286,6 @@ class BuildOpenCore:
print("- Adding Mac Pro, Xserve DRM patches")
self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += " shikigva=128 unfairgva=1 -wegtree"
# Add OpenCanopy
print("- Adding OpenCanopy GUI")
shutil.rmtree(self.constants.resources_path, onerror=rmtree_handler)
@@ -309,7 +307,7 @@ class BuildOpenCore:
print("- Adding SATA Hibernation Patch")
self.config["Kernel"]["Quirks"]["ThirdPartyDrives"] = True
#DEBUG Settings
# DEBUG Settings
if self.constants.verbose_debug is True:
print("- Enabling Verbose boot")
self.config["Kernel"]["Quirks"]["PanicNoKextDump"] = True
@@ -403,12 +401,14 @@ class BuildOpenCore:
self.config["PlatformInfo"]["PlatformNVRAM"]["BID"] = self.spoofed_board
self.config["PlatformInfo"]["SMBIOS"]["BoardProduct"] = self.spoofed_board
self.config["PlatformInfo"]["UpdateNVRAM"] = True
def moderate_serial_patch(self):
self.config["PlatformInfo"]["Automatic"] = True
self.config["PlatformInfo"]["UpdateDataHub"] = True
self.config["PlatformInfo"]["UpdateNVRAM"] = True
self.config["UEFI"]["ProtocolOverrides"]["DataHub"] = True
self.config["PlatformInfo"]["Generic"]["SystemProductName"] = self.spoofed_model
def adanced_serial_patch(self):
macserial_output = subprocess.run([self.constants.macserial_path] + f"-g -m {self.spoofed_model} -n 1".split(), stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
macserial_output = macserial_output.stdout.decode().strip().split(" | ")
@@ -534,11 +534,11 @@ class BuildOpenCore:
input("Press [Enter] to go back.\n")
def copy_efi(self):
utilities.cls()
utilities.header(["Installing OpenCore to Drive"])
Utilities.cls()
Utilities.header(["Installing OpenCore to Drive"])
if not self.constants.opencore_release_folder.exists():
utilities.TUIOnlyPrint(
Utilities.TUIOnlyPrint(
["Installing OpenCore to Drive"],
"Press [Enter] to go back.\n",
[
@@ -574,7 +574,7 @@ Please build OpenCore first!"""
# Avoid crashing with CDs installed
continue
# TODO: Advanced mode
menu = utilities.TUIMenu(
menu = Utilities.TUIMenu(
["Select Disk"],
"Please select the disk you would like to install OpenCore to: ",
in_between=["Missing disks? Ensure they have an EFI or FAT32 partition."],
@@ -594,7 +594,7 @@ Please build OpenCore first!"""
disk_identifier = "disk" + response
selected_disk = all_disks[disk_identifier]
menu = utilities.TUIMenu(
menu = Utilities.TUIMenu(
["Select Partition"],
"Please select the partition you would like to install OpenCore to: ",
return_number_instead_of_direct_call=True,
@@ -651,8 +651,8 @@ Please build OpenCore first!"""
ssd_type = False
mount_path = Path(partition_info["MountPoint"])
disk_type = partition_info["BusProtocol"]
utilities.cls()
utilities.header(["Copying OpenCore"])
Utilities.cls()
Utilities.header(["Copying OpenCore"])
if mount_path.exists():
if (mount_path / Path("EFI/OC")).exists():

View File

@@ -2,18 +2,22 @@
# Copyright (C) 2020-2021, Dhinak G, Mykola Grymalyuk
from __future__ import print_function
import subprocess, sys, time, platform
import subprocess
import sys
import time
import platform
from Resources import Build, ModelArray, Constants, SysPatch, Utilities
class MenuOptions:
def __init__(self, model, versions):
self.model = model
self.constants: Constants.Constants = versions
def change_os(self):
utilities.cls()
utilities.header(["Select Patcher's Target OS"])
Utilities.cls()
Utilities.header(["Select Patcher's Target OS"])
print(f"""
Minimum Target:\t{self.constants.min_os_support}
Maximum Target:\t{self.constants.max_os_support}
@@ -30,8 +34,8 @@ Current target:\t{self.constants.os_support}
ModelArray.SupportedSMBIOS = ModelArray.SupportedSMBIOS12
def change_verbose(self):
utilities.cls()
utilities.header(["Set Verbose mode"])
Utilities.cls()
Utilities.header(["Set Verbose mode"])
change_menu = input("Enable Verbose mode(y/n): ")
if change_menu in {"y", "Y", "yes", "Yes"}:
self.constants.verbose_debug = True
@@ -41,8 +45,8 @@ Current target:\t{self.constants.os_support}
print("Invalid option")
def change_oc(self):
utilities.cls()
utilities.header(["Set OpenCore DEBUG mode"])
Utilities.cls()
Utilities.header(["Set OpenCore DEBUG mode"])
change_menu = input("Enable OpenCore DEBUG mode(y/n): ")
if change_menu in {"y", "Y", "yes", "Yes"}:
self.constants.opencore_debug = True
@@ -52,9 +56,10 @@ Current target:\t{self.constants.os_support}
self.constants.opencore_build = "RELEASE"
else:
print("Invalid option")
def change_kext(self):
utilities.cls()
utilities.header(["Set Kext DEBUG mode"])
Utilities.cls()
Utilities.header(["Set Kext DEBUG mode"])
change_menu = input("Enable Kext DEBUG mode(y/n): ")
if change_menu in {"y", "Y", "yes", "Yes"}:
self.constants.kext_debug = True
@@ -64,8 +69,8 @@ Current target:\t{self.constants.os_support}
print("Invalid option")
def change_metal(self):
utilities.cls()
utilities.header(["Assume Metal GPU Always in iMac"])
Utilities.cls()
Utilities.header(["Assume Metal GPU Always in iMac"])
print("""This is for iMacs that have upgraded Metal GPUs, otherwise
Patcher assumes based on stock configuration (ie. iMac10,x-12,x)
@@ -92,8 +97,8 @@ option is for those patching on a different machine or OCLP cannot detect.
print("Invalid option")
def change_wifi(self):
utilities.cls()
utilities.header(["Assume Upgraded Wifi Always"])
Utilities.cls()
Utilities.header(["Assume Upgraded Wifi Always"])
print("""This is for Macs with upgraded wifi cards(ie. BCM94360/2)
Note: Patcher will detect whether hardware has been upgraded regardless, this
@@ -108,8 +113,8 @@ option is for those patching on a different machine or cannot detect.
print("Invalid option")
def change_serial(self):
utilities.cls()
utilities.header(["Set SMBIOS Mode"])
Utilities.cls()
Utilities.header(["Set SMBIOS Mode"])
print("""This section is for setting how OpenCore generates the SMBIOS
Recommended for adanced users who want control how serials are handled
@@ -130,9 +135,10 @@ Note: For new users we recommend leaving as default(1. Minimal)
self.constants.serial_settings = "Advanced"
else:
print("Invalid option")
def change_showpicker(self):
utilities.cls()
utilities.header(["Set OpenCore Picker mode"])
Utilities.cls()
Utilities.header(["Set OpenCore Picker mode"])
print("""By default, OpenCore will show its boot picker each time on boot up,
however this can be disabled by default and be shown on command by repeatedly
pressing the "Esc" key
@@ -146,8 +152,8 @@ pressing the "Esc" key
print("Invalid option")
def change_vault(self):
utilities.cls()
utilities.header(["Set OpenCore Vaulting"])
Utilities.cls()
Utilities.header(["Set OpenCore Vaulting"])
print("""By default, this patcher will sign all your files and ensure none of the
contents can be tampered with. However for more advanced users, you may
want to be able to freely edit the config.plist and files.
@@ -164,8 +170,8 @@ Note: For secuirty reasons, OpenShell will be disabled when Vault is set.
print("Invalid option")
def change_sip(self):
utilities.cls()
utilities.header(["Set SIP and SecureBootModel"])
Utilities.cls()
Utilities.header(["Set SIP and SecureBootModel"])
print("""SIP and SecureBootModel are used to ensure proper OTA functionality,
however to patch the root volume both of these must be disabled.
Only disable is absolutely necessary. SIP value = 0xFEF
@@ -199,8 +205,8 @@ Valid options:
print("Invalid option")
def change_imac_nvidia(self):
utilities.cls()
utilities.header(["Force iMac Nvidia Patches"])
Utilities.cls()
Utilities.header(["Force iMac Nvidia Patches"])
print("""Specifically for iMac10,x-12,x with Metal Nvidia GPU upgrades
By default the patcher will try to detect what hardware is
running, however this will enforce iMac Nvidia Build Patches.
@@ -214,8 +220,8 @@ running, however this will enforce iMac Nvidia Build Patches.
print("Invalid option")
def custom_repo(self):
utilities.cls()
utilities.header(["Set custom patch repo"])
Utilities.cls()
Utilities.header(["Set custom patch repo"])
print(f"""For users participating in OpenCore Patcher betas, this is
where you can add custom repos such as Google Drive links.
@@ -239,8 +245,8 @@ Current repo:
print("Invalid option")
def bootstrap_setting(self):
utilities.cls()
utilities.header(["Set Bootstrap method"])
Utilities.cls()
Utilities.header(["Set Bootstrap method"])
print("""Sets OpenCore's bootstrap method, currently the patcher supports the
following options.
@@ -263,4 +269,4 @@ see the EFI Boot entry in the boot picker.
elif change_menu == "2":
self.constants.boot_efi = True
else:
print("Invalid option")
print("Invalid option")

View File

@@ -240,8 +240,8 @@ class Constants:
@property
def applehda_path(self): return self.payload_apple_kexts_path / Path("Audio/AppleHDA.kext")
# GPU Kexts and Bundles
@property
def legacy_graphics(self): return self.payload_apple_kexts_path / Path("Graphics-Acceleration")
@property
@@ -275,18 +275,18 @@ class Constants:
def skylight_path(self): return self.payload_apple_private_frameworks_path_accel / Path("SkyLight.framework")
csr_values = {
"CSR_ALLOW_UNTRUSTED_KEXTS ": False, # 0x1 - Introduced in El Capitan
"CSR_ALLOW_UNRESTRICTED_FS ": False, # 0x2 - Introduced in El Capitan
"CSR_ALLOW_TASK_FOR_PID ": False, # 0x4 - Introduced in El Capitan
"CSR_ALLOW_KERNEL_DEBUGGER ": False, # 0x8 - Introduced in El Capitan
"CSR_ALLOW_APPLE_INTERNAL ": False, # 0x10 - Introduced in El Capitan
"CSR_ALLOW_UNRESTRICTED_DTRACE ": False, # 0x20 - Introduced in El Capitan
"CSR_ALLOW_UNRESTRICTED_NVRAM ": False, # 0x40 - Introduced in El Capitan
"CSR_ALLOW_DEVICE_CONFIGURATION ": False, # 0x80 - Introduced in El Capitan
"CSR_ALLOW_ANY_RECOVERY_OS ": False, # 0x100 - Introduced in Sierra
"CSR_ALLOW_UNAPPROVED_KEXTS ": False, # 0x200 - Introduced in High Sierra
"CSR_ALLOW_EXECUTABLE_POLICY_OVERRIDE": False, # 0x400 - Introduced in Mojave
"CSR_ALLOW_UNAUTHENTICATED_ROOT ": False, # 0x800 - Introduced in Big Sur
"CSR_ALLOW_UNTRUSTED_KEXTS ": False, # 0x1 - Introduced in El Capitan
"CSR_ALLOW_UNRESTRICTED_FS ": False, # 0x2 - Introduced in El Capitan
"CSR_ALLOW_TASK_FOR_PID ": False, # 0x4 - Introduced in El Capitan
"CSR_ALLOW_KERNEL_DEBUGGER ": False, # 0x8 - Introduced in El Capitan
"CSR_ALLOW_APPLE_INTERNAL ": False, # 0x10 - Introduced in El Capitan
"CSR_ALLOW_UNRESTRICTED_DTRACE ": False, # 0x20 - Introduced in El Capitan
"CSR_ALLOW_UNRESTRICTED_NVRAM ": False, # 0x40 - Introduced in El Capitan
"CSR_ALLOW_DEVICE_CONFIGURATION ": False, # 0x80 - Introduced in El Capitan
"CSR_ALLOW_ANY_RECOVERY_OS ": False, # 0x100 - Introduced in Sierra
"CSR_ALLOW_UNAPPROVED_KEXTS ": False, # 0x200 - Introduced in High Sierra
"CSR_ALLOW_EXECUTABLE_POLICY_OVERRIDE": False, # 0x400 - Introduced in Mojave
"CSR_ALLOW_UNAUTHENTICATED_ROOT ": False, # 0x800 - Introduced in Big Sur
}
sbm_values = [
@@ -306,4 +306,4 @@ class Constants:
"j215",
"j185",
"j185f",
]
]

View File

@@ -74,7 +74,7 @@ SupportedSMBIOS12 = [
]
## CPU patches
# CPU patches
MissingSSE42 = [
"MacBook4,1",
@@ -127,7 +127,7 @@ pciSSDT = [
"Dortania1,1"
]
## Ethernet patches
# Ethernet patches
EthernetNvidia = [
"MacBook5,1",
@@ -170,7 +170,7 @@ EthernetBroadcom = [
"Dortania1,1"
]
## Wifi patches
# Wifi patches
WifiAtheros = [
"iMac10,1",
@@ -213,19 +213,19 @@ WifiBCM94322 = [
WifiBCM94331 = [
"MacBook6,1", # PciRoot(0x0)/Pci(0x15,0x0)/Pci(0x0,0x0)
"MacBook7,1", # PciRoot(0x0)/Pci(0x15,0x0)/Pci(0x0,0x0)
"MacBookAir4,1", # PciRoot(0x0)/Pci(0x1C,0x1)/Pci(0x0,0x0)
"MacBookAir4,2", # PciRoot(0x0)/Pci(0x1C,0x1)/Pci(0x0,0x0)
"MacBookAir5,1", # PciRoot(0x0)/Pci(0x1C,0x1)/Pci(0x0,0x0)
"MacBookAir5,2", # PciRoot(0x0)/Pci(0x1C,0x1)/Pci(0x0,0x0)
"MacBookPro6,1", # PciRoot(0x0)/Pci(0x1C,0x1)/Pci(0x0,0x0)
"MacBookPro6,2", # PciRoot(0x0)/Pci(0x1C,0x1)/Pci(0x0,0x0)
"MacBookPro8,1", # PciRoot(0x0)/Pci(0x1C,0x1)/Pci(0x0,0x0)
"MacBookPro8,2", # PciRoot(0x0)/Pci(0x1C,0x1)/Pci(0x0,0x0)
"MacBookPro8,3", # PciRoot(0x0)/Pci(0x1C,0x1)/Pci(0x0,0x0)
"MacBookPro9,1", # PciRoot(0x0)/Pci(0x1C,0x1)/Pci(0x0,0x0)
"MacBookPro9,2", # PciRoot(0x0)/Pci(0x1C,0x1)/Pci(0x0,0x0)
"MacBookPro10,1",# PciRoot(0x0)/Pci(0x1C,0x1)/Pci(0x0,0x0)
"MacBookPro10,2",# PciRoot(0x0)/Pci(0x1C,0x1)/Pci(0x0,0x0)
"MacBookAir4,1", # PciRoot(0x0)/Pci(0x1C,0x1)/Pci(0x0,0x0)
"MacBookAir4,2", # PciRoot(0x0)/Pci(0x1C,0x1)/Pci(0x0,0x0)
"MacBookAir5,1", # PciRoot(0x0)/Pci(0x1C,0x1)/Pci(0x0,0x0)
"MacBookAir5,2", # PciRoot(0x0)/Pci(0x1C,0x1)/Pci(0x0,0x0)
"MacBookPro6,1", # PciRoot(0x0)/Pci(0x1C,0x1)/Pci(0x0,0x0)
"MacBookPro6,2", # PciRoot(0x0)/Pci(0x1C,0x1)/Pci(0x0,0x0)
"MacBookPro8,1", # PciRoot(0x0)/Pci(0x1C,0x1)/Pci(0x0,0x0)
"MacBookPro8,2", # PciRoot(0x0)/Pci(0x1C,0x1)/Pci(0x0,0x0)
"MacBookPro8,3", # PciRoot(0x0)/Pci(0x1C,0x1)/Pci(0x0,0x0)
"MacBookPro9,1", # PciRoot(0x0)/Pci(0x1C,0x1)/Pci(0x0,0x0)
"MacBookPro9,2", # PciRoot(0x0)/Pci(0x1C,0x1)/Pci(0x0,0x0)
"MacBookPro10,1", # PciRoot(0x0)/Pci(0x1C,0x1)/Pci(0x0,0x0)
"MacBookPro10,2", # PciRoot(0x0)/Pci(0x1C,0x1)/Pci(0x0,0x0)
"Macmini4,1", # PciRoot(0x0)/Pci(0x15,0x0)/Pci(0x0,0x0)
"Macmini5,1", # PciRoot(0x0)/Pci(0x1C,0x1)/Pci(0x0,0x0)
"Macmini5,2", # PciRoot(0x0)/Pci(0x1C,0x1)/Pci(0x0,0x0)
@@ -238,7 +238,7 @@ WifiBCM94331 = [
"Dortania1,1"
]
## Audio
# Audio
LegacyAudio = [
"MacBook4,1",
@@ -301,106 +301,106 @@ nvidiaHDEF = [
"iMac10,1"
]
## GPU
# GPU
LegacyGPU = [
"MacBook4,1", # GMA X3100
"MacBook5,1", # Nvidia 9000
"MacBook5,2", # Nvidia 9000
"MacBook6,1", # Nvidia 9000
"MacBook7,1", # Nvidia 300
"MacBookAir2,1", # Nvidia 9000
"MacBookAir3,1", # Nvidia 300
"MacBookAir3,2", # Nvidia 300
"MacBookAir4,1", # Intel 3000
"MacBookAir4,2", # Intel 3000
"MacBookPro4,1", # Nvidia 8000
"MacBookPro5,1", # Nvidia 9000
"MacBookPro5,2", # Nvidia 9000
"MacBookPro5,3", # Nvidia 9000
"MacBookPro5,4", # Nvidia 9000
"MacBookPro5,5", # Nvidia 9000
"MacBookPro6,1", # Intel 100 + Nvidia 300
"MacBookPro6,2", # Intel 100 + Nvidia 300
"MacBookPro7,1", # Nvidia 300
"MacBookPro8,1", # Intel 3000
"MacBookPro8,2", # Intel 3000 + AMD 6000
"MacBookPro8,3", # Intel 3000 + AMD 6000
"Macmini3,1", # Nvidia 9000
"Macmini4,1", # Nvidia 300
"Macmini5,1", # Intel 3000
"Macmini5,2", # AMD 6000
"Macmini5,3", # Intel 3000
"iMac7,1", # AMD 2000
#"iMac8,1", # Nvidia and AMD 2400
"iMac9,1", # Nvidia 9000
#"iMac10,1", # Nvidia 9000 and AMD 4000
"iMac11,1", # AMD 4000
"iMac11,2", # AMD 4000 and 5000
"iMac11,3", # AMD 5000
"iMac12,1", # AMD 6000
"iMac12,2", # AMD 6000
"Dortania1,1" # RTX 3080
"MacBook4,1", # GMA X3100
"MacBook5,1", # Nvidia 9000
"MacBook5,2", # Nvidia 9000
"MacBook6,1", # Nvidia 9000
"MacBook7,1", # Nvidia 300
"MacBookAir2,1", # Nvidia 9000
"MacBookAir3,1", # Nvidia 300
"MacBookAir3,2", # Nvidia 300
"MacBookAir4,1", # Intel 3000
"MacBookAir4,2", # Intel 3000
"MacBookPro4,1", # Nvidia 8000
"MacBookPro5,1", # Nvidia 9000
"MacBookPro5,2", # Nvidia 9000
"MacBookPro5,3", # Nvidia 9000
"MacBookPro5,4", # Nvidia 9000
"MacBookPro5,5", # Nvidia 9000
"MacBookPro6,1", # Intel 100 + Nvidia 300
"MacBookPro6,2", # Intel 100 + Nvidia 300
"MacBookPro7,1", # Nvidia 300
"MacBookPro8,1", # Intel 3000
"MacBookPro8,2", # Intel 3000 + AMD 6000
"MacBookPro8,3", # Intel 3000 + AMD 6000
"Macmini3,1", # Nvidia 9000
"Macmini4,1", # Nvidia 300
"Macmini5,1", # Intel 3000
"Macmini5,2", # AMD 6000
"Macmini5,3", # Intel 3000
"iMac7,1", # AMD 2000
# "iMac8,1", # Nvidia and AMD 2400
"iMac9,1", # Nvidia 9000
# "iMac10,1", # Nvidia 9000 and AMD 4000
"iMac11,1", # AMD 4000
"iMac11,2", # AMD 4000 and 5000
"iMac11,3", # AMD 5000
"iMac12,1", # AMD 6000
"iMac12,2", # AMD 6000
"Dortania1,1" # RTX 3080
]
LegacyGPUNvidia = [
"MacBook5,1", # Nvidia 9000
"MacBook5,2", # Nvidia 9000
"MacBook6,1", # Nvidia 9000
"MacBook7,1", # Nvidia 300
"MacBookAir2,1", # Nvidia 9000
"MacBookAir3,1", # Nvidia 300
"MacBookAir3,2", # Nvidia 300
"MacBookPro4,1", # Nvidia 8000
"MacBookPro5,1", # Nvidia 9000
"MacBookPro5,2", # Nvidia 9000
"MacBookPro5,3", # Nvidia 9000
"MacBookPro5,4", # Nvidia 9000
"MacBookPro5,5", # Nvidia 9000
"MacBookPro6,1", # Intel 100 + Nvidia 300
"MacBookPro6,2", # Intel 100 + Nvidia 300
"MacBookPro7,1", # Nvidia 300
"Macmini3,1", # Nvidia 9000
"Macmini4,1", # Nvidia 300
"iMac9,1", # Nvidia 9000
#"iMac10,1", # Nvidia 9000 and AMD 4000
"MacBook5,1", # Nvidia 9000
"MacBook5,2", # Nvidia 9000
"MacBook6,1", # Nvidia 9000
"MacBook7,1", # Nvidia 300
"MacBookAir2,1", # Nvidia 9000
"MacBookAir3,1", # Nvidia 300
"MacBookAir3,2", # Nvidia 300
"MacBookPro4,1", # Nvidia 8000
"MacBookPro5,1", # Nvidia 9000
"MacBookPro5,2", # Nvidia 9000
"MacBookPro5,3", # Nvidia 9000
"MacBookPro5,4", # Nvidia 9000
"MacBookPro5,5", # Nvidia 9000
"MacBookPro6,1", # Intel 100 + Nvidia 300
"MacBookPro6,2", # Intel 100 + Nvidia 300
"MacBookPro7,1", # Nvidia 300
"Macmini3,1", # Nvidia 9000
"Macmini4,1", # Nvidia 300
"iMac9,1", # Nvidia 9000
# "iMac10,1", # Nvidia 9000 and AMD 4000
]
LegacyGPUAMD = [
"MacBookPro8,2", # Intel 3000 + AMD 6000
"MacBookPro8,3", # Intel 3000 + AMD 6000
"Macmini5,2", # AMD 6000
"iMac7,1", # AMD 2000
#"iMac8,1", # Nvidia and AMD 2000
#"iMac10,1", # Nvidia 9000 and AMD 4000
"iMac11,1", # AMD 4000
"iMac11,2", # AMD 4000 and 5000
"iMac11,3", # AMD 5000
"iMac12,1", # AMD 6000
"iMac12,2", # AMD 6000
"MacBookPro8,2", # Intel 3000 + AMD 6000
"MacBookPro8,3", # Intel 3000 + AMD 6000
"Macmini5,2", # AMD 6000
"iMac7,1", # AMD 2000
# "iMac8,1", # Nvidia and AMD 2000
# "iMac10,1", # Nvidia 9000 and AMD 4000
"iMac11,1", # AMD 4000
"iMac11,2", # AMD 4000 and 5000
"iMac11,3", # AMD 5000
"iMac12,1", # AMD 6000
"iMac12,2", # AMD 6000
]
LegacyGPUAMDIntelGen2 = [
"MacBookPro8,2", # Intel 3000 + AMD 6000
"MacBookPro8,3", # Intel 3000 + AMD 6000
"Macmini5,2", # AMD 6000
"iMac12,1", # AMD 6000
"iMac12,2", # AMD 6000
"MacBookPro8,2", # Intel 3000 + AMD 6000
"MacBookPro8,3", # Intel 3000 + AMD 6000
"Macmini5,2", # AMD 6000
"iMac12,1", # AMD 6000
"iMac12,2", # AMD 6000
]
LegacyGPUIntelGen1 = [
"MacBookPro6,1", # Intel 100 + Nvidia 300
"MacBookPro6,2", # Intel 100 + Nvidia 300
"MacBookPro6,1", # Intel 100 + Nvidia 300
"MacBookPro6,2", # Intel 100 + Nvidia 300
]
LegacyGPUIntelGen2 = [
"MacBookAir4,1", # Intel 3000
"MacBookAir4,2", # Intel 3000
"MacBookPro8,1", # Intel 3000
"MacBookPro8,2", # Intel 3000 + AMD 6000
"MacBookPro8,3", # Intel 3000 + AMD 6000
"Macmini5,1", # Intel 3000
"Macmini5,3", # Intel 3000
"MacBookAir4,1", # Intel 3000
"MacBookAir4,2", # Intel 3000
"MacBookPro8,1", # Intel 3000
"MacBookPro8,2", # Intel 3000 + AMD 6000
"MacBookPro8,3", # Intel 3000 + AMD 6000
"Macmini5,1", # Intel 3000
"Macmini5,3", # Intel 3000
]
LegacyBrightness = [
@@ -688,70 +688,70 @@ upgradableMXMGPUs = [
# Reference: https://forums.macrumors.com/threads/2011-imac-graphics-card-upgrade.1596614/
NVIDIAMXMGPUs = [
"0x12b9",#Quadro K610M
"0x0ff6",#Quadro K1100M
"0x11fc",#Quadro K2100M
"0x0ffc",#Quadro K1000M
"0x0ffb",#Quadro K2000M
"0x11b6",#Quadro K3100M
"0x11b7",#Quadro K4100M
"0x11bc",#Quadro K5000M
"0x11b8",#Quadro K5100M
"0x11e1",#GTX 765M
"0x11e2",#GTX 765M
"0x11e0",#GTX 770M
"0x119e",#GTX 780M Mac Edition
"0x119e",#GTX 780M
"0x119f",#GTX 880M
"0x119a",#GTX 860M
"0x1392",#GTX 860M
"0x1199",#GTX 870M
"0x11a9",#GTX 870M
"0x12b9", # Quadro K610M
"0x0ff6", # Quadro K1100M
"0x11fc", # Quadro K2100M
"0x0ffc", # Quadro K1000M
"0x0ffb", # Quadro K2000M
"0x11b6", # Quadro K3100M
"0x11b7", # Quadro K4100M
"0x11bc", # Quadro K5000M
"0x11b8", # Quadro K5100M
"0x11e1", # GTX 765M
"0x11e2", # GTX 765M
"0x11e0", # GTX 770M
"0x119e", # GTX 780M Mac Edition
"0x119e", # GTX 780M
"0x119f", # GTX 880M
"0x119a", # GTX 860M
"0x1392", # GTX 860M
"0x1199", # GTX 870M
"0x11a9", # GTX 870M
]
AMDMXMGPUs = [
"0x67EF",#AMD RX 460
"0x67e8",#AMD WX 4130/WX 4150
"0x67e0",#AMD WX 4170
"0x67c0",#AMD WX 7100
"0x67EF", # AMD RX 460
"0x67e8", # AMD WX 4130/WX 4150
"0x67e0", # AMD WX 4170
"0x67c0", # AMD WX 7100
]
BCM4360Wifi = [
"43BA",#BCM43602
"43A3",#BCM4350
"43A0",#BCM4360
"43BA", # BCM43602
"43A3", # BCM4350
"43A0", # BCM4360
]
BCM94331Wifi = [
"4331",#BCM94331
"4353",#BCM943224
"4331", # BCM94331
"4353", # BCM943224
]
BCM94322Wifi = [
"432B",#BCM94322
"432B", # BCM94322
]
BCM94328Wifi = [
"4311",
"4312",
"4313",
"4318",
"4319",
"431A",
"4320",
"4324",
"4325",
"4328",
"432C",
"432D",
"4312",
"4313",
"4318",
"4319",
"431A",
"4320",
"4324",
"4325",
"4328",
"432C",
"432D",
]
AtherosWifi = [
"0030",
"002A",
"001C",
"0023",
"0024",
"0030",
"002A",
"001C",
"0023",
"0024",
]
NightShiftExclude = [
@@ -867,29 +867,29 @@ NoExFat = [
DeleteNvidiaAccel11 = [
"AMDRadeonX4000.kext",
"AMDRadeonX4000HWServices.kext",
"AMDRadeonX5000.kext",
"AMDRadeonX5000HWServices.kext",
"AMDRadeonX6000.kext",
"AMDRadeonX6000Framebuffer.kext",
"AMDRadeonX6000HWServices.kext",
"AppleIntelBDWGraphics.kext",
"AppleIntelBDWGraphicsFramebuffer.kext",
"AppleIntelCFLGraphicsFramebuffer.kext",
"AppleIntelHD4000Graphics.kext",
"AppleIntelHD5000Graphics.kext",
"AppleIntelICLGraphics.kext",
"AppleIntelICLLPGraphicsFramebuffer.kext",
"AppleIntelKBLGraphics.kext",
"AppleIntelKBLGraphicsFramebuffer.kext",
"AppleIntelSKLGraphics.kext",
"AppleIntelSKLGraphicsFramebuffer.kext",
"AppleIntelFramebufferAzul.kext",
"AppleIntelFramebufferCapri.kext",
"AppleParavirtGPU.kext",
"GeForce.kext",
"IOAcceleratorFamily2.kext",
"IOGPUFamily.kext",
"AMDRadeonX4000HWServices.kext",
"AMDRadeonX5000.kext",
"AMDRadeonX5000HWServices.kext",
"AMDRadeonX6000.kext",
"AMDRadeonX6000Framebuffer.kext",
"AMDRadeonX6000HWServices.kext",
"AppleIntelBDWGraphics.kext",
"AppleIntelBDWGraphicsFramebuffer.kext",
"AppleIntelCFLGraphicsFramebuffer.kext",
"AppleIntelHD4000Graphics.kext",
"AppleIntelHD5000Graphics.kext",
"AppleIntelICLGraphics.kext",
"AppleIntelICLLPGraphicsFramebuffer.kext",
"AppleIntelKBLGraphics.kext",
"AppleIntelKBLGraphicsFramebuffer.kext",
"AppleIntelSKLGraphics.kext",
"AppleIntelSKLGraphicsFramebuffer.kext",
"AppleIntelFramebufferAzul.kext",
"AppleIntelFramebufferCapri.kext",
"AppleParavirtGPU.kext",
"GeForce.kext",
"IOAcceleratorFamily2.kext",
"IOGPUFamily.kext",
]
DeleteAMDAccel11 = [
@@ -900,11 +900,11 @@ DeleteAMDAccel11 = [
"AMDRadeonX6000.kext",
"AMDRadeonX6000Framebuffer.kext",
"AMDRadeonX6000HWServices.kext",
"AMD7000Controller.kext", # AMDSupport Dependancy
"AMD8000Controller.kext", # AMDSupport Dependancy
"AMD9000Controller.kext", # AMDSupport Dependancy
"AMD9500Controller.kext", # AMDSupport Dependancy
"AMD10000Controller.kext", # AMDSupport Dependancy
"AMD7000Controller.kext", # AMDSupport Dependancy
"AMD8000Controller.kext", # AMDSupport Dependancy
"AMD9000Controller.kext", # AMDSupport Dependancy
"AMD9500Controller.kext", # AMDSupport Dependancy
"AMD10000Controller.kext", # AMDSupport Dependancy
"AppleIntelBDWGraphics.kext",
"AppleIntelBDWGraphicsFramebuffer.kext",
"AppleIntelCFLGraphicsFramebuffer.kext",
@@ -926,103 +926,103 @@ DeleteAMDAccel11 = [
AddNvidiaAccel11 = [
"GeForceGA.bundle",
"GeForceTesla.kext",
"GeForceTeslaGLDriver.bundle",
"GeForceTeslaVADriver.bundle",
"NVDANV50HalTesla.kext",
"NVDAResmanTesla.kext",
"GeForceTesla.kext",
"GeForceTeslaGLDriver.bundle",
"GeForceTeslaVADriver.bundle",
"NVDANV50HalTesla.kext",
"NVDAResmanTesla.kext",
"IOSurface.kext",
]
AddNvidiaBrightness11 = [
"GeForceGA.bundle",
"GeForceTesla.kext",
"GeForceTeslaGLDriver.bundle",
"GeForceTeslaVADriver.bundle",
"NVDANV50HalTesla.kext",
"NVDAResmanTesla.kext",
"GeForceTesla.kext",
"GeForceTeslaGLDriver.bundle",
"GeForceTeslaVADriver.bundle",
"NVDANV50HalTesla.kext",
"NVDAResmanTesla.kext",
]
AddAMDAccel11 = [
"AMD2400Controller.kext",
"AMD2600Controller.kext",
"AMD3800Controller.kext",
"AMD4600Controller.kext",
"AMD4800Controller.kext",
"AMD5000Controller.kext",
"AMD6000Controller.kext",
"AMDFramebuffer.kext",
"AMDLegacyFramebuffer.kext",
"AMDLegacySupport.kext",
"AMDRadeonVADriver.bundle",
"AMDRadeonVADriver2.bundle",
#"AMDRadeonX3000.kext", # __ZN22IOAccelDisplayMachine210gMetaClassE link issues
#"AMDRadeonX3000GLDriver.bundle",
"AMDShared.bundle",
"AMDSupport.kext",
"ATIRadeonX2000.kext",
"ATIRadeonX2000GA.plugin",
"ATIRadeonX2000GLDriver.bundle",
"ATIRadeonX2000VADriver.bundle",
"AMD2600Controller.kext",
"AMD3800Controller.kext",
"AMD4600Controller.kext",
"AMD4800Controller.kext",
"AMD5000Controller.kext",
"AMD6000Controller.kext",
"AMDFramebuffer.kext",
"AMDLegacyFramebuffer.kext",
"AMDLegacySupport.kext",
"AMDRadeonVADriver.bundle",
"AMDRadeonVADriver2.bundle",
# "AMDRadeonX3000.kext", # __ZN22IOAccelDisplayMachine210gMetaClassE link issues
# "AMDRadeonX3000GLDriver.bundle",
"AMDShared.bundle",
"AMDSupport.kext",
"ATIRadeonX2000.kext",
"ATIRadeonX2000GA.plugin",
"ATIRadeonX2000GLDriver.bundle",
"ATIRadeonX2000VADriver.bundle",
"IOSurface.kext",
]
AddAMDBrightness11 = [
"AMD2400Controller.kext",
"AMD2600Controller.kext",
"AMD3800Controller.kext",
"AMD4600Controller.kext",
"AMD4800Controller.kext",
"AMD5000Controller.kext",
"AMD6000Controller.kext",
"AMDLegacyFramebuffer.kext",
"AMDLegacySupport.kext",
"AMDRadeonX3000.kext",
"AMDRadeonX3000GLDriver.bundle",
"ATIRadeonX2000.kext",
"ATIRadeonX2000GA.plugin",
"ATIRadeonX2000GLDriver.bundle",
"ATIRadeonX2000VADriver.bundle",
"AMD2600Controller.kext",
"AMD3800Controller.kext",
"AMD4600Controller.kext",
"AMD4800Controller.kext",
"AMD5000Controller.kext",
"AMD6000Controller.kext",
"AMDLegacyFramebuffer.kext",
"AMDLegacySupport.kext",
"AMDRadeonX3000.kext",
"AMDRadeonX3000GLDriver.bundle",
"ATIRadeonX2000.kext",
"ATIRadeonX2000GA.plugin",
"ATIRadeonX2000GLDriver.bundle",
"ATIRadeonX2000VADriver.bundle",
]
AddIntelGen1Accel = [
"AppleIntelFramebufferAzul.kext",
"AppleIntelFramebufferCapri.kext",
"AppleIntelHDGraphics.kext",
"AppleIntelHDGraphicsFB.kext",
"AppleIntelHDGraphicsGA.plugin",
"AppleIntelHDGraphicsGLDriver.bundle",
"AppleIntelHDGraphicsVADriver.bundle",
"AppleIntelFramebufferCapri.kext",
"AppleIntelHDGraphics.kext",
"AppleIntelHDGraphicsFB.kext",
"AppleIntelHDGraphicsGA.plugin",
"AppleIntelHDGraphicsGLDriver.bundle",
"AppleIntelHDGraphicsVADriver.bundle",
"IOSurface.kext",
]
AddIntelGen1Brightness = [
"AppleIntelFramebufferAzul.kext",
"AppleIntelFramebufferCapri.kext",
"AppleIntelHDGraphics.kext",
"AppleIntelHDGraphicsFB.kext",
"AppleIntelHDGraphicsGA.plugin",
"AppleIntelHDGraphicsGLDriver.bundle",
"AppleIntelHDGraphicsVADriver.bundle",
"AppleIntelFramebufferCapri.kext",
"AppleIntelHDGraphics.kext",
"AppleIntelHDGraphicsFB.kext",
"AppleIntelHDGraphicsGA.plugin",
"AppleIntelHDGraphicsGLDriver.bundle",
"AppleIntelHDGraphicsVADriver.bundle",
]
AddIntelGen2Accel = [
"AppleIntelHD3000Graphics.kext",
"AppleIntelHD3000GraphicsGA.plugin",
"AppleIntelHD3000GraphicsGLDriver.bundle",
"AppleIntelHD3000GraphicsVADriver.bundle",
"AppleIntelSNBGraphicsFB.kext",
"AppleIntelSNBVA.bundle",
"AppleIntelHD3000GraphicsGA.plugin",
"AppleIntelHD3000GraphicsGLDriver.bundle",
"AppleIntelHD3000GraphicsVADriver.bundle",
"AppleIntelSNBGraphicsFB.kext",
"AppleIntelSNBVA.bundle",
"IOSurface.kext",
]
AddIntelGen2Brightness = [
"AppleIntelHD3000Graphics.kext",
"AppleIntelHD3000GraphicsGA.plugin",
"AppleIntelHD3000GraphicsGLDriver.bundle",
"AppleIntelHD3000GraphicsVADriver.bundle",
"AppleIntelSNBGraphicsFB.kext",
"AppleIntelSNBVA.bundle",
"AppleIntelHD3000GraphicsGA.plugin",
"AppleIntelHD3000GraphicsGLDriver.bundle",
"AppleIntelHD3000GraphicsVADriver.bundle",
"AppleIntelSNBGraphicsFB.kext",
"AppleIntelSNBVA.bundle",
]
DeleteBrightness = [
@@ -1030,6 +1030,6 @@ DeleteBrightness = [
]
AddBrightness = [
"AppleBacklight.kext",
"AppleBacklightExpert.kext",
]
"AppleBacklight.kext",
"AppleBacklightExpert.kext",
]

View File

@@ -164,7 +164,6 @@ class PatchSysVolume:
print("- Enabling NSDefenestratorModeEnabled")
subprocess.run("defaults write -g NSDefenestratorModeEnabled -bool true".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
def patch_root_vol(self):
print(f"- Detecting patches for {self.model}")
rebuild_required = False
@@ -282,7 +281,7 @@ class PatchSysVolume:
self.download_files()
def download_files(self):
utilities.cls()
Utilities.cls()
print("- Downloading Apple binaries")
popen_oclp = subprocess.Popen(f"curl -S -L {self.constants.url_apple_binaries} --output {self.constants.payload_apple_root_path_zip}".split(), stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, universal_newlines=True)
for stdout_line in iter(popen_oclp.stdout.readline, ""):
@@ -317,7 +316,7 @@ class PatchSysVolume:
print(f"Cannot run on this OS, requires macOS 11!")
else:
self.check_status()
utilities.cls()
Utilities.cls()
if (self.sip_patch_status is False) and (self.smb_status is False):
print("- Detected SIP and SecureBootModel are disabled, continuing")
input("\nPress [ENTER] to continue")
@@ -341,6 +340,7 @@ class PatchSysVolume:
print("Please disable FileVault in System Preferences")
print("")
input("Press [Enter] to go exit.")
def start_unpatch(self):
if self.constants.custom_model is not None:
print("Unpatching must be done on target machine!")
@@ -348,7 +348,7 @@ class PatchSysVolume:
print(f"Cannot run on this OS, requires macOS 11!")
else:
self.check_status()
utilities.cls()
Utilities.cls()
if (self.sip_patch_status is False) and (self.smb_status is False):
print("- Detected SIP and SecureBootModel are disabled, continuing")
input("\nPress [ENTER] to continue")
@@ -370,4 +370,3 @@ class PatchSysVolume:
print("Please disable FileVault in System Preferences")
print("")
input("Press [Enter] to go exit.")

View File

@@ -8,6 +8,12 @@ Main hardware we'd appreciate:
* Any Mac you own
* Does require SSE4,1 CPU to test on Sierra and newer however
Additionally, hardware info dumps are greatly beneficial for us to determine what patches a machine might need:
* [IORegistryExplorer](https://github.com/khronokernel/IORegistryClone/blob/master/ioreg-210.zip?raw=true)
* `File -> SaveAs` and open an issue on Github
* Note: We want IOReg dumps of hardware not running on OpenCore, instead running a clean, supported OS
If you have any legacy hardware you're willing to donate, please contact us at the following email: