mirror of
https://github.com/leminlimez/Nugget.git
synced 2025-04-08 04:23:05 +08:00
fix daemons not restoring + file ownership
This commit is contained in:
@@ -20,6 +20,9 @@ def concat_exploit_file(file: FileToRestore, files_list: list[FileToRestore], la
|
|||||||
base_path = "/private/var/mobile/backup"
|
base_path = "/private/var/mobile/backup"
|
||||||
elif file.restore_path.startswith("/private/var/"):
|
elif file.restore_path.startswith("/private/var/"):
|
||||||
base_path = "/private/var/backup"
|
base_path = "/private/var/backup"
|
||||||
|
elif file.owner == 0 and file.group == 0:
|
||||||
|
# restore straight to the file since it won't restore otherwise
|
||||||
|
base_path = ""
|
||||||
# don't append the directory if it has already been added (restore will fail)
|
# don't append the directory if it has already been added (restore will fail)
|
||||||
path, name = os.path.split(file.restore_path)
|
path, name = os.path.split(file.restore_path)
|
||||||
domain_path = f"SysContainerDomain-../../../../../../../..{base_path}{path}/"
|
domain_path = f"SysContainerDomain-../../../../../../../..{base_path}{path}/"
|
||||||
@@ -27,14 +30,14 @@ def concat_exploit_file(file: FileToRestore, files_list: list[FileToRestore], la
|
|||||||
if last_domain != domain_path:
|
if last_domain != domain_path:
|
||||||
files_list.append(backup.Directory(
|
files_list.append(backup.Directory(
|
||||||
"",
|
"",
|
||||||
f"{domain_path}/",
|
f"{domain_path}",
|
||||||
owner=file.owner,
|
owner=file.owner,
|
||||||
group=file.group
|
group=file.group
|
||||||
))
|
))
|
||||||
new_last_domain = domain_path
|
new_last_domain = domain_path
|
||||||
files_list.append(backup.ConcreteFile(
|
files_list.append(backup.ConcreteFile(
|
||||||
"",
|
"",
|
||||||
f"{domain_path}/{name}",
|
f"{domain_path}{name}",
|
||||||
owner=file.owner,
|
owner=file.owner,
|
||||||
group=file.group,
|
group=file.group,
|
||||||
contents=file.contents
|
contents=file.contents
|
||||||
|
|||||||
@@ -235,6 +235,7 @@ class DeviceManager:
|
|||||||
))
|
))
|
||||||
|
|
||||||
def get_domain_for_path(self, path: str, fully_patched: bool = False) -> str:
|
def get_domain_for_path(self, path: str, fully_patched: bool = False) -> str:
|
||||||
|
# returns Domain: str?, Path: str
|
||||||
# just make the Sys Containers to use the regular way (won't work for mga)
|
# just make the Sys Containers to use the regular way (won't work for mga)
|
||||||
sysSharedContainer = "SysSharedContainerDomain-"
|
sysSharedContainer = "SysSharedContainerDomain-"
|
||||||
sysContainer = "SysContainerDomain-"
|
sysContainer = "SysContainerDomain-"
|
||||||
@@ -263,18 +264,20 @@ class DeviceManager:
|
|||||||
return new_domain, new_path
|
return new_domain, new_path
|
||||||
return None, path
|
return None, path
|
||||||
|
|
||||||
def concat_file(self, contents: str, path: str, files_to_restore: list[FileToRestore]):
|
def concat_file(self, contents: str, path: str, files_to_restore: list[FileToRestore], owner: int = 501, group: int = 501):
|
||||||
if self.get_current_device_supported():
|
if self.get_current_device_supported():
|
||||||
files_to_restore.append(FileToRestore(
|
files_to_restore.append(FileToRestore(
|
||||||
contents=contents,
|
contents=contents,
|
||||||
restore_path=path
|
restore_path=path,
|
||||||
|
owner=owner, group=group
|
||||||
))
|
))
|
||||||
else:
|
else:
|
||||||
domain, file_path = self.get_domain_for_path(path, fully_patched=self.get_current_device_patched())
|
domain, file_path = self.get_domain_for_path(path, fully_patched=self.get_current_device_patched())
|
||||||
files_to_restore.append(FileToRestore(
|
files_to_restore.append(FileToRestore(
|
||||||
contents=contents,
|
contents=contents,
|
||||||
restore_path=file_path,
|
restore_path=file_path,
|
||||||
domain=domain
|
domain=domain,
|
||||||
|
owner=owner, group=group
|
||||||
))
|
))
|
||||||
|
|
||||||
## APPLYING OR REMOVING TWEAKS AND RESTORING
|
## APPLYING OR REMOVING TWEAKS AND RESTORING
|
||||||
@@ -291,6 +294,7 @@ class DeviceManager:
|
|||||||
eligibility_files = None
|
eligibility_files = None
|
||||||
ai_file = None
|
ai_file = None
|
||||||
basic_plists: dict = {}
|
basic_plists: dict = {}
|
||||||
|
basic_plists_ownership: dict = {}
|
||||||
|
|
||||||
# set the plist keys
|
# set the plist keys
|
||||||
if not resetting:
|
if not resetting:
|
||||||
@@ -304,6 +308,7 @@ class DeviceManager:
|
|||||||
ai_file = tweak.apply_tweak()
|
ai_file = tweak.apply_tweak()
|
||||||
elif isinstance(tweak, BasicPlistTweak) or isinstance(tweak, RdarFixTweak) or isinstance(tweak, AdvancedPlistTweak):
|
elif isinstance(tweak, BasicPlistTweak) or isinstance(tweak, RdarFixTweak) or isinstance(tweak, AdvancedPlistTweak):
|
||||||
basic_plists = tweak.apply_tweak(basic_plists, self.allow_risky_tweaks)
|
basic_plists = tweak.apply_tweak(basic_plists, self.allow_risky_tweaks)
|
||||||
|
basic_plists_ownership[tweak.file_location] = tweak.owner
|
||||||
else:
|
else:
|
||||||
if gestalt_plist != None:
|
if gestalt_plist != None:
|
||||||
gestalt_plist = tweak.apply_tweak(gestalt_plist)
|
gestalt_plist = tweak.apply_tweak(gestalt_plist)
|
||||||
@@ -354,10 +359,12 @@ class DeviceManager:
|
|||||||
files_to_restore=files_to_restore
|
files_to_restore=files_to_restore
|
||||||
)
|
)
|
||||||
for location, plist in basic_plists.items():
|
for location, plist in basic_plists.items():
|
||||||
|
ownership = basic_plists_ownership[location]
|
||||||
self.concat_file(
|
self.concat_file(
|
||||||
contents=plistlib.dumps(plist),
|
contents=plistlib.dumps(plist),
|
||||||
path=location.value,
|
path=location.value,
|
||||||
files_to_restore=files_to_restore
|
files_to_restore=files_to_restore,
|
||||||
|
owner=ownership, group=ownership
|
||||||
)
|
)
|
||||||
# reset basic tweaks
|
# reset basic tweaks
|
||||||
if resetting:
|
if resetting:
|
||||||
|
|||||||
@@ -117,6 +117,7 @@ class MainWindow(QtWidgets.QMainWindow):
|
|||||||
self.ui.notifyPastesChk.toggled.connect(self.on_notifyPastesChk_clicked)
|
self.ui.notifyPastesChk.toggled.connect(self.on_notifyPastesChk_clicked)
|
||||||
|
|
||||||
## DAEMONS PAGE ACTIONS
|
## DAEMONS PAGE ACTIONS
|
||||||
|
self.ui.modifyDaemonsChk.toggled.connect(self.on_modifyDaemonsChk_clicked)
|
||||||
self.ui.thermalmonitordChk.toggled.connect(self.on_thermalmonitordChk_clicked)
|
self.ui.thermalmonitordChk.toggled.connect(self.on_thermalmonitordChk_clicked)
|
||||||
self.ui.otadChk.toggled.connect(self.on_otadChk_clicked)
|
self.ui.otadChk.toggled.connect(self.on_otadChk_clicked)
|
||||||
self.ui.usageTrackingAgentChk.toggled.connect(self.on_usageTrackingAgentChk_clicked)
|
self.ui.usageTrackingAgentChk.toggled.connect(self.on_usageTrackingAgentChk_clicked)
|
||||||
@@ -259,9 +260,9 @@ class MainWindow(QtWidgets.QMainWindow):
|
|||||||
if self.device_manager.get_current_device_model().startswith("iPhone"):
|
if self.device_manager.get_current_device_model().startswith("iPhone"):
|
||||||
# re-enable iPhone spoof models
|
# re-enable iPhone spoof models
|
||||||
self.ui.spoofedModelDrp.addItems(spoof_drp_options[:6])
|
self.ui.spoofedModelDrp.addItems(spoof_drp_options[:6])
|
||||||
else:
|
# add iPad models on phones (for testing)
|
||||||
# re-enable iPad spoof models
|
# re-enable iPad spoof models
|
||||||
self.ui.spoofedModelDrp.addItems(spoof_drp_options[6:])
|
self.ui.spoofedModelDrp.addItems(spoof_drp_options[6:])
|
||||||
|
|
||||||
def change_selected_device(self, index):
|
def change_selected_device(self, index):
|
||||||
if len(self.device_manager.devices) > 0:
|
if len(self.device_manager.devices) > 0:
|
||||||
@@ -703,20 +704,48 @@ class MainWindow(QtWidgets.QMainWindow):
|
|||||||
tweaks["AnnounceAllPastes"].set_enabled(checked)
|
tweaks["AnnounceAllPastes"].set_enabled(checked)
|
||||||
|
|
||||||
## DAEMONS PAGE
|
## DAEMONS PAGE
|
||||||
|
def on_modifyDaemonsChk_clicked(self, checked: bool):
|
||||||
|
tweaks["Daemons"].set_enabled(checked)
|
||||||
|
self.ui.daemonsPageContent.setDisabled(not checked)
|
||||||
|
|
||||||
def on_thermalmonitordChk_clicked(self, checked: bool):
|
def on_thermalmonitordChk_clicked(self, checked: bool):
|
||||||
tweaks["DisableThermalmonitord"].set_enabled(checked)
|
tweaks["Daemons"].value["com.apple.thermalmonitord"] = checked
|
||||||
def on_otadChk_clicked(self, checked: bool):
|
def on_otadChk_clicked(self, checked: bool):
|
||||||
tweaks["DisableOTADaemon"].set_enabled(checked)
|
tweaks["Daemons"].set_multiple_values([
|
||||||
|
"com.apple.mobile.softwareupdated",
|
||||||
|
"com.apple.OTATaskingAgent",
|
||||||
|
"com.apple.softwareupdateservicesd"
|
||||||
|
], value=checked)
|
||||||
def on_usageTrackingAgentChk_clicked(self, checked: bool):
|
def on_usageTrackingAgentChk_clicked(self, checked: bool):
|
||||||
tweaks["DisableUsageTracking"].set_enabled(checked)
|
tweaks["Daemons"].value["com.apple.UsageTrackingAgent"] = checked
|
||||||
def on_gameCenterChk_clicked(self, checked: bool):
|
def on_gameCenterChk_clicked(self, checked: bool):
|
||||||
tweaks["DisableGameCenter"].set_enabled(checked)
|
tweaks["Daemons"].value["com.apple.gamed"] = checked
|
||||||
def on_screenTimeChk_clicked(self, checked: bool):
|
def on_screenTimeChk_clicked(self, checked: bool):
|
||||||
tweaks["DisableScreenTime"].set_enabled(checked)
|
tweaks["Daemons"].value["com.apple.ScreenTimeAgent"] = checked
|
||||||
def on_crashReportsChk_clicked(self, checked: bool):
|
def on_crashReportsChk_clicked(self, checked: bool):
|
||||||
tweaks["DisableCrashReports"].set_enabled(checked)
|
tweaks["Daemons"].set_multiple_values([
|
||||||
|
"com.apple.ReportCrash",
|
||||||
|
"com.apple.ReportCrash.Jetsam",
|
||||||
|
"com.apple.ReportMemoryException",
|
||||||
|
"com.apple.OTACrashCopier",
|
||||||
|
"com.apple.analyticsd",
|
||||||
|
"com.apple.aslmanager",
|
||||||
|
"com.apple.coresymbolicationd",
|
||||||
|
"com.apple.crash_mover",
|
||||||
|
"com.apple.crashreportcopymobile",
|
||||||
|
"com.apple.DumpBasebandCrash",
|
||||||
|
"com.apple.DumpPanic",
|
||||||
|
"com.apple.logd",
|
||||||
|
"com.apple.logd.admin",
|
||||||
|
"com.apple.logd.events",
|
||||||
|
"com.apple.logd.watchdog",
|
||||||
|
"com.apple.logd_reporter",
|
||||||
|
"com.apple.logd_reporter.report_statistics",
|
||||||
|
"com.apple.system.logger",
|
||||||
|
"com.apple.syslogd"
|
||||||
|
], value=checked)
|
||||||
def on_tipsChk_clicked(self, checked: bool):
|
def on_tipsChk_clicked(self, checked: bool):
|
||||||
tweaks["DisableTips"].set_enabled(checked)
|
tweaks["Daemons"].value["com.apple.tipsd"] = checked
|
||||||
|
|
||||||
## Risky Options Page
|
## Risky Options Page
|
||||||
def on_disableOTAChk_clicked(self, checked: bool):
|
def on_disableOTAChk_clicked(self, checked: bool):
|
||||||
|
|||||||
@@ -1571,7 +1571,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 4.2 (beta 1)</string>
|
<string>Nugget GUI - Version 4.2 (beta 2)</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>
|
||||||
@@ -3634,20 +3634,11 @@ QComboBox QAbstractItemView::item:hover {
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<spacer name="verticalSpacer_18">
|
<widget class="QCheckBox" name="modifyDaemonsChk">
|
||||||
<property name="orientation">
|
<property name="text">
|
||||||
<enum>Qt::Vertical</enum>
|
<string>Modify</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeType">
|
</widget>
|
||||||
<enum>QSizePolicy::Fixed</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>16</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -3686,7 +3677,7 @@ QComboBox QAbstractItemView::item:hover {
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QWidget" name="daemonsPageContent" native="true">
|
<widget class="QWidget" name="daemonsPageContent" native="true">
|
||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
<bool>true</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_13">
|
<layout class="QVBoxLayout" name="verticalLayout_13">
|
||||||
<property name="leftMargin">
|
<property name="leftMargin">
|
||||||
|
|||||||
@@ -1942,9 +1942,10 @@ class Ui_Nugget(object):
|
|||||||
|
|
||||||
self.verticalLayout_122.addWidget(self.daemonsLbl)
|
self.verticalLayout_122.addWidget(self.daemonsLbl)
|
||||||
|
|
||||||
self.verticalSpacer_181 = QSpacerItem(20, 16, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Fixed)
|
self.modifyDaemonsChk = QCheckBox(self.verticalWidget_42)
|
||||||
|
self.modifyDaemonsChk.setObjectName(u"modifyDaemonsChk")
|
||||||
|
|
||||||
self.verticalLayout_122.addItem(self.verticalSpacer_181)
|
self.verticalLayout_122.addWidget(self.modifyDaemonsChk)
|
||||||
|
|
||||||
|
|
||||||
self.horizontalLayout_202.addWidget(self.verticalWidget_42)
|
self.horizontalLayout_202.addWidget(self.verticalWidget_42)
|
||||||
@@ -1968,7 +1969,7 @@ class Ui_Nugget(object):
|
|||||||
|
|
||||||
self.daemonsPageContent = QWidget(self.daemonsPage)
|
self.daemonsPageContent = QWidget(self.daemonsPage)
|
||||||
self.daemonsPageContent.setObjectName(u"daemonsPageContent")
|
self.daemonsPageContent.setObjectName(u"daemonsPageContent")
|
||||||
self.daemonsPageContent.setEnabled(True)
|
self.daemonsPageContent.setEnabled(False)
|
||||||
self.verticalLayout_132 = QVBoxLayout(self.daemonsPageContent)
|
self.verticalLayout_132 = QVBoxLayout(self.daemonsPageContent)
|
||||||
self.verticalLayout_132.setObjectName(u"verticalLayout_132")
|
self.verticalLayout_132.setObjectName(u"verticalLayout_132")
|
||||||
self.verticalLayout_132.setContentsMargins(0, 0, 0, 0)
|
self.verticalLayout_132.setContentsMargins(0, 0, 0, 0)
|
||||||
@@ -2052,9 +2053,9 @@ class Ui_Nugget(object):
|
|||||||
|
|
||||||
self.verticalLayout_123.addWidget(self.advancedOptionsLbl)
|
self.verticalLayout_123.addWidget(self.advancedOptionsLbl)
|
||||||
|
|
||||||
self.verticalSpacer_182 = QSpacerItem(20, 16, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Fixed)
|
self.verticalSpacer_181 = QSpacerItem(20, 16, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Fixed)
|
||||||
|
|
||||||
self.verticalLayout_123.addItem(self.verticalSpacer_182)
|
self.verticalLayout_123.addItem(self.verticalSpacer_181)
|
||||||
|
|
||||||
|
|
||||||
self.horizontalLayout_203.addWidget(self.verticalWidget_43)
|
self.horizontalLayout_203.addWidget(self.verticalWidget_43)
|
||||||
@@ -3079,7 +3080,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 4.2 (beta 1)", None))
|
self.label.setText(QCoreApplication.translate("Nugget", u"Nugget GUI - Version 4.2 (beta 2)", None))
|
||||||
self.statusBarLbl.setText(QCoreApplication.translate("Nugget", u"Mobile Gestalt", None))
|
self.statusBarLbl.setText(QCoreApplication.translate("Nugget", u"Mobile Gestalt", None))
|
||||||
self.mgaWarningLbl.setText(QCoreApplication.translate("Nugget", u"! You will need a MobileGestalt file for this feature. Please select it in the Apply page !", None))
|
self.mgaWarningLbl.setText(QCoreApplication.translate("Nugget", u"! You will need a MobileGestalt file for this feature. Please select it in the Apply page !", 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))
|
||||||
@@ -3196,6 +3197,7 @@ class Ui_Nugget(object):
|
|||||||
self.pasteSoundChk.setText(QCoreApplication.translate("Nugget", u"Play Sound on Paste", None))
|
self.pasteSoundChk.setText(QCoreApplication.translate("Nugget", u"Play Sound on Paste", None))
|
||||||
self.notifyPastesChk.setText(QCoreApplication.translate("Nugget", u"Show Notifications for System Pastes", None))
|
self.notifyPastesChk.setText(QCoreApplication.translate("Nugget", u"Show Notifications for System Pastes", None))
|
||||||
self.daemonsLbl.setText(QCoreApplication.translate("Nugget", u"Daemons", None))
|
self.daemonsLbl.setText(QCoreApplication.translate("Nugget", u"Daemons", None))
|
||||||
|
self.modifyDaemonsChk.setText(QCoreApplication.translate("Nugget", u"Modify", None))
|
||||||
self.thermalmonitordChk.setText(QCoreApplication.translate("Nugget", u"Disable thermalmonitord", None))
|
self.thermalmonitordChk.setText(QCoreApplication.translate("Nugget", u"Disable thermalmonitord", None))
|
||||||
self.otadChk.setText(QCoreApplication.translate("Nugget", u"Disable OTA", None))
|
self.otadChk.setText(QCoreApplication.translate("Nugget", u"Disable OTA", None))
|
||||||
self.usageTrackingAgentChk.setText(QCoreApplication.translate("Nugget", u"Disable UsageTrackingAgent", None))
|
self.usageTrackingAgentChk.setText(QCoreApplication.translate("Nugget", u"Disable UsageTrackingAgent", None))
|
||||||
|
|||||||
@@ -1942,9 +1942,10 @@ class Ui_Nugget(object):
|
|||||||
|
|
||||||
self.verticalLayout_122.addWidget(self.daemonsLbl)
|
self.verticalLayout_122.addWidget(self.daemonsLbl)
|
||||||
|
|
||||||
self.verticalSpacer_181 = QSpacerItem(20, 16, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Fixed)
|
self.modifyDaemonsChk = QCheckBox(self.verticalWidget_42)
|
||||||
|
self.modifyDaemonsChk.setObjectName(u"modifyDaemonsChk")
|
||||||
|
|
||||||
self.verticalLayout_122.addItem(self.verticalSpacer_181)
|
self.verticalLayout_122.addWidget(self.modifyDaemonsChk)
|
||||||
|
|
||||||
|
|
||||||
self.horizontalLayout_202.addWidget(self.verticalWidget_42)
|
self.horizontalLayout_202.addWidget(self.verticalWidget_42)
|
||||||
@@ -1968,7 +1969,7 @@ class Ui_Nugget(object):
|
|||||||
|
|
||||||
self.daemonsPageContent = QWidget(self.daemonsPage)
|
self.daemonsPageContent = QWidget(self.daemonsPage)
|
||||||
self.daemonsPageContent.setObjectName(u"daemonsPageContent")
|
self.daemonsPageContent.setObjectName(u"daemonsPageContent")
|
||||||
self.daemonsPageContent.setEnabled(True)
|
self.daemonsPageContent.setEnabled(False)
|
||||||
self.verticalLayout_132 = QVBoxLayout(self.daemonsPageContent)
|
self.verticalLayout_132 = QVBoxLayout(self.daemonsPageContent)
|
||||||
self.verticalLayout_132.setObjectName(u"verticalLayout_132")
|
self.verticalLayout_132.setObjectName(u"verticalLayout_132")
|
||||||
self.verticalLayout_132.setContentsMargins(0, 0, 0, 0)
|
self.verticalLayout_132.setContentsMargins(0, 0, 0, 0)
|
||||||
@@ -2052,9 +2053,9 @@ class Ui_Nugget(object):
|
|||||||
|
|
||||||
self.verticalLayout_123.addWidget(self.advancedOptionsLbl)
|
self.verticalLayout_123.addWidget(self.advancedOptionsLbl)
|
||||||
|
|
||||||
self.verticalSpacer_182 = QSpacerItem(20, 16, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Fixed)
|
self.verticalSpacer_181 = QSpacerItem(20, 16, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Fixed)
|
||||||
|
|
||||||
self.verticalLayout_123.addItem(self.verticalSpacer_182)
|
self.verticalLayout_123.addItem(self.verticalSpacer_181)
|
||||||
|
|
||||||
|
|
||||||
self.horizontalLayout_203.addWidget(self.verticalWidget_43)
|
self.horizontalLayout_203.addWidget(self.verticalWidget_43)
|
||||||
@@ -3079,7 +3080,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 4.2 (beta 1)", None))
|
self.label.setText(QCoreApplication.translate("Nugget", u"Nugget GUI - Version 4.2 (beta 2)", None))
|
||||||
self.statusBarLbl.setText(QCoreApplication.translate("Nugget", u"Mobile Gestalt", None))
|
self.statusBarLbl.setText(QCoreApplication.translate("Nugget", u"Mobile Gestalt", None))
|
||||||
self.mgaWarningLbl.setText(QCoreApplication.translate("Nugget", u"! You will need a MobileGestalt file for this feature. Please select it in the Apply page !", None))
|
self.mgaWarningLbl.setText(QCoreApplication.translate("Nugget", u"! You will need a MobileGestalt file for this feature. Please select it in the Apply page !", 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))
|
||||||
@@ -3196,6 +3197,7 @@ class Ui_Nugget(object):
|
|||||||
self.pasteSoundChk.setText(QCoreApplication.translate("Nugget", u"Play Sound on Paste", None))
|
self.pasteSoundChk.setText(QCoreApplication.translate("Nugget", u"Play Sound on Paste", None))
|
||||||
self.notifyPastesChk.setText(QCoreApplication.translate("Nugget", u"Show Notifications for System Pastes", None))
|
self.notifyPastesChk.setText(QCoreApplication.translate("Nugget", u"Show Notifications for System Pastes", None))
|
||||||
self.daemonsLbl.setText(QCoreApplication.translate("Nugget", u"Daemons", None))
|
self.daemonsLbl.setText(QCoreApplication.translate("Nugget", u"Daemons", None))
|
||||||
|
self.modifyDaemonsChk.setText(QCoreApplication.translate("Nugget", u"Modify", None))
|
||||||
self.thermalmonitordChk.setText(QCoreApplication.translate("Nugget", u"Disable thermalmonitord", None))
|
self.thermalmonitordChk.setText(QCoreApplication.translate("Nugget", u"Disable thermalmonitord", None))
|
||||||
self.otadChk.setText(QCoreApplication.translate("Nugget", u"Disable OTA", None))
|
self.otadChk.setText(QCoreApplication.translate("Nugget", u"Disable OTA", None))
|
||||||
self.usageTrackingAgentChk.setText(QCoreApplication.translate("Nugget", u"Disable UsageTrackingAgent", None))
|
self.usageTrackingAgentChk.setText(QCoreApplication.translate("Nugget", u"Disable UsageTrackingAgent", None))
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ class Tweak:
|
|||||||
value: any = 1,
|
value: any = 1,
|
||||||
edit_type: TweakModifyType = TweakModifyType.TOGGLE,
|
edit_type: TweakModifyType = TweakModifyType.TOGGLE,
|
||||||
min_version: Version = Version("1.0"),
|
min_version: Version = Version("1.0"),
|
||||||
|
owner: int = 501, group: int = 501,
|
||||||
divider_below: bool = False
|
divider_below: bool = False
|
||||||
):
|
):
|
||||||
self.label = label
|
self.label = label
|
||||||
@@ -22,6 +23,8 @@ class Tweak:
|
|||||||
self.value = value
|
self.value = value
|
||||||
self.min_version = min_version
|
self.min_version = min_version
|
||||||
self.edit_type = edit_type
|
self.edit_type = edit_type
|
||||||
|
self.owner = owner
|
||||||
|
self.group = group
|
||||||
self.divider_below = divider_below
|
self.divider_below = divider_below
|
||||||
self.enabled = False
|
self.enabled = False
|
||||||
|
|
||||||
@@ -49,10 +52,11 @@ class BasicPlistTweak(Tweak):
|
|||||||
value: any = True,
|
value: any = True,
|
||||||
edit_type: TweakModifyType = TweakModifyType.TOGGLE,
|
edit_type: TweakModifyType = TweakModifyType.TOGGLE,
|
||||||
min_version: Version = Version("1.0"),
|
min_version: Version = Version("1.0"),
|
||||||
|
owner: int = 501, group: int = 501,
|
||||||
is_risky: bool = False,
|
is_risky: bool = False,
|
||||||
divider_below: bool = False
|
divider_below: bool = False
|
||||||
):
|
):
|
||||||
super().__init__(label=label, key=key, subkey=None, value=value, edit_type=edit_type, min_version=min_version, divider_below=divider_below)
|
super().__init__(label=label, key=key, subkey=None, value=value, edit_type=edit_type, min_version=min_version, owner=owner, group=group, divider_below=divider_below)
|
||||||
self.file_location = file_location
|
self.file_location = file_location
|
||||||
self.is_risky = is_risky
|
self.is_risky = is_risky
|
||||||
|
|
||||||
@@ -72,10 +76,15 @@ class AdvancedPlistTweak(BasicPlistTweak):
|
|||||||
keyValues: dict,
|
keyValues: dict,
|
||||||
edit_type: TweakModifyType = TweakModifyType.TOGGLE,
|
edit_type: TweakModifyType = TweakModifyType.TOGGLE,
|
||||||
min_version: Version = Version("1.0"),
|
min_version: Version = Version("1.0"),
|
||||||
|
owner: int = 501, group: int = 501,
|
||||||
is_risky: bool = False,
|
is_risky: bool = False,
|
||||||
divider_below: bool = False
|
divider_below: bool = False
|
||||||
):
|
):
|
||||||
super().__init__(label=label, file_location=file_location, key=None, value=keyValues, edit_type=edit_type, min_version=min_version, is_risky=is_risky, divider_below=divider_below)
|
super().__init__(label=label, file_location=file_location, key=None, value=keyValues, edit_type=edit_type, min_version=min_version, owner=owner, group=group, is_risky=is_risky, divider_below=divider_below)
|
||||||
|
|
||||||
|
def set_multiple_values(self, keys: list[str], value: any):
|
||||||
|
for key in keys:
|
||||||
|
self.value[key] = value
|
||||||
|
|
||||||
def apply_tweak(self, other_tweaks: dict, risky_allowed: bool = False) -> dict:
|
def apply_tweak(self, other_tweaks: dict, risky_allowed: bool = False) -> dict:
|
||||||
if not self.enabled or (self.is_risky and not risky_allowed):
|
if not self.enabled or (self.is_risky and not risky_allowed):
|
||||||
|
|||||||
@@ -2,15 +2,6 @@ from devicemanagement.constants import Version
|
|||||||
from .tweak_classes import MobileGestaltTweak, MobileGestaltMultiTweak, MobileGestaltPickerTweak, FeatureFlagTweak, TweakModifyType, BasicPlistTweak, AdvancedPlistTweak, RdarFixTweak
|
from .tweak_classes import MobileGestaltTweak, MobileGestaltMultiTweak, MobileGestaltPickerTweak, FeatureFlagTweak, TweakModifyType, BasicPlistTweak, AdvancedPlistTweak, RdarFixTweak
|
||||||
from .eligibility_tweak import EligibilityTweak, AITweak
|
from .eligibility_tweak import EligibilityTweak, AITweak
|
||||||
from .basic_plist_locations import FileLocation
|
from .basic_plist_locations import FileLocation
|
||||||
|
|
||||||
default_disabled_daemons = {
|
|
||||||
"com.apple.magicswitchd.companion": True,
|
|
||||||
"com.apple.security.otpaird": True,
|
|
||||||
"com.apple.dhcp6d": True,
|
|
||||||
"com.apple.bootpd": True,
|
|
||||||
"com.apple.ftp-proxy-embedded": False,
|
|
||||||
"com.apple.relevanced": True
|
|
||||||
}
|
|
||||||
|
|
||||||
tweaks = {
|
tweaks = {
|
||||||
## MobileGestalt Tweaks
|
## MobileGestalt Tweaks
|
||||||
@@ -278,66 +269,18 @@ tweaks = {
|
|||||||
),
|
),
|
||||||
|
|
||||||
## Daemons
|
## Daemons
|
||||||
"DisableThermalmonitord": AdvancedPlistTweak(
|
"Daemons": AdvancedPlistTweak(
|
||||||
"Disable thermalmonitord",
|
"Disable Daemons",
|
||||||
FileLocation.disabledDaemons,
|
FileLocation.disabledDaemons,
|
||||||
default_disabled_daemons.copy().update({"com.apple.thermalmonitord": True})
|
{
|
||||||
),
|
"com.apple.magicswitchd.companion": True,
|
||||||
"DisableOTADaemon": AdvancedPlistTweak(
|
"com.apple.security.otpaird": True,
|
||||||
"Disable OTA (daemon)",
|
"com.apple.dhcp6d": True,
|
||||||
FileLocation.disabledDaemons,
|
"com.apple.bootpd": True,
|
||||||
default_disabled_daemons.copy().update({
|
"com.apple.ftp-proxy-embedded": False,
|
||||||
"com.apple.mobile.softwareupdated": True,
|
"com.apple.relevanced": True
|
||||||
"com.apple.OTATaskingAgent": True,
|
},
|
||||||
"com.apple.softwareupdateservicesd": True
|
owner=0, group=0
|
||||||
})
|
|
||||||
),
|
|
||||||
"DisableUsageTracking": AdvancedPlistTweak(
|
|
||||||
"Disable Usage Tracking",
|
|
||||||
FileLocation.disabledDaemons,
|
|
||||||
default_disabled_daemons.copy().update({
|
|
||||||
"com.apple.UsageTrackingAgent": True
|
|
||||||
})
|
|
||||||
),
|
|
||||||
"DisableGameCenter": AdvancedPlistTweak(
|
|
||||||
"Disable Game Center",
|
|
||||||
FileLocation.disabledDaemons,
|
|
||||||
default_disabled_daemons.copy().update({"com.apple.gamed": True})
|
|
||||||
),
|
|
||||||
"DisableScreenTime": AdvancedPlistTweak(
|
|
||||||
"Disable Screen Time Agent",
|
|
||||||
FileLocation.disabledDaemons,
|
|
||||||
default_disabled_daemons.copy().update({"com.apple.ScreenTimeAgent": True})
|
|
||||||
),
|
|
||||||
"DisableCrashReports": AdvancedPlistTweak(
|
|
||||||
"Disable Usage Tracking",
|
|
||||||
FileLocation.disabledDaemons,
|
|
||||||
default_disabled_daemons.copy().update({
|
|
||||||
"com.apple.ReportCrash": True,
|
|
||||||
"com.apple.ReportCrash.Jetsam": True,
|
|
||||||
"com.apple.ReportMemoryException": True,
|
|
||||||
"com.apple.OTACrashCopier": True,
|
|
||||||
"com.apple.analyticsd": True,
|
|
||||||
"com.apple.aslmanager": True,
|
|
||||||
"com.apple.coresymbolicationd": True,
|
|
||||||
"com.apple.crash_mover": True,
|
|
||||||
"com.apple.crashreportcopymobile": True,
|
|
||||||
"com.apple.DumpBasebandCrash": True,
|
|
||||||
"com.apple.DumpPanic": True,
|
|
||||||
"com.apple.logd": True,
|
|
||||||
"com.apple.logd.admin": True,
|
|
||||||
"com.apple.logd.events": True,
|
|
||||||
"com.apple.logd.watchdog": True,
|
|
||||||
"com.apple.logd_reporter": True,
|
|
||||||
"com.apple.logd_reporter.report_statistics": True,
|
|
||||||
"com.apple.system.logger": True,
|
|
||||||
"com.apple.syslogd": True
|
|
||||||
})
|
|
||||||
),
|
|
||||||
"DisableTips": AdvancedPlistTweak(
|
|
||||||
"Disable Tips",
|
|
||||||
FileLocation.disabledDaemons,
|
|
||||||
default_disabled_daemons.copy().update({"com.apple.tipsd": True})
|
|
||||||
),
|
),
|
||||||
|
|
||||||
## Risky Options
|
## Risky Options
|
||||||
|
|||||||
Reference in New Issue
Block a user