Cleaned up serial patching

This commit is contained in:
Mykola Grymalyuk
2020-11-30 20:40:57 -07:00
parent 6bff171256
commit df9839e444
3 changed files with 47 additions and 133 deletions

View File

@@ -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: ')

View File

@@ -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>

View File

@@ -172,150 +172,59 @@ 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"
# Grab serials from macserial
serialData = subprocess.Popen((r"./payloads/tools/macserial -g -m " + new_model + " -n 1").split(), stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
serialData = serialData.stdout.read().strip().split(" | ")
# Patch SMBIOS
Versions.plist_data = Versions.plist_data.replace( Versions.plist_data = Versions.plist_data.replace(
"iMac19,1", "iMac19,1",
"MacPro7,1" new_model
) )
# Patch Number Serial # Patch Number Serial
Versions.plist_data = Versions.plist_data.replace( Versions.plist_data = Versions.plist_data.replace(
"W00000000001", "W00000000001",
"Dortania-SN" serialData[0]
) )
# Patch MLB # Patch MLB
Versions.plist_data = Versions.plist_data.replace( Versions.plist_data = Versions.plist_data.replace(
"M0000000000000001", "M0000000000000001",
"Dortania-MLB" serialData[1]
) )
# Patch UUID # Patch UUID