mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-04-24 03:50:14 +10:00
Cleaned up serial patching
This commit is contained in:
@@ -48,8 +48,10 @@ while MainMenu:
|
|||||||
print(" 3. Change model")
|
print(" 3. Change model")
|
||||||
print(" 4. Credits")
|
print(" 4. Credits")
|
||||||
print(" 5. Exit")
|
print(" 5. Exit")
|
||||||
|
|
||||||
macserialoutput = subprocess.Popen(["./payloads/tools/macserial", "-m", "MacBookAir6,1"], stdout=subprocess.PIPE).communicate()[0]
|
macserialoutput = subprocess.Popen(["./payloads/tools/macserial", "-m", "MacBookAir6,1"], stdout=subprocess.PIPE).communicate()[0]
|
||||||
print(macserialoutput)
|
print(macserialoutput)
|
||||||
|
|
||||||
print("")
|
print("")
|
||||||
|
|
||||||
MainMenu = raw_input('Please select an option: ')
|
MainMenu = raw_input('Please select an option: ')
|
||||||
|
|||||||
11
README.md
11
README.md
@@ -4,11 +4,7 @@ A python script for building and booting OpenCore on legacy Macs, see [Supported
|
|||||||
|
|
||||||
Current TO-DO's with this patcher:
|
Current TO-DO's with this patcher:
|
||||||
|
|
||||||
* [x] Create OpenCore EFI
|
|
||||||
* [ ] Generate new serials
|
|
||||||
* [ ] Create macOS Installer
|
* [ ] Create macOS Installer
|
||||||
* [x] Install OpenCore to drive
|
|
||||||
* [x] USB mapping
|
|
||||||
* [ ] Legacy GPU Patches
|
* [ ] Legacy GPU Patches
|
||||||
* ie. 2011 and older
|
* ie. 2011 and older
|
||||||
* [ ] Legacy Audio Patches
|
* [ ] Legacy Audio Patches
|
||||||
@@ -16,6 +12,11 @@ Current TO-DO's with this patcher:
|
|||||||
|
|
||||||
## Supported SMBIOS
|
## Supported SMBIOS
|
||||||
|
|
||||||
|
Any hardware supporting SSE4.1 CPU and 64-Bit firmware work on this patcher. See below for exact support:
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>SBIOS Support Table</summary>
|
||||||
|
|
||||||
```
|
```
|
||||||
MacBook5,1
|
MacBook5,1
|
||||||
MacBook5,2
|
MacBook5,2
|
||||||
@@ -78,4 +79,6 @@ MacPro5,1
|
|||||||
Xserve3,1
|
Xserve3,1
|
||||||
```
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
<br>
|
||||||
|
|
||||||
|
|||||||
@@ -172,151 +172,60 @@ def BuildEFI():
|
|||||||
)
|
)
|
||||||
|
|
||||||
def BuildSMBIOS():
|
def BuildSMBIOS():
|
||||||
# Add new SMBIOS data
|
# Set new SMBIOS
|
||||||
|
new_model = current_model
|
||||||
if current_model in ModelArray.MacBookAir61:
|
if current_model in ModelArray.MacBookAir61:
|
||||||
print("- Spoofing to MacBookAir6,1")
|
print("- Spoofing to MacBookAir6,1")
|
||||||
# Patch SMBIOS
|
new_model = "MacBookAir6,1"
|
||||||
|
|
||||||
Versions.plist_data = Versions.plist_data.replace(
|
|
||||||
"iMac19,1",
|
|
||||||
"MacBookAir6,1"
|
|
||||||
)
|
|
||||||
# Patch Number Serial
|
|
||||||
Versions.plist_data = Versions.plist_data.replace(
|
|
||||||
"W00000000001",
|
|
||||||
"Dortania-SN"
|
|
||||||
)
|
|
||||||
# Patch MLB
|
|
||||||
Versions.plist_data = Versions.plist_data.replace(
|
|
||||||
"M0000000000000001",
|
|
||||||
"Dortania-MLB"
|
|
||||||
)
|
|
||||||
if current_model in ModelArray.MacBookAir62:
|
if current_model in ModelArray.MacBookAir62:
|
||||||
print("- Spoofing to MacBookAir6,2")
|
print("- Spoofing to MacBookAir6,2")
|
||||||
# Patch SMBIOS
|
new_model = "MacBookAir6,2"
|
||||||
|
|
||||||
Versions.plist_data = Versions.plist_data.replace(
|
|
||||||
"iMac19,1",
|
|
||||||
"MacBookAir6,2"
|
|
||||||
)
|
|
||||||
# Patch Number Serial
|
|
||||||
Versions.plist_data = Versions.plist_data.replace(
|
|
||||||
"W00000000001",
|
|
||||||
"Dortania-SN"
|
|
||||||
)
|
|
||||||
# Patch MLB
|
|
||||||
Versions.plist_data = Versions.plist_data.replace(
|
|
||||||
"M0000000000000001",
|
|
||||||
"Dortania-MLB"
|
|
||||||
)
|
|
||||||
if current_model in ModelArray.MacBookPro111:
|
if current_model in ModelArray.MacBookPro111:
|
||||||
print("- Spoofing to MacBookPro11,1")
|
print("- Spoofing to MacBookPro11,1")
|
||||||
# Patch SMBIOS
|
new_model = "MacBookPro11,1"
|
||||||
|
|
||||||
Versions.plist_data = Versions.plist_data.replace(
|
|
||||||
"iMac19,1",
|
|
||||||
"MacBookPro11,1"
|
|
||||||
)
|
|
||||||
# Patch Number Serial
|
|
||||||
Versions.plist_data = Versions.plist_data.replace(
|
|
||||||
"W00000000001",
|
|
||||||
"Dortania-SN"
|
|
||||||
)
|
|
||||||
# Patch MLB
|
|
||||||
Versions.plist_data = Versions.plist_data.replace(
|
|
||||||
"M0000000000000001",
|
|
||||||
"Dortania-MLB"
|
|
||||||
)
|
|
||||||
if current_model in ModelArray.MacBookPro112:
|
if current_model in ModelArray.MacBookPro112:
|
||||||
print("- Spoofing to MacBookPro11,2")
|
print("- Spoofing to MacBookPro11,2")
|
||||||
# Patch SMBIOS
|
new_model = "MacBookPro11,2"
|
||||||
|
|
||||||
Versions.plist_data = Versions.plist_data.replace(
|
|
||||||
"iMac19,1",
|
|
||||||
"MacBookPro11,2"
|
|
||||||
)
|
|
||||||
# Patch Number Serial
|
|
||||||
Versions.plist_data = Versions.plist_data.replace(
|
|
||||||
"W00000000001",
|
|
||||||
"Dortania-SN"
|
|
||||||
)
|
|
||||||
# Patch MLB
|
|
||||||
Versions.plist_data = Versions.plist_data.replace(
|
|
||||||
"M0000000000000001",
|
|
||||||
"Dortania-MLB"
|
|
||||||
)
|
|
||||||
if current_model in ModelArray.Macmini71:
|
if current_model in ModelArray.Macmini71:
|
||||||
print("- Spoofing to Macmini7,1")
|
print("- Spoofing to Macmini7,1")
|
||||||
# Patch SMBIOS
|
new_model = "Macmini7,1"
|
||||||
|
|
||||||
Versions.plist_data = Versions.plist_data.replace(
|
|
||||||
"iMac19,1",
|
|
||||||
" Macmini7,1"
|
|
||||||
)
|
|
||||||
# Patch Number Serial
|
|
||||||
Versions.plist_data = Versions.plist_data.replace(
|
|
||||||
"W00000000001",
|
|
||||||
"Dortania-SN"
|
|
||||||
)
|
|
||||||
# Patch MLB
|
|
||||||
Versions.plist_data = Versions.plist_data.replace(
|
|
||||||
"M0000000000000001",
|
|
||||||
"Dortania-MLB"
|
|
||||||
)
|
|
||||||
if current_model in ModelArray.iMac151:
|
if current_model in ModelArray.iMac151:
|
||||||
print("- Spoofing to iMac15,1")
|
print("- Spoofing to iMac15,1")
|
||||||
# Patch SMBIOS
|
new_model = "iMac15,1"
|
||||||
|
|
||||||
Versions.plist_data = Versions.plist_data.replace(
|
|
||||||
"iMac19,1",
|
|
||||||
"iMac15,1"
|
|
||||||
)
|
|
||||||
# Patch Number Serial
|
|
||||||
Versions.plist_data = Versions.plist_data.replace(
|
|
||||||
"W00000000001",
|
|
||||||
"Dortania-SN"
|
|
||||||
)
|
|
||||||
# Patch MLB
|
|
||||||
Versions.plist_data = Versions.plist_data.replace(
|
|
||||||
"M0000000000000001",
|
|
||||||
"Dortania-MLB"
|
|
||||||
)
|
|
||||||
if current_model in ModelArray.iMac144:
|
if current_model in ModelArray.iMac144:
|
||||||
print("- Spoofing to iMac14,4")
|
print("- Spoofing to iMac14,4")
|
||||||
# Patch SMBIOS
|
new_model = "iMac14,4"
|
||||||
|
|
||||||
Versions.plist_data = Versions.plist_data.replace(
|
|
||||||
"iMac19,1",
|
|
||||||
"iMac14,4"
|
|
||||||
)
|
|
||||||
# Patch Number Serial
|
|
||||||
Versions.plist_data = Versions.plist_data.replace(
|
|
||||||
"W00000000001",
|
|
||||||
"Dortania-SN"
|
|
||||||
)
|
|
||||||
# Patch MLB
|
|
||||||
Versions.plist_data = Versions.plist_data.replace(
|
|
||||||
"M0000000000000001",
|
|
||||||
"Dortania-MLB"
|
|
||||||
)
|
|
||||||
if current_model in ModelArray.MacPro71:
|
if current_model in ModelArray.MacPro71:
|
||||||
print("- Spoofing to MacPro7,1")
|
print("- Spoofing to MacPro7,1")
|
||||||
# Patch SMBIOS
|
new_model = "MacPro7,1"
|
||||||
|
|
||||||
Versions.plist_data = Versions.plist_data.replace(
|
# Grab serials from macserial
|
||||||
"iMac19,1",
|
serialData = subprocess.Popen((r"./payloads/tools/macserial -g -m " + new_model + " -n 1").split(), stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||||
"MacPro7,1"
|
serialData = serialData.stdout.read().strip().split(" | ")
|
||||||
)
|
|
||||||
# Patch Number Serial
|
# Patch SMBIOS
|
||||||
Versions.plist_data = Versions.plist_data.replace(
|
Versions.plist_data = Versions.plist_data.replace(
|
||||||
"W00000000001",
|
"iMac19,1",
|
||||||
"Dortania-SN"
|
new_model
|
||||||
)
|
)
|
||||||
# Patch MLB
|
|
||||||
Versions.plist_data = Versions.plist_data.replace(
|
# Patch Number Serial
|
||||||
"M0000000000000001",
|
Versions.plist_data = Versions.plist_data.replace(
|
||||||
"Dortania-MLB"
|
"W00000000001",
|
||||||
)
|
serialData[0]
|
||||||
|
)
|
||||||
|
# Patch MLB
|
||||||
|
Versions.plist_data = Versions.plist_data.replace(
|
||||||
|
"M0000000000000001",
|
||||||
|
serialData[1]
|
||||||
|
)
|
||||||
|
|
||||||
# Patch UUID
|
# Patch UUID
|
||||||
uuidGen = subprocess.Popen(["uuidgen"], stdout=subprocess.PIPE).communicate()[0]
|
uuidGen = subprocess.Popen(["uuidgen"], stdout=subprocess.PIPE).communicate()[0]
|
||||||
|
|||||||
Reference in New Issue
Block a user