From 7bc88eeadc7f16581ec7c9db024ffd526d00694c Mon Sep 17 00:00:00 2001 From: leminlimez <59540996+leminlimez@users.noreply.github.com> Date: Wed, 23 Oct 2024 11:12:22 -0400 Subject: [PATCH] hide feature flags on patched versions --- devicemanagement/constants.py | 14 +++++++++----- gui/main_window.py | 3 ++- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/devicemanagement/constants.py b/devicemanagement/constants.py index 20ee020..9347b15 100644 --- a/devicemanagement/constants.py +++ b/devicemanagement/constants.py @@ -11,15 +11,19 @@ class Device: self.locale = locale self.ld = ld + def has_exploit(self) -> bool: + parsed_ver: Version = Version(self.version) + if (parsed_ver < Version("18.1") + or self.build == "22B5007p" or self.build == "22B5023e" + or self.build == "22B5034e" or self.build == "22B5045g"): + return True + return False + def supported(self) -> bool: parsed_ver: Version = Version(self.version) if 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 + return self.has_exploit() class Version: def __init__(self, major: int, minor: int = 0, patch: int = 0): diff --git a/gui/main_window.py b/gui/main_window.py index 4568b02..29aeeda 100644 --- a/gui/main_window.py +++ b/gui/main_window.py @@ -240,7 +240,8 @@ class MainWindow(QtWidgets.QMainWindow): if Version(self.device_manager.data_singleton.current_device.version) >= Version("18.0"): self.ui.aodChk.show() self.ui.iphone16SettingsChk.show() - self.ui.featureFlagsPageBtn.show() + if self.device_manager.data_singleton.current_device.has_exploit(): + self.ui.featureFlagsPageBtn.show() # show the other dynamic island options self.ui.dynamicIslandDrp.addItem("2622 (iPhone 16 Pro Dynamic Island)") self.ui.dynamicIslandDrp.addItem("2868 (iPhone 16 Pro Max Dynamic Island)")