mirror of
https://github.com/leminlimez/Nugget.git
synced 2025-04-08 04:23:05 +08:00
toggle cpu and hardware spoofing
This commit is contained in:
@@ -18,7 +18,7 @@ from tweaks.tweaks import tweaks
|
||||
from tweaks.custom_gestalt_tweaks import CustomGestaltTweaks, ValueTypeStrings
|
||||
|
||||
App_Version = "4.2"
|
||||
App_Build = 5
|
||||
App_Build = 6
|
||||
|
||||
class Page(Enum):
|
||||
Home = 0
|
||||
@@ -97,6 +97,8 @@ class MainWindow(QtWidgets.QMainWindow):
|
||||
self.ui.languageLbl.hide() # to be removed later
|
||||
self.ui.languageTxt.textEdited.connect(self.on_languageTxt_textEdited)
|
||||
self.ui.spoofedModelDrp.activated.connect(self.on_spoofedModelDrp_activated)
|
||||
self.ui.spoofHardwareChk.toggled.connect(self.on_spoofHardwareChk_toggled)
|
||||
self.ui.spoofCPUChk.toggled.connect(self.on_spoofCPUChk_toggled)
|
||||
|
||||
## FEATURE FLAGS PAGE
|
||||
self.ui.clockAnimChk.toggled.connect(self.on_clockAnimChk_toggled)
|
||||
@@ -681,13 +683,13 @@ class MainWindow(QtWidgets.QMainWindow):
|
||||
if not self.device_manager.show_all_spoofable_models and not self.device_manager.get_current_device_model().startswith("iPhone"):
|
||||
# offset the index for ipads
|
||||
idx_to_apply += 6
|
||||
tweaks["SpoofModel"].set_selected_option(idx_to_apply)
|
||||
tweaks["SpoofHardware"].set_selected_option(idx_to_apply)
|
||||
tweaks["SpoofCPU"].set_selected_option(idx_to_apply)
|
||||
if index == 0:
|
||||
tweaks["SpoofModel"].set_enabled(False)
|
||||
tweaks["SpoofHardware"].set_enabled(False)
|
||||
tweaks["SpoofCPU"].set_enabled(False)
|
||||
tweaks["SpoofModel"].set_selected_option(idx_to_apply, is_enabled=(index != 0))
|
||||
tweaks["SpoofHardware"].set_selected_option(idx_to_apply, is_enabled=(index != 0 and self.ui.spoofHardwareChk.isChecked()))
|
||||
tweaks["SpoofCPU"].set_selected_option(idx_to_apply, is_enabled=(index != 0 and self.ui.spoofCPUChk.isChecked()))
|
||||
def on_spoofHardwareChk_toggled(self, checked: bool):
|
||||
tweaks["SpoofHardware"].set_enabled(checked and tweaks["SpoofHardware"].selected_option != 0)
|
||||
def on_spoofCPUChk_toggled(self, checked: bool):
|
||||
tweaks["SpoofCPU"].set_enabled(checked and tweaks["SpoofCPU"].selected_option != 0)
|
||||
|
||||
|
||||
## SPRINGBOARD OPTIONS PAGE
|
||||
|
||||
@@ -2597,6 +2597,30 @@ Only works on iOS 18.0 beta 1-2.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QScrollArea" name="scrollArea_2">
|
||||
<property name="verticalScrollBarPolicy">
|
||||
<enum>Qt::ScrollBarAsNeeded</enum>
|
||||
</property>
|
||||
<property name="horizontalScrollBarPolicy">
|
||||
<enum>Qt::ScrollBarAlwaysOff</enum>
|
||||
</property>
|
||||
<property name="sizeAdjustPolicy">
|
||||
<enum>QAbstractScrollArea::AdjustIgnored</enum>
|
||||
</property>
|
||||
<property name="widgetResizable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<widget class="QWidget" name="scrollAreaWidgetContents_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>-129</y>
|
||||
<width>660</width>
|
||||
<height>573</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_37">
|
||||
<item>
|
||||
<widget class="QWidget" name="euEnablerPageContent" native="true">
|
||||
<property name="enabled">
|
||||
@@ -3029,6 +3053,32 @@ QComboBox QAbstractItemView::item:hover {
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="spoofHardwareChk">
|
||||
<property name="toolTip">
|
||||
<string>Spoofs the device hardware model (ie D83AP)</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Spoof Hardware Model</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="spoofCPUChk">
|
||||
<property name="toolTip">
|
||||
<string>Spoofs the device CPU model (ie t8130)</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Spoof CPU Model</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -3050,6 +3100,10 @@ QComboBox QAbstractItemView::item:hover {
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="springboardOptionsPage">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_10">
|
||||
<property name="leftMargin">
|
||||
|
||||
@@ -15,10 +15,11 @@ from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
|
||||
QFont, QFontDatabase, QGradient, QIcon,
|
||||
QImage, QKeySequence, QLinearGradient, QPainter,
|
||||
QPalette, QPixmap, QRadialGradient, QTransform)
|
||||
from PySide6.QtWidgets import (QApplication, QCheckBox, QComboBox, QFrame,
|
||||
QHBoxLayout, QLabel, QLineEdit, QMainWindow,
|
||||
QProgressBar, QScrollArea, QSizePolicy, QSpacerItem,
|
||||
QStackedWidget, QToolButton, QVBoxLayout, QWidget)
|
||||
from PySide6.QtWidgets import (QAbstractScrollArea, QApplication, QCheckBox, QComboBox,
|
||||
QFrame, QHBoxLayout, QLabel, QLineEdit,
|
||||
QMainWindow, QProgressBar, QScrollArea, QSizePolicy,
|
||||
QSpacerItem, QStackedWidget, QToolButton, QVBoxLayout,
|
||||
QWidget)
|
||||
import resources_rc
|
||||
|
||||
class Ui_Nugget(object):
|
||||
@@ -1386,7 +1387,18 @@ class Ui_Nugget(object):
|
||||
|
||||
self.verticalLayout_17.addWidget(self.line_13)
|
||||
|
||||
self.euEnablerPageContent = QWidget(self.euEnablerPage)
|
||||
self.scrollArea_2 = QScrollArea(self.euEnablerPage)
|
||||
self.scrollArea_2.setObjectName(u"scrollArea_2")
|
||||
self.scrollArea_2.setVerticalScrollBarPolicy(Qt.ScrollBarAsNeeded)
|
||||
self.scrollArea_2.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
|
||||
self.scrollArea_2.setSizeAdjustPolicy(QAbstractScrollArea.AdjustIgnored)
|
||||
self.scrollArea_2.setWidgetResizable(True)
|
||||
self.scrollAreaWidgetContents_2 = QWidget()
|
||||
self.scrollAreaWidgetContents_2.setObjectName(u"scrollAreaWidgetContents_2")
|
||||
self.scrollAreaWidgetContents_2.setGeometry(QRect(0, -129, 660, 573))
|
||||
self.verticalLayout_37 = QVBoxLayout(self.scrollAreaWidgetContents_2)
|
||||
self.verticalLayout_37.setObjectName(u"verticalLayout_37")
|
||||
self.euEnablerPageContent = QWidget(self.scrollAreaWidgetContents_2)
|
||||
self.euEnablerPageContent.setObjectName(u"euEnablerPageContent")
|
||||
self.euEnablerPageContent.setEnabled(False)
|
||||
self.verticalLayout_16 = QVBoxLayout(self.euEnablerPageContent)
|
||||
@@ -1592,6 +1604,18 @@ class Ui_Nugget(object):
|
||||
|
||||
self.verticalLayout_34.addWidget(self.spoofedModelDrp)
|
||||
|
||||
self.spoofHardwareChk = QCheckBox(self.aiEnablerContent)
|
||||
self.spoofHardwareChk.setObjectName(u"spoofHardwareChk")
|
||||
self.spoofHardwareChk.setChecked(True)
|
||||
|
||||
self.verticalLayout_34.addWidget(self.spoofHardwareChk)
|
||||
|
||||
self.spoofCPUChk = QCheckBox(self.aiEnablerContent)
|
||||
self.spoofCPUChk.setObjectName(u"spoofCPUChk")
|
||||
self.spoofCPUChk.setChecked(True)
|
||||
|
||||
self.verticalLayout_34.addWidget(self.spoofCPUChk)
|
||||
|
||||
|
||||
self.verticalLayout_16.addWidget(self.aiEnablerContent)
|
||||
|
||||
@@ -1600,7 +1624,11 @@ class Ui_Nugget(object):
|
||||
self.verticalLayout_16.addItem(self.verticalSpacer_7)
|
||||
|
||||
|
||||
self.verticalLayout_17.addWidget(self.euEnablerPageContent)
|
||||
self.verticalLayout_37.addWidget(self.euEnablerPageContent)
|
||||
|
||||
self.scrollArea_2.setWidget(self.scrollAreaWidgetContents_2)
|
||||
|
||||
self.verticalLayout_17.addWidget(self.scrollArea_2)
|
||||
|
||||
self.pages.addWidget(self.euEnablerPage)
|
||||
self.springboardOptionsPage = QWidget()
|
||||
@@ -3281,6 +3309,14 @@ class Ui_Nugget(object):
|
||||
self.spoofedModelDrp.setItemText(26, QCoreApplication.translate("Nugget", u"iPad Air (M1) (C) (iPad13,17)", None))
|
||||
|
||||
self.spoofedModelDrp.setCurrentText(QCoreApplication.translate("Nugget", u"Original", None))
|
||||
#if QT_CONFIG(tooltip)
|
||||
self.spoofHardwareChk.setToolTip(QCoreApplication.translate("Nugget", u"Spoofs the device hardware model (ie D83AP)", None))
|
||||
#endif // QT_CONFIG(tooltip)
|
||||
self.spoofHardwareChk.setText(QCoreApplication.translate("Nugget", u"Spoof Hardware Model", None))
|
||||
#if QT_CONFIG(tooltip)
|
||||
self.spoofCPUChk.setToolTip(QCoreApplication.translate("Nugget", u"Spoofs the device CPU model (ie t8130)", None))
|
||||
#endif // QT_CONFIG(tooltip)
|
||||
self.spoofCPUChk.setText(QCoreApplication.translate("Nugget", u"Spoof CPU Model", None))
|
||||
self.springboardOptionsLbl.setText(QCoreApplication.translate("Nugget", u"Springboard Options", None))
|
||||
self.label_13.setText(QCoreApplication.translate("Nugget", u"Lock Screen Footnote Text", None))
|
||||
self.footnoteTxt.setPlaceholderText(QCoreApplication.translate("Nugget", u"Footnote Text", None))
|
||||
|
||||
@@ -15,10 +15,11 @@ from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
|
||||
QFont, QFontDatabase, QGradient, QIcon,
|
||||
QImage, QKeySequence, QLinearGradient, QPainter,
|
||||
QPalette, QPixmap, QRadialGradient, QTransform)
|
||||
from PySide6.QtWidgets import (QApplication, QCheckBox, QComboBox, QFrame,
|
||||
QHBoxLayout, QLabel, QLineEdit, QMainWindow,
|
||||
QProgressBar, QScrollArea, QSizePolicy, QSpacerItem,
|
||||
QStackedWidget, QToolButton, QVBoxLayout, QWidget)
|
||||
from PySide6.QtWidgets import (QAbstractScrollArea, QApplication, QCheckBox, QComboBox,
|
||||
QFrame, QHBoxLayout, QLabel, QLineEdit,
|
||||
QMainWindow, QProgressBar, QScrollArea, QSizePolicy,
|
||||
QSpacerItem, QStackedWidget, QToolButton, QVBoxLayout,
|
||||
QWidget)
|
||||
import resources_rc
|
||||
|
||||
class Ui_Nugget(object):
|
||||
@@ -1386,7 +1387,18 @@ class Ui_Nugget(object):
|
||||
|
||||
self.verticalLayout_17.addWidget(self.line_13)
|
||||
|
||||
self.euEnablerPageContent = QWidget(self.euEnablerPage)
|
||||
self.scrollArea_2 = QScrollArea(self.euEnablerPage)
|
||||
self.scrollArea_2.setObjectName(u"scrollArea_2")
|
||||
self.scrollArea_2.setVerticalScrollBarPolicy(Qt.ScrollBarAsNeeded)
|
||||
self.scrollArea_2.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
|
||||
self.scrollArea_2.setSizeAdjustPolicy(QAbstractScrollArea.AdjustIgnored)
|
||||
self.scrollArea_2.setWidgetResizable(True)
|
||||
self.scrollAreaWidgetContents_2 = QWidget()
|
||||
self.scrollAreaWidgetContents_2.setObjectName(u"scrollAreaWidgetContents_2")
|
||||
self.scrollAreaWidgetContents_2.setGeometry(QRect(0, -129, 660, 573))
|
||||
self.verticalLayout_37 = QVBoxLayout(self.scrollAreaWidgetContents_2)
|
||||
self.verticalLayout_37.setObjectName(u"verticalLayout_37")
|
||||
self.euEnablerPageContent = QWidget(self.scrollAreaWidgetContents_2)
|
||||
self.euEnablerPageContent.setObjectName(u"euEnablerPageContent")
|
||||
self.euEnablerPageContent.setEnabled(False)
|
||||
self.verticalLayout_16 = QVBoxLayout(self.euEnablerPageContent)
|
||||
@@ -1592,6 +1604,18 @@ class Ui_Nugget(object):
|
||||
|
||||
self.verticalLayout_34.addWidget(self.spoofedModelDrp)
|
||||
|
||||
self.spoofHardwareChk = QCheckBox(self.aiEnablerContent)
|
||||
self.spoofHardwareChk.setObjectName(u"spoofHardwareChk")
|
||||
self.spoofHardwareChk.setChecked(True)
|
||||
|
||||
self.verticalLayout_34.addWidget(self.spoofHardwareChk)
|
||||
|
||||
self.spoofCPUChk = QCheckBox(self.aiEnablerContent)
|
||||
self.spoofCPUChk.setObjectName(u"spoofCPUChk")
|
||||
self.spoofCPUChk.setChecked(True)
|
||||
|
||||
self.verticalLayout_34.addWidget(self.spoofCPUChk)
|
||||
|
||||
|
||||
self.verticalLayout_16.addWidget(self.aiEnablerContent)
|
||||
|
||||
@@ -1600,7 +1624,11 @@ class Ui_Nugget(object):
|
||||
self.verticalLayout_16.addItem(self.verticalSpacer_7)
|
||||
|
||||
|
||||
self.verticalLayout_17.addWidget(self.euEnablerPageContent)
|
||||
self.verticalLayout_37.addWidget(self.euEnablerPageContent)
|
||||
|
||||
self.scrollArea_2.setWidget(self.scrollAreaWidgetContents_2)
|
||||
|
||||
self.verticalLayout_17.addWidget(self.scrollArea_2)
|
||||
|
||||
self.pages.addWidget(self.euEnablerPage)
|
||||
self.springboardOptionsPage = QWidget()
|
||||
@@ -3281,6 +3309,14 @@ class Ui_Nugget(object):
|
||||
self.spoofedModelDrp.setItemText(26, QCoreApplication.translate("Nugget", u"iPad Air (M1) (C) (iPad13,17)", None))
|
||||
|
||||
self.spoofedModelDrp.setCurrentText(QCoreApplication.translate("Nugget", u"Original", None))
|
||||
#if QT_CONFIG(tooltip)
|
||||
self.spoofHardwareChk.setToolTip(QCoreApplication.translate("Nugget", u"Spoofs the device hardware model (ie D83AP)", None))
|
||||
#endif // QT_CONFIG(tooltip)
|
||||
self.spoofHardwareChk.setText(QCoreApplication.translate("Nugget", u"Spoof Hardware Model", None))
|
||||
#if QT_CONFIG(tooltip)
|
||||
self.spoofCPUChk.setToolTip(QCoreApplication.translate("Nugget", u"Spoofs the device CPU model (ie t8130)", None))
|
||||
#endif // QT_CONFIG(tooltip)
|
||||
self.spoofCPUChk.setText(QCoreApplication.translate("Nugget", u"Spoof CPU Model", None))
|
||||
self.springboardOptionsLbl.setText(QCoreApplication.translate("Nugget", u"Springboard Options", None))
|
||||
self.label_13.setText(QCoreApplication.translate("Nugget", u"Lock Screen Footnote Text", None))
|
||||
self.footnoteTxt.setPlaceholderText(QCoreApplication.translate("Nugget", u"Footnote Text", None))
|
||||
|
||||
@@ -220,9 +220,9 @@ class MobileGestaltPickerTweak(Tweak):
|
||||
plist["CacheExtra"][self.key][self.subkey] = new_value
|
||||
return plist
|
||||
|
||||
def set_selected_option(self, new_option: int):
|
||||
def set_selected_option(self, new_option: int, is_enabled: bool = True):
|
||||
self.selected_option = new_option
|
||||
self.enabled = True
|
||||
self.enabled = is_enabled
|
||||
|
||||
def get_selected_option(self) -> int:
|
||||
return self.selected_option
|
||||
|
||||
Reference in New Issue
Block a user