mirror of
https://github.com/leminlimez/Nugget.git
synced 2025-04-08 04:23:05 +08:00
disable auto reboot option + bump to v4.0
This commit is contained in:
@@ -30,8 +30,11 @@ class DeviceManager:
|
|||||||
self.devices: list[Device] = []
|
self.devices: list[Device] = []
|
||||||
self.data_singleton = DataSingleton()
|
self.data_singleton = DataSingleton()
|
||||||
self.current_device_index = 0
|
self.current_device_index = 0
|
||||||
|
|
||||||
|
# preferences
|
||||||
self.apply_over_wifi = True
|
self.apply_over_wifi = True
|
||||||
self.skip_setup = True
|
self.skip_setup = True
|
||||||
|
self.auto_reboot = True
|
||||||
|
|
||||||
def get_devices(self, settings: QSettings):
|
def get_devices(self, settings: QSettings):
|
||||||
self.devices.clear()
|
self.devices.clear()
|
||||||
@@ -281,8 +284,11 @@ class DeviceManager:
|
|||||||
# restore to the device
|
# restore to the device
|
||||||
update_label("Restoring to device...")
|
update_label("Restoring to device...")
|
||||||
try:
|
try:
|
||||||
restore_files(files=files_to_restore, reboot=True, lockdown_client=self.data_singleton.current_device.ld)
|
restore_files(files=files_to_restore, reboot=self.auto_reboot, lockdown_client=self.data_singleton.current_device.ld)
|
||||||
QMessageBox.information(None, "Success!", "All done! Your device will now restart.")
|
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!")
|
update_label("Success!")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
if "Find My" in str(e):
|
if "Find My" in str(e):
|
||||||
@@ -309,8 +315,11 @@ class DeviceManager:
|
|||||||
contents=b"",
|
contents=b"",
|
||||||
restore_path=file_path,
|
restore_path=file_path,
|
||||||
domain=domain
|
domain=domain
|
||||||
)], reboot=True, lockdown_client=self.data_singleton.current_device.ld)
|
)], reboot=self.auto_reboot, lockdown_client=self.data_singleton.current_device.ld)
|
||||||
QMessageBox.information(None, "Success!", "All done! Your device will now restart.")
|
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!")
|
update_label("Success!")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
if "Find My" in str(e):
|
if "Find My" in str(e):
|
||||||
|
|||||||
@@ -117,8 +117,9 @@ class MainWindow(QtWidgets.QMainWindow):
|
|||||||
self.ui.resetGestaltBtn.clicked.connect(self.on_resetGestaltBtn_clicked)
|
self.ui.resetGestaltBtn.clicked.connect(self.on_resetGestaltBtn_clicked)
|
||||||
|
|
||||||
## SETTINGS PAGE ACTIONS
|
## SETTINGS PAGE ACTIONS
|
||||||
self.ui.allowWifiApplyingChk.clicked.connect(self.on_allowWifiApplyingChk_toggled)
|
self.ui.allowWifiApplyingChk.toggled.connect(self.on_allowWifiApplyingChk_toggled)
|
||||||
self.ui.skipSetupChk.clicked.connect(self.on_skipSetupChk_toggled)
|
self.ui.skipSetupChk.toggled.connect(self.on_skipSetupChk_toggled)
|
||||||
|
self.ui.autoRebootChk.toggled.connect(self.on_autoRebootChk_toggled)
|
||||||
|
|
||||||
self.ui.resetPairBtn.clicked.connect(self.on_resetPairBtn_clicked)
|
self.ui.resetPairBtn.clicked.connect(self.on_resetPairBtn_clicked)
|
||||||
|
|
||||||
@@ -261,10 +262,15 @@ class MainWindow(QtWidgets.QMainWindow):
|
|||||||
# load the settings
|
# load the settings
|
||||||
apply_over_wifi = self.settings.value("apply_over_wifi", True, type=bool)
|
apply_over_wifi = self.settings.value("apply_over_wifi", True, type=bool)
|
||||||
skip_setup = self.settings.value("skip_setup", True, type=bool)
|
skip_setup = self.settings.value("skip_setup", True, type=bool)
|
||||||
|
auto_reboot = self.settings.value("auto_reboot", True, type=bool)
|
||||||
|
|
||||||
self.ui.allowWifiApplyingChk.setChecked(apply_over_wifi)
|
self.ui.allowWifiApplyingChk.setChecked(apply_over_wifi)
|
||||||
self.ui.skipSetupChk.setChecked(skip_setup)
|
self.ui.skipSetupChk.setChecked(skip_setup)
|
||||||
|
self.ui.autoRebootChk.setChecked(auto_reboot)
|
||||||
|
|
||||||
self.device_manager.apply_over_wifi = apply_over_wifi
|
self.device_manager.apply_over_wifi = apply_over_wifi
|
||||||
self.device_manager.skip_setup = skip_setup
|
self.device_manager.skip_setup = skip_setup
|
||||||
|
self.device_manager.auto_reboot = auto_reboot
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@@ -574,6 +580,10 @@ class MainWindow(QtWidgets.QMainWindow):
|
|||||||
self.device_manager.skip_setup = checked
|
self.device_manager.skip_setup = checked
|
||||||
# save the setting
|
# save the setting
|
||||||
self.settings.setValue("skip_setup", checked)
|
self.settings.setValue("skip_setup", checked)
|
||||||
|
def on_autoRebootChk_toggled(self, checked: bool):
|
||||||
|
self.device_manager.auto_reboot = checked
|
||||||
|
# save the setting
|
||||||
|
self.settings.setValue("auto_reboot", checked)
|
||||||
|
|
||||||
# Device Options
|
# Device Options
|
||||||
def on_resetPairBtn_clicked(self):
|
def on_resetPairBtn_clicked(self):
|
||||||
|
|||||||
@@ -1566,7 +1566,7 @@ QToolButton:pressed {
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label">
|
<widget class="QLabel" name="label">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Nugget GUI - Version 3.1 (beta 4)</string>
|
<string>Nugget GUI - Version 4.0 (beta 5)</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="alignment">
|
<property name="alignment">
|
||||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
@@ -3885,6 +3885,16 @@ QComboBox QAbstractItemView::item:hover {
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="autoRebootChk">
|
||||||
|
<property name="text">
|
||||||
|
<string>Auto Reboot After Applying</string>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="Line" name="line_20">
|
<widget class="Line" name="line_20">
|
||||||
<property name="styleSheet">
|
<property name="styleSheet">
|
||||||
|
|||||||
@@ -2103,6 +2103,12 @@ class Ui_Nugget(object):
|
|||||||
|
|
||||||
self._21.addWidget(self.skipSetupChk)
|
self._21.addWidget(self.skipSetupChk)
|
||||||
|
|
||||||
|
self.autoRebootChk = QCheckBox(self.settingsPageContent)
|
||||||
|
self.autoRebootChk.setObjectName(u"autoRebootChk")
|
||||||
|
self.autoRebootChk.setChecked(True)
|
||||||
|
|
||||||
|
self._21.addWidget(self.autoRebootChk)
|
||||||
|
|
||||||
self.line_20 = QFrame(self.settingsPageContent)
|
self.line_20 = QFrame(self.settingsPageContent)
|
||||||
self.line_20.setObjectName(u"line_20")
|
self.line_20.setObjectName(u"line_20")
|
||||||
self.line_20.setStyleSheet(u"QFrame {\n"
|
self.line_20.setStyleSheet(u"QFrame {\n"
|
||||||
@@ -2694,7 +2700,7 @@ class Ui_Nugget(object):
|
|||||||
self.toolButton_15.setText(QCoreApplication.translate("Nugget", u"Additional Thanks", None))
|
self.toolButton_15.setText(QCoreApplication.translate("Nugget", u"Additional Thanks", None))
|
||||||
self.libiBtn.setText(QCoreApplication.translate("Nugget", u"pymobiledevice3", None))
|
self.libiBtn.setText(QCoreApplication.translate("Nugget", u"pymobiledevice3", None))
|
||||||
self.qtBtn.setText(QCoreApplication.translate("Nugget", u"Qt Creator", None))
|
self.qtBtn.setText(QCoreApplication.translate("Nugget", u"Qt Creator", None))
|
||||||
self.label.setText(QCoreApplication.translate("Nugget", u"Nugget GUI - Version 3.1 (beta 4)", None))
|
self.label.setText(QCoreApplication.translate("Nugget", u"Nugget GUI - Version 4.0 (beta 5)", None))
|
||||||
self.statusBarLbl.setText(QCoreApplication.translate("Nugget", u"Mobile Gestalt", None))
|
self.statusBarLbl.setText(QCoreApplication.translate("Nugget", u"Mobile Gestalt", None))
|
||||||
self.label_9.setText(QCoreApplication.translate("Nugget", u"Device Subtype Preset", None))
|
self.label_9.setText(QCoreApplication.translate("Nugget", u"Device Subtype Preset", None))
|
||||||
self.dynamicIslandDrp.setItemText(0, QCoreApplication.translate("Nugget", u"None", None))
|
self.dynamicIslandDrp.setItemText(0, QCoreApplication.translate("Nugget", u"None", None))
|
||||||
@@ -2794,6 +2800,7 @@ class Ui_Nugget(object):
|
|||||||
self.springboardOptionsLbl1.setText(QCoreApplication.translate("Nugget", u"Nugget Settings", None))
|
self.springboardOptionsLbl1.setText(QCoreApplication.translate("Nugget", u"Nugget Settings", None))
|
||||||
self.allowWifiApplyingChk.setText(QCoreApplication.translate("Nugget", u"Allow Applying Over WiFi", None))
|
self.allowWifiApplyingChk.setText(QCoreApplication.translate("Nugget", u"Allow Applying Over WiFi", None))
|
||||||
self.skipSetupChk.setText(QCoreApplication.translate("Nugget", u"Skip Setup (non-exploit files only)", None))
|
self.skipSetupChk.setText(QCoreApplication.translate("Nugget", u"Skip Setup (non-exploit files only)", None))
|
||||||
|
self.autoRebootChk.setText(QCoreApplication.translate("Nugget", u"Auto Reboot After Applying", None))
|
||||||
self.resetPairBtn.setText(QCoreApplication.translate("Nugget", u"Reset Device Pairing", None))
|
self.resetPairBtn.setText(QCoreApplication.translate("Nugget", u"Reset Device Pairing", None))
|
||||||
self.statusBarLbl_2.setText(QCoreApplication.translate("Nugget", u"Location Simulation", None))
|
self.statusBarLbl_2.setText(QCoreApplication.translate("Nugget", u"Location Simulation", None))
|
||||||
self.label_4.setText("")
|
self.label_4.setText("")
|
||||||
|
|||||||
@@ -2103,6 +2103,12 @@ class Ui_Nugget(object):
|
|||||||
|
|
||||||
self._21.addWidget(self.skipSetupChk)
|
self._21.addWidget(self.skipSetupChk)
|
||||||
|
|
||||||
|
self.autoRebootChk = QCheckBox(self.settingsPageContent)
|
||||||
|
self.autoRebootChk.setObjectName(u"autoRebootChk")
|
||||||
|
self.autoRebootChk.setChecked(True)
|
||||||
|
|
||||||
|
self._21.addWidget(self.autoRebootChk)
|
||||||
|
|
||||||
self.line_20 = QFrame(self.settingsPageContent)
|
self.line_20 = QFrame(self.settingsPageContent)
|
||||||
self.line_20.setObjectName(u"line_20")
|
self.line_20.setObjectName(u"line_20")
|
||||||
self.line_20.setStyleSheet(u"QFrame {\n"
|
self.line_20.setStyleSheet(u"QFrame {\n"
|
||||||
@@ -2694,7 +2700,7 @@ class Ui_Nugget(object):
|
|||||||
self.toolButton_15.setText(QCoreApplication.translate("Nugget", u"Additional Thanks", None))
|
self.toolButton_15.setText(QCoreApplication.translate("Nugget", u"Additional Thanks", None))
|
||||||
self.libiBtn.setText(QCoreApplication.translate("Nugget", u"pymobiledevice3", None))
|
self.libiBtn.setText(QCoreApplication.translate("Nugget", u"pymobiledevice3", None))
|
||||||
self.qtBtn.setText(QCoreApplication.translate("Nugget", u"Qt Creator", None))
|
self.qtBtn.setText(QCoreApplication.translate("Nugget", u"Qt Creator", None))
|
||||||
self.label.setText(QCoreApplication.translate("Nugget", u"Nugget GUI - Version 3.1 (beta 4)", None))
|
self.label.setText(QCoreApplication.translate("Nugget", u"Nugget GUI - Version 4.0 (beta 5)", None))
|
||||||
self.statusBarLbl.setText(QCoreApplication.translate("Nugget", u"Mobile Gestalt", None))
|
self.statusBarLbl.setText(QCoreApplication.translate("Nugget", u"Mobile Gestalt", None))
|
||||||
self.label_9.setText(QCoreApplication.translate("Nugget", u"Device Subtype Preset", None))
|
self.label_9.setText(QCoreApplication.translate("Nugget", u"Device Subtype Preset", None))
|
||||||
self.dynamicIslandDrp.setItemText(0, QCoreApplication.translate("Nugget", u"None", None))
|
self.dynamicIslandDrp.setItemText(0, QCoreApplication.translate("Nugget", u"None", None))
|
||||||
@@ -2794,6 +2800,7 @@ class Ui_Nugget(object):
|
|||||||
self.springboardOptionsLbl1.setText(QCoreApplication.translate("Nugget", u"Nugget Settings", None))
|
self.springboardOptionsLbl1.setText(QCoreApplication.translate("Nugget", u"Nugget Settings", None))
|
||||||
self.allowWifiApplyingChk.setText(QCoreApplication.translate("Nugget", u"Allow Applying Over WiFi", None))
|
self.allowWifiApplyingChk.setText(QCoreApplication.translate("Nugget", u"Allow Applying Over WiFi", None))
|
||||||
self.skipSetupChk.setText(QCoreApplication.translate("Nugget", u"Skip Setup (non-exploit files only)", None))
|
self.skipSetupChk.setText(QCoreApplication.translate("Nugget", u"Skip Setup (non-exploit files only)", None))
|
||||||
|
self.autoRebootChk.setText(QCoreApplication.translate("Nugget", u"Auto Reboot After Applying", None))
|
||||||
self.resetPairBtn.setText(QCoreApplication.translate("Nugget", u"Reset Device Pairing", None))
|
self.resetPairBtn.setText(QCoreApplication.translate("Nugget", u"Reset Device Pairing", None))
|
||||||
self.statusBarLbl_2.setText(QCoreApplication.translate("Nugget", u"Location Simulation", None))
|
self.statusBarLbl_2.setText(QCoreApplication.translate("Nugget", u"Location Simulation", None))
|
||||||
self.label_4.setText("")
|
self.label_4.setText("")
|
||||||
|
|||||||
Reference in New Issue
Block a user