os_probe: Add RSR handling

This commit is contained in:
Mykola Grymalyuk
2022-12-16 19:06:07 -07:00
parent f71fcf6f58
commit 73afdc37c3
2 changed files with 9 additions and 1 deletions

View File

@@ -16,6 +16,7 @@
- Resolve KDK Versioning Fallback crashing when primary KDK site is down
- Resolve AirPlay to Mac support on Ventura with VMM
- Resolve WindowServer crashing on KDK-less with macOS 13.2 and Rapid Security Response updates
- Resolve Host Versioning when RSR is installed
- Increment Binaries:
- OpenCorePkg 0.8.7 - release
- FeatureUnlock 1.1.2 - rolling (94e29ce)

View File

@@ -2,6 +2,7 @@
import platform
import subprocess
import plistlib
def detect_kernel_major():
@@ -25,4 +26,10 @@ def detect_os_version():
def detect_os_build():
# Return OS build
# Example Output: 21A5522h (string)
return subprocess.run("sw_vers -buildVersion".split(), stdout=subprocess.PIPE).stdout.decode().strip()
# With macOS 13.2, Apple implemented the Rapid Security Response system which
# will change the reported build to the RSR version and not the original host
# To get the proper versions:
# - Host: /System/Library/CoreServices/SystemVersion.plist
# - RSR: /System/Volumes/Preboot/Cryptexes/OS/System/Library/CoreServices/SystemVersion.plist
return plistlib.load(open("/System/Library/CoreServices/SystemVersion.plist", "rb"))["ProductBuildVersion"]