installer.py: Add Variant Info

This commit is contained in:
Mykola Grymalyuk
2022-01-22 15:32:35 -07:00
parent f042ddfe75
commit 33eef9b87f
7 changed files with 36 additions and 11 deletions

1
.gitignore vendored
View File

@@ -22,3 +22,4 @@ __pycache__/
/docs/node_modules/
/payloads/List.txt
/payloads/Installer.sh
/payloads/Info.plist

View File

@@ -46,10 +46,11 @@ app = BUNDLE(exe,
bundle_identifier="com.dortania.opencore-legacy-patcher-wxpython",
info_plist={
"CFBundleShortVersionString": constants.Constants().patcher_version,
"NSHumanReadableCopyright": "Copyright 2020-2022 Dortania",
"NSHumanReadableCopyright": constants.Constants().copyright_date
"LSMinimumSystemVersion": "10.10.0",
"NSRequiresAquaSystemAppearance": False,
"NSHighResolutionCapable": True,
"Build Date": time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()),
"BuildMachineOSBuild": subprocess.run("sw_vers -buildVersion".split(), stdout=subprocess.PIPE, stderr=subprocess.STDOUT).stdout.decode().strip(),
"NSPrincipalClass": "NSApplication",
})

View File

@@ -315,7 +315,7 @@ class wx_python_gui:
# Copyright Label
self.copyright = wx.StaticText(self.frame, label="Copyright © 2020-2022 Dortania")
self.copyright = wx.StaticText(self.frame, label=self.constants.copyright_date)
self.copyright.SetFont(wx.Font(8, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL))
self.copyright.SetPosition(
wx.Point(
@@ -1065,8 +1065,12 @@ class wx_python_gui:
i = -20
if avalible_installers:
for app in avalible_installers:
print(f"macOS {avalible_installers[app]['Version']} ({avalible_installers[app]['Build']} - {utilities.human_fmt(avalible_installers[app]['Size'])} - {avalible_installers[app]['Source']})")
self.install_selection = wx.Button(self.frame, label=f"macOS {avalible_installers[app]['Version']} ({avalible_installers[app]['Build']} - {utilities.human_fmt(avalible_installers[app]['Size'])})", size=(250, 30))
print(f"macOS {avalible_installers[app]['Version']} ({avalible_installers[app]['Build']} - {utilities.human_fmt(avalible_installers[app]['Size'])} - {avalible_installers[app]['Source']}) - {avalible_installers[app]['Variant']}")
if avalible_installers[app]['Variant'] in ["DeveloperSeed" , "PublicSeed"]:
extra = " Beta"
else:
extra = ""
self.install_selection = wx.Button(self.frame, label=f"macOS {avalible_installers[app]['Version']}{extra} ({avalible_installers[app]['Build']} - {utilities.human_fmt(avalible_installers[app]['Size'])})", size=(280, 30))
i = i + 25
self.install_selection.SetPosition(
wx.Point(

View File

@@ -1264,7 +1264,11 @@ B. Exit
# Add mirror of 11.2.3 for users who want it
options.append([f"macOS {mirror_data.Install_macOS_Big_Sur_11_2_3['Version']} ({mirror_data.Install_macOS_Big_Sur_11_2_3['Build']} - {utilities.human_fmt(mirror_data.Install_macOS_Big_Sur_11_2_3['Size'])} - {mirror_data.Install_macOS_Big_Sur_11_2_3['Source']})", lambda: self.download_install_assistant(mirror_data.Install_macOS_Big_Sur_11_2_3['Link'])])
for app in avalible_installers:
options.append([f"macOS {avalible_installers[app]['Version']} ({avalible_installers[app]['Build']} - {utilities.human_fmt(avalible_installers[app]['Size'])} - {avalible_installers[app]['Source']})", lambda x=app: self.download_install_assistant(avalible_installers[x]['Link'])])
if avalible_installers[app]['Variant'] in ["DeveloperSeed", "PublicSeed"]:
variant = " Beta"
else:
variant = ""
options.append([f"macOS {avalible_installers[app]['Version']}{variant} ({avalible_installers[app]['Build']} - {utilities.human_fmt(avalible_installers[app]['Size'])} - {avalible_installers[app]['Source']})", lambda x=app: self.download_install_assistant(avalible_installers[x]['Link'])])
for option in options:
menu.add_menu_option(option[0], function=option[1])
response = menu.start()

View File

@@ -22,6 +22,7 @@ class Constants:
self.guide_link = "https://dortania.github.io/OpenCore-Legacy-Patcher/"
self.repo_link = "https://github.com/dortania/OpenCore-Legacy-Patcher"
self.repo_link_latest = f"{self.repo_link}/releases/tag/{self.patcher_version}"
self.copyright_date = "Copyright © 2020-2022 Dortania"
# OpenCore Versioning
# https://github.com/acidanthera/OpenCorePkg

View File

@@ -99,11 +99,24 @@ def list_downloadable_macOS_installers(download_path, catalog):
catalog_plist["Products"][item]["ExtendedMetaInfo"]["InstallAssistantPackageIdentifiers"]["BuildManifest"]
for bm_package in catalog_plist["Products"][item]["Packages"]:
if "BuildManifest.plist" in bm_package["URL"]:
utilities.download_file(bm_package["URL"], (Path(download_path) / Path("BuildManifest.plist")))
build_plist = plistlib.load((Path(download_path) / Path("BuildManifest.plist")).open("rb"))
version = build_plist["ProductVersion"]
build = build_plist["ProductBuildVersion"]
if "Info.plist" in bm_package["URL"] and "InstallInfo.plist" not in bm_package["URL"]:
utilities.download_file(bm_package["URL"], (Path(download_path) / Path("Info.plist")))
build_plist = plistlib.load((Path(download_path) / Path("Info.plist")).open("rb"))
version = build_plist["MobileAssetProperties"]["OSVersion"]
build = build_plist["MobileAssetProperties"]["Build"]
try:
catalog_url = build_plist["MobileAssetProperties"]["BridgeVersionInfo"]["CatalogURL"]
if "beta" in catalog_url:
catalog_url = "PublicSeed"
elif "customerseed" in catalog_url:
catalog_url = "CustomerSeed"
elif "seed" in catalog_url:
catalog_url = "DeveloperSeed"
else:
catalog_url = "Unknown"
except KeyError:
# Assume CustomerSeed if no catalog URL is found
catalog_url = "CustomerSeed"
for ia_package in catalog_plist["Products"][item]["Packages"]:
if "InstallAssistant.pkg" in ia_package["URL"]:
download_link = ia_package["URL"]
@@ -118,6 +131,7 @@ def list_downloadable_macOS_installers(download_path, catalog):
"Size": size,
"integrity": integrity,
"Source": "Apple Inc.",
"Variant": catalog_url,
}
})
except KeyError:

View File

@@ -173,7 +173,7 @@ class detect_root_patch:
"Validation: Patching Possible": self.verify_patch_allowed(),
"Validation: SIP is enabled": self.sip_enabled,
"Validation: SBM is enabled": self.sbm_enabled,
"Validation: AMFI is enabled": self.amfi_enabled,
"Validation: AMFI is enabled": self.amfi_enabled if self.amfi_must_disable else False,
"Validation: FileVault is enabled": self.fv_enabled,
"Validation: System is dosdude1 patched": self.dosdude_patched,
"Validation: Board ID is unsupported": self.bad_board_id,