Skip to content

Commit

Permalink
Update to 4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
LoveJessyChen committed Oct 29, 2024
1 parent 8e36485 commit fa87353
Show file tree
Hide file tree
Showing 13 changed files with 368 additions and 417 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto
2 changes: 2 additions & 0 deletions 0-Shortcuts/Credits.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Credits
[LeminLimez](https://github.com/leminlimez) for [Nugget](https://github.com/leminlimez/Nugget)
19 changes: 12 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Nugget
Unlock your device's full potential! Works on all versions iOS 17.0-17.7 & 18.0-18.1 beta 4 & 18.2 beta 1.
Unlock your device's full potential!

Sparserestore was patched in iOS 18.1 beta 5-18.1 RC1 & iOS 17.7.1. It will not be supported, please stop asking.
Sparserestore works on all versions iOS 17.0-17.7 and iOS 18.0-18.1 beta 4. There is partial support for iOS 17.7.1 and iOS 18.1 beta 5+.

This uses the sparserestore exploit to write to files outside of the intended restore location, like mobilegestalt.

Note: I am not responsible if your device bootloops. Please back up your data before using.
Note: I am not responsible if your device bootloops. Please back up your data before using!

## Features
- Enable Dynamic Island on any device
Expand All @@ -27,14 +27,20 @@ Note: I am not responsible if your device bootloops. Please back up your data be
- Enabling lock screen clock animation, lock screen page duplication button, and more!
- Disabling the new iOS 18 Photos UI
- EU Enabler
- AI Enabler
- Springboard Options (from Cowabunga Lite)
- Internal Options (from Cowabunga Lite)

## Running the Program
Requirements:
**Requirements:**
- pymobiledevice3
- Python 3.8 or newer

- **Windows:**
- Either [Apple Devices (from Microsoft Store)](https://apps.microsoft.com/detail/9np83lwlpz9k%3Fhl%3Den-US%26gl%3DUS&ved=2ahUKEwjE-svo7qyJAxWTlYkEHQpbH3oQFnoECBoQAQ&usg=AOvVaw0rZTXCFmRaHAifkEEu9tMI) app or [iTunes (from Apple website)](https://support.apple.com/en-us/106372)
- **Linux:**
- [usbmuxd](https://github.com/libimobiledevice/usbmuxd) and [libimobiledevice](https://github.com/libimobiledevice/libimobiledevice)

Note: It is highly recommended to use a virtual environment:
```
python3 -m venv .env # only needed once
Expand Down Expand Up @@ -64,10 +70,9 @@ To compile the resources file for Python, run the following command:
The application itself can be compiled by running `compile.py`.

## Credits

- [LeminLimez](https://github.com/leminlimez/Nugget) for Nugget
- [LeminLimez](https://github.com/leminlimez) for [Nugget](https://github.com/leminlimez/Nugget)
- [JJTech](https://github.com/JJTech0130) for Sparserestore/[TrollRestore](https://github.com/JJTech0130/TrollRestore)
- [pymobiledevice3](https://github.com/doronz88/pymobiledevice3)
- [disfordottie](https://x.com/disfordottie) for some global flag features

- [sneakyf1shy](https://github.com/f1shy-dev) for [AI Enabler](https://gist.github.com/f1shy-dev/23b4a78dc283edd30ae2b2e6429129b5)

233 changes: 0 additions & 233 deletions cli_app.py

This file was deleted.

18 changes: 11 additions & 7 deletions devicemanagement/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,19 @@ def __init__(self, uuid: int, name: str, version: str, build: str, model: str, l
self.locale = locale
self.ld = ld

def supported(self) -> bool:
def has_exploit(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"):
# make sure versions past 17.7.1 but before 18.0 aren't supported
if (parsed_ver >= Version("17.7.1") and parsed_ver < Version("18.0")):
return False
return True
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:
return self.has_exploit()

class Version:
def __init__(self, major: int, minor: int = 0, patch: int = 0):
Expand Down
36 changes: 28 additions & 8 deletions devicemanagement/device_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,26 @@ def __init__(self):
self.devices: list[Device] = []
self.data_singleton = DataSingleton()
self.current_device_index = 0

# preferences
self.apply_over_wifi = True
self.skip_setup = True
self.auto_reboot = True

def get_devices(self, settings: QSettings):
self.devices.clear()
connected_devices = usbmux.list_devices()
# handle errors when failing to get connected devices
try:
connected_devices = usbmux.list_devices()
except:
show_error_msg(
"""
Failed to get device list. Click \"Show Details\" for the traceback.
If you are on Windows, make sure you have the \"Apple Devices\" app from the Microsoft Store or iTunes from Apple's website.
If you are on Linux, make sure you have usbmuxd and libimobiledevice installed.
"""
)
# Connect via usbmuxd
for device in connected_devices:
if self.apply_over_wifi or device.is_usb:
Expand Down Expand Up @@ -65,7 +79,7 @@ def get_devices(self, settings: QSettings):
self.devices.append(dev)
except Exception as e:
print(f"ERROR with lockdown device with UUID {device.serial}")
show_error_msg(type(e).__name__)
show_error_msg(type(e).__name__ + ": " + repr(e))

if len(connected_devices) > 0:
self.set_current_device(index=0)
Expand Down Expand Up @@ -281,8 +295,11 @@ def apply_changes(self, resetting: bool = False, update_label=lambda x: None):
# restore to the device
update_label("Restoring to device...")
try:
restore_files(files=files_to_restore, reboot=True, lockdown_client=self.data_singleton.current_device.ld)
QMessageBox.information(None, "Success!", "All done! Your device will now restart.")
restore_files(files=files_to_restore, reboot=self.auto_reboot, lockdown_client=self.data_singleton.current_device.ld)
msg = "Your device will now restart."
if not self.auto_reboot:
msg = "Please restart your device to see changes."
QMessageBox.information(None, "Success!", "All done! " + msg)
update_label("Success!")
except Exception as e:
if "Find My" in str(e):
Expand All @@ -295,7 +312,7 @@ def apply_changes(self, resetting: bool = False, update_label=lambda x: None):
else:
print(traceback.format_exc())
update_label("Failed to restore")
show_error_msg(type(e).__name__)
show_error_msg(type(e).__name__ + ": " + repr(e))

## RESETTING MOBILE GESTALT
def reset_mobilegestalt(self, settings: QSettings, update_label=lambda x: None):
Expand All @@ -309,8 +326,11 @@ def reset_mobilegestalt(self, settings: QSettings, update_label=lambda x: None):
contents=b"",
restore_path=file_path,
domain=domain
)], reboot=True, lockdown_client=self.data_singleton.current_device.ld)
QMessageBox.information(None, "Success!", "All done! Your device will now restart.")
)], reboot=self.auto_reboot, lockdown_client=self.data_singleton.current_device.ld)
msg = "Your device will now restart."
if not self.auto_reboot:
msg = "Please restart your device to see changes."
QMessageBox.information(None, "Success!", "All done! " + msg)
update_label("Success!")
except Exception as e:
if "Find My" in str(e):
Expand All @@ -323,4 +343,4 @@ def reset_mobilegestalt(self, settings: QSettings, update_label=lambda x: None):
else:
print(traceback.format_exc())
update_label("Failed to restore")
show_error_msg(type(e).__name__)
show_error_msg(type(e).__name__ + ": " + repr(e))
Loading

0 comments on commit fa87353

Please sign in to comment.