mirror of
https://github.com/leminlimez/Nugget.git
synced 2025-04-08 04:23:05 +08:00
fix mobilegestalt tweaks not applying + optimize tweak options
This commit is contained in:
@@ -18,8 +18,8 @@ from tweaks.tweaks import tweaks
|
|||||||
from tweaks.custom_gestalt_tweaks import CustomGestaltTweaks, ValueTypeStrings
|
from tweaks.custom_gestalt_tweaks import CustomGestaltTweaks, ValueTypeStrings
|
||||||
from tweaks.daemons_tweak import Daemon
|
from tweaks.daemons_tweak import Daemon
|
||||||
|
|
||||||
App_Version = "4.2"
|
App_Version = "4.2.1"
|
||||||
App_Build = 0
|
App_Build = 1
|
||||||
|
|
||||||
class Page(Enum):
|
class Page(Enum):
|
||||||
Home = 0
|
Home = 0
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
from .tweak_classes import Tweak, TweakModifyType
|
from .tweak_classes import Tweak
|
||||||
from Sparserestore.restore import FileToRestore
|
from Sparserestore.restore import FileToRestore
|
||||||
from devicemanagement.constants import Version
|
from devicemanagement.constants import Version
|
||||||
|
|
||||||
@@ -22,11 +22,8 @@ def replace_region_code(plist_path: str, original_code: str = "US", new_code: st
|
|||||||
return plistlib.dumps(updated_plist_data)
|
return plistlib.dumps(updated_plist_data)
|
||||||
|
|
||||||
class EligibilityTweak(Tweak):
|
class EligibilityTweak(Tweak):
|
||||||
def __init__(
|
def __init__(self):
|
||||||
self,
|
super().__init__(key=None, value=["Method 1", "Method 2"])
|
||||||
min_version: Version = Version("1.0")
|
|
||||||
):
|
|
||||||
super().__init__(key=None, value=["Method 1", "Method 2"], edit_type=TweakModifyType.PICKER, min_version=min_version)
|
|
||||||
self.code = "US"
|
self.code = "US"
|
||||||
self.method = 0 # between 0 and 1
|
self.method = 0 # between 0 and 1
|
||||||
|
|
||||||
@@ -89,7 +86,7 @@ class EligibilityTweak(Tweak):
|
|||||||
|
|
||||||
class AITweak(Tweak):
|
class AITweak(Tweak):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__(key=None, value="", min_version=Version("18.1"))
|
super().__init__(key=None, value="")
|
||||||
|
|
||||||
def set_language_code(self, lang: str):
|
def set_language_code(self, lang: str):
|
||||||
self.value = lang
|
self.value = lang
|
||||||
|
|||||||
@@ -2,24 +2,15 @@ from enum import Enum
|
|||||||
from devicemanagement.constants import Version
|
from devicemanagement.constants import Version
|
||||||
from .basic_plist_locations import FileLocation
|
from .basic_plist_locations import FileLocation
|
||||||
|
|
||||||
class TweakModifyType(Enum):
|
|
||||||
TOGGLE = 1
|
|
||||||
TEXT = 2
|
|
||||||
PICKER = 3
|
|
||||||
|
|
||||||
class Tweak:
|
class Tweak:
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
key: str,
|
key: str,
|
||||||
value: any = 1,
|
value: any = 1,
|
||||||
edit_type: TweakModifyType = TweakModifyType.TOGGLE,
|
|
||||||
min_version: Version = Version("1.0"),
|
|
||||||
owner: int = 501, group: int = 501
|
owner: int = 501, group: int = 501
|
||||||
):
|
):
|
||||||
self.key = key
|
self.key = key
|
||||||
self.value = value
|
self.value = value
|
||||||
self.min_version = min_version
|
|
||||||
self.edit_type = edit_type
|
|
||||||
self.owner = owner
|
self.owner = owner
|
||||||
self.group = group
|
self.group = group
|
||||||
self.enabled = False
|
self.enabled = False
|
||||||
@@ -33,9 +24,6 @@ class Tweak:
|
|||||||
if toggle_enabled:
|
if toggle_enabled:
|
||||||
self.enabled = True
|
self.enabled = True
|
||||||
|
|
||||||
def is_compatible(self, device_ver: str):
|
|
||||||
return Version(device_ver) >= self.min_version
|
|
||||||
|
|
||||||
def apply_tweak(self):
|
def apply_tweak(self):
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
@@ -43,10 +31,9 @@ class NullifyFileTweak(Tweak):
|
|||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
file_location: FileLocation,
|
file_location: FileLocation,
|
||||||
min_version: Version = Version("1.0"),
|
|
||||||
owner: int = 501, group: int = 501
|
owner: int = 501, group: int = 501
|
||||||
):
|
):
|
||||||
super().__init__(key=None, value=None, min_version=min_version, owner=owner, group=group)
|
super().__init__(key=None, value=None, owner=owner, group=group)
|
||||||
self.file_location = file_location
|
self.file_location = file_location
|
||||||
|
|
||||||
def apply_tweak(self, other_tweaks: dict):
|
def apply_tweak(self, other_tweaks: dict):
|
||||||
@@ -60,12 +47,10 @@ class BasicPlistTweak(Tweak):
|
|||||||
file_location: FileLocation,
|
file_location: FileLocation,
|
||||||
key: str,
|
key: str,
|
||||||
value: any = True,
|
value: any = True,
|
||||||
edit_type: TweakModifyType = TweakModifyType.TOGGLE,
|
|
||||||
min_version: Version = Version("1.0"),
|
|
||||||
owner: int = 501, group: int = 501,
|
owner: int = 501, group: int = 501,
|
||||||
is_risky: bool = False
|
is_risky: bool = False
|
||||||
):
|
):
|
||||||
super().__init__(key=key, value=value, edit_type=edit_type, min_version=min_version, owner=owner, group=group)
|
super().__init__(key=key, value=value, owner=owner, group=group)
|
||||||
self.file_location = file_location
|
self.file_location = file_location
|
||||||
self.is_risky = is_risky
|
self.is_risky = is_risky
|
||||||
|
|
||||||
@@ -83,12 +68,10 @@ class AdvancedPlistTweak(BasicPlistTweak):
|
|||||||
self,
|
self,
|
||||||
file_location: FileLocation,
|
file_location: FileLocation,
|
||||||
keyValues: dict,
|
keyValues: dict,
|
||||||
edit_type: TweakModifyType = TweakModifyType.TOGGLE,
|
|
||||||
min_version: Version = Version("1.0"),
|
|
||||||
owner: int = 501, group: int = 501,
|
owner: int = 501, group: int = 501,
|
||||||
is_risky: bool = False
|
is_risky: bool = False
|
||||||
):
|
):
|
||||||
super().__init__(file_location=file_location, key=None, value=keyValues, edit_type=edit_type, min_version=min_version, owner=owner, group=group, is_risky=is_risky)
|
super().__init__(file_location=file_location, key=None, value=keyValues, owner=owner, group=group, is_risky=is_risky)
|
||||||
|
|
||||||
def set_multiple_values(self, keys: list[str], value: any):
|
def set_multiple_values(self, keys: list[str], value: any):
|
||||||
for key in keys:
|
for key in keys:
|
||||||
@@ -182,6 +165,15 @@ class RdarFixTweak(BasicPlistTweak):
|
|||||||
|
|
||||||
|
|
||||||
class MobileGestaltTweak(Tweak):
|
class MobileGestaltTweak(Tweak):
|
||||||
|
def __init__(
|
||||||
|
self,
|
||||||
|
key: str, subkey: str = None,
|
||||||
|
value: any = 1,
|
||||||
|
owner: int = 501, group: int = 501
|
||||||
|
):
|
||||||
|
super().__init__(key, value, owner, group)
|
||||||
|
self.subkey = subkey
|
||||||
|
|
||||||
def apply_tweak(self, plist: dict):
|
def apply_tweak(self, plist: dict):
|
||||||
if not self.enabled:
|
if not self.enabled:
|
||||||
return plist
|
return plist
|
||||||
@@ -196,10 +188,9 @@ class MobileGestaltPickerTweak(Tweak):
|
|||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
key: str, subkey: str = None,
|
key: str, subkey: str = None,
|
||||||
values: list = [1],
|
values: list = [1]
|
||||||
min_version: Version = Version("1.0")
|
|
||||||
):
|
):
|
||||||
super().__init__(key=key, value=values, edit_type=TweakModifyType.PICKER, min_version=min_version)
|
super().__init__(key=key, value=values)
|
||||||
self.subkey = subkey
|
self.subkey = subkey
|
||||||
self.selected_option = 0 # index of the selected option
|
self.selected_option = 0 # index of the selected option
|
||||||
|
|
||||||
@@ -221,8 +212,8 @@ class MobileGestaltPickerTweak(Tweak):
|
|||||||
return self.selected_option
|
return self.selected_option
|
||||||
|
|
||||||
class MobileGestaltMultiTweak(Tweak):
|
class MobileGestaltMultiTweak(Tweak):
|
||||||
def __init__(self, keyValues: dict, min_version: Version = Version("1.0")):
|
def __init__(self, keyValues: dict):
|
||||||
super().__init__(key=None, min_version=min_version)
|
super().__init__(key=None)
|
||||||
self.keyValues = keyValues
|
self.keyValues = keyValues
|
||||||
# key values looks like ["key name" = value]
|
# key values looks like ["key name" = value]
|
||||||
|
|
||||||
@@ -237,10 +228,9 @@ class FeatureFlagTweak(Tweak):
|
|||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
flag_category: str, flag_names: list,
|
flag_category: str, flag_names: list,
|
||||||
is_list: bool=True, inverted: bool=False,
|
is_list: bool=True, inverted: bool=False
|
||||||
min_version: Version = Version("1.0")
|
|
||||||
):
|
):
|
||||||
super().__init__(key=None, min_version=min_version)
|
super().__init__(key=None)
|
||||||
self.flag_category = flag_category
|
self.flag_category = flag_category
|
||||||
self.flag_names = flag_names
|
self.flag_names = flag_names
|
||||||
self.is_list = is_list
|
self.is_list = is_list
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
from devicemanagement.constants import Version
|
from devicemanagement.constants import Version
|
||||||
from .tweak_classes import MobileGestaltTweak, MobileGestaltMultiTweak, MobileGestaltPickerTweak, FeatureFlagTweak, TweakModifyType, BasicPlistTweak, AdvancedPlistTweak, RdarFixTweak, NullifyFileTweak
|
from .tweak_classes import MobileGestaltTweak, MobileGestaltMultiTweak, MobileGestaltPickerTweak, FeatureFlagTweak, BasicPlistTweak, AdvancedPlistTweak, RdarFixTweak, NullifyFileTweak
|
||||||
from .eligibility_tweak import EligibilityTweak, AITweak
|
from .eligibility_tweak import EligibilityTweak, AITweak
|
||||||
from .basic_plist_locations import FileLocation
|
from .basic_plist_locations import FileLocation
|
||||||
|
|
||||||
@@ -7,12 +7,12 @@ tweaks = {
|
|||||||
## MobileGestalt Tweaks
|
## MobileGestalt Tweaks
|
||||||
"DynamicIsland": MobileGestaltPickerTweak("oPeik/9e8lQWMszEjbPzng", "ArtworkDeviceSubType", [2436, 2556, 2796, 2976, 2622, 2868]),
|
"DynamicIsland": MobileGestaltPickerTweak("oPeik/9e8lQWMszEjbPzng", "ArtworkDeviceSubType", [2436, 2556, 2796, 2976, 2622, 2868]),
|
||||||
"RdarFix": RdarFixTweak(),
|
"RdarFix": RdarFixTweak(),
|
||||||
"ModelName": MobileGestaltTweak("oPeik/9e8lQWMszEjbPzng", "ArtworkDeviceProductDescription", "", TweakModifyType.TEXT),
|
"ModelName": MobileGestaltTweak("oPeik/9e8lQWMszEjbPzng", "ArtworkDeviceProductDescription", ""),
|
||||||
"BootChime": MobileGestaltTweak("QHxt+hGLaBPbQJbXiUJX3w"),
|
"BootChime": MobileGestaltTweak("QHxt+hGLaBPbQJbXiUJX3w"),
|
||||||
"ChargeLimit": MobileGestaltTweak("37NVydb//GP/GrhuTN+exg"),
|
"ChargeLimit": MobileGestaltTweak("37NVydb//GP/GrhuTN+exg"),
|
||||||
"CollisionSOS": MobileGestaltTweak("HCzWusHQwZDea6nNhaKndw"),
|
"CollisionSOS": MobileGestaltTweak("HCzWusHQwZDea6nNhaKndw"),
|
||||||
"TapToWake": MobileGestaltTweak("yZf3GTRMGTuwSV/lD7Cagw"),
|
"TapToWake": MobileGestaltTweak("yZf3GTRMGTuwSV/lD7Cagw"),
|
||||||
"CameraButton": MobileGestaltMultiTweak({"CwvKxM2cEogD3p+HYgaW0Q": 1, "oOV1jhJbdV3AddkcCg0AEA": 1}, min_version=Version("18.0")),
|
"CameraButton": MobileGestaltMultiTweak({"CwvKxM2cEogD3p+HYgaW0Q": 1, "oOV1jhJbdV3AddkcCg0AEA": 1}),
|
||||||
"Parallax": MobileGestaltTweak("UIParallaxCapability", value=0),
|
"Parallax": MobileGestaltTweak("UIParallaxCapability", value=0),
|
||||||
"StageManager": MobileGestaltTweak("qeaj75wk3HF4DwQ8qbIi7g", value=1),
|
"StageManager": MobileGestaltTweak("qeaj75wk3HF4DwQ8qbIi7g", value=1),
|
||||||
"Medusa": MobileGestaltMultiTweak({"mG0AnH/Vy1veoqoLRAIgTA": 1, "UCG5MkVahJxG1YULbbd5Bg": 1, "ZYqko/XM5zD3XBfN5RmaXA": 1, "nVh/gwNpy7Jv1NOk00CMrw": 1, "uKc7FPnEO++lVhHWHFlGbQ": 1}),
|
"Medusa": MobileGestaltMultiTweak({"mG0AnH/Vy1veoqoLRAIgTA": 1, "UCG5MkVahJxG1YULbbd5Bg": 1, "ZYqko/XM5zD3XBfN5RmaXA": 1, "nVh/gwNpy7Jv1NOk00CMrw": 1, "uKc7FPnEO++lVhHWHFlGbQ": 1}),
|
||||||
@@ -25,23 +25,20 @@ tweaks = {
|
|||||||
"InternalInstall": MobileGestaltTweak("EqrsVvjcYDdxHBiQmGhAWw"),
|
"InternalInstall": MobileGestaltTweak("EqrsVvjcYDdxHBiQmGhAWw"),
|
||||||
"EUEnabler": EligibilityTweak(),
|
"EUEnabler": EligibilityTweak(),
|
||||||
"AOD": MobileGestaltMultiTweak(
|
"AOD": MobileGestaltMultiTweak(
|
||||||
{"2OOJf1VhaM7NxfRok3HbWQ": 1, "j8/Omm6s1lsmTDFsXjsBfA": 1},
|
{"2OOJf1VhaM7NxfRok3HbWQ": 1, "j8/Omm6s1lsmTDFsXjsBfA": 1}),
|
||||||
min_version=Version("18.0")),
|
"AODVibrancy": MobileGestaltTweak("ykpu7qyhqFweVMKtxNylWA"),
|
||||||
"AODVibrancy": MobileGestaltTweak("ykpu7qyhqFweVMKtxNylWA", min_version=Version("18.0")),
|
|
||||||
|
|
||||||
## Feature Flag Tweaks
|
## Feature Flag Tweaks
|
||||||
"ClockAnim": FeatureFlagTweak(flag_category='SpringBoard',
|
"ClockAnim": FeatureFlagTweak(flag_category='SpringBoard',
|
||||||
flag_names=['SwiftUITimeAnimation'],
|
flag_names=['SwiftUITimeAnimation']),
|
||||||
min_version=Version("18.0")),
|
|
||||||
"Lockscreen": FeatureFlagTweak(flag_category="SpringBoard",
|
"Lockscreen": FeatureFlagTweak(flag_category="SpringBoard",
|
||||||
flag_names=['AutobahnQuickSwitchTransition', 'SlipSwitch', 'PosterEditorKashida'],
|
flag_names=['AutobahnQuickSwitchTransition', 'SlipSwitch', 'PosterEditorKashida']),
|
||||||
min_version=Version("18.0")),
|
"PhotoUI": FeatureFlagTweak(flag_category='Photos', flag_names=['Lemonade'], is_list=False, inverted=True),
|
||||||
"PhotoUI": FeatureFlagTweak(flag_category='Photos', flag_names=['Lemonade'], is_list=False, inverted=True, min_version=Version("18.0")),
|
"AI": FeatureFlagTweak(flag_category='SpringBoard', flag_names=['Domino', 'SuperDomino']),
|
||||||
"AI": FeatureFlagTweak(flag_category='SpringBoard', flag_names=['Domino', 'SuperDomino'], min_version=Version("18.1")),
|
|
||||||
|
|
||||||
## AI Enabler
|
## AI Enabler
|
||||||
"AIEligibility": AITweak(),
|
"AIEligibility": AITweak(),
|
||||||
"AIGestalt": MobileGestaltTweak("A62OafQ85EJAiiqKn4agtg", min_version=Version("18.1")),
|
"AIGestalt": MobileGestaltTweak("A62OafQ85EJAiiqKn4agtg"),
|
||||||
"SpoofModel": MobileGestaltPickerTweak("h9jDsbgj7xIVeIQ8S3/X3Q", values=[
|
"SpoofModel": MobileGestaltPickerTweak("h9jDsbgj7xIVeIQ8S3/X3Q", values=[
|
||||||
# Default
|
# Default
|
||||||
"Placeholder", # 0 | Original
|
"Placeholder", # 0 | Original
|
||||||
@@ -81,7 +78,7 @@ tweaks = {
|
|||||||
"iPad13,9", # 24 | iPad Pro (12.9-inch) (M1) (C)
|
"iPad13,9", # 24 | iPad Pro (12.9-inch) (M1) (C)
|
||||||
"iPad13,16", # 25 | iPad Air (M1) (W)
|
"iPad13,16", # 25 | iPad Air (M1) (W)
|
||||||
"iPad13,17", # 26 | iPad Air (M1) (C)
|
"iPad13,17", # 26 | iPad Air (M1) (C)
|
||||||
], min_version=Version("18.1")),
|
]),
|
||||||
"SpoofHardware": MobileGestaltPickerTweak("oYicEKzVTz4/CxxE05pEgQ", values=[
|
"SpoofHardware": MobileGestaltPickerTweak("oYicEKzVTz4/CxxE05pEgQ", values=[
|
||||||
# Default
|
# Default
|
||||||
"Placeholder", # 0 | Original
|
"Placeholder", # 0 | Original
|
||||||
@@ -121,7 +118,7 @@ tweaks = {
|
|||||||
"J522xAP", # 24 | iPad Pro (12.9-inch) (M1) (C)
|
"J522xAP", # 24 | iPad Pro (12.9-inch) (M1) (C)
|
||||||
"J407AP", # 25 | iPad Air (M1) (W)
|
"J407AP", # 25 | iPad Air (M1) (W)
|
||||||
"J408AP", # 26 | iPad Air (M1) (C)
|
"J408AP", # 26 | iPad Air (M1) (C)
|
||||||
], min_version=Version("18.1")),
|
]),
|
||||||
"SpoofCPU": MobileGestaltPickerTweak("5pYKlGnYYBzGvAlIU8RjEQ", values=[
|
"SpoofCPU": MobileGestaltPickerTweak("5pYKlGnYYBzGvAlIU8RjEQ", values=[
|
||||||
# Default
|
# Default
|
||||||
"Placeholder", # 0 | Original
|
"Placeholder", # 0 | Original
|
||||||
@@ -161,13 +158,12 @@ tweaks = {
|
|||||||
"t8103", # 24 | iPad Pro (12.9-inch) (M1) (C)
|
"t8103", # 24 | iPad Pro (12.9-inch) (M1) (C)
|
||||||
"t8103", # 25 | iPad Air (M1) (W)
|
"t8103", # 25 | iPad Air (M1) (W)
|
||||||
"t8103", # 26 | iPad Air (M1) (C)
|
"t8103", # 26 | iPad Air (M1) (C)
|
||||||
], min_version=Version("18.1")),
|
]),
|
||||||
|
|
||||||
## Springboard Tweaks
|
## Springboard Tweaks
|
||||||
"LockScreenFootnote": BasicPlistTweak(
|
"LockScreenFootnote": BasicPlistTweak(
|
||||||
FileLocation.footnote,
|
FileLocation.footnote,
|
||||||
key="LockScreenFootnote", value="",
|
key="LockScreenFootnote", value=""
|
||||||
edit_type=TweakModifyType.TEXT
|
|
||||||
),
|
),
|
||||||
"SBDontLockAfterCrash": BasicPlistTweak(
|
"SBDontLockAfterCrash": BasicPlistTweak(
|
||||||
FileLocation.springboard,
|
FileLocation.springboard,
|
||||||
|
|||||||
Reference in New Issue
Block a user