Compare commits

...

119 Commits
0.2.2 ... 0.2.4

Author SHA1 Message Date
Mykola Grymalyuk
c41ffaafc2 Add Latebloom detection to CLI 2021-07-30 09:37:19 -06:00
Mykola Grymalyuk
741eda5fd8 Fix iMac13,3 spoof 2021-07-30 09:16:41 -06:00
Dhinak G
1678005ceb Don't run the site on self-hosted 2021-07-29 19:37:15 -04:00
Dhinak G
df029110c7 Update to not run on M1 machine 2021-07-29 19:36:12 -04:00
Mykola Grymalyuk
59f43e0ea0 Add more Model dumps 2021-07-29 17:25:29 -06:00
Mykola Grymalyuk
9bdc5148c4 Adjust MinKernel 2021-07-28 16:43:17 -06:00
Mykola Grymalyuk
3283cf514b Fix MacBook8,1 Modertate SMBIOS setting 2021-07-26 15:17:45 -06:00
Mykola Grymalyuk
991e449d26 Disable USB Map injection when unneeded
Closes https://github.com/dortania/OpenCore-Legacy-Patcher/issues/384
2021-07-26 15:15:20 -06:00
Mykola Grymalyuk
f880751539 Sync changelog
Closes https://github.com/dortania/OpenCore-Legacy-Patcher/issues/358
2021-07-26 12:55:55 -06:00
Mykola Grymalyuk
8eade66017 Sync PatcherSupportPkg
Closes https://github.com/dortania/OpenCore-Legacy-Patcher/issues/405
2021-07-25 23:15:59 -06:00
Mykola Grymalyuk
bb09b0432f Add AMFI detection on build 2021-07-25 23:15:23 -06:00
Mykola Grymalyuk
eca98c65d3 Merge pull request #398 from dortania/latebloom
Add Latebloom support
2021-07-25 15:45:27 -06:00
Mykola Grymalyuk
3af8687f42 Fix print formatting 2021-07-24 23:14:18 -06:00
Mykola Grymalyuk
0af93e7936 Test Wake on WLAN support again 2021-07-24 10:31:14 -06:00
Mykola Grymalyuk
b8904387f3 Add Sandy Bridge comment 2021-07-24 09:48:05 -06:00
Mykola Grymalyuk
91b2a8b673 Merge branch 'main' of https://github.com/dortania/Opencore-Legacy-Patcher 2021-07-23 11:07:40 -06:00
Dhinak G
96748952d3 Update BENIFITS.md 2021-07-22 13:39:15 -04:00
Mykola Grymalyuk
5eddcadaac Add additional error handling on system calls 2021-07-21 21:57:36 -06:00
Mykola Grymalyuk
43131150a4 Fix Mojave/Catalina kextcache error handling 2021-07-21 21:55:43 -06:00
Mykola Grymalyuk
5fefc7185e Add validation checker in CLI
Currently fails due to bootstrap path, will be resolved in future
2021-07-21 19:30:54 -06:00
Mykola Grymalyuk
ff00e2683e Add better variable presentation 2021-07-20 09:30:14 -06:00
Mykola Grymalyuk
e94264f039 Allow latebloom support 2021-07-20 09:07:29 -06:00
Mykola Grymalyuk
7fc36ac098 Merge pull request #381 from ylluminate/patch-1
Update TCC modification in ACCEL.md for Big Sur
2021-07-20 08:57:23 -06:00
Mykola Grymalyuk
8711b4069a Update ACCEL.md 2021-07-20 08:57:06 -06:00
Mykola Grymalyuk
70cb12413a Update ACCEL.md 2021-07-20 08:56:38 -06:00
Mykola Grymalyuk
a6dc58a81d Merge pull request #390 from lulujyc/patch-2
Update ACCEL.md -- don't waste money buying DisplayLink adapters
2021-07-20 08:52:47 -06:00
Mykola Grymalyuk
f8da16bf0a Fix Thunderbolt Array typo (Thanks @woefi) 2021-07-20 08:52:03 -06:00
Mykola Grymalyuk
e43fecb4bc Clean up formatting 2021-07-19 15:42:01 -06:00
Mykola Grymalyuk
d6ed03eb8a Revert Kryptonite backend 2021-07-19 12:01:05 -06:00
Mykola Grymalyuk
49e1fb1ad2 Fix RaceCondition ModelArray 2021-07-19 10:43:19 -06:00
Mykola Grymalyuk
ab1dab7fe5 Backend for Kryptonite support 2021-07-19 10:37:34 -06:00
Mykola Grymalyuk
6c44472e00 Merge branch 'main' of https://github.com/dortania/Opencore-Legacy-Patcher 2021-07-19 09:35:26 -06:00
Mykola Grymalyuk
d1f545e356 Merge pull request #397 from educovas/main
Updated HD4000 Monterey support - MONTEREY-DROP.md
2021-07-19 09:13:05 -06:00
educovas
e61544dcb9 Update MONTEREY-DROP.md 2021-07-19 12:02:32 -03:00
Mykola Grymalyuk
889293ca8a Fix formatting 2021-07-19 07:44:37 -06:00
Mykola Grymalyuk
a280e22cdb Adjust csr formatting 2021-07-18 11:40:30 -06:00
lulujyc
bb26a5a5d8 Update ACCEL.md -- don't waste money buying DisplayLink adapters 2021-07-17 17:31:22 +08:00
Mykola Grymalyuk
ba543ca5cf TUI Workflow: Force overwrite existing signature 2021-07-15 16:47:52 -06:00
Mykola Grymalyuk
592b0a707f Fix typos 2021-07-15 09:45:24 -06:00
Mykola Grymalyuk
8da87aea28 Add dosdude patch detection 2021-07-14 09:59:56 -06:00
Mykola Grymalyuk
4842028516 Add better unpatch error handling 2021-07-13 20:20:27 -06:00
Mykola Grymalyuk
8b6bcd47d2 Add minor kernel version detection 2021-07-13 20:11:46 -06:00
Mykola Grymalyuk
081bb56dd0 Add backend to support latebloom
Kext currently not enabled until ready for mass community usage
2021-07-12 19:13:30 -06:00
Mykola Grymalyuk
418de07f84 Fix Wake on WLAN typo
Closes https://github.com/dortania/OpenCore-Legacy-Patcher/issues/383
2021-07-12 12:03:41 -06:00
Mykola Grymalyuk
18e3fa37ff Fix BlessOverride typo
Ref: https://github.com/dortania/OpenCore-Legacy-Patcher/issues/382
2021-07-11 17:08:38 -06:00
ylluminate
c36296f2a0 Update TCC modification in ACCEL.md for Big Sur 2021-07-11 14:57:55 -04:00
Mykola Grymalyuk
8159761833 Fix formatting 2021-07-11 12:28:52 -06:00
Mykola Grymalyuk
87526226cd Fix Windows scanning in OpenCore menu 2021-07-11 12:25:02 -06:00
Mykola Grymalyuk
1cf1e3491d Merge branch 'main' of https://github.com/dortania/Opencore-Legacy-Patcher 2021-07-11 10:27:38 -06:00
Dhinak G
9cf19319c5 Attempt to fix pickle issues 2021-07-10 01:38:41 -04:00
Mykola Grymalyuk
8b47c4fe7b Remove unnecessary sudo 2021-07-09 13:29:52 -06:00
Mykola Grymalyuk
3b3f5b3290 Enhance OS patching detection 2021-07-08 22:55:00 -06:00
Mykola Grymalyuk
637981b405 Add better Mojave/Catalina error handling 2021-07-08 15:43:59 -06:00
Mykola Grymalyuk
20b40f33ce Renove unused libraries 2021-07-08 15:42:15 -06:00
Mykola Grymalyuk
9a388009cd Add better SIP var detection 2021-07-08 15:39:14 -06:00
Mykola Grymalyuk
a4bcefd748 Fix AMFI dectection 2021-07-08 15:22:35 -06:00
Dhinak G
7885673363 Fix CLI when no patches are required 2021-07-08 17:20:14 -04:00
Mykola Grymalyuk
d7aa3889f9 Add FeatureUnlock
Creates less confusion with new name
2021-07-08 10:14:25 -06:00
Mykola Grymalyuk
4dc76e26fc Fix formatting 2021-07-07 18:54:55 -06:00
Mykola Grymalyuk
648bb67b73 Sync changelog 2021-07-07 10:47:39 -06:00
Mykola Grymalyuk
686698272b Merge pull request #371 from dortania/drm-test
Add DRM support for Intel HD4000
2021-07-07 09:16:37 -06:00
Mykola Grymalyuk
6349b64faf Re-enable Safari patch 2021-07-07 09:15:25 -06:00
Mykola Grymalyuk
09b9194b91 Fix crash on Apple Silicon 2021-07-06 22:42:32 -06:00
Mykola Grymalyuk
827aa96168 Update device_probe.py 2021-07-06 22:02:17 -06:00
Mykola Grymalyuk
02ae3c8393 Update SysPatch.py
Closes https://github.com/dortania/OpenCore-Legacy-Patcher/issues/368
2021-07-06 20:26:22 -06:00
Mykola Grymalyuk
8f6bd87721 Fix typo 2021-07-06 14:50:30 -06:00
Mykola Grymalyuk
cef684beb9 Allow hardware decode 2021-07-06 14:39:52 -06:00
Mykola Grymalyuk
6c7c60fb62 Test HD4000 DRM 2021-07-06 14:35:19 -06:00
Mykola Grymalyuk
1b786e57c3 Add board ID check for Sandy Bridge patch 2021-07-06 14:33:51 -06:00
Mykola Grymalyuk
35e6104786 Fix Country Code 2021-07-06 09:31:32 -06:00
Mykola Grymalyuk
ed7c0c6760 Fix CLI crash 2021-07-05 19:08:50 -06:00
Mykola Grymalyuk
25522069dc Update config.yml 2021-07-05 18:29:22 -06:00
Mykola Grymalyuk
cbbbe16031 Update config.yml 2021-07-05 18:28:49 -06:00
Mykola Grymalyuk
8ed540c7b4 Disable blank issues 2021-07-05 17:40:36 -06:00
Mykola Grymalyuk
467016521f Update bug_report.yml 2021-07-05 12:23:02 -06:00
Mykola Grymalyuk
33d166a4f8 Add Bug Form 2021-07-05 12:12:10 -06:00
Mykola Grymalyuk
a03623e678 Merge pull request #360 from SquiDual/patch-1
Update TERMS.md
2021-07-05 11:23:06 -06:00
Mykola Grymalyuk
bb424e8ab9 Add WLAN patch
Closes https://github.com/dortania/OpenCore-Legacy-Patcher/issues/353
2021-07-05 11:21:40 -06:00
Mykola Grymalyuk
9e98121e45 Adjust for GUI 2021-07-05 10:09:50 -06:00
SquiDual
f7d842a7f4 Update TERMS.md
Fix typo
2021-07-05 15:31:26 +08:00
Mykola Grymalyuk
a1981ab56d Fix NightShift in Monterey 2021-07-03 15:04:02 -06:00
Mykola Grymalyuk
e820a9ecc8 Fix AirPlay to Mac patch on 2017 iMacs 2021-07-03 13:21:05 -06:00
Mykola Grymalyuk
b13d47df08 Sync CLI 2021-06-28 09:42:23 -06:00
Dhinak G
e6adcdabac Fix typo
closes #351
2021-06-28 11:23:51 -04:00
Mykola Grymalyuk
3c4795fb47 Fix typo 2021-06-28 00:21:54 -06:00
Mykola Grymalyuk
aaf74b2b6a Fix typo 2021-06-28 00:13:55 -06:00
Mykola Grymalyuk
2c4b29400e Enable TeraScale 2 patches by default on desktops 2021-06-27 23:09:28 -06:00
Mykola Grymalyuk
98da3a16a8 Fix Wifi build crash 2021-06-27 22:30:58 -06:00
Mykola Grymalyuk
b24ee0e38c Fix symlinks with rsync 2021-06-27 22:16:47 -06:00
Mykola Grymalyuk
f557b10c3c Merge pull request #339 from dortania/ioreg-rewrite
Completely revamp IOReg probing
2021-06-27 10:32:58 -06:00
Mykola Grymalyuk
b876eda144 Update POST-INSTALL.md 2021-06-26 14:48:32 -06:00
Mykola Grymalyuk
4c8e256e7e Fix SIP typo for hackintosh 2021-06-26 13:51:40 -06:00
Dhinak G
447afac6eb Update build scripts 2021-06-25 09:13:17 -04:00
Dhinak G
657fc97f4f Completely revamp IOReg probing 2021-06-24 19:55:22 -04:00
Mykola Grymalyuk
1d8f87fb78 Reflect new GUI 2021-06-24 16:05:14 -06:00
Mykola Grymalyuk
c6a34ddeb8 Fix build version 2021-06-24 09:52:01 -06:00
Mykola Grymalyuk
694d0397ea Sync docs
Closes https://github.com/dortania/OpenCore-Legacy-Patcher/issues/146
2021-06-24 09:43:02 -06:00
Mykola Grymalyuk
9cbc243581 Merge pull request #333 from dortania/gui-ci
Implement OpenCore GUI
2021-06-24 09:26:48 -06:00
Mykola Grymalyuk
04a83462c3 Add notarization to TUI
TUI is deprecated, binary will be dropped in the future
2021-06-24 09:19:27 -06:00
Dhinak G
2e3152f23b Fix more IORegistry issues 2021-06-24 09:06:31 -04:00
Mykola Grymalyuk
ba1ac0501b Merge branch 'main' into gui-ci 2021-06-23 22:12:56 -06:00
Mykola Grymalyuk
3ce8b18ecb Update CI 2021-06-23 22:11:45 -06:00
Mykola Grymalyuk
baaa897d10 Add disk type detection 2021-06-23 21:46:42 -06:00
Mykola Grymalyuk
86ffb83c86 Update Constants.py 2021-06-23 20:33:49 -06:00
Mykola Grymalyuk
db708022e9 Fix model issue 2021-06-23 16:20:45 -06:00
Mykola Grymalyuk
cc2eebfd42 Test 2021-06-23 14:34:37 -06:00
Mykola Grymalyuk
8490893960 Fix error 2021-06-23 14:22:34 -06:00
Mykola Grymalyuk
15a5e54cbb Fix zip 2021-06-23 14:06:13 -06:00
Mykola Grymalyuk
1bc9f3d396 Fix 2021-06-23 13:59:24 -06:00
Mykola Grymalyuk
ca22da4ebb Test 2021-06-23 13:58:12 -06:00
Mykola Grymalyuk
e609866c5e Extra codesigning 2021-06-23 13:50:29 -06:00
Mykola Grymalyuk
bb5673e770 Force codesign 2021-06-23 13:15:10 -06:00
Mykola Grymalyuk
024d41c946 Fix incorrect file path 2021-06-23 13:12:12 -06:00
Mykola Grymalyuk
44c4a488f4 Add codesign to GUI 2021-06-23 13:09:42 -06:00
Mykola Grymalyuk
5c09c10301 Fix typo 2021-06-23 12:57:31 -06:00
Mykola Grymalyuk
4f74629e3f Fix CI 2021-06-23 12:54:34 -06:00
Mykola Grymalyuk
56194be716 Fix CI 2021-06-23 12:51:47 -06:00
Mykola Grymalyuk
8cfa90f352 Update CI 2021-06-23 12:34:05 -06:00
Mykola Grymalyuk
1064be45df Add basic GUI to CI pipeline 2021-06-23 11:55:37 -06:00
42 changed files with 1876 additions and 584 deletions

View File

@@ -1,34 +0,0 @@
---
name: Bug report
about: Create a report to help notify of issues
title: ''
labels: ''
assignees: ''
---
**Describe the bug**
A clear and concise description of what the issue is.
**To Reproduce**
Steps to reproduce the behavior:
1. Open app or .command '...'
2. Enter '....'
3. See error
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Build Folder**
If applicable, add the generated OpenCore Build to help explain your problem.
**Hardware (please complete the following information):**
- OS Running (ie. macOS 10.15.7, Catalina)
- OS Patching (ie. macOS 11.2.3, Big Sur)
- Model Patching (ie. MacPro5,1)
For in-depth hardware logs, we highly encourage users to run [IORegistryExplorer](https://github.com/khronokernel/IORegistryClone/blob/master/ioreg-210.zip?raw=true) and send the output
* ie. `File -> SaveAs`
**Additional context**
Add any other context about the problem here.

143
.github/ISSUE_TEMPLATE/bug_report.yml vendored Normal file
View File

@@ -0,0 +1,143 @@
name: Bug Report
description: File a bug report
title: "[Bug]: "
labels: [bug]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report!
- type: dropdown
id: machine
attributes:
label: Machine Model
description: What model was being patched?
options:
- MacBook4,1
- MacBook5,1
- MacBook5,2
- MacBook6,1
- MacBook7,1
- MacBook8,1
- MacBookAir2,1
- MacBookAir3,1
- MacBookAir3,2
- MacBookAir4,1
- MacBookAir4,2
- MacBookAir5,1
- MacBookAir5,2
- MacBookAir6,1
- MacBookAir6,2
- MacBookPro4,1
- MacBookPro5,1
- MacBookPro5,2
- MacBookPro5,3
- MacBookPro5,4
- MacBookPro5,5
- MacBookPro6,1
- MacBookPro6,2
- MacBookPro7,1
- MacBookPro8,1
- MacBookPro8,2
- MacBookPro8,3
- MacBookPro9,1
- MacBookPro9,2
- MacBookPro10,1
- MacBookPro10,2
- MacBookPro11,1
- MacBookPro11,2
- MacBookPro11,3
- Macmini3,1
- Macmini4,1
- Macmini5,1
- Macmini5,2
- Macmini5,3
- Macmini6,1
- Macmini6,2
- iMac7,1
- iMac8,1
- iMac9,1
- iMac10,1
- iMac11,1
- iMac11,2
- iMac11,3
- iMac12,1
- iMac12,2
- iMac13,1
- iMac13,2
- iMac13,3
- iMac14,1
- iMac14,2
- iMac14,3
- iMac14,4
- iMac15,1
- MacPro3,1
- MacPro4,1
- MacPro5,1
- Xserve2,1
- Xserve3,1
- Other/Non-Applicable
validations:
required: true
- type: dropdown
id: version
attributes:
label: Application Version
description: What build version of our software are you running?
options:
- 0.2.3 (Latest Build)
- 0.2.2 (Latest Release)
validations:
required: true
- type: dropdown
id: variant
attributes:
label: Application Variant
description: What variant of our software are you running?
options:
- GUI (Graphical User Interface)
- TUI (Text User Interface)
- CLI (Command Line Interface)
- Other/Non-Applicable
validations:
required: true
- type: dropdown
id: os-version
attributes:
label: What versions of macOS are you seeing the problem on?
multiple: true
options:
- macOS 12, Monterey
- macOS 11, Big Sur
- macOS 10.15, Catalina
- macOS 10.14, Mojave
- macOS 10.13, High Sierra
- macOS 10.12, Sierra
- macOS 10.11, El Capitan
- Other/Non-Applicable
validations:
required: true
- type: dropdown
id: where-issue
attributes:
label: Where does this issue happen?
multiple: true
options:
- Between booting macOS and Login Screen
- Within macOS (Before Logging in)
- Within macOS (After Logging in)
- Other/Non-Applicable
validations:
required: true
- type: textarea
id: what-happened
attributes:
label: What is the Isssue?
description: Additionally, explain what you expected to happen?
value: "Please clearly explain the issue"
validations:
required: true
- type: textarea
id: extra-info
attributes:
label: Any Additional Information

1
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@@ -0,0 +1 @@
blank_issues_enabled: false

View File

@@ -1,4 +1,4 @@
name: CI - Build App
name: CI - Build TUI
on:
push:
@@ -8,31 +8,30 @@ on:
jobs:
build:
name: Build App
runs-on: self-hosted
name: Build TUI
runs-on: x86_64
steps:
- uses: actions/checkout@v2
- name: Install Python Dependencies
run: pip3 install --upgrade pyinstaller requests
run: pip3 install --upgrade pyinstaller requests pyobjc
- run: pyinstaller OpenCore-Patcher.spec
- run: ./after_pyinstaller.sh
- run: 'codesign -s "Developer ID Application: Mykola Grymalyuk (S74BDJXQMD)" -v --deep --timestamp --entitlements entitlements.plist -o runtime "dist/OpenCore-Patcher.app"'
- run: cd dist; zip ../OpenCore-Patcher.zip OpenCore-Patcher; zip -r ../OpenCore-Patcher.app.zip OpenCore-Patcher.app
- run: ./../sign-app.sh
- run: 'codesign -s "Developer ID Application: Mykola Grymalyuk (S74BDJXQMD)" -v --force --deep --timestamp --entitlements entitlements.plist -o runtime "dist/OpenCore-Patcher.app"'
- run: cd dist; zip -r ../OpenCore-Patcher-TUI.app.zip OpenCore-Patcher.app
- run: ./../sign-tui.sh
- name: Upload App to Artifacts
uses: actions/upload-artifact@v2
with:
name: OpenCore-Patcher.app
path: OpenCore-Patcher.app.zip
name: OpenCore-Patcher-TUI.app
path: OpenCore-Patcher-TUI.app.zip
- name: Upload to Release
if: github.event_name == 'release'
uses: svenstaro/upload-release-action@e74ff71f7d8a4c4745b560a485cc5fdb9b5b999d
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: OpenCore-Patcher.app.zip
file: OpenCore-Patcher-TUI.app.zip
tag: ${{ github.ref }}
file_glob: true

View File

@@ -1,32 +0,0 @@
name: CI - Build CLI
on:
push:
workflow_dispatch:
release:
types: [published]
jobs:
build:
name: Build CLI
runs-on: self-hosted
steps:
- uses: actions/checkout@v2
- name: Install Python Dependencies
run: pip3 install --upgrade pyinstaller requests
- run: pyinstaller OCLP-CLI.spec
- run: cd dist; zip ../OCLP-CLI.zip OCLP-CLI
- name: Upload Binary to Artifacts
uses: actions/upload-artifact@v2
with:
name: OCLP-CLI
path: OCLP-CLI.zip
- name: Upload to Release
if: github.event_name == 'release'
uses: svenstaro/upload-release-action@e74ff71f7d8a4c4745b560a485cc5fdb9b5b999d
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: OCLP-CLI.zip
tag: ${{ github.ref }}
file_glob: true

50
.github/workflows/build-gui.yml vendored Normal file
View File

@@ -0,0 +1,50 @@
name: CI - Build GUI
on:
push:
workflow_dispatch:
release:
types: [published]
jobs:
build:
name: Build GUI
runs-on: x86_64
steps:
- uses: actions/checkout@v2
- name: Install Python Dependencies
run: pip3 install --upgrade pyinstaller requests pyobjc
- run: pyinstaller OCLP-CLI.spec
- run: cd dist; cp OCLP-CLI ../; cd ..
- run: zip OCLP-CLI.zip OCLP-CLI
- name: Download latest nightly OCLP-GUI
run: curl -S -L https://nightly.link/dortania/OCLP-GUI/workflows/build-app/master/OpenCore-Patcher-GUI.app.zip --output ./OpenCore-Patcher-GUI.app.zip
- run: unzip -o OpenCore-Patcher-GUI.app.zip
- run: unzip OpenCore-Patcher-GUI.app.zip; rm OpenCore-Patcher-GUI.app.zip
- name: Merge new GUI
run: cp OCLP-CLI OpenCore\ Patcher.app/Contents/Resources/
- run: python3 merge_gui.py
- run: 'codesign -s "Developer ID Application: Mykola Grymalyuk (S74BDJXQMD)" -v --force --deep --timestamp --entitlements entitlements.plist -o runtime "OpenCore Patcher.app/Contents/Resources/OCLP-CLI"'
- run: 'codesign -s "Developer ID Application: Mykola Grymalyuk (S74BDJXQMD)" -v --force --deep --timestamp --entitlements entitlements.plist -o runtime "OpenCore Patcher.app/Contents/Resources/oclpd"'
- run: 'codesign -s "Developer ID Application: Mykola Grymalyuk (S74BDJXQMD)" -v --force --deep --timestamp --entitlements entitlements.plist -o runtime "OpenCore Patcher.app"'
- run: ditto -c -k --sequesterRsrc --keepParent OpenCore\ Patcher.app OpenCore-Patcher-GUI.app.zip
- run: ./../sign-gui.sh
- name: Upload GUI to Artifacts
uses: actions/upload-artifact@v2
with:
name: OpenCore-Patcher-GUI.app
path: OpenCore-Patcher-GUI.app.zip
- name: Upload CLI to Artifacts
uses: actions/upload-artifact@v2
with:
name: OCLP-CLI
path: OCLP-CLI.zip
- name: Upload to Release
if: github.event_name == 'release'
uses: svenstaro/upload-release-action@e74ff71f7d8a4c4745b560a485cc5fdb9b5b999d
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: OpenCore-Patcher-GUI.app.zip
tag: ${{ github.ref }}
file_glob: true

View File

@@ -1,5 +1,39 @@
# OpenCore Legacy Patcher changelog
## 0.2.4
- Fix BlessOverride typo
- Fix Wake on WLAN typo
- Fix Catalyst App crashing in macOS 11.5 (ie. Messages.app)
- Increment Binaries
- PatcherSupportPkg 0.0.15 release
- Implement Latebloom.kext support (v0.19)
- Work around macOS 11.3+ race condition on pre-Sandy Bridge Macs
- Disable USB Map injection when unneeded
## 0.2.3
- Fix more IORegistry issues
- Implement OpenCore GUI
- Ensure symlinks are preserved
- Enable TeraScale 2 patches by default on all models
- Fix NightShift support for macOS Monterey
- Add UniversalControl support
- Currently not enabled by Apple in macOS Monterey Beta 2/iOS 15 Beta 2
- Add optional Wake in WLAN setting
- Note: enabling may create network instability
- Increment Binaries
- OpenCore 0.7.1 release (07-05-2021)
- FeatureUnlock 1.0.3 rolling (07-07-2021)
- Previously known as SidecarFixup
- Lilu 1.5.4 release (07-05-2021)
- AppleALC 1.6.2 release
- WhateverGreen 1.6.2 release
- PatcherSupportPkg 0.0.13 release
- Fix Intel HD4000 DRM Support in macOS Monterey (thanks EduCovas!)
- Support optionally re-enabling iGPU in iMac14,x with dGPUs
- Fix Windows scanning in OpenCore menu when Windows and macOS are stored on the same ESP
## 0.2.2
- Fix IORegistry issue

View File

@@ -9,7 +9,7 @@ import platform
import argparse
from pathlib import Path
from Resources import Build, ModelArray, Constants, SysPatch, device_probe, Utilities
from Resources import Build, ModelArray, Constants, SysPatch, device_probe, Utilities, ModelExample
class OpenCoreLegacyPatcher:
@@ -47,17 +47,22 @@ class OpenCoreLegacyPatcher:
parser.add_argument("--support_all", help="Allow OpenCore on natively supported Models", action="store_true", required=False)
parser.add_argument("--firewire", help="Enable FireWire Booting", action="store_true", required=False)
parser.add_argument("--nvme", help="Enable NVMe Booting", action="store_true", required=False)
parser.add_argument("--wlan", help="Enable Wake on WLAN support", action="store_true", required=False)
parser.add_argument("--disable_amfi", help="Disable AMFI", action="store_true", required=False)
parser.add_argument("--moderate_smbios", help="Moderate SMBIOS Patching", action="store_true", required=False)
# Building args requiring value values
parser.add_argument("--model", action="store", help="Set custom model", required=False)
parser.add_argument("--disk", action="store", help="Specifies disk to install to", required=False)
parser.add_argument("--smbios_spoof", action="store", help="Set SMBIOS patching mode", required=False)
# SysPatch args
parser.add_argument("--patch_sys_vol", help="Patches root volume", action="store_true", required=False)
parser.add_argument("--unpatch_sys_vol", help="Unpatches root volume, EXPERIMENTAL", action="store_true", required=False)
parser.add_argument("--terascale_2", help="Enable TeraScale 2 Acceleration", action="store_true", required=False)
#parser.add_argument("--patch_disk", action="store", help="Specifies disk to root patch", required=False)
parser.add_argument("--validate", help="Validate", action="store_true", required=False)
args = parser.parse_args()
@@ -70,6 +75,14 @@ class OpenCoreLegacyPatcher:
else:
print("- Using default payloads location")
if args.disk:
print(f"- Install Disk set: {args.disk}")
self.constants.disk = args.disk
if args.validate:
self.validate()
#if args.patch_disk:
# print(f"- Patch Disk set: {args.patch_disk}")
# self.constants.patch_disk = args.patch_disk
if args.verbose:
print("- Set verbose configuration")
self.constants.verbose_debug = True
@@ -101,11 +114,12 @@ class OpenCoreLegacyPatcher:
if args.disable_amfi:
print("- Set Disable AMFI configuration")
self.constants.disable_amfi = True
if args.wlan:
print("- Set Wake on WLAN configuration")
self.constants.enable_wake_on_wlan = True
if args.moderate_smbios:
print("- Set Moderate SMBIOS Patching configuration")
self.constants.serial_settings = "Moderate"
if args.model:
host_is_target
if args.smbios_spoof:
if args.smbios_spoof == "Minimal":
self.constants.serial_settings = "Minimal"
@@ -184,6 +198,8 @@ If you plan to create the USB for another machine, please select the "Change Mod
# MacBook8,1 has an odd bug where it cannot install Monterey with Minimal spoofing
self.constants.serial_settings == "Moderate"
self.constants.latebloom_delay, self.constants.latebloom_range, self.constants.latebloom_debug = Utilities.latebloom_detection(model)
def patch_vol(self):
SysPatch.PatchSysVolume(self.constants.custom_model or self.constants.computer.real_model, self.constants).start_patch()
@@ -195,6 +211,49 @@ If you plan to create the USB for another machine, please select the "Change Mod
def install_opencore(self):
Build.BuildOpenCore(self.constants.custom_model or self.constants.computer.real_model, self.constants).copy_efi()
def validate(self):
# Runs through ocvalidate to check for errors
valid_dumps = [
ModelExample.MacBookPro.MacBookPro92_Stock,
#ModelExample.MacBookPro.MacBookPro171_Stock,
#ModelExample.Macmini.Macmini91_Stock,
ModelExample.iMac.iMac81_Stock,
ModelExample.iMac.iMac112_Stock,
ModelExample.iMac.iMac122_Upgraded,
ModelExample.MacPro.MacPro31_Stock,
ModelExample.MacPro.MacPro31_Upgrade,
ModelExample.MacPro.MacPro31_Modern_AMD,
ModelExample.MacPro.MacPro31_Modern_Kepler,
]
self.constants.validate = True
for model in ModelArray.SupportedSMBIOS:
print(f"Validating predefined model: {model}")
self.constants.custom_model = model
self.build_opencore()
result = subprocess.run([self.constants.ocvalidate_path, f"{self.constants.opencore_release_folder}/EFI/OC/config.plist"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
if result.returncode != 0:
print("Error on build!")
print(result.stdout.decode())
raise Exception(f"Validation failed for predefined model: {model}")
else:
print(f"Validation succeeded for predefined model: {model}")
for model in valid_dumps:
self.constants.computer = model
self.computer = self.constants.computer
self.constants.custom_model = ""
print(f"Validating dumped model: {self.computer.real_model}")
self.build_opencore()
result = subprocess.run([self.constants.ocvalidate_path, f"{self.constants.opencore_release_folder}/EFI/OC/config.plist"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
if result.returncode != 0:
print("Error on build!")
print(result.stdout.decode())
raise Exception(f"Validation failed for predefined model: {self.computer.real_model}")
else:
print(f"Validation succeeded for predefined model: {self.computer.real_model}")
OpenCoreLegacyPatcher()

View File

@@ -6,8 +6,9 @@ block_cipher = None
a = Analysis(['OCLP-CLI.command'],
pathex=['Resources'],
binaries=[],
datas=[('payloads', 'payloads'), ('Resources', 'Resources')],
datas=[('payloads', 'payloads')],
hiddenimports=[],
hookspath=[],
runtime_hooks=[],

View File

@@ -17,20 +17,9 @@ class OpenCoreLegacyPatcher:
self.constants.computer = device_probe.Computer.probe()
self.computer = self.constants.computer
self.constants.detected_os = int(platform.uname().release.partition(".")[0])
self.constants.detected_os_minor = int(platform.uname().release.partition(".")[2].partition(".")[0])
self.set_defaults(self.computer.real_model, True)
custom_cpu_model_value = Utilities.get_nvram("revcpuname", "4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102", decode=True)
if custom_cpu_model_value is not None:
# TODO: Fix to not use two separate variables
self.constants.custom_cpu_model = 1
self.constants.custom_cpu_model_value = custom_cpu_model_value.split("%00")[0]
if "-v" in (Utilities.get_nvram("boot-args") or ""):
self.constants.verbose_debug = True
# Check if running in RecoveryOS
self.constants.recovery_status = Utilities.check_recovery()
def set_defaults(self, model, host_is_target):
# Defaults
self.constants.sip_status = True
@@ -70,7 +59,24 @@ class OpenCoreLegacyPatcher:
# self.constants.disable_amfi = False # Signed bundles, Don't need to explicitly set currently
if model == "MacBook8,1":
# MacBook8,1 has an odd bug where it cannot install Monterey with Minimal spoofing
self.constants.serial_settings == "Moderate"
self.constants.serial_settings = "Moderate"
custom_cpu_model_value = Utilities.get_nvram("revcpuname", "4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102", decode=True)
if custom_cpu_model_value is not None:
# TODO: Fix to not use two separate variables
self.constants.custom_cpu_model = 1
self.constants.custom_cpu_model_value = custom_cpu_model_value.split("%00")[0]
if "-v" in (Utilities.get_nvram("boot-args") or ""):
self.constants.verbose_debug = True
if Utilities.amfi_status() is False:
self.constants.disable_amfi = True
self.constants.latebloom_delay, self.constants.latebloom_range, self.constants.latebloom_debug = Utilities.latebloom_detection(model)
# Check if running in RecoveryOS
self.constants.recovery_status = Utilities.check_recovery()
def build_opencore(self):
Build.BuildOpenCore(self.constants.custom_model or self.constants.computer.real_model, self.constants).build_opencore()
@@ -115,10 +121,8 @@ system_profiler SPHardwareDataType | grep 'Model Identifier'
[f"Set Vault Mode:\t\t\tCurrently {self.constants.vault}", CliMenu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).change_vault],
[f"Allow FireWire Boot:\t\tCurrently {self.constants.firewire_boot}", CliMenu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).allow_firewire],
[f"Allow NVMe Boot:\t\t\tCurrently {self.constants.nvme_boot}", CliMenu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).allow_nvme],
[
f"Enable TeraScale 2 Acceleration:\tCurrently {self.constants.terascale_2_patch}",
CliMenu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).enable_terascale,
],
[f"Allow Wake on WLAN:\t\t\tCurrently {self.constants.enable_wake_on_wlan}", CliMenu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).allow_wowl],
[f"Allow Ivy iMac iGPU:\t\tCurrently {self.constants.allow_ivy_igpu}", CliMenu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).allow_ivy],
[f"Disable AMFI:\t\t\tCurrently {self.constants.disable_amfi}", CliMenu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).set_amfi],
[
f"Set SIP and SecureBootModel:\tSIP: {self.constants.sip_status} SBM: {self.constants.secure_status}",
@@ -128,6 +132,10 @@ system_profiler SPHardwareDataType | grep 'Model Identifier'
f"Allow OpenCore on native Models:\tCurrently {self.constants.allow_oc_everywhere}",
CliMenu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).allow_native_models,
],
[
f"Latebloom settings:\t\tDelay {self.constants.latebloom_delay}, Range {self.constants.latebloom_range}, Debug {self.constants.latebloom_debug}",
CliMenu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).latebloom_settings,
],
["Advanced Patch Settings, for developers only", self.advanced_patcher_settings],
]
@@ -220,6 +228,20 @@ Supported Options:
2. Unpatch System Volume (Experimental)
B. Exit
"""
mojave_catalina = """Patches Root volume to fix misc issues such as:
- Graphics Acceleration
- Nvidia: Tesla - Fermi (8000-500 series)
- Intel: Ironlake - Sandy Bridge
- AMD: TeraScale 1 and 2 (2000-6000 series)
- Audio support for iMac7,1 and iMac8,1
WARNING: Root Volume Patching is still in active development, please
have all important user data backed up. Note when the system volume
is patched, you can no longer have Delta updates or have FileVault
enabled.
Supported Options:
1. Patch System Volume
B. Exit
"""
default = """
This OS has no root patches available to apply, please ensure you're patching a booted
@@ -234,13 +256,15 @@ B. Exit
print(monterey)
elif self.constants.detected_os == self.constants.big_sur:
print(big_sur)
elif self.constants.detected_os in [self.constants.mojave, self.constants.catalina] and self.constants.moj_cat_accel == True:
print(mojave_catalina)
else:
print(default)
no_patch = True
change_menu = input("Patch System Volume?: ")
if no_patch is not True and change_menu == "1":
SysPatch.PatchSysVolume(self.constants.custom_model or self.computer.real_model, self.constants).start_patch()
elif no_patch is not True and change_menu == "2":
elif no_patch is not True and change_menu == "2" and self.constants.detected_os > self.constants.catalina:
SysPatch.PatchSysVolume(self.constants.custom_model or self.computer.real_model, self.constants).start_unpatch()
else:
print("Returning to main menu")

View File

@@ -6,8 +6,9 @@ block_cipher = None
a = Analysis(['OpenCore-Patcher.command'],
pathex=['Resources'],
binaries=[],
datas=[('payloads', 'payloads'), ('Resources', 'Resources')],
datas=[('payloads', 'payloads')],
hiddenimports=[],
hookspath=[],
runtime_hooks=[],

View File

@@ -3,7 +3,7 @@
<h1>OpenCore Legacy Patcher</h1>
</div>
A python program for building and booting [OpenCore](https://github.com/acidanthera/OpenCorePkg) on both legacy and modern Macs, see our in-depth [Guide](https://dortania.github.io/OpenCore-Legacy-Patcher/) for more information.
A python program with an [Objective-C GUI](https://github.com/dortania/OCLP-GUI) for building and booting [OpenCore](https://github.com/acidanthera/OpenCorePkg) on both legacy and modern Macs, see our in-depth [Guide](https://dortania.github.io/OpenCore-Legacy-Patcher/) for more information.
Supported features:
@@ -20,7 +20,8 @@ Note: Only clean-installs and upgrades are supported, macOS Big Sur installs alr
Note 2: Currently OpenCore Legacy Patcher officially supports patching to run macOS 11, Big Sur installs. For older OSes, OpenCore may function however support is currently not provided from Dortania.
* For Mojave and Catalina support, we recommend the use of [dosdude1's patchers](http://dosdude1.com)
* For macOS Mojave and Catalina support, we recommend the use of [dosdude1's patchers](http://dosdude1.com)
* macOS Monterey usage is provided however support is limited, currently recommended for users to run Big Sur for best compatibility
## Support
@@ -28,7 +29,11 @@ To get aid with the patcher, we recommend joining the [OpenCore Patcher Paradise
* [OpenCore Legacy Patcher's Issue's tab](https://github.com/dortania/OpenCore-Legacy-Patcher/issues)
Nightly builds can be found here courteous of nightly.link: [Nightly OpenCore-Patcher.app](https://nightly.link/dortania/OpenCore-Legacy-Patcher/workflows/build-app/main/OpenCore-Patcher.app.zip)
Nightly builds can be found here courteous of nightly.link:
* [Nightly OpenCore Patcher (GUI)](https://nightly.link/dortania/OpenCore-Legacy-Patcher/workflows/build-gui/main/OpenCore-Patcher-GUI.app.zip)
* [Nightly OpenCore Patcher (TUI)](https://nightly.link/dortania/OpenCore-Legacy-Patcher/workflows/build-app/main/OpenCore-Patcher-TUI.app.zip)
* [Nightly OpenCore Patcher (CLI)](https://nightly.link/dortania/OpenCore-Legacy-Patcher/workflows/build-gui/main/OCLP-CLI.zip)
## Credits
@@ -50,7 +55,10 @@ Nightly builds can be found here courteous of nightly.link: [Nightly OpenCore-Pa
* [Innie](https://github.com/cdf/Innie) and [NightShiftEnabler](https://github.com/cdf/NightShiftEnabler)
* [Syncretic](https://forums.macrumors.com/members/syncretic.1173816/)
* [AAAMouSSE](https://forums.macrumors.com/threads/mp3-1-others-sse-4-2-emulation-to-enable-amd-metal-driver.2206682/) and [telemetrap](https://forums.macrumors.com/threads/mp3-1-others-sse-4-2-emulation-to-enable-amd-metal-driver.2206682/post-28447707)
* [dosdude1](https://github.com/dosdude1) and [BarryKN](https://github.com/BarryKN)
* [dosdude1](https://github.com/dosdude1)
* Main author of GUI
* Development of previous patchers, laying out much of what needs to be patched
* [BarryKN](https://github.com/BarryKN)
* Development of previous patchers, laying out much of what needs to be patched
* [mario_bros_tech](https://github.com/mariobrostech) and the rest of the Unsupported Mac Discord
* Catalyst that started OpenCore Legacy Patcher

View File

@@ -17,14 +17,6 @@ from datetime import date
from Resources import Constants, ModelArray, Utilities, device_probe
def human_fmt(num):
for unit in ["B", "KB", "MB", "GB", "TB", "PB"]:
if abs(num) < 1000.0:
return "%3.1f %s" % (num, unit)
num /= 1000.0
return "%.1f %s" % (num, "EB")
def rmtree_handler(func, path, exc_info):
if exc_info[0] == FileNotFoundError:
return
@@ -40,48 +32,36 @@ class BuildOpenCore:
self.gfx0_path = None
def smbios_set(self):
def smbios_set(self, model):
print("- Setting macOS Monterey Supported SMBIOS")
if self.model in ModelArray.MacBookAir61:
print("- Spoofing to MacBookAir7,1")
if model in ModelArray.MacBookAir_11:
return "MacBookAir7,1"
elif self.model in ModelArray.MacBookAir62:
print("- Spoofing to MacBookAir7,2")
elif model in ModelArray.MacBookAir_13:
return "MacBookAir7,2"
elif self.model in ModelArray.MacBook81:
print("- Spoofing to MacBook9,1")
elif model in ModelArray.MacBook_12:
return "MacBook9,1"
elif self.model in ModelArray.MacBookPro111:
print("- Spoofing to MacBookPro12,1")
elif model in ModelArray.MacBookPro_13:
return "MacBookPro12,1"
elif self.model in ModelArray.MacBookPro112:
print("- Spoofing to MacBookPro11,4")
elif model in ModelArray.MacBookPro_15_iGPU:
return "MacBookPro11,4"
elif self.model in ModelArray.MacBookPro113:
print("- Spoofing to MacBookPro11,5")
elif model in ModelArray.MacBookPro_15_dGPU:
return "MacBookPro11,5"
elif self.model in ModelArray.Macmini71:
print("- Spoofing to Macmini7,1")
elif model in ModelArray.Macmini:
return "Macmini7,1"
elif self.model in ModelArray.iMacPro11:
print("- Spoofing to iMacPro1,1")
elif model in ModelArray.iMac_iGPUless:
return "iMacPro1,1"
elif self.model in ModelArray.iMac151:
elif model in ModelArray.iMac_dGPU:
# Check for upgraded GPUs on iMacs
if self.constants.drm_support is True:
print("- Spoofing to iMacPro1,1")
return "iMacPro1,1"
else:
print("- Spoofing to iMac17,1")
return "iMac17,1"
elif self.model in ModelArray.iMac144:
print("- Spoofing to iMac16,1")
elif model in ModelArray.iMac_iGPU:
return "iMac16,1"
elif self.model in ModelArray.MacPro71:
print("- Spoofing to MacPro7,1")
elif model in ModelArray.MacPro:
return "MacPro7,1"
else:
return self.model
return model
def fw_feature_detect(self, model):
# Values based off OpenCorePkg's Firmwarefeatures and FirmwarefeaturesMask
@@ -98,6 +78,28 @@ class BuildOpenCore:
fw_mask = b"\xff\x3f\x08\xc0\x00\x00\x00\x00"
return fw_feature, fw_mask
def disk_type(self):
drive_host_info = plistlib.loads(subprocess.run(f"diskutil info -plist {self.constants.disk}".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode())
sd_type = drive_host_info["MediaName"]
try:
ssd_type = drive_host_info["SolidState"]
except KeyError:
ssd_type = False
# Array filled with common SD Card names
# Note most USB-based SD Card readers generally report as "Storage Device", and no reliable way to detect further
if sd_type in ["SD Card Reader", "SD/MMC"]:
print("- Adding SD Card icon")
shutil.copy(self.constants.icon_path_sd, self.constants.opencore_release_folder)
elif ssd_type is True:
print("- Adding SSD icon")
shutil.copy(self.constants.icon_path_ssd, self.constants.opencore_release_folder)
elif drive_host_info["BusProtocol"] == "USB":
print("- Adding External USB Drive icon")
shutil.copy(self.constants.icon_path_external, self.constants.opencore_release_folder)
else:
print("- Adding Internal Drive icon")
shutil.copy(self.constants.icon_path_internal, self.constants.opencore_release_folder)
def build_efi(self):
Utilities.cls()
if not self.constants.custom_model:
@@ -117,8 +119,7 @@ class BuildOpenCore:
print("Deleting old copy of OpenCore folder")
shutil.rmtree(self.constants.opencore_release_folder, onerror=rmtree_handler, ignore_errors=True)
print()
print(f"- Adding OpenCore v{self.constants.opencore_version} {self.constants.opencore_build}")
print(f"\n- Adding OpenCore v{self.constants.opencore_version} {self.constants.opencore_build}")
shutil.copy(self.constants.opencore_zip_source, self.constants.build_path)
zipfile.ZipFile(self.constants.opencore_zip_copied).extractall(self.constants.build_path)
@@ -144,14 +145,9 @@ class BuildOpenCore:
# Essential kexts
("Lilu.kext", self.constants.lilu_version, self.constants.lilu_path, lambda: True),
("WhateverGreen.kext", self.constants.whatevergreen_version, self.constants.whatevergreen_path, lambda: self.constants.allow_oc_everywhere is False),
("RestrictEvents.kext", self.constants.restrictevents_version, self.constants.restrictevents_path, lambda: self.model in ModelArray.MacPro71),
("RestrictEvents.kext", self.constants.restrictevents_version, self.constants.restrictevents_path, lambda: self.model in ModelArray.MacPro),
# Modded RestrictEvents with displaypolicyd blocked to fix dGPU switching
("RestrictEvents.kext", self.constants.restrictevents_mbp_version, self.constants.restrictevents_mbp_path, lambda: self.model in ["MacBookPro6,1", "MacBookPro6,2", "MacBookPro9,1"]),
(
"NightShiftEnabler.kext",
self.constants.nightshift_version,
self.constants.nightshift_path,
lambda: self.model in ModelArray.NightShift and self.constants.allow_oc_everywhere is False and self.constants.serial_settings == "Minimal",
),
("SMC-Spoof.kext", self.constants.smcspoof_version, self.constants.smcspoof_path, lambda: self.constants.allow_oc_everywhere is False),
# CPU patches
("AppleMCEReporterDisabler.kext", self.constants.mce_version, self.constants.mce_path, lambda: self.model in ModelArray.DualSocket),
@@ -161,26 +157,33 @@ class BuildOpenCore:
"CPUFriend.kext",
self.constants.cpufriend_version,
self.constants.cpufriend_path,
lambda: self.model not in ["iMac7,1", "Xserve2,1"] and self.constants.allow_oc_everywhere is False and self.constants.disallow_cpufriend is False,
lambda: self.model not in ["iMac7,1", "Xserve2,1", "Dortania1,1"] and self.constants.allow_oc_everywhere is False and self.constants.disallow_cpufriend is False,
),
# Ethernet patches
("nForceEthernet.kext", self.constants.nforce_version, self.constants.nforce_path, lambda: self.model in ModelArray.EthernetNvidia),
("MarvelYukonEthernet.kext", self.constants.marvel_version, self.constants.marvel_path, lambda: self.model in ModelArray.EthernetMarvell),
("CatalinaBCM5701Ethernet.kext", self.constants.bcm570_version, self.constants.bcm570_path, lambda: self.model in ModelArray.EthernetBroadcom),
# Legacy audio
("AppleALC.kext", self.constants.applealc_version, self.constants.applealc_path, lambda: self.model in ModelArray.LegacyAudio or self.model in ModelArray.MacPro71),
("AppleALC.kext", self.constants.applealc_version, self.constants.applealc_path, lambda: self.model in ModelArray.LegacyAudio or self.model in ModelArray.MacPro),
# IDE patch
("AppleIntelPIIXATA.kext", self.constants.piixata_version, self.constants.piixata_path, lambda: self.model in ModelArray.IDEPatch),
# Misc
("SidecarFixup.kext", self.constants.sidecarfixup_version, self.constants.sidecarfixup_path, lambda: self.model in ModelArray.SidecarPatch),
("FeatureUnlock.kext", self.constants.featureunlock_version, self.constants.featureunlock_path, lambda: self.model in ModelArray.SidecarPatch),
("DebugEnhancer.kext", self.constants.debugenhancer_version, self.constants.debugenhancer_path, lambda: self.constants.kext_debug is True),
("latebloom.kext", self.constants.latebloom_version, self.constants.latebloom_path, lambda: self.model in ModelArray.PCIRaceCondition),
]:
self.enable_kext(name, version, path, check)
if self.constants.allow_oc_everywhere is False:
self.get_item_by_kv(self.config["Kernel"]["Patch"], "Identifier", "com.apple.driver.AppleSMC")["Enabled"] = True
if not self.constants.custom_model and (self.constants.allow_oc_everywhere is True or self.model in ModelArray.MacPro71):
if self.get_kext_by_bundle_path("latebloom.kext")["Enabled"] is True:
print(f"- Setting latebloom delay of {self.constants.latebloom_delay}ms, range {self.constants.latebloom_range}ms, debug {bool(self.constants.latebloom_debug)}")
self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"][
"boot-args"
] += f" latebloom={self.constants.latebloom_delay}, lb_range={self.constants.latebloom_range}, lb_debug={self.constants.latebloom_debug}"
if not self.constants.custom_model and (self.constants.allow_oc_everywhere is True or self.model in ModelArray.MacPro):
# Use Innie's same logic:
# https://github.com/cdf/Innie/blob/v1.3.0/Innie/Innie.cpp#L90-L97
for i, controller in enumerate(self.computer.storage):
@@ -201,7 +204,7 @@ class BuildOpenCore:
self.config["#Revision"][f"Hardware-NVMe-{i}"] = f"{Utilities.friendly_hex(controller.vendor_id)}:{Utilities.friendly_hex(controller.device_id)}"
# Disable Bit 0 (L0s), enable Bit 1 (L1)
nvme_aspm = (controller.aspm & (~3)) | 2
nvme_aspm = (controller.aspm & (~0b11)) | 0b10
if controller.pci_path:
print(f"- Found NVMe ({i}) at {controller.pci_path}")
@@ -239,8 +242,13 @@ class BuildOpenCore:
# iMac11,x-12,x also apply
arpt_path = "PciRoot(0x0)/Pci(0x1C,0x1)/Pci(0x0,0x0)"
print(f"- Using known DevicePath {arpt_path}")
print(f"- Applying fake ID for WiFi, setting Country Code: {self.computer.wifi.country_code}")
self.config["DeviceProperties"]["Add"][arpt_path] = {"device-id": binascii.unhexlify("ba430000"), "compatible": "pci14e4,43ba", "brcmfx-country": self.computer.wifi.country_code}
self.config["DeviceProperties"]["Add"][arpt_path] = {"device-id": binascii.unhexlify("ba430000"), "compatible": "pci14e4,43ba"}
if not self.constants.custom_model and self.computer.wifi and self.constants.validate is False and self.computer.wifi.country_code:
print(f"- Applying fake ID for WiFi, setting Country Code: {self.computer.wifi.country_code}")
self.config["DeviceProperties"]["Add"][arpt_path].update({"brcmfx-country": self.computer.wifi.country_code})
if self.constants.enable_wake_on_wlan is True:
print("- Enabling Wake on WLAN support")
self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += f" -brcmfxwowl"
# WiFi patches
# TODO: -a is not supported in Lion and older, need to add proper fix
@@ -256,15 +264,18 @@ class BuildOpenCore:
elif not self.constants.custom_model and self.computer.wifi:
if isinstance(self.computer.wifi, device_probe.Broadcom):
# This works around OCLP spoofing the Wifi card and therefore unable to actually detect the correct device
if self.computer.wifi.chipset == device_probe.Broadcom.Chipsets.AirportBrcmNIC:
if self.computer.wifi.chipset == device_probe.Broadcom.Chipsets.AirportBrcmNIC and self.constants.validate is False and self.computer.wifi.country_code:
self.enable_kext("AirportBrcmFixup.kext", self.constants.airportbcrmfixup_version, self.constants.airportbcrmfixup_path)
print(f"- Setting Wireless Card's Country Code: {self.computer.wifi.country_code}")
if not self.constants.custom_model and self.computer.wifi and self.computer.wifi.pci_path:
if self.computer.wifi.pci_path:
arpt_path = self.computer.wifi.pci_path
print(f"- Found ARPT device at {arpt_path}")
self.config["DeviceProperties"]["Add"][arpt_path] = {"brcmfx-country": self.computer.wifi.country_code}
else:
self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += f" brcmfx-country={self.computer.wifi.country_code}"
if self.constants.enable_wake_on_wlan is True:
print("- Enabling Wake on WLAN support")
self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += f" -brcmfxwowl"
elif self.computer.wifi.chipset == device_probe.Broadcom.Chipsets.AirPortBrcm4360:
wifi_fake_id(self)
elif self.computer.wifi.chipset == device_probe.Broadcom.Chipsets.AirPortBrcm4331:
@@ -292,12 +303,15 @@ class BuildOpenCore:
self.get_kext_by_bundle_path("IO80211HighSierra.kext/Contents/PlugIns/AirPortAtheros40.kext")["Enabled"] = True
else:
self.enable_kext("AirportBrcmFixup.kext", self.constants.airportbcrmfixup_version, self.constants.airportbcrmfixup_path)
print(f"- Setting Wireless Card's Country Code: {self.computer.wifi.country_code}")
self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += f" brcmfx-country={self.computer.wifi.country_code}"
# print(f"- Setting Wireless Card's Country Code: {self.computer.wifi.country_code}")
# self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += f" brcmfx-country={self.computer.wifi.country_code}"
if self.constants.enable_wake_on_wlan is True:
print("- Enabling Wake on WLAN support")
self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += f" -brcmfxwowl"
# CPUFriend
pp_map_path = Path(self.constants.platform_plugin_plist_path) / Path(f"{self.model}/Info.plist")
if self.model not in ["iMac7,1", "Xserve2,1"] and self.constants.allow_oc_everywhere is False:
if self.model not in ["iMac7,1", "Xserve2,1", "Dortania1,1"] and self.constants.allow_oc_everywhere is False:
Path(self.constants.pp_kext_folder).mkdir()
Path(self.constants.pp_contents_folder).mkdir()
shutil.copy(pp_map_path, self.constants.pp_contents_folder)
@@ -324,7 +338,12 @@ class BuildOpenCore:
# USB Map
usb_map_path = Path(self.constants.plist_folder_path) / Path("AppleUSBMaps/Info.plist")
# iMac7,1 kernel panics with USB map installed, remove for time being until properly debugged
if usb_map_path.exists() and self.constants.allow_oc_everywhere is False and self.model not in ["iMac7,1", "Xserve2,1"]:
if (
usb_map_path.exists()
and self.constants.allow_oc_everywhere is False
and self.model not in ["iMac7,1", "Xserve2,1", "Dortania1,1"]
and (self.model in ModelArray.Missing_USB_Map or self.constants.serial_settings in ["Moderate", "Advanced"])
):
print("- Adding USB-Map.kext")
Path(self.constants.map_kext_folder).mkdir()
Path(self.constants.map_contents_folder).mkdir()
@@ -381,12 +400,16 @@ class BuildOpenCore:
if self.model in ["iMac13,1", "iMac13,2", "iMac13,3"]:
if self.computer.dgpu:
print("- Fixing sleep support in macOS 12")
self.config["DeviceProperties"]["Add"]["PciRoot(0x0)/Pci(0x2,0x0)"] = {
"name": binascii.unhexlify("23646973706C6179"),
"IOName": "#display",
"class-code": binascii.unhexlify("FFFFFFFF"),
}
if self.constants.allow_ivy_igpu is False:
print("- Disabling iGPU to fix sleep support in macOS 12")
self.config["DeviceProperties"]["Add"][self.gfx0_path] = {"agdpmod": "vit9696", "shikigva": 256}
self.config["DeviceProperties"]["Add"]["PciRoot(0x0)/Pci(0x2,0x0)"] = {
"name": binascii.unhexlify("23646973706C6179"),
"IOName": "#display",
"class-code": binascii.unhexlify("FFFFFFFF"),
}
else:
print("- Enabling iGPU upon request")
# Audio Patch
if self.model in ModelArray.LegacyAudio:
@@ -510,7 +533,7 @@ class BuildOpenCore:
elif self.computer.dgpu.arch == device_probe.NVIDIA.Archs.Kepler:
backlight_path_detection(self)
nvidia_patch(self, self.gfx0_path)
if self.model in ModelArray.MacPro71:
if self.model in ModelArray.MacPro:
if not self.constants.custom_model:
for i, device in enumerate(self.computer.gpus):
print(f"- Found dGPU ({i + 1}): {Utilities.friendly_hex(device.vendor_id)}:{Utilities.friendly_hex(device.device_id)}")
@@ -533,7 +556,9 @@ class BuildOpenCore:
print("- Adding Mac Pro, Xserve DRM patches")
if "shikigva=128 unfairgva=1" not in self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"]:
print("- Falling back to boot-args")
self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += " shikigva=128 unfairgva=1" + (" -wegtree" if "-wegtree" not in self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] else "")
self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += " shikigva=128 unfairgva=1" + (
" -wegtree" if "-wegtree" not in self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] else ""
)
elif isinstance(device, device_probe.NVIDIA):
print("- Enabling Nvidia Output Patch")
if "-wegtree" not in self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"]:
@@ -550,6 +575,8 @@ class BuildOpenCore:
self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += " shikigva=128 unfairgva=1 -wegtree"
# Add XhciDxe if firmware doesn't have XHCI controller support and XCHI controller detected
# TODO: Fix XhciDxe to work on pre UEFI 2.0 Macs
# Ref: https://github.com/acidanthera/bugtracker/issues/1663
# if self.model not in ModelArray.XhciSupport and not self.constants.custom_model:
# devices = plistlib.loads(subprocess.run("ioreg -c IOPCIDevice -r -d2 -a".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode())
# try:
@@ -597,6 +624,8 @@ class BuildOpenCore:
if self.constants.kext_debug is True:
print("- Enabling DEBUG Kexts")
self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += " -liludbgall"
# Disabled due to macOS Monterey crashing shortly after kernel init
# Use DebugEnhancer.kext instead
# self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += " msgbuf=1048576"
if self.constants.opencore_debug is True:
print("- Enabling DEBUG OpenCore")
@@ -639,11 +668,17 @@ class BuildOpenCore:
if self.model == self.constants.override_smbios:
print("- Adding -no_compat_check")
self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += " -no_compat_check"
if self.constants.disk != "":
self.disk_type()
if self.constants.validate is False:
print("- Adding bootmgfw.efi BlessOverride")
self.config["Misc"]["BlessOverride"] += ["\\EFI\\Microsoft\\Boot\\bootmgfw.efi"]
def set_smbios(self):
spoofed_model = self.model
if self.constants.override_smbios == "Default":
spoofed_model = self.smbios_set()
spoofed_model = self.smbios_set(self.model)
print(f"- Spoofing to {spoofed_model}")
else:
spoofed_model = self.constants.override_smbios
try:
@@ -719,7 +754,11 @@ class BuildOpenCore:
self.config["PlatformInfo"]["CustomMemory"] = True
# USB Map and CPUFriend Patching
if self.constants.allow_oc_everywhere is False and self.model not in ["iMac7,1", "Xserve2,1"]:
if (
self.constants.allow_oc_everywhere is False
and self.model not in ["iMac7,1", "Xserve2,1", "Dortania1,1"]
and (self.model in ModelArray.Missing_USB_Map or self.constants.serial_settings in ["Moderate", "Advanced"])
):
new_map_ls = Path(self.constants.map_contents_folder) / Path("Info.plist")
map_config = plistlib.load(Path(new_map_ls).open("rb"))
# Strip unused USB maps
@@ -739,7 +778,7 @@ class BuildOpenCore:
except KeyError:
continue
plistlib.dump(map_config, Path(new_map_ls).open("wb"), sort_keys=True)
if self.constants.allow_oc_everywhere is False and self.model not in ["iMac7,1", "Xserve2,1"] and self.constants.disallow_cpufriend is False:
if self.constants.allow_oc_everywhere is False and self.model not in ["iMac7,1", "Xserve2,1", "Dortania1,1"] and self.constants.disallow_cpufriend is False:
# Adjust CPU Friend Data to correct SMBIOS
new_cpu_ls = Path(self.constants.pp_contents_folder) / Path("Info.plist")
cpu_config = plistlib.load(Path(new_cpu_ls).open("rb"))
@@ -904,7 +943,7 @@ Please build OpenCore first!"""
for disk in all_disks:
if not any(all_disks[disk]["partitions"][partition]["fs"] in ("msdos", "EFI") for partition in all_disks[disk]["partitions"]):
continue
menu.add_menu_option(f"{disk}: {all_disks[disk]['name']} ({human_fmt(all_disks[disk]['size'])})", key=disk[4:])
menu.add_menu_option(f"{disk}: {all_disks[disk]['name']} ({Utilities.human_fmt(all_disks[disk]['size'])})", key=disk[4:])
response = menu.start()
@@ -924,7 +963,7 @@ Please build OpenCore first!"""
for partition in selected_disk["partitions"]:
if selected_disk["partitions"][partition]["fs"] not in ("msdos", "EFI"):
continue
text = f"{partition}: {selected_disk['partitions'][partition]['name']} ({human_fmt(selected_disk['partitions'][partition]['size'])})"
text = f"{partition}: {selected_disk['partitions'][partition]['name']} ({Utilities.human_fmt(selected_disk['partitions'][partition]['size'])})"
if selected_disk["partitions"][partition]["type"] == "EFI" or (
selected_disk["partitions"][partition]["type"] == "Microsoft Basic Data" and selected_disk["partitions"][partition]["size"] < 1024 * 1024 * 512
): # 512 megabytes:
@@ -982,7 +1021,7 @@ Please build OpenCore first!"""
print("is removed from the partition")
print("We highly recommend users partition 200MB off their drive with Disk Utility")
print(" Name:\t\t OPENCORE")
print(" Format:\t FAT32")
print(" Format:\t\t FAT32")
print(" Size:\t\t 200MB")
choice = input("\nWould you like to still install OpenCore to this drive?(y/n): ")
if not choice in ["y", "Y", "Yes", "yes"]:

View File

@@ -328,9 +328,9 @@ hardware
"""
)
change_menu = input("Disable CPU Friend?(y/n): ")
if change_menu == "y":
if change_menu in {"y", "Y", "yes", "Yes"}:
self.constants.disallow_cpufriend = True
elif change_menu == "n":
elif change_menu in {"n", "N", "no", "No"}:
self.constants.disallow_cpufriend = False
else:
print("Invalid option")
@@ -420,9 +420,9 @@ Note: MacBook5,x-7,1 don't support FireWire boot
)
change_menu = input("Enable FireWire Boot support?(y/n): ")
if change_menu == "y":
if change_menu in {"y", "Y", "yes", "Yes"}:
self.constants.firewire_boot = True
elif change_menu == "n":
elif change_menu in {"n", "N", "no", "No"}:
self.constants.firewire_boot = False
else:
print("Invalid option")
@@ -445,9 +445,9 @@ OpenCore will enable NVMe support in it's picker
)
change_menu = input("Enable NVMe Boot support?(y/n): ")
if change_menu == "y":
if change_menu in {"y", "Y", "yes", "Yes"}:
self.constants.nvme_boot = True
elif change_menu == "n":
elif change_menu in {"n", "N", "no", "No"}:
self.constants.nvme_boot = False
else:
print("Invalid option")
@@ -471,9 +471,97 @@ Note: Acceleration only applies to macOS Big Sur
)
change_menu = input("Enable TS2 Acceleration?(y/n): ")
if change_menu == "y":
if change_menu in {"y", "Y", "yes", "Yes"}:
self.constants.terascale_2_patch = True
elif change_menu == "n":
elif change_menu in {"n", "N", "no", "No"}:
self.constants.terascale_2_patch = False
else:
print("Invalid option")
def allow_wowl(self):
Utilities.cls()
Utilities.header(["Allow Wake on WLAN"])
print(
"""
Due to an unfortunate bug in macOS Big Sur+, Wake on WLAN is
disabled by default for BCM943224, BCM94331 and BCM94360/2 chipsets.
This is due to Wake on WLAN creating network instability and in other cases
halving network speeds. This issue is not replicable across machines however
be prepared if enabling.
"""
)
change_menu = input("Allow Wake on WLAN?(y/n): ")
if change_menu in {"y", "Y", "yes", "Yes"}:
self.constants.enable_wake_on_wlan = True
elif change_menu in {"n", "N", "no", "No"}:
self.constants.enable_wake_on_wlan = False
else:
print("Invalid option")
def allow_ivy(self):
Utilities.cls()
Utilities.header(["Allow Ivy iMac iGPU"])
print(
"""
For iMac13,x systems with a Nvidia dGPU, the iGPU is disabled by default to
allow Delta Updates, FileVault, SIP and such on macOS Monterey. However due to
this, DRM and QuickSync support may be broken.
Users can choose to override this option but be aware SIP and FileVault must be
disabled to run root patches to fix DRM and QuickSync.
Note: This does not apply for Big Sur, the iGPU can be renabled without
consequence
Note 2: This setting only affects iMac13,x with dGPUs
"""
)
change_menu = input("Allow Ivy iMac iGPU?(y/n): ")
if change_menu in {"y", "Y", "yes", "Yes"}:
self.constants.allow_ivy_igpu = True
elif change_menu in {"n", "N", "no", "No"}:
self.constants.allow_ivy_igpu = False
else:
print("Invalid option")
def latebloom_settings(self):
Utilities.cls()
Utilities.header(["Set latebloom properties"])
print(
f"""
Set latebloom properties, useful for debugging boot stalls on
pre-Sandy Bridge Macs.
Valid options:
1. Set delay (currently: {self.constants.latebloom_delay}ms)
2. Set range (currently: {self.constants.latebloom_range}ms)
3. Set debug (currently: {bool(self.constants.latebloom_debug)})
"""
)
change_menu = input("Select latebloom property(1/2/3): ")
if change_menu == "1":
try:
self.constants.latebloom_delay = int(input("Set delay: "))
except ValueError:
input("Invalid value, press [ENTER] to continue")
elif change_menu == "2":
try:
self.constants.latebloom_range = int(input("Set range: "))
except ValueError:
input("Invalid value, press [ENTER] to continue")
elif change_menu == "3":
try:
print("Currently supports either 0(False) or 1(True)")
latebloom_debug = int(input("Set debug(0/1): "))
if latebloom_debug not in [0, 1]:
input("Invalid value, press [ENTER] to continue")
else:
self.constants.latebloom_debug = latebloom_debug
except ValueError:
input("Invalid value, press [ENTER] to continue")
else:
print("Invalid option")

View File

@@ -12,9 +12,9 @@ from Resources import device_probe
class Constants:
def __init__(self):
self.patcher_version = "0.2.2"
self.opencore_commit = "4e0ff2d - 05-23-2021"
self.opencore_version = "0.7.0"
self.patcher_version = "0.2.4"
self.opencore_commit = "be2d9fe - 07-2-2021"
self.opencore_version = "0.7.1"
self.lilu_version = "1.5.4"
self.whatevergreen_version = "1.5.1"
self.airportbcrmfixup_version = "2.1.3"
@@ -38,11 +38,14 @@ class Constants:
self.nightshift_version = "1.1.0"
self.smcspoof_version = "1.0.0"
self.nvmefix_version = "1.0.9"
self.sidecarfixup_version = "1.0.2"
self.featureunlock_version = "1.0.3"
self.debugenhancer_version = "1.0.3"
self.innie_version = "1.3.0"
self.fw_kext = "1.0.0"
self.patcher_support_pkg_version = "0.0.10" # PatcherSupportPkg
self.latebloom_version = "0.19"
self.disk = ""
self.patch_disk = ""
self.patcher_support_pkg_version = "0.0.15" # PatcherSupportPkg
# Get resource path
self.current_path = Path(__file__).parent.parent.resolve()
@@ -70,6 +73,7 @@ class Constants:
self.sip_status = True
self.secure_status = False
self.detected_os = 0
self.detected_os_minor = 0
self.boot_efi = False
self.drm_support = False
self.allow_oc_everywhere = False
@@ -85,6 +89,14 @@ class Constants:
self.nvme_boot = False
self.disable_amfi = False
self.terascale_2_patch = False
self.enable_wake_on_wlan = False
self.allow_ivy_igpu = False
self.moj_cat_accel = False
self.latebloom_status = False
self.latebloom_delay = 0
self.latebloom_range = 0
self.latebloom_debug = 0
self.validate = False
# OS Versions
self.tiger = 8
@@ -128,6 +140,12 @@ class Constants:
# External Files
self.url_patcher_support_pkg = "https://github.com/dortania/PatcherSupportPkg/releases/download/"
self.legacy_accel_support = [
self.mojave,
self.catalina,
self.big_sur,
]
# Payload Location
# OpenCore
@property
@@ -263,8 +281,8 @@ class Constants:
return self.payload_kexts_path / Path(f"Acidanthera/NVMeFix-v{self.nvmefix_version}.zip")
@property
def sidecarfixup_path(self):
return self.payload_kexts_path / Path(f"Acidanthera/SidecarFixup-v{self.sidecarfixup_version}.zip")
def featureunlock_path(self):
return self.payload_kexts_path / Path(f"Acidanthera/FeatureUnlock-v{self.featureunlock_version}.zip")
@property
def debugenhancer_path(self):
@@ -274,6 +292,10 @@ class Constants:
def innie_path(self):
return self.payload_kexts_path / Path(f"Misc/Innie-v{self.innie_version}.zip")
@property
def latebloom_path(self):
return self.payload_kexts_path / Path(f"Misc/latebloom-v{self.latebloom_version}.zip")
@property
def plist_folder_path(self):
return self.payload_kexts_path / Path("Plists")
@@ -301,7 +323,7 @@ class Constants:
@property
def opencore_release_folder(self):
return self.build_path / Path(f"OpenCore-{self.opencore_build}")
return self.build_path / Path(f"OpenCore-Build")
@property
def opencore_zip_copied(self):
@@ -384,6 +406,10 @@ class Constants:
def vault_path(self):
return self.payload_path / Path("Tools/CreateVault/sign.command")
@property
def ocvalidate_path(self):
return self.payload_path / Path("Tools/ocvalidate")
# Icons
@property
def app_icon_path(self):
@@ -459,6 +485,10 @@ class Constants:
def payload_apple_private_frameworks_path_accel_ts2(self):
return self.payload_apple_private_frameworks_path / Path("Graphics-Acceleration-TeraScale-2")
@property
def payload_apple_private_frameworks_path_accel_ivy(self):
return self.payload_apple_private_frameworks_path / Path("Graphics-Acceleration-Ivy-Bridge")
@property
def payload_apple_private_frameworks_path_brightness(self):
return self.payload_apple_private_frameworks_path / Path("Brightness-Control")
@@ -511,18 +541,21 @@ class Constants:
return self.payload_apple_kexts_path / Path("Brightness-Control")
csr_values = {
"CSR_ALLOW_UNTRUSTED_KEXTS": False, # 0x1 - Allows Unsigned Kexts - Introduced in El Capitan # noqa: E241
"CSR_ALLOW_UNRESTRICTED_FS": False, # 0x2 - File System Access - Introduced in El Capitan # noqa: E241
"CSR_ALLOW_TASK_FOR_PID": False, # 0x4 - Unrestricted Debugging - Introduced in El Capitan # noqa: E241
"CSR_ALLOW_KERNEL_DEBUGGER": False, # 0x8 - Allow Kernel Debugger - Introduced in El Capitan # noqa: E241
"CSR_ALLOW_APPLE_INTERNAL": False, # 0x10 - Set AppleInternal Features - Introduced in El Capitan # noqa: E241
"CSR_ALLOW_UNRESTRICTED_DTRACE": False, # 0x20 - Unrestricted DTrace usage - Introduced in El Capitan # noqa: E241
"CSR_ALLOW_UNRESTRICTED_NVRAM": False, # 0x40 - Unrestricted NVRAM write - Introduced in El Capitan # noqa: E241
"CSR_ALLOW_DEVICE_CONFIGURATION": False, # 0x80 - Allow Device Configuration(?) - Introduced in El Capitan # noqa: E241
"CSR_ALLOW_ANY_RECOVERY_OS": False, # 0x100 - Disable BaseSystem Verification - Introduced in Sierra # noqa: E241
"CSR_ALLOW_UNAPPROVED_KEXTS": False, # 0x200 - Allow Unapproved Kexts - Introduced in High Sierra # noqa: E241
# Source: macOS 11.4 (XNU's csr.h)
# https://opensource.apple.com/source/xnu/xnu-7195.121.3/bsd/sys/csr.h.auto.html
"CSR_ALLOW_UNTRUSTED_KEXTS": False, # 0x1 - Allows Unsigned Kexts - Introduced in El Capitan # noqa: E241
"CSR_ALLOW_UNRESTRICTED_FS": False, # 0x2 - File System Access - Introduced in El Capitan # noqa: E241
"CSR_ALLOW_TASK_FOR_PID": False, # 0x4 - Unrestricted task_for_pid() - Introduced in El Capitan # noqa: E241
"CSR_ALLOW_KERNEL_DEBUGGER": False, # 0x8 - Allow Kernel Debugger - Introduced in El Capitan # noqa: E241
"CSR_ALLOW_APPLE_INTERNAL": False, # 0x10 - Set AppleInternal Features - Introduced in El Capitan # noqa: E241
# "CSR_ALLOW_DESTRUCTIVE_DTRACE": False, # 0x20 - Allow destructive DTrace - Deprecated # noqa: E241
"CSR_ALLOW_UNRESTRICTED_DTRACE": False, # 0x20 - Unrestricted DTrace usage - Introduced in El Capitan # noqa: E241
"CSR_ALLOW_UNRESTRICTED_NVRAM": False, # 0x40 - Unrestricted NVRAM write - Introduced in El Capitan # noqa: E241
"CSR_ALLOW_DEVICE_CONFIGURATION": False, # 0x80 - Allow custom DeviceTree (iOS) - Introduced in El Capitan # noqa: E241
"CSR_ALLOW_ANY_RECOVERY_OS": False, # 0x100 - Skip BaseSystem Verification - Introduced in Sierra # noqa: E241
"CSR_ALLOW_UNAPPROVED_KEXTS": False, # 0x200 - Allow Unnotarized Kexts - Introduced in High Sierra # noqa: E241
"CSR_ALLOW_EXECUTABLE_POLICY_OVERRIDE": False, # 0x400 - Override Executable Policy - Introduced in Mojave # noqa: E241
"CSR_ALLOW_UNAUTHENTICATED_ROOT": False, # 0x800 - Allow Root Volume Mounting - Introduced in Big Sur # noqa: E241
"CSR_ALLOW_UNAUTHENTICATED_ROOT": False, # 0x800 - Allow Root Volume Mounting - Introduced in Big Sur # noqa: E241
}
root_patch_sip_mojave = [
@@ -543,22 +576,31 @@ class Constants:
]
sbm_values = [
"j137",
"j680",
"j132",
"j174",
"j140k",
"j780",
"j213",
"j140a",
"j152f",
"j160",
"j230k",
"j214k",
"j223",
"j215",
"j185",
"j185f",
"j137", # iMacPro1,1
"j680", # MacBookPro15,1
"j132", # MacBookPro15,2
"j174", # Macmini8,1
"j140k", # MacBookAir8,1
"j780", # MacBookPro15,3
"j213", # MacBookPro15,4
"j140a", # MacBookAir8,2
"j152f", # MacBookPro16,1
"j160", # MacPro7,1
"j230k", # MacBookAir9,1
"j214k", # MacBookPro16,2
"j223", # MacBookPro16,3
"j215", # MacBookPro16,4
"j185", # iMac20,1
"j185f", # iMac20,2
]
sandy_board_id = [
"Mac-E43C1C25D4880AD6", # MacBookPro12,1
"Mac-06F11F11946D27C5", # MacBookPro11,5
"Mac-9F18E312C5C2BF0B", # MacBookAir7,1
"Mac-937CB26E2E02BB01", # MacBookAir7,2
"Mac-35C5E08120C7EEAF", # Macmini7,1
"Mac-7BA5B2D9E42DDD94", # iMacPro1,1
]
board_id = {

View File

@@ -445,13 +445,35 @@ XhciSupport = [
]
SidecarPatch = [
"MacBook4,1",
"MacBook5,1",
"MacBook5,2",
"MacBook6,1",
"MacBook7,1",
"MacBook8,1",
"MacBookAir2,1",
"MacBookAir3,1",
"MacBookAir3,2",
"MacBookAir4,1",
"MacBookAir4,2",
"MacBookAir5,1",
"MacBookAir5,2",
"MacBookAir6,1",
"MacBookAir6,2",
"MacBookAir7,1",
"MacBookAir7,2",
"MacBookPro4,1",
"MacBookPro5,1",
"MacBookPro5,2",
"MacBookPro5,3",
"MacBookPro5,4",
"MacBookPro5,5",
"MacBookPro6,1",
"MacBookPro6,2",
"MacBookPro7,1",
"MacBookPro8,1",
"MacBookPro8,2",
"MacBookPro8,3",
"MacBookPro9,1",
"MacBookPro9,2",
"MacBookPro10,1",
@@ -468,10 +490,24 @@ SidecarPatch = [
"MacBookPro14,1",
"MacBookPro14,2",
"MacBookPro14,3",
"Macmini3,1",
"Macmini4,1",
"Macmini5,1",
"Macmini5,2",
"Macmini5,3",
"Macmini6,1",
"Macmini6,2",
"Macmini7,1",
"Macmini8,1",
"iMac7,1",
"iMac8,1",
"iMac9,1",
"iMac10,1",
"iMac11,1",
"iMac11,2",
"iMac11,3",
"iMac12,1",
"iMac12,2",
"iMac13,1",
"iMac13,2",
"iMac13,3",
@@ -483,6 +519,10 @@ SidecarPatch = [
"iMac16,2",
"iMac17,1",
"iMac18,1",
"iMac18,2",
"iMac18,3",
"MacPro3,1",
"MacPro4,1",
"MacPro5,1",
"MacPro6,1",
"Dortania1,1",
@@ -523,7 +563,7 @@ HiDPIpicker = ["MacBook8,1", "MacBookPro10,1", "MacBookPro10,2", "MacBookPro11,1
IDEPatch = ["MacBook4,1", "MacBookPro4,1", "iMac7,1", "iMac8,1", "MacPro3,1", "Xserve2,1", "Dortania1,1"]
# 11" Air
MacBookAir61 = [
MacBookAir_11 = [
"MacBookAir3,1",
"MacBookAir4,1",
"MacBookAir5,1",
@@ -531,7 +571,7 @@ MacBookAir61 = [
]
# Classic MacBook and 13" Air
MacBookAir62 = [
MacBookAir_13 = [
"MacBook4,1",
"MacBook5,1",
"MacBook5,2",
@@ -545,13 +585,13 @@ MacBookAir62 = [
]
# Retina MacBook
MacBook81 = [
MacBook_12 = [
"MacBook8,1",
]
# MacBook Pro 13"
MacBookPro111 = [
MacBookPro_13 = [
"MacBookPro5,5",
"MacBookPro7,1",
"MacBookPro8,1",
@@ -562,11 +602,11 @@ MacBookPro111 = [
# MacBook Pro 15" (iGPU)
MacBookPro112 = ["MacBookPro11,2"]
MacBookPro_15_iGPU = ["MacBookPro11,2"]
# MacBook Pro 15" and 17" (dGPU)
MacBookPro113 = [
MacBookPro_15_dGPU = [
"MacBookPro4,1",
"MacBookPro5,1",
"MacBookPro5,2",
@@ -583,9 +623,9 @@ MacBookPro113 = [
# Mac Mini
Macmini71 = ["Macmini3,1", "Macmini4,1", "Macmini5,1", "Macmini5,2", "Macmini5,3", "Macmini6,1", "Macmini6,2"]
Macmini = ["Macmini3,1", "Macmini4,1", "Macmini5,1", "Macmini5,2", "Macmini5,3", "Macmini6,1", "Macmini6,2"]
# iMacPro = dGPU only iMacs
iMacPro11 = [
iMac_iGPUless = [
"iMac7,1",
"iMac8,1",
"iMac9,1",
@@ -598,17 +638,17 @@ iMacPro11 = [
]
# iMac = AMD and Nvidia GPU with iGPU
iMac151 = [
iMac_dGPU = [
"iMac13,2",
"iMac14,2",
"iMac14,3",
"iMac15,1",
]
# iMac = Intel iGPU
iMac144 = ["iMac13,1", "iMac14,1", "iMac14,4"]
iMac_iGPU = ["iMac13,1", "iMac13,3", "iMac14,1", "iMac14,4"]
# Mac Pro and Xserve
MacPro71 = ["MacPro3,1", "MacPro4,1", "MacPro5,1", "Xserve2,1", "Xserve3,1", "Dortania1,1"]
MacPro = ["MacPro3,1", "MacPro4,1", "MacPro5,1", "Xserve2,1", "Xserve3,1", "Dortania1,1"]
XXerve = [
"Xserve3,1",
@@ -913,7 +953,7 @@ windows_audio = [
"iMac13,3",
]
NoAGPMSupport = ["MacBook4,1", "MacBookPro4,1", "iMac7,1", "iMac8,1", "MacPro3,1", "Xserve2,1"]
NoAGPMSupport = ["MacBook4,1", "MacBookPro4,1", "iMac7,1", "iMac8,1", "MacPro3,1", "Xserve2,1", "Dortania1,1"]
AGDPSupport = [
"MacBookPro9,1",
@@ -954,4 +994,158 @@ NoFireWireSupport = [
"MacBookAir3,2",
]
RecoveryIgnore = ["Update", "VM", "Recovery", "Preboot"]
PCIRaceCondition = [
"MacBook4,1",
"MacBook5,1",
"MacBook5,2",
"MacBook6,1",
"MacBook7,1",
"MacBookAir2,1",
"MacBookAir3,1",
"MacBookAir3,2",
"MacBookPro4,1",
"MacBookPro5,1",
"MacBookPro5,2",
"MacBookPro5,3",
"MacBookPro5,4",
"MacBookPro5,5",
"MacBookPro6,1",
"MacBookPro6,2",
"MacBookPro7,1",
"Macmini3,1",
"Macmini4,1",
"iMac7,1",
"iMac8,1",
"iMac9,1",
"iMac10,1",
"iMac11,1",
"iMac11,2",
"iMac11,3",
"MacPro3,1",
"MacPro4,1",
"MacPro5,1",
"Dortania1,1",
]
# Thunderbolt 1 Macs
Thunderbolt_1 = [
"MacBookAir4,1",
"MacBookAir4,2",
"MacBookAir5,1",
"MacBookAir5,2",
"MacBookAir6,1",
"MacBookAir6,2",
"MacBookPro8,1",
"MacBookPro8,2",
"MacBookPro8,3",
"MacBookPro9,1",
"MacBookPro9,2",
"MacBookPro10,1",
"MacBookPro10,2",
"Macmini5,1",
"Macmini5,2",
"Macmini5,3",
"Macmini6,1",
"Macmini6,2",
"iMac12,1",
"iMac12,2",
"iMac13,1",
"iMac13,2",
"iMac13,3",
"iMac14,1",
"iMac14,2",
"iMac14,3",
"iMac14,4",
"Dortania1,1",
]
# Thunderbolt 2 Macs
Thunderbolt_2 = [
"MacBookAir7,1",
"MacBookAir7,2",
"MacBookPro11,1",
"MacBookPro11,2",
"MacBookPro11,3",
"MacBookPro11,4",
"MacBookPro11,5",
"MacBookPro12,1",
"Macmini7,1",
"iMac15,1",
"iMac16,1",
"iMac16,2",
"MacPro6,1",
]
# Thunderbolt 3 Macs
Thunderbolt_3 = [
"MacBookAir8,1",
"MacBookAir8,2",
"MacBookAir9,1",
"MacBookPro13,1",
"MacBookPro13,2",
"MacBookPro13,3",
"MacBookPro14,1",
"MacBookPro14,2",
"MacBookPro14,3",
"MacBookPro15,1",
"MacBookPro15,2",
"MacBookPro15,3",
"MacBookPro15,4",
"MacBookPro16,1",
"MacBookPro16,2",
"MacBookPro16,3",
"MacBookPro16,4",
"Macmini8,1",
"iMac17,1",
"iMac18,1",
"iMac18,2",
"iMac18,3",
"iMac19,1",
"iMac19,2",
"iMac20,1",
"iMac20,2",
"MacPro7,1",
]
Missing_USB_Map = [
"MacBook4,1",
"MacBook5,1",
"MacBook5,2",
"MacBook6,1",
"MacBook7,1",
"MacBookAir2,1",
"MacBookAir3,1",
"MacBookAir3,2",
"MacBookAir4,1",
"MacBookAir4,2",
"MacBookPro4,1",
"MacBookPro5,1",
"MacBookPro5,2",
"MacBookPro5,3",
"MacBookPro5,4",
"MacBookPro5,5",
"MacBookPro6,1",
"MacBookPro6,2",
"MacBookPro7,1",
"MacBookPro8,1",
"MacBookPro8,2",
"MacBookPro8,3",
"Macmini3,1",
"Macmini4,1",
"Macmini5,1",
"Macmini5,2",
"Macmini5,3",
"iMac7,1",
"iMac8,1",
"iMac9,1",
"iMac10,1",
"iMac11,1",
"iMac11,2",
"iMac11,3",
"iMac12,1",
"iMac12,2",
"MacPro3,1",
"MacPro4,1",
"XServer2,1",
"XServer3,1",
]

260
Resources/ModelExample.py Normal file
View File

@@ -0,0 +1,260 @@
# Example Hardware probe of multiple models
# To be used when running validation tests
from Resources import device_probe
class MacBook:
MacBook71 = device_probe.Computer(
real_model="MacBook7,1",
real_board_id="Mac-F22C89C8",
reported_model="MacBook7,1",
reported_board_id="Mac-F22C89C8",
gpus=[
device_probe.NVIDIA(vendor_id=4318, device_id=2208, class_code=196608, name="IGPU", model="NVIDIA GeForce 320M", pci_path="PciRoot(0x0)/Pci(0x2,0x0)"),
],
igpu=device_probe.NVIDIA(vendor_id=4318, device_id=2208, class_code=196608, name="IGPU", model="NVIDIA GeForce 320M", pci_path="PciRoot(0x0)/Pci(0x2,0x0)"),
dgpu=None,
storage=[
device_probe.SATAController(vendor_id=4318, device_id=3464, class_code=67073, name="SATA", model=None, pci_path="PciRoot(0x0)/Pci(0xa,0x0)"),
],
wifi=device_probe.Broadcom(vendor_id=5348, device_id=17235, class_code=163840, name="ARPT", model=None, pci_path="PciRoot(0x0)/Pci(0x15,0x0)/Pci(0x0,0x0)"),
cpu=device_probe.CPU(
name="Intel(R) Core(TM)2 Duo CPU P8600 @ 2.40GHz",
flags=["FPU", "VME", "DE", "PSE", "TSC", "MSR", "PAE", "MCE", "CX8", "APIC", "SEP", "MTRR", "PGE", "MCA", "CMOV", "PAT", "PSE36", "CLFSH", "DS", "ACPI", "MMX", "FXSR", "SSE", "SSE2", "SS", "HTT", "TM", "PBE", "SSE3", "DTES64", "MON", "DSCPL", "VMX", "SMX", "EST", "TM2", "SSSE3", "CX16", "TPR", "PDCM", "SSE4.1"],
),
oclp_version=None,
opencore_version=None,
)
class MacBookPro:
MacBookPro92_Stock = device_probe.Computer(
real_model="MacBookPro9,2",
real_board_id="Mac-6F01561E16C75D06",
reported_model="MacBookPro9,2",
reported_board_id="Mac-6F01561E16C75D06",
gpus=[
device_probe.Intel(vendor_id=32902, device_id=358, class_code=196608, name="IGPU", model="Intel HD Graphics 4000", pci_path="PciRoot(0x0)/Pci(0x2,0x0)")
],
igpu=device_probe.Intel(vendor_id=32902, device_id=358, class_code=196608, name="IGPU", model="Intel HD Graphics 4000", pci_path="PciRoot(0x0)/Pci(0x2,0x0)"),
dgpu=None,
storage=[device_probe.SATAController(vendor_id=32902, device_id=7683, class_code=67073, name="SATA", model=None, pci_path="PciRoot(0x0)/Pci(0x1f,0x2)")],
wifi=device_probe.Broadcom(vendor_id=5348, device_id=17201, class_code=163840, name="ARPT", model=None, pci_path="PciRoot(0x0)/Pci(0x1c,0x1)/Pci(0x0,0x0)"),
cpu=device_probe.CPU(
name='Intel(R) Core(TM) i5-3210M CPU @ 2.50GHz',
flags=['FPU', 'VME', 'DE', 'PSE', 'TSC', 'MSR', 'PAE', 'MCE', 'CX8', 'APIC', 'SEP', 'MTRR', 'PGE', 'MCA', 'CMOV', 'PAT', 'PSE36', 'CLFSH', 'DS', 'ACPI', 'MMX', 'FXSR', 'SSE', 'SSE2', 'SS', 'HTT', 'TM', 'PBE', 'SSE3', 'PCLMULQDQ', 'DTES64', 'MON', 'DSCPL', 'VMX', 'EST', 'TM2', 'SSSE3', 'CX16', 'TPR', 'PDCM', 'SSE4.1', 'SSE4.2', 'x2APIC', 'POPCNT', 'AES', 'PCID', 'XSAVE', 'OSXSAVE', 'TSCTMR', 'AVX1.0', 'RDRAND', 'F16C']
),
oclp_version=None,
opencore_version=None,
)
MacBookPro171_Stock = device_probe.Computer(
# Run under Rosetta
real_model="MacBookPro17,1",
real_board_id="J293",
reported_model="MacBookPro17,1",
reported_board_id="J293",
gpus=[device_probe.AMD(vendor_id=4098, device_id=26640, class_code=196608, name="display", model="Unknown Unknown", pci_path="")],
igpu=None,
dgpu=None,
storage=[],
wifi=device_probe.Broadcom(vendor_id=5348, device_id=17445, class_code=163840, name="wlan", model=None, pci_path=""),
cpu=device_probe.CPU(
name="Apple M1",
flags=["FPU", "VME", "DE", "PSE", "TSC", "MSR", "PAE", "MCE", "CX8", "APIC", "SEP", "MTRR", "PGE", "MCA", "CMOV", "PAT", "PSE36", "CLFSH", "DS", "ACPI", "MMX", "FXSR", "SSE", "SSE2", "SS", "HTT", "TM", "PBE", "SSE3", "PCLMULQDQ", "DTSE64", "MON", "DSCPL", "VMX", "EST", "TM2", "SSSE3", "CX16", "TPR", "PDCM", "SSE4.1", "SSE4.2", "AES", "SEGLIM64"],
),
oclp_version=None,
opencore_version=None,
)
class Macmini:
Macmini91_Stock = device_probe.Computer(
# Run under Rosetta
real_model="Macmini9,1",
real_board_id="J274",
reported_model="Macmini9,1",
reported_board_id="J274",
gpus=[
device_probe.AMD(vendor_id=4098, device_id=26640, class_code=196608, name="display", model="Unknown Unknown", pci_path="", )
],
igpu=None,
dgpu=None,
storage=[],
wifi=device_probe.Broadcom(vendor_id=5348, device_id=17445, class_code=163840, name="wlan", model=None, pci_path=""),
cpu=device_probe.CPU(
name="Apple M1",
flags=["FPU", "VME", "DE", "PSE", "TSC", "MSR", "PAE", "MCE", "CX8", "APIC", "SEP", "MTRR", "PGE", "MCA", "CMOV", "PAT", "PSE36", "CLFSH", "DS", "ACPI", "MMX", "FXSR", "SSE", "SSE2", "SS", "HTT", "TM", "PBE", "SSE3", "PCLMULQDQ", "DTSE64", "MON", "DSCPL", "VMX", "EST", "TM2", "SSSE3", "CX16", "TPR", "PDCM", "SSE4.1", "SSE4.2", "AES", "SEGLIM64"]
),
oclp_version=None,
opencore_version=None
)
class iMac:
iMac81_Stock = device_probe.Computer(
# Stock Model
real_model="iMac8,1",
real_board_id="Mac-F226BEC8",
reported_model="iMac8,1",
reported_board_id="Mac-F226BEC8",
gpus=[
device_probe.AMD(vendor_id=4098, device_id=38088, class_code=196608, name="GFX0", model="ATI Radeon HD 2400", pci_path="PciRoot(0x0)/Pci(0x1,0x0)/Pci(0x0,0x0)")
],
igpu=None,
dgpu=device_probe.AMD(vendor_id=4098, device_id=38088, class_code=196608, name="GFX0", model="ATI Radeon HD 2400", pci_path="PciRoot(0x0)/Pci(0x1,0x0)/Pci(0x0,0x0)"),
storage=[
device_probe.SATAController(vendor_id=32902, device_id=10281, class_code=67073, name="SATA", model=None, pci_path="PciRoot(0x0)/Pci(0x1f,0x2)")
],
wifi=device_probe.Broadcom(vendor_id=5348, device_id=17192, class_code=163840, name="ARPT", model=None, pci_path="PciRoot(0x0)/Pci(0x1c,0x4)/Pci(0x0,0x0)"),
cpu=device_probe.CPU(
name="Intel(R) Core(TM)2 Duo CPU E8135 @ 2.40GHz",
flags=["FPU", "VME", "DE", "PSE", "TSC", "MSR", "PAE", "MCE", "CX8", "APIC", "SEP", "MTRR", "PGE", "MCA", "CMOV", "PAT", "PSE36", "CLFSH", "DS", "ACPI", "MMX", "FXSR", "SSE", "SSE2", "SS", "HTT", "TM", "PBE", "SSE3", "DTES64", "MON", "DSCPL", "VMX", "EST", "TM2", "SSSE3", "CX16", "TPR", "PDCM", "SSE4.1"]
),
oclp_version=None,
opencore_version=None,
)
iMac112_Stock = device_probe.Computer(
# Stock Model
real_model="iMac11,2",
real_board_id="Mac-F2238AC8",
reported_model="iMac11,2",
reported_board_id="Mac-F2238AC8",
gpus=[
device_probe.AMD(vendor_id=4098, device_id=38024, class_code=196608, name="GFX0", model="ATI Radeon HD 4670", pci_path="PciRoot(0x0)/Pci(0x1,0x0)/Pci(0x0,0x0)")
],
igpu=None,
dgpu=device_probe.AMD(vendor_id=4098, device_id=38024, class_code=196608, name="GFX0", model="ATI Radeon HD 4670", pci_path="PciRoot(0x0)/Pci(0x1,0x0)/Pci(0x0,0x0)"),
storage=[
device_probe.SATAController(vendor_id=32902, device_id=15138, class_code=67073, name="SATA", model=None, pci_path="PciRoot(0x0)/Pci(0x1f,0x2)")
],
wifi=device_probe.Atheros(vendor_id=5772, device_id=42, class_code=163840, name="ARPT", model=None, pci_path="PciRoot(0x0)/Pci(0x1c,0x1)/Pci(0x0,0x0)"),
cpu=device_probe.CPU(
name="Intel(R) Core(TM) i3 CPU 540 @ 3.07GHz",
flags=["FPU", "VME", "DE", "PSE", "TSC", "MSR", "PAE", "MCE", "CX8", "APIC", "SEP", "MTRR", "PGE", "MCA", "CMOV", "PAT", "PSE36", "CLFSH", "DS", "ACPI", "MMX", "FXSR", "SSE", "SSE2", "SS", "HTT", "TM", "PBE", "SSE3", "DTES64", "MON", "DSCPL", "VMX", "EST", "TM2", "SSSE3", "CX16", "TPR", "PDCM", "SSE4.1", "SSE4.2", "POPCNT", "PCID"]
),
oclp_version=None,
opencore_version=None,
)
iMac122_Upgraded = device_probe.Computer(
real_model="iMac12,2",
real_board_id="Mac-942B59F58194171B",
reported_model="iMac12,2",
reported_board_id="Mac-942B59F58194171B",
gpus=[
device_probe.Intel(vendor_id=32902, device_id=258, class_code=196608, name="HD Graphics 3000", model=None, pci_path="PciRoot(0x0)/Pci(0x2,0x0)"),
device_probe.AMD(vendor_id=4098, device_id=26600, class_code=196608, name="GFX0", model="Radeon Pro WX4130", pci_path="PciRoot(0x0)/Pci(0x1,0x0)/Pci(0x0,0x0)"),
],
igpu=device_probe.Intel(vendor_id=32902, device_id=258, class_code=196608, name="HD Graphics 3000", model=None, pci_path="PciRoot(0x0)/Pci(0x2,0x0)"),
dgpu=device_probe.AMD(vendor_id=4098, device_id=26600, class_code=196608, name="GFX0", model="Radeon Pro WX4130", pci_path="PciRoot(0x0)/Pci(0x1,0x0)/Pci(0x0,0x0)"),
storage=[
device_probe.SATAController(vendor_id=32902, device_id=7170, class_code=67073, name="SATA", model=None, pci_path="PciRoot(0x0)/Pci(0x1f,0x2)")
],
wifi=device_probe.Broadcom(vendor_id=5348, device_id=17338, class_code=163840, name="ARPT", model=None, pci_path="PciRoot(0x0)/Pci(0x1c,0x1)/Pci(0x0,0x0)"),
cpu=device_probe.CPU(
name="Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz",
flags=["FPU", "VME", "DE", "PSE", "TSC", "MSR", "PAE", "MCE", "CX8", "APIC", "SEP", "MTRR", "PGE", "MCA", "CMOV", "PAT", "PSE36", "CLFSH", "DS", "ACPI", "MMX", "FXSR", "SSE", "SSE2", "SS", "HTT", "TM", "PBE", "SSE3", "PCLMULQDQ", "DTES64", "MON", "DSCPL", "VMX", "SMX", "EST", "TM2", "SSSE3", "CX16", "TPR", "PDCM", "SSE4.1", "SSE4.2", "xAPIC", "POPCNT", "AES", "PCID", "XSAVE", "OSXSAVE", "TSCTMR", "AVX1.0"]
),
oclp_version=None,
opencore_version=None,
)
class MacPro:
MacPro31_Stock = device_probe.Computer(
# Stock Model, stock TS1 GPU and no Wifi card
real_model="MacPro3,1",
real_board_id="Mac-F42C88C8",
reported_model="MacPro3,1",
reported_board_id="Mac-F42C88C8",
gpus=[
device_probe.AMD(vendor_id=4098, device_id=38272, class_code=196608, name="GFX0", model="ATI Radeon HD 2600", pci_path="PciRoot(0x0)/Pci(0x5,0x0)/Pci(0x0,0x0)")
],
igpu=None,
dgpu=device_probe.AMD(vendor_id=4098, device_id=38272, class_code=196608, name="GFX0", model="ATI Radeon HD 2600", pci_path="PciRoot(0x0)/Pci(0x5,0x0)/Pci(0x0,0x0)"),
storage=[
device_probe.SATAController(vendor_id=32902, device_id=9857, class_code=67073, name="SATA", model=None, pci_path="PciRoot(0x0)/Pci(0x1f,0x2)")
],
wifi=None,
cpu=device_probe.CPU(
name="Intel(R) Xeon(R) CPU X5482 @ 3.20GHz",
flags=["FPU", "VME", "DE", "PSE", "TSC", "MSR", "PAE", "MCE", "CX8", "APIC", "SEP", "MTRR", "PGE", "MCA", "CMOV", "PAT", "PSE36", "CLFSH", "DS", "ACPI", "MMX", "FXSR", "SSE", "SSE2", "SS", "HTT", "TM", "PBE", "SSE3", "DTES64", "MON", "DSCPL", "VMX", "EST", "TM2", "SSSE3", "CX16", "TPR", "PDCM", "SSE4.1"],
),
oclp_version=None,
opencore_version=None,
)
MacPro31_Upgrade = device_probe.Computer(
# Upgraded Model, TS2 GPU and El-Capitan era Wifi card
real_model="MacPro3,1",
real_board_id="Mac-F42C88C8",
reported_model="MacPro3,1",
reported_board_id="Mac-F42C88C8",
gpus=[
device_probe.AMD(vendor_id=4098, device_id=26808, class_code=196608, name="GFX0", model="ATI Radeon HD 5770", pci_path="PciRoot(0x0)/Pci(0x5,0x0)/Pci(0x0,0x0)")
],
igpu=None,
dgpu=device_probe.AMD(vendor_id=4098, device_id=26808, class_code=196608, name="GFX0", model="ATI Radeon HD 5770", pci_path="PciRoot(0x0)/Pci(0x5,0x0)/Pci(0x0,0x0)"),
storage=[
device_probe.SATAController(vendor_id=32902, device_id=9857, class_code=67073, name="SATA", model=None, pci_path="PciRoot(0x0)/Pci(0x1f,0x2)")
],
wifi=device_probe.Broadcom(
vendor_id=5348, device_id=17192, class_code=163840, name="ARPT", model=None, pci_path="PciRoot(0x0)/Pci(0x1c,0x3)/Pci(0x0,0x0)"
),
cpu=device_probe.CPU(
name="Intel(R) Xeon(R) CPU X5482 @ 3.20GHz",
flags=["FPU", "VME", "DE", "PSE", "TSC", "MSR", "PAE", "MCE", "CX8", "APIC", "SEP", "MTRR", "PGE", "MCA", "CMOV", "PAT", "PSE36", "CLFSH", "DS", "ACPI", "MMX", "FXSR", "SSE", "SSE2", "SS", "HTT", "TM", "PBE", "SSE3", "DTES64", "MON", "DSCPL", "VMX", "EST", "TM2", "SSSE3", "CX16", "TPR", "PDCM", "SSE4.1"],
),
oclp_version=None,
opencore_version=None,
)
MacPro31_Modern_AMD = device_probe.Computer(
# Upgraded Model, Polaris GPU and BCM94360CD
real_model="MacPro3,1",
real_board_id="Mac-F42C88C8",
reported_model="MacPro3,1",
reported_board_id="Mac-F42C88C8",
gpus=[
device_probe.AMD(vendor_id=4098, device_id=26591, class_code=196608, name="GFX0", model="Radeon RX 470/570", pci_path="PciRoot(0x0)/Pci(0x5,0x0)/Pci(0x0,0x0)")
],
igpu=None,
dgpu=device_probe.AMD(vendor_id=4098, device_id=26591, class_code=196608, name="GFX0", model="Radeon RX 470/570", pci_path="PciRoot(0x0)/Pci(0x5,0x0)/Pci(0x0,0x0)"),
storage=[
device_probe.SATAController(vendor_id=32902, device_id=9857, class_code=67073, name="SATA", model=None, pci_path="PciRoot(0x0)/Pci(0x1f,0x2)")
],
wifi=device_probe.Broadcom(
vendor_id=5348, device_id=17312, class_code=163840, name="ARPT", model=None, pci_path="PciRoot(0x0)/Pci(0x1c,0x3)/Pci(0x0,0x0)"
),
cpu=device_probe.CPU(
name="Intel(R) Xeon(R) CPU X5482 @ 3.20GHz",
flags=["FPU", "VME", "DE", "PSE", "TSC", "MSR", "PAE", "MCE", "CX8", "APIC", "SEP", "MTRR", "PGE", "MCA", "CMOV", "PAT", "PSE36", "CLFSH", "DS", "ACPI", "MMX", "FXSR", "SSE", "SSE2", "SS", "HTT", "TM", "PBE", "SSE3", "DTES64", "MON", "DSCPL", "VMX", "EST", "TM2", "SSSE3", "CX16", "TPR", "PDCM", "SSE4.1"],
),
oclp_version=None,
opencore_version=None,
)
MacPro31_Modern_Kepler = device_probe.Computer(
# Upgraded Model, Kepler GPU and BCM94360CD
real_model="MacPro3,1",
real_board_id="Mac-F42C88C8",
reported_model="MacPro3,1",
reported_board_id="Mac-F42C88C8",
gpus=[device_probe.NVIDIA(vendor_id=4318, device_id=4737, class_code=196608, name="GFX0", model="NVIDIA GeForce GT 710", pci_path="PciRoot(0x0)/Pci(0x5,0x0)/Pci(0x0,0x0)")],
igpu=None,
dgpu=device_probe.NVIDIA(vendor_id=4318, device_id=4737, class_code=196608, name="GFX0", model="NVIDIA GeForce GT 710", pci_path="PciRoot(0x0)/Pci(0x5,0x0)/Pci(0x0,0x0)"),
storage=[
device_probe.SATAController(vendor_id=32902, device_id=9857, class_code=67073, name="SATA", model=None, pci_path="PciRoot(0x0)/Pci(0x1f,0x2)")
],
wifi=device_probe.Broadcom(
vendor_id=5348, device_id=17312, class_code=163840, name="ARPT", model=None, pci_path="PciRoot(0x0)/Pci(0x1c,0x3)/Pci(0x0,0x0)"
),
cpu=device_probe.CPU(
name="Intel(R) Xeon(R) CPU X5482 @ 3.20GHz",
flags=["FPU", "VME", "DE", "PSE", "TSC", "MSR", "PAE", "MCE", "CX8", "APIC", "SEP", "MTRR", "PGE", "MCA", "CMOV", "PAT", "PSE36", "CLFSH", "DS", "ACPI", "MMX", "FXSR", "SSE", "SSE2", "SS", "HTT", "TM", "PBE", "SSE3", "DTES64", "MON", "DSCPL", "VMX", "EST", "TM2", "SSSE3", "CX16", "TPR", "PDCM", "SSE4.1"],
),
oclp_version=None,
opencore_version=None,
)

View File

@@ -5,9 +5,7 @@
# - Temporary Work-around: sudo bless --mount /System/Volumes/Update/mnt1 --bootefi --last-sealed-snapshot
# - Work-around battery throttling on laptops with no battery (IOPlatformPluginFamily.kext/Contents/PlugIns/ACPI_SMC_PlatformPlugin.kext/Contents/Resources/)
import hashlib
import os
import requests
import shutil
import subprocess
import zipfile
@@ -20,6 +18,7 @@ class PatchSysVolume:
def __init__(self, model, versions):
self.model = model
self.constants: Constants.Constants = versions
self.computer = self.constants.computer
self.root_mount_path = None
self.sip_enabled = True
self.sbm_enabled = True
@@ -31,18 +30,19 @@ class PatchSysVolume:
self.iron_gpu = False
self.sandy_gpu = False
self.ivy_gpu = False
self.nvidia_legacy = False
self.brightness_legacy = False
self.legacy_audio = False
self.added_kexts = False
self.added_legacy_kexts = False
self.amfi_must_disable = False
self.check_board_id = False
self.bad_board_id = False
self.no_patch = True
if self.constants.detected_os > self.constants.catalina:
# Big Sur and newer use APFS snapshots
self.mount_location = "/System/Volumes/Update/mnt1"
else:
self.mount_location = "/"
self.mount_location = ""
self.mount_extensions = f"{self.mount_location}/System/Library/Extensions"
self.mount_frameworks = f"{self.mount_location}/System/Library/Frameworks"
self.mount_lauchd = f"{self.mount_location}/System/Library/LaunchDaemons"
@@ -57,6 +57,9 @@ class PatchSysVolume:
def find_mount_root_vol(self, patch):
self.root_mount_path = Utilities.get_disk_path()
if self.root_mount_path.startswith("disk"):
if self.constants.detected_os == self.constants.catalina:
print("- Mounting Catalina Root Volume as writable")
self.elevated(["mount", "-uw", f"{self.mount_location}/"], stdout=subprocess.PIPE).stdout.decode().strip().encode()
print(f"- Found Root Volume at: {self.root_mount_path}")
if Path(self.mount_extensions).exists():
print("- Root Volume is already mounted")
@@ -70,9 +73,6 @@ class PatchSysVolume:
if self.constants.detected_os > self.constants.catalina:
print("- Mounting APFS Snapshot as writable")
self.elevated(["mount", "-o", "nobrowse", "-t", "apfs", f"/dev/{self.root_mount_path}", self.mount_location], stdout=subprocess.PIPE).stdout.decode().strip().encode()
elif self.constants.detected_os == self.constants.catalina:
print("- Mounting Root Volume as writable")
self.elevated(["mount", "-uw", "/"], stdout=subprocess.PIPE).stdout.decode().strip().encode()
if Path(self.mount_extensions).exists():
print("- Successfully mounted the Root Volume")
if patch is True:
@@ -92,8 +92,20 @@ class PatchSysVolume:
input("- Press [ENTER] to exit: ")
def unpatch_root_vol(self):
print("- Reverting to last signed APFS snapshot")
self.elevated(["bless", "--mount", self.mount_location, "--bootefi", "--last-sealed-snapshot"], stdout=subprocess.PIPE).stdout.decode().strip().encode()
if self.constants.detected_os > self.constants.catalina:
print("- Reverting to last signed APFS snapshot")
result = self.elevated(["bless", "--mount", self.mount_location, "--bootefi", "--last-sealed-snapshot"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
if result.returncode != 0:
print("- Unable to revert root volume patches")
print("Reason for unpatch Failure:")
print(result.stdout.decode())
# print("- Failed to revert snapshot via bless, falling back on manual restoration")
# self.undo_root_patch()
else:
print("- Unpatching complete")
print("\nPlease reboot the machine for patches to take effect")
# else:
# self.undo_root_patch()
def rebuild_snapshot(self):
if self.constants.gui_mode is False:
@@ -102,9 +114,11 @@ class PatchSysVolume:
if self.constants.detected_os > self.constants.catalina:
result = self.elevated(["kmutil", "install", "--volume-root", self.mount_location, "--update-all"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
else:
result = self.elevated(["kextcache", "-i", "/"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
result = self.elevated(["kextcache", "-i", f"{self.mount_location}/"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
if result.returncode != 0:
# kextcache always returns 0, even if it fails
# Check the output for 'KernelCache ID' to see if the cache was successfully rebuilt
if result.returncode != 0 or (self.constants.detected_os < self.constants.catalina and "KernelCache ID" not in result.stdout.decode()):
self.success_status = False
print("- Unable to build new kernel cache")
print("\nPlease report this to Github")
@@ -117,16 +131,32 @@ class PatchSysVolume:
else:
self.success_status = True
print("- Successfully built new kernel cache")
if self.constants.gui_mode is False and self.constants.detected_os > self.constants.catalina:
input("Press [ENTER] to continue with snapshotting")
if self.constants.gui_mode is False:
if self.constants.detected_os > self.constants.catalina:
input("Press [ENTER] to continue with snapshotting")
else:
input("Press [ENTER] to continue with kernel and dyld cache merging")
if self.constants.detected_os > self.constants.catalina:
print("- Creating new APFS snapshot")
self.elevated(["bless", "--folder", f"{self.mount_location}/System/Library/CoreServices", "--bootefi", "--create-snapshot"], stdout=subprocess.PIPE).stdout.decode().strip().encode()
self.unmount_drive()
else:
if self.constants.detected_os == self.constants.catalina:
print("- Merging kernel cache")
Utilities.process_status(self.elevated(["kcditto"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
print("- Merging dyld cache")
Utilities.process_status(self.elevated(["update_dyld_shared_cache", "-root", f"{self.mount_location}/"]))
print("- Patching complete")
print("\nPlease reboot the machine for patches to take effect")
if self.amd_ts2 is True:
print(
"""\nPlease note that with ATI TeraScale 2 GPUs, you may experience colour strobing
on reboot. Please use SwitchResX or ResXtreme to force 1 million colours on your
monitor to fix this. If you are epileptic, please ask for someone to aid you or
set million colour before rebooting"""
)
if self.constants.gui_mode is False:
input("Press [ENTER] to continue")
input("\nPress [ENTER] to continue")
def unmount_drive(self):
print("- Unmounting Root Volume (Don't worry if this fails)")
@@ -137,7 +167,7 @@ class PatchSysVolume:
delete_path = Path(self.mount_extensions) / Path(delete_current_kext)
if Path(delete_path).exists():
print(f"- Deleting {delete_current_kext}")
self.elevated(["sudo", "rm", "-R", delete_path], stdout=subprocess.PIPE).stdout.decode().strip().encode()
Utilities.process_status(self.elevated(["rm", "-R", delete_path], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
else:
print(f"- Couldn't find {delete_current_kext}, skipping")
@@ -146,151 +176,216 @@ class PatchSysVolume:
existing_path = Path(self.mount_extensions) / Path(add_current_kext)
if Path(existing_path).exists():
print(f"- Found conflicting kext, Deleting Root Volume's {add_current_kext}")
self.elevated(["rm", "-R", existing_path], stdout=subprocess.PIPE).stdout.decode().strip().encode()
Utilities.process_status(self.elevated(["rm", "-R", existing_path], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
print(f"- Adding {add_current_kext}")
self.elevated(["cp", "-R", f"{vendor_location}/{add_current_kext}", self.mount_extensions], stdout=subprocess.PIPE).stdout.decode().strip().encode()
self.elevated(["chmod", "-Rf", "755", f"{self.mount_extensions}/{add_current_kext}"], stdout=subprocess.PIPE).stdout.decode().strip().encode()
self.elevated(["chown", "-Rf", "root:wheel", f"{self.mount_extensions}/{add_current_kext}"], stdout=subprocess.PIPE).stdout.decode().strip().encode()
Utilities.process_status(self.elevated(["cp", "-R", f"{vendor_location}/{add_current_kext}", self.mount_extensions], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
Utilities.process_status(self.elevated(["chmod", "-Rf", "755", f"{self.mount_extensions}/{add_current_kext}"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
Utilities.process_status(self.elevated(["chown", "-Rf", "root:wheel", f"{self.mount_extensions}/{add_current_kext}"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
def add_brightness_patch(self):
self.delete_old_binaries(SysPatchArray.DeleteBrightness)
self.add_new_binaries(SysPatchArray.AddBrightness, self.constants.legacy_brightness)
self.elevated(["rsync", "-r", "-i", f"{self.constants.payload_apple_private_frameworks_path_brightness}/", self.mount_private_frameworks], stdout=subprocess.PIPE).stdout.decode().strip().encode()
self.elevated(["chmod", "-Rf", "755", f"{self.mount_private_frameworks}/DisplayServices.framework"], stdout=subprocess.PIPE).stdout.decode().strip().encode()
self.elevated(["chown", "-Rf", "root:wheel", f"{self.mount_private_frameworks}/DisplayServices.framework"], stdout=subprocess.PIPE).stdout.decode().strip().encode()
Utilities.process_status(
self.elevated(["rsync", "-r", "-i", "-a", f"{self.constants.payload_apple_private_frameworks_path_brightness}/", self.mount_private_frameworks], stdout=subprocess.PIPE)
)
Utilities.process_status(self.elevated(["chmod", "-Rf", "755", f"{self.mount_private_frameworks}/DisplayServices.framework"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
Utilities.process_status(self.elevated(["chown", "-Rf", "root:wheel", f"{self.mount_private_frameworks}/DisplayServices.framework"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
def add_audio_patch(self):
self.delete_old_binaries(SysPatchArray.DeleteVolumeControl)
self.add_new_binaries(SysPatchArray.AddVolumeControl, self.constants.audio_path)
def gpu_accel_legacy_nvidia_big_sur(self):
self.delete_old_binaries(SysPatchArray.DeleteNvidiaAccel11)
self.add_new_binaries(SysPatchArray.AddGeneralAccel, self.constants.legacy_general_path)
self.add_new_binaries(SysPatchArray.AddNvidiaAccel11, self.constants.legacy_nvidia_path)
def gpu_accel_legacy(self):
if self.constants.detected_os == self.constants.mojave:
print("- Installing General Acceleration Kext patches for Mojave")
self.add_new_binaries(SysPatchArray.AddGeneralAccelMojave, self.constants.legacy_general_path)
elif self.constants.detected_os == self.constants.catalina:
print("- Installing General Acceleration Kext patches for Catalina")
self.add_new_binaries(SysPatchArray.AddGeneralAccelCatalina, self.constants.legacy_general_path)
elif self.constants.detected_os == self.constants.big_sur:
print("- Installing General Acceleration Kext patches for Big Sur")
self.add_new_binaries(SysPatchArray.AddGeneralAccel, self.constants.legacy_general_path)
def gpu_framebuffer_legacy_nvidia(self):
self.add_new_binaries(SysPatchArray.AddNvidiaBrightness, self.constants.legacy_nvidia_path)
# Nvidia
def gpu_accel_legacy_nvidia_master(self):
if self.constants.detected_os in [self.constants.mojave, self.constants.catalina]:
print("- Installing Nvidia Acceleration Kext patches for Mojave/Catalina")
self.gpu_accel_legacy()
self.add_new_binaries(SysPatchArray.AddNvidiaAccelLegacy, self.constants.legacy_nvidia_path)
elif self.constants.detected_os == self.constants.big_sur:
print("- Installing Nvidia Acceleration Kext patches for Big Sur")
self.delete_old_binaries(SysPatchArray.DeleteNvidiaAccel11)
self.gpu_accel_legacy()
self.add_new_binaries(SysPatchArray.AddNvidiaAccel11, self.constants.legacy_nvidia_path)
else:
print("- Installing basic Nvidia Framebuffer Kext patches for generic OS")
self.add_new_binaries(SysPatchArray.AddNvidiaBrightness, self.constants.legacy_nvidia_path)
def gpu_accel_legacy_ts1_big_sur(self):
self.delete_old_binaries(SysPatchArray.DeleteAMDAccel11)
self.add_new_binaries(SysPatchArray.AddGeneralAccel, self.constants.legacy_general_path)
self.add_new_binaries(SysPatchArray.AddAMDAccel11, self.constants.legacy_amd_path)
# AMD/ATI
def gpu_accel_legacy_ts1_master(self):
if self.constants.detected_os in [self.constants.mojave, self.constants.catalina]:
print("- Installing TeraScale 1 Acceleration Kext patches for Mojave/Catalina")
self.gpu_accel_legacy()
self.add_new_binaries(SysPatchArray.AddAMDAccelLegacy, self.constants.legacy_amd_path)
elif self.constants.detected_os == self.constants.big_sur:
print("- Installing TeraScale 1 Acceleration Kext patches for Big Sur")
self.delete_old_binaries(SysPatchArray.DeleteAMDAccel11)
self.gpu_accel_legacy()
self.add_new_binaries(SysPatchArray.AddAMDAccel11, self.constants.legacy_amd_path)
else:
print("- Installing basic TeraScale 1 Framebuffer Kext patches for generic OS")
self.add_new_binaries(SysPatchArray.AddAMDBrightness, self.constants.legacy_amd_path)
def gpu_accel_legacy_ts2_big_sur(self):
self.delete_old_binaries(SysPatchArray.DeleteAMDAccel11)
self.delete_old_binaries(SysPatchArray.DeleteAMDAccel11TS2)
self.add_new_binaries(SysPatchArray.AddGeneralAccel, self.constants.legacy_general_path)
self.add_new_binaries(SysPatchArray.AddAMDAccel11, self.constants.legacy_amd_path)
def gpu_accel_legacy_ts2_master(self):
if self.constants.detected_os in [self.constants.mojave, self.constants.catalina]:
print("- Installing TeraScale 2 Acceleration Kext patches for Mojave/Catalina")
self.gpu_accel_legacy()
self.add_new_binaries(SysPatchArray.AddAMDAccelLegacy, self.constants.legacy_amd_path)
elif self.constants.detected_os == self.constants.big_sur:
print("- Installing TeraScale 2 Acceleration Kext patches for Big Sur")
self.delete_old_binaries(SysPatchArray.DeleteAMDAccel11)
self.delete_old_binaries(SysPatchArray.DeleteAMDAccel11TS2)
self.gpu_accel_legacy()
self.add_new_binaries(SysPatchArray.AddAMDAccel11, self.constants.legacy_amd_path)
else:
print("- Installing basic TeraScale 2 Framebuffer Kext patches for generic OS")
self.add_new_binaries(SysPatchArray.AddAMDBrightness, self.constants.legacy_amd_path)
def gpu_framebuffer_legacy_amd(self):
self.add_new_binaries(SysPatchArray.AddAMDBrightness, self.constants.legacy_amd_path)
# Intel
def gpu_accel_legacy_ironlake_master(self):
if self.constants.detected_os in [self.constants.mojave, self.constants.catalina]:
print("- Installing Ironlake Acceleration Kext patches for Mojave/Catalina")
self.gpu_accel_legacy()
self.add_new_binaries(SysPatchArray.AddIntelGen1Accel, self.constants.legacy_intel_gen1_path)
elif self.constants.detected_os == self.constants.big_sur:
print("- Installing Ironlake Acceleration Kext patches for Big Sur")
self.delete_old_binaries(SysPatchArray.DeleteNvidiaAccel11)
self.gpu_accel_legacy()
self.add_new_binaries(SysPatchArray.AddIntelGen1Accel, self.constants.legacy_intel_gen1_path)
else:
print("- Installing basic Ironlake Framebuffer Kext patches for generic OS")
self.add_new_binaries(SysPatchArray.AddIntelGen1Accel, self.constants.legacy_intel_gen1_path)
def gpu_accel_legacy_ironlake_big_sur(self):
self.delete_old_binaries(SysPatchArray.DeleteNvidiaAccel11)
self.add_new_binaries(SysPatchArray.AddGeneralAccel, self.constants.legacy_general_path)
self.add_new_binaries(SysPatchArray.AddIntelGen1Accel, self.constants.legacy_intel_gen1_path)
def gpu_accel_legacy_sandybridge_master(self):
if self.constants.detected_os in [self.constants.mojave, self.constants.catalina]:
print("- Installing Sandy Bridge Acceleration Kext patches for Mojave/Catalina")
self.gpu_accel_legacy()
self.add_new_binaries(SysPatchArray.AddIntelGen2Accel, self.constants.legacy_intel_gen2_path)
elif self.constants.detected_os == self.constants.big_sur:
print("- Installing Sandy Bridge Acceleration Kext patches for Big Sur")
self.delete_old_binaries(SysPatchArray.DeleteNvidiaAccel11)
self.gpu_accel_legacy()
self.add_new_binaries(SysPatchArray.AddIntelGen2Accel, self.constants.legacy_intel_gen2_path)
else:
print("- Installing basic Sandy Bridge Framebuffer Kext patches for generic OS")
self.add_new_binaries(SysPatchArray.AddIntelGen2Accel, self.constants.legacy_intel_gen2_path)
def gpu_framebuffer_legacy_ironlake(self):
self.add_new_binaries(SysPatchArray.AddIntelGen1Accel, self.constants.legacy_intel_gen1_path)
def gpu_accel_legacy_sandybridge_big_sur(self):
self.delete_old_binaries(SysPatchArray.DeleteNvidiaAccel11)
self.add_new_binaries(SysPatchArray.AddGeneralAccel, self.constants.legacy_general_path)
self.add_new_binaries(SysPatchArray.AddIntelGen2Accel, self.constants.legacy_intel_gen2_path)
def gpu_framebuffer_legacy_sandybridge(self):
self.add_new_binaries(SysPatchArray.AddIntelGen2Accel, self.constants.legacy_intel_gen1_path)
def gpu_framebuffer_ivybridge_big_sur(self):
self.add_new_binaries(SysPatchArray.AddIntelGen3Accel, self.constants.legacy_intel_gen3_path)
print("- Fixing Acceleration in CoreMedia")
subprocess.run(["defaults", "write", "com.apple.coremedia", "hardwareVideoDecoder", "-string", "disable"], stdout=subprocess.PIPE).stdout.decode().strip().encode()
print("- Merging Ivy Bridge Frameworks")
self.elevated(["rsync", "-r", "-i", f"{self.constants.payload_apple_frameworks_path_accel_ivy}/", self.mount_frameworks], stdout=subprocess.PIPE).stdout.decode().strip().encode()
def gpu_framebuffer_ivybridge_master(self):
if self.constants.detected_os == self.constants.monterey:
print("- Installing IvyBridge Acceleration Kext patches for Monterey")
self.add_new_binaries(SysPatchArray.AddIntelGen3Accel, self.constants.legacy_intel_gen3_path)
print("- Fixing Acceleration in CoreMedia")
Utilities.process_status(subprocess.run(["defaults", "write", "com.apple.coremedia", "hardwareVideoDecoder", "-string", "enable"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
print("- Merging Ivy Bridge Frameworks")
Utilities.process_status(
self.elevated(["rsync", "-r", "-i", "-a", f"{self.constants.payload_apple_frameworks_path_accel_ivy}/", self.mount_frameworks], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
)
print("- Merging Ivy Bridge PrivateFrameworks")
Utilities.process_status(
self.elevated(["rsync", "-r", "-i", "-a", f"{self.constants.payload_apple_private_frameworks_path_accel_ivy}/", self.mount_private_frameworks], stdout=subprocess.PIPE)
)
else:
print("- Installing basic Ivy Bridge Kext patches for generic OS")
self.add_new_binaries(SysPatchArray.AddIntelGen3Accel, self.constants.legacy_intel_gen3_path)
def gpu_accel_legacy_extended(self):
print("- Merging general legacy Frameworks")
self.elevated(["rsync", "-r", "-i", f"{self.constants.payload_apple_frameworks_path_accel}/", self.mount_frameworks], stdout=subprocess.PIPE).stdout.decode().strip().encode()
if Path(self.mount_lauchd / Path("HiddHack.plist")).exists():
print("- Removing legacy HiddHack")
self.elevated(["rm", f"{self.mount_lauchd}/HiddHack.plist"], stdout=subprocess.PIPE).stdout.decode().strip().encode()
print("- Adding IOHID-Fixup.plist")
self.elevated(["rsync", "-r", "-i", f"{self.constants.payload_apple_lauchd_path_accel}/", self.mount_lauchd], stdout=subprocess.PIPE).stdout.decode().strip().encode()
self.elevated(["chmod", "755", f"{self.mount_lauchd}/IOHID-Fixup.plist"], stdout=subprocess.PIPE).stdout.decode().strip().encode()
self.elevated(["chown", "root:wheel", f"{self.mount_lauchd}/IOHID-Fixup.plist"], stdout=subprocess.PIPE).stdout.decode().strip().encode()
Utilities.process_status(
self.elevated(["rsync", "-r", "-i", "-a", f"{self.constants.payload_apple_frameworks_path_accel}/", self.mount_frameworks], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
)
print("- Merging general legacy PrivateFrameworks")
self.elevated(["rsync", "-r", "-i", f"{self.constants.payload_apple_private_frameworks_path_accel}/", self.mount_private_frameworks], stdout=subprocess.PIPE).stdout.decode().strip().encode()
Utilities.process_status(self.elevated(["rsync", "-r", "-i", "-a", f"{self.constants.payload_apple_private_frameworks_path_accel}/", self.mount_private_frameworks], stdout=subprocess.PIPE))
if self.constants.detected_os > self.constants.catalina:
print("- Adding IOHID-Fixup.plist")
Utilities.process_status(
self.elevated(["rsync", "-r", "-i", "-a", f"{self.constants.payload_apple_lauchd_path_accel}/", self.mount_lauchd], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
)
Utilities.process_status(self.elevated(["chmod", "755", f"{self.mount_lauchd}/IOHID-Fixup.plist"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
Utilities.process_status(self.elevated(["chown", "root:wheel", f"{self.mount_lauchd}/IOHID-Fixup.plist"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
def gpu_accel_legacy_extended_ts2(self):
print("- Merging TeraScale 2 legacy Frameworks")
self.elevated(["rsync", "-r", "-i", f"{self.constants.payload_apple_frameworks_path_accel_ts2}/", self.mount_frameworks], stdout=subprocess.PIPE).stdout.decode().strip().encode()
Utilities.process_status(
self.elevated(["rsync", "-r", "-i", "-a", f"{self.constants.payload_apple_frameworks_path_accel_ts2}/", self.mount_frameworks], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
)
print("- Merging TeraScale 2 PrivateFrameworks")
self.elevated(["rsync", "-r", "-i", f"{self.constants.payload_apple_private_frameworks_path_accel_ts2}/", self.mount_private_frameworks], stdout=subprocess.PIPE).stdout.decode().strip().encode()
Utilities.process_status(
self.elevated(["rsync", "-r", "-i", "-a", f"{self.constants.payload_apple_private_frameworks_path_accel_ts2}/", self.mount_private_frameworks], stdout=subprocess.PIPE)
)
print("- Fixing Acceleration in CMIO")
subprocess.run(["defaults", "write", "com.apple.cmio", "CMIO_Unit_Input_ASC.DoNotUseOpenCL", "-bool", "true"], stdout=subprocess.PIPE).stdout.decode().strip().encode()
Utilities.process_status(subprocess.run(["defaults", "write", "com.apple.cmio", "CMIO_Unit_Input_ASC.DoNotUseOpenCL", "-bool", "true"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
def patch_root_vol(self):
print(f"- Running patches for {self.model}")
# Graphics patches
if self.nvidia_legacy is True:
print("- Installing legacy Nvidia Patches")
if self.constants.detected_os == self.constants.big_sur:
print("- Detected Big Sur, installing Acceleration patches")
self.gpu_accel_legacy_nvidia_big_sur()
self.added_kexts = True
if self.constants.detected_os in self.constants.legacy_accel_support:
print("- Detected supported OS, installing Acceleration Patches")
self.added_legacy_kexts = True
else:
print("- Detected unsupported OS, installing Basic Framebuffer")
self.gpu_framebuffer_legacy_nvidia()
self.gpu_accel_legacy_nvidia_master()
if self.amd_ts1 is True:
elif self.amd_ts1 is True:
print("- Installing legacy TeraScale 1 Patches")
if self.constants.detected_os == self.constants.big_sur:
print("- Detected Big Sur, installing Acceleration patches")
self.gpu_accel_legacy_ts1_big_sur()
self.added_kexts = True
if self.constants.detected_os in self.constants.legacy_accel_support:
print("- Detected supported OS, installing Acceleration Patches")
self.added_legacy_kexts = True
else:
print("- Detected unsupported OS, installing Basic Framebuffer")
self.gpu_framebuffer_legacy_amd()
self.gpu_accel_legacy_ts1_master()
if self.amd_ts2 is True:
elif self.amd_ts2 is True:
print("- Installing legacy TeraScale 2 Patches")
if self.constants.detected_os == self.constants.big_sur:
print("- Detected Big Sur, installing Acceleration patches")
self.gpu_accel_legacy_ts2_big_sur()
self.added_kexts = True
if self.constants.detected_os in self.constants.legacy_accel_support:
print("- Detected supported OS, installing Acceleration Patches")
self.added_legacy_kexts = True
else:
print("- Detected unsupported OS, installing Basic Framebuffer")
self.gpu_framebuffer_legacy_amd()
self.gpu_accel_legacy_ts2_master()
if self.iron_gpu is True:
print("- Installing legacy Ironlake Patches")
if self.constants.detected_os == self.constants.big_sur:
print("- Detected Big Sur, installing Acceleration patches")
self.gpu_accel_legacy_ironlake_big_sur()
self.added_kexts = True
if self.constants.detected_os in self.constants.legacy_accel_support:
print("- Detected supported OS, installing Acceleration Patches")
self.added_legacy_kexts = True
else:
print("- Detected unsupported OS, installing Basic Framebuffer")
self.gpu_framebuffer_legacy_ironlake()
self.gpu_accel_legacy_ironlake_master()
if self.sandy_gpu is True:
elif self.sandy_gpu is True:
print("- Installing legacy Sandy Bridge Patches")
if self.constants.detected_os == self.constants.big_sur:
print("- Detected Big Sur, installing Acceleration patches")
self.gpu_accel_legacy_sandybridge_big_sur()
self.added_kexts = True
if self.constants.detected_os in self.constants.legacy_accel_support:
print("- Detected supported OS, installing Acceleration Patches")
self.added_legacy_kexts = True
else:
print("- Detected unsupported OS, installing Basic Framebuffer")
self.gpu_framebuffer_legacy_sandybridge()
self.gpu_accel_legacy_sandybridge_master()
if self.ivy_gpu is True:
elif self.ivy_gpu is True:
print("- Installing Ivy Bridge Patches")
self.gpu_framebuffer_ivybridge_big_sur()
if self.constants.detected_os == self.constants.monterey:
print("- Detected supported OS, installing Acceleration Patches")
else:
print("- Detected unsupported OS, installing Basic Framebuffer")
self.gpu_framebuffer_ivybridge_master()
if self.amd_ts2 is True:
if self.amd_ts2 is True and self.constants.detected_os in self.constants.legacy_accel_support:
# TeraScale 2 patches must be installed after Intel HD3000
self.add_new_binaries(SysPatchArray.AddAMDAccel11TS2, self.constants.legacy_amd_path_ts2)
if self.added_kexts is True:
if self.added_legacy_kexts is True and self.constants.detected_os in self.constants.legacy_accel_support:
self.gpu_accel_legacy_extended()
if self.amd_ts2 is True:
self.gpu_accel_legacy_extended_ts2()
@@ -329,6 +424,8 @@ class PatchSysVolume:
os_ver = "10.15-Catalina"
elif self.constants.detected_os == self.constants.mojave:
os_ver = "10.14-Mojave"
else:
raise Exception(f"Unsupported OS: {self.constants.detected_os}")
link = f"{self.constants.url_patcher_support_pkg}{self.constants.patcher_support_pkg_version}/{os_ver}.zip"
if Path(self.constants.payload_apple_root_path).exists():
@@ -344,7 +441,7 @@ class PatchSysVolume:
print("- Download completed")
print("- Unzipping download...")
try:
subprocess.run(["unzip", self.constants.payload_apple_root_path_zip], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, cwd=self.constants.payload_path).stdout.decode()
Utilities.process_status(subprocess.run(["unzip", self.constants.payload_apple_root_path_zip], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, cwd=self.constants.payload_path))
print("- Renaming folder")
os.rename(self.constants.payload_path / Path(os_ver), self.constants.payload_apple_root_path)
Path(self.constants.payload_apple_root_path_zip).unlink()
@@ -359,40 +456,44 @@ class PatchSysVolume:
print("- Download failed, please verify the below link works:")
print(link)
input("Press [ENTER] to continue")
def detect_gpus(self):
dgpu = self.constants.computer.dgpu
igpu = self.constants.computer.igpu
if self.constants.moj_cat_accel is True:
non_metal_os = self.constants.high_sierra
else:
non_metal_os = self.constants.catalina
if dgpu:
print(f"- Found GFX0: {Utilities.friendly_hex(dgpu.vendor_id)}:{Utilities.friendly_hex(dgpu.device_id)}")
if dgpu.arch in [device_probe.NVIDIA.Archs.Tesla, device_probe.NVIDIA.Archs.Fermi]:
if self.constants.detected_os > self.constants.catalina:
if self.constants.detected_os > non_metal_os:
self.nvidia_legacy = True
self.amfi_must_disable = True
elif dgpu.arch == device_probe.AMD.Archs.TeraScale_1:
if self.constants.detected_os > self.constants.catalina:
if self.constants.detected_os > non_metal_os:
self.amd_ts1 = True
self.amfi_must_disable = True
# TODO: Enable TS2 support
elif dgpu.arch == device_probe.AMD.Archs.TeraScale_2:
# Requires manual permission from user to avoid medical issues
if self.constants.detected_os > self.constants.catalina and self.constants.terascale_2_patch is True:
if self.constants.detected_os > non_metal_os:
self.amd_ts2 = True
self.amfi_must_disable = True
if igpu and igpu.class_code != 0xFFFFFF:
print(f"- Found IGPU: {Utilities.friendly_hex(igpu.vendor_id)}:{Utilities.friendly_hex(igpu.device_id)}")
if igpu.arch == device_probe.Intel.Archs.Iron_Lake:
if self.constants.detected_os > self.constants.catalina:
if self.constants.detected_os > non_metal_os:
self.iron_gpu = True
self.amfi_must_disable = True
elif igpu.arch == device_probe.Intel.Archs.Sandy_Bridge:
if self.constants.detected_os > self.constants.catalina:
if self.constants.detected_os > non_metal_os:
self.sandy_gpu = True
self.amfi_must_disable = True
self.check_board_id = True
elif igpu.arch == device_probe.Intel.Archs.Ivy_Bridge:
if self.constants.detected_os > self.constants.big_sur:
self.ivy_gpu = True
elif isinstance(igpu, device_probe.NVIDIA):
if self.constants.detected_os > self.constants.catalina:
if self.constants.detected_os > non_metal_os:
self.nvidia_legacy = True
self.amfi_must_disable = True
@@ -439,14 +540,20 @@ class PatchSysVolume:
)
def verify_patch_allowed(self):
self.sip_enabled, self.sbm_enabled, self.amfi_enabled, self.fv_enabled = Utilities.patching_status()
sip = self.constants.root_patch_sip_big_sur if self.constants.detected_os > self.constants.catalina else self.constants.root_patch_sip_mojave
if sip == self.constants.root_patch_sip_mojave:
sip_value = "For Hackintoshes, please set csr-active-config to '03060000' (0x603)\nFor non-OpenCore Macs, please run 'csrutil disable' in RecoveryOS"
else:
sip_value = (
"For Hackintoshes, please set csr-active-config to '030A0000' (0xA03)\nFor non-OpenCore Macs, please run 'csrutil disable' and \n'csrutil authenticated-root disable' in RecoveryOS"
)
self.sip_enabled, self.sbm_enabled, self.amfi_enabled, self.fv_enabled, self.dosdude_patched = Utilities.patching_status(sip)
if self.sip_enabled is True:
print("\nCannot patch! Please disable System Integrity Protection (SIP).")
print("Disable SIP in Patcher Settings and Rebuild OpenCore\n")
print("Ensure the following bits are set for csr-active-config:")
print("\n".join(self.constants.root_patch_sip_big_sur if self.constants.detected_os > self.constants.catalina else self.constants.root_patch_sip_mojave))
print("For Hackintoshes, please set csr-active-config to '030A0000' (0xA03)")
print("For non-OpenCore Macs, please run 'csrutil disable' and \n'csrutil authenticated-root disable' in RecoveryOS")
print("\n".join(sip))
print(sip_value)
if self.sbm_enabled is True:
print("\nCannot patch! Please disable Apple Secure Boot.")
@@ -461,7 +568,20 @@ class PatchSysVolume:
print("\nCannot patch! Please disable AMFI.")
print("For Hackintoshes, please add amfi_get_out_of_my_way=1 to boot-args")
if any([self.sip_enabled, self.sbm_enabled, self.fv_enabled, self.amfi_enabled if self.amfi_must_disable else False]):
if self.check_board_id is True and self.computer.reported_board_id not in self.constants.sandy_board_id:
print("\nCannot patch! Board ID not supported by AppleIntelSNBGraphicsFB")
print(f"Detected Board ID: {self.computer.reported_board_id}")
print("Please ensure your Board ID is listed below:")
print("\n".join(self.constants.sandy_board_id))
self.bad_board_id = True
if self.dosdude_patched is True:
print("\nCannot patch! Detected machine has already been patched by another patcher")
print("Please ensure your install is either clean or patched with OpenCore Legacy Patcher")
if any(
[self.sip_enabled, self.sbm_enabled, self.fv_enabled, self.dosdude_patched, self.amfi_enabled if self.amfi_must_disable else False, self.bad_board_id if self.check_board_id else False]
):
return False
else:
return True
@@ -471,16 +591,16 @@ class PatchSysVolume:
print("- Starting Patch Process")
print(f"- Determinging Required Patch set for Darwin {self.constants.detected_os}")
self.detect_patch_set()
if self.no_patch is False and self.constants.gui_mode is False:
change_menu = input("Would you like to continue with Root Volume Patching?(y/n): ")
elif self.constants.gui_mode is True:
change_menu = "y"
print("Continuing root patching")
else:
if self.no_patch is True:
change_menu = None
print("- No Root Patches required for your machine!")
if self.constants.gui_mode is False:
input("\nPress [ENTER] to return to the main menu: ")
elif self.constants.gui_mode is False:
change_menu = input("Would you like to continue with Root Volume Patching?(y/n): ")
else:
change_menu = "y"
print("Continuing root patching")
if change_menu in ["y", "Y"]:
print("- Continuing with Patching")
print("- Verifying whether Root Patching possible")

View File

@@ -140,6 +140,7 @@ AddAMDBrightness = [
AddAMDAccel11TS2 = [
"IOSurface.kext",
"IOAcceleratorFamily2.kext",
]
AddIntelGen1Accel = [
@@ -190,3 +191,57 @@ DeleteVolumeControl = [
"ApplePVPanic.kext",
"AppleVirtIOStorage.kext",
]
AddNvidiaAccelLegacy = [
"GeForceGA.bundle",
"GeForceTesla.kext",
"GeForceTeslaGLDriver.bundle",
"GeForceTeslaVADriver.bundle",
"NVDANV50HalTesla.kext",
"NVDAResmanTesla.kext",
]
AddAMDAccelLegacy = [
"AMD2400Controller.kext",
"AMD2600Controller.kext",
"AMD3800Controller.kext",
"AMD4600Controller.kext",
"AMD4800Controller.kext",
"AMD5000Controller.kext",
"AMD6000Controller.kext",
"AMDFramebuffer.kext",
"AMDLegacyFramebuffer.kext",
"AMDLegacySupport.kext",
"AMDRadeonVADriver.bundle",
"AMDRadeonVADriver2.bundle",
"AMDRadeonX3000.kext",
"AMDRadeonX3000GLDriver.bundle",
"AMDRadeonX4000HWServices.kext",
"AMDRadeonX4000.kext",
"AMDRadeonX4000GLDriver.bundle",
"AMDShared.bundle",
"AMDSupport.kext",
"ATIRadeonX2000.kext",
"ATIRadeonX2000GA.plugin",
"ATIRadeonX2000GLDriver.bundle",
"ATIRadeonX2000VADriver.bundle",
]
AddGeneralAccelCatalina = [
"AppleGraphicsControl.kext",
"AppleGraphicsPowerManagement.kext",
"AppleMCCSControl.kext",
"IOGraphicsFamily.kext",
"IONDRVSupport.kext",
"IOSurface.kext",
]
AddGeneralAccelMojave = [
"IONDRVSupport.kext",
"AppleGraphicsControl.kext",
"AppleGraphicsPowerManagement.kext",
"AppleMCCSControl.kext",
"IOAccelerator2D.plugin",
"IOAcceleratorFamily2.kext",
"IOGraphicsFamily.kext",
]

View File

@@ -1,16 +1,17 @@
# Copyright (C) 2020-2021, Dhinak G
from __future__ import print_function
import os
import hashlib
import math
from pathlib import Path
import os
import plistlib
import subprocess
import requests
import hashlib
from pathlib import Path
import re
import os
import requests
from Resources import Constants
from Resources import Constants, ioreg
def hexswap(input_hex: str):
@@ -20,6 +21,21 @@ def hexswap(input_hex: str):
return hex_str.upper()
def process_status(process_result):
if process_result.returncode != 0:
print(f"Process failed with exit code {process_result.returncode}")
print(f"Please file an issue on our Github")
raise Exception(f"Process result: \n{process_result.stdout.decode()}")
def human_fmt(num):
for unit in ["B", "KB", "MB", "GB", "TB", "PB"]:
if abs(num) < 1000.0:
return "%3.1f %s" % (num, unit)
num /= 1000.0
return "%.1f %s" % (num, "EB")
def header(lines):
lines = [i for i in lines if i is not None]
total_length = len(max(lines, key=len)) + 4
@@ -49,7 +65,28 @@ def get_disk_path():
return root_mount_path
def csr_decode(csr_active_config):
def latebloom_detection(model):
if model in ["MacPro4,1", "MacPro5,1", "iMac7,1", "iMac8,1"]:
# These machines are more likely to experience boot hangs, increase delays to accomodate
lb_delay = "250"
else:
lb_delay = "100"
lb_range = "1"
lb_debug = "1"
if get_nvram("boot-args", decode=False):
if "latebloom=" in get_nvram("boot-args", decode=False):
lb_delay = re.search(r"(?:[, ])latebloom=(\d+)", get_nvram("boot-args", decode=False))
lb_delay = lb_delay[1]
if "lb_range=" in get_nvram("boot-args", decode=False):
lb_range = re.search(r"(?:[, ])lb_range=(\d+)", get_nvram("boot-args", decode=False))
lb_range = lb_range[1]
if "lb_debug=" in get_nvram("boot-args", decode=False):
lb_debug = re.search(r"(?:[, ])lb_debug=(\d+)", get_nvram("boot-args", decode=False))
lb_debug = lb_debug[1]
return int(lb_delay), int(lb_range), int(lb_debug)
def csr_decode(csr_active_config, os_sip):
if csr_active_config is None:
csr_active_config = b"\x00\x00\x00\x00"
sip_int = int.from_bytes(csr_active_config, byteorder="little")
@@ -60,7 +97,7 @@ def csr_decode(csr_active_config):
i = i + 1
# Can be adjusted to whatever OS needs patching
sip_needs_change = all(Constants.Constants.csr_values[i] for i in Constants.Constants.root_patch_sip_big_sur)
sip_needs_change = all(Constants.Constants.csr_values[i] for i in os_sip)
if sip_needs_change is True:
return False
else:
@@ -71,29 +108,41 @@ def friendly_hex(integer: int):
return "{:02X}".format(integer)
def patching_status():
def amfi_status():
amfi_1 = "amfi_get_out_of_my_way=0x1"
amfi_2 = "amfi_get_out_of_my_way=1"
if get_nvram("boot-args", decode=False) and (amfi_1 in get_nvram("boot-args", decode=False) or amfi_2 in get_nvram("boot-args", decode=False)):
return False
return True
def patching_status(os_sip):
# Detection for Root Patching
sip_enabled = True # System Integrity Protection
sbm_enabled = True # Secure Boot Status (SecureBootModel)
amfi_enabled = True # Apple Mobile File Integrity
fv_enabled = True # FileVault
dosdude_patched = True
amfi_1 = "amfi_get_out_of_my_way=0x1"
amfi_2 = "amfi_get_out_of_my_way=1"
gen6_kext = "/System/Library/Extension/AppleIntelHDGraphics.kext"
gen7_kext = "/System/Library/Extension/AppleIntelHD3000Graphics.kext"
amfi_enabled = amfi_status()
if get_nvram("boot-args", decode=False) and amfi_1 in get_nvram("boot-args", decode=False) or amfi_2 in get_nvram("boot-args", decode=False):
amfi_enabled = False
if get_nvram("HardwareModel", "94B73556-2197-4702-82A8-3E1337DAFBFB", decode=False) not in Constants.Constants.sbm_values:
sbm_enabled = False
if get_nvram("csr-active-config", decode=False) and csr_decode(get_nvram("csr-active-config", decode=False)) is False:
if get_nvram("csr-active-config", decode=False) and csr_decode(get_nvram("csr-active-config", decode=False), os_sip) is False:
sip_enabled = False
fv_status: str = subprocess.run("fdesetup status".split(), stdout=subprocess.PIPE, stderr=subprocess.STDOUT).stdout.decode()
if fv_status.startswith("FileVault is Off"):
fv_enabled = False
return sip_enabled, sbm_enabled, amfi_enabled, fv_enabled
if not (Path(gen6_kext).exists() and Path(gen7_kext).exists()):
dosdude_patched = False
return sip_enabled, sbm_enabled, amfi_enabled, fv_enabled, dosdude_patched
clear = True
@@ -121,12 +170,19 @@ def get_nvram(variable: str, uuid: str = None, *, decode: bool = False):
uuid += ":"
else:
uuid = ""
result = subprocess.run(f"nvram -x {uuid}{variable}".split(), stdout=subprocess.PIPE, stderr=subprocess.PIPE).stdout.strip()
try:
value = plistlib.loads(result)[f"{uuid}{variable}"]
except plistlib.InvalidFileException:
nvram = ioreg.IORegistryEntryFromPath(ioreg.kIOMasterPortDefault, "IODeviceTree:/options".encode())
value = ioreg.IORegistryEntryCreateCFProperty(nvram, f"{uuid}{variable}", ioreg.kCFAllocatorDefault, ioreg.kNilOptions)
ioreg.IOObjectRelease(nvram)
if not value:
return None
if decode:
value = ioreg.corefoundation_to_native(value)
if decode and isinstance(value, bytes):
value = value.strip(b"\0").decode()
return value

View File

@@ -1,10 +1,14 @@
# Hardware probing
# Copyright (C) 2020-2021, Dhinak G, Mykola Grymalyuk
from __future__ import annotations
import binascii
import enum
import itertools
import plistlib
import subprocess
from dataclasses import dataclass, field
from typing import Any, ClassVar, Optional, Type
from typing import Any, ClassVar, Optional, Type, Union
from Resources import PCIIDArray, Utilities, ioreg
@@ -34,15 +38,16 @@ class PCIDevice:
# return state
@classmethod
def from_ioregistry(cls, entry: ioreg.IORegistryEntry, anti_spoof=False):
if anti_spoof and "IOName" in entry.properties:
vendor_id, device_id = (int(i, 16) for i in entry.properties["IOName"][3:].split(","))
def from_ioregistry(cls, entry: ioreg.io_registry_entry_t, anti_spoof=False):
properties: dict = ioreg.corefoundation_to_native(ioreg.IORegistryEntryCreateCFProperties(entry, None, ioreg.kCFAllocatorDefault, ioreg.kNilOptions)[1]) # type: ignore
if anti_spoof and "IOName" in properties:
vendor_id, device_id = (int(i, 16) for i in properties["IOName"][3:].split(","))
else:
vendor_id, device_id = [int.from_bytes(entry.properties[i][:4], byteorder="little") for i in ["vendor-id", "device-id"]]
vendor_id, device_id = [int.from_bytes(properties[i][:4], byteorder="little") for i in ["vendor-id", "device-id"]]
device = cls(vendor_id, device_id, int.from_bytes(entry.properties["class-code"][:6], byteorder="little"), name=entry.name)
if "model" in entry.properties:
device.model = entry.properties["model"].strip(b"\0").decode()
device = cls(vendor_id, device_id, int.from_bytes(properties["class-code"][:6], byteorder="little"), name=ioreg.io_name_t_to_str(ioreg.IORegistryEntryGetName(entry, None)[1]))
if "model" in properties:
device.model = properties["model"].strip(b"\0").decode()
device.populate_pci_path(entry)
return device
@@ -67,23 +72,27 @@ class PCIDevice:
# # Eventually
# raise NotImplementedError
def populate_pci_path(self, entry: ioreg.IORegistryEntry):
def populate_pci_path(self, original_entry: ioreg.io_registry_entry_t):
# Based off gfxutil logic, seems to work.
paths = []
entry = original_entry
while entry:
if entry.entry_class == "IOPCIDevice":
location = [hex(int(i, 16)) for i in entry.location.split(",") + ["0"]]
if ioreg.IOObjectConformsTo(entry, "IOPCIDevice".encode()):
location = [hex(int(i, 16)) for i in ioreg.io_name_t_to_str(ioreg.IORegistryEntryGetLocationInPlane(entry, "IOService".encode(), None)[1]).split(",") + ["0"]]
paths.append(f"Pci({location[0]},{location[1]})")
elif entry.entry_class == "IOACPIPlatformDevice":
paths.append(f"PciRoot({hex(int(entry.properties.get('_UID', 0)))})")
elif ioreg.IOObjectConformsTo(entry, "IOACPIPlatformDevice".encode()):
paths.append(f"PciRoot({hex(int(ioreg.corefoundation_to_native(ioreg.IORegistryEntryCreateCFProperty(entry, '_UID', ioreg.kCFAllocatorDefault, ioreg.kNilOptions)) or 0))})") # type: ignore
break
elif entry.entry_class in ["IOPCI2PCIBridge", "IOPCIBridge", "AppleACPIPCI"]:
elif ioreg.IOObjectConformsTo(entry, "IOPCIBridge".encode()):
pass
else:
# There's something in between that's not PCI! Abort
paths = []
break
entry = entry.parent
parent = ioreg.IORegistryEntryGetParentEntry(entry, "IOService".encode(), None)[1]
if entry != original_entry:
ioreg.IOObjectRelease(entry)
entry = parent
self.pci_path = "/".join(reversed(paths))
@@ -105,10 +114,25 @@ class WirelessCard(PCIDevice):
chipset: enum.Enum = field(init=False)
def __post_init__(self):
system_profiler = plistlib.loads(subprocess.run("system_profiler -xml SPAirPortDataType".split(), stdout=subprocess.PIPE).stdout)
self.country_code = system_profiler[0]["_items"][0]["spairport_airport_interfaces"][0]["spairport_wireless_country_code"]
self.detect_chipset()
@classmethod
def from_ioregistry(cls, entry: ioreg.io_registry_entry_t, anti_spoof=True):
device = super().from_ioregistry(entry, anti_spoof=anti_spoof)
matching_dict = {
"IOParentMatch": ioreg.corefoundation_to_native(ioreg.IORegistryEntryIDMatching(ioreg.IORegistryEntryGetRegistryEntryID(entry, None)[1])),
"IOProviderClass": "IO80211Interface",
}
interface = next(ioreg.ioiterator_to_list(ioreg.IOServiceGetMatchingServices(ioreg.kIOMasterPortDefault, matching_dict, None)[1]), None)
if interface:
device.country_code = ioreg.corefoundation_to_native(ioreg.IORegistryEntryCreateCFProperty(interface, "IO80211CountryCode", ioreg.kCFAllocatorDefault, ioreg.kNilOptions)) # type: ignore # If not present, will be None anyways
else:
device.country_code = None # type: ignore
return device
def detect_chipset(self):
raise NotImplementedError
@@ -118,7 +142,7 @@ class NVMeController(PCIDevice):
CLASS_CODE: ClassVar[int] = 0x010802
aspm: Optional[int] = None
parent_aspm: Optional[int] = None
# parent_aspm: Optional[int] = None
@dataclass
@@ -267,12 +291,11 @@ class Computer:
wifi: Optional[WirelessCard] = None
cpu: Optional[CPU] = None
oclp_version: Optional[str] = None
ioregistry: Optional[ioreg.IOReg] = None
opencore_version: Optional[str] = None
@staticmethod
def probe():
computer = Computer()
computer.ioregistry = ioreg.IOReg()
computer.gpu_probe()
computer.dgpu_probe()
computer.igpu_probe()
@@ -284,15 +307,20 @@ class Computer:
def gpu_probe(self):
# Chain together two iterators: one for class code 00000300, the other for class code 00800300
devices = itertools.chain(self.ioregistry.find(property=("class-code", binascii.a2b_hex("00000300"))), self.ioregistry.find(property=("class-code", binascii.a2b_hex("00800300"))))
devices = ioreg.ioiterator_to_list(
ioreg.IOServiceGetMatchingServices(
ioreg.kIOMasterPortDefault, {"IOProviderClass": "IOPCIDevice", "IOPropertyMatch": [{"class-code": binascii.a2b_hex("00000300")}, {"class-code": binascii.a2b_hex("00800300")}]}, None
)[1]
)
for device in devices:
vendor: Type[GPU] = PCIDevice.from_ioregistry(device).vendor_detect(inherits=GPU) # type: ignore
if vendor:
self.gpus.append(vendor.from_ioregistry(device)) # type: ignore
ioreg.IOObjectRelease(device)
def dgpu_probe(self):
device = next(self.ioregistry.find(name="GFX0"), None)
device = next(ioreg.ioiterator_to_list(ioreg.IOServiceGetMatchingServices(ioreg.kIOMasterPortDefault, ioreg.IOServiceNameMatching("GFX0".encode()), None)[1]), None)
if not device:
# No devices
return
@@ -300,9 +328,10 @@ class Computer:
vendor: Type[GPU] = PCIDevice.from_ioregistry(device).vendor_detect(inherits=GPU) # type: ignore
if vendor:
self.dgpu = vendor.from_ioregistry(device) # type: ignore
ioreg.IOObjectRelease(device)
def igpu_probe(self):
device = next(self.ioregistry.find(name="IGPU"), None)
device = next(ioreg.ioiterator_to_list(ioreg.IOServiceGetMatchingServices(ioreg.kIOMasterPortDefault, ioreg.IOServiceNameMatching("IGPU".encode()), None)[1]), None)
if not device:
# No devices
return
@@ -310,63 +339,68 @@ class Computer:
vendor: Type[GPU] = PCIDevice.from_ioregistry(device).vendor_detect(inherits=GPU) # type: ignore
if vendor:
self.igpu = vendor.from_ioregistry(device) # type: ignore
ioreg.IOObjectRelease(device)
def wifi_probe(self):
# result = subprocess.run("ioreg -r -c IOPCIDevice -a -d2".split(), stdout=subprocess.PIPE).stdout.strip()
devices = self.ioregistry.find(property=("class-code", binascii.a2b_hex(Utilities.hexswap(hex(WirelessCard.CLASS_CODE)[2:].zfill(8)))))
# if not result:
# # No devices
# print("A")
# return
# devices = plistlib.loads(result)
# devices = [i for i in devices if i["class-code"] == binascii.a2b_hex("00800200")]
# if not devices:
# # No devices
# print("B")
# return
devices = ioreg.ioiterator_to_list(
ioreg.IOServiceGetMatchingServices(
ioreg.kIOMasterPortDefault,
{"IOProviderClass": "IOPCIDevice", "IOPropertyMatch": {"class-code": binascii.a2b_hex(Utilities.hexswap(hex(WirelessCard.CLASS_CODE)[2:].zfill(8)))}},
None,
)[1]
)
for device in devices:
vendor: Type[WirelessCard] = PCIDevice.from_ioregistry(device, anti_spoof=True).vendor_detect(inherits=WirelessCard) # type: ignore
if vendor:
self.wifi = vendor.from_ioregistry(device, anti_spoof=True) # type: ignore
break
ioreg.IOObjectRelease(device)
def storage_probe(self):
sata_controllers = self.ioregistry.find(entry_class="IOPCIDevice", property=("class-code", binascii.a2b_hex(Utilities.hexswap(hex(SATAController.CLASS_CODE)[2:].zfill(8)))))
nvme_controllers = itertools.chain.from_iterable(
[
# self.ioregistry.find(entry_class="IOPCIDevice", property=("class-code", binascii.a2b_hex(Utilities.hexswap(hex(NVMeController.CLASS_CODE)[2:].zfill(8))))),
self.ioregistry.find(entry_class="IOPCIDevice", children={"entry_class": "IONVMeController"}),
]
sata_controllers = ioreg.ioiterator_to_list(
ioreg.IOServiceGetMatchingServices(
ioreg.kIOMasterPortDefault,
{"IOProviderClass": "IOPCIDevice", "IOPropertyMatch": [{"class-code": binascii.a2b_hex(Utilities.hexswap(hex(SATAController.CLASS_CODE)[2:].zfill(8)))}]},
None,
)[1]
)
nvme_controllers = ioreg.ioiterator_to_list(
ioreg.IOServiceGetMatchingServices(
ioreg.kIOMasterPortDefault, {"IOProviderClass": "IONVMeController", "IOParentMatch": {"IOProviderClass": "IOPCIDevice"}, "IOPropertyMatch": {"IOClass": "IONVMeController"}}, None
)[1]
)
for device in sata_controllers:
self.storage.append(SATAController.from_ioregistry(device))
ioreg.IOObjectRelease(device)
for device in nvme_controllers:
aspm = device.properties.get("pci-aspm-default", 0)
parent = ioreg.IORegistryEntryGetParentEntry(device, "IOService".encode(), None)[1]
ioreg.IOObjectRelease(device)
aspm: Union[int, bytes] = ioreg.corefoundation_to_native(ioreg.IORegistryEntryCreateCFProperty(parent, "pci-aspm-default", ioreg.kCFAllocatorDefault, ioreg.kNilOptions)) or 0 # type: ignore
if isinstance(aspm, bytes):
aspm = int.from_bytes(aspm, byteorder="little")
if device.parent.parent.entry_class == "IOPCIDevice":
parent_aspm = device.parent.parent.properties.get("pci-aspm-default", 0)
if isinstance(parent_aspm, bytes):
parent_aspm = int.from_bytes(parent_aspm, byteorder="little")
else:
parent_aspm = None
controller = NVMeController.from_ioregistry(device)
controller = NVMeController.from_ioregistry(parent)
controller.aspm = aspm
controller.parent_aspm = parent_aspm
if controller.vendor_id != 0x106B:
self.storage.append(controller)
ioreg.IOObjectRelease(parent)
def smbios_probe(self):
# Reported model
entry = next(self.ioregistry.find(name="Root")).children[0]
self.reported_model = entry.properties["model"].strip(b"\0").decode()
self.reported_board_id = entry.properties.get("board-id", entry.properties.get("target-type", b"")).strip(b"\0").decode()
entry = next(ioreg.ioiterator_to_list(ioreg.IOServiceGetMatchingServices(ioreg.kIOMasterPortDefault, ioreg.IOServiceMatching("IOPlatformExpertDevice".encode()), None)[1]))
self.reported_model = ioreg.corefoundation_to_native(ioreg.IORegistryEntryCreateCFProperty(entry, "model", ioreg.kCFAllocatorDefault, ioreg.kNilOptions)).strip(b"\0").decode() # type: ignore
translated = subprocess.run("sysctl -in sysctl.proc_translated".split(), stdout=subprocess.PIPE).stdout.decode()
if translated:
board = "target-type"
else:
board = "board-id"
self.reported_board_id = ioreg.corefoundation_to_native(ioreg.IORegistryEntryCreateCFProperty(entry, board, ioreg.kCFAllocatorDefault, ioreg.kNilOptions)).strip(b"\0").decode() # type: ignore
ioreg.IOObjectRelease(entry)
# Real model
# TODO: We previously had logic for OC users using iMacPro1,1 with incorrect ExposeSensitiveData. Add logic?
@@ -375,6 +409,7 @@ class Computer:
# OCLP version
self.oclp_version = Utilities.get_nvram("OCLP-Version", "4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102", decode=True)
self.opencore_version = Utilities.get_nvram("opencore-version", "4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102", decode=True)
def cpu_probe(self):
self.cpu = CPU(

View File

@@ -1,94 +1,244 @@
# Handle misc CLI menu options
# Copyright (C) 2020-2021, Dhinak G
from __future__ import annotations
import plistlib
import subprocess
import tempfile
from dataclasses import dataclass
from pathlib import Path
from typing import Generator
from xml.parsers.expat import ExpatError
from typing import NewType, Union
import objc
from CoreFoundation import CFRelease, kCFAllocatorDefault # type: ignore # pylint: disable=no-name-in-module
from Foundation import NSBundle # type: ignore # pylint: disable=no-name-in-module
from PyObjCTools import Conversion
IOKit_bundle = NSBundle.bundleWithIdentifier_("com.apple.framework.IOKit")
# pylint: disable=invalid-name
io_name_t_ref_out = b"[128c]" # io_name_t is char[128]
const_io_name_t_ref_in = b"r*"
CFStringRef = b"^{__CFString=}"
CFDictionaryRef = b"^{__CFDictionary=}"
CFAllocatorRef = b"^{__CFAllocator=}"
# pylint: enable=invalid-name
# https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/ObjCRuntimeGuide/Articles/ocrtTypeEncodings.html
functions = [
("IORegistryEntryCreateCFProperties", b"IIo^@" + CFAllocatorRef + b"I"),
("IOServiceMatching", CFDictionaryRef + b"r*"),
("IOServiceGetMatchingServices", b"II" + CFDictionaryRef + b"o^I"),
("IOIteratorNext", b"II"),
("IORegistryEntryGetParentEntry", b"IIr*o^I"),
("IOObjectRelease", b"II"),
("IORegistryEntryGetName", b"IIo" + io_name_t_ref_out),
("IOObjectGetClass", b"IIo" + io_name_t_ref_out),
("IOObjectCopyClass", CFStringRef + b"I"),
("IOObjectCopySuperclassForClass", CFStringRef + CFStringRef),
("IORegistryEntryGetChildIterator", b"IIr*o^I"),
("IORegistryCreateIterator", b"IIr*Io^I"),
("IORegistryEntryCreateIterator", b"IIr*Io^I"),
("IORegistryIteratorEnterEntry", b"II"),
("IORegistryIteratorExitEntry", b"II"),
("IORegistryEntryCreateCFProperty", b"@I" + CFStringRef + CFAllocatorRef + b"I"),
("IORegistryEntryGetPath", b"IIr*oI"),
("IORegistryEntryCopyPath", CFStringRef + b"Ir*"),
("IOObjectConformsTo", b"II" + const_io_name_t_ref_in),
("IORegistryEntryGetLocationInPlane", b"II" + const_io_name_t_ref_in + b"o" + io_name_t_ref_out),
("IOServiceNameMatching", CFDictionaryRef + b"r*"),
("IORegistryEntryGetRegistryEntryID", b"IIo^Q"),
("IORegistryEntryIDMatching", CFDictionaryRef + b"Q"),
("IORegistryEntryFromPath", b"II" + const_io_name_t_ref_in),
]
variables = [("kIOMasterPortDefault", b"I")]
# pylint: disable=invalid-name
pointer = type(None)
kern_return_t = NewType("kern_return_t", int)
boolean_t = int
io_object_t = NewType("io_object_t", object)
io_name_t = bytes
io_string_t = bytes
# io_registry_entry_t = NewType("io_registry_entry_t", io_object_t)
io_registry_entry_t = io_object_t
io_iterator_t = NewType("io_iterator_t", io_object_t)
CFTypeRef = Union[int, float, bytes, dict, list]
IOOptionBits = int
mach_port_t = int
CFAllocatorType = type(kCFAllocatorDefault)
NULL = 0
kIOMasterPortDefault: mach_port_t
kNilOptions: IOOptionBits = NULL
# IOKitLib.h
kIORegistryIterateRecursively = 1
kIORegistryIterateParents = 2
# pylint: enable=invalid-name
@dataclass
class IORegistryEntry:
name: str
entry_class: str
properties: dict
location: str
children: list[IORegistryEntry]
parent: IORegistryEntry
# kern_return_t IORegistryEntryCreateCFProperties(io_registry_entry_t entry, CFMutableDictionaryRef * properties, CFAllocatorRef allocator, IOOptionBits options);
def IORegistryEntryCreateCFProperties(entry: io_registry_entry_t, properties: pointer, allocator: CFAllocatorType, options: IOOptionBits) -> tuple[kern_return_t, dict]: # pylint: disable=invalid-name
raise NotImplementedError
class IOReg:
def __init__(self):
try:
self.ioreg = plistlib.loads(subprocess.run("ioreg -a -l".split(), stdout=subprocess.PIPE).stdout.strip())
except ExpatError:
fd, file_path = tempfile.mkstemp(suffix=".plist")
with open(fd, "wb") as file_obj:
file_obj.write(subprocess.run("ioreg -a -l".split(), stdout=subprocess.PIPE).stdout.strip())
# CFMutableDictionaryRef IOServiceMatching(const char * name);
def IOServiceMatching(name: bytes) -> dict: # pylint: disable=invalid-name
raise NotImplementedError
subprocess.run("plutil -convert binary1".split() + [file_path])
self.ioreg = plistlib.load(Path(file_path).open("rb"))
self.tree = self.recurse(self.ioreg, None)
def recurse(self, entry, parent):
converted = IORegistryEntry(
entry["IORegistryEntryName"],
entry["IOObjectClass"],
{
i: v
for i, v in entry.items()
if i
not in [
"IOServiceBusyState",
"IOServiceBusyTime",
"IOServiceState",
"IORegistryEntryLocation",
"IORegistryEntryName",
"IORegistryEntryID",
"IOObjectClass",
"IORegistryEntryChildren",
"IOObjectRetainCount",
]
},
entry.get("IORegistryEntryLocation"),
[],
parent,
)
# kern_return_t IOServiceGetMatchingServices(mach_port_t masterPort, CFDictionaryRef matching CF_RELEASES_ARGUMENT, io_iterator_t * existing);
def IOServiceGetMatchingServices(masterPort: mach_port_t, matching: dict, existing: pointer) -> tuple[kern_return_t, io_iterator_t]: # pylint: disable=invalid-name
raise NotImplementedError
for i in entry.get("IORegistryEntryChildren", []):
converted.children.append(self.recurse(i, converted))
return converted
# io_object_t IOIteratorNext(io_iterator_t iterator);
def IOIteratorNext(iterator: io_iterator_t) -> io_object_t: # pylint: disable=invalid-name
raise NotImplementedError
def parse_conditions(self, entry: IORegistryEntry, **kwargs):
conditions = []
if "parent" in kwargs:
conditions.append(self.parse_conditions(entry.parent, **kwargs["parent"]))
if "children" in kwargs:
conditions.append(any(self.parse_conditions(i, **kwargs["children"]) for i in entry.children))
if "name" in kwargs:
conditions.append(kwargs["name"] == entry.name)
if "entry_class" in kwargs:
conditions.append(kwargs["entry_class"] == entry.entry_class)
if "key" in kwargs:
conditions.append(kwargs["key"] in entry.properties)
if "property" in kwargs:
conditions.append(kwargs["property"][0] in entry.properties and entry.properties[kwargs["property"][0]] == kwargs["property"][1])
return all(conditions)
# kern_return_t IORegistryEntryGetParentEntry(io_registry_entry_t entry, const io_name_t plane, io_registry_entry_t * parent);
def IORegistryEntryGetParentEntry(entry: io_registry_entry_t, plane: io_name_t, parent: pointer) -> tuple[kern_return_t, io_registry_entry_t]: # pylint: disable=invalid-name
raise NotImplementedError
def find(self, root: IORegistryEntry = None, **kwargs) -> Generator[IORegistryEntry, None, None]:
if not root:
root = self.tree
if not kwargs:
return
# kern_return_t IOObjectRelease(io_object_t object);
def IOObjectRelease(object: io_object_t) -> kern_return_t: # pylint: disable=invalid-name
raise NotImplementedError
if self.parse_conditions(root, **kwargs):
yield root
for i in root.children:
for j in self.find(i, **kwargs):
yield j
# kern_return_t IORegistryEntryGetName(io_registry_entry_t entry, io_name_t name);
def IORegistryEntryGetName(entry: io_registry_entry_t, name: pointer) -> tuple[kern_return_t, bytes]: # pylint: disable=invalid-name
raise NotImplementedError
# kern_return_t IOObjectGetClass(io_object_t object, io_name_t className);
def IOObjectGetClass(object: io_object_t, className: pointer) -> tuple[kern_return_t, bytes]: # pylint: disable=invalid-name
raise NotImplementedError
# CFStringRef IOObjectCopyClass(io_object_t object);
def IOObjectCopyClass(object: io_object_t) -> str: # pylint: disable=invalid-name
raise NotImplementedError
# CFStringRef IOObjectCopySuperclassForClass(CFStringRef classname)
def IOObjectCopySuperclassForClass(classname: str) -> str: # pylint: disable=invalid-name
raise NotImplementedError
# kern_return_t IORegistryEntryGetChildIterator(io_registry_entry_t entry, const io_name_t plane, io_iterator_t * iterator);
def IORegistryEntryGetChildIterator(entry: io_registry_entry_t, plane: io_name_t, iterator: pointer) -> tuple[kern_return_t, io_iterator_t]: # pylint: disable=invalid-name
raise NotImplementedError
# kern_return_t IORegistryCreateIterator(mach_port_t masterPort, const io_name_t plane, IOOptionBits options, io_iterator_t * iterator)
def IORegistryCreateIterator(masterPort: mach_port_t, plane: io_name_t, options: IOOptionBits, iterator: pointer) -> tuple[kern_return_t, io_iterator_t]: # pylint: disable=invalid-name
raise NotImplementedError
# kern_return_t IORegistryEntryCreateIterator(io_registry_entry_t entry, const io_name_t plane, IOOptionBits options, io_iterator_t * iterator)
def IORegistryEntryCreateIterator(entry: io_registry_entry_t, plane: io_name_t, options: IOOptionBits, iterator: pointer) -> tuple[kern_return_t, io_iterator_t]: # pylint: disable=invalid-name
raise NotImplementedError
# kern_return_t IORegistryIteratorEnterEntry(io_iterator_t iterator)
def IORegistryIteratorEnterEntry(iterator: io_iterator_t) -> kern_return_t: # pylint: disable=invalid-name
raise NotImplementedError
# kern_return_t IORegistryIteratorExitEntry(io_iterator_t iterator)
def IORegistryIteratorExitEntry(iterator: io_iterator_t) -> kern_return_t: # pylint: disable=invalid-name
raise NotImplementedError
# CFTypeRef IORegistryEntryCreateCFProperty(io_registry_entry_t entry, CFStringRef key, CFAllocatorRef allocator, IOOptionBits options);
def IORegistryEntryCreateCFProperty(entry: io_registry_entry_t, key: str, allocator: CFAllocatorType, options: IOOptionBits) -> CFTypeRef: # pylint: disable=invalid-name
raise NotImplementedError
# kern_return_t IORegistryEntryGetPath(io_registry_entry_t entry, const io_name_t plane, io_string_t path);
def IORegistryEntryGetPath(entry: io_registry_entry_t, plane: io_name_t, path: pointer) -> tuple[kern_return_t, io_string_t]: # pylint: disable=invalid-name
raise NotImplementedError
# CFStringRef IORegistryEntryCopyPath(io_registry_entry_t entry, const io_name_t plane)
def IORegistryEntryCopyPath(entry: io_registry_entry_t, plane: bytes) -> str: # pylint: disable=invalid-name
raise NotImplementedError
# boolean_t IOObjectConformsTo(io_object_t object, const io_name_t className)
def IOObjectConformsTo(object: io_object_t, className: bytes) -> boolean_t: # pylint: disable=invalid-name
raise NotImplementedError
# kern_return_t IORegistryEntryGetLocationInPlane(io_registry_entry_t entry, const io_name_t plane, io_name_t location)
def IORegistryEntryGetLocationInPlane(entry: io_registry_entry_t, plane: io_name_t, location: pointer) -> tuple[kern_return_t, bytes]: # pylint: disable=invalid-name
raise NotImplementedError
# CFMutableDictionaryRef IOServiceNameMatching(const char * name);
def IOServiceNameMatching(name: bytes) -> dict: # pylint: disable=invalid-name
raise NotImplementedError
# kern_return_t IORegistryEntryGetRegistryEntryID(io_registry_entry_t entry, uint64_t * entryID)
def IORegistryEntryGetRegistryEntryID(entry: io_registry_entry_t, entryID: pointer) -> tuple[kern_return_t, int]: # pylint: disable=invalid-name
raise NotImplementedError
# CFMutableDictionaryRef IORegistryEntryIDMatching(uint64_t entryID);
def IORegistryEntryIDMatching(entryID: int) -> dict: # pylint: disable=invalid-name
raise NotImplementedError
# io_registry_entry_t IORegistryEntryFromPath(mach_port_t mainPort, const io_string_t path)
def IORegistryEntryFromPath(mainPort: mach_port_t, path: io_string_t) -> io_registry_entry_t: # pylint: disable=invalid-name
raise NotImplementedError
objc.loadBundleFunctions(IOKit_bundle, globals(), functions) # type: ignore # pylint: disable=no-member
objc.loadBundleVariables(IOKit_bundle, globals(), variables) # type: ignore # pylint: disable=no-member
def ioiterator_to_list(iterator: io_iterator_t):
# items = []
item = IOIteratorNext(iterator) # noqa: F821
while item:
# items.append(next)
yield item
item = IOIteratorNext(iterator) # noqa: F821
IOObjectRelease(iterator) # noqa: F821
# return items
def corefoundation_to_native(collection):
if collection is None: # nullptr
return None
native = Conversion.pythonCollectionFromPropertyList(collection)
CFRelease(collection)
return native
def native_to_corefoundation(native):
return Conversion.propertyListFromPythonCollection(native)
def io_name_t_to_str(name):
return name.partition(b"\0")[0].decode()
def get_class_inheritance(io_object):
classes = []
cls = IOObjectCopyClass(io_object)
while cls:
# yield cls
classes.append(cls)
CFRelease(cls)
cls = IOObjectCopySuperclassForClass(cls)
return classes

View File

@@ -41,6 +41,18 @@ chmod +x tccplus
./tccplus add Microphone com.hnc.Discord
```
For those who may experience issues with `tccplus`, you can manually patch `com.apple.TCC` to add permissions:
```sh
# get app id (Zoom.us used in example):
$ osascript -e 'id of app "zoom.us"'
# output: us.zoom.xos
$ sudo sqlite3 ~/Library/Application\ Support/com.apple.TCC/TCC.db "INSERT or REPLACE INTO access VALUES('kTCCServiceMicrophone','us.zoom.xos',0,2,0,1,NULL,NULL,NULL,'UNUSED',NULL,0,1541440109);"
$ sudo sqlite3 ~/Library/Application\ Support/com.apple.TCC/TCC.db "INSERT or REPLACE INTO access VALUES('kTCCServiceCamera','us.zoom.xos',0,2,0,1,NULL,NULL,NULL,'UNUSED',NULL,0,1541440109);"
```
## Keyboard Backlight broken
Due to forcing `hidd` into spinning up with the fallback mode enabled, this can break the OS's recognition of backlight keyboards. Thankfully the drivers themselves still do operate so applications such as [LabTick](https://www.macupdate.com/app/mac/22151/lab-tick) are able to set the brightness manually.
@@ -71,4 +83,4 @@ The best way to achieve this is to boot Recovery (or Single User Mode if the dGP
nvram FA4CE28D-B62F-4C99-9CC3-6815686E30F9:gpu-power-prefs=%01%00%00%00
```
This will disable the dGPU and allow graphics acceleration in Big Sur. Note that external display outputs are directly routed to the dGPU and therefore can no longer be used. Solutions such as a [DisplayLink Adapters](https://www.displaylink.com/products/usb-adapters) can work around this limitation.
This will disable the dGPU and allow graphics acceleration in Big Sur. Note that external display outputs are directly routed to the dGPU and therefore can no longer be used. Solutions such as a [DisplayLink Adapters](https://www.displaylink.com/products/usb-adapters) can work around this limitation in theory. However, currently the proprietary DisplayLink driver refuses to function on legacy-patched systems, either resulting in a windowserver crash loop or no output at all.

View File

@@ -14,7 +14,7 @@ With OpenCore Legacy Patcher we recommend users go through the below table to un
| Supported OSes | <span style="color:#30BCD5">10.7-11</span> | <span style="color:red">10.15-11</span> |
| Firmware Patching | <span style="color:#30BCD5">None required</span> | <span style="color:red">Required for models without native APFS support</span> |
| BootCamp Switching | <span style="color:red">Requires EFI Conversion for Start Disk support, otherwise still supported</span> | <span style="color:#30BCD5">Native</span> |
| Legacy GPU Acceleration | <span style="color:#30BCD5">In active development</span>, see Acceleration Progress Tracker: [Link](https://github.com/dortania/OpenCore-Legacy-Patcher/issues/108) | <span style="color:red">Currently not researching</span> |
| Non-Metal GPU Acceleration | <span style="color:#30BCD5">In active development</span>, see Acceleration Progress Tracker: [Link](https://github.com/dortania/OpenCore-Legacy-Patcher/issues/108) | <span style="color:red">Currently not researching</span> |
| El Capitan-era Wifi cards | <span style="color:#30BCD5">Supported</span> | <span style="colorred">Not supported</span> |
| WPA Wireless Support | <span style="color:#30BCD5">Supported</span> | <span style="color:red">Minority may experience issues on early 2013 and older Models</span> |
| Personal Hotspot Support | <span style="color:#30BCD5">Native</span> | <span style="color:red">Often requires extra steps to achieve on early 2013 and older Models</span> |

View File

@@ -9,14 +9,13 @@ This patcher is made of multiple external applications from different people and
* [AirportBrcmFixup](https://github.com/acidanthera/AirportBrcmFixup/blob/master/LICENSE.txt)
* [CPUFriend](https://github.com/acidanthera/CPUFriend/blob/master/LICENSE)
* [RestrictEvents](https://github.com/acidanthera/RestrictEvents/blob/master/LICENSE.txt)
* [NightShiftEnabler](https://github.com/cdf/NightShiftEnabler/blob/master/LICENSE.txt)
* [FeatureUnlock](https://github.com/acidanthera/FeatureUnlock/blob/master/LICENSE.txt)
* [Innie](https://github.com/cdf/Innie/blob/master/LICENSE.txt)
* GPL 2.0
* [NVMeFix](https://github.com/acidanthera/NVMeFix/blob/master/LICENSE.txt)
* All rights reserved to respective authors
* [AAAMouSSE](https://forums.macrumors.com/threads/mp3-1-others-sse-4-2-emulation-to-enable-amd-metal-driver.2206682/) - Syncretic
* [telemetrap](https://forums.macrumors.com/threads/mp3-1-others-sse-4-2-emulation-to-enable-amd-metal-driver.2206682/post-28447707) - Syncretic
* [SidecarFixup](https://github.com/khronokernel/SidecarFixup) - Khronokernel
* Apple Binaries - Apple Inc.
Remaining files within OpenCore Legacy Patcher are copyrighted 2020-2021 Mykola Grymalyuk & Dhinak G. For integration into other projects, please request written permission.

View File

@@ -28,6 +28,7 @@ Below is a list of hardware that currently has issues with Monterey:
### Metal GPUs
* Intel HD4000 iGPUs lost support
* Re-introduced with OpenCore Legacy Patcher v0.1.7
By default these machines require root volume patches to gain graphics acceleration in Monterey. OpenCore Legacy Patcher supports readding support however SIP and FileVault can no longer be enabled due to root patching:
@@ -36,19 +37,6 @@ By default these machines require root volume patches to gain graphics accelerat
* MacBookPro9,x
* MacBookPro10,x
Note: Currently HD 4000 support in Monterey is not perfect, following are broken:
::: details HD 4000 Issues
* Photo Booth app crashing
* Safari sites crash if request camera access
* Full Screen recoding crashing with Screenshot app
* AirPlay to Mac crashes
* Full Screen apps crashes
* Disable "Hide menubar in Full Screen" to avoid crash
:::
### Non-Metal GPUs
* Non-Metal GPUs no longer have working acceleration patches:
@@ -66,7 +54,7 @@ The following machines cannot gain graphics acceleration at all in Monterey, onl
Note: iMac10,1 through iMac12,x can be upgraded with Metal GPUs, [see here for more info](https://forums.macrumors.com/threads/2011-imac-graphics-card-upgrade.1596614/)
## Bluetooth Support Dropped
## Bluetooth Support Dropped
* BRCM2046 and BRCM2070 Bluetooth Chipsets lost support
@@ -79,7 +67,7 @@ The following models lost Bluetooth support in macOS Monterey due to their legac
* MacBookPro8,1 and older
* MacPro5,1 and older
::: details Dropped Firmwares
::: details Dropped Firmwares
Here are the firmwares macOS Monterey Dropped (previously located within IOBluetoothUSBDFU.kext):
@@ -117,4 +105,4 @@ The following models lost Bluetooth support in macOS Monterey due to their legac
* MacBookPro7,1 and older
* MacPro5,1 and older
Note: BCM943224, BCM94331, BCM94360 and BCM943602 are still fully support by OpenCore Legacy Patcher
Note: BCM943224, BCM94331, BCM94360 and BCM943602 are still fully support by OpenCore Legacy Patcher

View File

@@ -34,6 +34,8 @@ For many users, SIP will be enabled by default on build. For Intel HD 4000 users
Note: Machines with non-Metal GPUs cannot enable SIP in Big Sur either due to patched root volume
Note 2: NVRAM may need to be reset to ensure SIP is correctly re-enabled
## Applying Post Install Volume Patches
**Note**: For users who need Post-Install Volume patches for legacy video acceleration support, you **must** disable the following settings in "Patcher Settings" when building and installing your new OpenCore:

View File

@@ -26,7 +26,7 @@ Term | Description
**IOKit** | Backbone of how Kernel Extentions (Kexts) probe and attach onto hardware, starts quickly after kernel initates
**WindowServer** | Backbone of the GUI interface in macOS, one of the first userfacing userspace programs to kick-in
**OTA** | Short for **O**ver **T**he **A**ir, refers to native OS updates via System Preferences like a supported Mac
**DELTA** | Often used with OTA, refers to OS updates that much smaller than full installers (generally ~3GB), note Deltas require the root volume to be unmotified otherwise ~12GB updates will occur.
**DELTA** | Often used with OTA, refers to OS updates that much smaller than full installers (generally ~3GB), note Deltas require the root volume to be unmodified otherwise ~12GB updates will occur.
---
Term | Description
--- | ---

10
merge_gui.py Normal file
View File

@@ -0,0 +1,10 @@
# Updates build version in OCLP-GUI during CI builds
# Copyright (C) 2021 Mykola Grymalyuk
import plistlib
from pathlib import Path
from Resources import Constants
app_path = Path.cwd() / Path ("OpenCore Patcher.app/Contents/Info.plist")
info = plistlib.load(Path(app_path).open("rb"))
info["CFBundleShortVersionString"] = Constants.Constants().patcher_version
plistlib.dump(info, Path(app_path).open("wb"), sort_keys=True)

View File

@@ -169,6 +169,8 @@
<false/>
<key>ResetLogoStatus</key>
<false/>
<key>SyncTableIds</key>
<false/>
</dict>
</dict>
<key>Booter</key>
@@ -240,7 +242,7 @@
<key>MaxKernel</key>
<string></string>
<key>MinKernel</key>
<string></string>
<string>10.0.0</string>
<key>BundlePath</key>
<string>Lilu.kext</string>
<key>ExecutablePath</key>
@@ -276,7 +278,7 @@
<key>MaxKernel</key>
<string></string>
<key>MinKernel</key>
<string></string>
<string>10.0.0</string>
<key>BundlePath</key>
<string>WhateverGreen.kext</string>
<key>ExecutablePath</key>
@@ -294,7 +296,7 @@
<key>MaxKernel</key>
<string></string>
<key>MinKernel</key>
<string></string>
<string>12.0.0</string>
<key>BundlePath</key>
<string>RestrictEvents.kext</string>
<key>ExecutablePath</key>
@@ -312,7 +314,7 @@
<key>MaxKernel</key>
<string></string>
<key>MinKernel</key>
<string></string>
<string>16.0.0</string>
<key>BundlePath</key>
<string>AAAMouSSE.kext</string>
<key>ExecutablePath</key>
@@ -590,42 +592,6 @@
<key>PlistPath</key>
<string>Contents/Info.plist</string>
</dict>
<dict>
<key>Arch</key>
<string>x86_64</string>
<key>Comment</key>
<string>AppleBacklightFixup - Modded Nvidia GPUs</string>
<key>Enabled</key>
<false/>
<key>MaxKernel</key>
<string></string>
<key>MinKernel</key>
<string></string>
<key>BundlePath</key>
<string>AppleBacklightFixup.kext</string>
<key>ExecutablePath</key>
<string>Contents/MacOS/AppleBacklightFixup</string>
<key>PlistPath</key>
<string>Contents/Info.plist</string>
</dict>
<dict>
<key>Arch</key>
<string>x86_64</string>
<key>Comment</key>
<string>NightShiftEnabler</string>
<key>Enabled</key>
<false/>
<key>MaxKernel</key>
<string></string>
<key>MinKernel</key>
<string></string>
<key>BundlePath</key>
<string>NightShiftEnabler.kext</string>
<key>ExecutablePath</key>
<string>Contents/MacOS/NightShiftEnabler</string>
<key>PlistPath</key>
<string>Contents/Info.plist</string>
</dict>
<dict>
<key>Arch</key>
<string>x86_64</string>
@@ -636,7 +602,7 @@
<key>MaxKernel</key>
<string></string>
<key>MinKernel</key>
<string></string>
<string>15.0.0</string>
<key>BundlePath</key>
<string>CPUFriend.kext</string>
<key>ExecutablePath</key>
@@ -654,7 +620,7 @@
<key>MaxKernel</key>
<string></string>
<key>MinKernel</key>
<string></string>
<string>15.0.0</string>
<key>BundlePath</key>
<string>CPUFriendDataProvider.kext</string>
<key>ExecutablePath</key>
@@ -762,7 +728,7 @@
<key>MaxKernel</key>
<string></string>
<key>MinKernel</key>
<string></string>
<string>12.0.0</string>
<key>BundlePath</key>
<string>CpuTscSync.kext</string>
<key>ExecutablePath</key>
@@ -780,7 +746,7 @@
<key>MaxKernel</key>
<string></string>
<key>MinKernel</key>
<string></string>
<string>14.0.0</string>
<key>BundlePath</key>
<string>HibernationFixup.kext</string>
<key>ExecutablePath</key>
@@ -798,7 +764,7 @@
<key>MaxKernel</key>
<string></string>
<key>MinKernel</key>
<string></string>
<string>18.0.0</string>
<key>BundlePath</key>
<string>NVMeFix.kext</string>
<key>ExecutablePath</key>
@@ -810,17 +776,17 @@
<key>Arch</key>
<string>x86_64</string>
<key>Comment</key>
<string>SidecarFixup</string>
<string>FeatureUnlock</string>
<key>Enabled</key>
<false/>
<key>MaxKernel</key>
<string></string>
<key>MinKernel</key>
<string>19.0.0</string>
<string>16.0.0</string>
<key>BundlePath</key>
<string>SidecarFixup.kext</string>
<string>FeatureUnlock.kext</string>
<key>ExecutablePath</key>
<string>Contents/MacOS/SidecarFixup</string>
<string>Contents/MacOS/FeatureUnlock</string>
<key>PlistPath</key>
<string>Contents/Info.plist</string>
</dict>
@@ -938,7 +904,7 @@
<key>BundlePath</key>
<string>DebugEnhancer.kext</string>
<key>Comment</key>
<string></string>
<string>Enhance DEBUG output in system logs</string>
<key>Enabled</key>
<false/>
<key>ExecutablePath</key>
@@ -946,7 +912,25 @@
<key>MaxKernel</key>
<string></string>
<key>MinKernel</key>
<string>12.0.0</string>
<key>PlistPath</key>
<string>Contents/Info.plist</string>
</dict>
<dict>
<key>Arch</key>
<string>x86_64</string>
<key>BundlePath</key>
<string>latebloom.kext</string>
<key>Comment</key>
<string>Work-around PCI race condition</string>
<key>Enabled</key>
<false/>
<key>ExecutablePath</key>
<string>Contents/MacOS/latebloom</string>
<key>MaxKernel</key>
<string></string>
<key>MinKernel</key>
<string>20.4.0</string>
<key>PlistPath</key>
<string>Contents/Info.plist</string>
</dict>
@@ -1076,6 +1060,8 @@
</dict>
<key>Scheme</key>
<dict>
<key>CustomKernel</key>
<false/>
<key>FuzzyMatch</key>
<true/>
<key>KernelArch</key>
@@ -1087,7 +1073,8 @@
<key>Misc</key>
<dict>
<key>BlessOverride</key>
<array/>
<array>
</array>
<key>Boot</key>
<dict>
<key>ConsoleAttributes</key>

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -46,6 +46,7 @@ bad_tools = [
"ResetSystem.efi",
"RtcRw.efi",
"CsrUtil.efi",
"TpmInfo.efi",
]
for version in build_types:
@@ -67,9 +68,8 @@ for version in build_types:
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()

BIN
payloads/Tools/ocvalidate Executable file

Binary file not shown.

View File

@@ -1 +1,2 @@
requests
pyobjc