Skip to content

Commit

Permalink
Update to 2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
LoveJessyChen committed Sep 11, 2024
1 parent abd6ca9 commit 031ae48
Show file tree
Hide file tree
Showing 11 changed files with 2,454 additions and 89 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Note: I am not responsible if your device bootloops. Please back up your data be
- Change Device Model Name (ie what shows in the Settings app)
- Enable Boot Chime
- Enable Charge Limit
- Enable iPhone 16 Settings
- Enable Collision SOS
- Enable Stage Manager
- Disable the Wallpaper Parallax
Expand Down
19 changes: 17 additions & 2 deletions cli_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def get_apply_number(num: int) -> int:
'---' \\ \\ / \\ \\ / `----'
`--`-' `--`-'
""")
print("CLI v2.0.1")
print("CLI v2.2")
print("by LeminLimez")
print("Thanks @disfordottie for the clock animation and @lrdsnow for EU Enabler\n")
print("Please back up your device before using!")
Expand Down Expand Up @@ -88,6 +88,7 @@ def get_apply_number(num: int) -> int:
# apply will still be the number of tweaks just to keep consistency
print(f"\n{get_apply_number(num_tweaks + 1)}. Apply")
print(f"{get_apply_number(num_tweaks + 1) + 1}. Remove All Tweaks")
print(f"{get_apply_number(num_tweaks + 1) + 2}. Reset Mobile Gestalt")
print("0. Exit\n")
page = int(input("Enter a number: "))
if page == get_apply_number(num_tweaks + 1) or page == get_apply_number(num_tweaks + 1) + 1:
Expand All @@ -113,7 +114,7 @@ def get_apply_number(num: int) -> int:

# set the plist keys
if not resetting:
for tweak in tweaks:
for tweak in tweaks.values:
if isinstance(tweak, FeatureFlagTweak):
flag_plist = tweak.apply_tweak(flag_plist)
elif isinstance(tweak, EligibilityTweak):
Expand Down Expand Up @@ -145,6 +146,20 @@ def get_apply_number(num: int) -> int:
finally:
input("Press Enter to exit...")
running = False
elif page == get_apply_number(num_tweaks + 1) + 2:
# reset mobilegestalt
# restore to the device
try:
restore_files(files=[FileToRestore(
contents=b"",
restore_path="/var/containers/Shared/SystemGroup/systemgroup.com.apple.mobilegestaltcache/Library/Caches/",
restore_name="com.apple.MobileGestalt.plist"
)], reboot=True, lockdown_client=device.ld)
except Exception as e:
print(traceback.format_exc())
finally:
input("Press Enter to exit...")
running = False
elif page == 0:
# exit the panel
print("Goodbye!")
Expand Down
25 changes: 25 additions & 0 deletions devicemanagement/device_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,3 +155,28 @@ def apply_changes(self, resetting: bool = False, update_label=lambda x: None):
print(traceback.format_exc())
update_label("Failed to restore")
show_error_msg(type(e).__name__)

## RESETTING MOBILE GESTALT
def reset_mobilegestalt(self, update_label=lambda x: None):
# restore to the device
update_label("Restoring to device...")
try:
restore_files(files=[FileToRestore(
contents=b"",
restore_path="/var/containers/Shared/SystemGroup/systemgroup.com.apple.mobilegestaltcache/Library/Caches/",
restore_name="com.apple.MobileGestalt.plist"
)], reboot=True, lockdown_client=self.data_singleton.current_device.ld)
QMessageBox.information(None, "Success!", "All done! Your device will now restart.")
update_label("Success!")
except Exception as e:
if "Find My" in str(e):
detailsBox = QMessageBox()
detailsBox.setIcon(QMessageBox.Critical)
detailsBox.setWindowTitle("Error!")
detailsBox.setText("Find My must be disabled in order to use this tool.")
detailsBox.setDetailedText("Disable Find My from Settings (Settings -> [Your Name] -> Find My) and then try again.")
detailsBox.exec()
else:
print(traceback.format_exc())
update_label("Failed to restore")
show_error_msg(type(e).__name__)
Binary file added files/.DS_Store
Binary file not shown.
24 changes: 24 additions & 0 deletions gui/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ def __init__(self, device_manager: DeviceManager):
self.ui.applyTweaksBtn.clicked.connect(self.on_applyPageBtn_clicked)
self.ui.removeTweaksBtn.clicked.connect(self.on_removeTweaksBtn_clicked)
self.ui.chooseGestaltBtn.clicked.connect(self.on_chooseGestaltBtn_clicked)
self.ui.resetGestaltBtn.clicked.connect(self.on_resetGestaltBtn_clicked)

## MOBILE GESTALT PAGE ACTIONS
self.ui.dynamicIslandDrp.activated.connect(self.on_dynamicIslandDrp_activated)
Expand All @@ -91,6 +92,8 @@ def __init__(self, device_manager: DeviceManager):

self.ui.bootChimeChk.clicked.connect(self.on_bootChimeChk_clicked)
self.ui.chargeLimitChk.clicked.connect(self.on_chargeLimitChk_clicked)
self.ui.tapToWakeChk.clicked.connect(self.on_tapToWakeChk_clicked)
self.ui.iphone16SettingsChk.clicked.connect(self.on_iphone16SettingsChk_clicked)
self.ui.parallaxChk.clicked.connect(self.on_parallaxChk_clicked)
self.ui.stageManagerChk.clicked.connect(self.on_stageManagerChk_clicked)
self.ui.ipadAppsChk.clicked.connect(self.on_ipadAppsChk_clicked)
Expand All @@ -102,6 +105,7 @@ def __init__(self, device_manager: DeviceManager):
self.ui.internalStorageChk.clicked.connect(self.on_internalStorageChk_clicked)
self.ui.collisionSOSChk.clicked.connect(self.on_collisionSOSChk_clicked)
self.ui.aodChk.clicked.connect(self.on_aodChk_clicked)
self.ui.sleepApneaChk.clicked.connect(self.on_sleepApneaChk_clicked)


## GENERAL INTERFACE FUNCTIONS
Expand Down Expand Up @@ -166,11 +170,22 @@ def change_selected_device(self, index):
if len(self.device_manager.devices) > 0:
self.device_manager.set_current_device(index=index)
# hide options that are for newer versions
# remove the new dynamic island options
try:
self.ui.dynamicIslandDrp.removeItem(6)
self.ui.dynamicIslandDrp.removeItem(5)
except:
pass
if Version(self.device_manager.data_singleton.current_device.version) >= Version("18.0"):
self.ui.aodChk.show()
self.ui.sleepApneaChk.show()
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)")
else:
self.ui.aodChk.hide()
self.ui.sleepApneaChk.hide()
self.ui.featureFlagsPageBtn.hide()
else:
self.device_manager.set_current_device(index=None)
Expand Down Expand Up @@ -289,6 +304,10 @@ def on_bootChimeChk_clicked(self, checked: bool):
tweaks["BootChime"].set_enabled(checked)
def on_chargeLimitChk_clicked(self, checked: bool):
tweaks["ChargeLimit"].set_enabled(checked)
def on_tapToWakeChk_clicked(self, checked: bool):
tweaks["TapToWake"].set_enabled(checked)
def on_iphone16SettingsChk_clicked(self, checked: bool):
tweaks["CameraButton"].set_enabled(checked)
def on_parallaxChk_clicked(self, checked: bool):
tweaks["Parallax"].set_enabled(checked)

Expand All @@ -297,6 +316,7 @@ def on_stageManagerChk_clicked(self, checked: bool):
def on_ipadAppsChk_clicked(self, checked: bool):
tweaks["iPadApps"].set_enabled(checked)
def on_shutterChk_clicked(self, checked: bool):
# TODO: allow the user to select the region
tweaks["Shutter"].set_enabled(checked)
def on_pencilChk_clicked(self, checked: bool):
tweaks["Pencil"].set_enabled(checked)
Expand All @@ -312,6 +332,8 @@ def on_collisionSOSChk_clicked(self, checked: bool):
tweaks["CollisionSOS"].set_enabled(checked)
def on_aodChk_clicked(self, checked: bool):
tweaks["AOD"].set_enabled(checked)
def on_sleepApneaChk_clicked(self, checked: bool):
tweaks["SleepApnea"].set_enabled(checked)


## FEATURE FLAGS PAGE
Expand Down Expand Up @@ -382,6 +404,8 @@ def update_bar(self, percent):
def on_removeTweaksBtn_clicked(self):
# TODO: Add safety here
self.device_manager.apply_changes(resetting=True, update_label=self.update_label)
def on_resetGestaltBtn_clicked(self):
self.device_manager.reset_mobilegestalt(update_label=self.update_label)

@QtCore.Slot()
def on_applyTweaksBtn_clicked(self):
Expand Down
Binary file modified qt/.DS_Store
Binary file not shown.
Loading

0 comments on commit 031ae48

Please sign in to comment.