mirror of
https://github.com/leminlimez/Nugget.git
synced 2025-04-08 04:23:05 +08:00
make ios 18.1 beta 5 and newer unsupported
This commit is contained in:
@@ -2,14 +2,25 @@ from enum import Enum
|
|||||||
from pymobiledevice3.lockdown import LockdownClient
|
from pymobiledevice3.lockdown import LockdownClient
|
||||||
|
|
||||||
class Device:
|
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.uuid = uuid
|
||||||
self.name = name
|
self.name = name
|
||||||
self.version = version
|
self.version = version
|
||||||
|
self.build = build
|
||||||
self.model = model
|
self.model = model
|
||||||
self.locale = locale
|
self.locale = locale
|
||||||
self.ld = ld
|
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:
|
class Version:
|
||||||
def __init__(self, major: int, minor: int = 0, patch: int = 0):
|
def __init__(self, major: int, minor: int = 0, patch: int = 0):
|
||||||
self.major = major
|
self.major = major
|
||||||
|
|||||||
@@ -23,8 +23,6 @@ def show_error_msg(txt: str):
|
|||||||
detailsBox.exec()
|
detailsBox.exec()
|
||||||
|
|
||||||
class DeviceManager:
|
class DeviceManager:
|
||||||
min_version: Version = Version("17")
|
|
||||||
|
|
||||||
## Class Functions
|
## Class Functions
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.devices: list[Device] = []
|
self.devices: list[Device] = []
|
||||||
@@ -45,6 +43,7 @@ class DeviceManager:
|
|||||||
uuid=device.serial,
|
uuid=device.serial,
|
||||||
name=vals['DeviceName'],
|
name=vals['DeviceName'],
|
||||||
version=vals['ProductVersion'],
|
version=vals['ProductVersion'],
|
||||||
|
build=vals['BuildVersion'],
|
||||||
model=vals['ProductType'],
|
model=vals['ProductType'],
|
||||||
locale=ld.locale,
|
locale=ld.locale,
|
||||||
ld=ld
|
ld=ld
|
||||||
@@ -68,7 +67,7 @@ class DeviceManager:
|
|||||||
self.current_device_index = 0
|
self.current_device_index = 0
|
||||||
else:
|
else:
|
||||||
self.data_singleton.current_device = self.devices[index]
|
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.device_available = False
|
||||||
self.data_singleton.gestalt_path = None
|
self.data_singleton.gestalt_path = None
|
||||||
else:
|
else:
|
||||||
@@ -92,6 +91,12 @@ class DeviceManager:
|
|||||||
return ""
|
return ""
|
||||||
else:
|
else:
|
||||||
return self.data_singleton.current_device.uuid
|
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
|
## APPLYING OR REMOVING TWEAKS AND RESTORING
|
||||||
|
|||||||
@@ -308,9 +308,8 @@ class MainWindow(QtWidgets.QMainWindow):
|
|||||||
self.ui.phoneVersionLbl.setText(f"<a style=\"text-decoration:none; color: white\" href=\"#\">{uuid}</a>")
|
self.ui.phoneVersionLbl.setText(f"<a style=\"text-decoration:none; color: white\" href=\"#\">{uuid}</a>")
|
||||||
|
|
||||||
def show_version_text(self, version: str):
|
def show_version_text(self, version: str):
|
||||||
parsed_ver: Version = Version(version)
|
|
||||||
support_str: str = "<span style=\"color: #32d74b;\">Supported!</span></a>"
|
support_str: str = "<span style=\"color: #32d74b;\">Supported!</span></a>"
|
||||||
if parsed_ver < DeviceManager.min_version:
|
if not self.device_manager.get_current_device_supported():
|
||||||
support_str = "<span style=\"color: #ff0000;\">Not Supported.</span></a>"
|
support_str = "<span style=\"color: #ff0000;\">Not Supported.</span></a>"
|
||||||
self.ui.phoneVersionLbl.setText(f"<a style=\"text-decoration:none; color: white;\" href=\"#\">iOS {version} {support_str}")
|
self.ui.phoneVersionLbl.setText(f"<a style=\"text-decoration:none; color: white;\" href=\"#\">iOS {version} {support_str}")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user