Merge pull request #999 from dortania/ventura-alpha

Implement beta Ventura support
This commit is contained in:
Mykola Grymalyuk
2022-10-18 22:21:12 -06:00
committed by GitHub
67 changed files with 2985 additions and 676 deletions

2
.gitignore vendored
View File

@@ -30,3 +30,5 @@ __pycache__/
/payloads/OpenCore-Legacy-Patcher
/payloads/InstallAssistant.pkg.integrityDataV1
/payloads.dmg
/payloads/OpenCore-Legacy-Patcher-*.plist
/payloads/KDK.dmg

View File

@@ -117,15 +117,20 @@ class create_binary:
"AutoPkg-Assets.pkg",
"AutoPkg-Assets.pkg.zip",
"InstallAssistant.pkg",
"InstallAssistant.pkg.integrityDataV1",
"KDK.dmg",
]
print("- Deleting extra binaries...")
for file in Path("payloads").glob(pattern="*"):
if file.name in delete_files:
if file.name in delete_files or file.name.startswith("OpenCore-Legacy-Patcher"):
print(f" - Deleting {file.name}")
file.unlink()
elif (Path(file) / Path("Contents/Resources/createinstallmedia")).exists():
print(f" - Deleting {file}")
subprocess.run(["rm", "-rf", file])
elif Path(file).is_dir() and file.name == "Universal-Binaries":
print(f" - Deleting {file}")
subprocess.run(["rm", "-rf", file])
def download_resources(self):
patcher_support_pkg_version = constants.Constants().patcher_support_pkg_version

View File

@@ -1,5 +1,54 @@
# OpenCore Legacy Patcher changelog
## 0.5.0
- Ventura Specific Updates:
- Switch boot.efi model patch to iMac18,1
- Resolve pre-Force Touch Trackpad support in Ventura
- Add Ventura-dropped Models:
- MacPro6,1
- Macmini7,1
- iMac16,x, iMac17,1
- MacBook9,1
- MacBookAir7,x
- MacBookPro11,4/5, MacBookPro12,1, MacBookPro13,x
- Add Ventura Software Catalog parsing
- Add Kernel Debug Kit checks to Ventura root patching
- Add USB map injection for dropped models
- Resolve Ethernet support on MacPro3,1-5,1
- Fix VMM patch set
- Allow dyld shared cache swapping on pre-Haswell
- Fix MouSSE/SSE4,2 emulation in macOS 13.0 Beta 3 (22A5295h)
- Graphics Acceleration for legacy Metal GPUs
- Intel: Ivy Bridge, Haswell, Broadwell and Skylake
- Nvidia: Kepler
- AMD: GCN 1 through 3
- AMD: Polaris (on pre-AVX2.0 systems)
- Boot in safe mode to avoid stock driver loading
- Raise SIP requirement to 0x803 for root patching
- Add Ventura Boot Picker icons
- Implement KDK-less root patching for Metal Intel and Nvidia GPUs
- AMD GCN will still require a KDK installed for patching
- Resolve OpenCL support for legacy Metal GPUs
- Implement Automatic Rosetta Cryptex installation on OS installs and updates
- Drops need for manual OS.dmg swapping on pre-Haswell
- Implement automatic Kernel Debug Kit downloader for systems requiring Boot/SysKC rebuilding
- ex. AMD GCN
- Relies on N-1 system for when matching KDK is not present
- Delete unused KDKs in `/Library/Developer/KDKs` during root patching
- Resolve Power Management support for Ivy Bridge and older
- Drop AMFI requirement for Nvidia Kepler and AMD GCN 1-3
- Resolve numerous AMD GCN 1-3 issues (ex. Photos.app, Screen Saver, etc.)
- Add work-around to Catalyst Buttons not responding on non-Metal in macOS Monterey
- Re-export OpenCanopy icons to better support Haswell and newer Macs
- Increment Binaries:
- OpenCorePkg 0.8.5 release
- Lilu 1.6.2 - release
- FeatureUnlock 1.0.9 release
- PatcherSupportPkg 0.7.1 - release
- BrcmPatchRAM 2.6.4 - release
- AutoPkgInstaller 1.0.1 - release
- CryptexFixup 1.0.0 - release
## 0.4.12
## 0.4.11
@@ -70,7 +119,6 @@
- Deprecate TUI support
- Users may still manually run from source for future builds
- Binaries will no longer be provided on future release
- Switch boot.efi model patch to iMac18,1
## 0.4.5
- Fix AutoPatcher.pkg download on releases

View File

@@ -21,6 +21,7 @@ class MacBook:
cpu=device_probe.CPU(
name="Intel(R) Core(TM)2 Duo CPU P8600 @ 2.40GHz",
flags=["FPU", "VME", "DE", "PSE", "TSC", "MSR", "PAE", "MCE", "CX8", "APIC", "SEP", "MTRR", "PGE", "MCA", "CMOV", "PAT", "PSE36", "CLFSH", "DS", "ACPI", "MMX", "FXSR", "SSE", "SSE2", "SS", "HTT", "TM", "PBE", "SSE3", "DTES64", "MON", "DSCPL", "VMX", "SMX", "EST", "TM2", "SSSE3", "CX16", "TPR", "PDCM", "SSE4.1"],
leafs=[],
),
oclp_version=None,
opencore_version=None,
@@ -42,7 +43,8 @@ class MacBookPro:
wifi=device_probe.Broadcom(vendor_id=5348, device_id=17201, class_code=163840, name="ARPT", model=None, pci_path="PciRoot(0x0)/Pci(0x1c,0x1)/Pci(0x0,0x0)"),
cpu=device_probe.CPU(
name='Intel(R) Core(TM) i5-3210M CPU @ 2.50GHz',
flags=['FPU', 'VME', 'DE', 'PSE', 'TSC', 'MSR', 'PAE', 'MCE', 'CX8', 'APIC', 'SEP', 'MTRR', 'PGE', 'MCA', 'CMOV', 'PAT', 'PSE36', 'CLFSH', 'DS', 'ACPI', 'MMX', 'FXSR', 'SSE', 'SSE2', 'SS', 'HTT', 'TM', 'PBE', 'SSE3', 'PCLMULQDQ', 'DTES64', 'MON', 'DSCPL', 'VMX', 'EST', 'TM2', 'SSSE3', 'CX16', 'TPR', 'PDCM', 'SSE4.1', 'SSE4.2', 'x2APIC', 'POPCNT', 'AES', 'PCID', 'XSAVE', 'OSXSAVE', 'TSCTMR', 'AVX1.0', 'RDRAND', 'F16C']
flags=['FPU', 'VME', 'DE', 'PSE', 'TSC', 'MSR', 'PAE', 'MCE', 'CX8', 'APIC', 'SEP', 'MTRR', 'PGE', 'MCA', 'CMOV', 'PAT', 'PSE36', 'CLFSH', 'DS', 'ACPI', 'MMX', 'FXSR', 'SSE', 'SSE2', 'SS', 'HTT', 'TM', 'PBE', 'SSE3', 'PCLMULQDQ', 'DTES64', 'MON', 'DSCPL', 'VMX', 'EST', 'TM2', 'SSSE3', 'CX16', 'TPR', 'PDCM', 'SSE4.1', 'SSE4.2', 'x2APIC', 'POPCNT', 'AES', 'PCID', 'XSAVE', 'OSXSAVE', 'TSCTMR', 'AVX1.0', 'RDRAND', 'F16C'],
leafs=[],
),
oclp_version=None,
opencore_version=None,
@@ -67,7 +69,8 @@ class MacBookPro:
wifi=device_probe.Broadcom(vendor_id=5348, device_id=17312, class_code=163840, name='ARPT', model=None, acpi_path='IOACPIPlane:/_SB/PCI0@0/RP03@1c0002/ARPT@0', pci_path='PciRoot(0x0)/Pci(0x1c,0x2)/Pci(0x0,0x0)'),
cpu=device_probe.CPU(
name='Intel(R) Core(TM) i5-4258U CPU @ 2.40GHz',
flags=['FPU', 'VME', 'DE', 'PSE', 'TSC', 'MSR', 'PAE', 'MCE', 'CX8', 'APIC', 'SEP', 'MTRR', 'PGE', 'MCA', 'CMOV', 'PAT', 'PSE36', 'CLFSH', 'DS', 'ACPI', 'MMX', 'FXSR', 'SSE', 'SSE2', 'SS', 'HTT', 'TM', 'PBE', 'SSE3', 'PCLMULQDQ', 'DTES64', 'MON', 'DSCPL', 'VMX', 'EST', 'TM2', 'SSSE3', 'FMA', 'CX16', 'TPR', 'PDCM', 'SSE4.1', 'SSE4.2', 'x2APIC', 'MOVBE', 'POPCNT', 'AES', 'PCID', 'XSAVE', 'OSXSAVE', 'SEGLIM64', 'TSCTMR', 'AVX1.0', 'RDRAND', 'F16C']
flags=['FPU', 'VME', 'DE', 'PSE', 'TSC', 'MSR', 'PAE', 'MCE', 'CX8', 'APIC', 'SEP', 'MTRR', 'PGE', 'MCA', 'CMOV', 'PAT', 'PSE36', 'CLFSH', 'DS', 'ACPI', 'MMX', 'FXSR', 'SSE', 'SSE2', 'SS', 'HTT', 'TM', 'PBE', 'SSE3', 'PCLMULQDQ', 'DTES64', 'MON', 'DSCPL', 'VMX', 'EST', 'TM2', 'SSSE3', 'FMA', 'CX16', 'TPR', 'PDCM', 'SSE4.1', 'SSE4.2', 'x2APIC', 'MOVBE', 'POPCNT', 'AES', 'PCID', 'XSAVE', 'OSXSAVE', 'SEGLIM64', 'TSCTMR', 'AVX1.0', 'RDRAND', 'F16C'],
leafs=[],
),
oclp_version='0.4.2',
opencore_version='DBG-077-2022-01-10',
@@ -75,6 +78,48 @@ class MacBookPro:
third_party_sata_ssd=False
)
MacBookPro133_Stock = device_probe.Computer(
real_model='MacBookPro13,3',
real_board_id='Mac-A5C67F76ED83108C',
reported_model='MacBookPro13,3',
reported_board_id='Mac-A5C67F76ED83108C',
build_model='MacBookPro13,3',
gpus=[
device_probe.Intel(vendor_id=32902, device_id=6427, class_code=196608, name='IGPU', model='Intel HD Graphics 530', acpi_path='IOACPIPlane:/_SB/PCI0@0/IGPU@20000', pci_path='PciRoot(0x0)/Pci(0x2,0x0)', disable_metal=False, force_compatible=False),
device_probe.AMD(vendor_id=4098, device_id=26607, class_code=196608, name='GFX0', model='AMD Radeon Pro 455', acpi_path='IOACPIPlane:/_SB/PCI0@0/PEG0@10000/GFX0@0', pci_path='PciRoot(0x0)/Pci(0x1,0x0)/Pci(0x0,0x0)', disable_metal=False, force_compatible=False)
],
igpu=device_probe.Intel(vendor_id=32902, device_id=6427, class_code=196608, name='IGPU', model='Intel HD Graphics 530', acpi_path='IOACPIPlane:/_SB/PCI0@0/IGPU@20000', pci_path='PciRoot(0x0)/Pci(0x2,0x0)', disable_metal=False, force_compatible=False),
dgpu=device_probe.AMD(vendor_id=4098, device_id=26607, class_code=196608, name='GFX0', model='AMD Radeon Pro 455', acpi_path='IOACPIPlane:/_SB/PCI0@0/PEG0@10000/GFX0@0', pci_path='PciRoot(0x0)/Pci(0x1,0x0)/Pci(0x0,0x0)', disable_metal=False, force_compatible=False),
storage=[
device_probe.NVMeController(vendor_id=5197, device_id=43012, class_code=67586, name='SSD0', model=None, acpi_path='IOACPIPlane:/_SB/PCI0@0/RP17@1b0000/SSD0@0', pci_path='PciRoot(0x0)/Pci(0x1b,0x0)/Pci(0x0,0x0)', disable_metal=False, force_compatible=False, aspm=258)
],
usb_controllers=[
device_probe.XHCIController(vendor_id=32902, device_id=41263, class_code=787248, name='XHC1', model=None, acpi_path='IOACPIPlane:/_SB/PCI0@0/XHC1@140000', pci_path='PciRoot(0x0)/Pci(0x14,0x0)', disable_metal=False, force_compatible=False),
device_probe.XHCIController(vendor_id=32902, device_id=5588, class_code=787248, name='XHC3', model=None, acpi_path='IOACPIPlane:/_SB/PCI0@0/PEG2@10002/UPSB@0/DSB2@20000/XHC3@0', pci_path='PciRoot(0x0)/Pci(0x1,0x2)/Pci(0x0,0x0)/Pci(0x2,0x0)/Pci(0x0,0x0)', disable_metal=False, force_compatible=False),
device_probe.XHCIController(vendor_id=32902, device_id=5588, class_code=787248, name='XHC2', model=None, acpi_path='IOACPIPlane:/_SB/PCI0@0/PEG1@10001/UPSB@0/DSB2@20000/XHC2@0', pci_path='PciRoot(0x0)/Pci(0x1,0x1)/Pci(0x0,0x0)/Pci(0x2,0x0)/Pci(0x0,0x0)', disable_metal=False, force_compatible=False)
],
sdxc_controller=[],
ethernet=[],
wifi=device_probe.Broadcom(vendor_id=5348, device_id=17338, class_code=163840, name='ARPT', model=None, acpi_path='IOACPIPlane:/_SB/PCI0@0/RP01@1c0000/ARPT@0', pci_path='PciRoot(0x0)/Pci(0x1c,0x0)/Pci(0x0,0x0)', disable_metal=False, force_compatible=False),
cpu=device_probe.CPU(
name='Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz',
flags=['FPU', 'VME', 'DE', 'PSE', 'TSC', 'MSR', 'PAE', 'MCE', 'CX8', 'APIC', 'SEP', 'MTRR', 'PGE', 'MCA', 'CMOV', 'PAT', 'PSE36', 'CLFSH', 'DS', 'ACPI', 'MMX', 'FXSR', 'SSE', 'SSE2', 'SS', 'HTT', 'TM', 'PBE', 'SSE3', 'PCLMULQDQ', 'DTES64', 'MON', 'DSCPL', 'VMX', 'SMX', 'EST', 'TM2', 'SSSE3', 'FMA', 'CX16', 'TPR', 'PDCM', 'SSE4.1', 'SSE4.2', 'x2APIC', 'MOVBE', 'POPCNT', 'AES', 'PCID', 'XSAVE', 'OSXSAVE', 'SEGLIM64', 'TSCTMR', 'AVX1.0', 'RDRAND', 'F16C'],
leafs=[]
),
oclp_version='0.5.0',
opencore_version=None,
opencore_path=None,
bluetooth_chipset=None,
ambient_light_sensor=False,
third_party_sata_ssd=False,
secure_boot_model='x86legacyap',
secure_boot_policy=0,
oclp_sys_version=None,
oclp_sys_date=None,
oclp_sys_url=None,
firmware_vendor='Apple'
)
MacBookPro141_SSD_Upgrade = device_probe.Computer(
real_model='MacBookPro14,1',
real_board_id='Mac-B4831CEBD52A0C4C',
@@ -95,7 +140,8 @@ class MacBookPro:
wifi=device_probe.Broadcom(vendor_id=5348, device_id=17315, class_code=163840, name='ARPT', model=None, acpi_path='IOACPIPlane:/_SB/PCI0@0/RP09@1d0000/ARPT@0', pci_path='PciRoot(0x0)/Pci(0x1d,0x0)/Pci(0x0,0x0)'),
cpu=device_probe.CPU(
name='Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz',
flags=['FPU', 'VME', 'DE', 'PSE', 'TSC', 'MSR', 'PAE', 'MCE', 'CX8', 'APIC', 'SEP', 'MTRR', 'PGE', 'MCA', 'CMOV', 'PAT', 'PSE36', 'CLFSH', 'DS', 'ACPI', 'MMX', 'FXSR', 'SSE', 'SSE2', 'SS', 'HTT', 'TM', 'PBE', 'SSE3', 'PCLMULQDQ', 'DTES64', 'MON', 'DSCPL', 'VMX', 'SMX', 'EST', 'TM2', 'SSSE3', 'FMA', 'CX16', 'TPR', 'PDCM', 'SSE4.1', 'SSE4.2', 'x2APIC', 'MOVBE', 'POPCNT', 'AES', 'PCID', 'XSAVE', 'OSXSAVE', 'SEGLIM64', 'TSCTMR', 'AVX1.0', 'RDRAND', 'F16C']
flags=['FPU', 'VME', 'DE', 'PSE', 'TSC', 'MSR', 'PAE', 'MCE', 'CX8', 'APIC', 'SEP', 'MTRR', 'PGE', 'MCA', 'CMOV', 'PAT', 'PSE36', 'CLFSH', 'DS', 'ACPI', 'MMX', 'FXSR', 'SSE', 'SSE2', 'SS', 'HTT', 'TM', 'PBE', 'SSE3', 'PCLMULQDQ', 'DTES64', 'MON', 'DSCPL', 'VMX', 'SMX', 'EST', 'TM2', 'SSSE3', 'FMA', 'CX16', 'TPR', 'PDCM', 'SSE4.1', 'SSE4.2', 'x2APIC', 'MOVBE', 'POPCNT', 'AES', 'PCID', 'XSAVE', 'OSXSAVE', 'SEGLIM64', 'TSCTMR', 'AVX1.0', 'RDRAND', 'F16C'],
leafs=[],
), oclp_version='0.4.1',
opencore_version=None,
bluetooth_chipset=None,
@@ -115,6 +161,7 @@ class MacBookPro:
cpu=device_probe.CPU(
name="Apple M1",
flags=["FPU", "VME", "DE", "PSE", "TSC", "MSR", "PAE", "MCE", "CX8", "APIC", "SEP", "MTRR", "PGE", "MCA", "CMOV", "PAT", "PSE36", "CLFSH", "DS", "ACPI", "MMX", "FXSR", "SSE", "SSE2", "SS", "HTT", "TM", "PBE", "SSE3", "PCLMULQDQ", "DTSE64", "MON", "DSCPL", "VMX", "EST", "TM2", "SSSE3", "CX16", "TPR", "PDCM", "SSE4.1", "SSE4.2", "AES", "SEGLIM64"],
leafs=[],
),
oclp_version=None,
opencore_version=None,
@@ -122,6 +169,144 @@ class MacBookPro:
class Macmini:
Macmini52_Stock = device_probe.Computer(
real_model='Macmini5,2',
real_board_id='Mac-4BC72D62AD45599E',
reported_model='Macmini5,2',
reported_board_id='Mac-4BC72D62AD45599E',
build_model='Macmini5,2',
gpus=[
device_probe.Intel(vendor_id=32902, device_id=294, class_code=229376, name='IGPU', model='Intel HD Graphics 3000', acpi_path='IOACPIPlane:/_SB/PCI0@0/IGPU@20000', pci_path='PciRoot(0x0)/Pci(0x2,0x0)', disable_metal=False, force_compatible=False),
device_probe.AMD(vendor_id=4098, device_id=26433, class_code=196608, name='GFX0', model='AMD Radeon HD 6630M', acpi_path='IOACPIPlane:/_SB/PCI0@0/P0P2@10000/GFX0@0', pci_path='PciRoot(0x0)/Pci(0x1,0x0)/Pci(0x0,0x0)', disable_metal=False, force_compatible=False)],
igpu=device_probe.Intel(vendor_id=32902, device_id=294, class_code=229376, name='IGPU', model='Intel HD Graphics 3000', acpi_path='IOACPIPlane:/_SB/PCI0@0/IGPU@20000', pci_path='PciRoot(0x0)/Pci(0x2,0x0)', disable_metal=False, force_compatible=False),
dgpu=device_probe.AMD(vendor_id=4098, device_id=26433, class_code=196608, name='GFX0', model='AMD Radeon HD 6630M', acpi_path='IOACPIPlane:/_SB/PCI0@0/P0P2@10000/GFX0@0', pci_path='PciRoot(0x0)/Pci(0x1,0x0)/Pci(0x0,0x0)', disable_metal=False, force_compatible=False),
storage=[
device_probe.SATAController(vendor_id=32902, device_id=7171, class_code=67073, name='SATA', model=None, acpi_path='IOACPIPlane:/_SB/PCI0@0/SATA@1f0002', pci_path='PciRoot(0x0)/Pci(0x1f,0x2)', disable_metal=False, force_compatible=False)
],
usb_controllers=[
device_probe.EHCIController(vendor_id=32902, device_id=7213, class_code=787232, name='EHC2', model=None, acpi_path='IOACPIPlane:/_SB/PCI0@0/EHC2@1a0007', pci_path='PciRoot(0x0)/Pci(0x1a,0x7)', disable_metal=False, force_compatible=False),
device_probe.EHCIController(vendor_id=32902, device_id=7206, class_code=787232, name='EHC1', model=None, acpi_path='IOACPIPlane:/_SB/PCI0@0/EHC1@1d0007', pci_path='PciRoot(0x0)/Pci(0x1d,0x7)', disable_metal=False, force_compatible=False),
device_probe.UHCIController(vendor_id=32902, device_id=7212, class_code=787200, name='UHC5', model=None, acpi_path='IOACPIPlane:/_SB/PCI0@0/UHC5@1a0000', pci_path='PciRoot(0x0)/Pci(0x1a,0x0)', disable_metal=False, force_compatible=False),
device_probe.UHCIController(vendor_id=32902, device_id=7207, class_code=787200, name='UHC1', model=None, acpi_path='IOACPIPlane:/_SB/PCI0@0/UHC1@1d0000', pci_path='PciRoot(0x0)/Pci(0x1d,0x0)', disable_metal=False, force_compatible=False)
],
sdxc_controller=[
device_probe.SDXCController(vendor_id=5348, device_id=5820, class_code=525569, name='SDXC', model=None, acpi_path='IOACPIPlane:/_SB/PCI0@0/RP01@1c0000/SDXC@1', pci_path='PciRoot(0x0)/Pci(0x1c,0x0)/Pci(0x0,0x1)', disable_metal=False, force_compatible=False)
],
ethernet=[
device_probe.BroadcomEthernet(vendor_id=5348, device_id=5812, class_code=131072, name='GIGE', model='Broadcom 57765-B0', acpi_path='IOACPIPlane:/_SB/PCI0@0/RP01@1c0000/GIGE@0', pci_path='PciRoot(0x0)/Pci(0x1c,0x0)/Pci(0x0,0x0)', disable_metal=False, force_compatible=False)
],
wifi=device_probe.Broadcom(vendor_id=5348, device_id=17201, class_code=163840, name='ARPT', model=None, acpi_path='IOACPIPlane:/_SB/PCI0@0/RP02@1c0001/ARPT@0', pci_path='PciRoot(0x0)/Pci(0x1c,0x1)/Pci(0x0,0x0)', disable_metal=False, force_compatible=False),
cpu=device_probe.CPU(
name='Intel(R) Core(TM) i5-2520M CPU @ 2.50GHz',
flags=['FPU', 'VME', 'DE', 'PSE', 'TSC', 'MSR', 'PAE', 'MCE', 'CX8', 'APIC', 'SEP', 'MTRR', 'PGE', 'MCA', 'CMOV', 'PAT', 'PSE36', 'CLFSH', 'DS', 'ACPI', 'MMX', 'FXSR', 'SSE', 'SSE2', 'SS', 'HTT', 'TM', 'PBE', 'SSE3', 'PCLMULQDQ', 'DTES64', 'MON', 'DSCPL', 'VMX', 'SMX', 'EST', 'TM2', 'SSSE3', 'CX16', 'TPR', 'PDCM', 'SSE4.1', 'SSE4.2', 'x2APIC', 'POPCNT', 'AES', 'PCID', 'XSAVE', 'OSXSAVE', 'TSCTMR', 'AVX1.0'],
leafs=['']
),
oclp_version='0.5.0',
opencore_version='REL-083-2022-08-01',
opencore_path='PciRoot(0x0)/Pci(0x1F,0x2)/Sata(0x0,0x0,0x0)/HD(1,GPT,D011D782-7E9A-459B-905D-9DA8D6494A53,0x28,0x64000)/EFI\\OC\\OpenCore.efi',
bluetooth_chipset='BRCM20702 Hub',
ambient_light_sensor=False,
third_party_sata_ssd=True,
secure_boot_model='x86legacyap',
secure_boot_policy=0,
oclp_sys_version='v0.4.11',
oclp_sys_date='October 06, 2022 @ 10:06:53',
oclp_sys_url=None,
firmware_vendor='Apple',
rosetta_active=False
)
Macmini61_Stock = device_probe.Computer(
real_model='Macmini6,1',
real_board_id='Mac-031AEE4D24BFF0B1',
reported_model='Macmini6,1',
reported_board_id='Mac-031AEE4D24BFF0B1',
build_model='Macmini6,1',
gpus=[
device_probe.Intel(vendor_id=32902, device_id=358, class_code=196608, name='IGPU', model='Intel HD Graphics 4000', acpi_path='IOACPIPlane:/_SB/PCI0@0/IGPU@20000', pci_path='PciRoot(0x0)/Pci(0x2,0x0)', disable_metal=False, force_compatible=False)
],
igpu=device_probe.Intel(vendor_id=32902, device_id=358, class_code=196608, name='IGPU', model='Intel HD Graphics 4000', acpi_path='IOACPIPlane:/_SB/PCI0@0/IGPU@20000', pci_path='PciRoot(0x0)/Pci(0x2,0x0)', disable_metal=False, force_compatible=False),
dgpu=None,
storage=[
device_probe.SATAController(vendor_id=32902, device_id=7683, class_code=67073, name='SATA', model=None, acpi_path='IOACPIPlane:/_SB/PCI0@0/SATA@1f0002', pci_path='PciRoot(0x0)/Pci(0x1f,0x2)', disable_metal=False, force_compatible=False)
],
usb_controllers=[
device_probe.XHCIController(vendor_id=32902, device_id=7729, class_code=787248, name='XHC1', model=None, acpi_path='IOACPIPlane:/_SB/PCI0@0/XHC1@140000', pci_path='PciRoot(0x0)/Pci(0x14,0x0)', disable_metal=False, force_compatible=False),
device_probe.EHCIController(vendor_id=32902, device_id=7725, class_code=787232, name='EHC2', model=None, acpi_path='IOACPIPlane:/_SB/PCI0@0/EHC2@1a0000', pci_path='PciRoot(0x0)/Pci(0x1a,0x0)', disable_metal=False, force_compatible=False),
device_probe.EHCIController(vendor_id=32902, device_id=7718, class_code=787232, name='EHC1', model=None, acpi_path='IOACPIPlane:/_SB/PCI0@0/EHC1@1d0000', pci_path='PciRoot(0x0)/Pci(0x1d,0x0)', disable_metal=False, force_compatible=False)
],
sdxc_controller=[
device_probe.SDXCController(vendor_id=5348, device_id=5820, class_code=525569, name='SDXC', model=None, acpi_path='IOACPIPlane:/_SB/PCI0@0/RP01@1c0000/SDXC@1', pci_path='PciRoot(0x0)/Pci(0x1c,0x0)/Pci(0x0,0x1)', disable_metal=False, force_compatible=False)
],
ethernet=[
device_probe.BroadcomEthernet(vendor_id=5348, device_id=5766, class_code=131072, name='GIGE', model='Broadcom 57766-A1', acpi_path='IOACPIPlane:/_SB/PCI0@0/RP01@1c0000/GIGE@0', pci_path='PciRoot(0x0)/Pci(0x1c,0x0)/Pci(0x0,0x0)', disable_metal=False, force_compatible=False)
],
wifi=device_probe.Broadcom(vendor_id=5348, device_id=17201, class_code=163840, name='ARPT', model=None, acpi_path='IOACPIPlane:/_SB/PCI0@0/RP02@1c0001/ARPT@0', pci_path='PciRoot(0x0)/Pci(0x1c,0x1)/Pci(0x0,0x0)', disable_metal=False, force_compatible=False
),
cpu=device_probe.CPU(
name='Intel(R) Core(TM) i5-3210M CPU @ 2.50GHz',
flags=['FPU', 'VME', 'DE', 'PSE', 'TSC', 'MSR', 'PAE', 'MCE', 'CX8', 'APIC', 'SEP', 'MTRR', 'PGE', 'MCA', 'CMOV', 'PAT', 'PSE36', 'CLFSH', 'DS', 'ACPI', 'MMX', 'FXSR', 'SSE', 'SSE2', 'SS', 'HTT', 'TM', 'PBE', 'SSE3', 'PCLMULQDQ', 'DTES64', 'MON', 'DSCPL', 'VMX', 'EST', 'TM2', 'SSSE3', 'CX16', 'TPR', 'PDCM', 'SSE4.1', 'SSE4.2', 'x2APIC', 'POPCNT', 'AES', 'PCID', 'XSAVE', 'OSXSAVE', 'TSCTMR', 'AVX1.0', 'RDRAND', 'F16C'],
leafs=['RDWRFSGS', 'SMEP', 'ERMS', 'MDCLEAR', 'IBRS', 'STIBP', 'L1DF', 'SSBD']
),
oclp_version='0.5.0',
opencore_version='REL-083-2022-08-01',
opencore_path='PciRoot(0x0)/Pci(0x1F,0x2)/Sata(0x0,0x0,0x0)/HD(1,GPT,B46958E3-7EB7-40C2-BB3A-2C88A0856DC7,0x28,0x64000)/EFI\\OC\\OpenCore.efi',
bluetooth_chipset='BRCM20702 Hub',
ambient_light_sensor=False,
third_party_sata_ssd=True,
secure_boot_model='x86legacyap',
secure_boot_policy=0,
oclp_sys_version='v0.5.0',
oclp_sys_date='October 04, 2022 @ 12:24:50',
oclp_sys_url='',
firmware_vendor='Apple',
rosetta_active=False
)
Macmini71_Stock = device_probe.Computer(
real_model='Macmini7,1',
real_board_id='Mac-35C5E08120C7EEAF',
reported_model='Macmini7,1',
reported_board_id='Mac-35C5E08120C7EEAF',
build_model='Macmini7,1',
gpus=[
device_probe.Intel(vendor_id=32902, device_id=2606, class_code=196608, name='IGPU', model='Intel Iris', acpi_path='IOACPIPlane:/_SB/PCI0@0/IGPU@20000', pci_path='PciRoot(0x0)/Pci(0x2,0x0)', disable_metal=False, force_compatible=False)
],
igpu=device_probe.Intel(vendor_id=32902, device_id=2606, class_code=196608, name='IGPU', model='Intel Iris', acpi_path='IOACPIPlane:/_SB/PCI0@0/IGPU@20000', pci_path='PciRoot(0x0)/Pci(0x2,0x0)', disable_metal=False, force_compatible=False),
dgpu=None,
storage=[
device_probe.SATAController(vendor_id=32902, device_id=39939, class_code=67073, name='SATA', model=None, acpi_path='IOACPIPlane:/_SB/PCI0@0/SATA@1f0002', pci_path='PciRoot(0x0)/Pci(0x1f,0x2)', disable_metal=False, force_compatible=False)
],
usb_controllers=[
device_probe.XHCIController(vendor_id=32902, device_id=39985, class_code=787248, name='XHC1', model=None, acpi_path='IOACPIPlane:/_SB/PCI0@0/XHC1@140000', pci_path='PciRoot(0x0)/Pci(0x14,0x0)', disable_metal=False, force_compatible=False)
],
sdxc_controller=[
device_probe.SDXCController(vendor_id=5348, device_id=5820, class_code=525569, name='SDXC', model=None, acpi_path='IOACPIPlane:/_SB/PCI0@0/RP04@1c0003/SDXC@1', pci_path='PciRoot(0x0)/Pci(0x1c,0x3)/Pci(0x0,0x1)', disable_metal=False, force_compatible=False)
],
ethernet=[
device_probe.BroadcomEthernet(vendor_id=5348, device_id=5766, class_code=131072, name='GIGE', model='Broadcom 57766-A1', acpi_path='IOACPIPlane:/_SB/PCI0@0/RP04@1c0003/GIGE@0', pci_path='PciRoot(0x0)/Pci(0x1c,0x3)/Pci(0x0,0x0)', disable_metal=False, force_compatible=False)
],
wifi=device_probe.Broadcom(vendor_id=5348, device_id=17312, class_code=163840, name='ARPT', model=None, acpi_path='IOACPIPlane:/_SB/PCI0@0/RP03@1c0002/ARPT@0', pci_path='PciRoot(0x0)/Pci(0x1c,0x2)/Pci(0x0,0x0)', disable_metal=False, force_compatible=False),
cpu=device_probe.CPU(
name='Intel(R) Core(TM) i5-4278U CPU @ 2.60GHz',
flags=['FPU', 'VME', 'DE', 'PSE', 'TSC', 'MSR', 'PAE', 'MCE', 'CX8', 'APIC', 'SEP', 'MTRR', 'PGE', 'MCA', 'CMOV', 'PAT', 'PSE36', 'CLFSH', 'DS', 'ACPI', 'MMX', 'FXSR', 'SSE', 'SSE2', 'SS', 'HTT', 'TM', 'PBE', 'SSE3', 'PCLMULQDQ', 'DTES64', 'MON', 'DSCPL', 'VMX', 'EST', 'TM2', 'SSSE3', 'FMA', 'CX16', 'TPR', 'PDCM', 'SSE4.1', 'SSE4.2', 'x2APIC', 'MOVBE', 'POPCNT', 'AES', 'PCID', 'XSAVE', 'OSXSAVE', 'SEGLIM64', 'TSCTMR', 'AVX1.0', 'RDRAND', 'F16C'],
leafs=['RDWRFSGS', 'TSC_THREAD_OFFSET', 'BMI1', 'AVX2', 'SMEP', 'BMI2', 'ERMS', 'INVPCID', 'FPU_CSDS', 'MDCLEAR', 'IBRS', 'STIBP', 'L1DF', 'SSBD']
),
oclp_version='0.5.0',
opencore_version='REL-083-2022-08-01',
opencore_path='PciRoot(0x0)/Pci(0x1F,0x2)/Sata(0x0,0x0,0x0)/HD(1,GPT,293E8ABF-B98C-4258-A811-04464BCA90EF,0x28,0x64000)/EFI\\OC\\OpenCore.efi',
bluetooth_chipset='BRCM20702 Hub',
ambient_light_sensor=False,
third_party_sata_ssd=True,
secure_boot_model='x86legacyap',
secure_boot_policy=0,
oclp_sys_version='v0.5.0',
oclp_sys_date='October 04, 2022 @ 12:04:48',
oclp_sys_url='https://github.com/dortania/OpenCore-Legacy-Patcher/commit/daf28a62effb2ce06a71cb5961c9d0c79d72c16b',
firmware_vendor='Apple',
rosetta_active=False
)
Macmini81_Stock = device_probe.Computer(
real_model="Macmini8,1",
real_board_id="Mac-7BA5B2DFE22DDD8C",
@@ -134,7 +319,8 @@ class Macmini:
wifi=device_probe.Broadcom(vendor_id=5348, device_id=17508, class_code=163840, name="ARPT", model=None, pci_path="PciRoot(0x0)/Pci(0x1c,0x0)/Pci(0x0,0x0)"),
cpu=device_probe.CPU(
name="Intel(R) Core(TM) i7-8700B CPU @ 3.20GHz",
flags=["FPU", "VME", "DE", "PSE", "TSC", "MSR", "PAE", "MCE", "CX8", "APIC", "SEP", "MTRR", "PGE", "MCA", "CMOV", "PAT", "PSE36", "CLFSH", "DS", "ACPI", "MMX", "FXSR", "SSE", "SSE2", "SS", "HTT", "TM", "PBE", "SSE3", "PCLMULQDQ", "DTES64", "MON", "DSCPL", "VMX", "SMX", "EST", "TM2", "SSSE3", "FMA", "CX16", "TPR", "PDCM", "SSE4.1", "SSE4.2", "x2APIC", "MOVBE", "POPCNT", "AES", "PCID", "XSAVE", "OSXSAVE", "SEGLIM64", "TSCTMR", "AVX1.0", "RDRAND", "F16C"]
flags=["FPU", "VME", "DE", "PSE", "TSC", "MSR", "PAE", "MCE", "CX8", "APIC", "SEP", "MTRR", "PGE", "MCA", "CMOV", "PAT", "PSE36", "CLFSH", "DS", "ACPI", "MMX", "FXSR", "SSE", "SSE2", "SS", "HTT", "TM", "PBE", "SSE3", "PCLMULQDQ", "DTES64", "MON", "DSCPL", "VMX", "SMX", "EST", "TM2", "SSSE3", "FMA", "CX16", "TPR", "PDCM", "SSE4.1", "SSE4.2", "x2APIC", "MOVBE", "POPCNT", "AES", "PCID", "XSAVE", "OSXSAVE", "SEGLIM64", "TSCTMR", "AVX1.0", "RDRAND", "F16C"],
leafs=[],
),
oclp_version=None,
opencore_version=None
@@ -155,7 +341,8 @@ class Macmini:
wifi=device_probe.Broadcom(vendor_id=5348, device_id=17445, class_code=163840, name="wlan", model=None, pci_path=""),
cpu=device_probe.CPU(
name="Apple M1",
flags=["FPU", "VME", "DE", "PSE", "TSC", "MSR", "PAE", "MCE", "CX8", "APIC", "SEP", "MTRR", "PGE", "MCA", "CMOV", "PAT", "PSE36", "CLFSH", "DS", "ACPI", "MMX", "FXSR", "SSE", "SSE2", "SS", "HTT", "TM", "PBE", "SSE3", "PCLMULQDQ", "DTSE64", "MON", "DSCPL", "VMX", "EST", "TM2", "SSSE3", "CX16", "TPR", "PDCM", "SSE4.1", "SSE4.2", "AES", "SEGLIM64"]
flags=["FPU", "VME", "DE", "PSE", "TSC", "MSR", "PAE", "MCE", "CX8", "APIC", "SEP", "MTRR", "PGE", "MCA", "CMOV", "PAT", "PSE36", "CLFSH", "DS", "ACPI", "MMX", "FXSR", "SSE", "SSE2", "SS", "HTT", "TM", "PBE", "SSE3", "PCLMULQDQ", "DTSE64", "MON", "DSCPL", "VMX", "EST", "TM2", "SSSE3", "CX16", "TPR", "PDCM", "SSE4.1", "SSE4.2", "AES", "SEGLIM64"],
leafs=[],
),
oclp_version=None,
opencore_version=None
@@ -180,7 +367,8 @@ class iMac:
wifi=device_probe.Broadcom(vendor_id=5348, device_id=17192, class_code=163840, name="ARPT", model=None, pci_path="PciRoot(0x0)/Pci(0x1c,0x4)/Pci(0x0,0x0)"),
cpu=device_probe.CPU(
name="Intel(R) Core(TM)2 Duo CPU E8135 @ 2.40GHz",
flags=["FPU", "VME", "DE", "PSE", "TSC", "MSR", "PAE", "MCE", "CX8", "APIC", "SEP", "MTRR", "PGE", "MCA", "CMOV", "PAT", "PSE36", "CLFSH", "DS", "ACPI", "MMX", "FXSR", "SSE", "SSE2", "SS", "HTT", "TM", "PBE", "SSE3", "DTES64", "MON", "DSCPL", "VMX", "EST", "TM2", "SSSE3", "CX16", "TPR", "PDCM", "SSE4.1"]
flags=["FPU", "VME", "DE", "PSE", "TSC", "MSR", "PAE", "MCE", "CX8", "APIC", "SEP", "MTRR", "PGE", "MCA", "CMOV", "PAT", "PSE36", "CLFSH", "DS", "ACPI", "MMX", "FXSR", "SSE", "SSE2", "SS", "HTT", "TM", "PBE", "SSE3", "DTES64", "MON", "DSCPL", "VMX", "EST", "TM2", "SSSE3", "CX16", "TPR", "PDCM", "SSE4.1"],
leafs=[],
),
oclp_version=None,
opencore_version=None,
@@ -203,7 +391,8 @@ class iMac:
wifi=device_probe.Atheros(vendor_id=5772, device_id=42, class_code=163840, name="ARPT", model=None, pci_path="PciRoot(0x0)/Pci(0x1c,0x1)/Pci(0x0,0x0)"),
cpu=device_probe.CPU(
name="Intel(R) Core(TM) i3 CPU 540 @ 3.07GHz",
flags=["FPU", "VME", "DE", "PSE", "TSC", "MSR", "PAE", "MCE", "CX8", "APIC", "SEP", "MTRR", "PGE", "MCA", "CMOV", "PAT", "PSE36", "CLFSH", "DS", "ACPI", "MMX", "FXSR", "SSE", "SSE2", "SS", "HTT", "TM", "PBE", "SSE3", "DTES64", "MON", "DSCPL", "VMX", "EST", "TM2", "SSSE3", "CX16", "TPR", "PDCM", "SSE4.1", "SSE4.2", "POPCNT", "PCID"]
flags=["FPU", "VME", "DE", "PSE", "TSC", "MSR", "PAE", "MCE", "CX8", "APIC", "SEP", "MTRR", "PGE", "MCA", "CMOV", "PAT", "PSE36", "CLFSH", "DS", "ACPI", "MMX", "FXSR", "SSE", "SSE2", "SS", "HTT", "TM", "PBE", "SSE3", "DTES64", "MON", "DSCPL", "VMX", "EST", "TM2", "SSSE3", "CX16", "TPR", "PDCM", "SSE4.1", "SSE4.2", "POPCNT", "PCID"],
leafs=[],
),
oclp_version=None,
opencore_version=None,
@@ -226,7 +415,8 @@ class iMac:
wifi=device_probe.Broadcom(vendor_id=5348, device_id=17338, class_code=163840, name="ARPT", model=None, pci_path="PciRoot(0x0)/Pci(0x1c,0x1)/Pci(0x0,0x0)"),
cpu=device_probe.CPU(
name="Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz",
flags=["FPU", "VME", "DE", "PSE", "TSC", "MSR", "PAE", "MCE", "CX8", "APIC", "SEP", "MTRR", "PGE", "MCA", "CMOV", "PAT", "PSE36", "CLFSH", "DS", "ACPI", "MMX", "FXSR", "SSE", "SSE2", "SS", "HTT", "TM", "PBE", "SSE3", "PCLMULQDQ", "DTES64", "MON", "DSCPL", "VMX", "SMX", "EST", "TM2", "SSSE3", "CX16", "TPR", "PDCM", "SSE4.1", "SSE4.2", "xAPIC", "POPCNT", "AES", "PCID", "XSAVE", "OSXSAVE", "TSCTMR", "AVX1.0"]
flags=["FPU", "VME", "DE", "PSE", "TSC", "MSR", "PAE", "MCE", "CX8", "APIC", "SEP", "MTRR", "PGE", "MCA", "CMOV", "PAT", "PSE36", "CLFSH", "DS", "ACPI", "MMX", "FXSR", "SSE", "SSE2", "SS", "HTT", "TM", "PBE", "SSE3", "PCLMULQDQ", "DTES64", "MON", "DSCPL", "VMX", "SMX", "EST", "TM2", "SSSE3", "CX16", "TPR", "PDCM", "SSE4.1", "SSE4.2", "xAPIC", "POPCNT", "AES", "PCID", "XSAVE", "OSXSAVE", "TSCTMR", "AVX1.0"],
leafs=[],
),
oclp_version=None,
opencore_version=None,
@@ -252,7 +442,8 @@ class iMac:
wifi=device_probe.Broadcom(vendor_id=5348, device_id=17201, class_code=163840, name='ARPT', model=None, acpi_path='IOACPIPlane:/_SB/PCI0@0/RP02@1c0001/ARPT@0', pci_path='PciRoot(0x0)/Pci(0x1c,0x1)/Pci(0x0,0x0)'),
cpu=device_probe.CPU(
name='Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz',
flags=['FPU', 'VME', 'DE', 'PSE', 'TSC', 'MSR', 'PAE', 'MCE', 'CX8', 'APIC', 'SEP', 'MTRR', 'PGE', 'MCA', 'CMOV', 'PAT', 'PSE36', 'CLFSH', 'DS', 'ACPI', 'MMX', 'FXSR', 'SSE', 'SSE2', 'SS', 'HTT', 'TM', 'PBE', 'SSE3', 'PCLMULQDQ', 'DTES64', 'MON', 'DSCPL', 'VMX', 'SMX', 'EST', 'TM2', 'SSSE3', 'CX16', 'TPR', 'PDCM', 'SSE4.1', 'SSE4.2', 'x2APIC', 'POPCNT', 'AES', 'PCID', 'XSAVE', 'OSXSAVE', 'TSCTMR', 'AVX1.0']
flags=['FPU', 'VME', 'DE', 'PSE', 'TSC', 'MSR', 'PAE', 'MCE', 'CX8', 'APIC', 'SEP', 'MTRR', 'PGE', 'MCA', 'CMOV', 'PAT', 'PSE36', 'CLFSH', 'DS', 'ACPI', 'MMX', 'FXSR', 'SSE', 'SSE2', 'SS', 'HTT', 'TM', 'PBE', 'SSE3', 'PCLMULQDQ', 'DTES64', 'MON', 'DSCPL', 'VMX', 'SMX', 'EST', 'TM2', 'SSSE3', 'CX16', 'TPR', 'PDCM', 'SSE4.1', 'SSE4.2', 'x2APIC', 'POPCNT', 'AES', 'PCID', 'XSAVE', 'OSXSAVE', 'TSCTMR', 'AVX1.0'],
leafs=[],
),
oclp_version='0.3.3',
opencore_version=None,
@@ -278,7 +469,8 @@ class iMac:
wifi=device_probe.Broadcom(vendor_id=5348, device_id=17312, class_code=163840, name='ARPT', model=None, acpi_path=None, pci_path='PciRoot(0x0)/Pci(0x1c,0x2)/Pci(0x0,0x0)'),
cpu=device_probe.CPU(
name='Intel(R) Core(TM) i5-4690 CPU @ 3.50GHz',
flags=['FPU', 'VME', 'DE', 'PSE', 'TSC', 'MSR', 'PAE', 'MCE', 'CX8', 'APIC', 'SEP', 'MTRR', 'PGE', 'MCA', 'CMOV', 'PAT', 'PSE36', 'CLFSH', 'DS', 'ACPI', 'MMX', 'FXSR', 'SSE', 'SSE2', 'SS', 'HTT', 'TM', 'PBE', 'SSE3', 'PCLMULQDQ', 'DTES64', 'MON', 'DSCPL', 'VMX', 'SMX', 'EST', 'TM2', 'SSSE3', 'FMA', 'CX16', 'TPR', 'PDCM', 'SSE4.1', 'SSE4.2', 'x2APIC', 'MOVBE', 'POPCNT', 'AES', 'PCID', 'XSAVE', 'OSXSAVE', 'SEGLIM64', 'TSCTMR', 'AVX1.0', 'RDRAND', 'F16C']
flags=['FPU', 'VME', 'DE', 'PSE', 'TSC', 'MSR', 'PAE', 'MCE', 'CX8', 'APIC', 'SEP', 'MTRR', 'PGE', 'MCA', 'CMOV', 'PAT', 'PSE36', 'CLFSH', 'DS', 'ACPI', 'MMX', 'FXSR', 'SSE', 'SSE2', 'SS', 'HTT', 'TM', 'PBE', 'SSE3', 'PCLMULQDQ', 'DTES64', 'MON', 'DSCPL', 'VMX', 'SMX', 'EST', 'TM2', 'SSSE3', 'FMA', 'CX16', 'TPR', 'PDCM', 'SSE4.1', 'SSE4.2', 'x2APIC', 'MOVBE', 'POPCNT', 'AES', 'PCID', 'XSAVE', 'OSXSAVE', 'SEGLIM64', 'TSCTMR', 'AVX1.0', 'RDRAND', 'F16C'],
leafs=[],
),
oclp_version=None,
opencore_version=None,
@@ -305,7 +497,8 @@ class iMac:
wifi=device_probe.Broadcom(vendor_id=5348, device_id=17508, class_code=163840, name='ARPT', model=None, acpi_path='IOACPIPlane:/_SB/PCI0@0/RP01@1c0000/ARPT@0', pci_path='PciRoot(0x0)/Pci(0x1c,0x0)/Pci(0x0,0x0)'),
cpu=device_probe.CPU(
name='Intel(R) Core(TM) i5-10500 CPU @ 3.10GHz',
flags=['FPU', 'VME', 'DE', 'PSE', 'TSC', 'MSR', 'PAE', 'MCE', 'CX8', 'APIC', 'SEP', 'MTRR', 'PGE', 'MCA', 'CMOV', 'PAT', 'PSE36', 'CLFSH', 'DS', 'ACPI', 'MMX', 'FXSR', 'SSE', 'SSE2', 'SS', 'HTT', 'TM', 'PBE', 'SSE3', 'PCLMULQDQ', 'DTES64', 'MON', 'DSCPL', 'VMX', 'SMX', 'EST', 'TM2', 'SSSE3', 'FMA', 'CX16', 'TPR', 'PDCM', 'SSE4.1', 'SSE4.2', 'x2APIC', 'MOVBE', 'POPCNT', 'AES', 'PCID', 'XSAVE', 'OSXSAVE', 'SEGLIM64', 'TSCTMR', 'AVX1.0', 'RDRAND', 'F16C']
flags=['FPU', 'VME', 'DE', 'PSE', 'TSC', 'MSR', 'PAE', 'MCE', 'CX8', 'APIC', 'SEP', 'MTRR', 'PGE', 'MCA', 'CMOV', 'PAT', 'PSE36', 'CLFSH', 'DS', 'ACPI', 'MMX', 'FXSR', 'SSE', 'SSE2', 'SS', 'HTT', 'TM', 'PBE', 'SSE3', 'PCLMULQDQ', 'DTES64', 'MON', 'DSCPL', 'VMX', 'SMX', 'EST', 'TM2', 'SSSE3', 'FMA', 'CX16', 'TPR', 'PDCM', 'SSE4.1', 'SSE4.2', 'x2APIC', 'MOVBE', 'POPCNT', 'AES', 'PCID', 'XSAVE', 'OSXSAVE', 'SEGLIM64', 'TSCTMR', 'AVX1.0', 'RDRAND', 'F16C'],
leafs=[],
),
oclp_version=None,
opencore_version=None,
@@ -333,6 +526,7 @@ class MacPro:
cpu=device_probe.CPU(
name="Intel(R) Xeon(R) CPU X5482 @ 3.20GHz",
flags=["FPU", "VME", "DE", "PSE", "TSC", "MSR", "PAE", "MCE", "CX8", "APIC", "SEP", "MTRR", "PGE", "MCA", "CMOV", "PAT", "PSE36", "CLFSH", "DS", "ACPI", "MMX", "FXSR", "SSE", "SSE2", "SS", "HTT", "TM", "PBE", "SSE3", "DTES64", "MON", "DSCPL", "VMX", "EST", "TM2", "SSSE3", "CX16", "TPR", "PDCM", "SSE4.1"],
leafs=[],
),
oclp_version=None,
opencore_version=None,
@@ -358,6 +552,7 @@ class MacPro:
cpu=device_probe.CPU(
name="Intel(R) Xeon(R) CPU X5482 @ 3.20GHz",
flags=["FPU", "VME", "DE", "PSE", "TSC", "MSR", "PAE", "MCE", "CX8", "APIC", "SEP", "MTRR", "PGE", "MCA", "CMOV", "PAT", "PSE36", "CLFSH", "DS", "ACPI", "MMX", "FXSR", "SSE", "SSE2", "SS", "HTT", "TM", "PBE", "SSE3", "DTES64", "MON", "DSCPL", "VMX", "EST", "TM2", "SSSE3", "CX16", "TPR", "PDCM", "SSE4.1"],
leafs=[],
),
oclp_version=None,
opencore_version=None,
@@ -383,6 +578,7 @@ class MacPro:
cpu=device_probe.CPU(
name="Intel(R) Xeon(R) CPU X5482 @ 3.20GHz",
flags=["FPU", "VME", "DE", "PSE", "TSC", "MSR", "PAE", "MCE", "CX8", "APIC", "SEP", "MTRR", "PGE", "MCA", "CMOV", "PAT", "PSE36", "CLFSH", "DS", "ACPI", "MMX", "FXSR", "SSE", "SSE2", "SS", "HTT", "TM", "PBE", "SSE3", "DTES64", "MON", "DSCPL", "VMX", "EST", "TM2", "SSSE3", "CX16", "TPR", "PDCM", "SSE4.1"],
leafs=[],
),
oclp_version=None,
opencore_version=None,
@@ -406,6 +602,7 @@ class MacPro:
cpu=device_probe.CPU(
name="Intel(R) Xeon(R) CPU X5482 @ 3.20GHz",
flags=["FPU", "VME", "DE", "PSE", "TSC", "MSR", "PAE", "MCE", "CX8", "APIC", "SEP", "MTRR", "PGE", "MCA", "CMOV", "PAT", "PSE36", "CLFSH", "DS", "ACPI", "MMX", "FXSR", "SSE", "SSE2", "SS", "HTT", "TM", "PBE", "SSE3", "DTES64", "MON", "DSCPL", "VMX", "EST", "TM2", "SSSE3", "CX16", "TPR", "PDCM", "SSE4.1"],
leafs=[],
),
oclp_version=None,
opencore_version=None,
@@ -424,7 +621,8 @@ class MacPro:
wifi=device_probe.Atheros(vendor_id=5772, device_id=48, class_code=163840, name="PXS4", model=None, pci_path="PciRoot(0x0)/Pci(0x1,0x0)/Pci(0x0,0x0)/Pci(0x4,0x0)/Pci(0x0,0x0)"),
cpu=device_probe.CPU(
name="Intel(R) Xeon(R) CPU W3520 @ 2.67GHz",
flags=["FPU", "VME", "DE", "PSE", "TSC", "MSR", "PAE", "MCE", "CX8", "APIC", "SEP", "MTRR", "PGE", "MCA", "CMOV", "PAT", "PSE36", "CLFSH", "DS", "ACPI", "MMX", "FXSR", "SSE", "SSE2", "SS", "HTT", "TM", "PBE", "SSE3", "DTES64", "MON", "DSCPL", "VMX", "EST", "TM2", "SSSE3", "CX16", "TPR", "PDCM", "SSE4.1", "SSE4.2", "POPCNT"]
flags=["FPU", "VME", "DE", "PSE", "TSC", "MSR", "PAE", "MCE", "CX8", "APIC", "SEP", "MTRR", "PGE", "MCA", "CMOV", "PAT", "PSE36", "CLFSH", "DS", "ACPI", "MMX", "FXSR", "SSE", "SSE2", "SS", "HTT", "TM", "PBE", "SSE3", "DTES64", "MON", "DSCPL", "VMX", "EST", "TM2", "SSSE3", "CX16", "TPR", "PDCM", "SSE4.1", "SSE4.2", "POPCNT"],
leafs=[],
),
oclp_version=None,
opencore_version=None
@@ -447,7 +645,8 @@ class MacPro:
wifi=device_probe.Broadcom(vendor_id=5348, device_id=17312, class_code=163840, name="ARPT", model=None, pci_path="PciRoot(0x0)/Pci(0x1,0x0)/Pci(0x0,0x0)/Pci(0x4,0x0)/Pci(0x0,0x0)"),
cpu=device_probe.CPU(
name="Intel(R) Xeon(R) CPU W3520 @ 2.67GHz",
flags=["FPU", "VME", "DE", "PSE", "TSC", "MSR", "PAE", "MCE", "CX8", "APIC", "SEP", "MTRR", "PGE", "MCA", "CMOV", "PAT", "PSE36", "CLFSH", "DS", "ACPI", "MMX", "FXSR", "SSE", "SSE2", "SS", "HTT", "TM", "PBE", "SSE3", "DTES64", "MON", "DSCPL", "VMX", "EST", "TM2", "SSSE3", "CX16", "TPR", "PDCM", "SSE4.1", "SSE4.2", "POPCNT"]
flags=["FPU", "VME", "DE", "PSE", "TSC", "MSR", "PAE", "MCE", "CX8", "APIC", "SEP", "MTRR", "PGE", "MCA", "CMOV", "PAT", "PSE36", "CLFSH", "DS", "ACPI", "MMX", "FXSR", "SSE", "SSE2", "SS", "HTT", "TM", "PBE", "SSE3", "DTES64", "MON", "DSCPL", "VMX", "EST", "TM2", "SSSE3", "CX16", "TPR", "PDCM", "SSE4.1", "SSE4.2", "POPCNT"],
leafs=[],
),
oclp_version="0.2.5",
opencore_version="REL-071-2021-07-02"
@@ -470,7 +669,8 @@ class MacPro:
wifi=device_probe.Broadcom(vendor_id=5348, device_id=17312, class_code=163840, name="PXS4", model=None, pci_path="PciRoot(0x0)/Pci(0x1,0x0)/Pci(0x0,0x0)/Pci(0x4,0x0)/Pci(0x0,0x0)"),
cpu=device_probe.CPU(
name="Intel(R) Xeon(R) CPU X5670 @ 2.93GHz",
flags=["FPU", "VME", "DE", "PSE", "TSC", "MSR", "PAE", "MCE", "CX8", "APIC", "SEP", "MTRR", "PGE", "MCA", "CMOV", "PAT", "PSE36", "CLFSH", "DS", "ACPI", "MMX", "FXSR", "SSE", "SSE2", "SS", "HTT", "TM", "PBE", "SSE3", "PCLMULQDQ", "DTES64", "MON", "DSCPL", "VMX", "SMX", "EST", "TM2", "SSSE3", "CX16", "TPR", "PDCM", "SSE4.1", "SSE4.2", "POPCNT", "AES", "PCID"]
flags=["FPU", "VME", "DE", "PSE", "TSC", "MSR", "PAE", "MCE", "CX8", "APIC", "SEP", "MTRR", "PGE", "MCA", "CMOV", "PAT", "PSE36", "CLFSH", "DS", "ACPI", "MMX", "FXSR", "SSE", "SSE2", "SS", "HTT", "TM", "PBE", "SSE3", "PCLMULQDQ", "DTES64", "MON", "DSCPL", "VMX", "SMX", "EST", "TM2", "SSSE3", "CX16", "TPR", "PDCM", "SSE4.1", "SSE4.2", "POPCNT", "AES", "PCID"],
leafs=[],
),
oclp_version="0.2.5",
opencore_version="REL-071-2021-07-02"
@@ -508,7 +708,8 @@ class MacPro:
wifi=None,
cpu=device_probe.CPU(
name='Intel(R) Xeon(R) CPU X5670 @ 2.93GHz',
flags=['FPU', 'VME', 'DE', 'PSE', 'TSC', 'MSR', 'PAE', 'MCE', 'CX8', 'APIC', 'SEP', 'MTRR', 'PGE', 'MCA', 'CMOV', 'PAT', 'PSE36', 'CLFSH', 'DS', 'ACPI', 'MMX', 'FXSR', 'SSE', 'SSE2', 'SS', 'HTT', 'TM', 'PBE', 'SSE3', 'PCLMULQDQ', 'DTES64', 'MON', 'DSCPL', 'VMX', 'SMX', 'EST', 'TM2', 'SSSE3', 'CX16', 'TPR', 'PDCM', 'SSE4.1', 'SSE4.2', 'POPCNT', 'AES', 'PCID']
flags=['FPU', 'VME', 'DE', 'PSE', 'TSC', 'MSR', 'PAE', 'MCE', 'CX8', 'APIC', 'SEP', 'MTRR', 'PGE', 'MCA', 'CMOV', 'PAT', 'PSE36', 'CLFSH', 'DS', 'ACPI', 'MMX', 'FXSR', 'SSE', 'SSE2', 'SS', 'HTT', 'TM', 'PBE', 'SSE3', 'PCLMULQDQ', 'DTES64', 'MON', 'DSCPL', 'VMX', 'SMX', 'EST', 'TM2', 'SSSE3', 'CX16', 'TPR', 'PDCM', 'SSE4.1', 'SSE4.2', 'POPCNT', 'AES', 'PCID'],
leafs=[],
),
oclp_version='0.4.6',
opencore_version='REL-080-2022-04-18',
@@ -521,4 +722,57 @@ class MacPro:
oclp_sys_version='v0.4.6',
oclp_sys_date='September 03, 2019 @ 23:13:43',
firmware_vendor='Apple'
)
class Hackintosh:
QEMU_Virtual_Machine_GT710 = device_probe.Computer(
real_model='iMac14,4',
real_board_id='Mac-81E3E92DD6088272',
reported_model='iMac14,4',
reported_board_id='Mac-81E3E92DD6088272',
build_model=None,
gpus=[
device_probe.NVIDIA(vendor_id=4318, device_id=4747, class_code=196608, name='GFX0', model='NVIDIA GeForce GT 710', acpi_path=None, pci_path='PciRoot(0x0)/Pci(0x1c,0x0)/Pci(0x0,0x0)', disable_metal=False, force_compatible=False)
],
igpu=None,
dgpu=device_probe.NVIDIA(vendor_id=4318, device_id=4747, class_code=196608, name='GFX0', model='NVIDIA GeForce GT 710', acpi_path=None, pci_path='PciRoot(0x0)/Pci(0x1c,0x0)/Pci(0x0,0x0)', disable_metal=False, force_compatible=False),
storage=[
device_probe.SATAController(vendor_id=32902, device_id=10530, class_code=67073, name='pci8086,2922', model=None, acpi_path=None, pci_path='PciRoot(0x0)/Pci(0x1f,0x2)', disable_metal=False, force_compatible=False),
device_probe.SATAController(vendor_id=32902, device_id=10530, class_code=67073, name='pci8086,2922', model=None, acpi_path=None, pci_path='PciRoot(0x0)/Pci(0x1e,0x0)/Pci(0x1,0x0)/Pci(0x7,0x0)', disable_metal=False, force_compatible=False),
device_probe.NVMeController(vendor_id=5197, device_id=43016, class_code=67586, name='pci144d,a808', model=None, acpi_path=None, pci_path='PciRoot(0x0)/Pci(0x1c,0x1)/Pci(0x0,0x0)', disable_metal=False, force_compatible=False, aspm=0)
],
usb_controllers=[
device_probe.XHCIController(vendor_id=6945, device_id=8514, class_code=787248, name='pci1b21,2142', model=None, acpi_path=None, pci_path='PciRoot(0x0)/Pci(0x1c,0x2)/Pci(0x0,0x0)', disable_metal=False, force_compatible=False),
device_probe.EHCIController(vendor_id=32902, device_id=10556, class_code=787232, name='pci8086,293c', model=None, acpi_path=None, pci_path='PciRoot(0x0)/Pci(0x1a,0x7)', disable_metal=False, force_compatible=False),
device_probe.EHCIController(vendor_id=32902, device_id=10554, class_code=787232, name='pci8086,293a', model=None, acpi_path=None, pci_path='PciRoot(0x0)/Pci(0x1d,0x7)', disable_metal=False, force_compatible=False),
device_probe.UHCIController(vendor_id=32902, device_id=10551, class_code=787200, name='SD0', model=None, acpi_path='IOACPIPlane:/_SB/PCI0@0/SD0@1a0000', pci_path='PciRoot(0x0)/Pci(0x1a,0x0)', disable_metal=False, force_compatible=False),
device_probe.UHCIController(vendor_id=32902, device_id=10552, class_code=787200, name='pci8086,2938', model=None, acpi_path=None, pci_path='PciRoot(0x0)/Pci(0x1a,0x1)', disable_metal=False, force_compatible=False),
device_probe.UHCIController(vendor_id=32902, device_id=10553, class_code=787200, name='pci8086,2939', model=None, acpi_path=None, pci_path='PciRoot(0x0)/Pci(0x1a,0x2)', disable_metal=False, force_compatible=False),
device_probe.UHCIController(vendor_id=32902, device_id=10548, class_code=787200, name='SE8', model=None, acpi_path='IOACPIPlane:/_SB/PCI0@0/SE8@1d0000', pci_path='PciRoot(0x0)/Pci(0x1d,0x0)', disable_metal=False, force_compatible=False),
device_probe.UHCIController(vendor_id=32902, device_id=10549, class_code=787200, name='pci8086,2935', model=None, acpi_path=None, pci_path='PciRoot(0x0)/Pci(0x1d,0x1)', disable_metal=False, force_compatible=False),
device_probe.UHCIController(vendor_id=32902, device_id=10550, class_code=787200, name='pci8086,2936', model=None, acpi_path=None, pci_path='PciRoot(0x0)/Pci(0x1d,0x2)', disable_metal=False, force_compatible=False)
],
sdxc_controller=[],
ethernet=[],
wifi=None,
cpu=device_probe.CPU(
name='Intel(R) Core(TM) i9-7920X CPU @ 2.90GHz',
flags=['FPU', 'VME', 'DE', 'PSE', 'TSC', 'MSR', 'PAE', 'MCE', 'CX8', 'APIC', 'SEP', 'MTRR', 'PGE', 'MCA', 'CMOV', 'PAT', 'PSE36', 'CLFSH', 'MMX', 'FXSR', 'SSE', 'SSE2', 'SS', 'HTT', 'SSE3', 'PCLMULQDQ', 'VMX', 'SSSE3', 'FMA', 'CX16', 'PDCM', 'SSE4.1', 'SSE4.2', 'x2APIC', 'MOVBE', 'POPCNT', 'AES', 'VMM', 'PCID', 'XSAVE', 'OSXSAVE', 'TSCTMR', 'AVX1.0', 'RDRAND', 'F16C'],
leafs=['RDWRFSGS', 'TSC_THREAD_OFFSET', 'BMI1', 'HLE', 'AVX2', 'SMEP', 'BMI2', 'ERMS', 'INVPCID', 'RTM', 'MPX', 'AVX512F', 'AVX512DQ', 'RDSEED', 'ADX', 'SMAP', 'CLFSOPT', 'CLWB', 'AVX512CD', 'AVX512BW', 'AVX512VL', 'UMIP', 'MDCLEAR', 'IBRS', 'STIBP', 'ACAPMSR', 'SSBD']
),
oclp_version=None,
opencore_version='REL-083-2022-08-01',
opencore_path=None,
bluetooth_chipset=None,
ambient_light_sensor=False,
third_party_sata_ssd=False,
secure_boot_model='x86legacyap',
secure_boot_policy=0,
oclp_sys_version=None,
oclp_sys_date=None,
oclp_sys_url=None,
firmware_vendor='EDK II',
rosetta_active=False
)

View File

@@ -8,6 +8,7 @@ SupportedSMBIOS = [
"MacBook6,1",
"MacBook7,1",
"MacBook8,1",
"MacBook9,1",
# MacBook Air
"MacBookAir2,1",
"MacBookAir3,1",
@@ -18,6 +19,8 @@ SupportedSMBIOS = [
"MacBookAir5,2",
"MacBookAir6,1",
"MacBookAir6,2",
"MacBookAir7,1",
"MacBookAir7,2",
# MacBook Pro
"MacBookPro4,1",
"MacBookPro5,1",
@@ -38,6 +41,12 @@ SupportedSMBIOS = [
"MacBookPro11,1",
"MacBookPro11,2",
"MacBookPro11,3",
"MacBookPro11,4",
"MacBookPro11,5",
"MacBookPro12,1",
"MacBookPro13,1",
"MacBookPro13,2",
"MacBookPro13,3",
# Mac Mini
"Macmini3,1",
"Macmini4,1",
@@ -46,6 +55,7 @@ SupportedSMBIOS = [
"Macmini5,3",
"Macmini6,1",
"Macmini6,2",
"Macmini7,1",
# iMac
"iMac7,1",
"iMac8,1",
@@ -64,10 +74,14 @@ SupportedSMBIOS = [
"iMac14,3",
"iMac14,4",
"iMac15,1",
"iMac16,1",
"iMac16,2",
"iMac17,1",
# Mac Pro
"MacPro3,1",
"MacPro4,1",
"MacPro5,1",
"MacPro6,1",
# Xserve
"Xserve2,1",
"Xserve3,1",
@@ -119,21 +133,45 @@ LegacyAudio = [
# GPU
ModernGPU = [
"MacBook8,1", # Intel 6000
"MacBook9,1", # Intel Skylake
"MacBookAir5,1", # Intel 4000
"MacBookAir5,2", # Intel 4000
"MacBookAir6,1", # Intel 5000
"MacBookAir6,2", # Intel 5000
"MacBookAir7,1", # Intel 6000
"MacBookAir7,2", # Intel 6000
"MacBookPro9,1", # Intel 4000 + Nvidia 650M
"MacBookPro9,2", # Intel 4000
"MacBookPro10,1", # Intel 4000 + Nvidia 650M
"MacBookPro10,2", # Intel 4000
"MacBookPro11,1", # Intel 5000
"MacBookPro11,2", # Intel 5000
"MacBookPro11,3", # Intel 5000 + Nvidia Kepler
"MacBookPro11,4", # Intel 5000
"MacBookPro11,5", # Intel 5000 + GCN 1
"MacBookPro12,1", # Intel 6000
"MacBookPro13,1", # Intel Skylake
"MacBookPro13,2", # Intel Skylake
"MacBookPro13,3", # Intel Skylake
"Macmini6,1", # Intel 4000
"Macmini6,2", # Intel 4000
"Macmini7,1", # Intel 5000
"iMac13,1", # Intel 4000
"iMac13,2", # Intel 4000 + Nvidia Kepler
"iMac13,3", # Intel 4000
"iMac14,1", # Intel 5000 + Nvidia Kepler
"iMac14,2", # Intel 5000 + Nvidia Kepler
"iMac14,3", # Intel 5000 + Nvidia Kepler
"iMac14,4", # Intel 5000
"iMac15,1", # Intel 5000 + GCN 1
"iMac16,1", # Intel 6000
"iMac16,2", # Intel 6000
"iMac17,1", # Intel Skylake + GCN1
"MacPro3,1", # Lacks AVX2.0
"MacPro4,1", # Lacks AVX2.0
"MacPro5,1", # Lacks AVX2.0
"MacPro6,1", # GCN 1
]
LegacyGPU = [
@@ -277,3 +315,39 @@ Missing_USB_Map = [
"Xserve2,1",
"Xserve3,1",
]
Missing_USB_Map_Ventura = [
"MacBook8,1",
"MacBookAir5,1",
"MacBookAir5,2",
"MacBookAir6,1",
"MacBookAir6,2",
"MacBookAir7,1",
"MacBookAir7,2",
"MacBookPro9,1",
"MacBookPro9,2",
"MacBookPro10,1",
"MacBookPro10,2",
"MacBookPro11,1",
"MacBookPro11,2",
"MacBookPro11,3",
"MacBookPro11,4",
"MacBookPro11,5",
"MacBookPro12,1",
"MacPro5,1",
"MacPro6,1",
"Macmini6,1",
"Macmini6,2",
"Macmini7,1",
"iMac13,1",
"iMac13,2",
"iMac14,1",
"iMac14,2",
"iMac14,3",
"iMac14,4",
"iMac15,1",
"iMac15,2",
"iMac16,1",
"iMac16,2",
"iMac17,1",
]

View File

@@ -1,3 +1,4 @@
from curses.ascii import isdigit
import enum
@@ -77,4 +78,70 @@ class os_conversion:
except KeyError:
os_kernel = 0
return int(os_kernel)
return int(os_kernel)
def find_largest_build(build_array):
# Find the newest version within an array of versions
# These builds will have both numbers and letters in the version
# ex:
# [
# "22A5295i",
# "22A5266r",
# "22A5286j",
# "22A5295h",
# ]
max_length = 0 # Length of the longest build
build_array_split = [] # 'build_array', converted into individual array of elements
final_build = "" # Largest determined build
# Convert strings to arrays
for build in build_array:
list_build = list(build)
if len(list_build) > max_length:
max_length = len(list_build)
build_array_split.append(list_build)
# Pad out each array to same length
for build in build_array_split:
while len(build) < max_length:
build.append("0")
# Convert all letters to int using ord()
for build in build_array_split:
for entry in build:
if not entry.isdigit():
build[build.index(entry)] = ord(entry)
for build_outer_loop in build_array_split:
for build_inner_loop in list(build_array_split):
for i in range(len(build_outer_loop)):
# remove any builds that are not the largest
if int(build_outer_loop[i]) > int(build_inner_loop[i]):
build_array_split.remove(build_inner_loop)
break
if int(build_outer_loop[i]) < int(build_inner_loop[i]):
break
# Convert array back to string
for entry in build_array_split[0]:
# Since we split per character, we know that anything above 9 is a letter
if int(entry) > 9:
# revert back to letter
final_build += chr(entry)
else:
final_build += str(entry)
# Since we pad with 0s, we need to next determine how many 0s to remove
for build in build_array:
if final_build.startswith(build):
# Handle cases where Apple added a letter to the build
# ex. "22A5295" vs "22A5295"
remaining_strings = final_build.split(build)[1]
# If all remaining strings are 0s, then we can remove the 0s
if all(char == "0" for char in remaining_strings):
final_build = build
return final_build

View File

@@ -134,6 +134,14 @@ class system_integrity_protection:
"CSR_ALLOW_UNAPPROVED_KEXTS", # 0x200 - Required for Aux Cache in Big Sur+
]
root_patch_sip_ventura = [
# Variables required to root patch in Ventura
"CSR_ALLOW_UNTRUSTED_KEXTS", # 0x1 - Required for Aux Cache in Big Sur+
"CSR_ALLOW_UNRESTRICTED_FS", # 0x2 - Required to mount and edit root volume, as well as load modded platform binaries
"CSR_ALLOW_UNAUTHENTICATED_ROOT", # 0x800 - Required to avoid KC mismatch kernel panic
]
# CSR_ALLOW_EXECUTABLE_POLICY_OVERRIDE (introduced with Mojave):
# This bit is quite strange and was originally assumed to be required for modded platform binaries
# However after extensive testing, this doesn't seem true. In addition, this bit is never flipped via

View File

@@ -14,6 +14,9 @@
# Switchable GPUs: If model uses a GMUX
# Stock GPUs: GPUs variations shipped
# Reference:
# https://github.com/acidanthera/OpenCorePkg/blob/master/Library/OcMacInfoLib/AutoGenerated.c
from resources import device_probe
from data import cpu_data, os_data, bluetooth_data
@@ -225,7 +228,7 @@ smbios_dictionary = {
},
"MacBook9,1": {
"Board ID": "Mac-9AE82516C7C6B903",
"FirmwareFeatures": "0xFC0FE13F",
"FirmwareFeatures": "0x8FC0FE13F",
"SecureBootModel": None,
"CPU Generation": cpu_data.cpu_data.skylake.value,
"Max OS Supported": os_data.os_data.monterey,
@@ -242,7 +245,7 @@ smbios_dictionary = {
},
"MacBook10,1": {
"Board ID": "Mac-EE2EBD4B90B839A8",
"FirmwareFeatures": "0xFC0FE13F",
"FirmwareFeatures": "0x8FC0FE13F",
"SecureBootModel": None,
"CPU Generation": cpu_data.cpu_data.kaby_lake.value,
"Max OS Supported": os_data.os_data.max_os,
@@ -432,7 +435,7 @@ smbios_dictionary = {
},
"MacBookAir7,1": {
"Board ID": "Mac-9F18E312C5C2BF0B",
"FirmwareFeatures": "0xFF0FF576",
"FirmwareFeatures": "0x8FF0FF576",
"SecureBootModel": None,
"CPU Generation": cpu_data.cpu_data.broadwell.value,
"Max OS Supported": os_data.os_data.monterey,
@@ -449,7 +452,7 @@ smbios_dictionary = {
},
"MacBookAir7,2": {
"Board ID": "Mac-937CB26E2E02BB01",
"FirmwareFeatures": "0xFF0FF576",
"FirmwareFeatures": "0x8FF0FF576",
"SecureBootModel": None,
"CPU Generation": cpu_data.cpu_data.broadwell.value,
"Max OS Supported": os_data.os_data.monterey,
@@ -466,7 +469,7 @@ smbios_dictionary = {
},
"MacBookAir8,1": {
"Board ID": "Mac-827FAC58A8FDFA22",
"FirmwareFeatures": "0xFD8FF42E",
"FirmwareFeatures": "0x8FD8FF42E",
"SecureBootModel": "j140k",
"CPU Generation": cpu_data.cpu_data.coffee_lake.value,
"Max OS Supported": os_data.os_data.max_os,
@@ -483,7 +486,7 @@ smbios_dictionary = {
},
"MacBookAir8,1_v2": {
"Board ID": "Mac-112818653D3AABFC",
"FirmwareFeatures": "0xFD8FF42E",
"FirmwareFeatures": "0x8FD8FF42E",
"SecureBootModel": "j140k", # TODO: Verify
"CPU Generation": cpu_data.cpu_data.coffee_lake.value,
"Max OS Supported": os_data.os_data.max_os,
@@ -502,7 +505,7 @@ smbios_dictionary = {
# AppleInternal MacBookAir8,1
# True Model unknown
"Board ID": "Mac-827FAC58A8FDFA22",
"FirmwareFeatures": "0xFD8FF42E",
"FirmwareFeatures": "0x8FD8FF42E",
"SecureBootModel": "x589amlu",
"CPU Generation": cpu_data.cpu_data.coffee_lake.value,
"Max OS Supported": os_data.os_data.max_os,
@@ -519,7 +522,7 @@ smbios_dictionary = {
},
"MacBookAir8,2": {
"Board ID": "Mac-226CB3C6A851A671",
"FirmwareFeatures": "0xFD8FF42E",
"FirmwareFeatures": "0x8FD8FF42E",
"SecureBootModel": "j140a",
"CPU Generation": cpu_data.cpu_data.coffee_lake.value,
"Max OS Supported": os_data.os_data.max_os,
@@ -536,7 +539,7 @@ smbios_dictionary = {
},
"MacBookAir9,1": {
"Board ID": "Mac-0CFF9C7C2B63DF8D",
"FirmwareFeatures": "0xFFAFF06E",
"FirmwareFeatures": "0x8FFAFF06E",
"SecureBootModel": "j230k",
"CPU Generation": cpu_data.cpu_data.ice_lake.value,
"Max OS Supported": os_data.os_data.max_os,
@@ -555,7 +558,7 @@ smbios_dictionary = {
# AppleInternal MacBookAir9,1
# True Model unknown
"Board ID": "Mac-0CFF9C7C2B63DF8D",
"FirmwareFeatures": "0xFFAFF06E",
"FirmwareFeatures": "0x8FFAFF06E",
"SecureBootModel": "x589icly",
"CPU Generation": cpu_data.cpu_data.ice_lake.value,
"Max OS Supported": os_data.os_data.max_os,
@@ -1014,7 +1017,7 @@ smbios_dictionary = {
"Screen Size": 13,
"Ethernet Chipset": "Broadcom",
"Stock GPUs": [
device_probe.NVIDIA.Archs.Kepler
device_probe.Intel.Archs.Ivy_Bridge,
],
"Stock Storage": [
"SATA 2.5",
@@ -1050,7 +1053,7 @@ smbios_dictionary = {
"Screen Size": 13,
"Ethernet Chipset": None,
"Stock GPUs": [
device_probe.NVIDIA.Archs.Kepler
device_probe.Intel.Archs.Ivy_Bridge,
],
"Stock Storage": [
"mSATA",
@@ -1103,6 +1106,7 @@ smbios_dictionary = {
"Ethernet Chipset": None,
"Stock GPUs": [
device_probe.Intel.Archs.Haswell,
device_probe.NVIDIA.Archs.Kepler,
],
"Stock Storage": [
"NVMe",
@@ -1110,7 +1114,7 @@ smbios_dictionary = {
},
"MacBookPro11,4": {
"Board ID": "Mac-06F11FD93F0323C5",
"FirmwareFeatures": "0xEB0FF577",
"FirmwareFeatures": "0x8EB0FF577",
"SecureBootModel": None,
"CPU Generation": cpu_data.cpu_data.haswell.value,
"Max OS Supported": os_data.os_data.monterey,
@@ -1127,7 +1131,7 @@ smbios_dictionary = {
},
"MacBookPro11,5": {
"Board ID": "Mac-06F11F11946D27C5",
"FirmwareFeatures": "0xEB0FF577",
"FirmwareFeatures": "0x8EB0FF577",
"SecureBootModel": None,
"CPU Generation": cpu_data.cpu_data.haswell.value,
"Max OS Supported": os_data.os_data.monterey,
@@ -1146,7 +1150,7 @@ smbios_dictionary = {
},
"MacBookPro12,1": {
"Board ID": "Mac-E43C1C25D4880AD6",
"FirmwareFeatures": "0xFD0FF576",
"FirmwareFeatures": "0x8FD0FF576",
"SecureBootModel": None,
"CPU Generation": cpu_data.cpu_data.broadwell.value,
"Max OS Supported": os_data.os_data.monterey,
@@ -1163,7 +1167,7 @@ smbios_dictionary = {
},
"MacBookPro13,1": {
"Board ID": "Mac-473D31EABEB93F9B",
"FirmwareFeatures": "0xFC0FE137",
"FirmwareFeatures": "0x8FC0FE137",
"SecureBootModel": None,
"CPU Generation": cpu_data.cpu_data.skylake.value,
"Max OS Supported": os_data.os_data.monterey,
@@ -1180,7 +1184,7 @@ smbios_dictionary = {
},
"MacBookPro13,2": {
"Board ID": "Mac-66E35819EE2D0D05",
"FirmwareFeatures": "0xFC0FE137",
"FirmwareFeatures": "0x8FC0FE137",
"SecureBootModel": None,
"CPU Generation": cpu_data.cpu_data.skylake.value,
"Max OS Supported": os_data.os_data.monterey,
@@ -1197,7 +1201,7 @@ smbios_dictionary = {
},
"MacBookPro13,3": {
"Board ID": "Mac-A5C67F76ED83108C",
"FirmwareFeatures": "0xFC0FE137",
"FirmwareFeatures": "0x8FC0FE137",
"SecureBootModel": None,
"CPU Generation": cpu_data.cpu_data.skylake.value,
"Max OS Supported": os_data.os_data.monterey,
@@ -1216,7 +1220,7 @@ smbios_dictionary = {
},
"MacBookPro14,1": {
"Board ID": "Mac-B4831CEBD52A0C4C",
"FirmwareFeatures": "0xFF0FF57E",
"FirmwareFeatures": "0x8FF0FF57E",
"SecureBootModel": None,
"CPU Generation": cpu_data.cpu_data.kaby_lake.value,
"Max OS Supported": os_data.os_data.max_os,
@@ -1233,7 +1237,7 @@ smbios_dictionary = {
},
"MacBookPro14,2": {
"Board ID": "Mac-CAD6701F7CEA0921",
"FirmwareFeatures": "0xFF0FF57E",
"FirmwareFeatures": "0x8FF0FF57E",
"SecureBootModel": None,
"CPU Generation": cpu_data.cpu_data.kaby_lake.value,
"Max OS Supported": os_data.os_data.max_os,
@@ -1250,7 +1254,7 @@ smbios_dictionary = {
},
"MacBookPro14,3": {
"Board ID": "Mac-551B86E5744E2388",
"FirmwareFeatures": "0xFF0FF57E",
"FirmwareFeatures": "0x8FF0FF57E",
"SecureBootModel": None,
"CPU Generation": cpu_data.cpu_data.kaby_lake.value,
"Max OS Supported": os_data.os_data.max_os,
@@ -1269,7 +1273,7 @@ smbios_dictionary = {
},
"MacBookPro15,1": {
"Board ID": "Mac-937A206F2EE63C01",
"FirmwareFeatures": "0xFD8FF426",
"FirmwareFeatures": "0x8FD8FF426",
"SecureBootModel": "j680",
"CPU Generation": cpu_data.cpu_data.coffee_lake.value,
"Max OS Supported": os_data.os_data.max_os,
@@ -1288,7 +1292,7 @@ smbios_dictionary = {
},
"MacBookPro15,2": {
"Board ID": "Mac-827FB448E656EC26",
"FirmwareFeatures": "0xFD8FF426",
"FirmwareFeatures": "0x8FD8FF426",
"SecureBootModel": "j132",
"CPU Generation": cpu_data.cpu_data.coffee_lake.value,
"Max OS Supported": os_data.os_data.max_os,
@@ -1305,7 +1309,7 @@ smbios_dictionary = {
},
"MacBookPro15,3": {
"Board ID": "Mac-1E7E29AD0135F9BC",
"FirmwareFeatures": "0xFD8FF426",
"FirmwareFeatures": "0x8FD8FF426",
"SecureBootModel": "j780",
"CPU Generation": cpu_data.cpu_data.coffee_lake.value,
"Max OS Supported": os_data.os_data.max_os,
@@ -1324,7 +1328,7 @@ smbios_dictionary = {
},
"MacBookPro15,4": {
"Board ID": "Mac-53FDB3D8DB8CA971",
"FirmwareFeatures": "0xFD8FF426",
"FirmwareFeatures": "0x8FD8FF426",
"SecureBootModel": "j213",
"CPU Generation": cpu_data.cpu_data.coffee_lake.value,
"Max OS Supported": os_data.os_data.max_os,
@@ -1341,7 +1345,7 @@ smbios_dictionary = {
},
"MacBookPro16,1": {
"Board ID": "Mac-E1008331FDC96864",
"FirmwareFeatures": "0xFDAFF066",
"FirmwareFeatures": "0x8FDAFF066",
"SecureBootModel": "j152f",
"CPU Generation": cpu_data.cpu_data.coffee_lake.value,
"Max OS Supported": os_data.os_data.max_os,
@@ -1360,7 +1364,7 @@ smbios_dictionary = {
},
"MacBookPro16,2": {
"Board ID": "Mac-5F9802EFE386AA28",
"FirmwareFeatures": "0xFFAFF06E",
"FirmwareFeatures": "0x8FFFFFF7F",
"SecureBootModel": "j214k",
"CPU Generation": cpu_data.cpu_data.ice_lake.value,
"Max OS Supported": os_data.os_data.max_os,
@@ -1377,7 +1381,7 @@ smbios_dictionary = {
},
"MacBookPro16,3": {
"Board ID": "Mac-E7203C0F68AA0004",
"FirmwareFeatures": "0xFDAFF066",
"FirmwareFeatures": "0x8FDAFF066",
"SecureBootModel": "j223",
"CPU Generation": cpu_data.cpu_data.coffee_lake.value,
"Max OS Supported": os_data.os_data.max_os,
@@ -1394,7 +1398,7 @@ smbios_dictionary = {
},
"MacBookPro16,4": {
"Board ID": "Mac-A61BADE1FDAD7B05",
"FirmwareFeatures": "0xFDAFF066",
"FirmwareFeatures": "0x8FDAFF066",
"SecureBootModel": "j215",
"CPU Generation": cpu_data.cpu_data.coffee_lake.value,
"Max OS Supported": os_data.os_data.max_os,
@@ -1637,7 +1641,7 @@ smbios_dictionary = {
},
"Macmini7,1": {
"Board ID": "Mac-35C5E08120C7EEAF",
"FirmwareFeatures": "0xE00DE137",
"FirmwareFeatures": "0x8E00DE137",
"SecureBootModel": None,
"CPU Generation": cpu_data.cpu_data.haswell.value,
"Max OS Supported": os_data.os_data.monterey,
@@ -1654,7 +1658,7 @@ smbios_dictionary = {
},
"Macmini8,1": {
"Board ID": "Mac-7BA5B2DFE22DDD8C",
"FirmwareFeatures": "0xFD8FF466",
"FirmwareFeatures": "0x8FD8FF466",
"SecureBootModel": "j174",
"CPU Generation": cpu_data.cpu_data.coffee_lake.value,
"Max OS Supported": os_data.os_data.max_os,
@@ -2137,7 +2141,6 @@ smbios_dictionary = {
"Ethernet Chipset": "Broadcom",
"Stock GPUs": [
device_probe.Intel.Archs.Ivy_Bridge,
device_probe.NVIDIA.Archs.Kepler,
],
"Stock Storage": [
"SATA 3.5",
@@ -2155,7 +2158,6 @@ smbios_dictionary = {
"Ethernet Chipset": "Broadcom",
"Stock GPUs": [
device_probe.Intel.Archs.Haswell,
device_probe.NVIDIA.Archs.Kepler,
],
"Stock Storage": [
"SATA 3.5",
@@ -2255,7 +2257,7 @@ smbios_dictionary = {
},
"iMac16,1": {
"Board ID": "Mac-A369DDC4E67F1C45",
"FirmwareFeatures": "0xFC0FE137",
"FirmwareFeatures": "0x8FC0FE137",
"SecureBootModel": None,
"CPU Generation": cpu_data.cpu_data.broadwell.value,
"Max OS Supported": os_data.os_data.monterey,
@@ -2272,7 +2274,7 @@ smbios_dictionary = {
},
"iMac16,2": {
"Board ID": "Mac-FFE5EF870D7BA81A",
"FirmwareFeatures": "0xFC0FE137",
"FirmwareFeatures": "0x8FC0FE137",
"SecureBootModel": None,
"CPU Generation": cpu_data.cpu_data.broadwell.value,
"Max OS Supported": os_data.os_data.monterey,
@@ -2289,7 +2291,7 @@ smbios_dictionary = {
},
"iMac17,1": {
"Board ID": "Mac-DB15BD556843C820",
"FirmwareFeatures": "0xFC0FE137",
"FirmwareFeatures": "0x8FC0FE137",
"SecureBootModel": None,
"CPU Generation": cpu_data.cpu_data.skylake.value,
"Max OS Supported": os_data.os_data.monterey,
@@ -2299,6 +2301,7 @@ smbios_dictionary = {
"5K Display": True,
"Stock GPUs": [
device_probe.Intel.Archs.Skylake,
device_probe.AMD.Archs.Legacy_GCN_8000,
device_probe.AMD.Archs.Legacy_GCN_9000,
],
"Stock Storage": [
@@ -2308,7 +2311,7 @@ smbios_dictionary = {
},
"iMac17,1_v2": {
"Board ID": "Mac-65CE76090165799A",
"FirmwareFeatures": "0xFC0FE137",
"FirmwareFeatures": "0x8FC0FE137",
"SecureBootModel": None,
"CPU Generation": cpu_data.cpu_data.skylake.value,
"Max OS Supported": os_data.os_data.monterey,
@@ -2318,6 +2321,7 @@ smbios_dictionary = {
"5K Display": True,
"Stock GPUs": [
device_probe.Intel.Archs.Skylake,
device_probe.AMD.Archs.Legacy_GCN_8000,
device_probe.AMD.Archs.Legacy_GCN_9000,
],
"Stock Storage": [
@@ -2327,7 +2331,7 @@ smbios_dictionary = {
},
"iMac17,1_v3": {
"Board ID": "Mac-B809C3757DA9BB8D",
"FirmwareFeatures": "0xFC0FE137",
"FirmwareFeatures": "0x8FC0FE137",
"SecureBootModel": None,
"CPU Generation": cpu_data.cpu_data.skylake.value,
"Max OS Supported": os_data.os_data.monterey,
@@ -2337,6 +2341,7 @@ smbios_dictionary = {
"5K Display": True,
"Stock GPUs": [
device_probe.Intel.Archs.Skylake,
device_probe.AMD.Archs.Legacy_GCN_8000,
device_probe.AMD.Archs.Legacy_GCN_9000,
],
"Stock Storage": [
@@ -2346,7 +2351,7 @@ smbios_dictionary = {
},
"iMac18,1": {
"Board ID": "Mac-4B682C642B45593E",
"FirmwareFeatures": "0xFD0FF576",
"FirmwareFeatures": "0x8FD0FF576",
"SecureBootModel": None,
"CPU Generation": cpu_data.cpu_data.kaby_lake.value,
"Max OS Supported": os_data.os_data.max_os,
@@ -2363,7 +2368,7 @@ smbios_dictionary = {
},
"iMac18,2": {
"Board ID": "Mac-77F17D7DA9285301",
"FirmwareFeatures": "0xFD0FF576",
"FirmwareFeatures": "0x8FD0FF576",
"SecureBootModel": None,
"CPU Generation": cpu_data.cpu_data.kaby_lake.value,
"Max OS Supported": os_data.os_data.max_os,
@@ -2381,7 +2386,7 @@ smbios_dictionary = {
},
"iMac18,3": {
"Board ID": "Mac-BE088AF8C5EB4FA2",
"FirmwareFeatures": "0xFD0FF576",
"FirmwareFeatures": "0x8FD0FF576",
"SecureBootModel": None,
"CPU Generation": cpu_data.cpu_data.kaby_lake.value,
"Max OS Supported": os_data.os_data.max_os,
@@ -2400,7 +2405,7 @@ smbios_dictionary = {
},
"iMac19,1": {
"Board ID": "Mac-AA95B1DDAB278B95",
"FirmwareFeatures": "0xFD8FF576",
"FirmwareFeatures": "0x8FD8FF576",
"SecureBootModel": None,
"CPU Generation": cpu_data.cpu_data.coffee_lake.value,
"Max OS Supported": os_data.os_data.max_os,
@@ -2421,7 +2426,7 @@ smbios_dictionary = {
"AAPL_iMac19,1": {
# AppleInternal iMac19,1 unit
"Board ID": "Mac-CF21D135A7D34AA6",
"FirmwareFeatures": "0xFD8FF576",
"FirmwareFeatures": "0x8FD8FF576",
"SecureBootModel": None,
"CPU Generation": cpu_data.cpu_data.coffee_lake.value,
"Max OS Supported": os_data.os_data.max_os,
@@ -2441,7 +2446,7 @@ smbios_dictionary = {
},
"iMac19,2": {
"Board ID": "Mac-63001698E7A34814",
"FirmwareFeatures": "0xFD8FF576",
"FirmwareFeatures": "0x8FD8FF576",
"SecureBootModel": None,
"CPU Generation": cpu_data.cpu_data.coffee_lake.value,
"Max OS Supported": os_data.os_data.max_os,
@@ -2460,7 +2465,7 @@ smbios_dictionary = {
},
"iMac20,1": {
"Board ID": "Mac-CFF7D910A743CAAF",
"FirmwareFeatures": "0xFD8FF576",
"FirmwareFeatures": "0x8FFB3F066",
"SecureBootModel": "j185",
"CPU Generation": cpu_data.cpu_data.comet_lake.value,
"Max OS Supported": os_data.os_data.max_os,
@@ -2478,7 +2483,7 @@ smbios_dictionary = {
},
"iMac20,2": {
"Board ID": "Mac-AF89B6D9451A490B",
"FirmwareFeatures": "0xFD8FF576",
"FirmwareFeatures": "0x8FFB3F066",
"SecureBootModel": "j185f",
"CPU Generation": cpu_data.cpu_data.comet_lake.value,
"Max OS Supported": os_data.os_data.max_os,
@@ -2589,7 +2594,9 @@ smbios_dictionary = {
"Ethernet Chipset": "Intel 80003ES2LAN",
"Socketed GPUs": "PCIe",
"Stock GPUs": [
device_probe.AMD.Archs.TeraScale_1
device_probe.AMD.Archs.TeraScale_1,
device_probe.AMD.Archs.Polaris,
],
"Stock Storage": [
"SATA 3.5",
@@ -2607,7 +2614,8 @@ smbios_dictionary = {
"Ethernet Chipset": "Intel 82574L",
"Socketed GPUs": "PCIe",
"Stock GPUs": [
device_probe.NVIDIA.Archs.Tesla
device_probe.NVIDIA.Archs.Tesla,
device_probe.AMD.Archs.Polaris,
],
"Stock Storage": [
"SATA 3.5",
@@ -2624,7 +2632,8 @@ smbios_dictionary = {
"Ethernet Chipset": "Intel 82574L",
"Socketed GPUs": "PCIe",
"Stock GPUs": [
device_probe.AMD.Archs.TeraScale_2
device_probe.AMD.Archs.TeraScale_2,
device_probe.AMD.Archs.Polaris,
],
"Stock Storage": [
"SATA 3.5",
@@ -2632,7 +2641,7 @@ smbios_dictionary = {
},
"MacPro6,1": {
"Board ID": "Mac-F60DEB81FF30ACF6",
"FirmwareFeatures": "0xE90FF576",
"FirmwareFeatures": "0x8E90FF576",
"SecureBootModel": None,
"CPU Generation": cpu_data.cpu_data.ivy_bridge.value,
"Max OS Supported": os_data.os_data.monterey,
@@ -2648,7 +2657,7 @@ smbios_dictionary = {
},
"MacPro7,1": {
"Board ID": "Mac-27AD2F918AE68F61",
"FirmwareFeatures": "0xFDAFF066",
"FirmwareFeatures": "0x8FDAFF066",
"SecureBootModel": "j160",
"CPU Generation": cpu_data.cpu_data.coffee_lake.value,
"Max OS Supported": os_data.os_data.max_os,

View File

@@ -42,18 +42,12 @@ def SystemPatchDictionary(os_major, os_minor, non_metal_os_support):
"CoreDisplay.framework": f"10.14.4-{os_major}",
"IOSurface.framework": f"10.15.7-{os_major}",
"QuartzCore.framework": f"10.15.7-{os_major}",
**({ "WebKit.framework": "11.6" } if os_major >= os_data.os_data.monterey else {}),
},
"/System/Library/PrivateFrameworks": {
"GPUSupport.framework": "10.14.3",
"SkyLight.framework": f"10.14.6-{os_major}",
},
},
"Install Non-Root": {
"/Library/Apple/System/Library/StagedFrameworks/Safari": {
**({ "WebKit.framework": "11.6" } if os_major >= os_data.os_data.monterey else {}),
},
},
"Remove": {
"/System/Library/Extensions": [
"AMDRadeonX4000.kext",
@@ -80,12 +74,15 @@ def SystemPatchDictionary(os_major, os_minor, non_metal_os_support):
"GeForce.kext",
"IOAcceleratorFamily2.kext",
"IOGPUFamily.kext",
"AppleAfterburner.kext",
],
},
"Install Non-Root": {
"/Library/Application Support/SkyLightPlugins": {
**({ "DropboxHack.dylib": "SkyLightPlugins" } if os_major >= os_data.os_data.monterey else {}),
**({ "DropboxHack.txt": "SkyLightPlugins" } if os_major >= os_data.os_data.monterey else {}),
**({ "DropboxHack.dylib": "SkyLightPlugins" } if os_major >= os_data.os_data.monterey else {}),
**({ "DropboxHack.txt": "SkyLightPlugins" } if os_major >= os_data.os_data.monterey else {}),
**({ "CatalystButton.dylib": "SkyLightPlugins" } if os_major >= os_data.os_data.monterey else {}),
**({ "CatalystButton.txt": "SkyLightPlugins" } if os_major >= os_data.os_data.monterey else {}),
},
},
"Processes": {
@@ -172,11 +169,15 @@ def SystemPatchDictionary(os_major, os_minor, non_metal_os_support):
},
},
# AMD GCN and Nvidia Kepler require Metal Downgrade in Ventura
# The patches are required due to struct issues in the Metal stack
# - AMD GCN will break on BronzeMtlDevice
# - See Nvidia Kepler patchset for more info
"Metal Common": {
"Display Name": "",
"OS Support": {
"Minimum OS Support": {
"OS Major": os_data.os_data.monterey,
"OS Major": os_data.os_data.ventura,
"OS Minor": 0
},
"Maximum OS Support": {
@@ -186,8 +187,57 @@ def SystemPatchDictionary(os_major, os_minor, non_metal_os_support):
},
"Install": {
"/System/Library/Frameworks": {
"OpenCL.framework": "11.6",
"WebKit.framework": "11.6",
"Metal.framework": "12.5",
"MetalPerformanceShaders.framework": "12.5",
},
},
},
# Temporary work-around for Kepler GPUs on Ventura
# We removed the reliance on Metal.framework downgrade, however the new Kepler
# patchset breaks with the old Metal. Thus we need to ensure stock variant is used
# Remove this when OCLP is merged onto mainline
"Revert Metal Downgrade": {
"Display Name": "",
"OS Support": {
"Minimum OS Support": {
"OS Major": os_data.os_data.ventura,
"OS Minor": 0
},
"Maximum OS Support": {
"OS Major": os_data.os_data.ventura,
"OS Minor": 99
},
},
"Remove": {
"/System/Library/Frameworks/Metal.framework/Versions/A/": [
"Metal",
"MetalOld.dylib",
],
"/System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/Frameworks/MPSCore.framework/Versions/A": [
"MPSCore",
],
},
},
# Monterey has a WebKit sandboxing issue where many UI elements fail to render
# This patch simple replaces the sandbox profile with one supporting our GPUs
# Note: Neither Big Sur nor Ventura have this issue
"WebKit Monterey Common": {
"Display Name": "",
"OS Support": {
"Minimum OS Support": {
"OS Major": os_data.os_data.monterey,
"OS Minor": 0
},
"Maximum OS Support": {
"OS Major": os_data.os_data.monterey,
"OS Minor": 99
},
},
"Install": {
"/System/Library/Frameworks": {
"WebKit.framework": "11.6"
},
},
"Install Non-Root": {
@@ -197,14 +247,13 @@ def SystemPatchDictionary(os_major, os_minor, non_metal_os_support):
},
},
# Resolve AppleGVACore crashing on MacBookPro11,3 due to mixed GPU combo
# ie. native Haswell iGPU + non-native Kepler dGPU
# This can be remove after 0.4.6 release, as 0.4.5 downgrades to 10.15.7
"GVA Work-Around": {
# Intel Ivy Bridge, Haswell and Nvidia Kepler are Metal 3802-based GPUs
# Due to this, we need to re-add 3802 compiler support to the Metal stack
"Metal 3802 Common": {
"Display Name": "",
"OS Support": {
"Minimum OS Support": {
"OS Major": os_data.os_data.monterey,
"OS Major": os_data.os_data.ventura,
"OS Minor": 0
},
"Maximum OS Support": {
@@ -212,17 +261,23 @@ def SystemPatchDictionary(os_major, os_minor, non_metal_os_support):
"OS Minor": 99
},
},
"Remove": {
"/System/Library/PrivateFrameworks/AppleGVA.framework/Versions/A": [
"AppleGVA",
],
"/System/Library/PrivateFrameworks/AppleGVACore.framework/Versions/A": [
"AppleGVACore",
],
"Install": {
"/System/Library/Frameworks": {
"Metal.framework": "12.5-3802",
},
"/System/Library/PrivateFrameworks": {
"MTLCompiler.framework": "12.5-3802",
"GPUCompiler.framework": "12.5-3802",
},
"/System/Library/Sandbox/Profiles": {
"com.apple.mtlcompilerservice.sb": "12.5-3802",
}
},
},
"Modern GVA": {
# For GPUs last natively supported in Catalina/Big Sur
# Restores DRM support
"Catalina GVA": {
"Display Name": "",
"OS Support": {
"Minimum OS Support": {
@@ -242,7 +297,29 @@ def SystemPatchDictionary(os_major, os_minor, non_metal_os_support):
},
},
"Legacy GVA": {
# For GPUs last natively supported in Monterey
# Restores DRM support
"Monterey GVA": {
"Display Name": "",
"OS Support": {
"Minimum OS Support": {
"OS Major": os_data.os_data.ventura,
"OS Minor": 0
},
"Maximum OS Support": {
"OS Major": os_data.os_data.max_os,
"OS Minor": 99
},
},
"Install": {
"/System/Library/PrivateFrameworks": {
"AppleGVA.framework": "12.5",
"AppleGVACore.framework": "12.5",
},
},
},
"High Sierra GVA": {
"Display Name": "",
"OS Support": {
"Minimum OS Support": {
@@ -262,6 +339,65 @@ def SystemPatchDictionary(os_major, os_minor, non_metal_os_support):
},
},
"Big Sur OpenCL": {
"Display Name": "",
"OS Support": {
"Minimum OS Support": {
"OS Major": os_data.os_data.monterey,
"OS Minor": 0
},
"Maximum OS Support": {
"OS Major": os_data.os_data.max_os,
"OS Minor": 99
},
},
"Install": {
"/System/Library/Frameworks": {
"OpenCL.framework": "11.6",
},
},
},
"Monterey OpenCL": {
"Display Name": "",
"OS Support": {
"Minimum OS Support": {
"OS Major": os_data.os_data.ventura,
"OS Minor": 0
},
"Maximum OS Support": {
"OS Major": os_data.os_data.max_os,
"OS Minor": 99
},
},
"Install": {
"/System/Library/Frameworks": {
"OpenCL.framework": "12.5",
},
},
},
# In Ventura, Apple added AVX2.0 code to AMD's OpenCL/GL compilers
"AMD OpenCL": {
"Display Name": "",
"OS Support": {
"Minimum OS Support": {
"OS Major": os_data.os_data.ventura,
"OS Minor": 0
},
"Maximum OS Support": {
"OS Major": os_data.os_data.max_os,
"OS Minor": 99
},
},
"Install": {
"/System/Library/Frameworks": {
"OpenCL.framework": "12.5 non-AVX2.0",
"OpenGL.framework": "12.5 non-AVX2.0",
},
},
},
"Nvidia Tesla": {
"Display Name": "Graphics: Nvidia Tesla",
"OS Support": {
@@ -309,12 +445,15 @@ def SystemPatchDictionary(os_major, os_minor, non_metal_os_support):
"NVDAStartup.kext": "12.0 Beta 6",
"GeForceAIRPlugin.bundle": "11.0 Beta 3",
"GeForceGLDriver.bundle": "11.0 Beta 3",
"GeForceMTLDriver.bundle": "11.0 Beta 3",
"GeForceMTLDriver.bundle": "11.0 Beta 3" if os_major <= os_data.os_data.monterey else f"11.0 Beta 3-{os_major}",
"GeForceVADriver.bundle": "12.0 Beta 6",
},
"/System/Library/Frameworks": {
# XNU 21.6 (macOS 12.5)
**({ "Metal.framework": "12.5 Beta 2"} if os_data.os_conversion.is_os_newer(os_data.os_data.monterey, 5, os_major, os_minor) else {})
**({ "Metal.framework": "12.5 Beta 2"} if (os_data.os_conversion.is_os_newer(os_data.os_data.monterey, 5, os_major, os_minor) and os_major < os_data.os_data.ventura) else {}),
},
"/System/Library/PrivateFrameworks": {
"GPUCompiler.framework": "11.6",
},
},
},
@@ -485,14 +624,30 @@ def SystemPatchDictionary(os_major, os_minor, non_metal_os_support):
"OS Minor": 99
},
},
"Install Reference": {
"Install": {
"/System/Library/Extensions": {
"AMD7000Controller.kext": "12.4",
"AMD8000Controller.kext": "12.4",
"AMD9000Controller.kext": "12.4",
"AMDRadeonX4000.kext": "12.4",
"AMD7000Controller.kext": "12.5",
"AMD8000Controller.kext": "12.5",
"AMD9000Controller.kext": "12.5",
"AMD9500Controller.kext": "12.5",
"AMDRadeonX4000.kext": "12.5",
"AMDRadeonX4000HWServices.kext": "12.5",
"AMDFramebuffer.kext": "12.5",
"AMDSupport.kext": "12.5",
"AMDRadeonX4000GLDriver.bundle": "12.5",
"AMDMTLBronzeDriver.bundle": "12.5",
"AMDShared.bundle": "12.5",
},
},
"Remove": {
"/System/Library/Extensions": [
# Due to downgraded AMDSupport.kext
# In the future, we will have to downgrade the entire AMD stack
# to support non-AVX2.0 machines with Vega or newer
"AMD10000Controller.kext",
],
},
},
"Intel Ironlake": {
"Display Name": "Graphics: Intel Ironlake",
@@ -578,14 +733,15 @@ def SystemPatchDictionary(os_major, os_minor, non_metal_os_support):
"OS Minor": 99
},
},
"Install Reference": {
"Install": {
"/System/Library/Extensions": {
"AppleIntelFramebufferAzul.kext": "12.4",
"AppleIntelHD5000Graphics.kext": "12.4",
"AppleIntelHD5000GraphicsGLDriver.bundle": "11.0 Beta 6",
"AppleIntelHD5000GraphicsMTLDriver.bundle": "11.0 Beta 6",
"AppleIntelHD5000GraphicsVADriver.bundle": "11.0 Beta 6",
"AppleIntelHSWVA.bundle": "11.0 Beta 6",
"AppleIntelFramebufferAzul.kext": "12.5",
"AppleIntelHD5000Graphics.kext": "12.5",
"AppleIntelHD5000GraphicsGLDriver.bundle": "12.5",
"AppleIntelHD5000GraphicsMTLDriver.bundle": "12.5",
"AppleIntelHD5000GraphicsVADriver.bundle": "12.5",
"AppleIntelHSWVA.bundle": "12.5",
"AppleIntelGraphicsShared.bundle": "12.5",
},
},
},
@@ -601,14 +757,15 @@ def SystemPatchDictionary(os_major, os_minor, non_metal_os_support):
"OS Minor": 99
},
},
"Install Reference": {
"Install": {
"/System/Library/Extensions": {
"AppleIntelBDWGraphics.kext": "12.4",
"AppleIntelBDWGraphicsFramebuffer.kext": "12.4",
"AppleIntelBDWGraphicsGLDriver.bundle": "11.0 Beta 6",
"AppleIntelBDWGraphicsMTLDriver.bundle": "11.0 Beta 6",
"AppleIntelBDWGraphicsVADriver.bundle": "11.0 Beta 6",
"AppleIntelBDWGraphicsVAME.bundle": "11.0 Beta 6",
"AppleIntelBDWGraphics.kext": "12.5",
"AppleIntelBDWGraphicsFramebuffer.kext": "12.5",
"AppleIntelBDWGraphicsGLDriver.bundle": "12.5",
"AppleIntelBDWGraphicsMTLDriver.bundle": "12.5",
"AppleIntelBDWGraphicsVADriver.bundle": "12.5",
"AppleIntelBDWGraphicsVAME.bundle": "12.5",
"AppleIntelGraphicsShared.bundle": "12.5",
},
},
},
@@ -624,21 +781,22 @@ def SystemPatchDictionary(os_major, os_minor, non_metal_os_support):
"OS Minor": 99
},
},
"Install Reference": {
"Install": {
"/System/Library/Extensions": {
"AppleIntelSKLGraphics.kext": "12.4",
"AppleIntelSKLGraphicsFramebuffer.kext": "12.4",
"AppleIntelSKLGraphicsGLDriver.bundle": "11.0 Beta 6",
"AppleIntelSKLGraphicsMTLDriver.bundle": "11.0 Beta 6",
"AppleIntelSKLGraphicsVADriver.bundle": "11.0 Beta 6",
"AppleIntelSKLGraphicsVAME.bundle": "11.0 Beta 6",
"AppleIntelSKLGraphics.kext": "12.5",
"AppleIntelSKLGraphicsFramebuffer.kext": "12.5",
"AppleIntelSKLGraphicsGLDriver.bundle": "12.5",
"AppleIntelSKLGraphicsMTLDriver.bundle": "12.5",
"AppleIntelSKLGraphicsVADriver.bundle": "12.5",
"AppleIntelSKLGraphicsVAME.bundle": "12.5",
"AppleIntelGraphicsShared.bundle": "12.5",
},
},
},
},
"Audio": {
"Legacy Realtek": {
"Display Name": "Audio: Legacy Realtek Audio",
"Display Name": "Audio: Legacy Realtek",
"OS Support": {
"Minimum OS Support": {
"OS Major": os_data.os_data.sierra,
@@ -668,7 +826,7 @@ def SystemPatchDictionary(os_major, os_minor, non_metal_os_support):
},
# For Mac Pros with non-UGA/GOP GPUs
"Legacy Non-GOP": {
"Display Name": "Audio: Legacy non-GOP Audio",
"Display Name": "Audio: Legacy non-GOP",
"OS Support": {
"Minimum OS Support": {
"OS Major": os_data.os_data.mojave,
@@ -687,15 +845,15 @@ def SystemPatchDictionary(os_major, os_minor, non_metal_os_support):
},
},
"Networking": {
"Legacy WiFi": {
"Display Name": "Networking: Legacy WiFi",
"Legacy Wireless": {
"Display Name": "Networking: Legacy Wireless",
"OS Support": {
"Minimum OS Support": {
"OS Major": os_data.os_data.monterey,
"OS Minor": 0
},
"Maximum OS Support": {
"OS Major": os_data.os_data.max_os,
"OS Major": os_data.os_data.monterey,
"OS Minor": 99
},
},
@@ -716,8 +874,8 @@ def SystemPatchDictionary(os_major, os_minor, non_metal_os_support):
},
},
"Brightness": {
"Legacy Brightness": {
"Display Name": "Brightness: Legacy Brightness",
"Legacy Backlight Control": {
"Display Name": "Brightness: Legacy Backlight Control",
"OS Support": {
"Minimum OS Support": {
"OS Major": os_data.os_data.high_sierra,

View File

@@ -16,7 +16,7 @@ from pathlib import Path
import binascii
import hashlib
from resources import constants, defaults, build, install, installer, sys_patch_download, utilities, sys_patch_detect, sys_patch, run, generate_smbios, updates, integrity_verification, global_settings
from resources import constants, defaults, build, install, installer, sys_patch_download, utilities, sys_patch_detect, sys_patch, run, generate_smbios, updates, integrity_verification, global_settings, kdk_handler
from data import model_array, os_data, smbios_data, sip_data
from gui import menu_redirect, gui_help
@@ -233,7 +233,7 @@ class wx_python_gui:
if event:
if event.GetEventObject() != wx.Menu:
try:
if event.GetEventObject().GetLabel() == "Start Root Patching":
if event.GetEventObject().GetLabel() in ["Start Root Patching", "Reinstall Root Patches"]:
extension = " --gui_patch"
elif event.GetEventObject().GetLabel() == "Revert Root Patches":
extension = " --gui_unpatch"
@@ -775,7 +775,7 @@ class wx_python_gui:
self.return_to_main_menu.SetPosition(
wx.Point(
self.reload_button.GetPosition().x,
self.reload_button.GetPosition().y + self.reload_button.GetSize().height + 7.5
self.reload_button.GetPosition().y + self.reload_button.GetSize().height + 8
)
)
self.return_to_main_menu.Bind(wx.EVT_BUTTON, self.main_menu)
@@ -887,6 +887,44 @@ class wx_python_gui:
popup_message = wx.MessageDialog(self.frame,f"OpenCore has finished installing to disk.\n\nYou can eject the drive, insert it into the {self.constants.custom_model}, reboot, hold the Option key and select OpenCore/Boot EFI's option.", "Success", wx.OK)
popup_message.ShowModal()
def check_if_new_patches_needed(self, patches):
# Check if there's any new patches for the user to install
# Newer users will assume the root patch menu will present missing patches.
# Thus we'll need to see if the exact same OCLP build was used already
if self.constants.commit_info[0] in ["Running from source", "Built from source"]:
return True
if self.constants.computer.oclp_sys_url != self.constants.commit_info[2]:
# If commits are different, assume patches are as well
return True
oclp_plist = "/System/Library/CoreServices/OpenCore-Legacy-Patcher.plist"
if not Path(oclp_plist).exists():
# If it doesn't exist, no patches were ever installed
# ie. all patches applicable
return True
oclp_plist_data = plistlib.load(open(oclp_plist, "rb"))
for patch in patches:
if (not patch.startswith("Settings") and not patch.startswith("Validation") and patches[patch] is True):
# Patches should share the same name as the plist key
# See sys_patch_dict.py for more info
patch_installed = False
for key in oclp_plist_data:
if "Display Name" not in oclp_plist_data[key]:
continue
if oclp_plist_data[key]["Display Name"] == patch:
patch_installed = True
break
if patch_installed is False:
print(f"- Patch {patch} not installed")
return True
print("- No new patches detected for system")
return False
def root_patch_menu(self, event=None):
# Define Menu
# Header: Post-Install Menu
@@ -920,21 +958,38 @@ class wx_python_gui:
print("- No applicable patches available")
patches = []
# Check if OCLP has already applied the same patches
no_new_patches = False
if patches:
no_new_patches = not self.check_if_new_patches_needed(patches)
i = 0
if patches:
for patch in patches:
# Add Label for each patch
if (not patch.startswith("Settings") and not patch.startswith("Validation") and patches[patch] is True):
print(f"- Adding patch: {patch} - {patches[patch]}")
self.patch_label = wx.StaticText(self.frame_modal, label=f"- {patch}")
self.patch_label.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL))
self.patch_label.SetPosition(
wx.Point(
self.subheader.GetPosition().x,
self.subheader.GetPosition().y + self.subheader.GetSize().height + 3 + i
if no_new_patches is False:
for patch in patches:
# Add Label for each patch
if (not patch.startswith("Settings") and not patch.startswith("Validation") and patches[patch] is True):
print(f"- Adding patch: {patch} - {patches[patch]}")
self.patch_label = wx.StaticText(self.frame_modal, label=f"- {patch}")
self.patch_label.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL))
self.patch_label.SetPosition(
wx.Point(
self.subheader.GetPosition().x,
self.subheader.GetPosition().y + self.subheader.GetSize().height + 3 + i
)
)
i = i + self.patch_label.GetSize().height + 3
else:
self.patch_label = wx.StaticText(self.frame_modal, label=f"All applicable patches already installed")
self.patch_label.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL))
self.patch_label.SetPosition(
wx.Point(
self.subheader.GetPosition().x,
self.subheader.GetPosition().y + self.subheader.GetSize().height + 3 + i
)
i = i + self.patch_label.GetSize().height + 3
)
i = i + self.patch_label.GetSize().height + 3
self.patch_label.Centre(wx.HORIZONTAL)
if patches["Validation: Patching Possible"] is False:
self.patch_label = wx.StaticText(self.frame_modal, label="Cannot Patch due to following reasons:")
self.patch_label.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD))
@@ -1002,6 +1057,8 @@ class wx_python_gui:
# Start Root Patching
self.start_root_patching = wx.Button(self.frame_modal, label="Start Root Patching", size=(170, -1))
if no_new_patches is True:
self.start_root_patching.Label = "Reinstall Root Patches"
self.start_root_patching.SetPosition(
wx.Point(
self.patch_label.GetPosition().x,
@@ -1099,6 +1156,8 @@ class wx_python_gui:
self.pulse_alternative(self.progress_bar)
wx.GetApp().Yield()
self.progress_bar.Hide()
# Download resources
sys.stdout=menu_redirect.RedirectLabel(self.developer_note)
download_result, link = sys_patch_download.grab_patcher_support_pkg(self.constants).download_files()
@@ -1118,6 +1177,28 @@ class wx_python_gui:
webbrowser.open(self.constants.repo_link_latest)
self.main_menu()
if self.patches["Settings: Kernel Debug Kit missing"] is True:
# Download KDK (if needed)
self.subheader.SetLabel("Downloading Kernel Debug Kit")
self.subheader.Centre(wx.HORIZONTAL)
self.developer_note.SetLabel("Starting shortly")
sys.stdout=menu_redirect.RedirectLabel(self.developer_note)
kdk_result, error_msg, detected_build = kdk_handler.kernel_debug_kit_handler(self.constants).download_kdk(self.constants.detected_os_version, self.constants.detected_os_build)
sys.stdout=sys.__stdout__
if kdk_result is False:
# Create popup window to inform user of error
self.popup = wx.MessageDialog(
self.frame,
f"A problem occurred trying to download the Kernel Debug Kit:\n\n{error_msg}",
"Kernel Debug Kit",
wx.ICON_ERROR
)
self.popup.ShowModal()
self.finished_auto_patch = True
self.main_menu()
self.reset_frame_modal()
self.frame_modal.SetSize(-1, self.WINDOW_HEIGHT_MAIN)
@@ -1191,30 +1272,33 @@ class wx_python_gui:
if self.constants.root_patcher_succeeded is True:
print("- Root Patcher finished successfully")
if self.constants.needs_to_open_preferences is True:
# Create dialog box to open System Preferences -> Security and Privacy
self.popup = wx.MessageDialog(
self.frame_modal,
"We just finished installing the patches to your Root Volume!\n\nHowever, Apple requires users to manually approve the kernel extensions installed before they can be used next reboot.\n\nWould you like to open System Preferences?",
"Open System Preferences?",
wx.YES_NO | wx.ICON_INFORMATION
)
self.popup.SetYesNoLabels("Open System Preferences", "Ignore")
answer = self.popup.ShowModal()
if answer == wx.ID_YES:
output =subprocess.run(
[
"osascript", "-e",
'tell app "System Preferences" to activate',
"-e", 'tell app "System Preferences" to reveal anchor "General" of pane id "com.apple.preference.security"',
],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE
if self.constants.detected_os >= os_data.os_data.ventura:
self.reboot_system(message="Root Patcher finished successfully!\nIf you were prompted to open System Settings to authorize new kexts, this can be ignored. Your system is ready once restarted.\n\nWould you like to reboot now?")
else:
# Create dialog box to open System Preferences -> Security and Privacy
self.popup = wx.MessageDialog(
self.frame_modal,
"We just finished installing the patches to your Root Volume!\n\nHowever, Apple requires users to manually approve the kernel extensions installed before they can be used next reboot.\n\nWould you like to open System Preferences?",
"Open System Preferences?",
wx.YES_NO | wx.ICON_INFORMATION
)
if output.returncode != 0:
# Some form of fallback if unaccelerated state errors out
subprocess.run(["open", "-a", "System Preferences"])
time.sleep(5)
self.OnCloseFrame(None)
self.popup.SetYesNoLabels("Open System Preferences", "Ignore")
answer = self.popup.ShowModal()
if answer == wx.ID_YES:
output =subprocess.run(
[
"osascript", "-e",
'tell app "System Preferences" to activate',
"-e", 'tell app "System Preferences" to reveal anchor "General" of pane id "com.apple.preference.security"',
],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE
)
if output.returncode != 0:
# Some form of fallback if unaccelerated state errors out
subprocess.run(["open", "-a", "System Preferences"])
time.sleep(5)
self.OnCloseFrame(None)
else:
self.reboot_system(message="Root Patcher finished successfully\nWould you like to reboot now?")
self.return_to_main_menu.Enable()
@@ -1403,7 +1487,7 @@ class wx_python_gui:
# Download installer catalog
if ias is None:
def ia():
self.available_installers = installer.list_downloadable_macOS_installers(self.constants.payload_path, "PublicSeed")
self.available_installers = installer.list_downloadable_macOS_installers(self.constants.payload_path, "DeveloperSeed")
print("- Downloading installer catalog...")
thread_ia = threading.Thread(target=ia)
@@ -1443,7 +1527,7 @@ class wx_python_gui:
if ias is None:
available_installers = installer.only_list_newest_installers(available_installers)
for app in available_installers:
print(f"macOS {available_installers[app]['Version']} ({available_installers[app]['Build']} - {utilities.human_fmt(available_installers[app]['Size'])} - {available_installers[app]['Source']}) - {available_installers[app]['Variant']}")
print(f"macOS {available_installers[app]['Version']} ({available_installers[app]['Build']}):\n - Size: {utilities.human_fmt(available_installers[app]['Size'])}\n - Source: {available_installers[app]['Source']}\n - Variant: {available_installers[app]['Variant']}\n - Link: {available_installers[app]['Link']}\n")
if available_installers[app]['Variant'] in ["DeveloperSeed" , "PublicSeed"]:
extra = " Beta"
else:
@@ -1499,17 +1583,29 @@ class wx_python_gui:
self.grab_installer_data(ias=ias)
def download_macos_click(self, app_dict):
try:
app_major = app_dict['Version'].split(".")[0]
if float(app_major) > self.constants.os_support:
# Throw pop up warning OCLP does not support this OS
os = os_data.os_conversion.convert_kernel_to_marketing_name(os_data.os_conversion.os_to_kernel(app_major))
dlg = wx.MessageDialog(self.frame_modal, f"OpenCore Legacy Patcher currently does not support macOS {os}. We highly recommend you select an older installer.\n\nThe newest version we officially support is macOS {os_data.os_conversion.convert_kernel_to_marketing_name(os_data.os_conversion.os_to_kernel(str(self.constants.os_support)))}\n\nWould you still want to continue downloading macOS {os}?", "Unsupported OS", wx.YES_NO | wx.ICON_WARNING)
if dlg.ShowModal() == wx.ID_NO:
return
except ValueError:
pass
# Unsupported Models include:
# - USB 1.1 machines (Penryn, MacPro3,1-5,1)
# - VBIOS Boot Issue (MacPro6,1)
# - Non-Metal GPUs
model = self.constants.custom_model or self.constants.computer.real_model
if model in model_array.LegacyGPU or model in ["MacPro3,1", "MacPro4,1", "MacPro5,1", "MacPro6,1"]:
try:
app_major = app_dict['Version'].split(".")[0]
if float(app_major) > self.constants.os_support:
# Throw pop up warning OCLP does not support this OS
os = os_data.os_conversion.convert_kernel_to_marketing_name(os_data.os_conversion.os_to_kernel(app_major))
dlg = wx.MessageDialog(self.frame_modal, f"OpenCore Legacy Patcher currently does not support macOS {os} on your machine ({model}).\n\nThe newest version we officially support is macOS {os_data.os_conversion.convert_kernel_to_marketing_name(os_data.os_conversion.os_to_kernel(str(self.constants.os_support)))}. For more information, see the associated Ventura Github Issue.\n\nWould you still want to continue downloading macOS {os}?", "Unsupported OS", style=wx.YES_NO | wx.CANCEL | wx.ICON_QUESTION)
dlg.SetYesNoCancelLabels("View Github Issue", "Download Anyways", "Cancel")
result = dlg.ShowModal()
if result == wx.ID_YES:
webbrowser.open("https://github.com/dortania/OpenCore-Legacy-Patcher/issues/998")
return
elif result == wx.ID_NO:
pass
else:
return
except ValueError:
pass
# Ensure we have space to both download and extract the installer
host_space = utilities.get_free_space()
@@ -2242,11 +2338,11 @@ class wx_python_gui:
if user_choice == self.computer.real_model:
print(f"Using Real Model: {user_choice}")
self.constants.custom_model = None
defaults.generate_defaults.probe(self.computer.real_model, True, self.constants)
defaults.generate_defaults(self.computer.real_model, True, self.constants)
else:
print(f"Using Custom Model: {user_choice}")
self.constants.custom_model = user_choice
defaults.generate_defaults.probe(self.constants.custom_model, False, self.constants)
defaults.generate_defaults(self.constants.custom_model, False, self.constants)
# Reload Settings
self.settings_menu(None)
@@ -2362,7 +2458,8 @@ class wx_python_gui:
self.gpu_dropdown.Bind(wx.EVT_CHOICE, self.gpu_selection_click)
self.gpu_dropdown.Centre(wx.HORIZONTAL)
self.gpu_dropdown.SetToolTip(wx.ToolTip("Configures MXM GPU Vendor logic on pre-built models\nIf you are not using MXM iMacs, please leave this setting as is."))
if self.computer.real_model not in ["iMac10,1", "iMac11,1", "iMac11,2", "iMac11,3", "iMac12,1", "iMac12,2"]:
models = ["iMac10,1", "iMac11,1", "iMac11,2", "iMac11,3", "iMac12,1", "iMac12,2"]
if (not self.constants.custom_model and self.computer.real_model not in models) or (self.constants.custom_model and self.constants.custom_model not in models):
self.gpu_dropdown.Disable()
# Disable Thunderbolt
@@ -2483,16 +2580,47 @@ class wx_python_gui:
if self.computer.third_party_sata_ssd is False and not self.constants.custom_model:
self.set_enhanced_3rd_party_ssd_checkbox.Disable()
# Disable Library Validation
self.disable_library_validation_checkbox = wx.CheckBox(self.frame_modal, label="Disable Library Validation")
self.disable_library_validation_checkbox.SetValue(self.constants.disable_cs_lv)
self.disable_library_validation_checkbox.Bind(wx.EVT_CHECKBOX, self.disable_library_validation_click)
self.disable_library_validation_checkbox.SetPosition(wx.Point(
self.set_enhanced_3rd_party_ssd_checkbox.GetPosition().x,
self.set_enhanced_3rd_party_ssd_checkbox.GetPosition().y + self.set_enhanced_3rd_party_ssd_checkbox.GetSize().height
))
# Disable AMFI
self.disable_amfi_checkbox = wx.CheckBox(self.frame_modal, label="Disable AMFI")
self.disable_amfi_checkbox.SetValue(self.constants.disable_amfi)
self.disable_amfi_checkbox.Bind(wx.EVT_CHECKBOX, self.disable_amfi_click)
self.disable_amfi_checkbox.SetPosition(wx.Point(
self.disable_library_validation_checkbox.GetPosition().x,
self.disable_library_validation_checkbox.GetPosition().y + self.disable_library_validation_checkbox.GetSize().height
))
if self.constants.disable_cs_lv is False:
self.disable_amfi_checkbox.Disable()
# Delete Unused KDKs during patching
self.delete_unused_kdks_checkbox = wx.CheckBox(self.frame_modal, label="Delete Unused KDKs")
self.delete_unused_kdks_checkbox.SetValue(self.constants.should_nuke_kdks)
self.delete_unused_kdks_checkbox.Bind(wx.EVT_CHECKBOX, self.delete_unused_kdks_click)
self.delete_unused_kdks_checkbox.SetPosition(wx.Point(
self.disable_amfi_checkbox.GetPosition().x,
self.disable_amfi_checkbox.GetPosition().y + self.disable_amfi_checkbox.GetSize().height
))
self.delete_unused_kdks_checkbox.SetToolTip(wx.ToolTip("This will delete unused KDKs during root patching.\nThis will save space on your drive, however can be disabled if you wish to keep KDKs installed."))
# Set Ignore App Updates
self.set_ignore_app_updates_checkbox = wx.CheckBox(self.frame_modal, label="Ignore App Updates")
self.set_ignore_app_updates_checkbox.SetValue(self.constants.ignore_updates)
self.set_ignore_app_updates_checkbox.Bind(wx.EVT_CHECKBOX, self.set_ignore_app_updates_click)
self.set_ignore_app_updates_checkbox.SetPosition(wx.Point(
self.set_enhanced_3rd_party_ssd_checkbox.GetPosition().x,
self.set_enhanced_3rd_party_ssd_checkbox.GetPosition().y + self.set_enhanced_3rd_party_ssd_checkbox.GetSize().height))
self.delete_unused_kdks_checkbox.GetPosition().x,
self.delete_unused_kdks_checkbox.GetPosition().y + self.delete_unused_kdks_checkbox.GetSize().height))
self.set_ignore_app_updates_checkbox.SetToolTip(wx.ToolTip("This will set whether OpenCore will ignore App Updates on launch.\nEnable this option if you do not want to be prompted for App Updates"))
# Button: Developer Debug Info
self.debug_button = wx.Button(self.frame_modal, label="Developer Debug Info")
self.debug_button.Bind(wx.EVT_BUTTON, self.additional_info_menu)
@@ -2514,6 +2642,33 @@ class wx_python_gui:
self.frame_modal.SetSize(wx.Size(-1, self.return_to_main_menu_button.GetPosition().y + self.return_to_main_menu_button.GetSize().height + 40))
self.frame_modal.ShowWindowModal()
def delete_unused_kdks_click(self, event):
if self.delete_unused_kdks_checkbox.GetValue() is True:
print("Nuke KDKs enabled")
self.constants.should_nuke_kdks = True
else:
print("Nuke KDKs disabled")
self.constants.should_nuke_kdks = False
global_settings.global_settings().write_property("ShouldNukeKDKs", self.constants.should_nuke_kdks)
def disable_library_validation_click(self, event):
if self.disable_library_validation_checkbox.GetValue():
print("Disable Library Validation")
self.disable_amfi_checkbox.Enable()
self.constants.disable_cs_lv = True
else:
print("Enable Library Validation")
self.disable_amfi_checkbox.Disable()
self.constants.disable_cs_lv = False
def disable_amfi_click(self, event):
if self.disable_amfi_checkbox.GetValue():
print("Disable AMFI")
self.constants.disable_amfi = True
else:
print("Enable AMFI")
self.constants.disable_amfi = False
def set_ignore_app_updates_click(self, event):
self.constants.ignore_updates = self.set_ignore_app_updates_checkbox.GetValue()
if self.constants.ignore_updates is True:
@@ -3051,7 +3206,7 @@ class wx_python_gui:
elif self.constants.sip_status is True:
self.sip_value = 0x00
else:
self.sip_value = 0x802
self.sip_value = 0x803
self.sip_label_2 = wx.StaticText(self.frame_modal, label=f"Currently configured SIP: {hex(self.sip_value)}")
self.sip_label_2.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD))
@@ -3067,21 +3222,21 @@ class wx_python_gui:
)
self.sip_label_2_2.Center(wx.HORIZONTAL)
self.sip_label_3 = wx.StaticText(self.frame_modal, label="For older Macs requiring root patching, we set SIP to\n be partially disabled (0x802) to allow root patching.")
self.sip_label_3 = wx.StaticText(self.frame_modal, label="For older Macs requiring root patching, we set SIP to\n be partially disabled (0x803) to allow root patching.")
self.sip_label_3.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL))
self.sip_label_3.SetPosition(
wx.Point(self.sip_label_2_2.GetPosition().x, self.sip_label_2_2.GetPosition().y + self.sip_label_2_2.GetSize().height + 10)
)
self.sip_label_3.Center(wx.HORIZONTAL)
self.sip_label_4 = wx.StaticText(self.frame_modal, label="This value (0x802) corresponds to the following bits in csr.h:")
self.sip_label_4 = wx.StaticText(self.frame_modal, label="This value (0x803) corresponds to the following bits in csr.h:")
self.sip_label_4.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL))
self.sip_label_4.SetPosition(
wx.Point(self.sip_label_3.GetPosition().x, self.sip_label_3.GetPosition().y + self.sip_label_3.GetSize().height + 5)
)
self.sip_label_4.Center(wx.HORIZONTAL)
self.sip_label_5 = wx.StaticText(self.frame_modal, label=" 0x2 - CSR_ALLOW_UNRESTRICTED_FS\n 0x800 - CSR_ALLOW_UNAUTHENTICATED_ROOT")
self.sip_label_5 = wx.StaticText(self.frame_modal, label=" 0x1 - CSR_ALLOW_UNTRUSTED_KEXTS\n 0x2 - CSR_ALLOW_UNRESTRICTED_FS\n 0x800 - CSR_ALLOW_UNAUTHENTICATED_ROOT")
self.sip_label_5.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL))
self.sip_label_5.SetPosition(
wx.Point(self.sip_label_4.GetPosition().x, self.sip_label_4.GetPosition().y + self.sip_label_4.GetSize().height + 7)
@@ -3135,7 +3290,7 @@ OpenCore Legacy Patcher by default knows the most ideal
if hex(self.sip_value) == "0x0":
self.constants.custom_sip_value = None
self.constants.sip_status = True
elif hex(self.sip_value) == "0x802":
elif hex(self.sip_value) == "0x803":
self.constants.custom_sip_value = None
self.constants.sip_status = False
else:

View File

@@ -663,6 +663,42 @@
<key>PlistPath</key>
<string>Contents/Info.plist</string>
</dict>
<dict>
<key>Arch</key>
<string>x86_64</string>
<key>Comment</key>
<string>Intel 80003ES2LAN Ethernet Patch</string>
<key>Enabled</key>
<false/>
<key>MaxKernel</key>
<string></string>
<key>MinKernel</key>
<string>22.0.0</string>
<key>BundlePath</key>
<string>Intel82574L.kext</string>
<key>ExecutablePath</key>
<string>Contents/MacOS/Intel82574L</string>
<key>PlistPath</key>
<string>Contents/Info.plist</string>
</dict>
<dict>
<key>Arch</key>
<string>x86_64</string>
<key>Comment</key>
<string>Intel 82574L Ethernet Patch</string>
<key>Enabled</key>
<false/>
<key>MaxKernel</key>
<string></string>
<key>MinKernel</key>
<string>22.0.0</string>
<key>BundlePath</key>
<string>AppleIntel8254XEthernet.kext</string>
<key>ExecutablePath</key>
<string>Contents/MacOS/AppleIntel8254XEthernet</string>
<key>PlistPath</key>
<string>Contents/Info.plist</string>
</dict>
<dict>
<key>Arch</key>
<string>x86_64</string>
@@ -1233,12 +1269,30 @@
<key>ExecutablePath</key>
<string>Contents/MacOS/NoAVXFSCompressionTypeZlib</string>
<key>MaxKernel</key>
<string></string>
<string>21.99.99</string>
<key>MinKernel</key>
<string>21.5.0</string>
<key>PlistPath</key>
<string>Contents/Info.plist</string>
</dict>
<dict>
<key>Arch</key>
<string>x86_64</string>
<key>BundlePath</key>
<string>NoAVXFSCompressionTypeZlib-AVXpel.kext</string>
<key>Comment</key>
<string>Work-around 13.0+ Zlib kernel panic</string>
<key>Enabled</key>
<false/>
<key>ExecutablePath</key>
<string>Contents/MacOS/NoAVXFSCompressionTypeZlib</string>
<key>MaxKernel</key>
<string></string>
<key>MinKernel</key>
<string>22.0.0</string>
<key>PlistPath</key>
<string>Contents/Info.plist</string>
</dict>
<dict>
<key>Arch</key>
<string>x86_64</string>
@@ -1267,7 +1321,187 @@
<key>Enabled</key>
<false/>
<key>ExecutablePath</key>
<string>Contents/MacOS/AppleUSBTopCase</string>
<string></string>
<key>MaxKernel</key>
<string></string>
<key>MinKernel</key>
<string>22.0.0</string>
<key>PlistPath</key>
<string>Contents/Info.plist</string>
</dict>
<dict>
<key>Arch</key>
<string>x86_64</string>
<key>BundlePath</key>
<string>AppleUSBTopCase.kext/Contents/PlugIns/AppleUSBTCButtons.kext</string>
<key>Comment</key>
<string>AppleUSBTCButtons</string>
<key>Enabled</key>
<false/>
<key>ExecutablePath</key>
<string>Contents/MacOS/AppleUSBTCButtons</string>
<key>MaxKernel</key>
<string></string>
<key>MinKernel</key>
<string>22.0.0</string>
<key>PlistPath</key>
<string>Contents/Info.plist</string>
</dict>
<dict>
<key>Arch</key>
<string>x86_64</string>
<key>BundlePath</key>
<string>AppleUSBTopCase.kext/Contents/PlugIns/AppleUSBTCKeyboard.kext</string>
<key>Comment</key>
<string>AppleUSBTCKeyboard</string>
<key>Enabled</key>
<false/>
<key>ExecutablePath</key>
<string>Contents/MacOS/AppleUSBTCKeyboard</string>
<key>MaxKernel</key>
<string></string>
<key>MinKernel</key>
<string>22.0.0</string>
<key>PlistPath</key>
<string>Contents/Info.plist</string>
</dict>
<dict>
<key>Arch</key>
<string>x86_64</string>
<key>BundlePath</key>
<string>AppleUSBTopCase.kext/Contents/PlugIns/AppleUSBTCKeyEventDriver.kext</string>
<key>Comment</key>
<string>AppleUSBTCKeyEventDriver</string>
<key>Enabled</key>
<false/>
<key>ExecutablePath</key>
<string>Contents/MacOS/AppleUSBTCKeyEventDriver</string>
<key>MaxKernel</key>
<string></string>
<key>MinKernel</key>
<string>22.0.0</string>
<key>PlistPath</key>
<string>Contents/Info.plist</string>
</dict>
<dict>
<key>Arch</key>
<string>x86_64</string>
<key>BundlePath</key>
<string>USB1.1-Injector.kext/Contents/PlugIns/AppleUSBOHCI.kext</string>
<key>Comment</key>
<string>USB1.1 - AppleUSBOHCI</string>
<key>Enabled</key>
<false/>
<key>ExecutablePath</key>
<string>Contents/MacOS/AppleUSBOHCI</string>
<key>MaxKernel</key>
<string></string>
<key>MinKernel</key>
<string>22.0.0</string>
<key>PlistPath</key>
<string>Contents/Info.plist</string>
</dict>
<dict>
<key>Arch</key>
<string>x86_64</string>
<key>BundlePath</key>
<string>USB1.1-Injector.kext/Contents/PlugIns/AppleUSBOHCIPCI.kext</string>
<key>Comment</key>
<string>USB1.1 - AppleUSBOHCIPCI</string>
<key>Enabled</key>
<false/>
<key>ExecutablePath</key>
<string>Contents/MacOS/AppleUSBOHCIPCI</string>
<key>MaxKernel</key>
<string></string>
<key>MinKernel</key>
<string>22.0.0</string>
<key>PlistPath</key>
<string>Contents/Info.plist</string>
</dict>
<dict>
<key>Arch</key>
<string>x86_64</string>
<key>BundlePath</key>
<string>USB1.1-Injector.kext/Contents/PlugIns/AppleUSBUHCI.kext</string>
<key>Comment</key>
<string>USB1.1 - AppleUSBUHCI</string>
<key>Enabled</key>
<false/>
<key>ExecutablePath</key>
<string>Contents/MacOS/AppleUSBUHCI</string>
<key>MaxKernel</key>
<string></string>
<key>MinKernel</key>
<string>22.0.0</string>
<key>PlistPath</key>
<string>Contents/Info.plist</string>
</dict>
<dict>
<key>Arch</key>
<string>x86_64</string>
<key>BundlePath</key>
<string>USB1.1-Injector.kext/Contents/PlugIns/AppleUSBUHCIPCI.kext</string>
<key>Comment</key>
<string>USB1.1 - AppleUSBUHCIPCI</string>
<key>Enabled</key>
<false/>
<key>ExecutablePath</key>
<string>Contents/MacOS/AppleUSBUHCIPCI</string>
<key>MaxKernel</key>
<string></string>
<key>MinKernel</key>
<string>22.0.0</string>
<key>PlistPath</key>
<string>Contents/Info.plist</string>
</dict>
<dict>
<key>Arch</key>
<string>x86_64</string>
<key>BundlePath</key>
<string>CryptexFixup.kext</string>
<key>Comment</key>
<string>CryptexFixup</string>
<key>Enabled</key>
<false/>
<key>ExecutablePath</key>
<string>Contents/MacOS/CryptexFixup</string>
<key>MaxKernel</key>
<string></string>
<key>MinKernel</key>
<string>22.0.0</string>
<key>PlistPath</key>
<string>Contents/Info.plist</string>
</dict>
<dict>
<key>Arch</key>
<string>x86_64</string>
<key>BundlePath</key>
<string>AppleIntelCPUPowerManagement.kext</string>
<key>Comment</key>
<string>Legacy Power Management (pre-XCPM)</string>
<key>Enabled</key>
<false/>
<key>ExecutablePath</key>
<string>Contents/MacOS/AppleIntelCPUPowerManagement</string>
<key>MaxKernel</key>
<string></string>
<key>MinKernel</key>
<string>22.0.0</string>
<key>PlistPath</key>
<string>Contents/Info.plist</string>
</dict>
<dict>
<key>Arch</key>
<string>x86_64</string>
<key>BundlePath</key>
<string>AppleIntelCPUPowerManagementClient.kext</string>
<key>Comment</key>
<string>Legacy Power Management (pre-XCPM) Helper</string>
<key>Enabled</key>
<false/>
<key>ExecutablePath</key>
<string>Contents/MacOS/AppleIntelCPUPowerManagementClient</string>
<key>MaxKernel</key>
<string></string>
<key>MinKernel</key>
@@ -1511,7 +1745,7 @@
<key>Base</key>
<string></string>
<key>Comment</key>
<string>Reroute kern.hv_vmm_present patch (2)</string>
<string>Reroute kern.hv_vmm_present patch (2) Legacy</string>
<key>Count</key>
<integer>1</integer>
<key>Enabled</key>
@@ -1525,7 +1759,7 @@
<key>Mask</key>
<data></data>
<key>MaxKernel</key>
<string></string>
<string>21.99.99</string>
<key>MinKernel</key>
<string>20.4.0</string>
<key>Replace</key>
@@ -1535,6 +1769,36 @@
<key>Skip</key>
<integer>0</integer>
</dict>
<dict>
<key>Arch</key>
<string>x86_64</string>
<key>Base</key>
<string></string>
<key>Comment</key>
<string>Reroute kern.hv_vmm_present patch (2) Ventura</string>
<key>Count</key>
<integer>1</integer>
<key>Enabled</key>
<false/>
<key>Find</key>
<data>Ym9vdCBzZXNzaW9uIFVVSUQAaHZfdm1tX3ByZXNlbnQA</data>
<key>Identifier</key>
<string>kernel</string>
<key>Limit</key>
<integer>0</integer>
<key>Mask</key>
<data></data>
<key>MaxKernel</key>
<string></string>
<key>MinKernel</key>
<string>22.0.0</string>
<key>Replace</key>
<data>Ym9vdCBzZXNzaW9uIFVVSUQAZGlyZWN0X2hhbmRvZmYA</data>
<key>ReplaceMask</key>
<data></data>
<key>Skip</key>
<integer>0</integer>
</dict>
<dict>
<key>Arch</key>
<string>x86_64</string>
@@ -1565,6 +1829,66 @@
<key>Skip</key>
<integer>0</integer>
</dict>
<dict>
<key>Arch</key>
<string>x86_64</string>
<key>Base</key>
<string>_authenticate_root_hash</string>
<key>Comment</key>
<string>Disable Root Hash validation</string>
<key>Count</key>
<integer>0</integer>
<key>Enabled</key>
<false/>
<key>Find</key>
<data></data>
<key>Identifier</key>
<string>com.apple.filesystems.apfs</string>
<key>Limit</key>
<integer>0</integer>
<key>Mask</key>
<data></data>
<key>MaxKernel</key>
<string></string>
<key>MinKernel</key>
<string>22.0.0</string>
<key>Replace</key>
<data>uAAAAADD</data>
<key>ReplaceMask</key>
<data></data>
<key>Skip</key>
<integer>0</integer>
</dict>
<dict>
<key>Arch</key>
<string>x86_64</string>
<key>Base</key>
<string>__ZL22_vnode_check_signatureP5vnodeP5labeliP7cs_blobPjS5_ijPPcPm</string>
<key>Comment</key>
<string>Disable _csr_check() in _vnode_check_signature</string>
<key>Count</key>
<integer>1</integer>
<key>Enabled</key>
<false/>
<key>Find</key>
<data>AQAAAOgAAAAAhcB1</data>
<key>Identifier</key>
<string>com.apple.driver.AppleMobileFileIntegrity</string>
<key>Limit</key>
<integer>0</integer>
<key>Mask</key>
<data>//////8AAAAA////</data>
<key>MaxKernel</key>
<string></string>
<key>MinKernel</key>
<string>22.0.0</string>
<key>Replace</key>
<data>AQAAALgBAAAAhcB1</data>
<key>ReplaceMask</key>
<data></data>
<key>Skip</key>
<integer>0</integer>
</dict>
</array>
<key>Quirks</key>
<dict>
@@ -1681,12 +2005,8 @@
<array/>
<key>Security</key>
<dict>
<key>AllowNvramReset</key>
<true/>
<key>AllowSetDefault</key>
<true/>
<key>AllowToggleSip</key>
<false/>
<key>ApECID</key>
<integer>0</integer>
<key>AuthRestart</key>
@@ -1767,6 +2087,8 @@
<false/>
<key>TextMode</key>
<false/>
<key>FullNvramAccess</key>
<false/>
</dict>
<dict>
<key>Arguments</key>
@@ -1787,6 +2109,8 @@
<false/>
<key>TextMode</key>
<true/>
<key>FullNvramAccess</key>
<false/>
</dict>
</array>
</dict>
@@ -1840,8 +2164,6 @@
<key>FA4CE28D-B62F-4C99-9CC3-6815686E30F9</key>
<array/>
</dict>
<key>LegacyEnable</key>
<false/>
<key>LegacyOverwrite</key>
<false/>
<key>LegacySchema</key>
@@ -2072,6 +2394,8 @@
<false/>
<key>Arguments</key>
<string></string>
<key>LoadEarly</key>
<false/>
</dict>
<dict>
<key>Comment</key>
@@ -2082,6 +2406,8 @@
<false/>
<key>Arguments</key>
<string></string>
<key>LoadEarly</key>
<false/>
</dict>
<dict>
<key>Comment</key>
@@ -2092,6 +2418,8 @@
<false/>
<key>Arguments</key>
<string></string>
<key>LoadEarly</key>
<false/>
</dict>
<dict>
<key>Comment</key>
@@ -2102,6 +2430,8 @@
<false/>
<key>Arguments</key>
<string></string>
<key>LoadEarly</key>
<false/>
</dict>
<dict>
<key>Comment</key>
@@ -2112,6 +2442,8 @@
<false/>
<key>Arguments</key>
<string></string>
<key>LoadEarly</key>
<false/>
</dict>
<dict>
<key>Comment</key>
@@ -2122,6 +2454,8 @@
<false/>
<key>Arguments</key>
<string></string>
<key>LoadEarly</key>
<false/>
</dict>
<dict>
<key>Comment</key>
@@ -2132,6 +2466,20 @@
<false/>
<key>Arguments</key>
<string></string>
<key>LoadEarly</key>
<false/>
</dict>
<dict>
<key>Comment</key>
<string></string>
<key>Path</key>
<string>ResetNvramEntry.efi</string>
<key>Enabled</key>
<false/>
<key>Arguments</key>
<string></string>
<key>LoadEarly</key>
<false/>
</dict>
</array>
<key>Input</key>

Binary file not shown.

View File

@@ -583,6 +583,43 @@
<key>SHARED_SETTINGS_FOR_ALL_APPAREANCES</key>
<true/>
</dict>
<key>INSTALLATION TYPE</key>
<dict>
<key>HIERARCHIES</key>
<dict>
<key>INSTALLER</key>
<dict>
<key>LIST</key>
<array>
<dict>
<key>CHILDREN</key>
<array/>
<key>DESCRIPTION</key>
<array/>
<key>OPTIONS</key>
<dict>
<key>HIDDEN</key>
<false/>
<key>STATE</key>
<integer>1</integer>
</dict>
<key>PACKAGE_UUID</key>
<string>4312D78E-7981-41F2-A0E9-5C7E11AC61C5</string>
<key>TITLE</key>
<array/>
<key>TYPE</key>
<integer>0</integer>
<key>UUID</key>
<string>B3E23E4E-EF8D-4C21-933E-03C8187D415B</string>
</dict>
</array>
<key>REMOVED</key>
<dict/>
</dict>
</dict>
<key>MODE</key>
<integer>0</integer>
</dict>
<key>INSTALLATION_STEPS</key>
<array>
<dict>
@@ -645,7 +682,19 @@
<key>INTRODUCTION</key>
<dict>
<key>LOCALIZATIONS</key>
<array/>
<array>
<dict>
<key>LANGUAGE</key>
<string>English</string>
<key>VALUE</key>
<dict>
<key>PATH</key>
<string>intro.txt</string>
<key>PATH_TYPE</key>
<integer>1</integer>
</dict>
</dict>
</array>
</dict>
<key>LICENSE</key>
<dict>
@@ -659,6 +708,11 @@
<key>LOCALIZATIONS</key>
<array/>
</dict>
<key>SUMMARY</key>
<dict>
<key>LOCALIZATIONS</key>
<array/>
</dict>
<key>TITLE</key>
<dict>
<key>LOCALIZATIONS</key>
@@ -675,7 +729,65 @@
<key>PROJECT_REQUIREMENTS</key>
<dict>
<key>LIST</key>
<array/>
<array>
<dict>
<key>BEHAVIOR</key>
<integer>3</integer>
<key>DICTIONARY</key>
<dict>
<key>IC_REQUIREMENT_FILES_CONDITION</key>
<integer>1</integer>
<key>IC_REQUIREMENT_FILES_DISK_TYPE</key>
<integer>0</integer>
<key>IC_REQUIREMENT_FILES_LIST</key>
<array>
<string>/System/Library/CoreServices/OpenCore-Legacy-Patcher.plist</string>
</array>
<key>IC_REQUIREMENT_FILES_SELECTOR</key>
<integer>0</integer>
</dict>
<key>IC_REQUIREMENT_CHECK_TYPE</key>
<integer>1</integer>
<key>IDENTIFIER</key>
<string>fr.whitebox.Packages.requirement.files</string>
<key>MESSAGE</key>
<array>
<dict>
<key>LANGUAGE</key>
<string>English</string>
<key>VALUE</key>
<string>AutoPkg-Assets.pkg should never be used by end-users manually, please use the OpenCore-Patcher.app listed on Github</string>
</dict>
</array>
<key>NAME</key>
<string>Files</string>
<key>STATE</key>
<true/>
</dict>
<dict>
<key>BEHAVIOR</key>
<integer>3</integer>
<key>DICTIONARY</key>
<dict>
<key>IC_REQUIREMENT_OS_DISK_TYPE</key>
<integer>0</integer>
<key>IC_REQUIREMENT_OS_DISTRIBUTION_TYPE</key>
<integer>0</integer>
<key>IC_REQUIREMENT_OS_MINIMUM_VERSION</key>
<integer>110000</integer>
</dict>
<key>IC_REQUIREMENT_CHECK_TYPE</key>
<integer>1</integer>
<key>IDENTIFIER</key>
<string>fr.whitebox.Packages.requirement.os</string>
<key>MESSAGE</key>
<array/>
<key>NAME</key>
<string>Operating System</string>
<key>STATE</key>
<true/>
</dict>
</array>
<key>RESOURCES</key>
<array/>
<key>ROOT_VOLUME_ONLY</key>

View File

@@ -0,0 +1,7 @@
DO NOT RUN AUTOPKG-ASSETS MANUALLY!
THIS CAN BREAK YOUR SYSTEM'S INSTALL!
This package should only ever be invoked by the Patcher itself, never downloaded or run by the user. Download the OpenCore-Patcher.app on the Github Repository.
https://github.com/dortania/OpenCore-Legacy-Patcher/releases/

View File

@@ -1,40 +0,0 @@
diff --git a/BrcmPatchRAM/BlueToolFixup.cpp b/BrcmPatchRAM/BlueToolFixup.cpp
index a6e3c69..5e8a424 100644
--- a/BrcmPatchRAM/BlueToolFixup.cpp
+++ b/BrcmPatchRAM/BlueToolFixup.cpp
@@ -48,6 +48,27 @@ bool BlueToolFixup::start(IOService *provider) {
static const uint8_t kSkipUpdateFilePathOriginal[] = "/etc/bluetool/SkipBluetoothAutomaticFirmwareUpdate";
static const uint8_t kSkipUpdateFilePathPatched[] = "/System/Library/CoreServices/boot.efi";
+
+// Workaround 12.4 Beta 3+ bug where macOS may detect the Bluetooth chipset twice
+// Once as internal, and second as an external dongle:
+// 'ERROR -- Third Party Dongle has the same address as the internal module'
+// Applicable for BCM2046 and BCM2070 chipsets (BT2.1)
+static const uint8_t kSkipAddressCheckOriginal[] =
+{
+ 0x48, 0x89, 0xF3, // mov rbx, rsi
+ 0xE8, 0xE3, 0xF3, 0xFE, 0xFF, // call sub_1000c5bc6
+ 0x85, 0xC0, // test eax, eax
+ 0x74, 0x1D, // je loc_1000d6804
+};
+
+static const uint8_t kSkipAddressCheckPatched[] =
+{
+ 0x48, 0x89, 0xF3, // mov rbx, rsi
+ 0xE8, 0xE3, 0xF3, 0xFE, 0xFF, // call sub_1000c5bc6
+ 0x85, 0xC0, // test eax, eax
+ 0x72, 0x1D, // jb short loc_1000d6804
+};
+
static const uint8_t kVendorCheckOriginal[] =
{
0x81, 0xFA, // cmp edx
@@ -131,6 +152,7 @@ static void patched_cs_validate_page(vnode_t vp, memory_object_t pager, memory_o
}
else if (strcmp(path + dirLength, "bluetoothd") == 0) {
searchAndPatch(data, PAGE_SIZE, path, kVendorCheckOriginal, kVendorCheckPatched);
+ searchAndPatch(data, PAGE_SIZE, path, kSkipAddressCheckOriginal, kSkipAddressCheckPatched);
searchAndPatch(data, PAGE_SIZE, path, kBadChipsetCheckOriginal, kBadChipsetCheckPatched);
if (shouldPatchBoardId)
searchAndPatch(data, PAGE_SIZE, path, boardIdsWithUSBBluetooth[0], kBoardIdSize, BaseDeviceInfo::get().boardIdentifier, kBoardIdSize);

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -29,10 +29,24 @@ bad_drivers = [
"OpenNtfsDxe.efi",
"OpenPartitionDxe.efi",
"OpenUsbKbDxe.efi",
"OpenVariableRuntimeDxe.efi",
"Ps2KeyboardDxe.efi",
"Ps2MouseDxe.efi",
"ToggleSipEntry.efi",
"UsbMouseDxe.efi",
"XhciDxe.efi",
"Udp4Dxe.efi",
"TcpDxe.efi",
"SnpDxe.efi",
"MnpDxe.efi",
"Ip4Dxe.efi",
"HttpUtilitiesDxe.efi",
"HttpDxe.efi",
"HttpBootDxe.efi",
"DpcDxe.efi",
"DnsDxe.efi",
"Dhcp4Dxe.efi",
"ArpDxe.efi",
]
bad_tools = [
@@ -72,4 +86,4 @@ for version in build_types:
print("- Renaming folder to OpenCore-Build and zipping")
subprocess.run(f"mv ./OpenCore-{version} ./OpenCore-Build".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
subprocess.run(f"zip -r ./OpenCore-{version}.zip ./OpenCore-Build".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
subprocess.run(f"rm -rf ./OpenCore-Build".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
subprocess.run(f"rm -rf ./OpenCore-Build".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()

Binary file not shown.

BIN
payloads/Tools/ocvalidate-0.8.5 Executable file

Binary file not shown.

View File

@@ -2,6 +2,8 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AssociatedBundleIdentifiers</key>
<string>com.dortania.opencore-legacy-patcher</string>
<key>Label</key>
<string>com.dortania.opencore-legacy-patcher.auto-patch</string>
<key>ProgramArguments</key>

View File

@@ -1,4 +1,5 @@
requests
pyobjc
wxpython
pyinstaller
pyinstaller
packaging

111
resources/amfi_detect.py Normal file
View File

@@ -0,0 +1,111 @@
# Determine AppleMobileFileIntegrity's OS configuration
from resources import utilities
class amfi_configuration_detection:
def __init__(self):
self.AMFI_ALLOW_TASK_FOR_PID = False
self.AMFI_ALLOW_INVALID_SIGNATURE = False
self.AMFI_LV_ENFORCE_THIRD_PARTY = False
self.AMFI_ALLOW_EVERYTHING = False
self.SKIP_LIBRARY_VALIDATION = False
self.boot_args = []
self.oclp_args = []
self.init_nvram_dicts()
self.parse_amfi_bitmask()
self.parse_amfi_boot_args()
self.parse_oclp_configuration()
def init_nvram_dicts(self):
boot_args = utilities.get_nvram("boot-args", decode=True)
oclp_args = utilities.get_nvram("OCLP-Settings", "4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102", decode=True)
if boot_args:
self.boot_args = boot_args.split(" ")
if oclp_args:
self.oclp_args = oclp_args.split(" ")
def parse_amfi_bitmask(self):
# See data/amfi_data.py for more information
amfi_value = 0
for arg in self.boot_args:
if arg.startswith("amfi="):
try:
amfi_value = arg.split("=")
if len(amfi_value) != 2:
return
amfi_value = amfi_value[1]
if amfi_value.startswith("0x"):
amfi_value = int(amfi_value, 16)
else:
amfi_value = int(amfi_value)
except:
return
break
if amfi_value == 0:
return
if amfi_value & 0x1:
self.AMFI_ALLOW_TASK_FOR_PID = True
if amfi_value & 0x2:
self.AMFI_ALLOW_INVALID_SIGNATURE = True
if amfi_value & 0x4:
self.AMFI_LV_ENFORCE_THIRD_PARTY = True
if amfi_value & 0x80:
self.AMFI_ALLOW_EVERYTHING = True
self.SKIP_LIBRARY_VALIDATION = True
self.AMFI_ALLOW_INVALID_SIGNATURE = True
def parse_amfi_boot_args(self):
for arg in self.boot_args:
if arg.startswith("amfi_unrestrict_task_for_pid"):
value = arg.split("=")
if len(value) == 2:
if value[1] in ["0x1", "1"]:
self.AMFI_ALLOW_TASK_FOR_PID = True
elif arg.startswith("amfi_allow_any_signature"):
value = arg.split("=")
if len(value) == 2:
if value[1] in ["0x1", "1"]:
self.AMFI_ALLOW_INVALID_SIGNATURE = True
elif arg.startswith("amfi_get_out_of_my_way"):
value = arg.split("=")
if len(value) == 2:
if value[1] in ["0x1", "1"]:
self.AMFI_ALLOW_EVERYTHING = True
self.SKIP_LIBRARY_VALIDATION = True
self.AMFI_ALLOW_INVALID_SIGNATURE = True
def parse_oclp_configuration(self):
if "-allow_amfi" in self.oclp_args:
self.SKIP_LIBRARY_VALIDATION = True
def check_config(self, level):
# Levels:
# - 0: No checks
# - 1. Library Validation (Monterey and Older)
# - 2. Library Validation and Signature Checks (Ventura and Newer)
# - 3. Disable all AMFI checks
if level == 0:
return True
if level == 1:
return self.SKIP_LIBRARY_VALIDATION
if level == 2:
return bool(self.SKIP_LIBRARY_VALIDATION and self.AMFI_ALLOW_INVALID_SIGNATURE)
if level == 3:
return self.AMFI_ALLOW_EVERYTHING
return False

View File

@@ -17,7 +17,7 @@ class arguments:
if self.args.model:
print(f"- Using custom model: {self.args.model}")
settings.custom_model = self.args.model
defaults.generate_defaults.probe(settings.custom_model, False, settings)
defaults.generate_defaults(settings.custom_model, False, settings)
elif settings.computer.real_model not in model_array.SupportedSMBIOS and settings.allow_oc_everywhere is False:
print(
"""Your model is not supported by this patcher for running unsupported OSes!"
@@ -27,7 +27,7 @@ class arguments:
sys.exit(1)
else:
print(f"- Using detected model: {settings.computer.real_model}")
defaults.generate_defaults.probe(settings.custom_model, True, settings)
defaults.generate_defaults(settings.custom_model, True, settings)
if self.args.disk:
print(f"- Install Disk set: {self.args.disk}")
@@ -66,9 +66,6 @@ class arguments:
if self.args.nvme:
print("- Set NVMe Boot configuration")
settings.nvme_boot = True
# if self.args.disable_amfi:
# print("- Set Disable AMFI configuration")
# settings.amfi_status = False
if self.args.wlan:
print("- Set Wake on WLAN configuration")
settings.enable_wake_on_wlan = True

View File

@@ -148,7 +148,8 @@ class BuildOpenCore:
print("- Enabling VMM exemption patch")
self.get_item_by_kv(self.config["Kernel"]["Patch"], "Comment", "Reroute kern.hv_vmm_present patch (1)")["Enabled"] = True
self.get_item_by_kv(self.config["Kernel"]["Patch"], "Comment", "Reroute kern.hv_vmm_present patch (2)")["Enabled"] = True
self.get_item_by_kv(self.config["Kernel"]["Patch"], "Comment", "Reroute kern.hv_vmm_present patch (2) Legacy")["Enabled"] = True
self.get_item_by_kv(self.config["Kernel"]["Patch"], "Comment", "Reroute kern.hv_vmm_present patch (2) Ventura")["Enabled"] = True
# Patch HW_BID to OC_BID
# Set OC_BID to iMac18,1 Board ID (Mac-F60DEB81FF30ACF6)
@@ -206,12 +207,19 @@ class BuildOpenCore:
# Applicable for pre-Ivy Bridge models
if self.get_kext_by_bundle_path("CatalinaBCM5701Ethernet.kext")["Enabled"] is False:
self.enable_kext("CatalinaBCM5701Ethernet.kext", self.constants.bcm570_version, self.constants.bcm570_path)
elif isinstance(controller, device_probe.IntelEthernet) and controller.chipset == device_probe.IntelEthernet.Chipsets.AppleIntelI210Ethernet:
elif isinstance(controller, device_probe.IntelEthernet):
if smbios_data.smbios_dictionary[self.model]["CPU Generation"] < cpu_data.cpu_data.ivy_bridge.value:
# Apple's IOSkywalkFamily in DriverKit requires VT-D support
# Applicable for pre-Ivy Bridge models
if self.get_kext_by_bundle_path("CatalinaIntelI210Ethernet.kext")["Enabled"] is False:
self.enable_kext("CatalinaIntelI210Ethernet.kext", self.constants.i210_version, self.constants.i210_path)
if controller.chipset == device_probe.IntelEthernet.Chipsets.AppleIntelI210Ethernet:
if self.get_kext_by_bundle_path("CatalinaIntelI210Ethernet.kext")["Enabled"] is False:
self.enable_kext("CatalinaIntelI210Ethernet.kext", self.constants.i210_version, self.constants.i210_path)
elif controller.chipset == device_probe.IntelEthernet.Chipsets.AppleIntel8254XEthernet:
if self.get_kext_by_bundle_path("AppleIntel8254XEthernet.kext")["Enabled"] is False:
self.enable_kext("AppleIntel8254XEthernet.kext", self.constants.intel_8254x_version, self.constants.intel_8254x_path)
elif controller.chipset == device_probe.IntelEthernet.Chipsets.Intel82574L:
if self.get_kext_by_bundle_path("Intel82574L.kext")["Enabled"] is False:
self.enable_kext("Intel82574L.kext", self.constants.intel_82574l_version, self.constants.intel_82574l_path)
elif isinstance(controller, device_probe.NVIDIAEthernet):
if self.get_kext_by_bundle_path("nForceEthernet.kext")["Enabled"] is False:
self.enable_kext("nForceEthernet.kext", self.constants.nforce_version, self.constants.nforce_path)
@@ -228,6 +236,11 @@ class BuildOpenCore:
self.enable_kext("nForceEthernet.kext", self.constants.nforce_version, self.constants.nforce_path)
elif smbios_data.smbios_dictionary[self.model]["Ethernet Chipset"] == "Marvell":
self.enable_kext("MarvelYukonEthernet.kext", self.constants.marvel_version, self.constants.marvel_path)
elif smbios_data.smbios_dictionary[self.model]["Ethernet Chipset"] == "Intel 80003ES2LAN":
self.enable_kext("AppleIntel8254XEthernet.kext", self.constants.intel_8254x_version, self.constants.intel_8254x_path)
elif smbios_data.smbios_dictionary[self.model]["Ethernet Chipset"] == "Intel 82574L":
self.enable_kext("Intel82574L.kext", self.constants.intel_82574l_version, self.constants.intel_82574l_path)
# i3 Ivy Bridge iMacs don't support RDRAND
# However for prebuilt, assume they do
@@ -255,6 +268,7 @@ class BuildOpenCore:
# To verify the non-AVX kext is used, check IOService for 'com_apple_AppleFSCompression_NoAVXCompressionTypeZlib'
if smbios_data.smbios_dictionary[self.model]["CPU Generation"] < cpu_data.cpu_data.sandy_bridge.value:
self.enable_kext("NoAVXFSCompressionTypeZlib.kext", self.constants.apfs_zlib_version, self.constants.apfs_zlib_path)
self.enable_kext("NoAVXFSCompressionTypeZlib-AVXpel.kext", self.constants.apfs_zlib_v2_version, self.constants.apfs_zlib_v2_path)
if not self.constants.custom_model and (self.constants.allow_oc_everywhere is True or self.model in model_array.MacPro):
# Use Innie's same logic:
@@ -431,6 +445,28 @@ class BuildOpenCore:
self.get_item_by_kv(self.config["ACPI"]["Patch"], "Comment", "BUF0 to BUF1")["Enabled"] = True
shutil.copy(self.constants.windows_ssdt_path, self.constants.acpi_path)
# In macOS Ventura, Apple dropped AppleIntelCPUPowerManagement* kexts as they're unused on Haswell+
# However re-injecting the AICPUPM kexts is not enough, as Ventura changed how 'intel_cpupm_matching' is set:
# https://github.com/apple-oss-distributions/xnu/blob/e7776783b89a353188416a9a346c6cdb4928faad/osfmk/i386/pal_routines.h#L153-L163
#
# Specifically Apple has this logic for power management:
# - 0: Kext Based Power Management
# - 3: Kernel Based Power Management (For Haswell+ and Virtual Machines)
# - 4: Generic Virtual Machine Power Management
#
# Apple determines which to use by verifying whether 'plugin-type' exists in ACPI (with a value of 1 for Haswell, 2 for VMs)
# By default however, the plugin-type is not set, and thus the default value of '0' is used
# https://github.com/apple-oss-distributions/xnu/blob/e7776783b89a353188416a9a346c6cdb4928faad/osfmk/i386/pal_native.h#L62
#
# With Ventura, Apple no longer sets '0' as the default value, and instead sets it to '3'
# This breaks AppleIntelCPUPowerManagement.kext matching as it no longer matches against the correct criteria
#
# To resolve, we patched AICPUPM to attach regardless of the value of 'intel_cpupm_matching'
if smbios_data.smbios_dictionary[self.model]["CPU Generation"] <= cpu_data.cpu_data.ivy_bridge.value:
print("- Enabling legacy power management support")
self.enable_kext("AppleIntelCPUPowerManagement.kext", self.constants.aicpupm_version, self.constants.aicpupm_path)
self.enable_kext("AppleIntelCPUPowerManagementClient.kext", self.constants.aicpupm_version, self.constants.aicpupm_client_path)
# With macOS Monterey, Apple's SDXC driver requires the system to support VT-D
# However pre-Ivy Bridge don't support this feature
if smbios_data.smbios_dictionary[self.model]["CPU Generation"] <= cpu_data.cpu_data.sandy_bridge.value:
@@ -443,13 +479,17 @@ class BuildOpenCore:
usb_map_path.exists()
and (self.constants.allow_oc_everywhere is False or self.constants.allow_native_spoofs is True)
and self.model not in ["Xserve2,1", "Dortania1,1"]
and (self.model in model_array.Missing_USB_Map or self.constants.serial_settings in ["Moderate", "Advanced"])
and (
(self.model in model_array.Missing_USB_Map or self.model in model_array.Missing_USB_Map_Ventura)
or self.constants.serial_settings in ["Moderate", "Advanced"])
):
print("- Adding USB-Map.kext")
Path(self.constants.map_kext_folder).mkdir()
Path(self.constants.map_contents_folder).mkdir()
shutil.copy(usb_map_path, self.constants.map_contents_folder)
self.get_kext_by_bundle_path("USB-Map.kext")["Enabled"] = True
if self.model in model_array.Missing_USB_Map_Ventura and self.constants.serial_settings not in ["Moderate", "Advanced"]:
self.get_kext_by_bundle_path("USB-Map.kext")["MinKernel"] = "22.0.0"
if self.constants.allow_oc_everywhere is False:
if self.constants.serial_settings != "None":
@@ -531,7 +571,7 @@ class BuildOpenCore:
"use-layout-id": 1,
}
self.enable_kext("AppleALC.kext", self.constants.applealc_version, self.constants.applealc_path)
elif self.model.startswith("MacPro") or self.model.startswith("Xserve"):
elif (self.model.startswith("MacPro") and self.model != "MacPro6,1") or self.model.startswith("Xserve"):
# Used to enable Audio support for non-standard dGPUs
self.enable_kext("AppleALC.kext", self.constants.applealc_version, self.constants.applealc_path)
@@ -608,11 +648,11 @@ class BuildOpenCore:
if not self.get_kext_by_bundle_path("WhateverGreen.kext")["Enabled"] is True:
# Ensure WEG is enabled as we need if for Backlight patching
self.enable_kext("WhateverGreen.kext", self.constants.whatevergreen_version, self.constants.whatevergreen_path)
self.config["DeviceProperties"]["Add"][backlight_path] = {"shikigva": 128, "unfairgva": 1}
self.config["DeviceProperties"]["Add"][backlight_path] = {"shikigva": 128, "unfairgva": 1, "agdpmod": "pikera", "rebuild-device-tree": 1, "enable-gva-support": 1}
if self.constants.custom_model and self.model == "iMac11,2":
# iMac11,2 can have either PciRoot(0x0)/Pci(0x3,0x0)/Pci(0x0,0x0) or PciRoot(0x0)/Pci(0x1,0x0)/Pci(0x0,0x0)
# Set both properties when we cannot run hardware detection
self.config["DeviceProperties"]["Add"]["PciRoot(0x0)/Pci(0x3,0x0)/Pci(0x0,0x0)"] = {"shikigva": 128, "unfairgva": 1}
self.config["DeviceProperties"]["Add"]["PciRoot(0x0)/Pci(0x3,0x0)/Pci(0x0,0x0)"] = {"shikigva": 128, "unfairgva": 1, "agdpmod": "pikera", "rebuild-device-tree": 1, "enable-gva-support": 1}
if self.model in ["iMac12,1", "iMac12,2"]:
print("- Disabling unsupported iGPU")
self.config["DeviceProperties"]["Add"]["PciRoot(0x0)/Pci(0x2,0x0)"] = {
@@ -627,34 +667,25 @@ class BuildOpenCore:
if self.computer.dgpu.arch == device_probe.AMD.Archs.Legacy_GCN_7000:
print("- Adding Legacy GCN Power Gate Patches")
self.config["DeviceProperties"]["Add"][backlight_path].update({
"rebuild-device-tree": 1,
"CAIL,CAIL_DisableDrmdmaPowerGating": 1,
"CAIL,CAIL_DisableGfxCGPowerGating": 1,
"CAIL,CAIL_DisableUVDPowerGating": 1,
"CAIL,CAIL_DisableVCEPowerGating": 1,
"agdpmod": "pikera",
"enable-gva-support": 1
})
if self.constants.imac_model == "Legacy GCN":
print("- Adding Legacy GCN Power Gate Patches")
self.config["DeviceProperties"]["Add"][backlight_path].update({
"rebuild-device-tree": 1,
"CAIL,CAIL_DisableDrmdmaPowerGating": 1,
"CAIL,CAIL_DisableGfxCGPowerGating": 1,
"CAIL,CAIL_DisableUVDPowerGating": 1,
"CAIL,CAIL_DisableVCEPowerGating": 1,
"agdpmod": "pikera",
"enable-gva-support": 1
})
if self.model == "iMac11,2":
self.config["DeviceProperties"]["Add"]["PciRoot(0x0)/Pci(0x3,0x0)/Pci(0x0,0x0)"].update({
"rebuild-device-tree": 1,
"CAIL,CAIL_DisableDrmdmaPowerGating": 1,
"CAIL,CAIL_DisableGfxCGPowerGating": 1,
"CAIL,CAIL_DisableUVDPowerGating": 1,
"CAIL,CAIL_DisableVCEPowerGating": 1,
"agdpmod": "pikera",
"enable-gva-support": 1
})
# Check GPU Vendor
@@ -778,12 +809,24 @@ class BuildOpenCore:
# Add AMDGPUWakeHandler
self.enable_kext("AMDGPUWakeHandler.kext", self.constants.gpu_wake_version, self.constants.gpu_wake_path)
# Pre-Force Touch trackpad support for macOS Ventura
if smbios_data.smbios_dictionary[self.model]["CPU Generation"] < cpu_data.cpu_data.skylake.value:
if self.model.startswith("MacBook"):
# These units got force touch early, so ignore them
if self.model not in ["MacBookPro11,4", "MacBookPro11,5", "MacBook8,1"]:
self.enable_kext("AppleUSBTopCase.kext", self.constants.topcase_version, self.constants.top_case_path)
self.get_kext_by_bundle_path("AppleUSBTopCase.kext/Contents/PlugIns/AppleUSBTCButtons.kext")["Enabled"] = True
self.get_kext_by_bundle_path("AppleUSBTopCase.kext/Contents/PlugIns/AppleUSBTCKeyboard.kext")["Enabled"] = True
self.get_kext_by_bundle_path("AppleUSBTopCase.kext/Contents/PlugIns/AppleUSBTCKeyEventDriver.kext")["Enabled"] = True
self.enable_kext("AppleUSBMultitouch.kext", self.constants.multitouch_version, self.constants.multitouch_path)
# Bluetooth Detection
if not self.constants.custom_model and self.computer.bluetooth_chipset:
if self.computer.bluetooth_chipset in ["BRCM2070 Hub", "BRCM2046 Hub"]:
print("- Fixing Legacy Bluetooth for macOS Monterey")
self.enable_kext("BlueToolFixup.kext", self.constants.bluetool_version, self.constants.bluetool_path)
self.enable_kext("Bluetooth-Spoof.kext", self.constants.btspoof_version, self.constants.btspoof_path)
self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += " -btlfxallowanyaddr"
elif self.computer.bluetooth_chipset == "BRCM20702 Hub":
# BCM94331 can include either BCM2070 or BRCM20702 v1 Bluetooth chipsets
# Note Monterey only natively supports BRCM20702 v2 (found with BCM94360)
@@ -801,6 +844,7 @@ class BuildOpenCore:
print("- Fixing Legacy Bluetooth for macOS Monterey")
self.enable_kext("BlueToolFixup.kext", self.constants.bluetool_version, self.constants.bluetool_path)
if smbios_data.smbios_dictionary[self.model]["Bluetooth Model"] <= bluetooth_data.bluetooth_data.BRCM2070.value:
self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += " -btlfxallowanyaddr"
self.enable_kext("Bluetooth-Spoof.kext", self.constants.btspoof_version, self.constants.btspoof_path)
if self.constants.nvme_boot is True:
@@ -815,6 +859,7 @@ class BuildOpenCore:
self.get_efi_binary_by_path("OpenCanopy.efi", "UEFI", "Drivers")["Enabled"] = True
self.get_efi_binary_by_path("OpenRuntime.efi", "UEFI", "Drivers")["Enabled"] = True
self.get_efi_binary_by_path("OpenLinuxBoot.efi", "UEFI", "Drivers")["Enabled"] = True
self.get_efi_binary_by_path("ResetNvramEntry.efi", "UEFI", "Drivers")["Enabled"] = True
# Exfat check
if smbios_data.smbios_dictionary[self.model]["CPU Generation"] < cpu_data.cpu_data.sandy_bridge.value:
# Sandy Bridge and newer Macs natively support ExFat
@@ -879,6 +924,27 @@ class BuildOpenCore:
self.get_efi_binary_by_path("XhciDxe.efi", "UEFI", "Drivers")["Enabled"] = True
self.get_efi_binary_by_path("UsbBusDxe.efi", "UEFI", "Drivers")["Enabled"] = True
# Add UHCI/OHCI drivers
if not self.constants.custom_model:
if self.constants.computer.usb_controllers:
for controller in self.constants.computer.usb_controllers:
if isinstance(controller, device_probe.UHCIController) or isinstance(controller, device_probe.OHCIController):
print("- Adding UHCI/OHCI USB support")
shutil.copy(self.constants.apple_usb_11_injector_path, self.constants.kexts_path)
self.get_kext_by_bundle_path("USB1.1-Injector.kext/Contents/PlugIns/AppleUSBOHCI.kext")["Enabled"] = True
self.get_kext_by_bundle_path("USB1.1-Injector.kext/Contents/PlugIns/AppleUSBOHCIPCI.kext")["Enabled"] = True
self.get_kext_by_bundle_path("USB1.1-Injector.kext/Contents/PlugIns/AppleUSBUHCI.kext")["Enabled"] = True
self.get_kext_by_bundle_path("USB1.1-Injector.kext/Contents/PlugIns/AppleUSBUHCIPCI.kext")["Enabled"] = True
break
else:
if smbios_data.smbios_dictionary[self.model]["CPU Generation"] <= cpu_data.cpu_data.sandy_bridge.value:
print("- Adding UHCI/OHCI USB support")
shutil.copy(self.constants.apple_usb_11_injector_path, self.constants.kexts_path)
self.get_kext_by_bundle_path("USB1.1-Injector.kext/Contents/PlugIns/AppleUSBOHCI.kext")["Enabled"] = True
self.get_kext_by_bundle_path("USB1.1-Injector.kext/Contents/PlugIns/AppleUSBOHCIPCI.kext")["Enabled"] = True
self.get_kext_by_bundle_path("USB1.1-Injector.kext/Contents/PlugIns/AppleUSBUHCI.kext")["Enabled"] = True
self.get_kext_by_bundle_path("USB1.1-Injector.kext/Contents/PlugIns/AppleUSBUHCIPCI.kext")["Enabled"] = True
# ThirdPartDrives Check
if self.constants.allow_3rd_party_drives is True:
for drive in ["SATA 2.5", "SATA 3.5", "mSATA"]:
@@ -906,6 +972,12 @@ class BuildOpenCore:
# Namely due to Xserve2,1 being limited to 10.7, thus no hardware detection
self.enable_kext("AppleRAIDCard.kext", self.constants.apple_raid_version, self.constants.apple_raid_path)
# Force Output support PC VBIOS on Mac Pros
if self.constants.force_output_support is True:
print("- Forcing GOP Support")
self.config["UEFI"]["Quirks"]["ForgeUefiSupport"] = True
self.config["UEFI"]["Quirks"]["ReloadOptionRoms"] = True
# DEBUG Settings
if self.constants.verbose_debug is True:
print("- Enabling Verbose boot")
@@ -946,14 +1018,24 @@ class BuildOpenCore:
self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["csr-active-config"] = utilities.string_to_hex(self.constants.custom_sip_value.lstrip("0x"))
elif self.constants.sip_status is False:
print("- Set SIP to allow Root Volume patching")
self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["csr-active-config"] = binascii.unhexlify("02080000")
self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["csr-active-config"] = binascii.unhexlify("03080000")
# apfs.kext has an undocumented boot-arg that allows FileVault usage on broken APFS seals (-arv_allow_fv)
# This is however hidden behind kern.development, thus we patch _apfs_filevault_allowed to always return true
# Note this function was added in 11.3 (20E232, 20.4), older builds do not support this (ie. 11.2.3)
print("- Allowing FileVault on Root Patched systems")
self.get_item_by_kv(self.config["Kernel"]["Patch"], "Comment", "Force FileVault on Broken Seal")["Enabled"] = True
# Lets us check in sys_patch.py if config supports FileVault
self.config["NVRAM"]["Add"]["4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102"]["OCLP-Settings"] += " -allow_fv"
# if self.constants.amfi_status is False:
# print("- Disabling AMFI")
# self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += " amfi_get_out_of_my_way=1"
if self.constants.disable_cs_lv is True:
print("- Disabling Library Validation")
# In Ventura, LV patch broke. For now, add AMFI arg
# Before merging into mainline, this needs to be resolved
self.get_item_by_kv(self.config["Kernel"]["Patch"], "Comment", "Disable Library Validation Enforcement")["Enabled"] = True
self.get_item_by_kv(self.config["Kernel"]["Patch"], "Comment", "Disable _csr_check() in _vnode_check_signature")["Enabled"] = True
if self.constants.disable_amfi is True:
self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += " amfi=0x80"
self.config["NVRAM"]["Add"]["4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102"]["OCLP-Settings"] += " -allow_amfi"
# CSLVFixup simply patches out __RESTRICT and __restrict out of the Music.app Binary
# Ref: https://pewpewthespells.com/blog/blocking_code_injection_on_ios_and_os_x.html
@@ -964,7 +1046,8 @@ class BuildOpenCore:
if self.constants.force_vmm is True:
print("- Forcing VMM patchset to support OTA updates")
self.get_item_by_kv(self.config["Kernel"]["Patch"], "Comment", "Reroute kern.hv_vmm_present patch (1)")["Enabled"] = True
self.get_item_by_kv(self.config["Kernel"]["Patch"], "Comment", "Reroute kern.hv_vmm_present patch (2)")["Enabled"] = True
self.get_item_by_kv(self.config["Kernel"]["Patch"], "Comment", "Reroute kern.hv_vmm_present patch (2) Legacy")["Enabled"] = True
self.get_item_by_kv(self.config["Kernel"]["Patch"], "Comment", "Reroute kern.hv_vmm_present patch (2) Ventura")["Enabled"] = True
if self.constants.serial_settings in ["Moderate", "Advanced"]:
print("- Enabling USB Rename Patches")
self.get_item_by_kv(self.config["ACPI"]["Patch"], "Comment", "XHC1 to SHC1")["Enabled"] = True
@@ -1005,14 +1088,9 @@ class BuildOpenCore:
# Haswell and Broadwell MacBooks lock out the VMX bit if booting UEFI Windows
print("- Enabling VMX Bit for non-macOS OSes")
self.config["UEFI"]["Quirks"]["EnableVmx"] = True
if self.constants.allow_fv_root is True:
# apfs.kext has an undocumented boot-arg that allows FileVault usage on broken APFS seals (-arv_allow_fv)
# This is however hidden behind kern.development, thus we patch _apfs_filevault_allowed to always return true
# Note this function was added in 11.3 (20E232, 20.4), older builds do not support this (ie. 11.2.3)
print("- Allowing FileVault on Root Patched systems")
self.get_item_by_kv(self.config["Kernel"]["Patch"], "Identifier", "com.apple.filesystems.apfs")["Enabled"] = True
# Lets us check in sys_patch.py if config supports FileVault
self.config["NVRAM"]["Add"]["4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102"]["OCLP-Settings"] += " -allow_fv"
if smbios_data.smbios_dictionary[self.model]["CPU Generation"] <= cpu_data.cpu_data.ivy_bridge.value:
print("- Enabling Rosetta Cryptex support in Ventura")
self.enable_kext("CryptexFixup.kext", self.constants.cryptexfixup_version, self.constants.cryptexfixup_path)
if self.constants.disable_msr_power_ctl is True:
print("- Disabling Firmware Throttling")
if smbios_data.smbios_dictionary[self.model]["CPU Generation"] >= cpu_data.cpu_data.nehalem.value:
@@ -1203,7 +1281,7 @@ class BuildOpenCore:
if (
self.constants.allow_oc_everywhere is False
and self.model not in ["Xserve2,1", "Dortania1,1"]
and (self.model in model_array.Missing_USB_Map or self.constants.serial_settings in ["Moderate", "Advanced"])
and ((self.model in model_array.Missing_USB_Map or self.model in model_array.Missing_USB_Map_Ventura) or self.constants.serial_settings in ["Moderate", "Advanced"])
):
new_map_ls = Path(self.constants.map_contents_folder) / Path("Info.plist")
map_config = plistlib.load(Path(new_map_ls).open("rb"))
@@ -1308,28 +1386,19 @@ class BuildOpenCore:
def cleanup(self):
print("- Cleaning up files")
# Remove unused entries
# TODO: Consolidate into a single for loop
for entry in list(self.config["ACPI"]["Add"]):
if not entry["Enabled"]:
self.config["ACPI"]["Add"].remove(entry)
for entry in list(self.config["ACPI"]["Patch"]):
if not entry["Enabled"]:
self.config["ACPI"]["Patch"].remove(entry)
for entry in list(self.config["Booter"]["Patch"]):
if not entry["Enabled"]:
self.config["Booter"]["Patch"].remove(entry)
for entry in list(self.config["Kernel"]["Add"]):
if not entry["Enabled"]:
self.config["Kernel"]["Add"].remove(entry)
for entry in list(self.config["Kernel"]["Patch"]):
if not entry["Enabled"]:
self.config["Kernel"]["Patch"].remove(entry)
for entry in list(self.config["Misc"]["Tools"]):
if not entry["Enabled"]:
self.config["Misc"]["Tools"].remove(entry)
for entry in list(self.config["UEFI"]["Drivers"]):
if not entry["Enabled"]:
self.config["UEFI"]["Drivers"].remove(entry)
entries_to_clean = {
"ACPI": ["Add", "Delete", "Patch"],
"Booter": ["Patch"],
"Kernel": ["Add", "Block", "Force", "Patch"],
"Misc": ["Tools"],
"UEFI": ["Drivers"],
}
for entry in entries_to_clean:
for sub_entry in entries_to_clean[entry]:
for item in list(self.config[entry][sub_entry]):
if item["Enabled"] is False:
self.config[entry][sub_entry].remove(item)
plistlib.dump(self.config, Path(self.constants.plist_path).open("wb"), sort_keys=True)
for kext in self.constants.kexts_path.rglob("*.zip"):
@@ -1347,6 +1416,27 @@ class BuildOpenCore:
for i in self.constants.build_path.rglob("__MACOSX"):
shutil.rmtree(i)
# Remove unused plugins inside of kexts
# Following plugins are sometimes unused as there's different variants machines need
known_unused_plugins = [
"AirPortBrcm4331.kext",
"AirPortAtheros40.kext",
"AppleAirPortBrcm43224.kext",
"AirPortBrcm4360_Injector.kext",
"AirPortBrcmNIC_Injector.kext"
]
for kext in Path(self.constants.opencore_release_folder / Path("EFI/OC/Kexts")).glob("*.kext"):
for plugin in Path(kext / "Contents/PlugIns/").glob("*.kext"):
should_remove = True
for enabled_kexts in self.config["Kernel"]["Add"]:
if enabled_kexts["BundlePath"].endswith(plugin.name):
should_remove = False
break
if should_remove:
if plugin.name not in known_unused_plugins:
raise Exception(f" - Unknown plugin found: {plugin.name}")
shutil.rmtree(plugin)
Path(self.constants.opencore_zip_copied).unlink()
def sign_files(self):
@@ -1361,12 +1451,66 @@ class BuildOpenCore:
print("- Missing Command Line tools, skipping Vault for saftey reasons")
print("- Install via 'xcode-select --install' and rerun OCLP if you wish to vault this config")
def validate_pathing(self):
print("- Validating generated config")
if not Path(self.constants.opencore_release_folder / Path("EFI/OC/config.plist")):
print("- OpenCore config file missing!!!")
raise Exception("OpenCore config file missing")
config_plist = plistlib.load(Path(self.constants.opencore_release_folder / Path("EFI/OC/config.plist")).open("rb"))
for acpi in config_plist["ACPI"]["Add"]:
# print(f" - Validating {acpi['Path']}")
if not Path(self.constants.opencore_release_folder / Path("EFI/OC/ACPI") / Path(acpi["Path"])).exists():
print(f" - Missing ACPI Table: {acpi['Path']}")
raise Exception(f"Missing ACPI Table: {acpi['Path']}")
for kext in config_plist["Kernel"]["Add"]:
# print(f" - Validating {kext['BundlePath']}")
kext_path = Path(self.constants.opencore_release_folder / Path("EFI/OC/Kexts") / Path(kext["BundlePath"]))
kext_binary_path = Path(kext_path / Path(kext["ExecutablePath"]))
kext_plist_path = Path(kext_path / Path(kext["PlistPath"]))
if not kext_path.exists():
print(f"- Missing kext: {kext_path}")
raise Exception(f"Missing {kext_path}")
if not kext_binary_path.exists():
print(f"- Missing {kext['BundlePath']}'s binary: {kext_binary_path}")
raise Exception(f"Missing {kext_binary_path}")
if not kext_plist_path.exists():
print(f"- Missing {kext['BundlePath']}'s plist: {kext_plist_path}")
raise Exception(f"Missing {kext_plist_path}")
for tool in config_plist["Misc"]["Tools"]:
# print(f" - Validating {tool['Path']}")
if not Path(self.constants.opencore_release_folder / Path("EFI/OC/Tools") / Path(tool["Path"])).exists():
print(f" - Missing tool: {tool['Path']}")
raise Exception(f"Missing tool: {tool['Path']}")
for driver in config_plist["UEFI"]["Drivers"]:
# print(f" - Validating {driver['Path']}")
if not Path(self.constants.opencore_release_folder / Path("EFI/OC/Drivers") / Path(driver["Path"])).exists():
print(f" - Missing driver: {driver['Path']}")
raise Exception(f"Missing driver: {driver['Path']}")
# Validating local files
# Validate Tools
for tool_files in Path(self.constants.opencore_release_folder / Path("EFI/OC/Tools")).glob("*"):
if tool_files.name not in [x["Path"] for x in config_plist["Misc"]["Tools"]]:
print(f" - Missing tool from config: {tool_files.name}")
raise Exception(f"Missing tool from config: {tool_files.name}")
for driver_file in Path(self.constants.opencore_release_folder / Path("EFI/OC/Drivers")).glob("*"):
if driver_file.name not in [x["Path"] for x in config_plist["UEFI"]["Drivers"]]:
print(f"- Found extra driver: {driver_file.name}")
raise Exception(f"Found extra driver: {driver_file.name}")
def build_opencore(self):
self.build_efi()
if self.constants.allow_oc_everywhere is False or self.constants.allow_native_spoofs is True or (self.constants.custom_serial_number != "" and self.constants.custom_board_serial_number != ""):
self.set_smbios()
self.cleanup()
self.sign_files()
self.validate_pathing()
print("")
print(f"Your OpenCore EFI for {self.model} has been built at:")
print(f" {self.constants.opencore_release_folder}")

View File

@@ -173,7 +173,7 @@ Note: For security reasons, OpenShell will be disabled when Vault is set.
print(
f"""SIP is used to ensure proper security measures are set,
however to patch the root volume this must be lowered partially.
Only disable is absolutely necessary. SIP value = 0x802
Only disable is absolutely necessary. SIP value = 0x803
Valid options:
@@ -222,24 +222,6 @@ Q. Return to previous menu
else:
self.change_sbm()
def set_amfi(self):
utilities.cls()
utilities.header(["Set AMFI"])
print(
"""Required for Root Patching non-Metal GPUs
in macOS Big Sur. Without this, will receive kernel panic once
Patcher finishes installing legacy acceleration patches.
"""
)
change_menu = input("Disable AMFI(y/n/q): ")
if change_menu in {"y", "Y", "yes", "Yes"}:
self.constants.amfi_status = False
elif change_menu in {"n", "N", "no", "No"}:
self.constants.amfi_status = True
elif change_menu in {"q", "Q", "Quit", "quit"}:
print("Returning to previous menu")
else:
self.set_amfi()
def bootstrap_setting(self):
utilities.cls()
@@ -819,7 +801,7 @@ Note: This option should only be flipped under the following circumstances:
print(
"""
By default OCLP will use the SIP value of 0x00 as the enabled and
0xA03 for machines that require root patching. For users who wish
0x803 for machines that require root patching. For users who wish
to flip additional bits in SIP may use this option.
To disable SIP outright, set it to 0xFEF
@@ -983,7 +965,7 @@ system_profiler SPHardwareDataType | grep 'Model Identifier'
print("\n".join(model_array.SupportedSMBIOS))
input("\nPress [ENTER] to continue")
else:
defaults.generate_defaults.probe(self.constants.custom_model, False, self.constants)
defaults.generate_defaults(self.constants.custom_model, False, self.constants)
def PatchVolume(self):
utilities.cls()
@@ -1077,10 +1059,6 @@ system_profiler SPHardwareDataType | grep 'Model Identifier'
title = ["Adjust Security Settings"]
menu = tui_helpers.TUIMenu(title, "Please select an option: ", auto_number=True, top_level=True)
options = [
# [
# f"Set Apple Mobile File Integrity (AMFI):\tCurrently {self.constants.amfi_status}",
# MenuOptions(self.constants.custom_model or self.constants.computer.real_model, self.constants).set_amfi,
# ],
[
f"Set System Integrity Protection (SIP):\tCurrently {self.constants.custom_sip_value or self.constants.sip_status}",
MenuOptions(self.constants.custom_model or self.constants.computer.real_model, self.constants).change_sip,

View File

@@ -12,8 +12,8 @@ from data import os_data
class Constants:
def __init__(self):
# Patcher Versioning
self.patcher_version = "0.4.12" # OpenCore-Legacy-Patcher
self.patcher_support_pkg_version = "0.5.4" # PatcherSupportPkg
self.patcher_version = "0.5.0" # OpenCore-Legacy-Patcher
self.patcher_support_pkg_version = "0.7.1" # PatcherSupportPkg
self.url_patcher_support_pkg = "https://github.com/dortania/PatcherSupportPkg/releases/download/"
self.nightly_url_patcher_support_pkg = "https://nightly.link/dortania/PatcherSupportPkg/workflows/build/master/"
self.discord_link = "https://discord.gg/rqdPgH8xSN"
@@ -26,25 +26,26 @@ class Constants:
# OpenCore Versioning
# https://github.com/acidanthera/OpenCorePkg
self.opencore_commit = "30798fb - 04-18-2022"
self.opencore_version = "0.8.0"
self.opencore_commit = "c14b2ab - 10-04-2022"
self.opencore_version = "0.8.5"
# Kext Versioning
## Acidanthera
## https://github.com/acidanthera
self.lilu_version = "1.6.0" # Lilu
self.lilu_version = "1.6.2" # Lilu
self.whatevergreen_version = "1.5.8" # WhateverGreen
self.airportbcrmfixup_version = "2.1.3" # 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.featureunlock_version = "1.0.8" # FeatureUnlock
self.featureunlock_version = "1.0.9" # FeatureUnlock
self.debugenhancer_version = "1.0.4" # DebugEnhancer
self.cpufriend_version = "1.2.5" # CPUFriend
self.bluetool_version = "2.6.2" # BlueToolFixup (BrcmPatchRAM)
self.bluetool_version = "2.6.4" # BlueToolFixup (BrcmPatchRAM)
self.cslvfixup_version = "2.6.1" # CSLVFixup
self.autopkg_version = "1.0.0" # AutoPkgInstaller
self.autopkg_version = "1.0.1" # AutoPkgInstaller
self.cryptexfixup_version = "1.0.0" # CryptexFixup
## Apple
## https://www.apple.com
@@ -56,8 +57,13 @@ class Constants:
self.apple_isight_version = "1.0.0" # AppleiSight
self.apple_raid_version = "1.0.0" # AppleRAIDCard
self.apfs_zlib_version = "12.3.1" # NoAVXFSCompressionTypeZlib
self.apfs_zlib_v2_version = "12.6" # NoAVXFSCompressionTypeZlib (patched with AVXpel)
self.multitouch_version = "1.0.0" # AppleUSBMultitouch
self.topcase_version = "1.0.0" # AppleUSBTopCase
self.intel_82574l_version = "1.0.0" # Intel82574L
self.intel_8254x_version = "1.0.0" # AppleIntel8254XEthernet
self.apple_usb_11_injector = "1.0.0" # AppleUSBUHCI/OHCI
self.aicpupm_version = "1.0.0" # AppleIntelCPUPowerManagement/Client
## Apple - Dortania Modified
self.bcm570_version = "1.0.2" # CatalinaBCM5701Ethernet
@@ -77,8 +83,8 @@ class Constants:
## Syncretic
## https://forums.macrumors.com/members/syncretic.1173816/
## https://github.com/reenigneorcim/latebloom
self.mousse_version = "0.95" # MouSSE
self.telemetrap_version = "1.0.0" # telemetrap
self.mousse_version = "0.95-Dortania" # MouSSE
self.telemetrap_version = "1.0.0" # telemetrap
## cdf
## https://github.com/cdf/Innie
@@ -109,6 +115,7 @@ class Constants:
self.wxpython_variant = False # Determine if using wxPython variant
self.unpack_thread = None # Determine if unpack thread finished
self.cli_mode = False # Determine if running in CLI mode
self.should_nuke_kdks = True # Determine if KDKs should be nuked if unused in /L*/D*/KDKs
## Hardware
self.computer: device_probe.Computer = None # type: ignore
@@ -143,18 +150,18 @@ class Constants:
## Security Settings
self.apecid_support = False # ApECID
self.amfi_status = True # Apple Mobile File Integrity
self.sip_status = True # System Integrity Protection
self.secure_status = False # Secure Boot Model
self.vault = False # EFI Vault
self.disable_cs_lv = False # Disable Library validation
self.disable_amfi = False # Disable AMFI
## OS Settings
self.os_support = 12.0
self.detected_os = 0 # Major Kernel Version
self.detected_os_minor = 0 # Minor Kernel Version
self.detected_os_build = "" # OS Build
self.allow_fv_root = False # Allow FileVault on broken sealed snapshots
self.detected_os = 0 # Major Kernel Version
self.detected_os_minor = 0 # Minor Kernel Version
self.detected_os_build = "" # OS Build
self.detected_os_version = "" # OS Version
## Boot Volume Settings
self.firewire_boot = False # Allow macOS FireWire Boot
@@ -162,12 +169,13 @@ class Constants:
self.xhci_boot = False
## Graphics Settings
self.metal_build = False # Set MXM Build support
self.imac_vendor = "None" # Set MXM GPU vendor
self.imac_model = "" # Set MXM GPU model
self.drm_support = False # Set iMac14,x DRM support
self.allow_ts2_accel = True # Set TeraScale 2 Acceleration support
self.force_nv_web = False # Force Nvidia Web Drivers on Tesla and Kepler
self.metal_build = False # Set MXM Build support
self.imac_vendor = "None" # Set MXM GPU vendor
self.imac_model = "" # Set MXM GPU model
self.drm_support = False # Set iMac14,x DRM support
self.allow_ts2_accel = True # Set TeraScale 2 Acceleration support
self.force_nv_web = False # Force Nvidia Web Drivers on Tesla and Kepler
self.force_output_support = False # Force Output support for Mac Pros with PC VBIOS
## Miscellaneous
self.disallow_cpufriend = False # Disable CPUFriend
@@ -303,6 +311,26 @@ class Constants:
def nforce_path(self):
return self.payload_kexts_path / Path(f"Ethernet/nForceEthernet-v{self.nforce_version}.zip")
@property
def intel_82574l_path(self):
return self.payload_kexts_path / Path(f"Ethernet/Intel82574L-v{self.intel_82574l_version}.zip")
@property
def intel_8254x_path(self):
return self.payload_kexts_path / Path(f"Ethernet/AppleIntel8254XEthernet-v{self.intel_8254x_version}.zip")
@property
def apple_usb_11_injector_path(self):
return self.payload_kexts_path / Path(f"USB/USB1.1-Injector-v{self.apple_usb_11_injector}.zip")
@property
def aicpupm_path(self):
return self.payload_kexts_path / Path(f"Misc/AppleIntelCPUPowerManagement-v{self.aicpupm_version}.zip")
@property
def aicpupm_client_path(self):
return self.payload_kexts_path / Path(f"Misc/AppleIntelCPUPowerManagementClient-v{self.aicpupm_version}.zip")
@property
def mce_path(self):
return self.payload_kexts_path / Path(f"Misc/AppleMCEReporterDisabler-v{self.mce_version}.zip")
@@ -315,6 +343,10 @@ class Constants:
def apfs_zlib_path(self):
return self.payload_kexts_path / Path(f"Misc/NoAVXFSCompressionTypeZlib-v{self.apfs_zlib_version}.zip")
@property
def apfs_zlib_v2_path(self):
return self.payload_kexts_path / Path(f"Misc/NoAVXFSCompressionTypeZlib-AVXpel-v{self.apfs_zlib_v2_version}.zip")
@property
def multitouch_path(self):
return self.payload_kexts_path / Path(f"Misc/AppleUSBMultitouch-v{self.multitouch_version}.zip")
@@ -391,6 +423,10 @@ class Constants:
def autopkg_path(self):
return self.payload_kexts_path / Path(f"Acidanthera/AutoPkgInstaller-v{self.autopkg_version}-{self.kext_variant}.zip")
@property
def cryptexfixup_path(self):
return self.payload_kexts_path / Path(f"Acidanthera/CryptexFixup-v{self.cryptexfixup_version}-{self.kext_variant}.zip")
@property
def innie_path(self):
return self.payload_kexts_path / Path(f"Misc/Innie-v{self.innie_version}.zip")
@@ -575,6 +611,10 @@ class Constants:
def payload_local_binaries_root_path_zip(self):
return self.payload_path / Path("Universal-Binaries.zip")
@property
def kdk_download_path(self):
return self.payload_path / Path("KDK.dmg")
sbm_values = [
"j137ap", # iMacPro1,1

View File

@@ -1,187 +1,246 @@
# Generate Default Data
from resources import utilities, device_probe, generate_smbios, global_settings
from data import model_array, smbios_data, cpu_data, os_data
from data import smbios_data, cpu_data, os_data
import subprocess
class generate_defaults:
def probe(model, host_is_target, settings):
# Generate Default Data
# Takes in Settings data set, and returns updated Settings
settings.sip_status = True
settings.secure_status = False # Default false for Monterey
settings.amfi_status = True
settings.custom_serial_number = ""
settings.custom_board_serial_number = ""
if host_is_target:
settings.custom_serial_number = utilities.get_nvram("OCLP-Spoofed-SN", "4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102", decode=True)
settings.custom_board_serial_number = utilities.get_nvram("OCLP-Spoofed-MLB", "4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102", decode=True)
if settings.custom_serial_number is None or settings.custom_board_serial_number is None:
# If either variables are missing, we assume something is wrong with the spoofed variables and reset
settings.custom_serial_number = ""
settings.custom_board_serial_number = ""
def __init__(self, model, host_is_target, settings):
self.model = model
self.constants = settings
self.host_is_target = host_is_target
if settings.computer.usb_controllers:
try:
if smbios_data.smbios_dictionary[model]["CPU Generation"] < cpu_data.cpu_data.ivy_bridge.value:
# Reset Variables
self.constants.sip_status = True
self.constants.secure_status = False
self.constants.disable_cs_lv = False
self.constants.disable_amfi = False
self.constants.custom_serial_number = ""
self.constants.custom_board_serial_number = ""
self.general_probe()
self.nvram_probe()
self.gpu_probe()
self.networking_probe()
self.misc_hardwares_probe()
self.smbios_probe()
def general_probe(self):
if "Book" in self.model:
self.constants.set_content_caching = False
else:
self.constants.set_content_caching = True
if self.model in ["MacBookPro8,2", "MacBookPro8,3"]:
# Users disabling TS2 most likely have a faulty dGPU
# users can override this in settings
ts2_status = global_settings.global_settings().read_property("MacBookPro_TeraScale_2_Accel")
if ts2_status is True:
self.constants.allow_ts2_accel = True
else:
global_settings.global_settings().write_property("MacBookPro_TeraScale_2_Accel", False)
self.constants.allow_ts2_accel = False
if self.model in smbios_data.smbios_dictionary:
if smbios_data.smbios_dictionary[self.model]["CPU Generation"] < cpu_data.cpu_data.ivy_bridge.value and self.model != "MacPro5,1":
# Sidecar and AirPlay to Mac only blacklist Ivy and newer (as well as MacPro5,1)
# Avoid extra patching without benefit
self.constants.fu_arguments = " -disable_sidecar_mac"
else:
self.constants.fu_arguments = None
if smbios_data.smbios_dictionary[self.model]["CPU Generation"] >= cpu_data.cpu_data.skylake.value:
# On 2016-2017 MacBook Pros, 15" devices used a stock Samsung SSD with IONVMeController
# Technically this should be patched based on NVMeFix.kext logic,
# however Apple deemed the SSD unsupported for enhanced performance
# In addition, some upgraded NVMe drives still have issues with enhanced power management
# Safest to disable by default, allow user to configure afterwards
self.constants.allow_nvme_fixing = False
else:
self.constants.allow_nvme_fixing = True
# Check if running in RecoveryOS
self.constants.recovery_status = utilities.check_recovery()
if global_settings.global_settings().read_property("Force_Web_Drivers") is True:
self.constants.force_nv_web = True
result = global_settings.global_settings().read_property("ShouldNukeKDKs")
if result is False:
self.constants.should_nuke_kdks = False
def smbios_probe(self):
if not self.host_is_target:
if self.model in ["MacPro4,1", "MacPro5,1"]:
# Allow H.265 on AMD
# Assume 2009+ machines have Polaris on pre-builts (internal testing)
# Hardware Detection will never hit this
self.constants.serial_settings = "Minimal"
# Check if model uses T2 SMBIOS, if so see if it needs root patching (determined earlier on via SIP variable)
# If not, allow SecureBootModel usage, otherwise force VMM patching
# Needed for macOS Monterey to allow OTA updates
try:
spoof_model = generate_smbios.set_smbios_model_spoof(self.model)
except:
# Native Macs (mainly M1s) will error out as they don't know what SMBIOS to spoof to
# As we don't spoof on native models, we can safely ignore this
spoof_model = self.model
if spoof_model in smbios_data.smbios_dictionary:
if smbios_data.smbios_dictionary[spoof_model]["SecureBootModel"] is not None:
if self.constants.sip_status is False:
# Force VMM as root patching breaks .im4m signature
self.constants.secure_status = False
self.constants.force_vmm = True
else:
# Allow SecureBootModel
self.constants.secure_status = True
self.constants.force_vmm = False
def nvram_probe(self):
if not self.host_is_target:
return
if "-v" in (utilities.get_nvram("boot-args") or ""):
self.constants.verbose_debug = True
self.constants.custom_serial_number = utilities.get_nvram("OCLP-Spoofed-SN", "4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102", decode=True)
self.constants.custom_board_serial_number = utilities.get_nvram("OCLP-Spoofed-MLB", "4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102", decode=True)
if self.constants.custom_serial_number is None or self.constants.custom_board_serial_number is None:
# If either variables are missing, we assume something is wrong with the spoofed variables and reset
self.constants.custom_serial_number = ""
self.constants.custom_board_serial_number = ""
custom_cpu_model_value = utilities.get_nvram("revcpuname", "4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102", decode=True)
if custom_cpu_model_value is not None:
# TODO: Fix to not use two separate variables
self.constants.custom_cpu_model = 1
self.constants.custom_cpu_model_value = custom_cpu_model_value.split("%00")[0]
def networking_probe(self):
if (
isinstance(self.constants.computer.wifi, device_probe.Broadcom) and
self.constants.computer.wifi.chipset in [device_probe.Broadcom.Chipsets.AirPortBrcm4331, device_probe.Broadcom.Chipsets.AirPortBrcm43224]
) or (
isinstance(self.constants.computer.wifi, device_probe.Atheros) and
self.constants.computer.wifi.chipset == device_probe.Atheros.Chipsets.AirPortAtheros40
):
# 12.0: Legacy Wireless chipsets require root patching
self.constants.sip_status = False
self.constants.secure_status = False
def misc_hardwares_probe(self):
if self.host_is_target:
if self.constants.computer.usb_controllers:
if self.model in smbios_data.smbios_dictionary:
if smbios_data.smbios_dictionary[self.model]["CPU Generation"] < cpu_data.cpu_data.ivy_bridge.value:
# Pre-Ivy do not natively support XHCI boot support
# If we detect XHCI on older model, enable
for controller in settings.computer.usb_controllers:
for controller in self.constants.computer.usb_controllers:
if isinstance(controller, device_probe.XHCIController):
settings.xhci_boot = True
self.constants.xhci_boot = True
break
except KeyError:
pass
if utilities.check_metal_support(device_probe, settings.computer) is False:
settings.disable_cs_lv = True
settings.secure_status = False
settings.sip_status = False
settings.allow_fv_root = True
settings.host_is_non_metal = True
# If a Mac is non-Metal based, Beta Blur is highly recommended
if settings.detected_os >= os_data.os_data.big_sur:
for arg in ["Moraea_BlurBeta"]:
# If user explicitly set the blur, don't override
arg_result = subprocess.run(["defaults", "read", "-g", arg], stdout=subprocess.PIPE).stdout.decode("utf-8").strip()
if arg_result not in ["true", "1", "false", "0"]:
subprocess.run(["defaults", "write", "-g", arg, "-bool", "TRUE"])
if settings.computer.gpus:
for gpu in settings.computer.gpus:
if gpu.arch == device_probe.NVIDIA.Archs.Kepler:
# 12.0 (B7+): Kepler are now unsupported
settings.sip_status = False
settings.amfi_status = True
settings.allow_fv_root = True # Allow FileVault on broken seal
break
elif gpu.arch in [device_probe.NVIDIA.Archs.Fermi, device_probe.NVIDIA.Archs.Maxwell, device_probe.NVIDIA.Archs.Pascal]:
settings.custom_sip_value = "0xA03"
break
if (
isinstance(settings.computer.wifi, device_probe.Broadcom)
and settings.computer.wifi.chipset in [device_probe.Broadcom.Chipsets.AirPortBrcm4331, device_probe.Broadcom.Chipsets.AirPortBrcm43224]
) or (isinstance(settings.computer.wifi, device_probe.Atheros) and settings.computer.wifi.chipset == device_probe.Atheros.Chipsets.AirPortAtheros40):
# 12.0: Legacy Wireless chipsets require root patching
settings.sip_status = False
settings.allow_fv_root = True # Allow FileVault on broken seal
def gpu_probe(self):
gpu_dict = []
if self.host_is_target:
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"]
if settings.computer.gpus:
for gpu in settings.computer.gpus:
if gpu.arch in [
for gpu in gpu_dict:
if self.host_is_target:
if gpu.class_code:
if gpu.class_code == 0xFFFFFFFF:
continue
gpu = gpu.arch
# Legacy Metal Logic
if gpu in [
device_probe.Intel.Archs.Ivy_Bridge,
device_probe.Intel.Archs.Haswell,
device_probe.Intel.Archs.Broadwell,
device_probe.Intel.Archs.Skylake,
device_probe.NVIDIA.Archs.Kepler,
device_probe.AMD.Archs.Legacy_GCN_7000,
device_probe.AMD.Archs.Legacy_GCN_8000,
device_probe.AMD.Archs.Legacy_GCN_9000,
device_probe.AMD.Archs.Polaris,
device_probe.AMD.Archs.Vega,
device_probe.AMD.Archs.Navi,
]:
if gpu in [
device_probe.AMD.Archs.Legacy_GCN_7000,
device_probe.AMD.Archs.Legacy_GCN_8000,
device_probe.AMD.Archs.Legacy_GCN_9000,
device_probe.AMD.Archs.Polaris,
device_probe.AMD.Archs.Vega,
device_probe.AMD.Archs.Navi,
]:
# Allow H.265 on AMD
try:
smbios_data.smbios_dictionary[model]["Socketed GPUs"]
settings.serial_settings = "Minimal"
except KeyError:
pass
break
elif model in ["MacPro4,1", "MacPro5,1"]:
# Allow H.265 on AMD
# Assume 2009+ machines have Polaris on pre-builts (internal testing)
# Hardware Detection will never hit this
settings.serial_settings = "Minimal"
elif model in model_array.LegacyGPU:
settings.disable_cs_lv = True
]:
if gpu == device_probe.AMD.Archs.Legacy_GCN_7000:
# Check if we're running in Rosetta
if self.host_is_target:
if self.constants.computer.rosetta_active is True:
continue
if model in model_array.LegacyGPU:
if host_is_target and utilities.check_metal_support(device_probe, settings.computer) is True:
# Building on device and we have a native, supported GPU
if settings.computer.dgpu and settings.computer.dgpu.arch == device_probe.NVIDIA.Archs.Kepler:
settings.sip_status = False
# settings.secure_status = True # Monterey
settings.allow_fv_root = True # Allow FileVault on broken seal
else:
settings.sip_status = False # Unsigned kexts
settings.secure_status = False # Root volume modified
settings.amfi_status = False # Unsigned binaries
settings.allow_fv_root = True # Allow FileVault on broken seal
if model in model_array.ModernGPU:
# Systems with Ivy or Kepler GPUs, Monterey requires root patching for accel
settings.sip_status = False # Unsigned kexts
settings.secure_status = False # Modified root volume
settings.allow_fv_root = True # Allow FileVault on broken seal
# settings.amfi_status = True # Signed bundles, Don't need to explicitly set currently
# Allow H.265 on AMD
if self.model in smbios_data.smbios_dictionary:
if "Socketed GPUs" in smbios_data.smbios_dictionary[self.model]:
self.constants.serial_settings = "Minimal"
if "Book" in model:
settings.set_content_caching = False
else:
settings.set_content_caching = True
# See if system can use the native AMD stack in Ventura
if gpu in [
device_probe.AMD.Archs.Polaris,
device_probe.AMD.Archs.Vega,
device_probe.AMD.Archs.Navi,
]:
if self.host_is_target:
if "AVX2" in self.constants.computer.cpu.leafs:
continue
else:
if self.model in smbios_data.smbios_dictionary:
if smbios_data.smbios_dictionary[self.model]["CPU Generation"] >= cpu_data.cpu_data.haswell.value:
continue
custom_cpu_model_value = utilities.get_nvram("revcpuname", "4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102", decode=True)
if custom_cpu_model_value is not None:
# TODO: Fix to not use two separate variables
settings.custom_cpu_model = 1
settings.custom_cpu_model_value = custom_cpu_model_value.split("%00")[0]
self.constants.sip_status = False
self.constants.secure_status = False
self.constants.disable_cs_lv = True
if "-v" in (utilities.get_nvram("boot-args") or ""):
settings.verbose_debug = True
# Non-Metal Logic
elif gpu in [
device_probe.Intel.Archs.Iron_Lake,
device_probe.Intel.Archs.Sandy_Bridge,
device_probe.NVIDIA.Archs.Tesla,
device_probe.NVIDIA.Archs.Fermi,
device_probe.NVIDIA.Archs.Maxwell,
device_probe.NVIDIA.Archs.Pascal,
device_probe.AMD.Archs.TeraScale_1,
device_probe.AMD.Archs.TeraScale_2,
]:
self.constants.sip_status = False
self.constants.secure_status = False
self.constants.disable_cs_lv = True
if os_data.os_data.ventura in self.constants.legacy_accel_support:
# Only disable AMFI if we officially support Ventura
self.constants.disable_amfi = True
if utilities.amfi_status() is False:
settings.amfi_status = False
if model in ["MacBookPro8,2", "MacBookPro8,3"]:
# Users disabling TS2 most likely have a faulty dGPU
# users can override this in settings
ts2_status = global_settings.global_settings().read_property("MacBookPro_TeraScale_2_Accel")
if ts2_status is True:
settings.allow_ts2_accel = True
else:
global_settings.global_settings().write_property("MacBookPro_TeraScale_2_Accel", False)
settings.allow_ts2_accel = False
try:
if smbios_data.smbios_dictionary[model]["CPU Generation"] < cpu_data.cpu_data.ivy_bridge.value and model != "MacPro5,1":
# Sidecar and AirPlay to Mac only blacklist Ivy and newer (as well as MacPro5,1)
# Avoid extra patching without benefit
settings.fu_arguments = " -disable_sidecar_mac"
else:
settings.fu_arguments = None
if smbios_data.smbios_dictionary[model]["CPU Generation"] >= cpu_data.cpu_data.skylake.value:
# On 2016-2017 MacBook Pros, 15" devices used a stock Samsung SSD with IONVMeController
# Technically this should be patched based on NVMeFix.kext logic,
# however Apple deemed the SSD unsupported for enhanced performance
# In addition, some upgraded NVMe drives still have issues with enhanced power management
# Safest to disable by default, allow user to configure afterwards
settings.allow_nvme_fixing = False
else:
settings.allow_nvme_fixing = True
except KeyError:
pass
# Check if running in RecoveryOS
settings.recovery_status = utilities.check_recovery()
# Check if model uses T2 SMBIOS, if so see if it needs root patching (determined earlier on via SIP variable)
# If not, allow SecureBootModel usage, otherwise force VMM patching
# Needed for macOS Monterey to allow OTA updates
try:
spoof_model = generate_smbios.set_smbios_model_spoof(model)
except:
# Native Macs (mainly M1s) will error out as they don't know what SMBIOS to spoof to
# As we don't spoof on native models, we can safely ignore this
spoof_model = model
try:
if smbios_data.smbios_dictionary[spoof_model]["SecureBootModel"] is not None:
if settings.sip_status is False:
# Force VMM as root patching breaks .im4m signature
settings.secure_status = False
settings.force_vmm = True
else:
# Allow SecureBootModel
settings.secure_status = True
settings.force_vmm = False
except KeyError:
pass
nv_web_status = global_settings.global_settings().read_property("Force_Web_Drivers")
if nv_web_status is True:
settings.force_nv_web = True
if self.host_is_target:
self.constants.host_is_non_metal = True
# If a Mac is non-Metal based, Beta Blur is highly recommended
if self.constants.detected_os >= os_data.os_data.big_sur:
for arg in ["Moraea_BlurBeta"]:
# If user explicitly set the blur, don't override
arg_result = subprocess.run(["defaults", "read", "-g", arg], stdout=subprocess.PIPE).stdout.decode("utf-8").strip()
if arg_result not in ["true", "1", "false", "0"]:
subprocess.run(["defaults", "write", "-g", arg, "-bool", "TRUE"])

View File

@@ -18,6 +18,7 @@ from data import pci_data
class CPU:
name: str
flags: list[str]
leafs: list[str]
@dataclass
@@ -482,7 +483,9 @@ class Computer:
secure_boot_policy: Optional[int] = None
oclp_sys_version: Optional[str] = None
oclp_sys_date: Optional[str] = None
oclp_sys_url: Optional[str] = None
firmware_vendor: Optional[str] = None
rosetta_active: Optional[bool] = False
@staticmethod
def probe():
@@ -501,6 +504,7 @@ class Computer:
computer.ambient_light_sensor_probe()
computer.sata_disk_probe()
computer.oclp_sys_patch_probe()
computer.check_rosetta()
return computer
def gpu_probe(self):
@@ -714,8 +718,16 @@ class Computer:
self.cpu = CPU(
subprocess.run("sysctl machdep.cpu.brand_string".split(), stdout=subprocess.PIPE).stdout.decode().partition(": ")[2].strip(),
subprocess.run("sysctl machdep.cpu.features".split(), stdout=subprocess.PIPE).stdout.decode().partition(": ")[2].strip().split(" "),
self.cpu_get_leafs(),
)
def cpu_get_leafs(self):
leafs = []
result = subprocess.run("sysctl machdep.cpu.leaf7_features".split(), stdout=subprocess.PIPE, stderr=subprocess.DEVNULL)
if result.returncode == 0:
return result.stdout.decode().partition(": ")[2].strip().split(" ")
return leafs
def bluetooth_probe(self):
usb_data: str = subprocess.run("system_profiler SPUSBDataType".split(), stdout=subprocess.PIPE, stderr=subprocess.STDOUT).stdout.decode()
if "BRCM20702 Hub" in usb_data:
@@ -756,8 +768,16 @@ class Computer:
if path.exists():
sys_plist = plistlib.load(path.open("rb"))
if sys_plist:
try:
if "OpenCore Legacy Patcher" in sys_plist:
self.oclp_sys_version = sys_plist["OpenCore Legacy Patcher"]
if "Time Patched" in sys_plist:
self.oclp_sys_date = sys_plist["Time Patched"]
except KeyError:
pass
if "Commit URL" in sys_plist:
self.oclp_sys_url = sys_plist["Commit URL"]
def check_rosetta(self):
result = subprocess.run("sysctl -in sysctl.proc_translated".split(), stdout=subprocess.PIPE).stdout.decode()
if result:
self.rosetta_active = True
else:
self.rosetta_active = False

View File

@@ -7,31 +7,21 @@ def set_smbios_model_spoof(model):
smbios_data.smbios_dictionary[model]["Screen Size"]
# Found mobile SMBIOS
if model.startswith("MacBookAir"):
if smbios_data.smbios_dictionary[model]["Screen Size"] == 13:
return "MacBookAir7,2"
elif smbios_data.smbios_dictionary[model]["Screen Size"] == 11:
return "MacBookAir7,1"
else:
# Unknown Model
raise Exception(f"Unknown SMBIOS for spoofing: {model}")
return "MacBookAir8,1"
elif model.startswith("MacBookPro"):
if smbios_data.smbios_dictionary[model]["Screen Size"] == 13:
return "MacBookPro12,1"
return "MacBookPro14,1"
elif smbios_data.smbios_dictionary[model]["Screen Size"] >= 15:
# 15" and 17"
try:
smbios_data.smbios_dictionary[model]["Switchable GPUs"]
return "MacBookPro11,5"
except KeyError:
return "MacBookPro11,4"
return "MacBookPro14,3"
else:
# Unknown Model
raise Exception(f"Unknown SMBIOS for spoofing: {model}")
elif model.startswith("MacBook"):
if smbios_data.smbios_dictionary[model]["Screen Size"] == 13:
return "MacBookAir7,2"
return "MacBookAir8,1"
elif smbios_data.smbios_dictionary[model]["Screen Size"] == 12:
return "MacBook9,1"
return "MacBook10,1"
else:
# Unknown Model
raise Exception(f"Unknown SMBIOS for spoofing: {model}")
@@ -43,13 +33,13 @@ def set_smbios_model_spoof(model):
if model.startswith("MacPro") or model.startswith("Xserve"):
return "MacPro7,1"
elif model.startswith("Macmini"):
return "Macmini7,1"
return "Macmini8,1"
elif model.startswith("iMac"):
if smbios_data.smbios_dictionary[model]["Max OS Supported"] <= os_data.os_data.high_sierra:
# Models dropped in Mojave either do not have an iGPU, or should have them disabled
return "iMacPro1,1"
else:
return "iMac17,1"
return "iMac18,3"
else:
# Unknown Model
raise Exception(f"Unknown SMBIOS for spoofing: {model}")

View File

@@ -159,11 +159,11 @@ def install_macOS_installer(download_path):
def list_downloadable_macOS_installers(download_path, catalog):
available_apps = {}
if catalog == "DeveloperSeed":
link = "https://swscan.apple.com/content/catalogs/others/index-12seed-12-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog"
link = "https://swscan.apple.com/content/catalogs/others/index-13seed-13-12-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog"
elif catalog == "PublicSeed":
link = "https://swscan.apple.com/content/catalogs/others/index-12beta-12-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog"
link = "https://swscan.apple.com/content/catalogs/others/index-13beta-13-12-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog"
else:
link = "https://swscan.apple.com/content/catalogs/others/index-12-12-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog"
link = "https://swscan.apple.com/content/catalogs/others/index-13-12-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog"
if utilities.verify_network_connection(link) is True:
try:
@@ -230,7 +230,7 @@ def only_list_newest_installers(available_apps):
# This is used to avoid overwhelming the user with installer options
# Only strip OSes that we know are supported
supported_versions = ["10.13", "10.14", "10.15", "11", "12"]
supported_versions = ["10.13", "10.14", "10.15", "11", "12", "13"]
for version in supported_versions:
remote_version_minor = 0
@@ -256,9 +256,8 @@ def only_list_newest_installers(available_apps):
# Now remove all versions that are not the largest
for ia in list(available_apps):
# Don't use Beta builds to determine latest version
if available_apps[ia]["Variant"] in ["CustomerSeed", "DeveloperSeed", "PublicSeed"]:
# Remove Beta builds from default listing
available_apps.pop(ia)
continue
if available_apps[ia]["Version"].startswith(version):
@@ -290,6 +289,15 @@ def only_list_newest_installers(available_apps):
os_builds.append(available_apps[ia]["Build"])
# Final passthrough
# Remove Betas if there's a non-beta version available
for ia in list(available_apps):
if available_apps[ia]["Variant"] in ["CustomerSeed", "DeveloperSeed", "PublicSeed"]:
for ia2 in available_apps:
if available_apps[ia2]["Version"].split(".")[0] == available_apps[ia]["Version"].split(".")[0] and available_apps[ia2]["Variant"] not in ["CustomerSeed", "DeveloperSeed", "PublicSeed"]:
available_apps.pop(ia)
break
return available_apps
def format_drive(disk_id):

250
resources/kdk_handler.py Normal file
View File

@@ -0,0 +1,250 @@
# Kernel Debug Kit downloader
import datetime
import re
import urllib.parse
from pathlib import Path
from typing import cast
import packaging.version
import requests
import subprocess
from resources import utilities
from resources.constants import Constants
class kernel_debug_kit_handler:
def __init__(self, constants: Constants):
self.constants = constants
def get_available_kdks(self):
KDK_API_LINK = "https://kdk-api.dhinak.net/v1"
print("- Fetching available KDKs")
try:
results = utilities.SESSION.get(KDK_API_LINK, headers={"User-Agent": f"OCLP/{self.constants.patcher_version}"})
except (requests.exceptions.Timeout, requests.exceptions.TooManyRedirects, requests.exceptions.ConnectionError):
print("- Could not contact KDK API")
return None
if results.status_code != 200:
print("- Could not fetch KDK list")
return None
return sorted(results.json(), key=lambda x: (packaging.version.parse(x["version"]), datetime.datetime.fromisoformat(x["date"])), reverse=True)
def get_closest_match_legacy(self, host_version: str, host_build: str):
# Get the closest match to the provided version
# KDKs are generally a few days late, so we'll rely on N-1 matching
# Note: AppleDB is manually updated, so this is not a perfect solution
OS_DATABASE_LINK = "https://api.appledb.dev/main.json"
VERSION_PATTERN = re.compile(r"\d+\.\d+(\.\d+)?")
parsed_host_version = cast(packaging.version.Version, packaging.version.parse(host_version))
print(f"- Checking closest match for: {host_version} build {host_build}")
try:
results = utilities.SESSION.get(OS_DATABASE_LINK)
except (requests.exceptions.Timeout, requests.exceptions.TooManyRedirects, requests.exceptions.ConnectionError):
print("- Could not contact AppleDB")
return None, "", ""
if results.status_code != 200:
print("- Could not fetch database")
return None, "", ""
macos_builds = [i for i in results.json()["ios"] if i["osType"] == "macOS"]
# If the version is borked, put it at the bottom of the list
# Would omit it, but can't do that in this lambda
macos_builds.sort(key=lambda x: (packaging.version.parse(VERSION_PATTERN.match(x["version"]).group() if VERSION_PATTERN.match(x["version"]) else "0.0.0"), datetime.datetime.fromisoformat(x["released"])), reverse=True) # type: ignore
# Iterate through, find build that is closest to the host version
# Use date to determine which is closest
for build_info in macos_builds:
if build_info["osType"] == "macOS":
raw_version = VERSION_PATTERN.match(build_info["version"])
if not raw_version:
# Skip if version is borked
continue
version = cast(packaging.version.Version, packaging.version.parse(raw_version.group()))
build = build_info["build"]
if build == host_build:
# Skip, as we want the next closest match
continue
elif version <= parsed_host_version and version.major == parsed_host_version.major and version.minor == parsed_host_version.minor:
# The KDK list is already sorted by date then version, so the first match is the closest
print(f"- Closest match: {version} build {build}")
return self.generate_kdk_link(str(version), build), str(version), build
print("- Could not find a match")
return None, "", ""
def generate_kdk_link(self, version: str, build: str):
return f"https://download.developer.apple.com/macOS/Kernel_Debug_Kit_{version}_build_{build}/Kernel_Debug_Kit_{version}_build_{build}.dmg"
def verify_apple_developer_portal(self, link):
# Determine whether Apple Developer Portal is up
# and if the requested file is available
# Returns following:
# 0: Portal is up and file is available
# 1: Portal is up but file is not available
# 2: Portal is down
TOKEN_URL_BASE = "https://developerservices2.apple.com/services/download"
remote_path = urllib.parse.urlparse(link).path
token_url = urllib.parse.urlunparse(urllib.parse.urlparse(TOKEN_URL_BASE)._replace(query=urllib.parse.urlencode({"path": remote_path})))
try:
response = utilities.SESSION.get(token_url, timeout=5)
except (requests.exceptions.Timeout, requests.exceptions.TooManyRedirects, requests.exceptions.ConnectionError):
print("- Could not contact Apple download servers")
return 2
try:
response.raise_for_status()
except requests.exceptions.HTTPError:
if response.status_code == 400 and "The path specified is invalid" in response.text:
print("- File does not exist on Apple download servers")
return 1
else:
print("- Could not request download authorization from Apple download servers")
return 2
return 0
def download_kdk(self, version: str, build: str):
detected_build = build
if self.is_kdk_installed(detected_build) is True:
print("- KDK is already installed")
self.remove_unused_kdks(exclude_builds=[detected_build])
return True, "", detected_build
download_link = None
closest_match_download_link = None
closest_version = ""
closest_build = ""
kdk_list = self.get_available_kdks()
parsed_version = cast(packaging.version.Version, packaging.version.parse(version))
if kdk_list:
for kdk in kdk_list:
kdk_version = cast(packaging.version.Version, packaging.version.parse(kdk["version"]))
if kdk["build"] == build:
download_link = kdk["url"]
elif not closest_match_download_link and kdk_version <= parsed_version and kdk_version.major == parsed_version.major and kdk_version.minor == parsed_version.minor:
# The KDK list is already sorted by date then version, so the first match is the closest
closest_match_download_link = kdk["url"]
closest_version = kdk["version"]
closest_build = kdk["build"]
else:
print("- Could not fetch KDK list, falling back to brute force")
download_link = self.generate_kdk_link(version, build)
closest_match_download_link, closest_version, closest_build = self.get_closest_match_legacy(version, build)
print(f"- Checking for KDK matching macOS {version} build {build}")
# download_link is None if no matching KDK is found, so we'll fall back to the closest match
result = self.verify_apple_developer_portal(download_link) if download_link else 1
if result == 0:
print("- Downloading KDK")
elif result == 1:
print("- Could not find KDK, finding closest match")
if self.is_kdk_installed(closest_build) is True:
print(f"- Closet Build ({closest_build}) already installed")
self.remove_unused_kdks(exclude_builds=[detected_build, closest_build])
return True, "", closest_build
if closest_match_download_link is None:
msg = "Could not find KDK for host, nor closest match"
print(f"- {msg}")
return False, msg, ""
print(f"- Closest match: {closest_version} build {closest_build}")
result = self.verify_apple_developer_portal(closest_match_download_link)
if result == 0:
print("- Downloading KDK")
download_link = closest_match_download_link
elif result == 1:
msg = "Could not find KDK for host on Apple's servers, nor closest match"
print(f"- {msg}")
return False, msg, ""
elif result == 2:
msg = "Could not contact Apple download servers"
print(f"- {msg}")
return False, msg, ""
else:
msg = "Unknown error"
print(f"- {msg}")
return False, msg, ""
elif result == 2:
msg = "Could not contact Apple download servers"
print(f"- {msg}")
return False, msg, ""
if utilities.download_apple_developer_portal(download_link, self.constants.kdk_download_path):
result = subprocess.run(["hdiutil", "verify", self.constants.kdk_download_path], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
if result.returncode != 0:
print(f"Error: Kernel Debug Kit checksum verification failed!")
print(f"Output: {result.stderr}")
msg = "Kernel Debug Kit checksum verification failed, please try again.\n\nIf this continues to fail, ensure you're downloading on a stable network connection (ie. Ethernet)"
print(f"- {msg}")
return False, msg, ""
self.remove_unused_kdks(exclude_builds=[detected_build, closest_build])
return True, "", detected_build
msg = "Failed to download KDK"
print(f"- {msg}")
return False, msg, ""
def is_kdk_installed(self, build):
kexts_to_check = [
"System.kext/PlugIns/Libkern.kext/Libkern",
"apfs.kext/Contents/MacOS/apfs",
"IOUSBHostFamily.kext/Contents/MacOS/IOUSBHostFamily",
"AMDRadeonX6000.kext/Contents/MacOS/AMDRadeonX6000",
]
if Path("/Library/Developer/KDKs").exists():
for file in Path("/Library/Developer/KDKs").iterdir():
if file.is_dir():
if file.name.endswith(f"{build}.kdk"):
for kext in kexts_to_check:
if not Path(f"{file}/System/Library/Extensions/{kext}").exists():
print(f"- Corrupted KDK found, removing due to missing: {file}/System/Library/Extensions/{kext}")
utilities.elevated(["rm", "-rf", file], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
return False
return True
return False
def remove_unused_kdks(self, exclude_builds=[]):
if self.constants.should_nuke_kdks is False:
return
if not Path("/Library/Developer/KDKs").exists():
return
if exclude_builds == []:
return
print("- Cleaning unused KDKs")
for kdk_folder in Path("/Library/Developer/KDKs").iterdir():
if kdk_folder.is_dir():
if kdk_folder.name.endswith(".kdk"):
should_remove = True
for build in exclude_builds:
if build != "" and kdk_folder.name.endswith(f"{build}.kdk"):
should_remove = False
break
if should_remove is False:
continue
print(f" - Removing {kdk_folder.name}")
utilities.elevated(["rm", "-rf", kdk_folder], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)

View File

@@ -26,7 +26,8 @@ class OpenCoreLegacyPatcher:
def generate_base_data(self):
self.constants.detected_os = os_probe.detect_kernel_major()
self.constants.detected_os_minor = os_probe.detect_kernel_minor()
self.constants.detected_os_build = os_probe.detect_kernel_build()
self.constants.detected_os_build = os_probe.detect_os_build()
self.constants.detected_os_version = os_probe.detect_os_version()
self.constants.computer = device_probe.Computer.probe()
self.constants.recovery_status = utilities.check_recovery()
self.computer = self.constants.computer
@@ -47,7 +48,13 @@ class OpenCoreLegacyPatcher:
self.constants.unpack_thread.start()
self.constants.commit_info = commit_info.commit_info(self.constants.launcher_binary).generate_commit_info()
defaults.generate_defaults.probe(self.computer.real_model, True, self.constants)
# Now that we have commit info, update nightly link
if self.constants.commit_info[0] not in ["Running from source", "Built from source"]:
branch = self.constants.commit_info[0]
branch = branch.replace("refs/heads/", "")
self.constants.installer_pkg_url_nightly = self.constants.installer_pkg_url_nightly.replace("main", branch)
defaults.generate_defaults(self.computer.real_model, True, self.constants)
if utilities.check_cli_args() is not None:
print("- Detected arguments, switching to CLI mode")

View File

@@ -16,7 +16,13 @@ def detect_kernel_minor():
return int(platform.uname().release.partition(".")[2].partition(".")[0])
def detect_kernel_build():
def detect_os_version():
# Return OS version
# Example Output: 12.0 (string)
return subprocess.run("sw_vers -productVersion".split(), stdout=subprocess.PIPE).stdout.decode().strip()
def detect_os_build():
# Return OS build
# Example Output: 21A5522h (string)
return subprocess.run("sw_vers -buildVersion".split(), stdout=subprocess.PIPE, stderr=subprocess.STDOUT).stdout.decode().split("\n")[0]
return subprocess.run("sw_vers -buildVersion".split(), stdout=subprocess.PIPE).stdout.decode().strip()

View File

@@ -22,7 +22,7 @@ class reroute_payloads:
print(f"- New payloads location: {self.temp_dir.name}")
print("- Creating payloads directory")
Path(self.temp_dir.name / Path("payloads")).mkdir(parents=True, exist_ok=True)
self.unmount_active_dmgs()
self.unmount_active_dmgs(unmount_all_active=False)
output = subprocess.run(
[
"hdiutil", "attach", "-noverify", f"{self.constants.payload_path}.dmg",

View File

@@ -1,7 +1,7 @@
# Framework for mounting and patching macOS root volume
# Copyright (C) 2020-2022, Dhinak G, Mykola Grymalyuk
# System based off of Apple's Kernel Development Kit (KDK)
# System based off of Apple's Kernel Debug Kit (KDK)
# - https://developer.apple.com/download/all/
# The system relies on mounting the APFS volume as a live read/write volume
@@ -28,12 +28,16 @@
# Alternative to mounting via 'mount', Apple's update system uses 'mount_apfs' directly
# '/sbin/mount_apfs -R /dev/disk5s5 /System/Volumes/Update/mnt1'
# With macOS Ventura, you will also need to install the KDK onto root if you plan to use kmutil
# This is because Apple removed on-disk binaries (ref: https://github.com/dortania/OpenCore-Legacy-Patcher/issues/998)
# 'sudo ditto /Library/Developer/KDKs/<KDK Version>/System /System/Volumes/Update/mnt1/System'
import plistlib
import shutil
import subprocess
from pathlib import Path
from resources import constants, utilities, sys_patch_download, sys_patch_detect, sys_patch_auto, sys_patch_helpers
from resources import constants, utilities, sys_patch_download, sys_patch_detect, sys_patch_auto, sys_patch_helpers, kdk_handler
from data import os_data
@@ -48,6 +52,7 @@ class PatchSysVolume:
self.constants.needs_to_open_preferences = False
self.patch_set_dictionary = {}
self.needs_kmutil_exemptions = False # For '/Library/Extensions' rebuilds
self.kdk_path = None
# GUI will detect hardware patches before starting PatchSysVolume()
# However the TUI will not, so allow for data to be passed in manually avoiding multiple calls
@@ -56,6 +61,8 @@ class PatchSysVolume:
self.hardware_details = hardware_details
self.init_pathing(custom_root_mount_path=None, custom_data_mount_path=None)
self.skip_root_kmutil_requirement = self.hardware_details["Settings: Supports Auxiliary Cache"]
def __del__(self):
# Ensures that each time we're patching, we're using a clean repository
if Path(self.constants.payload_local_binaries_root_path).exists():
@@ -101,6 +108,54 @@ class PatchSysVolume:
print(result.stdout.decode().strip())
return False
def merge_kdk_with_root(self):
if self.skip_root_kmutil_requirement is True:
return
if self.constants.detected_os < os_data.os_data.ventura:
return
downloaded_kdk = None
kdk_path = sys_patch_helpers.sys_patch_helpers(self.constants).determine_kdk_present(match_closest=False)
if kdk_path is None:
if not self.constants.kdk_download_path.exists():
kdk_result, error_msg, downloaded_kdk = kdk_handler.kernel_debug_kit_handler(self.constants).download_kdk(self.constants.detected_os_version, self.constants.detected_os_build)
if kdk_result is False:
raise Exception(f"Unable to download KDK: {error_msg}")
sys_patch_helpers.sys_patch_helpers(self.constants).install_kdk()
kdk_path = sys_patch_helpers.sys_patch_helpers(self.constants).determine_kdk_present(match_closest=True, override_build=downloaded_kdk)
oclp_plist = Path("/System/Library/CoreServices/OpenCore-Legacy-Patcher.plist")
if (Path(self.mount_location) / Path("System/Library/Extensions/System.kext/PlugIns/Libkern.kext/Libkern")).exists() and oclp_plist.exists():
# KDK was already merged, check if the KDK used is the same as the one we're using
# If not, we'll rsync over with the new KDK
try:
oclp_plist_data = plistlib.load(open(oclp_plist, "rb"))
if "Kernel Debug Kit Used" in oclp_plist_data:
if oclp_plist_data["Kernel Debug Kit Used"] == str(kdk_path):
print("- Matching KDK determined to already be merged, skipping")
return
except:
pass
if kdk_path is None:
print(f"- Unable to find Kernel Debug Kit: {downloaded_kdk}")
raise Exception("Unable to find Kernel Debug Kit")
self.kdk_path = kdk_path
print(f"- Found KDK at: {kdk_path}")
print("- Merging KDK with Root Volume")
utilities.elevated(
# Only merge '/System/Library/Extensions'
# 'Kernels' and 'KernelSupport' is wasted space for root patching (we don't care above dev kernels)
["rsync", "-r", "-i", "-a", f"{kdk_path}/System/Library/Extensions/", f"{self.mount_location}/System/Library/Extensions"],
stdout=subprocess.PIPE, stderr=subprocess.STDOUT
)
# During reversing, we found that kmutil uses this path to determine whether the KDK was successfully merged
# Best to verify now before we cause any damage
if not (Path(self.mount_location) / Path("System/Library/Extensions/System.kext/PlugIns/Libkern.kext/Libkern")).exists():
print("- Failed to merge KDK with Root Volume")
raise Exception("Failed to merge KDK with Root Volume")
print("- Successfully merged KDK with Root Volume")
def unpatch_root_vol(self):
if self.constants.detected_os > os_data.os_data.catalina and self.root_supports_snapshot is True:
print("- Reverting to last signed APFS snapshot")
@@ -113,15 +168,68 @@ class PatchSysVolume:
else:
self.clean_skylight_plugins()
self.delete_nonmetal_enforcement()
self.clean_auxiliary_kc()
self.constants.root_patcher_succeeded = True
print("- Unpatching complete")
print("\nPlease reboot the machine for patches to take effect")
def rebuild_snapshot(self):
print("- Rebuilding Kernel Cache (This may take some time)")
if self.rebuild_kernel_collection() is True:
self.update_preboot_kernel_cache()
self.rebuild_dyld_shared_cache()
if self.create_new_apfs_snapshot() is True:
print("- Patching complete")
print("\nPlease reboot the machine for patches to take effect")
if self.needs_kmutil_exemptions is True:
print("Note: Apple will require you to open System Preferences -> Security to allow the new kernel extensions to be loaded")
self.constants.root_patcher_succeeded = True
if self.constants.gui_mode is False:
input("\nPress [ENTER] to continue")
def rebuild_kernel_collection(self):
print("- Rebuilding Kernel Cache (This may take some time)")
if self.constants.detected_os > os_data.os_data.catalina:
args = ["kmutil", "install", "--volume-root", self.mount_location, "--update-all"]
# Base Arguments
args = ["kmutil", "install"]
if self.skip_root_kmutil_requirement is True:
# Only rebuild the Auxiliary Kernel Collection
args.append("--new")
args.append("aux")
args.append("--boot-path")
args.append(f"{self.mount_location}/System/Library/KernelCollections/BootKernelExtensions.kc")
args.append("--system-path")
args.append(f"{self.mount_location}/System/Library/KernelCollections/SystemKernelExtensions.kc")
else:
# Rebuild Boot, System and Auxiliary Kernel Collections
args.append("--volume-root")
args.append(self.mount_location)
# Build Boot, Sys and Aux KC
args.append("--update-all")
# If multiple kernels found, only build release KCs
args.append("--variant-suffix")
args.append("release")
if self.constants.detected_os >= os_data.os_data.ventura:
# With Ventura, we're required to provide a KDK in some form
# to rebuild the Kernel Cache
#
# However since we already merged the KDK onto root with 'ditto',
# We can add '--allow-missing-kdk' to skip parsing the KDK
#
# This allows us to only delete/overwrite kexts inside of
# /System/Library/Extensions and not the entire KDK
args.append("--allow-missing-kdk")
# 'install' and '--update-all' cannot be used together in Ventura.
# kmutil will request the usage of 'create' instead:
# Warning: kmutil install's usage of --update-all is deprecated.
# Use kmutil create --update-install instead'
args[1] = "create"
if self.needs_kmutil_exemptions is True:
# When installing to '/Library/Extensions', following args skip kext consent
@@ -129,7 +237,6 @@ class PatchSysVolume:
print(" (You will get a prompt by System Preferences, ignore for now)")
args.append("--no-authentication")
args.append("--no-authorization")
self.constants.needs_to_open_preferences = True # Notify in GUI to open System Preferences
else:
args = ["kextcache", "-i", f"{self.mount_location}/"]
@@ -150,31 +257,46 @@ class PatchSysVolume:
print("\nPlease reboot the machine to avoid potential issues rerunning the patcher")
if self.constants.gui_mode is False:
input("Press [ENTER] to continue")
else:
print("- Successfully built new kernel cache")
self.update_preboot_kernel_cache()
self.rebuild_dyld_shared_cache()
if self.root_supports_snapshot is True:
print("- Creating new APFS snapshot")
bless = utilities.elevated(
["bless", "--folder", f"{self.mount_location}/System/Library/CoreServices", "--bootefi", "--create-snapshot"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT
)
if bless.returncode != 0:
print("- Unable to create new snapshot")
print("Reason for snapshot failure:")
print(bless.stdout.decode())
if "Can't use last-sealed-snapshot or create-snapshot on non system volume" in bless.stdout.decode():
print("- This is an APFS bug with Monterey! Perform a clean installation to ensure your APFS volume is built correctly")
return
else:
self.unmount_drive()
print("- Patching complete")
print("\nPlease reboot the machine for patches to take effect")
if self.needs_kmutil_exemptions is True:
print("Note: Apple will require you to open System Preferences -> Security to allow the new kernel extensions to be loaded")
self.constants.root_patcher_succeeded = True
if self.constants.gui_mode is False:
input("\nPress [ENTER] to continue")
return False
if self.skip_root_kmutil_requirement is True:
# Force rebuild the Auxiliary KC
result = utilities.elevated(["killall", "syspolicyd", "kernelmanagerd"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
if result.returncode != 0:
print("- Unable to remove kernel extension policy files")
print(f"\nReason for Patch Failure ({result.returncode}):")
print(result.stdout.decode())
print("")
print("\nPlease reboot the machine to avoid potential issues rerunning the patcher")
if self.constants.gui_mode is False:
input("Press [ENTER] to continue")
return False
for file in ["KextPolicy", "KextPolicy-shm", "KextPolicy-wal"]:
self.remove_file("/private/var/db/SystemPolicyConfiguration/", file)
print("- Successfully built new kernel cache")
return True
def create_new_apfs_snapshot(self):
if self.root_supports_snapshot is True:
print("- Creating new APFS snapshot")
bless = utilities.elevated(
[
"bless",
"--folder", f"{self.mount_location}/System/Library/CoreServices",
"--bootefi", "--create-snapshot"
], stdout=subprocess.PIPE, stderr=subprocess.STDOUT
)
if bless.returncode != 0:
print("- Unable to create new snapshot")
print("Reason for snapshot failure:")
print(bless.stdout.decode())
if "Can't use last-sealed-snapshot or create-snapshot on non system volume" in bless.stdout.decode():
print("- This is an APFS bug with Monterey and newer! Perform a clean installation to ensure your APFS volume is built correctly")
return False
self.unmount_drive()
return True
def unmount_drive(self):
print("- Unmounting Root Volume (Don't worry if this fails)")
@@ -206,16 +328,104 @@ class PatchSysVolume:
print(f"- Removing non-Metal Enforcement Preference: {arg}")
utilities.elevated(["defaults", "delete", "/Library/Preferences/com.apple.CoreDisplay", arg])
def clean_auxiliary_kc(self):
# When reverting root volume patches, the AuxKC will still retain the UUID
# it was built against. Thus when Boot/SysKC are reverted, Aux will break
# To resolve this, delete all installed kexts in /L*/E* and rebuild the AuxKC
# We can verify our binaries based off the OpenCore-Legacy-Patcher.plist file
if self.constants.detected_os < os_data.os_data.big_sur:
return
oclp_path = "/System/Library/CoreServices/OpenCore-Legacy-Patcher.plist"
if not Path(oclp_path).exists():
return
print("- Cleaning Auxiliary Kernel Collection")
oclp_plist_data = plistlib.load(Path(oclp_path).open("rb"))
for key in oclp_plist_data:
if "Install" not in oclp_plist_data[key]:
continue
for location in oclp_plist_data[key]["Install"]:
if not location.endswith("Extensions"):
continue
for file in oclp_plist_data[key]["Install"][location]:
if not file.endswith(".kext"):
continue
self.remove_file("/Library/Extensions", file)
def write_patchset(self, patchset):
destination_path = f"{self.mount_location}/System/Library/CoreServices"
file_name = "OpenCore-Legacy-Patcher.plist"
destination_path_file = f"{destination_path}/{file_name}"
if sys_patch_helpers.sys_patch_helpers(self.constants).generate_patchset_plist(patchset, file_name):
if sys_patch_helpers.sys_patch_helpers(self.constants).generate_patchset_plist(patchset, file_name, self.kdk_path):
print("- Writing patchset information to Root Volume")
if Path(destination_path_file).exists():
utilities.process_status(utilities.elevated(["rm", destination_path_file], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
utilities.process_status(utilities.elevated(["cp", f"{self.constants.payload_path}/{file_name}", destination_path], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
def add_auxkc_support(self, install_file, source_folder_path, install_patch_directory, destination_folder_path):
# In macOS Ventura, KDKs are required to build new Boot and System KCs
# However for some patch sets, we're able to use the Auxiliary KCs with '/Library/Extensions'
# kernelmanagerd determines which kext is installed by their 'OSBundleRequired' entry
# If a kext is labeled as 'OSBundleRequired: Root' or 'OSBundleRequired: Safe Boot',
# kernelmanagerd will require the kext to be installed in the Boot/SysKC
# Additionally, kexts starting with 'com.apple.' are not natively allowed to be installed
# in the AuxKC. So we need to explicitly set our 'OSBundleRequired' to 'Auxiliary'
if self.skip_root_kmutil_requirement is False:
return destination_folder_path
if not install_file.endswith(".kext"):
return destination_folder_path
if install_patch_directory != "/System/Library/Extensions":
return destination_folder_path
if self.constants.detected_os < os_data.os_data.ventura:
return destination_folder_path
updated_install_location = str(self.mount_location_data) + "/Library/Extensions"
print(f" - Adding AuxKC support to {install_file}")
plist_path = Path(Path(source_folder_path) / Path(install_file) / Path("Contents/Info.plist"))
plist_data = plistlib.load((plist_path).open("rb"))
# Check if we need to update the 'OSBundleRequired' entry
if not plist_data["CFBundleIdentifier"].startswith("com.apple."):
return updated_install_location
if "OSBundleRequired" in plist_data:
if plist_data["OSBundleRequired"] == "Auxiliary":
return updated_install_location
plist_data["OSBundleRequired"] = "Auxiliary"
plistlib.dump(plist_data, plist_path.open("wb"))
self.check_kexts_needs_authentication(install_file)
return updated_install_location
def check_kexts_needs_authentication(self, kext_name):
# Verify whether the user needs to authenticate in System Preferences
# Specifically under 'private/var/db/KernelManagement/AuxKC/CurrentAuxKC/com.apple.kcgen.instructions.plist'
# ["kextsToBuild"][i]:
# ["bundlePathMainOS"] = /Library/Extensions/Test.kext
# ["cdHash"] = Bundle's CDHash (random on ad-hoc signed, static on dev signed)
# ["teamID"] = Team ID (blank on ad-hoc signed)
# To grab the CDHash of a kext, run 'codesign -dvvv <kext_path>'
try:
aux_cache_path = Path(self.mount_location_data) / Path("/private/var/db/KernelExtensionManagement/AuxKC/CurrentAuxKC/com.apple.kcgen.instructions.plist")
if aux_cache_path.exists():
aux_cache_data = plistlib.load((aux_cache_path).open("rb"))
for kext in aux_cache_data["kextsToBuild"]:
if "bundlePathMainOS" in aux_cache_data["kextsToBuild"][kext]:
if aux_cache_data["kextsToBuild"][kext]["bundlePathMainOS"] == f"/Library/Extensions/{kext_name}":
return
except PermissionError:
pass
print(f" - {kext_name} requires authentication in System Preferences")
self.constants.needs_to_open_preferences = True # Notify in GUI to open System Preferences
def patch_root_vol(self):
print(f"- Running patches for {self.model}")
if self.patch_set_dictionary != {}:
@@ -243,28 +453,43 @@ class PatchSysVolume:
for method_install in ["Install", "Install Non-Root"]:
if method_install in required_patches[patch]:
for install_patch_directory in required_patches[patch][method_install]:
for install_patch_directory in list(required_patches[patch][method_install]):
print(f"- Handling Installs in: {install_patch_directory}")
for install_file in required_patches[patch][method_install][install_patch_directory]:
for install_file in list(required_patches[patch][method_install][install_patch_directory]):
source_folder_path = source_files_path + "/" + required_patches[patch][method_install][install_patch_directory][install_file] + install_patch_directory
if method_install == "Install":
destination_folder_path = str(self.mount_location) + install_patch_directory
else:
if install_patch_directory == "/Library/Extensions":
self.needs_kmutil_exemptions = True
self.check_kexts_needs_authentication(install_file)
destination_folder_path = str(self.mount_location_data) + install_patch_directory
updated_destination_folder_path = self.add_auxkc_support(install_file, source_folder_path, install_patch_directory, destination_folder_path)
if destination_folder_path != updated_destination_folder_path:
# Update required_patches to reflect the new destination folder path
if updated_destination_folder_path not in required_patches[patch][method_install]:
required_patches[patch][method_install].update({updated_destination_folder_path: {}})
required_patches[patch][method_install][updated_destination_folder_path].update({install_file: required_patches[patch][method_install][install_patch_directory][install_file]})
required_patches[patch][method_install][install_patch_directory].pop(install_file)
destination_folder_path = updated_destination_folder_path
self.install_new_file(source_folder_path, destination_folder_path, install_file)
if "Processes" in required_patches[patch]:
for process in required_patches[patch]["Processes"]:
# Some processes need sudo, however we cannot directly call sudo in some scenarios
# Instead, call elevated funtion is string's boolean is True
# Instead, call elevated funtion if string's boolean is True
if required_patches[patch]["Processes"][process] is True:
print(f"- Running Process as Root:\n{process}")
utilities.process_status(utilities.elevated(process.split(" "), stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
else:
print(f"- Running Process:\n{process}")
utilities.process_status(subprocess.run(process, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True))
if "AMD Legacy GCN" in required_patches:
sys_patch_helpers.sys_patch_helpers(self.constants).disable_window_server_caching()
self.write_patchset(required_patches)
def preflight_checks(self, required_patches, source_files_path):
@@ -274,6 +499,8 @@ class PatchSysVolume:
self.clean_skylight_plugins()
# Make sure non-Metal Enforcement preferences are not present
self.delete_nonmetal_enforcement()
# Make sure we clean old kexts in /L*/E* that are not in the patchset
self.clean_auxiliary_kc()
# Make sure SNB kexts are compatible with the host
if "Intel Sandy Bridge" in required_patches:
@@ -289,6 +516,9 @@ class PatchSysVolume:
if not Path(source_file).exists():
raise Exception(f"Failed to find {source_file}")
# Ensure KDK is properly installed
self.merge_kdk_with_root()
print("- Finished Preflight, starting patching")
def install_new_file(self, source_folder, destination_folder, file_name):

View File

@@ -190,7 +190,7 @@ class AutomaticSysPatch:
# Strip everything after OpenCore-Patcher.app
path = str(settings.launcher_binary).split("/Contents/MacOS/OpenCore-Patcher")[0]
print(f"- Copying {path} to /Library/Application Support/Dortania/")
utilities.process_status(utilities.elevated(["cp", "-R", path, "/Library/Application Support/Dortania/"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
utilities.process_status(utilities.elevated(["ditto", path, "/Library/Application Support/Dortania/OpenCore-Patcher.app"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
if not Path("/Library/Application Support/Dortania/OpenCore-Patcher.app").exists():
# Sometimes the binary the user launches may have a suffix (ie. OpenCore-Patcher 3.app)
@@ -204,6 +204,9 @@ class AutomaticSysPatch:
if Path("/Library/LaunchAgents/com.dortania.opencore-legacy-patcher.auto-patch.plist").exists():
print("- Deleting existing auto-patch.plist")
utilities.process_status(utilities.elevated(["rm", "/Library/LaunchAgents/com.dortania.opencore-legacy-patcher.auto-patch.plist"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
if not Path("/Library/LaunchAgents/").exists():
print("- Creating /Library/LaunchAgents/")
utilities.process_status(utilities.elevated(["mkdir", "-p", "/Library/LaunchAgents/"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
utilities.process_status(utilities.elevated(["cp", settings.auto_patch_launch_agent_path, "/Library/LaunchAgents/"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
# Set the permissions on the com.dortania.opencore-legacy-patcher.auto-patch.plist

View File

@@ -3,7 +3,8 @@
# Used when supplying data to sys_patch.py
# Copyright (C) 2020-2022, Dhinak G, Mykola Grymalyuk
from resources import constants, device_probe, utilities
import subprocess
from resources import constants, device_probe, utilities, sys_patch_helpers, amfi_detect
from data import model_array, os_data, sip_data, sys_patch_dict
class detect_root_patch:
@@ -13,14 +14,18 @@ class detect_root_patch:
self.computer = self.constants.computer
# GPU Patch Detection
self.nvidia_tesla = False
self.kepler_gpu = False
self.nvidia_web = False
self.amd_ts1 = False
self.amd_ts2 = False
self.iron_gpu = False
self.sandy_gpu = False
self.ivy_gpu = False
self.nvidia_tesla = False
self.kepler_gpu = False
self.nvidia_web = False
self.amd_ts1 = False
self.amd_ts2 = False
self.iron_gpu = False
self.sandy_gpu = False
self.ivy_gpu = False
self.haswell_gpu = False
self.broadwell_gpu = False
self.skylake_gpu = False
self.legacy_gcn = False
# Misc Patch Detection
self.brightness_legacy = False
@@ -31,8 +36,10 @@ class detect_root_patch:
# Patch Requirements
self.amfi_must_disable = False
self.amfi_shim_bins = False
self.supports_metal = False
self.needs_nv_web_checks = False
self.requires_root_kc = False
# Validation Checks
self.sip_enabled = False
@@ -40,6 +47,7 @@ class detect_root_patch:
self.amfi_enabled = False
self.fv_enabled = False
self.dosdude_patched = False
self.missing_kdk = False
self.missing_whatever_green = False
self.missing_nv_web_nvram = False
@@ -56,17 +64,28 @@ class detect_root_patch:
if self.constants.detected_os > non_metal_os:
self.nvidia_tesla = True
self.amfi_must_disable = True
if os_data.os_data.ventura in self.constants.legacy_accel_support:
self.amfi_shim_bins = True
self.legacy_keyboard_backlight = self.check_legacy_keyboard_backlight()
self.requires_root_kc = True
elif gpu.arch == device_probe.NVIDIA.Archs.Kepler and self.constants.force_nv_web is False:
if self.constants.detected_os > os_data.os_data.big_sur:
# Kepler drivers were dropped with Beta 7
# 12.0 Beta 5: 21.0.0 - 21A5304g
# 12.0 Beta 6: 21.1.0 - 21A5506j
# 12.0 Beta 7: 21.1.0 - 21A5522h
if self.constants.detected_os == os_data.os_data.monterey and self.constants.detected_os_minor > 0:
if "21A5506j" not in self.constants.detected_os_build:
self.kepler_gpu = True
self.supports_metal = True
if (
self.constants.detected_os >= os_data.os_data.ventura or
(
"21A5506j" not in self.constants.detected_os_build and
self.constants.detected_os == os_data.os_data.monterey and
self.constants.detected_os_minor > 0
)
):
self.kepler_gpu = True
self.supports_metal = True
if self.constants.detected_os >= os_data.os_data.ventura:
self.amfi_must_disable = True
elif gpu.arch in [
device_probe.NVIDIA.Archs.Fermi,
device_probe.NVIDIA.Archs.Kepler,
@@ -76,28 +95,80 @@ class detect_root_patch:
if self.constants.detected_os > os_data.os_data.mojave:
self.nvidia_web = True
self.amfi_must_disable = True
if os_data.os_data.ventura in self.constants.legacy_accel_support:
self.amfi_shim_bins = True
self.needs_nv_web_checks = True
self.requires_root_kc = True
elif gpu.arch == device_probe.AMD.Archs.TeraScale_1:
if self.constants.detected_os > non_metal_os:
self.amd_ts1 = True
self.amfi_must_disable = True
if os_data.os_data.ventura in self.constants.legacy_accel_support:
self.amfi_shim_bins = True
self.requires_root_kc = True
elif gpu.arch == device_probe.AMD.Archs.TeraScale_2:
if self.constants.detected_os > non_metal_os:
self.amd_ts2 = True
self.amfi_must_disable = True
if os_data.os_data.ventura in self.constants.legacy_accel_support:
self.amfi_shim_bins = True
self.requires_root_kc = True
elif gpu.arch in [
device_probe.AMD.Archs.Legacy_GCN_7000,
device_probe.AMD.Archs.Legacy_GCN_8000,
device_probe.AMD.Archs.Legacy_GCN_9000,
device_probe.AMD.Archs.Polaris,
]:
if self.constants.detected_os > os_data.os_data.monterey:
if self.constants.computer.rosetta_active is True:
continue
if gpu.arch == device_probe.AMD.Archs.Polaris:
# Check if host supports AVX2.0
# If not, enable legacy GCN patch
if "AVX2" in self.constants.computer.cpu.leafs:
continue
self.legacy_gcn = True
self.supports_metal = True
self.requires_root_kc = True
self.amfi_must_disable = True
elif gpu.arch == device_probe.Intel.Archs.Iron_Lake:
if self.constants.detected_os > non_metal_os:
self.iron_gpu = True
self.amfi_must_disable = True
if os_data.os_data.ventura in self.constants.legacy_accel_support:
self.amfi_shim_bins = True
self.legacy_keyboard_backlight = self.check_legacy_keyboard_backlight()
self.requires_root_kc = True
elif gpu.arch == device_probe.Intel.Archs.Sandy_Bridge:
if self.constants.detected_os > non_metal_os:
self.sandy_gpu = True
self.amfi_must_disable = True
if os_data.os_data.ventura in self.constants.legacy_accel_support:
self.amfi_shim_bins = True
self.legacy_keyboard_backlight = self.check_legacy_keyboard_backlight()
self.requires_root_kc = True
elif gpu.arch == device_probe.Intel.Archs.Ivy_Bridge:
if self.constants.detected_os > os_data.os_data.big_sur:
self.ivy_gpu = True
if self.constants.detected_os >= os_data.os_data.ventura:
self.amfi_must_disable = True
self.supports_metal = True
elif gpu.arch == device_probe.Intel.Archs.Haswell:
if self.constants.detected_os > os_data.os_data.monterey:
self.haswell_gpu = True
self.amfi_must_disable = True
self.supports_metal = True
elif gpu.arch == device_probe.Intel.Archs.Broadwell:
if self.constants.detected_os > os_data.os_data.monterey:
self.broadwell_gpu = True
self.amfi_must_disable = True
self.supports_metal = True
elif gpu.arch == device_probe.Intel.Archs.Skylake:
if self.constants.detected_os > os_data.os_data.monterey:
self.skylake_gpu = True
self.amfi_must_disable = True
self.supports_metal = True
if self.supports_metal is True:
# Avoid patching Metal and non-Metal GPUs if both present, prioritize Metal GPU
@@ -110,6 +181,14 @@ class detect_root_patch:
self.sandy_gpu = False
self.legacy_keyboard_backlight = False
if self.constants.detected_os <= os_data.os_data.monterey:
# Always assume Root KC requirement on Monterey and older
self.requires_root_kc = True
else:
if self.requires_root_kc is True:
self.missing_kdk = not self.check_kdk()
def check_dgpu_status(self):
dgpu = self.constants.computer.dgpu
if dgpu:
@@ -174,6 +253,11 @@ class detect_root_patch:
def check_whatevergreen(self):
return utilities.check_kext_loaded("WhateverGreen", self.constants.detected_os)
def check_kdk(self):
if sys_patch_helpers.sys_patch_helpers(self.constants).determine_kdk_present() is None:
return False
return True
def check_sip(self):
if self.constants.detected_os > os_data.os_data.catalina:
if self.nvidia_web is True:
@@ -182,6 +266,12 @@ class detect_root_patch:
sip_value = (
f"For Hackintoshes, please set csr-active-config to '030A0000' ({sip_hex})\nFor non-OpenCore Macs, please run 'csrutil disable' and \n'csrutil authenticated-root disable' in RecoveryOS"
)
elif self.constants.detected_os >= os_data.os_data.ventura:
sip = sip_data.system_integrity_protection.root_patch_sip_ventura
sip_hex = "0x803"
sip_value = (
f"For Hackintoshes, please set csr-active-config to '03080000' ({sip_hex})\nFor non-OpenCore Macs, please run 'csrutil disable' and \n'csrutil authenticated-root disable' in RecoveryOS"
)
else:
sip = sip_data.system_integrity_protection.root_patch_sip_big_sur
sip_hex = "0x802"
@@ -210,7 +300,7 @@ class detect_root_patch:
isinstance(self.constants.computer.wifi, device_probe.Broadcom)
and self.constants.computer.wifi.chipset in [device_probe.Broadcom.Chipsets.AirPortBrcm4331, device_probe.Broadcom.Chipsets.AirPortBrcm43224]
) or (isinstance(self.constants.computer.wifi, device_probe.Atheros) and self.constants.computer.wifi.chipset == device_probe.Atheros.Chipsets.AirPortAtheros40):
if self.constants.detected_os > os_data.os_data.big_sur:
if os_data.os_data.ventura > self.constants.detected_os > os_data.os_data.big_sur:
self.legacy_wifi = True
# if self.model in ["MacBookPro5,1", "MacBookPro5,2", "MacBookPro5,3", "MacBookPro8,2", "MacBookPro8,3"]:
@@ -233,37 +323,54 @@ class detect_root_patch:
"Graphics: Nvidia Web Drivers": self.nvidia_web,
"Graphics: AMD TeraScale 1": self.amd_ts1,
"Graphics: AMD TeraScale 2": self.amd_ts2,
"Graphics: AMD Legacy GCN": self.legacy_gcn,
"Graphics: Intel Ironlake": self.iron_gpu,
"Graphics: Intel Sandy Bridge": self.sandy_gpu,
"Graphics: Intel Ivy Bridge": self.ivy_gpu,
"Graphics: Intel Haswell": self.haswell_gpu,
"Graphics: Intel Broadwell": self.broadwell_gpu,
"Graphics: Intel Skylake": self.skylake_gpu,
"Brightness: Legacy Backlight Control": self.brightness_legacy,
"Audio: Legacy Realtek": self.legacy_audio,
"Networking: Legacy Wireless": self.legacy_wifi,
"Miscellaneous: Legacy GMUX": self.legacy_gmux,
"Miscellaneous: Legacy Keyboard Backlight": self.legacy_keyboard_backlight,
"Settings: Requires AMFI exemption": self.amfi_must_disable,
"Settings: Supports Auxiliary Cache": not self.requires_root_kc,
"Settings: Kernel Debug Kit missing": self.missing_kdk if self.constants.detected_os >= os_data.os_data.ventura.value else False,
"Validation: Patching Possible": self.verify_patch_allowed(),
f"Validation: SIP is enabled (Required: {self.check_sip()[2]} or higher)": self.sip_enabled,
f"Validation: Currently Booted SIP: ({hex(utilities.csr_dump())})": self.sip_enabled,
"Validation: SecureBootModel is enabled": self.sbm_enabled,
"Validation: AMFI is enabled": self.amfi_enabled if self.amfi_must_disable is True else False,
f"Validation: {'AMFI' if self.constants.host_is_hackintosh is True or self.get_amfi_level_needed() > 2 else 'Library Validation'} is enabled": self.amfi_enabled if self.amfi_must_disable is True else False,
"Validation: FileVault is enabled": self.fv_enabled,
"Validation: System is dosdude1 patched": self.dosdude_patched,
"Validation: WhateverGreen.kext missing": self.missing_whatever_green if self.nvidia_web is True else False,
"Validation: Force OpenGL property missing": self.missing_nv_web_opengl if self.nvidia_web is True else False,
"Validation: Force compat property missing": self.missing_nv_compat if self.nvidia_web is True else False,
"Validation: nvda_drv(_vrl) variable missing": self.missing_nv_web_nvram if self.nvidia_web is True else False,
}
return self.root_patch_dict
def get_amfi_level_needed(self):
if self.amfi_must_disable is True:
if self.constants.detected_os > os_data.os_data.catalina:
if self.constants.detected_os >= os_data.os_data.ventura:
if self.amfi_shim_bins is True:
# Currently we require AMFI outright disabled
# in Ventura to work with shim'd binaries
return 3
return 1
return 0
def verify_patch_allowed(self, print_errors=False):
sip_dict = self.check_sip()
sip = sip_dict[0]
sip_value = sip_dict[1]
self.sip_enabled, self.sbm_enabled, self.amfi_enabled, self.fv_enabled, self.dosdude_patched = utilities.patching_status(sip, self.constants.detected_os)
self.sip_enabled, self.sbm_enabled, self.fv_enabled, self.dosdude_patched = utilities.patching_status(sip, self.constants.detected_os)
self.amfi_enabled = not amfi_detect.amfi_configuration_detection().check_config(self.get_amfi_level_needed())
if self.nvidia_web is True:
self.missing_nv_web_nvram = not self.check_nv_web_nvram()
@@ -314,7 +421,6 @@ class detect_root_patch:
print("\nCannot patch! WhateverGreen.kext missing")
print("Please ensure WhateverGreen.kext is installed")
if any(
[
# General patch checks
@@ -341,57 +447,89 @@ class detect_root_patch:
print("- The following patches will be applied:")
if hardware_details["Graphics: Intel Ironlake"] is True:
required_patches.update({"Non-Metal Common": all_hardware_patchset["Graphics"]["Non-Metal Common"]})
required_patches.update({"WebKit Monterey Common": all_hardware_patchset["Graphics"]["WebKit Monterey Common"]})
required_patches.update({"Intel Ironlake": all_hardware_patchset["Graphics"]["Intel Ironlake"]})
if hardware_details["Graphics: Intel Sandy Bridge"] is True:
required_patches.update({"Non-Metal Common": all_hardware_patchset["Graphics"]["Non-Metal Common"]})
required_patches.update({"Legacy GVA": all_hardware_patchset["Graphics"]["Legacy GVA"]})
required_patches.update({"High Sierra GVA": all_hardware_patchset["Graphics"]["High Sierra GVA"]})
required_patches.update({"WebKit Monterey Common": all_hardware_patchset["Graphics"]["WebKit Monterey Common"]})
required_patches.update({"Intel Sandy Bridge": all_hardware_patchset["Graphics"]["Intel Sandy Bridge"]})
if hardware_details["Graphics: Intel Ivy Bridge"] is True:
required_patches.update({"Metal Common": all_hardware_patchset["Graphics"]["Metal Common"]})
required_patches.update({"Modern GVA": all_hardware_patchset["Graphics"]["Modern GVA"]})
required_patches.update({"Metal 3802 Common": all_hardware_patchset["Graphics"]["Metal 3802 Common"]})
required_patches.update({"Catalina GVA": all_hardware_patchset["Graphics"]["Catalina GVA"]})
required_patches.update({"Monterey OpenCL": all_hardware_patchset["Graphics"]["Monterey OpenCL"]})
required_patches.update({"Big Sur OpenCL": all_hardware_patchset["Graphics"]["Big Sur OpenCL"]})
required_patches.update({"WebKit Monterey Common": all_hardware_patchset["Graphics"]["WebKit Monterey Common"]})
required_patches.update({"Intel Ivy Bridge": all_hardware_patchset["Graphics"]["Intel Ivy Bridge"]})
if hardware_details["Graphics: Intel Haswell"] is True:
required_patches.update({"Metal 3802 Common": all_hardware_patchset["Graphics"]["Metal 3802 Common"]})
required_patches.update({"Monterey GVA": all_hardware_patchset["Graphics"]["Monterey GVA"]})
required_patches.update({"Monterey OpenCL": all_hardware_patchset["Graphics"]["Monterey OpenCL"]})
required_patches.update({"Intel Haswell": all_hardware_patchset["Graphics"]["Intel Haswell"]})
if hardware_details["Graphics: Intel Broadwell"] is True:
required_patches.update({"Monterey GVA": all_hardware_patchset["Graphics"]["Monterey GVA"]})
required_patches.update({"Monterey OpenCL": all_hardware_patchset["Graphics"]["Monterey OpenCL"]})
required_patches.update({"Intel Broadwell": all_hardware_patchset["Graphics"]["Intel Broadwell"]})
if hardware_details["Graphics: Intel Skylake"] is True:
required_patches.update({"Monterey GVA": all_hardware_patchset["Graphics"]["Monterey GVA"]})
required_patches.update({"Monterey OpenCL": all_hardware_patchset["Graphics"]["Monterey OpenCL"]})
required_patches.update({"Intel Skylake": all_hardware_patchset["Graphics"]["Intel Skylake"]})
if hardware_details["Graphics: Nvidia Tesla"] is True:
required_patches.update({"Non-Metal Common": all_hardware_patchset["Graphics"]["Non-Metal Common"]})
required_patches.update({"WebKit Monterey Common": all_hardware_patchset["Graphics"]["WebKit Monterey Common"]})
required_patches.update({"Nvidia Tesla": all_hardware_patchset["Graphics"]["Nvidia Tesla"]})
if hardware_details["Graphics: Nvidia Web Drivers"] is True:
required_patches.update({"Non-Metal Common": all_hardware_patchset["Graphics"]["Non-Metal Common"]})
required_patches.update({"Non-Metal IOAccelerator Common": all_hardware_patchset["Graphics"]["Non-Metal IOAccelerator Common"]})
required_patches.update({"Non-Metal CoreDisplay Common": all_hardware_patchset["Graphics"]["Non-Metal CoreDisplay Common"]})
required_patches.update({"WebKit Monterey Common": all_hardware_patchset["Graphics"]["WebKit Monterey Common"]})
required_patches.update({"Nvidia Web Drivers": all_hardware_patchset["Graphics"]["Nvidia Web Drivers"]})
required_patches.update({"Non-Metal Enforcement": all_hardware_patchset["Graphics"]["Non-Metal Enforcement"]})
if hardware_details["Graphics: Nvidia Kepler"] is True:
required_patches.update({"Metal Common": all_hardware_patchset["Graphics"]["Metal Common"]})
required_patches.update({"Modern GVA": all_hardware_patchset["Graphics"]["Modern GVA"]})
required_patches.update({"Revert Metal Downgrade": all_hardware_patchset["Graphics"]["Revert Metal Downgrade"]})
required_patches.update({"Metal 3802 Common": all_hardware_patchset["Graphics"]["Metal 3802 Common"]})
required_patches.update({"Catalina GVA": all_hardware_patchset["Graphics"]["Catalina GVA"]})
required_patches.update({"Monterey OpenCL": all_hardware_patchset["Graphics"]["Monterey OpenCL"]})
required_patches.update({"Big Sur OpenCL": all_hardware_patchset["Graphics"]["Big Sur OpenCL"]})
required_patches.update({"WebKit Monterey Common": all_hardware_patchset["Graphics"]["WebKit Monterey Common"]})
required_patches.update({"Nvidia Kepler": all_hardware_patchset["Graphics"]["Nvidia Kepler"]})
for gpu in self.constants.computer.gpus:
# Handle mixed GPU situations (ie. MacBookPro11,3: Haswell iGPU + Kepler dGPU)
if gpu.arch == device_probe.Intel.Archs.Haswell:
if "Modern GVA" in required_patches:
del(required_patches["Modern GVA"])
required_patches.update({"GVA Work-Around": all_hardware_patchset["Graphics"]["GVA Work-Around"]})
if "Catalina GVA" in required_patches:
del(required_patches["Catalina GVA"])
break
if hardware_details["Graphics: AMD TeraScale 1"] is True:
required_patches.update({"Non-Metal Common": all_hardware_patchset["Graphics"]["Non-Metal Common"]})
required_patches.update({"WebKit Monterey Common": all_hardware_patchset["Graphics"]["WebKit Monterey Common"]})
required_patches.update({"AMD TeraScale Common": all_hardware_patchset["Graphics"]["AMD TeraScale Common"]})
required_patches.update({"AMD TeraScale 1": all_hardware_patchset["Graphics"]["AMD TeraScale 1"]})
if hardware_details["Graphics: AMD TeraScale 2"] is True:
required_patches.update({"Non-Metal Common": all_hardware_patchset["Graphics"]["Non-Metal Common"]})
required_patches.update({"Non-Metal IOAccelerator Common": all_hardware_patchset["Graphics"]["Non-Metal IOAccelerator Common"]})
required_patches.update({"WebKit Monterey Common": all_hardware_patchset["Graphics"]["WebKit Monterey Common"]})
required_patches.update({"AMD TeraScale Common": all_hardware_patchset["Graphics"]["AMD TeraScale Common"]})
required_patches.update({"AMD TeraScale 2": all_hardware_patchset["Graphics"]["AMD TeraScale 2"]})
if self.constants.allow_ts2_accel is False or self.constants.detected_os not in self.constants.legacy_accel_support:
# TeraScale 2 MacBooks with faulty GPUs are highly prone to crashing with AMDRadeonX3000 attached
# Additionally, AMDRadeonX3000 requires IOAccelerator downgrade which is not installed without 'Non-Metal IOAccelerator Common'
del(required_patches["AMD TeraScale 2"]["Install"]["/System/Library/Extensions"]["AMDRadeonX3000.kext"])
if hardware_details["Graphics: AMD Legacy GCN"] is True:
required_patches.update({"Revert Metal Downgrade": all_hardware_patchset["Graphics"]["Revert Metal Downgrade"]})
required_patches.update({"Monterey GVA": all_hardware_patchset["Graphics"]["Monterey GVA"]})
required_patches.update({"Monterey OpenCL": all_hardware_patchset["Graphics"]["Monterey OpenCL"]})
required_patches.update({"AMD Legacy GCN": all_hardware_patchset["Graphics"]["AMD Legacy GCN"]})
if "AVX2" not in self.constants.computer.cpu.leafs:
required_patches.update({"AMD OpenCL": all_hardware_patchset["Graphics"]["AMD OpenCL"]})
if hardware_details["Brightness: Legacy Backlight Control"] is True:
required_patches.update({"Legacy Brightness": all_hardware_patchset["Brightness"]["Legacy Brightness"]})
required_patches.update({"Legacy Backlight Control": all_hardware_patchset["Brightness"]["Legacy Backlight Control"]})
if hardware_details["Audio: Legacy Realtek"] is True:
if self.model in ["iMac7,1", "iMac8,1"]:
required_patches.update({"Legacy Realtek": all_hardware_patchset["Audio"]["Legacy Realtek"]})
else:
required_patches.update({"Legacy Non-GOP": all_hardware_patchset["Audio"]["Legacy Non-GOP"]})
if hardware_details["Networking: Legacy Wireless"] is True:
required_patches.update({"Legacy WiFi": all_hardware_patchset["Networking"]["Legacy WiFi"]})
required_patches.update({"Legacy Wireless": all_hardware_patchset["Networking"]["Legacy Wireless"]})
if hardware_details["Miscellaneous: Legacy GMUX"] is True:
required_patches.update({"Legacy GMUX": all_hardware_patchset["Miscellaneous"]["Legacy GMUX"]})
if hardware_details["Miscellaneous: Legacy Keyboard Backlight"] is True:
@@ -399,6 +537,11 @@ class detect_root_patch:
if required_patches:
host_os_float = float(f"{self.constants.detected_os}.{self.constants.detected_os_minor}")
# Prioritize Monterey GVA patches
if "Catalina GVA" in required_patches and "Monterey GVA" in required_patches:
del(required_patches["Catalina GVA"])
for patch_name in list(required_patches):
patch_os_min_float = float(f'{required_patches[patch_name]["OS Support"]["Minimum OS Support"]["OS Major"]}.{required_patches[patch_name]["OS Support"]["Minimum OS Support"]["OS Minor"]}')
patch_os_max_float = float(f'{required_patches[patch_name]["OS Support"]["Maximum OS Support"]["OS Major"]}.{required_patches[patch_name]["OS Support"]["Maximum OS Support"]["OS Minor"]}')

View File

@@ -1,12 +1,16 @@
# Additional support functions for sys_patch.py
# Copyright (C) 2020-2022, Dhinak G, Mykola Grymalyuk
from resources import generate_smbios
import subprocess
import tempfile
from data import os_data
from resources import generate_smbios, utilities
from pathlib import Path
from datetime import datetime
import plistlib
import os
from resources import constants
class sys_patch_helpers:
@@ -47,14 +51,20 @@ class sys_patch_helpers:
raise Exception("Failed to find AppleIntelSNBGraphicsFB.kext, cannot patch!!!")
def generate_patchset_plist(self, patchset, file_name):
def generate_patchset_plist(self, patchset, file_name, kdk_used):
source_path = f"{self.constants.payload_path}"
source_path_file = f"{source_path}/{file_name}"
kdk_string = "Not applicable"
if kdk_used:
kdk_string = kdk_used
data = {
"OpenCore Legacy Patcher": f"v{self.constants.patcher_version}",
"PatcherSupportPkg": f"v{self.constants.patcher_support_pkg_version}",
"Time Patched": f"{datetime.now().strftime('%B %d, %Y @ %H:%M:%S')}",
"Commit URL": f"{self.constants.commit_info[2]}",
"Kernel Debug Kit Used": f"{kdk_string}",
}
data.update(patchset)
if Path(source_path_file).exists():
@@ -63,4 +73,72 @@ class sys_patch_helpers:
plistlib.dump(data, Path(source_path_file).open("wb"), sort_keys=False)
if Path(source_path_file).exists():
return True
return False
return False
def install_kdk(self):
if not self.constants.kdk_download_path.exists():
return
print(f"- Installing downloaded KDK (this may take a while)")
with tempfile.TemporaryDirectory() as mount_point:
utilities.process_status(subprocess.run(["hdiutil", "attach", self.constants.kdk_download_path, "-mountpoint", mount_point, "-nobrowse"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
# Install the KDK
utilities.process_status(utilities.elevated(["installer", "-pkg", f"{mount_point}/KernelDebugKit.pkg", "-target", "/"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
subprocess.run(["hdiutil", "detach", mount_point], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) # Do not really care if this fails
print("- Successfully installed KDK")
def determine_kdk_present(self, match_closest=False, override_build=None):
# Check if KDK is present
# If 'match_closest' is True, will provide the closest match to the reported KDK
kdk_array = []
search_build = self.constants.detected_os_build
if override_build:
search_build = override_build
if not Path("/Library/Developer/KDKs").exists():
return None
for kdk_folder in Path("/Library/Developer/KDKs").iterdir():
if not kdk_folder.name.endswith(".kdk"):
continue
# Ensure direct match
if kdk_folder.name.endswith(f"{search_build}.kdk"):
# Verify that the KDK is valid
if (kdk_folder / Path("System/Library/Extensions/System.kext/PlugIns/Libkern.kext/Libkern")).exists():
return kdk_folder
if match_closest is True:
# ex: KDK_13.0_22A5266r.kdk -> 22A5266r.kdk -> 22A5266r
try:
build = kdk_folder.name.split("_")[2].split(".")[0]
# Don't append if Darwin Major is different
if build.startswith(str(self.constants.detected_os)):
kdk_array.append(build)
except IndexError:
pass
if match_closest is True:
result = os_data.os_conversion.find_largest_build(kdk_array)
print(f"- Closest KDK match to {search_build}: {result}")
for kdk_folder in Path("/Library/Developer/KDKs").iterdir():
if kdk_folder.name.endswith(f"{result}.kdk"):
# Verify that the KDK is valid
if (kdk_folder / Path("System/Library/Extensions/System.kext/PlugIns/Libkern.kext/Libkern")).exists():
return kdk_folder
return None
def disable_window_server_caching(self):
# On legacy GCN GPUs, the WindowServer cache generated creates
# corrupted Opaque shaders.
# To work-around this, we disable WindowServer caching
# And force macOS into properly generating the Opaque shaders
print("- Disabling WindowServer Caching")
# Invoke via 'bash -c' to resolve pathing
utilities.elevated(["bash", "-c", "rm -rf /private/var/folders/*/*/*/WindowServer/com.apple.WindowServer"])
# Disable writing to WindowServer folder
utilities.elevated(["bash", "-c", "chflags uchg /private/var/folders/*/*/*/WindowServer"])

View File

@@ -35,7 +35,9 @@ class check_binary_updates:
self.remote_version_array.append(0)
for i in range(0, len(self.remote_version_array)):
if self.remote_version_array[i] > self.binary_version_array[i]:
if int(self.remote_version_array[i]) < int(self.binary_version_array[i]):
break
elif int(self.remote_version_array[i]) > int(self.binary_version_array[i]):
return True
return False

View File

@@ -14,8 +14,9 @@ import time
import atexit
import requests
import shutil
import urllib.parse
from resources import constants, ioreg
from resources import constants, ioreg, amfi_detect
from data import sip_data, os_data
SESSION = requests.Session()
@@ -152,24 +153,6 @@ def enable_sleep_after_running():
sleep_process.kill()
sleep_process = None
def amfi_status():
amfi_args = [
"amfi_get_out_of_my_way=0x1",
"amfi_get_out_of_my_way=1",
"amfi=128",
]
oclp_guid = get_nvram("OCLP-Settings", "4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102", decode=True)
if oclp_guid:
if "-allow_amfi" in oclp_guid:
return False
boot_args = get_nvram("boot-args", decode=True)
if boot_args:
for arg in amfi_args:
if arg in boot_args:
return False
return True
def check_kext_loaded(kext_name, os_version):
if os_version > os_data.os_data.catalina:
@@ -270,18 +253,12 @@ def patching_status(os_sip, os):
# Detection for Root Patching
sip_enabled = True # System Integrity Protection
sbm_enabled = True # Secure Boot Status (SecureBootModel)
amfi_enabled = True # Apple Mobile File Integrity
fv_enabled = True # FileVault
dosdude_patched = True
gen6_kext = "/System/Library/Extension/AppleIntelHDGraphics.kext"
gen7_kext = "/System/Library/Extension/AppleIntelHD3000Graphics.kext"
if os > os_data.os_data.catalina:
amfi_enabled = amfi_status()
else:
# Catalina and older supports individually disabling Library Validation
amfi_enabled = False
sbm_enabled = check_secure_boot_level()
@@ -301,7 +278,7 @@ def patching_status(os_sip, os):
if not (Path(gen6_kext).exists() and Path(gen7_kext).exists()):
dosdude_patched = False
return sip_enabled, sbm_enabled, amfi_enabled, fv_enabled, dosdude_patched
return sip_enabled, sbm_enabled, fv_enabled, dosdude_patched
clear = True
@@ -400,7 +377,7 @@ def get_firmware_vendor(*, decode: bool = False):
def verify_network_connection(url):
try:
response = SESSION.head(url, timeout=5)
response = SESSION.head(url, timeout=5, allow_redirects=True)
return True
except (requests.exceptions.Timeout, requests.exceptions.TooManyRedirects, requests.exceptions.ConnectionError, requests.exceptions.HTTPError):
return False
@@ -408,33 +385,36 @@ def verify_network_connection(url):
def download_file(link, location, is_gui=None, verify_checksum=False):
if verify_network_connection(link):
disable_sleep_while_running()
short_link = os.path.basename(link)
base_name = Path(link).name
if Path(location).exists():
Path(location).unlink()
header = SESSION.head(link).headers
try:
# Try to get true file
# ex. Github's release links provides a "fake" header
# Thus need to resolve to the real link
link = SESSION.head(link).headers["location"]
header = SESSION.head(link).headers
except KeyError:
pass
head_response = SESSION.head(link, allow_redirects=True)
try:
# Handle cases where Content-Length has garbage or is missing
total_file_size = int(SESSION.head(link).headers['Content-Length'])
total_file_size = int(head_response.headers['Content-Length'])
except KeyError:
total_file_size = 0
if total_file_size > 1024:
file_size_rounded = round(total_file_size / 1024 / 1024, 2)
file_size_string = f" of {file_size_rounded}MB"
# Check if we have enough space
if total_file_size > get_free_space():
print(f"Not enough space to download {base_name} ({file_size_rounded}MB)")
return False
else:
file_size_string = ""
response = SESSION.get(link, stream=True)
# SU Catalog's link is quite long, strip to make it bearable
if "sucatalog.gz" in short_link:
short_link = "sucatalog.gz"
header = f"# Downloading: {short_link} #"
if "sucatalog.gz" in base_name:
base_name = "sucatalog.gz"
header = f"# Downloading: {base_name} #"
box_length = len(header)
box_string = "#" * box_length
dl = 0
@@ -487,6 +467,30 @@ def download_file(link, location, is_gui=None, verify_checksum=False):
print(link)
return None
def download_apple_developer_portal(link, location, is_gui=None, verify_checksum=False):
TOKEN_URL_BASE = "https://developerservices2.apple.com/services/download?path="
remote_path = urllib.parse.urlparse(link).path
token_url = urllib.parse.urlunparse(urllib.parse.urlparse(TOKEN_URL_BASE)._replace(query=urllib.parse.urlencode({"path": remote_path})))
try:
response = SESSION.get(token_url, timeout=5)
except (requests.exceptions.Timeout, requests.exceptions.TooManyRedirects, requests.exceptions.ConnectionError):
print(" - Could not contact Apple download servers")
return None
try:
response.raise_for_status()
except requests.exceptions.HTTPError:
if response.status_code == 400 and "The path specified is invalid" in response.text:
print(" - File does not exist on Apple download servers")
else:
print(" - Could not request download authorization from Apple download servers")
return None
return download_file(link, location, is_gui, verify_checksum)
def dump_constants(constants):
with open(os.path.join(os.path.expanduser('~'), 'Desktop', 'internal_data.txt'), 'w') as f:
f.write(str(vars(constants)))
@@ -574,7 +578,7 @@ def monitor_disk_output(disk):
def validate_link(link):
# Check if link is 404
try:
response = SESSION.head(link, timeout=5)
response = SESSION.head(link, timeout=5, allow_redirects=True)
if response.status_code == 404:
return False
else:
@@ -606,8 +610,11 @@ def block_os_updaters():
def check_boot_mode():
# Check whether we're in Safe Mode or not
sys_plist = plistlib.loads(subprocess.run(["system_profiler", "SPSoftwareDataType"], stdout=subprocess.PIPE).stdout)
return sys_plist[0]["_items"][0]["boot_mode"]
try:
sys_plist = plistlib.loads(subprocess.run(["system_profiler", "SPSoftwareDataType"], stdout=subprocess.PIPE).stdout)
return sys_plist[0]["_items"][0]["boot_mode"]
except (KeyError, TypeError, plistlib.InvalidFileException):
return None
def elevated(*args, **kwargs) -> subprocess.CompletedProcess:
# When running through our GUI, we run as root, however we do not get uid 0

View File

@@ -10,7 +10,11 @@ def validate(settings):
valid_dumps = [
example_data.MacBookPro.MacBookPro92_Stock,
example_data.MacBookPro.MacBookPro111_Stock,
example_data.MacBookPro.MacBookPro133_Stock,
# example_data.MacBookPro.MacBookPro171_Stock,
example_data.Macmini.Macmini52_Stock,
example_data.Macmini.Macmini61_Stock,
example_data.Macmini.Macmini71_Stock,
# example_data.Macmini.Macmini91_Stock,
example_data.iMac.iMac81_Stock,
example_data.iMac.iMac112_Stock,
@@ -81,16 +85,19 @@ def validate(settings):
raise Exception(f"Failed to find {source_file}")
print(f"- Validating against Darwin {major_kernel}.{minor_kernel}")
if not sys_patch_helpers.sys_patch_helpers(settings).generate_patchset_plist(patchset, "OpenCore-Legacy-Patcher"):
if not sys_patch_helpers.sys_patch_helpers(settings).generate_patchset_plist(patchset, f"OpenCore-Legacy-Patcher-{major_kernel}.{minor_kernel}.plist", None):
raise Exception("Failed to generate patchset plist")
# Remove the plist file after validation
Path(settings.payload_path / f"OpenCore-Legacy-Patcher-{major_kernel}.{minor_kernel}.plist").unlink()
def validate_sys_patch():
if Path(settings.payload_local_binaries_root_path_zip).exists():
print("Validating Root Patch File integrity")
if not Path(settings.payload_local_binaries_root_path).exists():
subprocess.run(["ditto", "-V", "-x", "-k", "--sequesterRsrc", "--rsrc", settings.payload_local_binaries_root_path_zip, settings.payload_path], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
for supported_os in [os_data.os_data.big_sur, os_data.os_data.monterey]:
for supported_os in [os_data.os_data.big_sur, os_data.os_data.monterey, os_data.os_data.ventura]:
for i in range(0, 10):
validate_root_patch_files(supported_os, i)
print("Validating SNB Board ID patcher")
@@ -99,26 +106,31 @@ def validate(settings):
else:
print("- Skipping Root Patch File integrity validation")
# First run is with default settings
build_prebuilt()
build_dumps()
# Second run, flip all settings
settings.verbose_debug = True
settings.opencore_debug = True
settings.opencore_build = "DEBUG"
settings.kext_debug = True
settings.kext_variant = "DEBUG"
settings.kext_debug = True
settings.showpicker = False
settings.sip_status = False
settings.secure_status = True
settings.firewire_boot = True
settings.nvme_boot = True
settings.enable_wake_on_wlan = True
settings.disable_tb = True
settings.force_surplus = True
settings.software_demux = True
settings.serial_settings = "Minimal"
build_prebuilt()
build_dumps()
validate_sys_patch()
def validate_configs():
# First run is with default settings
build_prebuilt()
build_dumps()
# Second run, flip all settings
settings.verbose_debug = True
settings.opencore_debug = True
settings.opencore_build = "DEBUG"
settings.kext_debug = True
settings.kext_variant = "DEBUG"
settings.kext_debug = True
settings.showpicker = False
settings.sip_status = False
settings.secure_status = True
settings.firewire_boot = True
settings.nvme_boot = True
settings.enable_wake_on_wlan = True
settings.disable_tb = True
settings.force_surplus = True
settings.software_demux = True
settings.serial_settings = "Minimal"
build_prebuilt()
build_dumps()
validate_configs()
validate_sys_patch()