diff --git a/devicemanagement/constants.py b/devicemanagement/constants.py index 48cb9e7..b88a4b1 100644 --- a/devicemanagement/constants.py +++ b/devicemanagement/constants.py @@ -2,14 +2,25 @@ from enum import Enum from pymobiledevice3.lockdown import LockdownClient class Device: - def __init__(self, uuid: int, name: str, version: str, model: str, locale: str, ld: LockdownClient): + def __init__(self, uuid: int, name: str, version: str, build: str, model: str, locale: str, ld: LockdownClient): self.uuid = uuid self.name = name self.version = version + self.build = build self.model = model self.locale = locale self.ld = ld + def supported(self) -> bool: + parsed_ver: Version = Version(self.version) + if (parsed_ver < Version("17.0")) or (parsed_ver > Version("18.1")): + return False + if (parsed_ver == Version("18.1") + and self.build != "22B5007p" and self.build == "22B5023e" + and self.build == "22B5034e" and self.build == "22B5045g"): + return False + return True + class Version: def __init__(self, major: int, minor: int = 0, patch: int = 0): self.major = major diff --git a/devicemanagement/device_manager.py b/devicemanagement/device_manager.py index e044146..bdbb2ad 100644 --- a/devicemanagement/device_manager.py +++ b/devicemanagement/device_manager.py @@ -23,8 +23,6 @@ def show_error_msg(txt: str): detailsBox.exec() class DeviceManager: - min_version: Version = Version("17") - ## Class Functions def __init__(self): self.devices: list[Device] = [] @@ -45,6 +43,7 @@ class DeviceManager: uuid=device.serial, name=vals['DeviceName'], version=vals['ProductVersion'], + build=vals['BuildVersion'], model=vals['ProductType'], locale=ld.locale, ld=ld @@ -68,7 +67,7 @@ class DeviceManager: self.current_device_index = 0 else: self.data_singleton.current_device = self.devices[index] - if Version(self.devices[index].version) < DeviceManager.min_version: + if Version(self.devices[index].version) < Version("17.0"): self.data_singleton.device_available = False self.data_singleton.gestalt_path = None else: @@ -92,6 +91,12 @@ class DeviceManager: return "" else: return self.data_singleton.current_device.uuid + + def get_current_device_supported(self) -> bool: + if self.data_singleton.current_device == None: + return False + else: + return self.data_singleton.current_device.supported() ## APPLYING OR REMOVING TWEAKS AND RESTORING diff --git a/gui/main_window.py b/gui/main_window.py index c6a5be9..74384c1 100644 --- a/gui/main_window.py +++ b/gui/main_window.py @@ -308,9 +308,8 @@ class MainWindow(QtWidgets.QMainWindow): self.ui.phoneVersionLbl.setText(f"{uuid}") def show_version_text(self, version: str): - parsed_ver: Version = Version(version) support_str: str = "Supported!" - if parsed_ver < DeviceManager.min_version: + if not self.device_manager.get_current_device_supported(): support_str = "Not Supported." self.ui.phoneVersionLbl.setText(f"iOS {version} {support_str}")