From 836d672634d389b3947a5bd399bf6e3df9fa6b19 Mon Sep 17 00:00:00 2001 From: Hoang Hong Quan Date: Tue, 8 Oct 2024 01:21:03 +0700 Subject: [PATCH] Update instructions, remove hardware info screen --- OpCore-Simplify.py | 37 +++++++------------------------------ Scripts/acpi_guru.py | 21 +-------------------- 2 files changed, 8 insertions(+), 50 deletions(-) diff --git a/OpCore-Simplify.py b/OpCore-Simplify.py index 273c169..54ea7a4 100644 --- a/OpCore-Simplify.py +++ b/OpCore-Simplify.py @@ -1,6 +1,5 @@ from Scripts.datasets import os_data from Scripts import acpi_guru -from Scripts import aida64 from Scripts import compatibility_checker from Scripts import efi_builder from Scripts import gathering_files @@ -18,7 +17,6 @@ class OCPE: self.u = utils.Utils("OpCore Simplify") self.o = gathering_files.gatheringFiles() self.ac = acpi_guru.ACPIGuru() - self.a = aida64.AIDA64() self.c = compatibility_checker.CompatibilityChecker() self.b = efi_builder.builder() self.k = kext_maestro.KextMaestro() @@ -37,43 +35,23 @@ class OCPE: def select_hardware_report(self): while True: - self.u.head("Select your AIDA64 report") + self.u.head("Select hardware report") print("") - print("To ensure the best results, please follow these instructions before generating the AIDA64 report:") + print("To ensure the best results, please follow these instructions before generating the hardware report:") print("") print(" 1. Install all available drivers if possible (skip this step when using Windows PE)") - print(" 2. Use the latest version of AIDA64 Extreme, available at \"https://aida64.com/downloads\"") - print(" 3. In the Report Wizard, ensure \"Hardware-related pages\" is selected on the Report Profiles\n and choose the \"HTML\" format") + print(" 2. Use the latest version of Hardware Sniffer") print("") print("Q. Quit") print("") - user_input = self.u.request_input("Please drag and drop your AIDA64 report here: (*HTML/.htm) ") + user_input = self.u.request_input("Please drag and drop your hardware report here: (.JSON) ") if user_input.lower() == "q": self.u.exit_program() - path = self.u.normalize_path(user_input) - if not path: + path, data = self.u.normalize_path(user_input), self.u.read_file(path) + if not path or os.path.splitext(path).lower() == ".json" or not isinstance(data, dict): continue - return path, self.a.dump(path) + return path, data - def show_hardware_report(self, hardware_report): - self.u.head("Review the hardware information") - contents = [] - for index, device_type in enumerate(hardware_report, start=1): - contents.append("{}. {}{}".format(index, device_type, "" if device_type == "Intel MEI" else ":")) - - if device_type == "SD Controller": - contents.append("{}* {}".format(" "*4, hardware_report.get(device_type).get("Device Description"))) - elif device_type == "Intel MEI": - pass - else: - for device_name, device_props in hardware_report.get(device_type).items(): - contents.append("{}* {}{}".format(" "*4, device_name, ": {}".format(device_props) if isinstance(device_props, str) else "")) - content = "\n".join(contents) + "\n" - self.u.adjust_window_size(content) - print(content) - self.u.request_input() - return - def select_macos_version(self, supported_macos_version): version_pattern = re.compile(r'^(\d+)(?:\.(\d+)(?:\.(\d+))?)?$') @@ -169,7 +147,6 @@ class OCPE: if option == 1: hardware_report_path, hardware_report = self.select_hardware_report() - self.show_hardware_report(hardware_report) supported_macos_version, unsupported_devices = self.c.check_compatibility(hardware_report) macos_version = supported_macos_version[-1] if int(macos_version[:2]) == os_data.macos_versions[-1].darwin_version and os_data.macos_versions[-1].release_status == "beta": diff --git a/Scripts/acpi_guru.py b/Scripts/acpi_guru.py index eb13e69..88d1b9e 100644 --- a/Scripts/acpi_guru.py +++ b/Scripts/acpi_guru.py @@ -2800,32 +2800,13 @@ DefinitionBlock ("", "SSDT", 2, "ZPSS", "SURFACE", 0x00001000) } def select_acpi_tables(self): - results_path = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), "Results") - apcidump_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), "acpidump.exe") while True: self.utils.head("Select ACPI Tables") print("") - if sys.platform == "win32": - print("To manually dump ACPI tables, open Command Prompt and enter the following commands in sequence:") - print("") - print(" > cd \"{}\"".format(results_path.replace("/", "\\"))) - print(" > mkdir ACPITables") - print(" > cd ACPITables") - print(" > \"{}\" -b".format(apcidump_path.replace("/", "\\"))) - print(" > rename *.dat *.aml") - print("") - print("The ACPI tables will now be available in\n \"{}\\ACPITables\"".format(results_path.replace("/", "\\"))) - print("") - if sys.platform.startswith("linux") or sys.platform == "win32": - print("P. Dump ACPI Tables") print("Q. Quit") print(" ") menu = self.utils.request_input("Please drag and drop ACPI Tables folder here: ") - if menu.lower() == "p" and (sys.platform.startswith("linux") or sys.platform == "win32"): - return self.read_acpi_tables( - self.acpi.dump_tables(os.path.join(results_path, "ACPITables")) - ) - elif menu.lower() == "q": + if menu.lower() == "q": self.utils.exit_program() path = self.utils.normalize_path(menu) if not path: