mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-04-21 03:04:31 +10:00
Compare commits
74 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
37e99ba49c | ||
|
|
288b827616 | ||
|
|
e8a6f45329 | ||
|
|
a1ffadf582 | ||
|
|
a6c4890d0f | ||
|
|
00b47aef47 | ||
|
|
92f85feda5 | ||
|
|
21778e8d92 | ||
|
|
57d2597c86 | ||
|
|
20baf8c417 | ||
|
|
99a145e7cb | ||
|
|
79f4ba17d9 | ||
|
|
659d842023 | ||
|
|
037ff0f2c3 | ||
|
|
fac1298a6e | ||
|
|
273910b69a | ||
|
|
1974cd6341 | ||
|
|
bef429b758 | ||
|
|
bebbf646e1 | ||
|
|
6504442d4f | ||
|
|
ff0012e214 | ||
|
|
91e7ff40e4 | ||
|
|
07d09d8eb2 | ||
|
|
b95ab91b43 | ||
|
|
4cc9e414d2 | ||
|
|
a5d56147c0 | ||
|
|
3e8963c372 | ||
|
|
f4d6ef1741 | ||
|
|
abbb9c1c66 | ||
|
|
22b66e0a87 | ||
|
|
fd6c3d818d | ||
|
|
cefdd1df66 | ||
|
|
fcda4a26bf | ||
|
|
60f6482d43 | ||
|
|
c316e6f5fe | ||
|
|
d30972e5ef | ||
|
|
5206028478 | ||
|
|
00043087c4 | ||
|
|
d7ecdf3871 | ||
|
|
6fe7ed614c | ||
|
|
09f77490a5 | ||
|
|
1cc6d50474 | ||
|
|
549cb9fc9a | ||
|
|
a8ef84acf9 | ||
|
|
f55d3ba5b2 | ||
|
|
e46a5213a6 | ||
|
|
2331aeb6d9 | ||
|
|
1277fef735 | ||
|
|
5fdde346cf | ||
|
|
907ce75295 | ||
|
|
915d38eab1 | ||
|
|
8678200385 | ||
|
|
66e1cbcf1e | ||
|
|
e1568d9391 | ||
|
|
89069a85f0 | ||
|
|
5b2917cb03 | ||
|
|
73afdc37c3 | ||
|
|
f71fcf6f58 | ||
|
|
6169d593c5 | ||
|
|
f463e505d4 | ||
|
|
6c6ae6145d | ||
|
|
90310fcaca | ||
|
|
27d1ee3b02 | ||
|
|
2fba826f80 | ||
|
|
1f63dffd3f | ||
|
|
f4f4f3e1f3 | ||
|
|
4ffe6bed9b | ||
|
|
d3878e34a2 | ||
|
|
501b228b6b | ||
|
|
c707047530 | ||
|
|
1c24cfee24 | ||
|
|
ebd605d459 | ||
|
|
f4cb0bed68 | ||
|
|
0a395b47ae |
@@ -85,6 +85,8 @@ class create_binary:
|
|||||||
self.move_launcher()
|
self.move_launcher()
|
||||||
self.patch_load_command()
|
self.patch_load_command()
|
||||||
self.add_commit_data()
|
self.add_commit_data()
|
||||||
|
self.post_flight_cleanup()
|
||||||
|
self.mini_validate()
|
||||||
|
|
||||||
def build_binary(self):
|
def build_binary(self):
|
||||||
if Path(f"./dist/OpenCore-Patcher.app").exists():
|
if Path(f"./dist/OpenCore-Patcher.app").exists():
|
||||||
@@ -266,5 +268,31 @@ class create_binary:
|
|||||||
print(mv_output.stderr.decode('utf-8'))
|
print(mv_output.stderr.decode('utf-8'))
|
||||||
raise Exception("Move failed")
|
raise Exception("Move failed")
|
||||||
|
|
||||||
|
def post_flight_cleanup(self):
|
||||||
|
# Remove ./dist/OpenCore-Patcher
|
||||||
|
path = "./dist/OpenCore-Patcher"
|
||||||
|
print(f" - Removing {path}")
|
||||||
|
rm_output = subprocess.run(
|
||||||
|
["rm", "-rf", path],
|
||||||
|
stdout=subprocess.PIPE, stderr=subprocess.PIPE
|
||||||
|
)
|
||||||
|
if rm_output.returncode != 0:
|
||||||
|
print(f" - Remove failed: {path}")
|
||||||
|
print(rm_output.stderr.decode('utf-8'))
|
||||||
|
raise Exception(f"Remove failed: {path}")
|
||||||
|
|
||||||
|
def mini_validate(self):
|
||||||
|
# Ensure binary can start
|
||||||
|
# Only build a single config, TUI CI will do in-depth validation
|
||||||
|
print(" - Validating binary")
|
||||||
|
validate_output = subprocess.run(
|
||||||
|
["./dist/OpenCore-Patcher.app/Contents/MacOS/OpenCore-Patcher", "--build", "--model", "MacPro3,1"],
|
||||||
|
stdout=subprocess.PIPE, stderr=subprocess.PIPE
|
||||||
|
)
|
||||||
|
if validate_output.returncode != 0:
|
||||||
|
print(" - Validation failed")
|
||||||
|
print(validate_output.stderr.decode('utf-8'))
|
||||||
|
raise Exception("Validation failed")
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
create_binary()
|
create_binary()
|
||||||
78
CHANGELOG.md
78
CHANGELOG.md
@@ -1,5 +1,83 @@
|
|||||||
# OpenCore Legacy Patcher changelog
|
# OpenCore Legacy Patcher changelog
|
||||||
|
|
||||||
|
## 0.6.0
|
||||||
|
- Resolve external NVMe reporting regression from 0.5.2
|
||||||
|
- Implement Legacy Wireless support for Ventura
|
||||||
|
- Applicable for BCM94328, BCM94322 and Atheros chipsets
|
||||||
|
- Implement Wifi-only patches when no internet connection available but required (ie. KDKs)
|
||||||
|
- Allows users to install Legacy Wireless patches, then connect to the internet to install remaining patches
|
||||||
|
- Resolve `/Library/Extensions` not being cleaned on KDK-less root patches
|
||||||
|
- Add AMD Vega Graphics support for pre-AVX2.0 systems on Ventura
|
||||||
|
- ex. AMD Vega 56 and 64, AMD Radeon VII
|
||||||
|
- Note: As with Polaris, Vega GPUs cannot be mixed with AMD GCN 1-3 patches
|
||||||
|
- Patcher will prioritize the AMD GCN 1-3 (assumption that GCN is primary GPU, ex. MacPro6,1)
|
||||||
|
- Implement proper `APPLE SSD TS0128F/256F` detection
|
||||||
|
- Allows all Macs to utilize patch if required
|
||||||
|
- Avoids usage of patch when host lacks affected drive (ex. MacBookAir6,x with upgraded SSD)
|
||||||
|
- Prompt with auto patcher when booted OpenCore is out of date to root patcher
|
||||||
|
- ex. Booted OCLP is 0.5.2, root patcher is 0.5.3
|
||||||
|
- Disable native AMD Graphics on pre-Haswell Macs in Ventura
|
||||||
|
- Allows for easy root patching, dropping reliance on Safe Mode to boot
|
||||||
|
- Primarily applicable for iMacs and Mac Pros with AMD Polaris and Vega GPUs
|
||||||
|
- Implement mini validation during GUI build
|
||||||
|
- Add early UHCI/OHCI support (USB1.1)
|
||||||
|
- Implemented via Root Volume patching, ie. no installer support at this time
|
||||||
|
- Support should be seen as experimental, especially for laptops
|
||||||
|
- Applicable for Penryn Macs and Cheese Grater Mac Pros (MacPro3,1 - MacPro5,1)
|
||||||
|
- See associated issue for current limitations: [Legacy UHCI/OHCI support in Ventura](https://github.com/dortania/OpenCore-Legacy-Patcher/issues/1021)
|
||||||
|
- USB 3.0 controllers cannot be used along side USB 1.1 patches, OCLP will prioritize USB 3.0 support
|
||||||
|
- Add early non-Metal Graphics Acceleration support for macOS Ventura
|
||||||
|
- Applicable for following GPU architectures:
|
||||||
|
- Intel Ironlake and Sandy Bridge
|
||||||
|
- Nvidia Tesla, Maxwell and Pascal
|
||||||
|
- AMD TeraScale 1 and 2
|
||||||
|
- Notes:
|
||||||
|
- Bluetooth Pairing is currently semi-functional, see here for work around: [Tab+Space work-around](https://forums.macrumors.com/threads/macos-13-ventura-on-unsupported-macs-thread.2346881/post-31858759)
|
||||||
|
- AMFI currently needs to be outright disabled in Ventura
|
||||||
|
- Overall non-Metal improvements:
|
||||||
|
- Improved fake rim
|
||||||
|
- Fixed full screen animation
|
||||||
|
- Fixed split screen
|
||||||
|
- Improved menubar blur
|
||||||
|
- Add Nvidia Kepler GOP Driver injection
|
||||||
|
- Primarily for GPUs lacking GOPs and can't have a newer VBIOS flashed
|
||||||
|
- Resolve Rapid Security Response support for Haswell+ Macs requiring KDKs
|
||||||
|
- Implemented via:
|
||||||
|
- Userspace: [RSRRepair](https://github.com/flagersgit/RSRRepair) at `/etc/rc.server` (2b1c9e3)
|
||||||
|
- Kernelspace: [RSRHelper.kext](https://github.com/khronokernel/RSRHelper) (cbe1be9)
|
||||||
|
- Add APFS Trim Configuration
|
||||||
|
- Settings -> Misc Settings -> APFS Trim
|
||||||
|
- Increment Binaries:
|
||||||
|
- OpenCorePkg 0.8.8 - release
|
||||||
|
- PatcherSupportPkg 0.8.2 - release
|
||||||
|
- KDKlessWorkaround 1.0.0 - rolling (4924276)
|
||||||
|
- FeatureUnlock 1.1.2 - release
|
||||||
|
- CPUFriend 1.2.6 - release
|
||||||
|
- Lilu 1.6.3 - release
|
||||||
|
|
||||||
|
## 0.5.3
|
||||||
|
- Integrate FixPCIeLinkrate.efi v0.1.0
|
||||||
|
- Fixes link rate for PCIe 3.0 devices on MacPro3,1
|
||||||
|
- Resolve AppleIntelCPUPowerManagement Panic in Safe Mode
|
||||||
|
- Applicable for pre-Haswell Macs on Ventura
|
||||||
|
- Revert AppleALC 1.7.6 update back to 1.6.3
|
||||||
|
- Resolves audio issues on certain Intel HDEF devices
|
||||||
|
- Regression currently being investigated within AppleALC
|
||||||
|
- Remove `Force Web Drivers` option
|
||||||
|
- Avoids accidental use of non-Metal Web Drivers on Kepler GPUs
|
||||||
|
- Resolve silent auto patcher crash when new OCLP version is available
|
||||||
|
- Implement [`py_sip_xnu`](https://github.com/khronokernel/py_sip_xnu) module
|
||||||
|
- Resolve Content Caching Patch Regression
|
||||||
|
- Resolve KDK Versioning Fallback crashing when primary KDK site is down
|
||||||
|
- Resolve AirPlay to Mac support on Ventura with VMM
|
||||||
|
- Resolve WindowServer crashing on KDK-less with macOS 13.2 and Rapid Security Response updates
|
||||||
|
- Resolve Host Versioning when RSR is installed
|
||||||
|
- Resolve iMac7,1-8,1 and MacBookPro4,1 boot support in Ventura
|
||||||
|
- Increment Binaries:
|
||||||
|
- OpenCorePkg 0.8.7 - release
|
||||||
|
- FeatureUnlock 1.1.2 - rolling (94e29ce)
|
||||||
|
- WhateverGreen 1.6.2 - release
|
||||||
|
|
||||||
## 0.5.2
|
## 0.5.2
|
||||||
- Ventura Specific Updates:
|
- Ventura Specific Updates:
|
||||||
- Resolve AMD Polaris external display output support
|
- Resolve AMD Polaris external display output support
|
||||||
|
|||||||
10
README.md
10
README.md
@@ -89,6 +89,16 @@ To run the project from source, see here: [Build and run from source](./SOURCE.m
|
|||||||
* Endless hours helping architect and troubleshoot many portions of the project
|
* Endless hours helping architect and troubleshoot many portions of the project
|
||||||
* [flagers](https://github.com/flagersgit)
|
* [flagers](https://github.com/flagersgit)
|
||||||
* Aid with Nvidia Web Driver research and development
|
* Aid with Nvidia Web Driver research and development
|
||||||
|
* [joevt](https://github.com/joevt)
|
||||||
|
* [FixPCIeLinkrate](https://github.com/joevt/joevtApps)
|
||||||
|
* Amazing users who've graciously donate hardware:
|
||||||
|
* [JohnD](https://forums.macrumors.com/members/johnd.53633/) - 2013 Mac Pro
|
||||||
|
* [SpiGAndromeda](https://github.com/SpiGAndromeda) - AMD Vega 64
|
||||||
|
* [turbomacs](https://github.com/turbomacs) - 2014 5k iMac
|
||||||
|
* [vinaypundith](https://forums.macrumors.com/members/vinaypundith.1212357/) - MacBook7,1
|
||||||
|
* zephar - 2008 Mac Pro
|
||||||
|
* jazo97 - 2011 15" MacBook Pro
|
||||||
|
* And others (reach out if we forgot you!)
|
||||||
* MacRumors and Unsupported Mac Communities
|
* MacRumors and Unsupported Mac Communities
|
||||||
* Endless testing, reporting issues
|
* Endless testing, reporting issues
|
||||||
* Apple
|
* Apple
|
||||||
|
|||||||
@@ -81,13 +81,12 @@ def SystemPatchDictionary(os_major, os_minor, non_metal_os_support):
|
|||||||
"/Library/Application Support/SkyLightPlugins": {
|
"/Library/Application Support/SkyLightPlugins": {
|
||||||
**({ "DropboxHack.dylib": "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 {}),
|
**({ "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": {
|
"Processes": {
|
||||||
# 'When Space Allows' option introduced in 12.4 (XNU 21.5)
|
# 'When Space Allows' option introduced in 12.4 (XNU 21.5)
|
||||||
**({"defaults write /Library/Preferences/.GlobalPreferences.plist ShowDate -int 1": True } if os_data.os_conversion.is_os_newer(os_data.os_data.monterey, 4, os_major, os_minor) else {}),
|
**({"defaults write /Library/Preferences/.GlobalPreferences.plist ShowDate -int 1": True } if os_data.os_conversion.is_os_newer(os_data.os_data.monterey, 4, os_major, os_minor) else {}),
|
||||||
|
"defaults write /Library/Preferences/.GlobalPreferences.plist InternalDebugUseGPUProcessForCanvasRenderingEnabled -bool false": True,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"Non-Metal IOAccelerator Common": {
|
"Non-Metal IOAccelerator Common": {
|
||||||
@@ -630,6 +629,7 @@ def SystemPatchDictionary(os_major, os_minor, non_metal_os_support):
|
|||||||
"AMD8000Controller.kext": "12.5",
|
"AMD8000Controller.kext": "12.5",
|
||||||
"AMD9000Controller.kext": "12.5",
|
"AMD9000Controller.kext": "12.5",
|
||||||
"AMD9500Controller.kext": "12.5",
|
"AMD9500Controller.kext": "12.5",
|
||||||
|
"AMD10000Controller.kext": "12.5",
|
||||||
"AMDRadeonX4000.kext": "12.5",
|
"AMDRadeonX4000.kext": "12.5",
|
||||||
"AMDRadeonX4000HWServices.kext": "12.5",
|
"AMDRadeonX4000HWServices.kext": "12.5",
|
||||||
"AMDFramebuffer.kext": "12.5",
|
"AMDFramebuffer.kext": "12.5",
|
||||||
@@ -640,14 +640,6 @@ def SystemPatchDictionary(os_major, os_minor, non_metal_os_support):
|
|||||||
"AMDShared.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",
|
|
||||||
],
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
# Used only for AMD Polaris with host lacking AVX2.0
|
# Used only for AMD Polaris with host lacking AVX2.0
|
||||||
# Note missing framebuffers are not restored (ex. 'ATY,Berbice')
|
# Note missing framebuffers are not restored (ex. 'ATY,Berbice')
|
||||||
@@ -673,6 +665,51 @@ def SystemPatchDictionary(os_major, os_minor, non_metal_os_support):
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
"AMD Legacy Vega": {
|
||||||
|
"Display Name": "Graphics: AMD Legacy Vega",
|
||||||
|
"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/Extensions": {
|
||||||
|
"AMDRadeonX5000.kext": "12.5",
|
||||||
|
|
||||||
|
"AMDRadeonX5000GLDriver.bundle": "12.5",
|
||||||
|
"AMDRadeonX5000MTLDriver.bundle": "12.5",
|
||||||
|
"AMDRadeonX5000Shared.bundle": "12.5",
|
||||||
|
|
||||||
|
"AMDShared.bundle": "12.5",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
# Support mixed legacy and modern AMD GPUs
|
||||||
|
# Specifically systems using AMD GCN 1-3 and Vega (ex. MacPro6,1 with eGPU)
|
||||||
|
# Assume 'AMD Legacy GCN' patchset is installed alongside this
|
||||||
|
"AMD Legacy Vega Extended": {
|
||||||
|
"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/Extensions": {
|
||||||
|
"AMDRadeonX5000HWServices.kext": "12.5",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
"Intel Ironlake": {
|
"Intel Ironlake": {
|
||||||
"Display Name": "Graphics: Intel Ironlake",
|
"Display Name": "Graphics: Intel Ironlake",
|
||||||
"OS Support": {
|
"OS Support": {
|
||||||
@@ -874,25 +911,50 @@ def SystemPatchDictionary(os_major, os_minor, non_metal_os_support):
|
|||||||
"OS Minor": 0
|
"OS Minor": 0
|
||||||
},
|
},
|
||||||
"Maximum OS Support": {
|
"Maximum OS Support": {
|
||||||
"OS Major": os_data.os_data.monterey,
|
"OS Major": os_data.os_data.max_os,
|
||||||
"OS Minor": 99
|
"OS Minor": 99
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"Install": {
|
"Install": {
|
||||||
"/usr/libexec": {
|
"/usr/libexec": {
|
||||||
"airportd": "11.5.2",
|
"airportd": "11.7.1",
|
||||||
},
|
},
|
||||||
"/System/Library/CoreServices": {
|
"/System/Library/CoreServices": {
|
||||||
"WiFiAgent.app": "11.5.2",
|
"WiFiAgent.app": "11.7.1",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"Install Non-Root": {
|
"Install Non-Root": {
|
||||||
"/Library/Application Support/SkyLightPlugins": {
|
"/Library/Application Support/SkyLightPlugins": {
|
||||||
**({ "CoreWLAN.dylib": "SkyLightPlugins" } if os_major >= os_data.os_data.monterey else {}),
|
**({ "CoreWLAN.dylib": "SkyLightPlugins" } if os_major == os_data.os_data.monterey else {}),
|
||||||
**({ "CoreWLAN.txt": "SkyLightPlugins" } if os_major >= os_data.os_data.monterey else {}),
|
**({ "CoreWLAN.txt": "SkyLightPlugins" } if os_major == os_data.os_data.monterey else {}),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
"Legacy Wireless Extended": {
|
||||||
|
"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": {
|
||||||
|
"/usr/libexec": {
|
||||||
|
"wps": "12.6.2",
|
||||||
|
},
|
||||||
|
"/System/Library/Frameworks": {
|
||||||
|
"CoreWLAN.framework": "12.6.2",
|
||||||
|
},
|
||||||
|
"/System/Library/PrivateFrameworks": {
|
||||||
|
"CoreWiFi.framework": "12.6.2",
|
||||||
|
"IO80211.framework": "12.6.2",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"Brightness": {
|
"Brightness": {
|
||||||
"Legacy Backlight Control": {
|
"Legacy Backlight Control": {
|
||||||
@@ -967,6 +1029,28 @@ def SystemPatchDictionary(os_major, os_minor, non_metal_os_support):
|
|||||||
"defaults write /Library/Preferences/.GlobalPreferences.plist Moraea_BacklightHack -bool true": True,
|
"defaults write /Library/Preferences/.GlobalPreferences.plist Moraea_BacklightHack -bool true": True,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
"Legacy USB 1.1": {
|
||||||
|
"Display Name": "Miscellaneous: Legacy USB 1.1",
|
||||||
|
"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/Extensions/IOUSBHostFamily.kext/Contents/MacOS": {
|
||||||
|
"IOUSBHostFamily": "12.6.2",
|
||||||
|
},
|
||||||
|
"/System/Library/Extensions/IOUSBHostFamily.kext/Contents/PlugIns": {
|
||||||
|
"AppleUSBEHCI.kext": "12.6.2",
|
||||||
|
"AppleUSBHub.kext": "12.6.2",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,11 @@ Next, run the `OpenCore-Patcher.app`:
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
::: warning
|
||||||
|
OpenCore configurations are hardware specific.
|
||||||
|
If you're building OpenCore for a different model than you're currently running, it is absolutely necessary to select the proper model from Settings.
|
||||||
|
:::
|
||||||
|
|
||||||
Here we'll select Build and Install OpenCore and start building:
|
Here we'll select Build and Install OpenCore and start building:
|
||||||
|
|
||||||
| Start Building | Finished Building |
|
| Start Building | Finished Building |
|
||||||
|
|||||||
@@ -47,9 +47,10 @@ For users with 2008 to 2013 Mac Pros (MacPro3,1-6,1) and 2009 to 2011 iMacs (iMa
|
|||||||
|
|
||||||
* CPUs supporting AVX2.0 are Haswell or newer, which no pre-2019 Mac Pros can be upgraded with.
|
* CPUs supporting AVX2.0 are Haswell or newer, which no pre-2019 Mac Pros can be upgraded with.
|
||||||
|
|
||||||
Currently at this time, OpenCore Legacy Patcher only supports patching the AMD Polaris Graphics stack to no longer require AVX2.0. However due to lack of hardware on-hand, we cannot support AMD Vega or Navi on Ventura.
|
Currently at this time, OpenCore Legacy Patcher only supports patching the AMD Polaris Graphics stack to no longer require AVX2.0. However due to lack of hardware on-hand, we cannot support Navi on Ventura.
|
||||||
|
|
||||||
* If you have spare Vega or Navi GPUs you'd like to donate, feel free to reach out: khronokernel@icloud.com
|
* If you have spare Navi GPU you'd like to donate, feel free to reach out: khronokernel@icloud.com
|
||||||
|
* Thanks to a gracious user, we've gotten an AMD Vega 64 on-hand for testing. No time estimate can be provided for Vega support at this time.
|
||||||
|
|
||||||
Additionally, the native stack will crash over and over on macOS Ventura as it fails to load the AVX2.0-based binaries. Thus to patch Ventura, you will need to boot in Safe Mode and run OCLP's Root Volume Patcher
|
Additionally, the native stack will crash over and over on macOS Ventura as it fails to load the AVX2.0-based binaries. Thus to patch Ventura, you will need to boot in Safe Mode and run OCLP's Root Volume Patcher
|
||||||
|
|
||||||
|
|||||||
@@ -1527,6 +1527,42 @@
|
|||||||
<key>PlistPath</key>
|
<key>PlistPath</key>
|
||||||
<string>Contents/Info.plist</string>
|
<string>Contents/Info.plist</string>
|
||||||
</dict>
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>Arch</key>
|
||||||
|
<string>x86_64</string>
|
||||||
|
<key>BundlePath</key>
|
||||||
|
<string>KDKlessWorkaround.kext</string>
|
||||||
|
<key>Comment</key>
|
||||||
|
<string>KDKlessWorkaround</string>
|
||||||
|
<key>Enabled</key>
|
||||||
|
<false/>
|
||||||
|
<key>ExecutablePath</key>
|
||||||
|
<string>Contents/MacOS/KDKlessWorkaround</string>
|
||||||
|
<key>MaxKernel</key>
|
||||||
|
<string></string>
|
||||||
|
<key>MinKernel</key>
|
||||||
|
<string>22.3.0</string>
|
||||||
|
<key>PlistPath</key>
|
||||||
|
<string>Contents/Info.plist</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>Arch</key>
|
||||||
|
<string>x86_64</string>
|
||||||
|
<key>BundlePath</key>
|
||||||
|
<string>RSRHelper.kext</string>
|
||||||
|
<key>Comment</key>
|
||||||
|
<string>RSRHelper</string>
|
||||||
|
<key>Enabled</key>
|
||||||
|
<false/>
|
||||||
|
<key>ExecutablePath</key>
|
||||||
|
<string>Contents/MacOS/RSRHelper</string>
|
||||||
|
<key>MaxKernel</key>
|
||||||
|
<string></string>
|
||||||
|
<key>MinKernel</key>
|
||||||
|
<string>20.0.0</string>
|
||||||
|
<key>PlistPath</key>
|
||||||
|
<string>Contents/Info.plist</string>
|
||||||
|
</dict>
|
||||||
</array>
|
</array>
|
||||||
<key>Block</key>
|
<key>Block</key>
|
||||||
<array/>
|
<array/>
|
||||||
@@ -1977,6 +2013,8 @@
|
|||||||
<integer>0</integer>
|
<integer>0</integer>
|
||||||
<key>HibernateMode</key>
|
<key>HibernateMode</key>
|
||||||
<string>Auto</string>
|
<string>Auto</string>
|
||||||
|
<key>HibernateSkipsPicker</key>
|
||||||
|
<true/>
|
||||||
<key>HideAuxiliary</key>
|
<key>HideAuxiliary</key>
|
||||||
<true/>
|
<true/>
|
||||||
<key>LauncherPath</key>
|
<key>LauncherPath</key>
|
||||||
@@ -1994,7 +2032,7 @@
|
|||||||
<key>PollAppleHotKeys</key>
|
<key>PollAppleHotKeys</key>
|
||||||
<true/>
|
<true/>
|
||||||
<key>ShowPicker</key>
|
<key>ShowPicker</key>
|
||||||
<string>SkipOnHibernateWake</string>
|
<true/>
|
||||||
<key>TakeoffDelay</key>
|
<key>TakeoffDelay</key>
|
||||||
<integer>0</integer>
|
<integer>0</integer>
|
||||||
<key>Timeout</key>
|
<key>Timeout</key>
|
||||||
@@ -2173,6 +2211,8 @@
|
|||||||
<string>OCLP-Spoofed-MLB</string>
|
<string>OCLP-Spoofed-MLB</string>
|
||||||
<string>revcpu</string>
|
<string>revcpu</string>
|
||||||
<string>revcpuname</string>
|
<string>revcpuname</string>
|
||||||
|
<string>revblock</string>
|
||||||
|
<string>revpatch</string>
|
||||||
</array>
|
</array>
|
||||||
<key>7C436110-AB2A-4BBB-A880-FE41995C9F82</key>
|
<key>7C436110-AB2A-4BBB-A880-FE41995C9F82</key>
|
||||||
<array>
|
<array>
|
||||||
@@ -2517,6 +2557,30 @@
|
|||||||
<key>LoadEarly</key>
|
<key>LoadEarly</key>
|
||||||
<false/>
|
<false/>
|
||||||
</dict>
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>Comment</key>
|
||||||
|
<string></string>
|
||||||
|
<key>Path</key>
|
||||||
|
<string>NVGOP_GK.efi</string>
|
||||||
|
<key>Enabled</key>
|
||||||
|
<false/>
|
||||||
|
<key>Arguments</key>
|
||||||
|
<string></string>
|
||||||
|
<key>LoadEarly</key>
|
||||||
|
<false/>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>Comment</key>
|
||||||
|
<string></string>
|
||||||
|
<key>Path</key>
|
||||||
|
<string>FixPCIeLinkRate.efi</string>
|
||||||
|
<key>Enabled</key>
|
||||||
|
<false/>
|
||||||
|
<key>Arguments</key>
|
||||||
|
<string></string>
|
||||||
|
<key>LoadEarly</key>
|
||||||
|
<false/>
|
||||||
|
</dict>
|
||||||
</array>
|
</array>
|
||||||
<key>Input</key>
|
<key>Input</key>
|
||||||
<dict>
|
<dict>
|
||||||
|
|||||||
BIN
payloads/Drivers/FixPCIeLinkRate.efi
Normal file
BIN
payloads/Drivers/FixPCIeLinkRate.efi
Normal file
Binary file not shown.
BIN
payloads/Drivers/NVGOP_GK.efi
Normal file
BIN
payloads/Drivers/NVGOP_GK.efi
Normal file
Binary file not shown.
BIN
payloads/Kexts/Acidanthera/AppleALC-v1.6.3-DEBUG.zip
Normal file
BIN
payloads/Kexts/Acidanthera/AppleALC-v1.6.3-DEBUG.zip
Normal file
Binary file not shown.
BIN
payloads/Kexts/Acidanthera/AppleALC-v1.6.3-RELEASE.zip
Normal file
BIN
payloads/Kexts/Acidanthera/AppleALC-v1.6.3-RELEASE.zip
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
payloads/Kexts/Acidanthera/CPUFriend-v1.2.6-DEBUG.zip
Normal file
BIN
payloads/Kexts/Acidanthera/CPUFriend-v1.2.6-DEBUG.zip
Normal file
Binary file not shown.
BIN
payloads/Kexts/Acidanthera/CPUFriend-v1.2.6-RELEASE.zip
Normal file
BIN
payloads/Kexts/Acidanthera/CPUFriend-v1.2.6-RELEASE.zip
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
payloads/Kexts/Acidanthera/FeatureUnlock-v1.1.2-DEBUG.zip
Normal file
BIN
payloads/Kexts/Acidanthera/FeatureUnlock-v1.1.2-DEBUG.zip
Normal file
Binary file not shown.
BIN
payloads/Kexts/Acidanthera/FeatureUnlock-v1.1.2-RELEASE.zip
Normal file
BIN
payloads/Kexts/Acidanthera/FeatureUnlock-v1.1.2-RELEASE.zip
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
payloads/Kexts/Acidanthera/Lilu-v1.6.3-DEBUG.zip
Normal file
BIN
payloads/Kexts/Acidanthera/Lilu-v1.6.3-DEBUG.zip
Normal file
Binary file not shown.
BIN
payloads/Kexts/Acidanthera/Lilu-v1.6.3-RELEASE.zip
Normal file
BIN
payloads/Kexts/Acidanthera/Lilu-v1.6.3-RELEASE.zip
Normal file
Binary file not shown.
BIN
payloads/Kexts/Acidanthera/RSRHelper-v1.0.0-DEBUG.zip
Normal file
BIN
payloads/Kexts/Acidanthera/RSRHelper-v1.0.0-DEBUG.zip
Normal file
Binary file not shown.
BIN
payloads/Kexts/Acidanthera/RSRHelper-v1.0.0-RELEASE.zip
Normal file
BIN
payloads/Kexts/Acidanthera/RSRHelper-v1.0.0-RELEASE.zip
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
payloads/Kexts/Acidanthera/WhateverGreen-v1.6.3-DEBUG.zip
Normal file
BIN
payloads/Kexts/Acidanthera/WhateverGreen-v1.6.3-DEBUG.zip
Normal file
Binary file not shown.
BIN
payloads/Kexts/Acidanthera/WhateverGreen-v1.6.3-RELEASE.zip
Normal file
BIN
payloads/Kexts/Acidanthera/WhateverGreen-v1.6.3-RELEASE.zip
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
payloads/Kexts/Misc/KDKlessWorkaround-v1.0.0-DEBUG.zip
Normal file
BIN
payloads/Kexts/Misc/KDKlessWorkaround-v1.0.0-DEBUG.zip
Normal file
Binary file not shown.
BIN
payloads/Kexts/Misc/KDKlessWorkaround-v1.0.0-RELEASE.zip
Normal file
BIN
payloads/Kexts/Misc/KDKlessWorkaround-v1.0.0-RELEASE.zip
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,89 +0,0 @@
|
|||||||
#!/usr/bin/env python3
|
|
||||||
# Simple script to delete unnecessary files from OpenCore and move into place
|
|
||||||
# To use, simply :
|
|
||||||
# - Download an OpenCore build
|
|
||||||
# - Place the X64 folder in the /payloads/OpenCore folder
|
|
||||||
# - Rename to OpenCore-VERSION (ie. DEBUG or RELEASE)
|
|
||||||
# - Run script
|
|
||||||
# - Rename folders to appropriate versions (ie. OpenCore-Build)
|
|
||||||
# - Zip folders
|
|
||||||
# TODO:
|
|
||||||
# - Download latest builds from dortania.github.io
|
|
||||||
|
|
||||||
import subprocess
|
|
||||||
from pathlib import Path
|
|
||||||
|
|
||||||
build_types = [
|
|
||||||
"DEBUG",
|
|
||||||
"RELEASE",
|
|
||||||
]
|
|
||||||
|
|
||||||
bad_drivers = [
|
|
||||||
"AudioDxe.efi",
|
|
||||||
"BiosVideo.efi",
|
|
||||||
"CrScreenshotDxe.efi",
|
|
||||||
"Ext4Dxe.efi",
|
|
||||||
"HiiDatabase.efi",
|
|
||||||
"NvmExpressDxe.efi",
|
|
||||||
"OpenHfsPlus.efi",
|
|
||||||
"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 = [
|
|
||||||
"ChipTune.efi",
|
|
||||||
"CleanNvram.efi",
|
|
||||||
"ControlMsrE2.efi",
|
|
||||||
"GopStop.efi",
|
|
||||||
"KeyTester.efi",
|
|
||||||
"MmapDump.efi",
|
|
||||||
"OpenControl.efi",
|
|
||||||
"ResetSystem.efi",
|
|
||||||
"RtcRw.efi",
|
|
||||||
"CsrUtil.efi",
|
|
||||||
"TpmInfo.efi",
|
|
||||||
]
|
|
||||||
|
|
||||||
for version in build_types:
|
|
||||||
print("- Creating S/L/C")
|
|
||||||
subprocess.run(f"mkdir -p ./OpenCore-{version}/System/Library/CoreServices".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
|
|
||||||
print("- Creating boot.efi Bootstrap")
|
|
||||||
subprocess.run(f"cp ./OpenCore-{version}/EFI/BOOT/BOOTx64.efi ./OpenCore-{version}/System/Library/CoreServices/boot.efi".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
|
|
||||||
print("- Deleting old BOOTx64.efi")
|
|
||||||
subprocess.run(f"rm -R ./OpenCore-{version}/EFI/BOOT/".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
|
|
||||||
for delete_drivers in bad_drivers:
|
|
||||||
if Path(f"./OpenCore-{version}/EFI/OC/Drivers/{delete_drivers}").exists():
|
|
||||||
print(f"- Deleting {delete_drivers}")
|
|
||||||
subprocess.run(f"rm ./OpenCore-{version}/EFI/OC/Drivers/{delete_drivers}".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
|
|
||||||
else:
|
|
||||||
print(f"- Unable to find {delete_drivers}, skipping")
|
|
||||||
for delete_tools in bad_tools:
|
|
||||||
if Path(f".//OpenCore-{version}/EFI/OC/Tools/{delete_tools}").exists():
|
|
||||||
print(f"- Deleting {delete_tools}")
|
|
||||||
subprocess.run(f"rm ./OpenCore-{version}/EFI/OC/Tools/{delete_tools}".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
|
|
||||||
else:
|
|
||||||
print(f"- Unable to find {delete_tools}, skipping")
|
|
||||||
|
|
||||||
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()
|
|
||||||
286
payloads/OpenCore/generate.command
Executable file
286
payloads/OpenCore/generate.command
Executable file
@@ -0,0 +1,286 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
# Script to download and generate valid OpenCorePkg folder/file structure for use with OpenCore-Legacy-Patcher
|
||||||
|
# To use:
|
||||||
|
# - Download OpenCore-{VERSION}-{VARIANT}.zip
|
||||||
|
# - If no files are found, the script will download the latest version
|
||||||
|
# - Place zips in same directory as this script
|
||||||
|
# - Run script
|
||||||
|
|
||||||
|
|
||||||
|
import subprocess
|
||||||
|
from pathlib import Path
|
||||||
|
import requests
|
||||||
|
|
||||||
|
REPO_URL = "https://api.github.com/repos/acidanthera/OpenCorePkg/releases/latest"
|
||||||
|
|
||||||
|
BUILD_VARIANTS = [
|
||||||
|
"DEBUG",
|
||||||
|
"RELEASE"
|
||||||
|
]
|
||||||
|
|
||||||
|
UNUSED_DRIVERS = [
|
||||||
|
"AudioDxe.efi",
|
||||||
|
"BiosVideo.efi",
|
||||||
|
"CrScreenshotDxe.efi",
|
||||||
|
"Ext4Dxe.efi",
|
||||||
|
"HiiDatabase.efi",
|
||||||
|
"NvmExpressDxe.efi",
|
||||||
|
"OpenHfsPlus.efi",
|
||||||
|
"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",
|
||||||
|
]
|
||||||
|
|
||||||
|
UNUSED_TOOLS = [
|
||||||
|
"ChipTune.efi",
|
||||||
|
"CleanNvram.efi",
|
||||||
|
"ControlMsrE2.efi",
|
||||||
|
"GopStop.efi",
|
||||||
|
"KeyTester.efi",
|
||||||
|
"MmapDump.efi",
|
||||||
|
"OpenControl.efi",
|
||||||
|
"ResetSystem.efi",
|
||||||
|
"RtcRw.efi",
|
||||||
|
"CsrUtil.efi",
|
||||||
|
"TpmInfo.efi",
|
||||||
|
]
|
||||||
|
|
||||||
|
IMPORTANT_UTILITIES = [
|
||||||
|
"macserial",
|
||||||
|
"ocvalidate",
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class GenerateOpenCore:
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
print("Generating new OpenCore bundles...")
|
||||||
|
|
||||||
|
self.working_dir = None
|
||||||
|
|
||||||
|
self.set_directory()
|
||||||
|
self.validate_files()
|
||||||
|
self.generate()
|
||||||
|
|
||||||
|
print("New OpenCore bundles generated!")
|
||||||
|
|
||||||
|
def set_directory(self):
|
||||||
|
self.working_dir = Path(__file__).parent.absolute()
|
||||||
|
print(f"Working directory: {self.working_dir}")
|
||||||
|
|
||||||
|
self.debug_zip = None
|
||||||
|
self.release_zip = None
|
||||||
|
|
||||||
|
# Find OpenCore DEBUG zip
|
||||||
|
for file in self.working_dir.iterdir():
|
||||||
|
if file.name.endswith("DEBUG.zip") and file.name != "OpenCore-DEBUG.zip":
|
||||||
|
print(f" Found DEBUG zip: {file.name}")
|
||||||
|
self.debug_zip = file
|
||||||
|
|
||||||
|
# Find OpenCore RELEASE zip
|
||||||
|
for file in self.working_dir.iterdir():
|
||||||
|
if file.name.endswith("RELEASE.zip") and file.name != "OpenCore-RELEASE.zip":
|
||||||
|
print(f" Found RELEASE zip: {file.name}")
|
||||||
|
self.release_zip = file
|
||||||
|
|
||||||
|
if self.debug_zip is None:
|
||||||
|
self.download_new_binaries("DEBUG")
|
||||||
|
|
||||||
|
if self.release_zip is None:
|
||||||
|
self.download_new_binaries("RELEASE")
|
||||||
|
|
||||||
|
|
||||||
|
# Unzip both, rename to OpenCore-DEBUG and OpenCore-RELEASE
|
||||||
|
print("Unzipping DEBUG zip...")
|
||||||
|
subprocess.run (
|
||||||
|
["unzip", f"{self.debug_zip}", "-d", f"{self.working_dir}/OpenCore-DEBUG-ROOT"],
|
||||||
|
stdout=subprocess.PIPE, stderr=subprocess.PIPE
|
||||||
|
)
|
||||||
|
|
||||||
|
print("Unzipping RELEASE zip...")
|
||||||
|
subprocess.run (
|
||||||
|
["unzip", f"{self.release_zip}", "-d", f"{self.working_dir}/OpenCore-RELEASE-ROOT"],
|
||||||
|
stdout=subprocess.PIPE, stderr=subprocess.PIPE
|
||||||
|
)
|
||||||
|
|
||||||
|
for variant in BUILD_VARIANTS:
|
||||||
|
print(f"Moving {variant} folder...")
|
||||||
|
subprocess.run (
|
||||||
|
["mv", f"{self.working_dir}/OpenCore-{variant}-ROOT/X64", f"{self.working_dir}/OpenCore-{variant}"],
|
||||||
|
stdout=subprocess.PIPE, stderr=subprocess.PIPE
|
||||||
|
)
|
||||||
|
if variant == "DEBUG":
|
||||||
|
for utility in IMPORTANT_UTILITIES:
|
||||||
|
print(f"Moving {utility} from {variant} variant...")
|
||||||
|
subprocess.run (
|
||||||
|
["rm", "-rf", f"{self.working_dir}/{utility}"],
|
||||||
|
stdout=subprocess.PIPE, stderr=subprocess.PIPE
|
||||||
|
)
|
||||||
|
subprocess.run (
|
||||||
|
["mv", f"{self.working_dir}/OpenCore-{variant}-ROOT/Utilities/{utility}/{utility}", f"{self.working_dir}/{utility}"],
|
||||||
|
stdout=subprocess.PIPE, stderr=subprocess.PIPE
|
||||||
|
)
|
||||||
|
|
||||||
|
# Remove root folder
|
||||||
|
subprocess.run (
|
||||||
|
["rm", "-rf", f"{self.working_dir}/OpenCore-{variant}-ROOT"],
|
||||||
|
stdout=subprocess.PIPE, stderr=subprocess.PIPE
|
||||||
|
)
|
||||||
|
|
||||||
|
# Remove zip files
|
||||||
|
print("Removing zip files...")
|
||||||
|
# remove debug_zip
|
||||||
|
subprocess.run (
|
||||||
|
["rm", "-rf", self.debug_zip],
|
||||||
|
stdout=subprocess.PIPE, stderr=subprocess.PIPE
|
||||||
|
)
|
||||||
|
# remove release_zip
|
||||||
|
subprocess.run (
|
||||||
|
["rm", "-rf", self.release_zip],
|
||||||
|
stdout=subprocess.PIPE, stderr=subprocess.PIPE
|
||||||
|
)
|
||||||
|
|
||||||
|
def download_new_binaries(self, variant):
|
||||||
|
# Get latest release
|
||||||
|
print(f"Getting latest {variant}...")
|
||||||
|
latest_release = requests.get(REPO_URL).json()
|
||||||
|
|
||||||
|
# Get latest release download url
|
||||||
|
print(f" Getting latest {variant} download url...")
|
||||||
|
for asset in latest_release["assets"]:
|
||||||
|
if asset["name"].endswith(f"{variant}.zip"):
|
||||||
|
download_url = asset["browser_download_url"]
|
||||||
|
print(f" Download url: {download_url}")
|
||||||
|
break
|
||||||
|
|
||||||
|
if variant == "DEBUG":
|
||||||
|
self.debug_zip = f"{self.working_dir}/{asset['name']}"
|
||||||
|
elif variant == "RELEASE":
|
||||||
|
self.release_zip = f"{self.working_dir}/{asset['name']}"
|
||||||
|
else:
|
||||||
|
raise ValueError("Invalid variant!")
|
||||||
|
|
||||||
|
# Download latest release
|
||||||
|
print(f" Downloading latest {variant}...")
|
||||||
|
download = requests.get(download_url)
|
||||||
|
with open(f"{self.working_dir}/{asset['name']}", "wb") as f:
|
||||||
|
f.write(download.content)
|
||||||
|
|
||||||
|
def clean_old_bundles(self):
|
||||||
|
print("Cleaning old bundles...")
|
||||||
|
for variant in BUILD_VARIANTS:
|
||||||
|
if (self.working_dir / f"OpenCore-{variant}").exists():
|
||||||
|
print(f" Deleting old {variant} variant...")
|
||||||
|
subprocess.run (
|
||||||
|
["rm", "-rf", f"{self.working_dir}/OpenCore-{variant}"],
|
||||||
|
stdout=subprocess.PIPE, stderr=subprocess.PIPE
|
||||||
|
)
|
||||||
|
|
||||||
|
def validate_files(self):
|
||||||
|
for variant in BUILD_VARIANTS:
|
||||||
|
if not (self.working_dir / f"OpenCore-{variant}").exists():
|
||||||
|
raise FileNotFoundError(f"OpenCore-{variant} folder not found!")
|
||||||
|
|
||||||
|
def generate(self):
|
||||||
|
for variant in BUILD_VARIANTS:
|
||||||
|
print(f"Generating {variant} variant...")
|
||||||
|
self.generate_opencore(variant)
|
||||||
|
|
||||||
|
def generate_opencore(self, variant):
|
||||||
|
# Create S/L/C
|
||||||
|
print(" Creating SLC folder")
|
||||||
|
subprocess.run (
|
||||||
|
["mkdir", "-p", f"{self.working_dir}/OpenCore-{variant}/System/Library/CoreServices"],
|
||||||
|
stdout=subprocess.PIPE, stderr=subprocess.PIPE
|
||||||
|
)
|
||||||
|
|
||||||
|
# Relocate contents of /EFI/BOOT to /S/L/C
|
||||||
|
print(" Relocating BOOT folder to SLC")
|
||||||
|
for file in (self.working_dir / f"OpenCore-{variant}/EFI/BOOT").iterdir():
|
||||||
|
subprocess.run (
|
||||||
|
["mv", f"{file}", f"{self.working_dir}/OpenCore-{variant}/System/Library/CoreServices"],
|
||||||
|
stdout=subprocess.PIPE, stderr=subprocess.PIPE
|
||||||
|
)
|
||||||
|
|
||||||
|
# Rename BOOTx64.efi to boot.efi
|
||||||
|
print(" Renaming BOOTx64.efi to boot.efi")
|
||||||
|
subprocess.run (
|
||||||
|
["mv", f"{self.working_dir}/OpenCore-{variant}/System/Library/CoreServices/BOOTx64.efi", f"{self.working_dir}/OpenCore-{variant}/System/Library/CoreServices/boot.efi"],
|
||||||
|
stdout=subprocess.PIPE, stderr=subprocess.PIPE
|
||||||
|
)
|
||||||
|
|
||||||
|
# Delete BOOT folder
|
||||||
|
print(" Deleting BOOT folder")
|
||||||
|
subprocess.run (
|
||||||
|
["rm", "-rf", f"{self.working_dir}/OpenCore-{variant}/EFI/BOOT"],
|
||||||
|
stdout=subprocess.PIPE, stderr=subprocess.PIPE
|
||||||
|
)
|
||||||
|
|
||||||
|
# Delete unused drivers
|
||||||
|
print(" Deleting unused drivers")
|
||||||
|
for driver in UNUSED_DRIVERS:
|
||||||
|
if Path(f"{self.working_dir}/OpenCore-{variant}/EFI/OC/Drivers/{driver}").exists():
|
||||||
|
print(f" Deleting {driver}")
|
||||||
|
subprocess.run (
|
||||||
|
["rm", f"{self.working_dir}/OpenCore-{variant}/EFI/OC/Drivers/{driver}"],
|
||||||
|
stdout=subprocess.PIPE, stderr=subprocess.PIPE
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
print(f" {driver} not found")
|
||||||
|
|
||||||
|
# Delete unused tools
|
||||||
|
print(" Deleting unused tools")
|
||||||
|
for tool in UNUSED_TOOLS:
|
||||||
|
if Path(f"{self.working_dir}/OpenCore-{variant}/EFI/OC/Tools/{tool}").exists():
|
||||||
|
print(f" Deleting {tool}")
|
||||||
|
subprocess.run (
|
||||||
|
["rm", f"{self.working_dir}/OpenCore-{variant}/EFI/OC/Tools/{tool}"],
|
||||||
|
stdout=subprocess.PIPE, stderr=subprocess.PIPE
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
print(f" {tool} not found")
|
||||||
|
|
||||||
|
# Rename OpenCore-<variant> to OpenCore-Build
|
||||||
|
print(" Renaming OpenCore folder")
|
||||||
|
subprocess.run (
|
||||||
|
["mv", f"{self.working_dir}/OpenCore-{variant}", f"{self.working_dir}/OpenCore-Build"],
|
||||||
|
stdout=subprocess.PIPE, stderr=subprocess.PIPE
|
||||||
|
)
|
||||||
|
|
||||||
|
# Create OpenCore-<variant>.zip
|
||||||
|
print(" Creating OpenCore.zip")
|
||||||
|
subprocess.run (
|
||||||
|
["ditto", "-c", "-k", "--sequesterRsrc", "--keepParent", f"{self.working_dir}/OpenCore-Build", f"{self.working_dir}/OpenCore-{variant}.zip"],
|
||||||
|
stdout=subprocess.PIPE, stderr=subprocess.PIPE
|
||||||
|
)
|
||||||
|
|
||||||
|
# Delete OpenCore-Build
|
||||||
|
print(" Deleting OpenCore-Build")
|
||||||
|
subprocess.run (
|
||||||
|
["rm", "-rf", f"{self.working_dir}/OpenCore-Build"],
|
||||||
|
stdout=subprocess.PIPE, stderr=subprocess.PIPE
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
GenerateOpenCore()
|
||||||
BIN
payloads/OpenCore/macserial
Executable file
BIN
payloads/OpenCore/macserial
Executable file
Binary file not shown.
BIN
payloads/OpenCore/ocvalidate
Executable file
BIN
payloads/OpenCore/ocvalidate
Executable file
Binary file not shown.
BIN
payloads/Tools/RSRRepair
Executable file
BIN
payloads/Tools/RSRRepair
Executable file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -3,3 +3,4 @@ pyobjc
|
|||||||
wxpython
|
wxpython
|
||||||
pyinstaller
|
pyinstaller
|
||||||
packaging
|
packaging
|
||||||
|
py_sip_xnu
|
||||||
@@ -176,6 +176,12 @@ class build_firmware:
|
|||||||
support.build_support(self.model, self.constants, self.config).get_efi_binary_by_path("XhciDxe.efi", "UEFI", "Drivers")["Enabled"] = True
|
support.build_support(self.model, self.constants, self.config).get_efi_binary_by_path("XhciDxe.efi", "UEFI", "Drivers")["Enabled"] = True
|
||||||
support.build_support(self.model, self.constants, self.config).get_efi_binary_by_path("UsbBusDxe.efi", "UEFI", "Drivers")["Enabled"] = True
|
support.build_support(self.model, self.constants, self.config).get_efi_binary_by_path("UsbBusDxe.efi", "UEFI", "Drivers")["Enabled"] = True
|
||||||
|
|
||||||
|
# PCIe Link Rate check
|
||||||
|
if self.model == "MacPro3,1":
|
||||||
|
print("- Adding PCIe Link Rate Patch")
|
||||||
|
shutil.copy(self.constants.link_rate_driver_path, self.constants.drivers_path)
|
||||||
|
support.build_support(self.model, self.constants, self.config).get_efi_binary_by_path("FixPCIeLinkRate.efi", "UEFI", "Drivers")["Enabled"] = True
|
||||||
|
|
||||||
|
|
||||||
def firmware_compatibility_handling(self):
|
def firmware_compatibility_handling(self):
|
||||||
self.dual_dp_handling()
|
self.dual_dp_handling()
|
||||||
@@ -186,7 +192,7 @@ class build_firmware:
|
|||||||
# Currently the AICPUPM fix is not fully functional, thus forcing VMM is a temporary solution
|
# Currently the AICPUPM fix is not fully functional, thus forcing VMM is a temporary solution
|
||||||
# Waiting for XNU source to be released to fix this properly
|
# Waiting for XNU source to be released to fix this properly
|
||||||
# Ref: https://forums.macrumors.com/threads/opencore-on-the-mac-pro.2207814/
|
# Ref: https://forums.macrumors.com/threads/opencore-on-the-mac-pro.2207814/
|
||||||
if self.model == "MacPro6,1" or self.constants.set_vmm_cpuid is True:
|
if self.model in ["MacPro6,1", "iMac7,1", "iMac8,1", "MacBookPro4,1"] or self.constants.set_vmm_cpuid is True:
|
||||||
print("- Enabling VMM patch")
|
print("- Enabling VMM patch")
|
||||||
self.config["Kernel"]["Emulate"]["Cpuid1Data"] = binascii.unhexlify("00000000000000000000008000000000")
|
self.config["Kernel"]["Emulate"]["Cpuid1Data"] = binascii.unhexlify("00000000000000000000008000000000")
|
||||||
self.config["Kernel"]["Emulate"]["Cpuid1Mask"] = binascii.unhexlify("00000000000000000000008000000000")
|
self.config["Kernel"]["Emulate"]["Cpuid1Mask"] = binascii.unhexlify("00000000000000000000008000000000")
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
from resources import constants, device_probe, utilities
|
from resources import constants, device_probe, utilities
|
||||||
from resources.build import support
|
from resources.build import support
|
||||||
from data import smbios_data, model_array, os_data
|
from data import smbios_data, model_array, os_data, cpu_data
|
||||||
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
@@ -26,6 +26,7 @@ class build_graphics_audio:
|
|||||||
self.firmware_handling()
|
self.firmware_handling()
|
||||||
self.spoof_handling()
|
self.spoof_handling()
|
||||||
self.imac_mxm_patching()
|
self.imac_mxm_patching()
|
||||||
|
self.ioaccel_workaround()
|
||||||
|
|
||||||
|
|
||||||
def graphics_handling(self):
|
def graphics_handling(self):
|
||||||
@@ -241,6 +242,9 @@ class build_graphics_audio:
|
|||||||
# Used to enable Audio support for non-standard dGPUs
|
# Used to enable Audio support for non-standard dGPUs
|
||||||
support.build_support(self.model, self.constants, self.config).enable_kext("AppleALC.kext", self.constants.applealc_version, self.constants.applealc_path)
|
support.build_support(self.model, self.constants, self.config).enable_kext("AppleALC.kext", self.constants.applealc_version, self.constants.applealc_path)
|
||||||
|
|
||||||
|
# Due to regression in AppleALC 1.6.4+, temporarily use 1.6.3 and set override
|
||||||
|
if support.build_support(self.model, self.constants, self.config).get_kext_by_bundle_path("AppleALC.kext")["Enabled"] is True:
|
||||||
|
self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += " -lilubetaall"
|
||||||
|
|
||||||
def firmware_handling(self):
|
def firmware_handling(self):
|
||||||
# Add UGA to GOP layer
|
# Add UGA to GOP layer
|
||||||
@@ -278,11 +282,18 @@ class build_graphics_audio:
|
|||||||
self.config["UEFI"]["Quirks"]["ReloadOptionRoms"] = True
|
self.config["UEFI"]["Quirks"]["ReloadOptionRoms"] = True
|
||||||
|
|
||||||
# AMD GOP VBIOS injection for AMD GCN 1-4 GPUs
|
# AMD GOP VBIOS injection for AMD GCN 1-4 GPUs
|
||||||
if self.constants.gop_injection is True:
|
if self.constants.amd_gop_injection is True:
|
||||||
print("- Adding AMDGOP.efi")
|
print("- Adding AMDGOP.efi")
|
||||||
shutil.copy(self.constants.amd_gop_driver_path, self.constants.drivers_path)
|
shutil.copy(self.constants.amd_gop_driver_path, self.constants.drivers_path)
|
||||||
support.build_support(self.model, self.constants, self.config).get_efi_binary_by_path("AMDGOP.efi", "UEFI", "Drivers")["Enabled"] = True
|
support.build_support(self.model, self.constants, self.config).get_efi_binary_by_path("AMDGOP.efi", "UEFI", "Drivers")["Enabled"] = True
|
||||||
|
|
||||||
|
# Nvidia Kepler GOP VBIOS injection
|
||||||
|
if self.constants.nvidia_kepler_gop_injection is True:
|
||||||
|
print("- Adding NVGOP_GK.efi")
|
||||||
|
shutil.copy(self.constants.nvidia_kepler_gop_driver_path, self.constants.drivers_path)
|
||||||
|
support.build_support(self.model, self.constants, self.config).get_efi_binary_by_path("NVGOP_GK.efi", "UEFI", "Drivers")["Enabled"] = True
|
||||||
|
|
||||||
|
|
||||||
def spoof_handling(self):
|
def spoof_handling(self):
|
||||||
if self.constants.serial_settings == "None":
|
if self.constants.serial_settings == "None":
|
||||||
return
|
return
|
||||||
@@ -365,4 +376,44 @@ class build_graphics_audio:
|
|||||||
self.amd_mxm_patch(self.gfx0_path)
|
self.amd_mxm_patch(self.gfx0_path)
|
||||||
elif self.computer.dgpu.arch == device_probe.NVIDIA.Archs.Kepler:
|
elif self.computer.dgpu.arch == device_probe.NVIDIA.Archs.Kepler:
|
||||||
self.backlight_path_detection()
|
self.backlight_path_detection()
|
||||||
self.nvidia_mxm_patch(self.gfx0_path)
|
self.nvidia_mxm_patch(self.gfx0_path)
|
||||||
|
|
||||||
|
def ioaccel_workaround(self):
|
||||||
|
# Handle misc IOAccelerator issues
|
||||||
|
|
||||||
|
# When MTL bundles are missing from disk, WindowServer will repeatedly crash
|
||||||
|
# This primarily occurs when installing an RSR update, where root is cleaned but AuxKC is not
|
||||||
|
gpu_dict = []
|
||||||
|
if not self.constants.custom_model:
|
||||||
|
gpu_dict = self.constants.computer.gpus
|
||||||
|
else:
|
||||||
|
if not self.model in smbios_data.smbios_dictionary:
|
||||||
|
return
|
||||||
|
gpu_dict = smbios_data.smbios_dictionary[self.model]["Stock GPUs"]
|
||||||
|
for gpu in gpu_dict:
|
||||||
|
if not self.constants.custom_model:
|
||||||
|
gpu = gpu.arch
|
||||||
|
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,
|
||||||
|
]:
|
||||||
|
support.build_support(self.model, self.constants, self.config).enable_kext("KDKlessWorkaround.kext", self.constants.kdkless_version, self.constants.kdkless_path)
|
||||||
|
return
|
||||||
|
|
||||||
|
# KDKlessWorkaround supports disabling native AMD stack on Ventura for pre-AVX2.0 CPUs
|
||||||
|
# Applicable for Polaris, Vega, Navi GPUs
|
||||||
|
if smbios_data.smbios_dictionary[self.model]["CPU Generation"] > cpu_data.cpu_data.ivy_bridge.value:
|
||||||
|
return
|
||||||
|
for gpu in gpu_dict:
|
||||||
|
if not self.constants.custom_model:
|
||||||
|
gpu = gpu.arch
|
||||||
|
if gpu in [
|
||||||
|
device_probe.AMD.Archs.Polaris,
|
||||||
|
device_probe.AMD.Archs.Vega,
|
||||||
|
device_probe.AMD.Archs.Navi,
|
||||||
|
]:
|
||||||
|
support.build_support(self.model, self.constants, self.config).enable_kext("KDKlessWorkaround.kext", self.constants.kdkless_version, self.constants.kdkless_path)
|
||||||
|
return
|
||||||
@@ -79,7 +79,7 @@ class build_misc:
|
|||||||
patch_args = ""
|
patch_args = ""
|
||||||
if support.build_support(self.model, self.constants, self.config).get_item_by_kv(self.config["Kernel"]["Patch"], "Comment", "Reroute kern.hv_vmm_present patch (1)")["Enabled"] is True and self.constants.set_content_caching is True:
|
if support.build_support(self.model, self.constants, self.config).get_item_by_kv(self.config["Kernel"]["Patch"], "Comment", "Reroute kern.hv_vmm_present patch (1)")["Enabled"] is True and self.constants.set_content_caching is True:
|
||||||
print("- Fixing Content Caching support")
|
print("- Fixing Content Caching support")
|
||||||
patch_args += "content-caching,"
|
patch_args += "asset,"
|
||||||
|
|
||||||
if patch_args.endswith(","):
|
if patch_args.endswith(","):
|
||||||
patch_args = patch_args[:-1]
|
patch_args = patch_args[:-1]
|
||||||
@@ -183,6 +183,25 @@ class build_misc:
|
|||||||
if self.model in model_array.Missing_USB_Map_Ventura and self.constants.serial_settings not in ["Moderate", "Advanced"]:
|
if self.model in model_array.Missing_USB_Map_Ventura and self.constants.serial_settings not in ["Moderate", "Advanced"]:
|
||||||
support.build_support(self.model, self.constants, self.config).get_kext_by_bundle_path("USB-Map.kext")["MinKernel"] = "22.0.0"
|
support.build_support(self.model, self.constants, self.config).get_kext_by_bundle_path("USB-Map.kext")["MinKernel"] = "22.0.0"
|
||||||
|
|
||||||
|
# Add UHCI/OHCI drivers
|
||||||
|
# All Penryn Macs lack an internal USB hub to route USB 1.1 devices to the EHCI controller
|
||||||
|
# And MacPro4,1 and MacPro5,1 are the only post-Penryn Macs that lack an internal USB hub
|
||||||
|
# - Ref: https://techcommunity.microsoft.com/t5/microsoft-usb-blog/reasons-to-avoid-companion-controllers/ba-p/270710
|
||||||
|
#
|
||||||
|
# Required downgrades:
|
||||||
|
# - IOUSBHostFamily.kext (only kext itself, not plugins)
|
||||||
|
# - AppleUSBHub.kext
|
||||||
|
# - AppleUSBEHCI.kext
|
||||||
|
if (
|
||||||
|
smbios_data.smbios_dictionary[self.model]["CPU Generation"] <= cpu_data.cpu_data.penryn.value or \
|
||||||
|
self.model in ["MacPro4,1", "MacPro5,1"]
|
||||||
|
):
|
||||||
|
print("- Adding UHCI/OHCI USB support")
|
||||||
|
shutil.copy(self.constants.apple_usb_11_injector_path, self.constants.kexts_path)
|
||||||
|
support.build_support(self.model, self.constants, self.config).get_kext_by_bundle_path("USB1.1-Injector.kext/Contents/PlugIns/AppleUSBOHCI.kext")["Enabled"] = True
|
||||||
|
support.build_support(self.model, self.constants, self.config).get_kext_by_bundle_path("USB1.1-Injector.kext/Contents/PlugIns/AppleUSBOHCIPCI.kext")["Enabled"] = True
|
||||||
|
support.build_support(self.model, self.constants, self.config).get_kext_by_bundle_path("USB1.1-Injector.kext/Contents/PlugIns/AppleUSBUHCI.kext")["Enabled"] = True
|
||||||
|
support.build_support(self.model, self.constants, self.config).get_kext_by_bundle_path("USB1.1-Injector.kext/Contents/PlugIns/AppleUSBUHCIPCI.kext")["Enabled"] = True
|
||||||
|
|
||||||
def debug_handling(self):
|
def debug_handling(self):
|
||||||
# DEBUG Settings (OpenCorePkg and Kernel Space)
|
# DEBUG Settings (OpenCorePkg and Kernel Space)
|
||||||
@@ -218,7 +237,7 @@ class build_misc:
|
|||||||
|
|
||||||
if self.constants.showpicker is False:
|
if self.constants.showpicker is False:
|
||||||
print("- Hiding OpenCore picker")
|
print("- Hiding OpenCore picker")
|
||||||
self.config["Misc"]["Boot"]["ShowPicker"] = "Never"
|
self.config["Misc"]["Boot"]["ShowPicker"] = False
|
||||||
|
|
||||||
if self.constants.oc_timeout != 5:
|
if self.constants.oc_timeout != 5:
|
||||||
print(f"- Setting custom OpenCore picker timeout to {self.constants.oc_timeout} seconds")
|
print(f"- Setting custom OpenCore picker timeout to {self.constants.oc_timeout} seconds")
|
||||||
|
|||||||
@@ -41,6 +41,12 @@ class build_security:
|
|||||||
# Lets us check in sys_patch.py if config supports FileVault
|
# Lets us check in sys_patch.py if config supports FileVault
|
||||||
self.config["NVRAM"]["Add"]["4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102"]["OCLP-Settings"] += " -allow_fv"
|
self.config["NVRAM"]["Add"]["4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102"]["OCLP-Settings"] += " -allow_fv"
|
||||||
|
|
||||||
|
# Patch KC UUID panics due to RSR installation
|
||||||
|
# - Ref: https://github.com/dortania/OpenCore-Legacy-Patcher/issues/1019
|
||||||
|
print("- Enabling KC UUID mismatch patch")
|
||||||
|
self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += " -nokcmismatchpanic"
|
||||||
|
support.build_support(self.model, self.constants, self.config).enable_kext("RSRHelper.kext", self.constants.rsrhelper_version, self.constants.rsrhelper_path)
|
||||||
|
|
||||||
if self.constants.disable_cs_lv is True:
|
if self.constants.disable_cs_lv is True:
|
||||||
print("- Disabling Library Validation")
|
print("- Disabling Library Validation")
|
||||||
# In Ventura, LV patch broke. For now, add AMFI arg
|
# In Ventura, LV patch broke. For now, add AMFI arg
|
||||||
|
|||||||
@@ -19,12 +19,22 @@ class build_storage:
|
|||||||
self.ahci_handling()
|
self.ahci_handling()
|
||||||
self.pata_handling()
|
self.pata_handling()
|
||||||
self.misc_handling()
|
self.misc_handling()
|
||||||
|
self.pcie_handling()
|
||||||
|
self.trim_handling()
|
||||||
|
|
||||||
def ahci_handling(self):
|
def ahci_handling(self):
|
||||||
# MacBookAir6,x ship with an AHCI over PCIe SSD model 'APPLE SSD TS0128F' and 'APPLE SSD TS0256F'
|
# MacBookAir6,x ship with an AHCI over PCIe SSD model 'APPLE SSD TS0128F' and 'APPLE SSD TS0256F'
|
||||||
# This controller is not supported properly in macOS Ventura, instead populating itself as 'Media' with no partitions
|
# This controller is not supported properly in macOS Ventura, instead populating itself as 'Media' with no partitions
|
||||||
# To work-around this, use Monterey's AppleAHCI driver to force
|
# To work-around this, use Monterey's AppleAHCI driver to force support
|
||||||
if self.model in ["MacBookAir6,1", "MacBookAir6,2"]:
|
if not self.constants.custom_model:
|
||||||
|
sata_devices = [i for i in self.computer.storage if isinstance(i, device_probe.SATAController)]
|
||||||
|
for controller in sata_devices:
|
||||||
|
# https://linux-hardware.org/?id=pci:1179-010b-1b4b-9183
|
||||||
|
if controller.vendor_id == 0x1179 and controller.device_id == 0x010b:
|
||||||
|
print("- Enabling AHCI SSD patch")
|
||||||
|
support.build_support(self.model, self.constants, self.config).enable_kext("MonteAHCIPort.kext", self.constants.monterey_ahci_version, self.constants.monterey_ahci_path)
|
||||||
|
break
|
||||||
|
elif self.model in ["MacBookAir6,1", "MacBookAir6,2"]:
|
||||||
print("- Enabling AHCI SSD patch")
|
print("- Enabling AHCI SSD patch")
|
||||||
support.build_support(self.model, self.constants, self.config).enable_kext("MonteAHCIPort.kext", self.constants.monterey_ahci_version, self.constants.monterey_ahci_path)
|
support.build_support(self.model, self.constants, self.config).enable_kext("MonteAHCIPort.kext", self.constants.monterey_ahci_version, self.constants.monterey_ahci_path)
|
||||||
|
|
||||||
@@ -117,4 +127,10 @@ class build_storage:
|
|||||||
# However pre-Ivy Bridge don't support this feature
|
# 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:
|
if smbios_data.smbios_dictionary[self.model]["CPU Generation"] <= cpu_data.cpu_data.sandy_bridge.value:
|
||||||
if (self.constants.computer.sdxc_controller and not self.constants.custom_model) or (self.model.startswith("MacBookPro8") or self.model.startswith("Macmini5")):
|
if (self.constants.computer.sdxc_controller and not self.constants.custom_model) or (self.model.startswith("MacBookPro8") or self.model.startswith("Macmini5")):
|
||||||
support.build_support(self.model, self.constants, self.config).enable_kext("BigSurSDXC.kext", self.constants.bigsursdxc_version, self.constants.bigsursdxc_path)
|
support.build_support(self.model, self.constants, self.config).enable_kext("BigSurSDXC.kext", self.constants.bigsursdxc_version, self.constants.bigsursdxc_path)
|
||||||
|
|
||||||
|
|
||||||
|
def trim_handling(self):
|
||||||
|
if self.constants.apfs_trim_timeout is False:
|
||||||
|
print(f"- Disabling APFS TRIM timeout")
|
||||||
|
self.config["Kernel"]["Quirks"]["SetApfsTrimTimeout"] = 0
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
# pylint: disable=multiple-statements
|
# pylint: disable=multiple-statements
|
||||||
# Define Files
|
# Define Files
|
||||||
# Copyright (C) 2020-2022, Dhinak G, Mykola Grymalyuk
|
# Copyright (C) 2020-2023, Dhinak G, Mykola Grymalyuk
|
||||||
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
@@ -12,35 +12,35 @@ from data import os_data
|
|||||||
class Constants:
|
class Constants:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
# Patcher Versioning
|
# Patcher Versioning
|
||||||
self.patcher_version = "0.5.2" # OpenCore-Legacy-Patcher
|
self.patcher_version = "0.6.0" # OpenCore-Legacy-Patcher
|
||||||
self.patcher_support_pkg_version = "0.7.1" # PatcherSupportPkg
|
self.patcher_support_pkg_version = "0.8.2" # PatcherSupportPkg
|
||||||
self.url_patcher_support_pkg = "https://github.com/dortania/PatcherSupportPkg/releases/download/"
|
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.nightly_url_patcher_support_pkg = "https://nightly.link/dortania/PatcherSupportPkg/workflows/build/master/"
|
||||||
self.discord_link = "https://discord.gg/rqdPgH8xSN"
|
self.discord_link = "https://discord.gg/rqdPgH8xSN"
|
||||||
self.guide_link = "https://dortania.github.io/OpenCore-Legacy-Patcher/"
|
self.guide_link = "https://dortania.github.io/OpenCore-Legacy-Patcher/"
|
||||||
self.repo_link = "https://github.com/dortania/OpenCore-Legacy-Patcher"
|
self.repo_link = "https://github.com/dortania/OpenCore-Legacy-Patcher"
|
||||||
self.repo_link_latest = f"{self.repo_link}/releases/tag/{self.patcher_version}"
|
self.repo_link_latest = f"{self.repo_link}/releases/tag/{self.patcher_version}"
|
||||||
self.copyright_date = "Copyright © 2020-2022 Dortania"
|
self.copyright_date = "Copyright © 2020-2023 Dortania"
|
||||||
self.installer_pkg_url = f"{self.repo_link}/releases/download/{self.patcher_version}/AutoPkg-Assets.pkg"
|
self.installer_pkg_url = f"{self.repo_link}/releases/download/{self.patcher_version}/AutoPkg-Assets.pkg"
|
||||||
self.installer_pkg_url_nightly = "http://nightly.link/dortania/OpenCore-Legacy-Patcher/workflows/build-app-wxpython/main/AutoPkg-Assets.pkg.zip"
|
self.installer_pkg_url_nightly = "http://nightly.link/dortania/OpenCore-Legacy-Patcher/workflows/build-app-wxpython/main/AutoPkg-Assets.pkg.zip"
|
||||||
|
|
||||||
# OpenCore Versioning
|
# OpenCore Versioning
|
||||||
# https://github.com/acidanthera/OpenCorePkg
|
# https://github.com/acidanthera/OpenCorePkg
|
||||||
self.opencore_commit = "5061093 - 11-16-2022"
|
self.opencore_commit = "a753334 - 01-02-2023"
|
||||||
self.opencore_version = "0.8.7"
|
self.opencore_version = "0.8.8"
|
||||||
|
|
||||||
# Kext Versioning
|
# Kext Versioning
|
||||||
## Acidanthera
|
## Acidanthera
|
||||||
## https://github.com/acidanthera
|
## https://github.com/acidanthera
|
||||||
self.lilu_version = "1.6.2" # Lilu
|
self.lilu_version = "1.6.3" # Lilu
|
||||||
self.whatevergreen_version = "1.6.1" # WhateverGreen
|
self.whatevergreen_version = "1.6.3" # WhateverGreen
|
||||||
self.airportbcrmfixup_version = "2.1.6" # AirPortBrcmFixup
|
self.airportbcrmfixup_version = "2.1.6" # AirPortBrcmFixup
|
||||||
self.nvmefix_version = "1.0.9" # NVMeFix
|
self.nvmefix_version = "1.0.9" # NVMeFix
|
||||||
self.applealc_version = "1.7.6" # AppleALC
|
self.applealc_version = "1.6.3" # AppleALC
|
||||||
self.restrictevents_version = "1.0.9" # RestrictEvents
|
self.restrictevents_version = "1.0.9" # RestrictEvents
|
||||||
self.featureunlock_version = "1.1.0" # FeatureUnlock
|
self.featureunlock_version = "1.1.2" # FeatureUnlock
|
||||||
self.debugenhancer_version = "1.0.7" # DebugEnhancer
|
self.debugenhancer_version = "1.0.7" # DebugEnhancer
|
||||||
self.cpufriend_version = "1.2.5" # CPUFriend
|
self.cpufriend_version = "1.2.6" # CPUFriend
|
||||||
self.bluetool_version = "2.6.4" # BlueToolFixup (BrcmPatchRAM)
|
self.bluetool_version = "2.6.4" # BlueToolFixup (BrcmPatchRAM)
|
||||||
self.cslvfixup_version = "2.6.1" # CSLVFixup
|
self.cslvfixup_version = "2.6.1" # CSLVFixup
|
||||||
self.autopkg_version = "1.0.1" # AutoPkgInstaller
|
self.autopkg_version = "1.0.1" # AutoPkgInstaller
|
||||||
@@ -79,6 +79,7 @@ class Constants:
|
|||||||
self.mce_version = "1.0.0" # AppleMCEReporterDisabler
|
self.mce_version = "1.0.0" # AppleMCEReporterDisabler
|
||||||
self.btspoof_version = "1.0.0" # Bluetooth-Spoof
|
self.btspoof_version = "1.0.0" # Bluetooth-Spoof
|
||||||
self.aspp_override_version = "1.0.1" # ACPI_SMC_PlatformPlugin Override
|
self.aspp_override_version = "1.0.1" # ACPI_SMC_PlatformPlugin Override
|
||||||
|
self.rsrhelper_version = "1.0.0" # RSRHelper
|
||||||
|
|
||||||
## Syncretic
|
## Syncretic
|
||||||
## https://forums.macrumors.com/members/syncretic.1173816/
|
## https://forums.macrumors.com/members/syncretic.1173816/
|
||||||
@@ -98,6 +99,10 @@ class Constants:
|
|||||||
## https://github.com/blackgate/AMDGPUWakeHandler
|
## https://github.com/blackgate/AMDGPUWakeHandler
|
||||||
self.gpu_wake_version = "1.0.0"
|
self.gpu_wake_version = "1.0.0"
|
||||||
|
|
||||||
|
## flagersgit
|
||||||
|
## https://github.com/flagersgit/KDKlessWorkaround
|
||||||
|
self.kdkless_version = "1.0.0"
|
||||||
|
|
||||||
# Get resource path
|
# Get resource path
|
||||||
self.current_path = Path(__file__).parent.parent.resolve()
|
self.current_path = Path(__file__).parent.parent.resolve()
|
||||||
self.payload_path = self.current_path / Path("payloads")
|
self.payload_path = self.current_path / Path("payloads")
|
||||||
@@ -177,7 +182,8 @@ class Constants:
|
|||||||
self.allow_ts2_accel = True # Set TeraScale 2 Acceleration 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_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
|
self.force_output_support = False # Force Output support for Mac Pros with PC VBIOS
|
||||||
self.gop_injection = False # Set GOP Injection support
|
self.amd_gop_injection = False # Set GOP Injection support
|
||||||
|
self.nvidia_kepler_gop_injection = False # Set Kepler GOP Injection support
|
||||||
|
|
||||||
## Miscellaneous
|
## Miscellaneous
|
||||||
self.disallow_cpufriend = False # Disable CPUFriend
|
self.disallow_cpufriend = False # Disable CPUFriend
|
||||||
@@ -206,10 +212,12 @@ class Constants:
|
|||||||
self.commit_info = (None, None, None)
|
self.commit_info = (None, None, None)
|
||||||
self.set_vmm_cpuid = False # Set VMM bit inside CPUID
|
self.set_vmm_cpuid = False # Set VMM bit inside CPUID
|
||||||
self.oc_timeout = 5 # Set OpenCore timeout
|
self.oc_timeout = 5 # Set OpenCore timeout
|
||||||
|
self.apfs_trim_timeout = True # Set APFS Trim timeout
|
||||||
|
|
||||||
self.legacy_accel_support = [
|
self.legacy_accel_support = [
|
||||||
os_data.os_data.big_sur,
|
os_data.os_data.big_sur,
|
||||||
os_data.os_data.monterey,
|
os_data.os_data.monterey,
|
||||||
|
os_data.os_data.ventura,
|
||||||
]
|
]
|
||||||
|
|
||||||
# Payload Location
|
# Payload Location
|
||||||
@@ -253,6 +261,10 @@ class Constants:
|
|||||||
def amd_gop_driver_path(self):
|
def amd_gop_driver_path(self):
|
||||||
return self.payload_path / Path("Drivers/AMDGOP.efi")
|
return self.payload_path / Path("Drivers/AMDGOP.efi")
|
||||||
|
|
||||||
|
@property
|
||||||
|
def nvidia_kepler_gop_driver_path(self):
|
||||||
|
return self.payload_path / Path("Drivers/NVGOP_GK.efi")
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def xhci_driver_path(self):
|
def xhci_driver_path(self):
|
||||||
return self.payload_path / Path("Drivers/XhciDxe.efi")
|
return self.payload_path / Path("Drivers/XhciDxe.efi")
|
||||||
@@ -265,6 +277,10 @@ class Constants:
|
|||||||
def diags_launcher_path(self):
|
def diags_launcher_path(self):
|
||||||
return self.payload_path / Path("Drivers/diags.efi")
|
return self.payload_path / Path("Drivers/diags.efi")
|
||||||
|
|
||||||
|
@property
|
||||||
|
def link_rate_driver_path(self):
|
||||||
|
return self.payload_path / Path("Drivers/FixPCIeLinkRate.efi")
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def list_txt_path(self):
|
def list_txt_path(self):
|
||||||
return self.payload_path / Path("List.txt")
|
return self.payload_path / Path("List.txt")
|
||||||
@@ -434,6 +450,10 @@ class Constants:
|
|||||||
def cryptexfixup_path(self):
|
def cryptexfixup_path(self):
|
||||||
return self.payload_kexts_path / Path(f"Acidanthera/CryptexFixup-v{self.cryptexfixup_version}-{self.kext_variant}.zip")
|
return self.payload_kexts_path / Path(f"Acidanthera/CryptexFixup-v{self.cryptexfixup_version}-{self.kext_variant}.zip")
|
||||||
|
|
||||||
|
@property
|
||||||
|
def rsrhelper_path(self):
|
||||||
|
return self.payload_kexts_path / Path(f"Acidanthera/RSRHelper-v{self.rsrhelper_version}-{self.kext_variant}.zip")
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def innie_path(self):
|
def innie_path(self):
|
||||||
return self.payload_kexts_path / Path(f"Misc/Innie-v{self.innie_version}.zip")
|
return self.payload_kexts_path / Path(f"Misc/Innie-v{self.innie_version}.zip")
|
||||||
@@ -458,6 +478,10 @@ class Constants:
|
|||||||
def apple_raid_path(self):
|
def apple_raid_path(self):
|
||||||
return self.payload_kexts_path / Path(f"Misc/AppleRAIDCard-v{self.apple_raid_version}.zip")
|
return self.payload_kexts_path / Path(f"Misc/AppleRAIDCard-v{self.apple_raid_version}.zip")
|
||||||
|
|
||||||
|
@property
|
||||||
|
def kdkless_path(self):
|
||||||
|
return self.payload_kexts_path / Path(f"Misc/KDKlessWorkaround-v{self.kdkless_version}-{self.kext_variant}.zip")
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def plist_folder_path(self):
|
def plist_folder_path(self):
|
||||||
return self.payload_kexts_path / Path("Plists")
|
return self.payload_kexts_path / Path("Plists")
|
||||||
@@ -558,11 +582,7 @@ class Constants:
|
|||||||
# Tools
|
# Tools
|
||||||
@property
|
@property
|
||||||
def macserial_path(self):
|
def macserial_path(self):
|
||||||
return self.payload_path / Path("Tools/macserial")
|
return self.payload_path / Path("OpenCore/macserial")
|
||||||
|
|
||||||
@property
|
|
||||||
def gfxutil_path(self):
|
|
||||||
return self.payload_path / Path("Tools/gfxutil")
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def vault_path(self):
|
def vault_path(self):
|
||||||
@@ -570,12 +590,16 @@ class Constants:
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def ocvalidate_path(self):
|
def ocvalidate_path(self):
|
||||||
return self.payload_path / Path(f"Tools/ocvalidate-{self.opencore_version}")
|
return self.payload_path / Path(f"OpenCore/ocvalidate")
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def oclp_helper_path(self):
|
def oclp_helper_path(self):
|
||||||
return self.payload_path / Path("Tools/OCLP-Helper")
|
return self.payload_path / Path("Tools/OCLP-Helper")
|
||||||
|
|
||||||
|
@property
|
||||||
|
def rsrrepair_userspace_path(self):
|
||||||
|
return self.payload_path / Path("Tools/RSRRepair")
|
||||||
|
|
||||||
# Icons
|
# Icons
|
||||||
@property
|
@property
|
||||||
def app_icon_path(self):
|
def app_icon_path(self):
|
||||||
|
|||||||
@@ -16,6 +16,8 @@ class generate_defaults:
|
|||||||
self.constants.secure_status = False
|
self.constants.secure_status = False
|
||||||
self.constants.disable_cs_lv = False
|
self.constants.disable_cs_lv = False
|
||||||
self.constants.disable_amfi = False
|
self.constants.disable_amfi = False
|
||||||
|
self.constants.fu_status = True
|
||||||
|
self.constants.fu_arguments = None
|
||||||
|
|
||||||
self.constants.custom_serial_number = ""
|
self.constants.custom_serial_number = ""
|
||||||
self.constants.custom_board_serial_number = ""
|
self.constants.custom_board_serial_number = ""
|
||||||
@@ -119,17 +121,41 @@ class generate_defaults:
|
|||||||
|
|
||||||
|
|
||||||
def networking_probe(self):
|
def networking_probe(self):
|
||||||
if (
|
if self.host_is_target:
|
||||||
isinstance(self.constants.computer.wifi, device_probe.Broadcom) and
|
if not (
|
||||||
self.constants.computer.wifi.chipset in [device_probe.Broadcom.Chipsets.AirPortBrcm4331, device_probe.Broadcom.Chipsets.AirPortBrcm43224]
|
(
|
||||||
) or (
|
isinstance(self.constants.computer.wifi, device_probe.Broadcom) and
|
||||||
isinstance(self.constants.computer.wifi, device_probe.Atheros) and
|
self.constants.computer.wifi.chipset in [
|
||||||
self.constants.computer.wifi.chipset == device_probe.Atheros.Chipsets.AirPortAtheros40
|
device_probe.Broadcom.Chipsets.AirPortBrcm4331,
|
||||||
):
|
device_probe.Broadcom.Chipsets.AirPortBrcm43224,
|
||||||
# 12.0: Legacy Wireless chipsets require root patching
|
]
|
||||||
self.constants.sip_status = False
|
) or (
|
||||||
self.constants.secure_status = False
|
isinstance(self.constants.computer.wifi, device_probe.Atheros) and
|
||||||
|
self.constants.computer.wifi.chipset == device_probe.Atheros.Chipsets.AirPortAtheros40
|
||||||
|
)
|
||||||
|
):
|
||||||
|
return
|
||||||
|
|
||||||
|
else:
|
||||||
|
if not self.model in smbios_data.smbios_dictionary:
|
||||||
|
return
|
||||||
|
if (
|
||||||
|
smbios_data.smbios_dictionary[self.model]["Wireless Model"] not in [
|
||||||
|
device_probe.Broadcom.Chipsets.AirPortBrcm4331,
|
||||||
|
device_probe.Broadcom.Chipsets.AirPortBrcm43224,
|
||||||
|
device_probe.Atheros.Chipsets.AirPortAtheros40
|
||||||
|
]
|
||||||
|
):
|
||||||
|
return
|
||||||
|
|
||||||
|
# 12.0: Legacy Wireless chipsets require root patching
|
||||||
|
self.constants.sip_status = False
|
||||||
|
self.constants.secure_status = False
|
||||||
|
|
||||||
|
# 13.0: Enabling AirPlay to Mac patches breaks Control Center on legacy chipsets
|
||||||
|
# AirPlay to Mac was unsupported regardless, so we can safely disable it
|
||||||
|
self.constants.fu_status = True
|
||||||
|
self.constants.fu_arguments = " -disable_sidecar_mac"
|
||||||
|
|
||||||
def misc_hardwares_probe(self):
|
def misc_hardwares_probe(self):
|
||||||
if self.host_is_target:
|
if self.host_is_target:
|
||||||
@@ -226,14 +252,4 @@ class generate_defaults:
|
|||||||
self.constants.disable_cs_lv = True
|
self.constants.disable_cs_lv = True
|
||||||
if os_data.os_data.ventura in self.constants.legacy_accel_support:
|
if os_data.os_data.ventura in self.constants.legacy_accel_support:
|
||||||
# Only disable AMFI if we officially support Ventura
|
# Only disable AMFI if we officially support Ventura
|
||||||
self.constants.disable_amfi = True
|
self.constants.disable_amfi = 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"])
|
|
||||||
@@ -16,12 +16,13 @@ from pathlib import Path
|
|||||||
import binascii
|
import binascii
|
||||||
import hashlib
|
import hashlib
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
import py_sip_xnu
|
||||||
|
|
||||||
from resources import constants, defaults, install, installer, utilities, run, generate_smbios, updates, integrity_verification, global_settings, kdk_handler
|
from resources import constants, defaults, install, installer, utilities, run, generate_smbios, updates, integrity_verification, global_settings, kdk_handler
|
||||||
from resources.sys_patch import sys_patch_download, sys_patch_detect, sys_patch, sys_patch_auto
|
from resources.sys_patch import sys_patch_download, sys_patch_detect, sys_patch, sys_patch_auto
|
||||||
from resources.build import build
|
from resources.build import build
|
||||||
from data import model_array, os_data, smbios_data, sip_data
|
from data import model_array, os_data, smbios_data, sip_data, cpu_data
|
||||||
from gui import menu_redirect, gui_help
|
from resources.gui import menu_redirect, gui_help
|
||||||
|
|
||||||
|
|
||||||
class wx_python_gui:
|
class wx_python_gui:
|
||||||
@@ -1691,18 +1692,32 @@ class wx_python_gui:
|
|||||||
# Unsupported Models include:
|
# Unsupported Models include:
|
||||||
# - USB 1.1 machines (Penryn, MacPro3,1-5,1)
|
# - USB 1.1 machines (Penryn, MacPro3,1-5,1)
|
||||||
# - Non-Metal GPUs
|
# - Non-Metal GPUs
|
||||||
|
has_legacy_usb = False
|
||||||
|
issues_list = ""
|
||||||
model = self.constants.custom_model or self.constants.computer.real_model
|
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"]:
|
if model in ["MacPro3,1", "MacPro4,1", "MacPro5,1"]:
|
||||||
|
has_legacy_usb = True
|
||||||
|
issues_list = "- Lack of Keyboard/Mouse in macOS installer without a USB hub\n"
|
||||||
|
elif model in smbios_data.smbios_dictionary[model]:
|
||||||
|
if "CPU Generation" in smbios_data.smbios_dictionary[model]:
|
||||||
|
if smbios_data.smbios_dictionary[model]["CPU Generation"] <= cpu_data.cpu_data.penryn:
|
||||||
|
has_legacy_usb = True
|
||||||
|
if model.startswith("MacBook"):
|
||||||
|
issues_list = "- Lack of internal Keyboard/Trackpad in macOS installer\n"
|
||||||
|
elif not model.startswith("MacPro"):
|
||||||
|
issues_list = "- Lack of internal Keyboard/Mouse in macOS installer\n"
|
||||||
|
|
||||||
|
if has_legacy_usb:
|
||||||
try:
|
try:
|
||||||
app_major = app_dict['Version'].split(".")[0]
|
app_major = app_dict['Version'].split(".")[0]
|
||||||
if float(app_major) > self.constants.os_support:
|
if float(app_major) > self.constants.os_support:
|
||||||
# Throw pop up warning OCLP does not support this OS
|
# 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))
|
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 = wx.MessageDialog(self.frame_modal, f"OpenCore Legacy Patcher may not fully support macOS {os} on your machine ({model}).\n\nThe main issues include:\n{issues_list}\nThe newest version we recommend 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 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")
|
dlg.SetYesNoCancelLabels("View Github Issue", "Download Anyways", "Cancel")
|
||||||
result = dlg.ShowModal()
|
result = dlg.ShowModal()
|
||||||
if result == wx.ID_YES:
|
if result == wx.ID_YES:
|
||||||
webbrowser.open("https://github.com/dortania/OpenCore-Legacy-Patcher/issues/998")
|
webbrowser.open("https://github.com/dortania/OpenCore-Legacy-Patcher/issues/1021")
|
||||||
return
|
return
|
||||||
elif result == wx.ID_NO:
|
elif result == wx.ID_NO:
|
||||||
pass
|
pass
|
||||||
@@ -2580,23 +2595,33 @@ class wx_python_gui:
|
|||||||
self.timeout_spinner.Centre(wx.HORIZONTAL)
|
self.timeout_spinner.Centre(wx.HORIZONTAL)
|
||||||
|
|
||||||
# AMD GOP Injection
|
# AMD GOP Injection
|
||||||
self.set_gop_injection = wx.CheckBox(self.frame_modal, label="AMD GOP Injection")
|
self.set_amd_gop_injection = wx.CheckBox(self.frame_modal, label="AMD GOP Injection")
|
||||||
self.set_gop_injection.SetPosition(wx.Point(
|
self.set_amd_gop_injection.SetPosition(wx.Point(
|
||||||
30,
|
30,
|
||||||
self.timeout_spinner.GetPosition().y + self.timeout_spinner.GetSize().height + 5))
|
self.timeout_spinner.GetPosition().y + self.timeout_spinner.GetSize().height + 5))
|
||||||
self.set_gop_injection.SetValue(self.constants.gop_injection)
|
self.set_amd_gop_injection.SetValue(self.constants.amd_gop_injection)
|
||||||
self.set_gop_injection.Bind(wx.EVT_CHECKBOX, self.gop_injection_checkbox_click)
|
self.set_amd_gop_injection.Bind(wx.EVT_CHECKBOX, self.amd_gop_injection_checkbox_click)
|
||||||
models = ["iMac10,1", "iMac11,1", "iMac11,2", "iMac11,3", "iMac12,1", "iMac12,2", "MacPro3,1", "MacPro4,1", "MacPro5,1", "Xserve2,1", "Xserve3,1"]
|
models = ["iMac10,1", "iMac11,1", "iMac11,2", "iMac11,3", "iMac12,1", "iMac12,2", "MacPro3,1", "MacPro4,1", "MacPro5,1", "Xserve2,1", "Xserve3,1"]
|
||||||
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):
|
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.set_gop_injection.Disable()
|
self.set_amd_gop_injection.Disable()
|
||||||
|
|
||||||
|
# Nvidia Kepler GOP injection
|
||||||
|
self.set_nvidia_kepler_gop_injection = wx.CheckBox(self.frame_modal, label="Nvidia Kepler GOP Injection")
|
||||||
|
self.set_nvidia_kepler_gop_injection.SetPosition(wx.Point(
|
||||||
|
self.set_amd_gop_injection.GetPosition().x,
|
||||||
|
self.set_amd_gop_injection.GetPosition().y + self.set_amd_gop_injection.GetSize().height))
|
||||||
|
self.set_nvidia_kepler_gop_injection.SetValue(self.constants.nvidia_kepler_gop_injection)
|
||||||
|
self.set_nvidia_kepler_gop_injection.Bind(wx.EVT_CHECKBOX, self.nvidia_kepler_gop_injection_checkbox_click)
|
||||||
|
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.set_nvidia_kepler_gop_injection.Disable()
|
||||||
|
|
||||||
# Disable Thunderbolt
|
# Disable Thunderbolt
|
||||||
self.disable_thunderbolt_checkbox = wx.CheckBox(self.frame_modal, label="Disable Thunderbolt")
|
self.disable_thunderbolt_checkbox = wx.CheckBox(self.frame_modal, label="Disable Thunderbolt")
|
||||||
self.disable_thunderbolt_checkbox.SetValue(self.constants.disable_tb)
|
self.disable_thunderbolt_checkbox.SetValue(self.constants.disable_tb)
|
||||||
self.disable_thunderbolt_checkbox.Bind(wx.EVT_CHECKBOX, self.disable_tb_click)
|
self.disable_thunderbolt_checkbox.Bind(wx.EVT_CHECKBOX, self.disable_tb_click)
|
||||||
self.disable_thunderbolt_checkbox.SetPosition(wx.Point(
|
self.disable_thunderbolt_checkbox.SetPosition(wx.Point(
|
||||||
self.set_gop_injection.GetPosition().x,
|
self.set_nvidia_kepler_gop_injection.GetPosition().x,
|
||||||
self.set_gop_injection.GetPosition().y + self.set_gop_injection.GetSize().height))
|
self.set_nvidia_kepler_gop_injection.GetPosition().y + self.set_nvidia_kepler_gop_injection.GetSize().height))
|
||||||
self.disable_thunderbolt_checkbox.SetToolTip(wx.ToolTip("Disables Thunderbolt support on MacBookPro11,x\nMainly applicable for systems that cannot boot with Thunderbolt enabled"))
|
self.disable_thunderbolt_checkbox.SetToolTip(wx.ToolTip("Disables Thunderbolt support on MacBookPro11,x\nMainly applicable for systems that cannot boot with Thunderbolt enabled"))
|
||||||
if not self.constants.custom_model and not self.computer.real_model.startswith("MacBookPro11"):
|
if not self.constants.custom_model and not self.computer.real_model.startswith("MacBookPro11"):
|
||||||
self.disable_thunderbolt_checkbox.Disable()
|
self.disable_thunderbolt_checkbox.Disable()
|
||||||
@@ -2612,23 +2637,13 @@ class wx_python_gui:
|
|||||||
self.set_terascale_accel_checkbox.Disable()
|
self.set_terascale_accel_checkbox.Disable()
|
||||||
self.set_terascale_accel_checkbox.SetValue(False)
|
self.set_terascale_accel_checkbox.SetValue(False)
|
||||||
|
|
||||||
# Force Web Drivers in Tesla/Kepler
|
|
||||||
self.force_web_drivers_checkbox = wx.CheckBox(self.frame_modal, label="Force Web Drivers")
|
|
||||||
self.force_web_drivers_checkbox.SetValue(self.constants.force_nv_web)
|
|
||||||
self.force_web_drivers_checkbox.Bind(wx.EVT_CHECKBOX, self.force_web_drivers_click)
|
|
||||||
self.force_web_drivers_checkbox.SetPosition(wx.Point(
|
|
||||||
self.disable_thunderbolt_checkbox.GetPosition().x,
|
|
||||||
self.set_terascale_accel_checkbox.GetPosition().y + self.set_terascale_accel_checkbox.GetSize().height))
|
|
||||||
self.force_web_drivers_checkbox.SetToolTip(wx.ToolTip("This option will force Nvidia Web Driver support onto Nvidia Tesla and Kepler GPUs. This should only be used for development purposes."))
|
|
||||||
|
|
||||||
|
|
||||||
# Windows GMUX
|
# Windows GMUX
|
||||||
self.windows_gmux_checkbox = wx.CheckBox(self.frame_modal, label="Windows GMUX")
|
self.windows_gmux_checkbox = wx.CheckBox(self.frame_modal, label="Windows GMUX")
|
||||||
self.windows_gmux_checkbox.SetValue(self.constants.dGPU_switch)
|
self.windows_gmux_checkbox.SetValue(self.constants.dGPU_switch)
|
||||||
self.windows_gmux_checkbox.Bind(wx.EVT_CHECKBOX, self.windows_gmux_click)
|
self.windows_gmux_checkbox.Bind(wx.EVT_CHECKBOX, self.windows_gmux_click)
|
||||||
self.windows_gmux_checkbox.SetPosition(wx.Point(
|
self.windows_gmux_checkbox.SetPosition(wx.Point(
|
||||||
self.force_web_drivers_checkbox.GetPosition().x,
|
self.set_terascale_accel_checkbox.GetPosition().x,
|
||||||
self.force_web_drivers_checkbox.GetPosition().y + self.force_web_drivers_checkbox.GetSize().height))
|
self.set_terascale_accel_checkbox.GetPosition().y + self.set_terascale_accel_checkbox.GetSize().height))
|
||||||
self.windows_gmux_checkbox.SetToolTip(wx.ToolTip("Enable this option to allow usage of the hardware GMUX to switch between Intel and Nvidia/AMD GPUs in Windows."))
|
self.windows_gmux_checkbox.SetToolTip(wx.ToolTip("Enable this option to allow usage of the hardware GMUX to switch between Intel and Nvidia/AMD GPUs in Windows."))
|
||||||
|
|
||||||
# Hibernation Workaround
|
# Hibernation Workaround
|
||||||
@@ -2847,6 +2862,14 @@ class wx_python_gui:
|
|||||||
print("Wake on WLAN Disabled")
|
print("Wake on WLAN Disabled")
|
||||||
self.constants.enable_wake_on_wlan = False
|
self.constants.enable_wake_on_wlan = False
|
||||||
|
|
||||||
|
def apfs_trim_click(self, event=None):
|
||||||
|
if self.apfs_trim_checkbox.GetValue():
|
||||||
|
print("APFS Trim Enabled")
|
||||||
|
self.constants.apfs_trim_timeout = True
|
||||||
|
else:
|
||||||
|
print("APFS Trim Disabled")
|
||||||
|
self.constants.apfs_trim_timeout = False
|
||||||
|
|
||||||
def content_caching_click(self, event=None):
|
def content_caching_click(self, event=None):
|
||||||
if self.content_caching_checkbox.GetValue():
|
if self.content_caching_checkbox.GetValue():
|
||||||
print("Content Caching Enabled")
|
print("Content Caching Enabled")
|
||||||
@@ -2855,13 +2878,21 @@ class wx_python_gui:
|
|||||||
print("Content Caching Disabled")
|
print("Content Caching Disabled")
|
||||||
self.constants.set_content_caching = False
|
self.constants.set_content_caching = False
|
||||||
|
|
||||||
def gop_injection_checkbox_click(self, event=None):
|
def amd_gop_injection_checkbox_click(self, event=None):
|
||||||
if self.set_gop_injection.GetValue():
|
if self.set_amd_gop_injection.GetValue():
|
||||||
print("GOP Injection Enabled")
|
print("AMD GOP Injection Enabled")
|
||||||
self.constants.gop_injection = True
|
self.constants.amd_gop_injection = True
|
||||||
else:
|
else:
|
||||||
print("GOP Injection Disabled")
|
print("AMD GOP Injection Disabled")
|
||||||
self.constants.gop_injection = False
|
self.constants.amd_gop_injection = False
|
||||||
|
|
||||||
|
def nvidia_kepler_gop_injection_checkbox_click(self, event=None):
|
||||||
|
if self.set_nvidia_kepler_gop_injection.GetValue():
|
||||||
|
print("Nvidia Kepler GOP Injection Enabled")
|
||||||
|
self.constants.nvidia_kepler_gop_injection = True
|
||||||
|
else:
|
||||||
|
print("Nvidia Kepler GOP Injection Disabled")
|
||||||
|
self.constants.nvidia_kepler_gop_injection = False
|
||||||
|
|
||||||
def disable_tb_click(self, event=None):
|
def disable_tb_click(self, event=None):
|
||||||
if self.disable_thunderbolt_checkbox.GetValue():
|
if self.disable_thunderbolt_checkbox.GetValue():
|
||||||
@@ -3354,7 +3385,7 @@ class wx_python_gui:
|
|||||||
)
|
)
|
||||||
self.sip_label_2.Center(wx.HORIZONTAL)
|
self.sip_label_2.Center(wx.HORIZONTAL)
|
||||||
|
|
||||||
self.sip_label_2_2 = wx.StaticText(self.frame_modal, label=f"Currently Booted SIP: {hex(utilities.csr_dump())}")
|
self.sip_label_2_2 = wx.StaticText(self.frame_modal, label=f"Currently Booted SIP: {hex(py_sip_xnu.SipXnu().get_sip_status().value)}")
|
||||||
self.sip_label_2_2.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL))
|
self.sip_label_2_2.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL))
|
||||||
self.sip_label_2_2.SetPosition(
|
self.sip_label_2_2.SetPosition(
|
||||||
wx.Point(self.sip_label_2.GetPosition().x, self.sip_label_2.GetPosition().y + self.sip_label_2.GetSize().height + 5)
|
wx.Point(self.sip_label_2.GetPosition().x, self.sip_label_2.GetPosition().y + self.sip_label_2.GetSize().height + 5)
|
||||||
@@ -3527,12 +3558,19 @@ OpenCore Legacy Patcher by default knows the most ideal
|
|||||||
self.content_caching_checkbox.SetPosition(wx.Point(self.wake_on_wlan_checkbox.GetPosition().x, self.wake_on_wlan_checkbox.GetPosition().y + self.wake_on_wlan_checkbox.GetSize().height))
|
self.content_caching_checkbox.SetPosition(wx.Point(self.wake_on_wlan_checkbox.GetPosition().x, self.wake_on_wlan_checkbox.GetPosition().y + self.wake_on_wlan_checkbox.GetSize().height))
|
||||||
self.content_caching_checkbox.SetToolTip(wx.ToolTip("Enables content caching support in macOS"))
|
self.content_caching_checkbox.SetToolTip(wx.ToolTip("Enables content caching support in macOS"))
|
||||||
|
|
||||||
|
# APFS Trim
|
||||||
|
self.apfs_trim_checkbox = wx.CheckBox(self.frame_modal, label="APFS Trim")
|
||||||
|
self.apfs_trim_checkbox.SetValue(self.constants.apfs_trim_timeout)
|
||||||
|
self.apfs_trim_checkbox.Bind(wx.EVT_CHECKBOX, self.apfs_trim_click)
|
||||||
|
self.apfs_trim_checkbox.SetPosition(wx.Point(self.content_caching_checkbox.GetPosition().x, self.content_caching_checkbox.GetPosition().y + self.content_caching_checkbox.GetSize().height))
|
||||||
|
self.apfs_trim_checkbox.SetToolTip(wx.ToolTip("Enables APFS Trim support in macOS"))
|
||||||
|
|
||||||
# Button: return to main menu
|
# Button: return to main menu
|
||||||
self.return_to_main_menu_button = wx.Button(self.frame_modal, label="Return to Settings")
|
self.return_to_main_menu_button = wx.Button(self.frame_modal, label="Return to Settings")
|
||||||
self.return_to_main_menu_button.Bind(wx.EVT_BUTTON, self.settings_menu)
|
self.return_to_main_menu_button.Bind(wx.EVT_BUTTON, self.settings_menu)
|
||||||
self.return_to_main_menu_button.SetPosition(wx.Point(
|
self.return_to_main_menu_button.SetPosition(wx.Point(
|
||||||
self.content_caching_checkbox.GetPosition().x,
|
self.apfs_trim_checkbox.GetPosition().x,
|
||||||
self.content_caching_checkbox.GetPosition().y + self.content_caching_checkbox.GetSize().height + 10))
|
self.apfs_trim_checkbox.GetPosition().y + self.apfs_trim_checkbox.GetSize().height + 10))
|
||||||
self.return_to_main_menu_button.Center(wx.HORIZONTAL)
|
self.return_to_main_menu_button.Center(wx.HORIZONTAL)
|
||||||
|
|
||||||
# set frame_modal size below return to main menu button
|
# set frame_modal size below return to main menu button
|
||||||
@@ -3599,11 +3637,11 @@ OpenCore Legacy Patcher by default knows the most ideal
|
|||||||
else:
|
else:
|
||||||
is_blur_enabled = False
|
is_blur_enabled = False
|
||||||
|
|
||||||
is_rim_enabled = subprocess.run(["defaults", "read", "-g", "Moraea_RimBeta"], stdout=subprocess.PIPE).stdout.decode("utf-8").strip()
|
is_rim_disabled = subprocess.run(["defaults", "read", "-g", "Moraea_RimBetaDisabled"], stdout=subprocess.PIPE).stdout.decode("utf-8").strip()
|
||||||
if is_rim_enabled in ["1", "true"]:
|
if is_rim_disabled in ["1", "true"]:
|
||||||
is_rim_enabled = True
|
is_rim_disabled = True
|
||||||
else:
|
else:
|
||||||
is_rim_enabled = False
|
is_rim_disabled = False
|
||||||
|
|
||||||
# Checkbox: Dark Menu Bar
|
# Checkbox: Dark Menu Bar
|
||||||
self.dark_menu_bar_checkbox = wx.CheckBox(self.frame_modal, label="Dark Menu Bar")
|
self.dark_menu_bar_checkbox = wx.CheckBox(self.frame_modal, label="Dark Menu Bar")
|
||||||
@@ -3619,8 +3657,8 @@ OpenCore Legacy Patcher by default knows the most ideal
|
|||||||
self.enable_beta_blur_checkbox.SetPosition(wx.Point(self.dark_menu_bar_checkbox.GetPosition().x, self.dark_menu_bar_checkbox.GetPosition().y + self.dark_menu_bar_checkbox.GetSize().height + 7))
|
self.enable_beta_blur_checkbox.SetPosition(wx.Point(self.dark_menu_bar_checkbox.GetPosition().x, self.dark_menu_bar_checkbox.GetPosition().y + self.dark_menu_bar_checkbox.GetSize().height + 7))
|
||||||
|
|
||||||
# Checkbox: Enable Beta Rim
|
# Checkbox: Enable Beta Rim
|
||||||
self.enable_beta_rim_checkbox = wx.CheckBox(self.frame_modal, label="Enable Beta Rim")
|
self.enable_beta_rim_checkbox = wx.CheckBox(self.frame_modal, label="Disable Beta Rim")
|
||||||
self.enable_beta_rim_checkbox.SetValue(is_rim_enabled)
|
self.enable_beta_rim_checkbox.SetValue(is_rim_disabled)
|
||||||
self.enable_beta_rim_checkbox.Bind(wx.EVT_CHECKBOX, self.enable_beta_rim_click)
|
self.enable_beta_rim_checkbox.Bind(wx.EVT_CHECKBOX, self.enable_beta_rim_click)
|
||||||
self.enable_beta_rim_checkbox.SetPosition(wx.Point(self.enable_beta_blur_checkbox.GetPosition().x, self.enable_beta_blur_checkbox.GetPosition().y + self.enable_beta_blur_checkbox.GetSize().height + 7))
|
self.enable_beta_rim_checkbox.SetPosition(wx.Point(self.enable_beta_blur_checkbox.GetPosition().x, self.enable_beta_blur_checkbox.GetPosition().y + self.enable_beta_blur_checkbox.GetSize().height + 7))
|
||||||
|
|
||||||
@@ -3649,7 +3687,7 @@ OpenCore Legacy Patcher by default knows the most ideal
|
|||||||
|
|
||||||
def enable_beta_rim_click(self, event=None):
|
def enable_beta_rim_click(self, event=None):
|
||||||
if event.IsChecked():
|
if event.IsChecked():
|
||||||
subprocess.run(["defaults", "write", "-g", "Moraea_RimBeta", "-bool", "true"])
|
subprocess.run(["defaults", "write", "-g", "Moraea_RimBetaDisabled", "-bool", "true"])
|
||||||
else:
|
else:
|
||||||
subprocess.run(["defaults", "write", "-g", "Moraea_RimBeta", "-bool", "false"])
|
subprocess.run(["defaults", "write", "-g", "Moraea_RimBetaDisabled", "-bool", "false"])
|
||||||
print("Beta Rim Enabled:", event.IsChecked())
|
print("Beta Rim Enabled:", event.IsChecked())
|
||||||
@@ -25,7 +25,7 @@ class kernel_debug_kit_handler:
|
|||||||
print("- Fetching available KDKs")
|
print("- Fetching available KDKs")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
results = utilities.SESSION.get(KDK_API_LINK, headers={"User-Agent": f"OCLP/{self.constants.patcher_version}"})
|
results = utilities.SESSION.get(KDK_API_LINK, headers={"User-Agent": f"OCLP/{self.constants.patcher_version}"}, timeout=10)
|
||||||
except (requests.exceptions.Timeout, requests.exceptions.TooManyRedirects, requests.exceptions.ConnectionError):
|
except (requests.exceptions.Timeout, requests.exceptions.TooManyRedirects, requests.exceptions.ConnectionError):
|
||||||
print("- Could not contact KDK API")
|
print("- Could not contact KDK API")
|
||||||
return None
|
return None
|
||||||
@@ -62,7 +62,7 @@ class kernel_debug_kit_handler:
|
|||||||
macos_builds = [i for i in results.json()["ios"] if i["osType"] == "macOS"]
|
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
|
# If the version is borked, put it at the bottom of the list
|
||||||
# Would omit it, but can't do that in this lambda
|
# 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
|
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"] if x["released"] != "" else "1984-01-01")), reverse=True) # type: ignore
|
||||||
|
|
||||||
# Iterate through, find build that is closest to the host version
|
# Iterate through, find build that is closest to the host version
|
||||||
# Use date to determine which is closest
|
# Use date to determine which is closest
|
||||||
@@ -96,6 +96,11 @@ class kernel_debug_kit_handler:
|
|||||||
# 0: Portal is up and file is available
|
# 0: Portal is up and file is available
|
||||||
# 1: Portal is up but file is not available
|
# 1: Portal is up but file is not available
|
||||||
# 2: Portal is down
|
# 2: Portal is down
|
||||||
|
# 3: Network error
|
||||||
|
|
||||||
|
if utilities.verify_network_connection("https://developerservices2.apple.com/services/download") is False:
|
||||||
|
print("- Could not connect to the network")
|
||||||
|
return 3
|
||||||
|
|
||||||
TOKEN_URL_BASE = "https://developerservices2.apple.com/services/download"
|
TOKEN_URL_BASE = "https://developerservices2.apple.com/services/download"
|
||||||
remote_path = urllib.parse.urlparse(link).path
|
remote_path = urllib.parse.urlparse(link).path
|
||||||
@@ -196,6 +201,10 @@ class kernel_debug_kit_handler:
|
|||||||
msg += " and could not find a backup copy online"
|
msg += " and could not find a backup copy online"
|
||||||
print(f"- {msg}")
|
print(f"- {msg}")
|
||||||
return False, msg, ""
|
return False, msg, ""
|
||||||
|
elif result == 3:
|
||||||
|
msg = "Failed to connect to the internet"
|
||||||
|
print(f"- {msg}")
|
||||||
|
return False, msg, ""
|
||||||
|
|
||||||
if "github" in download_link:
|
if "github" in download_link:
|
||||||
result = utilities.download_file(download_link, self.constants.kdk_download_path)
|
result = utilities.download_file(download_link, self.constants.kdk_download_path)
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ class OpenCoreLegacyPatcher:
|
|||||||
if utilities.check_cli_args() is None:
|
if utilities.check_cli_args() is None:
|
||||||
if launch_gui is True:
|
if launch_gui is True:
|
||||||
utilities.disable_cls()
|
utilities.disable_cls()
|
||||||
from gui import gui_main
|
from resources.gui import gui_main
|
||||||
gui_main.wx_python_gui(self.constants).main_menu(None)
|
gui_main.wx_python_gui(self.constants).main_menu(None)
|
||||||
else:
|
else:
|
||||||
self.main_menu()
|
self.main_menu()
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
import platform
|
import platform
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import plistlib
|
||||||
|
|
||||||
|
|
||||||
def detect_kernel_major():
|
def detect_kernel_major():
|
||||||
@@ -25,4 +26,10 @@ def detect_os_version():
|
|||||||
def detect_os_build():
|
def detect_os_build():
|
||||||
# Return OS build
|
# Return OS build
|
||||||
# Example Output: 21A5522h (string)
|
# Example Output: 21A5522h (string)
|
||||||
return subprocess.run("sw_vers -buildVersion".split(), stdout=subprocess.PIPE).stdout.decode().strip()
|
|
||||||
|
# With macOS 13.2, Apple implemented the Rapid Security Response system which
|
||||||
|
# will change the reported build to the RSR version and not the original host
|
||||||
|
# To get the proper versions:
|
||||||
|
# - Host: /System/Library/CoreServices/SystemVersion.plist
|
||||||
|
# - RSR: /System/Volumes/Preboot/Cryptexes/OS/System/Library/CoreServices/SystemVersion.plist
|
||||||
|
return plistlib.load(open("/System/Library/CoreServices/SystemVersion.plist", "rb"))["ProductBuildVersion"]
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ class PatchSysVolume:
|
|||||||
print(result.stdout.decode().strip())
|
print(result.stdout.decode().strip())
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def merge_kdk_with_root(self):
|
def merge_kdk_with_root(self, save_hid_cs=False):
|
||||||
if self.skip_root_kmutil_requirement is True:
|
if self.skip_root_kmutil_requirement is True:
|
||||||
return
|
return
|
||||||
if self.constants.detected_os < os_data.os_data.ventura:
|
if self.constants.detected_os < os_data.os_data.ventura:
|
||||||
@@ -145,6 +145,14 @@ class PatchSysVolume:
|
|||||||
raise Exception("Unable to find Kernel Debug Kit")
|
raise Exception("Unable to find Kernel Debug Kit")
|
||||||
self.kdk_path = kdk_path
|
self.kdk_path = kdk_path
|
||||||
print(f"- Found KDK at: {kdk_path}")
|
print(f"- Found KDK at: {kdk_path}")
|
||||||
|
|
||||||
|
# Due to some IOHIDFamily oddities, we need to ensure their CodeSignature is retained
|
||||||
|
cs_path = Path(self.mount_location) / Path("System/Library/Extensions/IOHIDFamily.kext/Contents/PlugIns/IOHIDEventDriver.kext/Contents/_CodeSignature")
|
||||||
|
if save_hid_cs is True and cs_path.exists():
|
||||||
|
print("- Backing up IOHIDEventDriver CodeSignature")
|
||||||
|
# Note it's a folder, not a file
|
||||||
|
utilities.elevated(["cp", "-r", cs_path, f"{self.constants.payload_path}/IOHIDEventDriver_CodeSignature.bak"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||||
|
|
||||||
print("- Merging KDK with Root Volume")
|
print("- Merging KDK with Root Volume")
|
||||||
utilities.elevated(
|
utilities.elevated(
|
||||||
# Only merge '/System/Library/Extensions'
|
# Only merge '/System/Library/Extensions'
|
||||||
@@ -159,6 +167,16 @@ class PatchSysVolume:
|
|||||||
raise Exception("Failed to merge KDK with Root Volume")
|
raise Exception("Failed to merge KDK with Root Volume")
|
||||||
print("- Successfully merged KDK with Root Volume")
|
print("- Successfully merged KDK with Root Volume")
|
||||||
|
|
||||||
|
# Restore IOHIDEventDriver CodeSignature
|
||||||
|
if save_hid_cs is True and Path(f"{self.constants.payload_path}/IOHIDEventDriver_CodeSignature.bak").exists():
|
||||||
|
print("- Restoring IOHIDEventDriver CodeSignature")
|
||||||
|
if not cs_path.exists():
|
||||||
|
print(" - CodeSignature folder missing, creating")
|
||||||
|
utilities.elevated(["mkdir", "-p", cs_path], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||||
|
utilities.elevated(["cp", "-r", f"{self.constants.payload_path}/IOHIDEventDriver_CodeSignature.bak", cs_path], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||||
|
utilities.elevated(["rm", "-rf", f"{self.constants.payload_path}/IOHIDEventDriver_CodeSignature.bak"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||||
|
|
||||||
|
|
||||||
def unpatch_root_vol(self):
|
def unpatch_root_vol(self):
|
||||||
if self.constants.detected_os > os_data.os_data.catalina and self.root_supports_snapshot is True:
|
if self.constants.detected_os > os_data.os_data.catalina and self.root_supports_snapshot is True:
|
||||||
print("- Reverting to last signed APFS snapshot")
|
print("- Reverting to last signed APFS snapshot")
|
||||||
@@ -277,6 +295,9 @@ class PatchSysVolume:
|
|||||||
|
|
||||||
for file in ["KextPolicy", "KextPolicy-shm", "KextPolicy-wal"]:
|
for file in ["KextPolicy", "KextPolicy-shm", "KextPolicy-wal"]:
|
||||||
self.remove_file("/private/var/db/SystemPolicyConfiguration/", file)
|
self.remove_file("/private/var/db/SystemPolicyConfiguration/", file)
|
||||||
|
else:
|
||||||
|
# Install RSRHelper utility to handle desynced KCs
|
||||||
|
sys_patch_helpers.sys_patch_helpers(self.constants).install_rsr_repair_binary()
|
||||||
|
|
||||||
print("- Successfully built new kernel cache")
|
print("- Successfully built new kernel cache")
|
||||||
return True
|
return True
|
||||||
@@ -339,23 +360,20 @@ class PatchSysVolume:
|
|||||||
if self.constants.detected_os < os_data.os_data.big_sur:
|
if self.constants.detected_os < os_data.os_data.big_sur:
|
||||||
return
|
return
|
||||||
|
|
||||||
oclp_path = "/System/Library/CoreServices/OpenCore-Legacy-Patcher.plist"
|
|
||||||
if not Path(oclp_path).exists():
|
|
||||||
return
|
|
||||||
|
|
||||||
print("- Cleaning Auxiliary Kernel Collection")
|
print("- Cleaning Auxiliary Kernel Collection")
|
||||||
oclp_plist_data = plistlib.load(Path(oclp_path).open("rb"))
|
oclp_path = "/System/Library/CoreServices/OpenCore-Legacy-Patcher.plist"
|
||||||
|
if Path(oclp_path).exists():
|
||||||
for key in oclp_plist_data:
|
oclp_plist_data = plistlib.load(Path(oclp_path).open("rb"))
|
||||||
if "Install" not in oclp_plist_data[key]:
|
for key in oclp_plist_data:
|
||||||
continue
|
if "Install" not in oclp_plist_data[key]:
|
||||||
for location in oclp_plist_data[key]["Install"]:
|
|
||||||
if not location.endswith("Extensions"):
|
|
||||||
continue
|
continue
|
||||||
for file in oclp_plist_data[key]["Install"][location]:
|
for location in oclp_plist_data[key]["Install"]:
|
||||||
if not file.endswith(".kext"):
|
if not location.endswith("Extensions"):
|
||||||
continue
|
continue
|
||||||
self.remove_file("/Library/Extensions", file)
|
for file in oclp_plist_data[key]["Install"][location]:
|
||||||
|
if not file.endswith(".kext"):
|
||||||
|
continue
|
||||||
|
self.remove_file("/Library/Extensions", file)
|
||||||
|
|
||||||
# Handle situations where users migrated from older OSes with a lot of garbage in /L*/E*
|
# Handle situations where users migrated from older OSes with a lot of garbage in /L*/E*
|
||||||
# ex. Nvidia Web Drivers, NetUSB, dosdude1's patches, etc.
|
# ex. Nvidia Web Drivers, NetUSB, dosdude1's patches, etc.
|
||||||
@@ -513,7 +531,7 @@ class PatchSysVolume:
|
|||||||
else:
|
else:
|
||||||
print(f"- Running Process:\n{process}")
|
print(f"- Running Process:\n{process}")
|
||||||
utilities.process_status(subprocess.run(process, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True))
|
utilities.process_status(subprocess.run(process, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True))
|
||||||
if any(x in required_patches for x in ["AMD Legacy GCN", "AMD Legacy Polaris"]):
|
if any(x in required_patches for x in ["AMD Legacy GCN", "AMD Legacy Polaris", "AMD Legacy Vega"]):
|
||||||
sys_patch_helpers.sys_patch_helpers(self.constants).disable_window_server_caching()
|
sys_patch_helpers.sys_patch_helpers(self.constants).disable_window_server_caching()
|
||||||
if any(x in required_patches for x in ["Intel Ivy Bridge", "Intel Haswell"]):
|
if any(x in required_patches for x in ["Intel Ivy Bridge", "Intel Haswell"]):
|
||||||
sys_patch_helpers.sys_patch_helpers(self.constants).remove_news_widgets()
|
sys_patch_helpers.sys_patch_helpers(self.constants).remove_news_widgets()
|
||||||
@@ -544,7 +562,10 @@ class PatchSysVolume:
|
|||||||
raise Exception(f"Failed to find {source_file}")
|
raise Exception(f"Failed to find {source_file}")
|
||||||
|
|
||||||
# Ensure KDK is properly installed
|
# Ensure KDK is properly installed
|
||||||
self.merge_kdk_with_root()
|
should_save_cs = False
|
||||||
|
if "Legacy USB 1.1" in required_patches:
|
||||||
|
should_save_cs = True
|
||||||
|
self.merge_kdk_with_root(save_hid_cs=should_save_cs)
|
||||||
|
|
||||||
print("- Finished Preflight, starting patching")
|
print("- Finished Preflight, starting patching")
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import subprocess
|
|||||||
import webbrowser
|
import webbrowser
|
||||||
from resources import utilities, updates, global_settings
|
from resources import utilities, updates, global_settings
|
||||||
from resources.sys_patch import sys_patch_detect
|
from resources.sys_patch import sys_patch_detect
|
||||||
from gui import gui_main
|
from resources.gui import gui_main
|
||||||
|
|
||||||
class AutomaticSysPatch:
|
class AutomaticSysPatch:
|
||||||
|
|
||||||
@@ -24,89 +24,132 @@ class AutomaticSysPatch:
|
|||||||
|
|
||||||
def start_auto_patch(self):
|
def start_auto_patch(self):
|
||||||
print("- Starting Automatic Patching")
|
print("- Starting Automatic Patching")
|
||||||
if self.constants.wxpython_variant is True:
|
if self.constants.wxpython_variant is False:
|
||||||
if utilities.check_seal() is True:
|
|
||||||
print("- Detected Snapshot seal intact, detecting patches")
|
|
||||||
patches = sys_patch_detect.detect_root_patch(self.constants.computer.real_model, self.constants).detect_patch_set()
|
|
||||||
if not any(not patch.startswith("Settings") and not patch.startswith("Validation") and patches[patch] is True for patch in patches):
|
|
||||||
patches = []
|
|
||||||
if patches:
|
|
||||||
print("- Detected applicable patches, determining whether possible to patch")
|
|
||||||
if patches["Validation: Patching Possible"] is True:
|
|
||||||
print("- Determined patching is possible, checking for OCLP updates")
|
|
||||||
patch_string = ""
|
|
||||||
for patch in patches:
|
|
||||||
if patches[patch] is True and not patch.startswith("Settings") and not patch.startswith("Validation"):
|
|
||||||
patch_string += f"- {patch}\n"
|
|
||||||
# Check for updates
|
|
||||||
dict = updates.check_binary_updates(self.constants).check_binary_updates()
|
|
||||||
if not dict:
|
|
||||||
print("- No new binaries found on Github, proceeding with patching")
|
|
||||||
if self.constants.launcher_script is None:
|
|
||||||
args_string = f"'{self.constants.launcher_binary}' --gui_patch"
|
|
||||||
else:
|
|
||||||
args_string = f"{self.constants.launcher_binary} {self.constants.launcher_script} --gui_patch"
|
|
||||||
|
|
||||||
warning_str = ""
|
|
||||||
if utilities.verify_network_connection("https://api.github.com/repos/dortania/OpenCore-Legacy-Patcher/releases/latest") is False:
|
|
||||||
warning_str = f"""\n\nWARNING: We're unable to verify whether there are any new releases of OpenCore Legacy Patcher on Github. Be aware that you may be using an outdated version for this OS. If you're unsure, verify on Github that OpenCore Legacy Patcher {self.constants.patcher_version} is the latest official release"""
|
|
||||||
|
|
||||||
args = [
|
|
||||||
"osascript",
|
|
||||||
"-e",
|
|
||||||
f"""display dialog "OpenCore Legacy Patcher has detected you're running without Root Patches, and would like to install them.\n\nmacOS wipes all root patches during OS installs and updates, so they need to be reinstalled.\n\nFollowing Patches have been detected for your system: \n{patch_string}\nWould you like to apply these patches?{warning_str}" """
|
|
||||||
f'with icon POSIX file "{self.constants.app_icon_path}"',
|
|
||||||
]
|
|
||||||
output = subprocess.run(
|
|
||||||
args,
|
|
||||||
stdout=subprocess.PIPE,
|
|
||||||
stderr=subprocess.STDOUT
|
|
||||||
)
|
|
||||||
if output.returncode == 0:
|
|
||||||
args = [
|
|
||||||
"osascript",
|
|
||||||
"-e",
|
|
||||||
f'''do shell script "{args_string}"'''
|
|
||||||
f' with prompt "OpenCore Legacy Patcher would like to patch your root volume"'
|
|
||||||
" with administrator privileges"
|
|
||||||
" without altering line endings"
|
|
||||||
]
|
|
||||||
subprocess.run(
|
|
||||||
args,
|
|
||||||
stdout=subprocess.PIPE,
|
|
||||||
stderr=subprocess.STDOUT
|
|
||||||
)
|
|
||||||
else:
|
|
||||||
version = dict[0]["Version"]
|
|
||||||
github_link = dict[0]["Github Link"]
|
|
||||||
print(f"- Found new version: {version}")
|
|
||||||
|
|
||||||
# launch osascript to ask user if they want to apply the update
|
|
||||||
# if yes, open the link in the default browser
|
|
||||||
# we never want to run the root patcher if there are updates available
|
|
||||||
args = [
|
|
||||||
"osascript",
|
|
||||||
"-e",
|
|
||||||
f"""display dialog "OpenCore Legacy Patcher has detected you're running without Root Patches, and would like to install them.\n\nHowever we've detected a new version of OCLP on Github. Would you like to view this?\n\nCurrent Version: {self.constants.patcher_version}\nLatest Version: {version}\n\nNote: After downloading the latest OCLP version, open the app and run the 'Post Install Root Patcher' from the main menu." """
|
|
||||||
f'with icon POSIX file "{self.constants.app_icon_path}"',
|
|
||||||
]
|
|
||||||
output = subprocess.run(
|
|
||||||
args,
|
|
||||||
stdout=subprocess.PIPE,
|
|
||||||
stderr=subprocess.STDOUT
|
|
||||||
)
|
|
||||||
if output.returncode == 0:
|
|
||||||
webbrowser.open(github_link)
|
|
||||||
else:
|
|
||||||
print("- Cannot run patching")
|
|
||||||
else:
|
|
||||||
print("- No patches detected")
|
|
||||||
self.determine_if_boot_matches()
|
|
||||||
else:
|
|
||||||
print("- Detected Snapshot seal not intact, skipping")
|
|
||||||
self.determine_if_boot_matches(self.constants)
|
|
||||||
else:
|
|
||||||
print("- Auto Patch option is not supported on TUI, please use GUI")
|
print("- Auto Patch option is not supported on TUI, please use GUI")
|
||||||
|
return
|
||||||
|
|
||||||
|
if utilities.check_seal() is True:
|
||||||
|
print("- Detected Snapshot seal intact, detecting patches")
|
||||||
|
patches = sys_patch_detect.detect_root_patch(self.constants.computer.real_model, self.constants).detect_patch_set()
|
||||||
|
if not any(not patch.startswith("Settings") and not patch.startswith("Validation") and patches[patch] is True for patch in patches):
|
||||||
|
patches = []
|
||||||
|
if patches:
|
||||||
|
print("- Detected applicable patches, determining whether possible to patch")
|
||||||
|
if patches["Validation: Patching Possible"] is False:
|
||||||
|
print("- Cannot run patching")
|
||||||
|
return
|
||||||
|
|
||||||
|
print("- Determined patching is possible, checking for OCLP updates")
|
||||||
|
patch_string = ""
|
||||||
|
for patch in patches:
|
||||||
|
if patches[patch] is True and not patch.startswith("Settings") and not patch.startswith("Validation"):
|
||||||
|
patch_string += f"- {patch}\n"
|
||||||
|
# Check for updates
|
||||||
|
dict = updates.check_binary_updates(self.constants).check_binary_updates()
|
||||||
|
if not dict:
|
||||||
|
print("- No new binaries found on Github, proceeding with patching")
|
||||||
|
if self.constants.launcher_script is None:
|
||||||
|
args_string = f"'{self.constants.launcher_binary}' --gui_patch"
|
||||||
|
else:
|
||||||
|
args_string = f"{self.constants.launcher_binary} {self.constants.launcher_script} --gui_patch"
|
||||||
|
|
||||||
|
warning_str = ""
|
||||||
|
if utilities.verify_network_connection("https://api.github.com/repos/dortania/OpenCore-Legacy-Patcher/releases/latest") is False:
|
||||||
|
warning_str = f"""\n\nWARNING: We're unable to verify whether there are any new releases of OpenCore Legacy Patcher on Github. Be aware that you may be using an outdated version for this OS. If you're unsure, verify on Github that OpenCore Legacy Patcher {self.constants.patcher_version} is the latest official release"""
|
||||||
|
|
||||||
|
args = [
|
||||||
|
"osascript",
|
||||||
|
"-e",
|
||||||
|
f"""display dialog "OpenCore Legacy Patcher has detected you're running without Root Patches, and would like to install them.\n\nmacOS wipes all root patches during OS installs and updates, so they need to be reinstalled.\n\nFollowing Patches have been detected for your system: \n{patch_string}\nWould you like to apply these patches?{warning_str}" """
|
||||||
|
f'with icon POSIX file "{self.constants.app_icon_path}"',
|
||||||
|
]
|
||||||
|
output = subprocess.run(
|
||||||
|
args,
|
||||||
|
stdout=subprocess.PIPE,
|
||||||
|
stderr=subprocess.STDOUT
|
||||||
|
)
|
||||||
|
if output.returncode == 0:
|
||||||
|
args = [
|
||||||
|
"osascript",
|
||||||
|
"-e",
|
||||||
|
f'''do shell script "{args_string}"'''
|
||||||
|
f' with prompt "OpenCore Legacy Patcher would like to patch your root volume"'
|
||||||
|
" with administrator privileges"
|
||||||
|
" without altering line endings"
|
||||||
|
]
|
||||||
|
subprocess.run(
|
||||||
|
args,
|
||||||
|
stdout=subprocess.PIPE,
|
||||||
|
stderr=subprocess.STDOUT
|
||||||
|
)
|
||||||
|
return
|
||||||
|
else:
|
||||||
|
for key in dict:
|
||||||
|
version = dict[key]["Version"]
|
||||||
|
github_link = dict[key]["Github Link"]
|
||||||
|
print(f"- Found new version: {version}")
|
||||||
|
|
||||||
|
# launch osascript to ask user if they want to apply the update
|
||||||
|
# if yes, open the link in the default browser
|
||||||
|
# we never want to run the root patcher if there are updates available
|
||||||
|
args = [
|
||||||
|
"osascript",
|
||||||
|
"-e",
|
||||||
|
f"""display dialog "OpenCore Legacy Patcher has detected you're running without Root Patches, and would like to install them.\n\nHowever we've detected a new version of OCLP on Github. Would you like to view this?\n\nCurrent Version: {self.constants.patcher_version}\nLatest Version: {version}\n\nNote: After downloading the latest OCLP version, open the app and run the 'Post Install Root Patcher' from the main menu." """
|
||||||
|
f'with icon POSIX file "{self.constants.app_icon_path}"',
|
||||||
|
]
|
||||||
|
output = subprocess.run(
|
||||||
|
args,
|
||||||
|
stdout=subprocess.PIPE,
|
||||||
|
stderr=subprocess.STDOUT
|
||||||
|
)
|
||||||
|
if output.returncode == 0:
|
||||||
|
webbrowser.open(github_link)
|
||||||
|
|
||||||
|
return
|
||||||
|
else:
|
||||||
|
print("- No patches detected")
|
||||||
|
else:
|
||||||
|
print("- Detected Snapshot seal not intact, skipping")
|
||||||
|
|
||||||
|
if self.determine_if_versions_match() is False:
|
||||||
|
self.determine_if_boot_matches()
|
||||||
|
|
||||||
|
|
||||||
|
def determine_if_versions_match(self):
|
||||||
|
print("- Checking booted vs installed OCLP Build")
|
||||||
|
if self.constants.computer.oclp_version is None:
|
||||||
|
print("- Booted version not found")
|
||||||
|
return False
|
||||||
|
|
||||||
|
if self.constants.computer.oclp_version == self.constants.patcher_version:
|
||||||
|
print("- Versions match")
|
||||||
|
return False
|
||||||
|
|
||||||
|
# Check if installed version is newer than booted version
|
||||||
|
if updates.check_binary_updates(self.constants).check_if_build_newer(
|
||||||
|
self.constants.computer.oclp_version.split("."), self.constants.patcher_version.split(".")
|
||||||
|
) is True:
|
||||||
|
print("- Installed version is newer than booted version")
|
||||||
|
return False
|
||||||
|
|
||||||
|
args = [
|
||||||
|
"osascript",
|
||||||
|
"-e",
|
||||||
|
f"""display dialog "OpenCore Legacy Patcher has detected that you are booting an outdated OpenCore build\n- Booted: {self.constants.computer.oclp_version}\n- Installed: {self.constants.patcher_version}\n\nWould you like to update the OpenCore bootloader?" """
|
||||||
|
f'with icon POSIX file "{self.constants.app_icon_path}"',
|
||||||
|
]
|
||||||
|
output = subprocess.run(
|
||||||
|
args,
|
||||||
|
stdout=subprocess.PIPE,
|
||||||
|
stderr=subprocess.STDOUT
|
||||||
|
)
|
||||||
|
if output.returncode == 0:
|
||||||
|
print("- Launching GUI's Build/Install menu")
|
||||||
|
self.constants.start_build_install = True
|
||||||
|
gui_main.wx_python_gui(self.constants).main_menu(None)
|
||||||
|
|
||||||
|
return True
|
||||||
|
|
||||||
def determine_if_boot_matches(self):
|
def determine_if_boot_matches(self):
|
||||||
# Goal of this function is to determine whether the user
|
# Goal of this function is to determine whether the user
|
||||||
@@ -117,116 +160,124 @@ class AutomaticSysPatch:
|
|||||||
# and ask if they want to install to install to disk
|
# and ask if they want to install to install to disk
|
||||||
|
|
||||||
print("- Determining if macOS drive matches boot drive")
|
print("- Determining if macOS drive matches boot drive")
|
||||||
|
|
||||||
should_notify = global_settings.global_settings().read_property("AutoPatch_Notify_Mismatched_Disks")
|
should_notify = global_settings.global_settings().read_property("AutoPatch_Notify_Mismatched_Disks")
|
||||||
if should_notify is False:
|
if should_notify is False:
|
||||||
print("- Skipping due to user preference")
|
print("- Skipping due to user preference")
|
||||||
elif self.constants.host_is_hackintosh is True:
|
return
|
||||||
|
if self.constants.host_is_hackintosh is True:
|
||||||
print("- Skipping due to hackintosh")
|
print("- Skipping due to hackintosh")
|
||||||
else:
|
return
|
||||||
if self.constants.booted_oc_disk:
|
if not self.constants.booted_oc_disk:
|
||||||
root_disk = self.constants.booted_oc_disk.strip("disk")
|
print("- Failed to find disk OpenCore launched from")
|
||||||
root_disk = "disk" + root_disk.split("s")[0]
|
return
|
||||||
|
|
||||||
print(f" - Boot Drive: {self.constants.booted_oc_disk} ({root_disk})")
|
root_disk = self.constants.booted_oc_disk.strip("disk")
|
||||||
macOS_disk = utilities.get_disk_path()
|
root_disk = "disk" + root_disk.split("s")[0]
|
||||||
print(f" - macOS Drive: {macOS_disk}")
|
|
||||||
physical_stores = utilities.find_apfs_physical_volume(macOS_disk)
|
|
||||||
print(f" - APFS Physical Stores: {physical_stores}")
|
|
||||||
|
|
||||||
disk_match = False
|
print(f" - Boot Drive: {self.constants.booted_oc_disk} ({root_disk})")
|
||||||
for disk in physical_stores:
|
macOS_disk = utilities.get_disk_path()
|
||||||
if root_disk in disk:
|
print(f" - macOS Drive: {macOS_disk}")
|
||||||
print(f"- Boot drive matches macOS drive ({disk})")
|
physical_stores = utilities.find_apfs_physical_volume(macOS_disk)
|
||||||
disk_match = True
|
print(f" - APFS Physical Stores: {physical_stores}")
|
||||||
break
|
|
||||||
|
|
||||||
if disk_match is False:
|
disk_match = False
|
||||||
# Check if OpenCore is on a USB drive
|
for disk in physical_stores:
|
||||||
print("- Boot Drive does not match macOS drive, checking if OpenCore is on a USB drive")
|
if root_disk in disk:
|
||||||
|
print(f"- Boot drive matches macOS drive ({disk})")
|
||||||
|
disk_match = True
|
||||||
|
break
|
||||||
|
|
||||||
disk_info = plistlib.loads(subprocess.run(["diskutil", "info", "-plist", root_disk], stdout=subprocess.PIPE).stdout)
|
if disk_match is True:
|
||||||
try:
|
return
|
||||||
if disk_info["Ejectable"] is True:
|
|
||||||
print("- Boot Disk is ejectable, prompting user to install to internal")
|
|
||||||
|
|
||||||
args = [
|
# Check if OpenCore is on a USB drive
|
||||||
"osascript",
|
print("- Boot Drive does not match macOS drive, checking if OpenCore is on a USB drive")
|
||||||
"-e",
|
|
||||||
f"""display dialog "OpenCore Legacy Patcher has detected that you are booting OpenCore from an USB or External drive.\n\nIf you would like to boot your Mac normally without a USB drive plugged in, you can install OpenCore to the internal hard drive.\n\nWould you like to launch OpenCore Legacy Patcher and install to disk?" """
|
|
||||||
f'with icon POSIX file "{self.constants.app_icon_path}"',
|
|
||||||
]
|
|
||||||
output = subprocess.run(
|
|
||||||
args,
|
|
||||||
stdout=subprocess.PIPE,
|
|
||||||
stderr=subprocess.STDOUT
|
|
||||||
)
|
|
||||||
if output.returncode == 0:
|
|
||||||
print("- Launching GUI's Build/Install menu")
|
|
||||||
self.constants.start_build_install = True
|
|
||||||
gui_main.wx_python_gui(self.constants).main_menu(None)
|
|
||||||
else:
|
|
||||||
print("- Boot Disk is not removable, skipping prompt")
|
|
||||||
except KeyError:
|
|
||||||
print("- Unable to determine if boot disk is removable, skipping prompt")
|
|
||||||
|
|
||||||
else:
|
disk_info = plistlib.loads(subprocess.run(["diskutil", "info", "-plist", root_disk], stdout=subprocess.PIPE).stdout)
|
||||||
print("- Failed to find disk OpenCore launched from")
|
try:
|
||||||
|
if disk_info["Ejectable"] is False:
|
||||||
|
print("- Boot Disk is not removable, skipping prompt")
|
||||||
|
return
|
||||||
|
|
||||||
|
print("- Boot Disk is ejectable, prompting user to install to internal")
|
||||||
|
|
||||||
|
args = [
|
||||||
|
"osascript",
|
||||||
|
"-e",
|
||||||
|
f"""display dialog "OpenCore Legacy Patcher has detected that you are booting OpenCore from an USB or External drive.\n\nIf you would like to boot your Mac normally without a USB drive plugged in, you can install OpenCore to the internal hard drive.\n\nWould you like to launch OpenCore Legacy Patcher and install to disk?" """
|
||||||
|
f'with icon POSIX file "{self.constants.app_icon_path}"',
|
||||||
|
]
|
||||||
|
output = subprocess.run(
|
||||||
|
args,
|
||||||
|
stdout=subprocess.PIPE,
|
||||||
|
stderr=subprocess.STDOUT
|
||||||
|
)
|
||||||
|
if output.returncode == 0:
|
||||||
|
print("- Launching GUI's Build/Install menu")
|
||||||
|
self.constants.start_build_install = True
|
||||||
|
gui_main.wx_python_gui(self.constants).main_menu(None)
|
||||||
|
|
||||||
|
except KeyError:
|
||||||
|
print("- Unable to determine if boot disk is removable, skipping prompt")
|
||||||
|
|
||||||
|
|
||||||
def install_auto_patcher_launch_agent(self):
|
def install_auto_patcher_launch_agent(self):
|
||||||
# Installs the following:
|
# Installs the following:
|
||||||
# - OpenCore-Patcher.app in /Library/Application Support/Dortania/
|
# - OpenCore-Patcher.app in /Library/Application Support/Dortania/
|
||||||
# - com.dortania.opencore-legacy-patcher.auto-patch.plist in /Library/LaunchAgents/
|
# - com.dortania.opencore-legacy-patcher.auto-patch.plist in /Library/LaunchAgents/
|
||||||
if self.constants.launcher_script is None:
|
if self.constants.launcher_script is not None:
|
||||||
# Verify our binary isn't located in '/Library/Application Support/Dortania/'
|
print("- Skipping Auto Patcher Launch Agent, not supported when running from source")
|
||||||
# As we'd simply be duplicating ourselves
|
return
|
||||||
if not self.constants.launcher_binary.startswith("/Library/Application Support/Dortania/"):
|
|
||||||
print("- Installing Auto Patcher Launch Agent")
|
|
||||||
|
|
||||||
if not Path("Library/Application Support/Dortania").exists():
|
if self.constants.launcher_binary.startswith("/Library/Application Support/Dortania/"):
|
||||||
print("- Creating /Library/Application Support/Dortania/")
|
print("- Skipping Auto Patcher Launch Agent, already installed")
|
||||||
utilities.process_status(utilities.elevated(["mkdir", "-p", "/Library/Application Support/Dortania"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
|
return
|
||||||
|
|
||||||
print("- Copying OpenCore Patcher to /Library/Application Support/Dortania/")
|
# Verify our binary isn't located in '/Library/Application Support/Dortania/'
|
||||||
if Path("/Library/Application Support/Dortania/OpenCore-Patcher.app").exists():
|
# As we'd simply be duplicating ourselves
|
||||||
print("- Deleting existing OpenCore-Patcher")
|
print("- Installing Auto Patcher Launch Agent")
|
||||||
utilities.process_status(utilities.elevated(["rm", "-R", "/Library/Application Support/Dortania/OpenCore-Patcher.app"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
|
|
||||||
|
|
||||||
# Strip everything after OpenCore-Patcher.app
|
if not Path("Library/Application Support/Dortania").exists():
|
||||||
path = str(self.constants.launcher_binary).split("/Contents/MacOS/OpenCore-Patcher")[0]
|
print("- Creating /Library/Application Support/Dortania/")
|
||||||
print(f"- Copying {path} to /Library/Application Support/Dortania/")
|
utilities.process_status(utilities.elevated(["mkdir", "-p", "/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():
|
print("- Copying OpenCore Patcher to /Library/Application Support/Dortania/")
|
||||||
# Sometimes the binary the user launches may have a suffix (ie. OpenCore-Patcher 3.app)
|
if Path("/Library/Application Support/Dortania/OpenCore-Patcher.app").exists():
|
||||||
# We'll want to rename it to OpenCore-Patcher.app
|
print("- Deleting existing OpenCore-Patcher")
|
||||||
path = path.split("/")[-1]
|
utilities.process_status(utilities.elevated(["rm", "-R", "/Library/Application Support/Dortania/OpenCore-Patcher.app"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
|
||||||
print(f"- Renaming {path} to OpenCore-Patcher.app")
|
|
||||||
utilities.process_status(utilities.elevated(["mv", f"/Library/Application Support/Dortania/{path}", "/Library/Application Support/Dortania/OpenCore-Patcher.app"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
|
|
||||||
|
|
||||||
subprocess.run(["xattr", "-cr", "/Library/Application Support/Dortania/OpenCore-Patcher.app"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
# Strip everything after OpenCore-Patcher.app
|
||||||
|
path = str(self.constants.launcher_binary).split("/Contents/MacOS/OpenCore-Patcher")[0]
|
||||||
|
print(f"- Copying {path} to /Library/Application Support/Dortania/")
|
||||||
|
utilities.process_status(utilities.elevated(["ditto", path, "/Library/Application Support/Dortania/OpenCore-Patcher.app"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
|
||||||
|
|
||||||
# Copy over our launch agent
|
if not Path("/Library/Application Support/Dortania/OpenCore-Patcher.app").exists():
|
||||||
print("- Copying auto-patch.plist Launch Agent to /Library/LaunchAgents/")
|
# Sometimes the binary the user launches may have a suffix (ie. OpenCore-Patcher 3.app)
|
||||||
if Path("/Library/LaunchAgents/com.dortania.opencore-legacy-patcher.auto-patch.plist").exists():
|
# We'll want to rename it to OpenCore-Patcher.app
|
||||||
print("- Deleting existing auto-patch.plist")
|
path = path.split("/")[-1]
|
||||||
utilities.process_status(utilities.elevated(["rm", "/Library/LaunchAgents/com.dortania.opencore-legacy-patcher.auto-patch.plist"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
|
print(f"- Renaming {path} to OpenCore-Patcher.app")
|
||||||
if not Path("/Library/LaunchAgents/").exists():
|
utilities.process_status(utilities.elevated(["mv", f"/Library/Application Support/Dortania/{path}", "/Library/Application Support/Dortania/OpenCore-Patcher.app"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
|
||||||
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", self.constants.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
|
subprocess.run(["xattr", "-cr", "/Library/Application Support/Dortania/OpenCore-Patcher.app"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||||
print("- Setting permissions on auto-patch.plist")
|
|
||||||
utilities.process_status(utilities.elevated(["chmod", "644", "/Library/LaunchAgents/com.dortania.opencore-legacy-patcher.auto-patch.plist"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
|
|
||||||
utilities.process_status(utilities.elevated(["chown", "root:wheel", "/Library/LaunchAgents/com.dortania.opencore-legacy-patcher.auto-patch.plist"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
|
|
||||||
|
|
||||||
# Making app alias
|
# Copy over our launch agent
|
||||||
# Simply an easy way for users to notice the app
|
print("- Copying auto-patch.plist Launch Agent to /Library/LaunchAgents/")
|
||||||
# If there's already an alias or exiting app, skip
|
if Path("/Library/LaunchAgents/com.dortania.opencore-legacy-patcher.auto-patch.plist").exists():
|
||||||
if not Path("/Applications/OpenCore-Patcher.app").exists():
|
print("- Deleting existing auto-patch.plist")
|
||||||
print("- Making app alias")
|
utilities.process_status(utilities.elevated(["rm", "/Library/LaunchAgents/com.dortania.opencore-legacy-patcher.auto-patch.plist"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
|
||||||
utilities.process_status(utilities.elevated(["ln", "-s", "/Library/Application Support/Dortania/OpenCore-Patcher.app", "/Applications/OpenCore-Patcher.app"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
|
if not Path("/Library/LaunchAgents/").exists():
|
||||||
else:
|
print("- Creating /Library/LaunchAgents/")
|
||||||
print("- Skipping Auto Patcher Launch Agent, not supported when running from source")
|
utilities.process_status(utilities.elevated(["mkdir", "-p", "/Library/LaunchAgents/"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
|
||||||
|
utilities.process_status(utilities.elevated(["cp", self.constants.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
|
||||||
|
print("- Setting permissions on auto-patch.plist")
|
||||||
|
utilities.process_status(utilities.elevated(["chmod", "644", "/Library/LaunchAgents/com.dortania.opencore-legacy-patcher.auto-patch.plist"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
|
||||||
|
utilities.process_status(utilities.elevated(["chown", "root:wheel", "/Library/LaunchAgents/com.dortania.opencore-legacy-patcher.auto-patch.plist"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
|
||||||
|
|
||||||
|
# Making app alias
|
||||||
|
# Simply an easy way for users to notice the app
|
||||||
|
# If there's already an alias or exiting app, skip
|
||||||
|
if not Path("/Applications/OpenCore-Patcher.app").exists():
|
||||||
|
print("- Making app alias")
|
||||||
|
utilities.process_status(utilities.elevated(["ln", "-s", "/Library/Application Support/Dortania/OpenCore-Patcher.app", "/Applications/OpenCore-Patcher.app"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
|
||||||
@@ -5,7 +5,11 @@
|
|||||||
|
|
||||||
from resources import constants, device_probe, utilities, amfi_detect
|
from resources import constants, device_probe, utilities, amfi_detect
|
||||||
from resources.sys_patch import sys_patch_helpers
|
from resources.sys_patch import sys_patch_helpers
|
||||||
from data import model_array, os_data, sip_data, sys_patch_dict
|
from data import model_array, os_data, sip_data, sys_patch_dict, smbios_data, cpu_data
|
||||||
|
|
||||||
|
import py_sip_xnu
|
||||||
|
from pathlib import Path
|
||||||
|
import plistlib
|
||||||
|
|
||||||
class detect_root_patch:
|
class detect_root_patch:
|
||||||
def __init__(self, model, versions):
|
def __init__(self, model, versions):
|
||||||
@@ -27,6 +31,7 @@ class detect_root_patch:
|
|||||||
self.skylake_gpu = False
|
self.skylake_gpu = False
|
||||||
self.legacy_gcn = False
|
self.legacy_gcn = False
|
||||||
self.legacy_polaris = False
|
self.legacy_polaris = False
|
||||||
|
self.legacy_vega = False
|
||||||
|
|
||||||
# Misc Patch Detection
|
# Misc Patch Detection
|
||||||
self.brightness_legacy = False
|
self.brightness_legacy = False
|
||||||
@@ -34,6 +39,7 @@ class detect_root_patch:
|
|||||||
self.legacy_wifi = False
|
self.legacy_wifi = False
|
||||||
self.legacy_gmux = False
|
self.legacy_gmux = False
|
||||||
self.legacy_keyboard_backlight = False
|
self.legacy_keyboard_backlight = False
|
||||||
|
self.legacy_uhci_ohci = False
|
||||||
|
|
||||||
# Patch Requirements
|
# Patch Requirements
|
||||||
self.amfi_must_disable = False
|
self.amfi_must_disable = False
|
||||||
@@ -49,6 +55,7 @@ class detect_root_patch:
|
|||||||
self.fv_enabled = False
|
self.fv_enabled = False
|
||||||
self.dosdude_patched = False
|
self.dosdude_patched = False
|
||||||
self.missing_kdk = False
|
self.missing_kdk = False
|
||||||
|
self.has_network = False
|
||||||
|
|
||||||
self.missing_whatever_green = False
|
self.missing_whatever_green = False
|
||||||
self.missing_nv_web_nvram = False
|
self.missing_nv_web_nvram = False
|
||||||
@@ -142,6 +149,15 @@ class detect_root_patch:
|
|||||||
self.supports_metal = True
|
self.supports_metal = True
|
||||||
self.requires_root_kc = True
|
self.requires_root_kc = True
|
||||||
self.amfi_must_disable = True
|
self.amfi_must_disable = True
|
||||||
|
elif gpu.arch == device_probe.AMD.Archs.Vega:
|
||||||
|
if self.constants.detected_os > os_data.os_data.monterey:
|
||||||
|
if "AVX2" in self.constants.computer.cpu.leafs:
|
||||||
|
continue
|
||||||
|
|
||||||
|
self.legacy_vega = True
|
||||||
|
self.supports_metal = True
|
||||||
|
self.requires_root_kc = True
|
||||||
|
self.amfi_must_disable = True
|
||||||
elif gpu.arch == device_probe.Intel.Archs.Iron_Lake:
|
elif gpu.arch == device_probe.Intel.Archs.Iron_Lake:
|
||||||
if self.constants.detected_os > non_metal_os:
|
if self.constants.detected_os > non_metal_os:
|
||||||
self.iron_gpu = True
|
self.iron_gpu = True
|
||||||
@@ -190,12 +206,13 @@ class detect_root_patch:
|
|||||||
self.sandy_gpu = False
|
self.sandy_gpu = False
|
||||||
self.legacy_keyboard_backlight = False
|
self.legacy_keyboard_backlight = False
|
||||||
|
|
||||||
if self.legacy_polaris is True and self.legacy_gcn is True:
|
if self.legacy_gcn is True:
|
||||||
# We can only support one or the other due to the nature of relying
|
# We can only support one or the other due to the nature of relying
|
||||||
# on portions of the native AMD stack for Polaris
|
# on portions of the native AMD stack for Polaris and Vega
|
||||||
# Thus we'll prioritize legacy GCN due to being the internal card
|
# Thus we'll prioritize legacy GCN due to being the internal card
|
||||||
# ex. MacPro6,1 and MacBookPro11,5 with eGPUs
|
# ex. MacPro6,1 and MacBookPro11,5 with eGPUs
|
||||||
self.legacy_polaris = False
|
self.legacy_polaris = False
|
||||||
|
self.legacy_vega = False
|
||||||
|
|
||||||
if self.constants.detected_os <= os_data.os_data.monterey:
|
if self.constants.detected_os <= os_data.os_data.monterey:
|
||||||
# Always assume Root KC requirement on Monterey and older
|
# Always assume Root KC requirement on Monterey and older
|
||||||
@@ -204,6 +221,55 @@ class detect_root_patch:
|
|||||||
if self.requires_root_kc is True:
|
if self.requires_root_kc is True:
|
||||||
self.missing_kdk = not self.check_kdk()
|
self.missing_kdk = not self.check_kdk()
|
||||||
|
|
||||||
|
self.check_networking_support()
|
||||||
|
|
||||||
|
|
||||||
|
def check_networking_support(self):
|
||||||
|
# On macOS Ventura, networking support is required to download KDKs.
|
||||||
|
# However for machines such as BCM94322, BCM94328 and Atheros chipsets,
|
||||||
|
# users may only have wifi as their only supported network interface.
|
||||||
|
# Thus we'll allow for KDK-less installs for these machines on first run.
|
||||||
|
# On subsequent runs, we'll require networking to be enabled.
|
||||||
|
|
||||||
|
if self.constants.detected_os < os_data.os_data.ventura:
|
||||||
|
return
|
||||||
|
if self.legacy_wifi is False:
|
||||||
|
return
|
||||||
|
if self.requires_root_kc is False:
|
||||||
|
return
|
||||||
|
if self.missing_kdk is False:
|
||||||
|
return
|
||||||
|
if self.has_network is True:
|
||||||
|
return
|
||||||
|
|
||||||
|
# Verify whether OCLP already installed network patches to the root volume
|
||||||
|
# If so, require networking to be enabled (user just needs to connect to wifi)
|
||||||
|
oclp_patch_path = "/System/Library/CoreServices/OpenCore-Legacy-Patcher.plist"
|
||||||
|
if Path(oclp_patch_path).exists():
|
||||||
|
oclp_plist = plistlib.load(open(oclp_patch_path, "rb"))
|
||||||
|
if "Legacy Wireless" in oclp_plist:
|
||||||
|
return
|
||||||
|
|
||||||
|
# Due to the reliance of KDKs for most older patches, we'll allow KDK-less
|
||||||
|
# installs for Legacy Wifi patches and remove others
|
||||||
|
self.missing_kdk = False
|
||||||
|
self.requires_root_kc = False
|
||||||
|
|
||||||
|
# Reset patches needing KDK
|
||||||
|
self.nvidia_tesla = False
|
||||||
|
self.nvidia_web = False
|
||||||
|
self.amd_ts1 = False
|
||||||
|
self.amd_ts2 = False
|
||||||
|
self.iron_gpu = False
|
||||||
|
self.sandy_gpu = False
|
||||||
|
self.legacy_gcn = False
|
||||||
|
self.legacy_polaris = False
|
||||||
|
self.legacy_vega = False
|
||||||
|
self.brightness_legacy = False
|
||||||
|
self.legacy_audio = False
|
||||||
|
self.legacy_gmux = False
|
||||||
|
self.legacy_keyboard_backlight = False
|
||||||
|
|
||||||
|
|
||||||
def check_dgpu_status(self):
|
def check_dgpu_status(self):
|
||||||
dgpu = self.constants.computer.dgpu
|
dgpu = self.constants.computer.dgpu
|
||||||
@@ -300,8 +366,47 @@ class detect_root_patch:
|
|||||||
sip_value = f"For Hackintoshes, please set csr-active-config to '03060000' ({sip_hex})\nFor non-OpenCore Macs, please run 'csrutil disable' in RecoveryOS"
|
sip_value = f"For Hackintoshes, please set csr-active-config to '03060000' ({sip_hex})\nFor non-OpenCore Macs, please run 'csrutil disable' in RecoveryOS"
|
||||||
return (sip, sip_value, sip_hex)
|
return (sip, sip_value, sip_hex)
|
||||||
|
|
||||||
|
def check_uhci_ohci(self):
|
||||||
|
if self.constants.detected_os < os_data.os_data.ventura:
|
||||||
|
return False
|
||||||
|
|
||||||
|
for controller in self.constants.computer.usb_controllers:
|
||||||
|
if (isinstance(controller, device_probe.XHCIController)):
|
||||||
|
# Currently USB 1.1 patches are incompatible with USB 3.0 controllers
|
||||||
|
# TODO: Downgrade remaining USB stack to ensure full support
|
||||||
|
return False
|
||||||
|
|
||||||
|
# If we're on a hackintosh, check for UHCI/OHCI controllers
|
||||||
|
if self.constants.host_is_hackintosh is True:
|
||||||
|
for controller in self.constants.computer.usb_controllers:
|
||||||
|
if (
|
||||||
|
isinstance(controller, device_probe.UHCIController) or
|
||||||
|
isinstance(controller, device_probe.OHCIController)
|
||||||
|
):
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
|
if self.model not in smbios_data.smbios_dictionary:
|
||||||
|
return False
|
||||||
|
|
||||||
|
# If we're on a Mac, check for Penryn or older
|
||||||
|
# This is due to Apple implementing an internal USB hub on post-Penryn (excluding MacPro4,1 and MacPro5,1)
|
||||||
|
# Ref: https://techcommunity.microsoft.com/t5/microsoft-usb-blog/reasons-to-avoid-companion-controllers/ba-p/270710
|
||||||
|
if (
|
||||||
|
smbios_data.smbios_dictionary[self.model]["CPU Generation"] <= cpu_data.cpu_data.penryn.value or \
|
||||||
|
self.model in ["MacPro4,1", "MacPro5,1"]
|
||||||
|
):
|
||||||
|
return True
|
||||||
|
|
||||||
|
return False
|
||||||
|
|
||||||
def detect_patch_set(self):
|
def detect_patch_set(self):
|
||||||
self.detect_gpus()
|
self.has_network = utilities.verify_network_connection()
|
||||||
|
|
||||||
|
if self.check_uhci_ohci() is True:
|
||||||
|
self.legacy_uhci_ohci = True
|
||||||
|
self.requires_root_kc = True
|
||||||
|
|
||||||
if self.model in model_array.LegacyBrightness:
|
if self.model in model_array.LegacyBrightness:
|
||||||
if self.constants.detected_os > os_data.os_data.catalina:
|
if self.constants.detected_os > os_data.os_data.catalina:
|
||||||
self.brightness_legacy = True
|
self.brightness_legacy = True
|
||||||
@@ -316,8 +421,11 @@ class detect_root_patch:
|
|||||||
isinstance(self.constants.computer.wifi, device_probe.Broadcom)
|
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]
|
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):
|
) or (isinstance(self.constants.computer.wifi, device_probe.Atheros) and self.constants.computer.wifi.chipset == device_probe.Atheros.Chipsets.AirPortAtheros40):
|
||||||
if os_data.os_data.ventura > self.constants.detected_os > os_data.os_data.big_sur:
|
if self.constants.detected_os > os_data.os_data.big_sur:
|
||||||
self.legacy_wifi = True
|
self.legacy_wifi = True
|
||||||
|
if self.constants.detected_os >= os_data.os_data.ventura:
|
||||||
|
# Due to extracted frameworks for IO80211.framework and co, check library validation
|
||||||
|
self.amfi_must_disable = True
|
||||||
|
|
||||||
# if self.model in ["MacBookPro5,1", "MacBookPro5,2", "MacBookPro5,3", "MacBookPro8,2", "MacBookPro8,3"]:
|
# if self.model in ["MacBookPro5,1", "MacBookPro5,2", "MacBookPro5,3", "MacBookPro8,2", "MacBookPro8,3"]:
|
||||||
if self.model in ["MacBookPro8,2", "MacBookPro8,3"]:
|
if self.model in ["MacBookPro8,2", "MacBookPro8,3"]:
|
||||||
@@ -333,6 +441,8 @@ class detect_root_patch:
|
|||||||
else:
|
else:
|
||||||
self.legacy_gmux = True
|
self.legacy_gmux = True
|
||||||
|
|
||||||
|
self.detect_gpus()
|
||||||
|
|
||||||
self.root_patch_dict = {
|
self.root_patch_dict = {
|
||||||
"Graphics: Nvidia Tesla": self.nvidia_tesla,
|
"Graphics: Nvidia Tesla": self.nvidia_tesla,
|
||||||
"Graphics: Nvidia Kepler": self.kepler_gpu,
|
"Graphics: Nvidia Kepler": self.kepler_gpu,
|
||||||
@@ -341,6 +451,7 @@ class detect_root_patch:
|
|||||||
"Graphics: AMD TeraScale 2": self.amd_ts2,
|
"Graphics: AMD TeraScale 2": self.amd_ts2,
|
||||||
"Graphics: AMD Legacy GCN": self.legacy_gcn,
|
"Graphics: AMD Legacy GCN": self.legacy_gcn,
|
||||||
"Graphics: AMD Legacy Polaris": self.legacy_polaris,
|
"Graphics: AMD Legacy Polaris": self.legacy_polaris,
|
||||||
|
"Graphics: AMD Legacy Vega": self.legacy_vega,
|
||||||
"Graphics: Intel Ironlake": self.iron_gpu,
|
"Graphics: Intel Ironlake": self.iron_gpu,
|
||||||
"Graphics: Intel Sandy Bridge": self.sandy_gpu,
|
"Graphics: Intel Sandy Bridge": self.sandy_gpu,
|
||||||
"Graphics: Intel Ivy Bridge": self.ivy_gpu,
|
"Graphics: Intel Ivy Bridge": self.ivy_gpu,
|
||||||
@@ -352,12 +463,13 @@ class detect_root_patch:
|
|||||||
"Networking: Legacy Wireless": self.legacy_wifi,
|
"Networking: Legacy Wireless": self.legacy_wifi,
|
||||||
"Miscellaneous: Legacy GMUX": self.legacy_gmux,
|
"Miscellaneous: Legacy GMUX": self.legacy_gmux,
|
||||||
"Miscellaneous: Legacy Keyboard Backlight": self.legacy_keyboard_backlight,
|
"Miscellaneous: Legacy Keyboard Backlight": self.legacy_keyboard_backlight,
|
||||||
|
"Miscellaneous: Legacy USB 1.1": self.legacy_uhci_ohci,
|
||||||
"Settings: Requires AMFI exemption": self.amfi_must_disable,
|
"Settings: Requires AMFI exemption": self.amfi_must_disable,
|
||||||
"Settings: Supports Auxiliary Cache": not self.requires_root_kc,
|
"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,
|
"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(),
|
"Validation: Patching Possible": self.verify_patch_allowed(),
|
||||||
f"Validation: SIP is enabled (Required: {self.check_sip()[2]} or higher)": self.sip_enabled,
|
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,
|
f"Validation: Currently Booted SIP: ({hex(py_sip_xnu.SipXnu().get_sip_status().value)})": self.sip_enabled,
|
||||||
"Validation: SecureBootModel is enabled": self.sbm_enabled,
|
"Validation: SecureBootModel is enabled": self.sbm_enabled,
|
||||||
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,
|
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: FileVault is enabled": self.fv_enabled,
|
||||||
@@ -366,6 +478,7 @@ class detect_root_patch:
|
|||||||
"Validation: Force OpenGL property missing": self.missing_nv_web_opengl 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: 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,
|
"Validation: nvda_drv(_vrl) variable missing": self.missing_nv_web_nvram if self.nvidia_web is True else False,
|
||||||
|
"Validation: Network Connection Required": (not self.has_network) if (self.requires_root_kc and self.missing_kdk and self.constants.detected_os >= os_data.os_data.ventura.value) else False,
|
||||||
}
|
}
|
||||||
|
|
||||||
return self.root_patch_dict
|
return self.root_patch_dict
|
||||||
@@ -438,6 +551,10 @@ class detect_root_patch:
|
|||||||
print("\nCannot patch! WhateverGreen.kext missing")
|
print("\nCannot patch! WhateverGreen.kext missing")
|
||||||
print("Please ensure WhateverGreen.kext is installed")
|
print("Please ensure WhateverGreen.kext is installed")
|
||||||
|
|
||||||
|
if (not self.has_network) if (self.requires_root_kc and self.missing_kdk and self.constants.detected_os >= os_data.os_data.ventura.value) else False:
|
||||||
|
print("\nCannot patch! Network Connection Required")
|
||||||
|
print("Please ensure you have an active internet connection")
|
||||||
|
|
||||||
if any(
|
if any(
|
||||||
[
|
[
|
||||||
# General patch checks
|
# General patch checks
|
||||||
@@ -451,6 +568,9 @@ class detect_root_patch:
|
|||||||
self.missing_nv_web_opengl if self.nvidia_web is True else False,
|
self.missing_nv_web_opengl if self.nvidia_web is True else False,
|
||||||
self.missing_nv_compat if self.nvidia_web is True else False,
|
self.missing_nv_compat if self.nvidia_web is True else False,
|
||||||
self.missing_whatever_green if self.nvidia_web is True else False,
|
self.missing_whatever_green if self.nvidia_web is True else False,
|
||||||
|
|
||||||
|
# KDK specific
|
||||||
|
(not self.has_network) if (self.requires_root_kc and self.missing_kdk and self.constants.detected_os >= os_data.os_data.ventura.value) else False
|
||||||
]
|
]
|
||||||
):
|
):
|
||||||
return False
|
return False
|
||||||
@@ -541,6 +661,13 @@ class detect_root_patch:
|
|||||||
required_patches.update({"AMD Legacy Polaris": all_hardware_patchset["Graphics"]["AMD Legacy Polaris"]})
|
required_patches.update({"AMD Legacy Polaris": all_hardware_patchset["Graphics"]["AMD Legacy Polaris"]})
|
||||||
if "AVX2" not in self.constants.computer.cpu.leafs:
|
if "AVX2" not in self.constants.computer.cpu.leafs:
|
||||||
required_patches.update({"AMD OpenCL": all_hardware_patchset["Graphics"]["AMD OpenCL"]})
|
required_patches.update({"AMD OpenCL": all_hardware_patchset["Graphics"]["AMD OpenCL"]})
|
||||||
|
if hardware_details["Graphics: AMD Legacy Vega"] 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({"AMD Legacy Vega": all_hardware_patchset["Graphics"]["AMD Legacy Vega"]})
|
||||||
|
required_patches.update({"AMD OpenCL": all_hardware_patchset["Graphics"]["AMD OpenCL"]})
|
||||||
|
if hardware_details["Graphics: AMD Legacy GCN"] is True:
|
||||||
|
required_patches.update({"AMD Legacy Vega Extended": all_hardware_patchset["Graphics"]["AMD Legacy Vega Extended"]})
|
||||||
if hardware_details["Brightness: Legacy Backlight Control"] is True:
|
if hardware_details["Brightness: Legacy Backlight Control"] is True:
|
||||||
required_patches.update({"Legacy Backlight Control": all_hardware_patchset["Brightness"]["Legacy Backlight Control"]})
|
required_patches.update({"Legacy Backlight Control": all_hardware_patchset["Brightness"]["Legacy Backlight Control"]})
|
||||||
if hardware_details["Audio: Legacy Realtek"] is True:
|
if hardware_details["Audio: Legacy Realtek"] is True:
|
||||||
@@ -550,10 +677,13 @@ class detect_root_patch:
|
|||||||
required_patches.update({"Legacy Non-GOP": all_hardware_patchset["Audio"]["Legacy Non-GOP"]})
|
required_patches.update({"Legacy Non-GOP": all_hardware_patchset["Audio"]["Legacy Non-GOP"]})
|
||||||
if hardware_details["Networking: Legacy Wireless"] is True:
|
if hardware_details["Networking: Legacy Wireless"] is True:
|
||||||
required_patches.update({"Legacy Wireless": all_hardware_patchset["Networking"]["Legacy Wireless"]})
|
required_patches.update({"Legacy Wireless": all_hardware_patchset["Networking"]["Legacy Wireless"]})
|
||||||
|
required_patches.update({"Legacy Wireless Extended": all_hardware_patchset["Networking"]["Legacy Wireless Extended"]})
|
||||||
if hardware_details["Miscellaneous: Legacy GMUX"] is True:
|
if hardware_details["Miscellaneous: Legacy GMUX"] is True:
|
||||||
required_patches.update({"Legacy GMUX": all_hardware_patchset["Miscellaneous"]["Legacy GMUX"]})
|
required_patches.update({"Legacy GMUX": all_hardware_patchset["Miscellaneous"]["Legacy GMUX"]})
|
||||||
if hardware_details["Miscellaneous: Legacy Keyboard Backlight"] is True:
|
if hardware_details["Miscellaneous: Legacy Keyboard Backlight"] is True:
|
||||||
required_patches.update({"Legacy Keyboard Backlight": all_hardware_patchset["Miscellaneous"]["Legacy Keyboard Backlight"]})
|
required_patches.update({"Legacy Keyboard Backlight": all_hardware_patchset["Miscellaneous"]["Legacy Keyboard Backlight"]})
|
||||||
|
if hardware_details["Miscellaneous: Legacy USB 1.1"] is True:
|
||||||
|
required_patches.update({"Legacy USB 1.1": all_hardware_patchset["Miscellaneous"]["Legacy USB 1.1"]})
|
||||||
|
|
||||||
if required_patches:
|
if required_patches:
|
||||||
host_os_float = float(f"{self.constants.detected_os}.{self.constants.detected_os_minor}")
|
host_os_float = float(f"{self.constants.detected_os}.{self.constants.detected_os_minor}")
|
||||||
|
|||||||
@@ -83,9 +83,23 @@ class sys_patch_helpers:
|
|||||||
print(f"- Installing downloaded KDK (this may take a while)")
|
print(f"- Installing downloaded KDK (this may take a while)")
|
||||||
with tempfile.TemporaryDirectory() as mount_point:
|
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))
|
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
|
# Due to a permissions bug in macOS, sometimes the OS will fail on a Read-only file system error
|
||||||
utilities.process_status(utilities.elevated(["installer", "-pkg", f"{mount_point}/KernelDebugKit.pkg", "-target", "/"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
|
# We don't actually need to write inside the KDK DMG, however macOS will do whatever it wants
|
||||||
subprocess.run(["hdiutil", "detach", mount_point], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) # Do not really care if this fails
|
# Thus move the KDK to another location, and run the installer from there
|
||||||
|
kdk_dst_path = Path(f"{self.constants.payload_path}/KernelDebugKit.pkg")
|
||||||
|
if kdk_dst_path.exists():
|
||||||
|
utilities.process_status(utilities.elevated(["rm", kdk_dst_path], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
|
||||||
|
utilities.process_status(subprocess.run(["cp", f"{mount_point}/KernelDebugKit.pkg", self.constants.payload_path], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
|
||||||
|
result = utilities.elevated(["installer", "-pkg", kdk_dst_path, "-target", "/"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||||
|
if result.returncode != 0:
|
||||||
|
print("- Failed to install KDK:")
|
||||||
|
print(result.stdout.decode('utf-8'))
|
||||||
|
if result.stderr:
|
||||||
|
print(result.stderr.decode('utf-8'))
|
||||||
|
utilities.elevated(["hdiutil", "detach", mount_point], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||||
|
raise Exception("Failed to install KDK")
|
||||||
|
utilities.process_status(utilities.elevated(["rm", kdk_dst_path], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
|
||||||
|
utilities.elevated(["hdiutil", "detach", mount_point], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||||
print("- Successfully installed KDK")
|
print("- Successfully installed KDK")
|
||||||
|
|
||||||
|
|
||||||
@@ -145,6 +159,9 @@ class sys_patch_helpers:
|
|||||||
utilities.elevated(["bash", "-c", "rm -rf /private/var/folders/*/*/*/WindowServer/com.apple.WindowServer"])
|
utilities.elevated(["bash", "-c", "rm -rf /private/var/folders/*/*/*/WindowServer/com.apple.WindowServer"])
|
||||||
# Disable writing to WindowServer folder
|
# Disable writing to WindowServer folder
|
||||||
utilities.elevated(["bash", "-c", "chflags uchg /private/var/folders/*/*/*/WindowServer"])
|
utilities.elevated(["bash", "-c", "chflags uchg /private/var/folders/*/*/*/WindowServer"])
|
||||||
|
# Reference:
|
||||||
|
# To reverse write lock:
|
||||||
|
# 'chflags nouchg /private/var/folders/*/*/*/WindowServer'
|
||||||
|
|
||||||
|
|
||||||
def remove_news_widgets(self):
|
def remove_news_widgets(self):
|
||||||
@@ -183,4 +200,25 @@ class sys_patch_helpers:
|
|||||||
if did_find:
|
if did_find:
|
||||||
with open(file_path, "wb") as f:
|
with open(file_path, "wb") as f:
|
||||||
plistlib.dump(data, f, sort_keys=False)
|
plistlib.dump(data, f, sort_keys=False)
|
||||||
subprocess.run(["killall", "NotificationCenter"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
subprocess.run(["killall", "NotificationCenter"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||||
|
|
||||||
|
|
||||||
|
def install_rsr_repair_binary(self):
|
||||||
|
# With macOS 13.2, Apple implemented the Rapid Security Response System
|
||||||
|
# However Apple added a half baked snapshot reversion system if seal was broken,
|
||||||
|
# which forgets to handle Preboot BootKC syncing
|
||||||
|
|
||||||
|
# Thus this application will try to re-sync the BootKC with SysKC in the event of a panic
|
||||||
|
# Reference: https://github.com/dortania/OpenCore-Legacy-Patcher/issues/1019
|
||||||
|
|
||||||
|
# This is a (hopefully) temporary work-around, however likely to stay.
|
||||||
|
# RSRRepair has the added bonus of fixing desynced KCs from 'bless', so useful in Big Sur+
|
||||||
|
# https://github.com/flagersgit/RSRRepair
|
||||||
|
|
||||||
|
if self.constants.detected_os < os_data.os_data.big_sur:
|
||||||
|
return
|
||||||
|
|
||||||
|
print("- Installing Kernel Collection syncing utility")
|
||||||
|
result = utilities.elevated([self.constants.rsrrepair_userspace_path, "--install"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||||
|
if result.returncode != 0:
|
||||||
|
print(f" - Failed to install RSRRepair: {result.stdout.decode()}")
|
||||||
@@ -9,14 +9,14 @@ from pathlib import Path
|
|||||||
import os
|
import os
|
||||||
import binascii
|
import binascii
|
||||||
import argparse
|
import argparse
|
||||||
from ctypes import CDLL, c_uint, byref
|
|
||||||
import time
|
import time
|
||||||
import atexit
|
import atexit
|
||||||
import requests
|
import requests
|
||||||
import shutil
|
import shutil
|
||||||
import urllib.parse
|
import urllib.parse
|
||||||
|
import py_sip_xnu
|
||||||
|
|
||||||
from resources import constants, ioreg, amfi_detect
|
from resources import constants, ioreg
|
||||||
from data import sip_data, os_data
|
from data import sip_data, os_data
|
||||||
|
|
||||||
SESSION = requests.Session()
|
SESSION = requests.Session()
|
||||||
@@ -40,7 +40,7 @@ def string_to_hex(input_string):
|
|||||||
def process_status(process_result):
|
def process_status(process_result):
|
||||||
if process_result.returncode != 0:
|
if process_result.returncode != 0:
|
||||||
print(f"Process failed with exit code {process_result.returncode}")
|
print(f"Process failed with exit code {process_result.returncode}")
|
||||||
print(f"Please file an issue on our Github")
|
print(f"Please report the issue on the Discord server")
|
||||||
raise Exception(f"Process result: \n{process_result.stdout.decode()}")
|
raise Exception(f"Process result: \n{process_result.stdout.decode()}")
|
||||||
|
|
||||||
|
|
||||||
@@ -102,24 +102,9 @@ def check_filesystem_type():
|
|||||||
filesystem_type = plistlib.loads(subprocess.run(["diskutil", "info", "-plist", "/"], stdout=subprocess.PIPE).stdout.decode().strip().encode())
|
filesystem_type = plistlib.loads(subprocess.run(["diskutil", "info", "-plist", "/"], stdout=subprocess.PIPE).stdout.decode().strip().encode())
|
||||||
return filesystem_type["FilesystemType"]
|
return filesystem_type["FilesystemType"]
|
||||||
|
|
||||||
def csr_dump():
|
|
||||||
# Based off sip_config.py
|
|
||||||
# https://gist.github.com/pudquick/8b320be960e1654b908b10346272326b
|
|
||||||
# https://opensource.apple.com/source/xnu/xnu-7195.141.2/libsyscall/wrappers/csr.c.auto.html
|
|
||||||
# Far more reliable than parsing NVRAM's csr-active-config (ie. user can wipe it, boot.efi can strip bits)
|
|
||||||
|
|
||||||
# Note that 'csr_get_active_config' was not introduced until 10.11
|
|
||||||
try:
|
|
||||||
libsys = CDLL('/usr/lib/libSystem.dylib')
|
|
||||||
raw = c_uint(0)
|
|
||||||
errmsg = libsys.csr_get_active_config(byref(raw))
|
|
||||||
return raw.value
|
|
||||||
except AttributeError:
|
|
||||||
return 0
|
|
||||||
|
|
||||||
|
|
||||||
def csr_decode(os_sip):
|
def csr_decode(os_sip):
|
||||||
sip_int = csr_dump()
|
sip_int = py_sip_xnu.SipXnu().get_sip_status().value
|
||||||
for i, current_sip_bit in enumerate(sip_data.system_integrity_protection.csr_values):
|
for i, current_sip_bit in enumerate(sip_data.system_integrity_protection.csr_values):
|
||||||
if sip_int & (1 << i):
|
if sip_int & (1 << i):
|
||||||
sip_data.system_integrity_protection.csr_values[current_sip_bit] = True
|
sip_data.system_integrity_protection.csr_values[current_sip_bit] = True
|
||||||
@@ -375,7 +360,9 @@ def get_firmware_vendor(*, decode: bool = False):
|
|||||||
value = value.strip("\0")
|
value = value.strip("\0")
|
||||||
return value
|
return value
|
||||||
|
|
||||||
def verify_network_connection(url):
|
def verify_network_connection(url=None):
|
||||||
|
if url is None:
|
||||||
|
url = "https://www.google.com"
|
||||||
try:
|
try:
|
||||||
response = SESSION.head(url, timeout=5, allow_redirects=True)
|
response = SESSION.head(url, timeout=5, allow_redirects=True)
|
||||||
return True
|
return True
|
||||||
|
|||||||
Reference in New Issue
Block a user