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
|
||||
|
||||
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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user