mirror of
https://github.com/leminlimez/Nugget.git
synced 2025-04-08 04:23:05 +08:00
springboard tweaks/internal options for cli
This commit is contained in:
17
tweaks/basic_plist_locations.py
Normal file
17
tweaks/basic_plist_locations.py
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
from enum import Enum
|
||||||
|
|
||||||
|
class FileLocation(Enum):
|
||||||
|
# Springboard Options
|
||||||
|
springboard = "/var/Managed Preferences/mobile/com.apple.springboard.plist"
|
||||||
|
footnote = "/var/containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles/Library/ConfigurationProfiles/SharedDeviceConfiguration.plist"
|
||||||
|
uikit = "/var/Managed Preferences/mobile/com.apple.UIKit.plist"
|
||||||
|
wifiDebug = "/var/Managed Preferences/mobile/com.apple.MobileWiFi.debug.plist"
|
||||||
|
airdrop = "/var/Managed Preferences/mobile/com.apple.sharingd.plist"
|
||||||
|
|
||||||
|
# Internal Options
|
||||||
|
globalPreferences = "/var/Managed Preferences/mobile/.GlobalPreferences.plist"
|
||||||
|
appStore = "/var/Managed Preferences/mobile/com.apple.AppStore.plist"
|
||||||
|
backboardd = "/var/Managed Preferences/mobile/com.apple.backboardd.plist"
|
||||||
|
coreMotion = "/var/Managed Preferences/mobile/com.apple.CoreMotion.plist"
|
||||||
|
pasteboard = "/var/Managed Preferences/mobile/com.apple.Pasteboard.plist"
|
||||||
|
notes = "/var/Managed Preferences/mobile/com.apple.mobilenotes.plist"
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
from enum import Enum
|
from enum import Enum
|
||||||
from devicemanagement.constants import Version
|
from devicemanagement.constants import Version
|
||||||
|
from .basic_plist_locations import FileLocation
|
||||||
|
|
||||||
class TweakModifyType(Enum):
|
class TweakModifyType(Enum):
|
||||||
TOGGLE = 1
|
TOGGLE = 1
|
||||||
@@ -38,6 +39,29 @@ class Tweak:
|
|||||||
|
|
||||||
def apply_tweak(self):
|
def apply_tweak(self):
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
|
|
||||||
|
class BasicPlistTweak(Tweak):
|
||||||
|
def __init__(
|
||||||
|
self, label: str,
|
||||||
|
file_location: FileLocation,
|
||||||
|
key: str,
|
||||||
|
value: any = True,
|
||||||
|
edit_type: TweakModifyType = TweakModifyType.TOGGLE,
|
||||||
|
min_version: Version = Version("1.0"),
|
||||||
|
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)
|
||||||
|
self.file_location = file_location
|
||||||
|
|
||||||
|
def apply_tweak(self, other_tweaks: dict) -> dict:
|
||||||
|
if not self.enabled:
|
||||||
|
return other_tweaks
|
||||||
|
if self.file_location in other_tweaks:
|
||||||
|
other_tweaks[self.file_location][self.key] = self.value
|
||||||
|
else:
|
||||||
|
other_tweaks[self.file_location] = {self.key: self.value}
|
||||||
|
return other_tweaks
|
||||||
|
|
||||||
|
|
||||||
class MobileGestaltTweak(Tweak):
|
class MobileGestaltTweak(Tweak):
|
||||||
|
|||||||
122
tweaks/tweaks.py
122
tweaks/tweaks.py
@@ -1,13 +1,13 @@
|
|||||||
from devicemanagement.constants import Version
|
from devicemanagement.constants import Version
|
||||||
from .tweak_classes import MobileGestaltTweak, MobileGestaltMultiTweak, MobileGestaltPickerTweak, FeatureFlagTweak, TweakModifyType
|
from .tweak_classes import MobileGestaltTweak, MobileGestaltMultiTweak, MobileGestaltPickerTweak, FeatureFlagTweak, TweakModifyType, BasicPlistTweak
|
||||||
from .eligibility_tweak import EligibilityTweak
|
from .eligibility_tweak import EligibilityTweak
|
||||||
|
from .basic_plist_locations import FileLocation
|
||||||
|
|
||||||
|
|
||||||
tweaks = {
|
tweaks = {
|
||||||
|
## MobileGestalt Tweaks
|
||||||
"DynamicIsland": MobileGestaltPickerTweak("Toggle Dynamic Island", "oPeik/9e8lQWMszEjbPzng", "ArtworkDeviceSubType", [2436, 2556, 2796, 2976, 2622, 2868]),
|
"DynamicIsland": MobileGestaltPickerTweak("Toggle Dynamic Island", "oPeik/9e8lQWMszEjbPzng", "ArtworkDeviceSubType", [2436, 2556, 2796, 2976, 2622, 2868]),
|
||||||
"ModelName": MobileGestaltTweak("Set Device Model Name", "oPeik/9e8lQWMszEjbPzng", "ArtworkDeviceProductDescription", "", TweakModifyType.TEXT),
|
"ModelName": MobileGestaltTweak("Set Device Model Name", "oPeik/9e8lQWMszEjbPzng", "ArtworkDeviceProductDescription", "", TweakModifyType.TEXT),
|
||||||
# MobileGestaltTweak("Fix Dynamic Island", "YlEtTtHlNesRBMal1CqRaA"),
|
|
||||||
# MobileGestaltTweak("Set Dynamic Island Location", "Zg7DduDoSCy6vY6mhy3n2w", value="{ x: 390.000000, y: 205.848432, width: 50.000000, height: 105.651573 }"), # not sure what value this is supposed to be but it removes the island currently
|
|
||||||
"BootChime": MobileGestaltTweak("Toggle Boot Chime", "QHxt+hGLaBPbQJbXiUJX3w"),
|
"BootChime": MobileGestaltTweak("Toggle Boot Chime", "QHxt+hGLaBPbQJbXiUJX3w"),
|
||||||
"ChargeLimit": MobileGestaltTweak("Toggle Charge Limit", "37NVydb//GP/GrhuTN+exg"),
|
"ChargeLimit": MobileGestaltTweak("Toggle Charge Limit", "37NVydb//GP/GrhuTN+exg"),
|
||||||
"CollisionSOS": MobileGestaltTweak("Toggle Collision SOS", "HCzWusHQwZDea6nNhaKndw"),
|
"CollisionSOS": MobileGestaltTweak("Toggle Collision SOS", "HCzWusHQwZDea6nNhaKndw"),
|
||||||
@@ -25,7 +25,8 @@ tweaks = {
|
|||||||
"AOD": MobileGestaltMultiTweak("Always On Display",
|
"AOD": MobileGestaltMultiTweak("Always On Display",
|
||||||
{"2OOJf1VhaM7NxfRok3HbWQ": 1, "j8/Omm6s1lsmTDFsXjsBfA": 1},
|
{"2OOJf1VhaM7NxfRok3HbWQ": 1, "j8/Omm6s1lsmTDFsXjsBfA": 1},
|
||||||
min_version=Version("18.0")),
|
min_version=Version("18.0")),
|
||||||
"SleepApnea": MobileGestaltTweak("Toggle Sleep Apnea (real) [for apple watches]", "e0HV2blYUDBk/MsMEQACNA", min_version=Version("18.0"), divider_below=True),
|
|
||||||
|
## Feature Flag Tweaks
|
||||||
"ClockAnim": FeatureFlagTweak("Toggle Lockscreen Clock Animation", flag_category='SpringBoard',
|
"ClockAnim": FeatureFlagTweak("Toggle Lockscreen Clock Animation", flag_category='SpringBoard',
|
||||||
flag_names=['SwiftUITimeAnimation'],
|
flag_names=['SwiftUITimeAnimation'],
|
||||||
min_version=Version("18.0")),
|
min_version=Version("18.0")),
|
||||||
@@ -33,5 +34,116 @@ tweaks = {
|
|||||||
flag_names=['AutobahnQuickSwitchTransition', 'SlipSwitch', 'PosterEditorKashida'],
|
flag_names=['AutobahnQuickSwitchTransition', 'SlipSwitch', 'PosterEditorKashida'],
|
||||||
min_version=Version("18.0")),
|
min_version=Version("18.0")),
|
||||||
"PhotoUI": FeatureFlagTweak("Enable Old Photo UI", flag_category='Photos', flag_names=['Lemonade'], is_list=False, inverted=True, min_version=Version("18.0")),
|
"PhotoUI": FeatureFlagTweak("Enable Old Photo UI", flag_category='Photos', flag_names=['Lemonade'], is_list=False, inverted=True, min_version=Version("18.0")),
|
||||||
"AI": FeatureFlagTweak("Enable Apple Intelligence", flag_category='SpringBoard', flag_names=['Domino', 'SuperDomino'], min_version=Version("18.1"))
|
"AI": FeatureFlagTweak("Enable Apple Intelligence", flag_category='SpringBoard', flag_names=['Domino', 'SuperDomino'], min_version=Version("18.1"), divider_below=True),
|
||||||
|
|
||||||
|
## Springboard Tweaks
|
||||||
|
"LockScreenFootnote": BasicPlistTweak(
|
||||||
|
"Lock Screen Footnote Text",
|
||||||
|
FileLocation.footnote,
|
||||||
|
key="LockScreenFootnote", value="",
|
||||||
|
edit_type=TweakModifyType.TEXT
|
||||||
|
),
|
||||||
|
"SBDontLockAfterCrash": BasicPlistTweak(
|
||||||
|
"Disable Lock After Respring",
|
||||||
|
FileLocation.springboard,
|
||||||
|
"SBDontLockAfterCrash"
|
||||||
|
),
|
||||||
|
"SBDontDimOrLockOnAC": BasicPlistTweak(
|
||||||
|
"Disable Screen Dimming While Charging",
|
||||||
|
FileLocation.springboard,
|
||||||
|
"SBDontDimOrLockOnAC"
|
||||||
|
),
|
||||||
|
"SBHideLowPowerAlerts": BasicPlistTweak(
|
||||||
|
"Disable Low Battery Alerts",
|
||||||
|
FileLocation.springboard,
|
||||||
|
"SBHideLowPowerAlerts"
|
||||||
|
),
|
||||||
|
"SBNeverBreadcrumb": BasicPlistTweak(
|
||||||
|
"Disable Breadcrumb",
|
||||||
|
FileLocation.springboard,
|
||||||
|
"SBNeverBreadcrumb"
|
||||||
|
),
|
||||||
|
"SBShowSupervisionTextOnLockScreen": BasicPlistTweak(
|
||||||
|
"Show Supervision Text on Lock Screen",
|
||||||
|
FileLocation.springboard,
|
||||||
|
"SBShowSupervisionTextOnLockScreen"
|
||||||
|
),
|
||||||
|
"AirplaySupport": BasicPlistTweak(
|
||||||
|
"Enable AirPlay support for Stage Manager",
|
||||||
|
FileLocation.springboard,
|
||||||
|
"SBExtendedDisplayOverrideSupportForAirPlayAndDontFileRadars",
|
||||||
|
divider_below=True
|
||||||
|
),
|
||||||
|
|
||||||
|
## Internal Options
|
||||||
|
"SBBuildNumber": BasicPlistTweak(
|
||||||
|
"Show Build Version in Status Bar",
|
||||||
|
FileLocation.globalPreferences,
|
||||||
|
"UIStatusBarShowBuildVersion"
|
||||||
|
),
|
||||||
|
"RTL": BasicPlistTweak(
|
||||||
|
"Force Right-to-Left Layout",
|
||||||
|
FileLocation.globalPreferences,
|
||||||
|
"NSForceRightToLeftWritingDirection"
|
||||||
|
),
|
||||||
|
"MetalForceHudEnabled": BasicPlistTweak(
|
||||||
|
"Enable Metal HUD Debug",
|
||||||
|
FileLocation.globalPreferences,
|
||||||
|
"MetalForceHudEnabled"
|
||||||
|
),
|
||||||
|
"AccessoryDeveloperEnabled": BasicPlistTweak(
|
||||||
|
"Enable Accessory Debugging",
|
||||||
|
FileLocation.globalPreferences,
|
||||||
|
"AccessoryDeveloperEnabled"
|
||||||
|
),
|
||||||
|
"iMessageDiagnosticsEnabled": BasicPlistTweak(
|
||||||
|
"Enable iMessage Debugging",
|
||||||
|
FileLocation.globalPreferences,
|
||||||
|
"iMessageDiagnosticsEnabled"
|
||||||
|
),
|
||||||
|
"IDSDiagnosticsEnabled": BasicPlistTweak(
|
||||||
|
"Enable Continuity Debugging",
|
||||||
|
FileLocation.globalPreferences,
|
||||||
|
"IDSDiagnosticsEnabled"
|
||||||
|
),
|
||||||
|
"VCDiagnosticsEnabled": FileLocation(
|
||||||
|
"Enable FaceTime Debugging",
|
||||||
|
FileLocation.globalPreferences,
|
||||||
|
"VCDiagnosticsEnabled"
|
||||||
|
),
|
||||||
|
"AppStoreDebug": FileLocation(
|
||||||
|
"Enable App Store Debug Gesture",
|
||||||
|
FileLocation.appStore,
|
||||||
|
"debugGestureEnabled"
|
||||||
|
),
|
||||||
|
"NotesDebugMode": FileLocation(
|
||||||
|
"Enable Notes App Debug Mode",
|
||||||
|
FileLocation.notes,
|
||||||
|
"DebugModeEnabled"
|
||||||
|
),
|
||||||
|
"BKDigitizerVisualizeTouches": FileLocation(
|
||||||
|
"Show Touches With Debug Info",
|
||||||
|
FileLocation.backboardd,
|
||||||
|
"BKDigitizerVisualizeTouches"
|
||||||
|
),
|
||||||
|
"BKHideAppleLogoOnLaunch": FileLocation(
|
||||||
|
"Hide Respring Icon",
|
||||||
|
FileLocation.backboardd,
|
||||||
|
"BKHideAppleLogoOnLaunch"
|
||||||
|
),
|
||||||
|
"EnableWakeGestureHaptic": FileLocation(
|
||||||
|
"Vibrate on Raise-to-Wake",
|
||||||
|
FileLocation.coreMotion,
|
||||||
|
"EnableWakeGestureHaptic"
|
||||||
|
),
|
||||||
|
"PlaySoundOnPaste": FileLocation(
|
||||||
|
"Play Sound on Paste",
|
||||||
|
FileLocation.pasteboard,
|
||||||
|
"PlaySoundOnPaste"
|
||||||
|
),
|
||||||
|
"AnnounceAllPastes": FileLocation(
|
||||||
|
"Show Notifications for System Pastes",
|
||||||
|
FileLocation.pasteboard,
|
||||||
|
"AnnounceAllPastes"
|
||||||
|
)
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user