mirror of
https://github.com/leminlimez/Nugget.git
synced 2025-04-08 04:23:05 +08:00
toggle to nullify screentime agent plist
This commit is contained in:
@@ -18,6 +18,7 @@ class FileLocation(Enum):
|
||||
|
||||
# Daemons
|
||||
disabledDaemons = "/var/db/com.apple.xpc.launchd/disabled.plist"
|
||||
screentime = "/var/mobile/Library/Preferences/ScreenTimeAgent.plist"
|
||||
|
||||
# Risky Options
|
||||
ota = "/var/Managed Preferences/mobile/com.apple.MobileAsset.plist"
|
||||
|
||||
@@ -43,6 +43,21 @@ class Tweak:
|
||||
def apply_tweak(self):
|
||||
raise NotImplementedError
|
||||
|
||||
class NullifyFileTweak(Tweak):
|
||||
def __init__(
|
||||
self, label: str,
|
||||
file_location: FileLocation,
|
||||
min_version: Version = Version("1.0"),
|
||||
owner: int = 501, group: int = 501,
|
||||
divider_below: bool = False
|
||||
):
|
||||
super().__init__(label=label, key=None, value=None, min_version=min_version, owner=owner, group=group, divider_below=divider_below)
|
||||
self.file_location = file_location
|
||||
|
||||
def apply_tweak(self, other_tweaks: dict):
|
||||
if self.enabled:
|
||||
other_tweaks[self.file_location] = b""
|
||||
|
||||
|
||||
class BasicPlistTweak(Tweak):
|
||||
def __init__(
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
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, NullifyFileTweak
|
||||
from .eligibility_tweak import EligibilityTweak, AITweak
|
||||
from .basic_plist_locations import FileLocation
|
||||
|
||||
@@ -283,6 +283,9 @@ tweaks = {
|
||||
},
|
||||
owner=0, group=0
|
||||
),
|
||||
"ClearScreenTimeAgentPlist": NullifyFileTweak(
|
||||
"Clear ScreenTimeAgent Plist", FileLocation.screentime
|
||||
),
|
||||
|
||||
## Risky Options
|
||||
"DisableOTAFile": AdvancedPlistTweak(
|
||||
|
||||
Reference in New Issue
Block a user