Skip to content

Commit 3aa7193

Browse files
committed
1.1.2 RCF
1 parent a8cff2a commit 3aa7193

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Geranium/ByeTime/ByeTimeHelper.swift

+7-3
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,13 @@ func doStuff() {
121121
let entriesToRemove = ["com.apple.familycircled", "com.apple.UsageTrackingAgent", "com.apple.ScreenTimeAgent", "com.apple.homed"]
122122
RootHelper.removeItem(at: URL(fileURLWithPath: "/var/mobile/Documents/disabled.plist"))
123123
RootHelper.copy(from: URL(fileURLWithPath: "/var/db/com.apple.xpc.launchd/disabled.plist"), to: URL(fileURLWithPath: "/var/mobile/Documents/disabled.plist"))
124-
var plist = try? readPlist(atPath: "/var/mobile/Documents/disabled.plist")
125-
removeEntriesFromPlistArray(plist!, entriesToRemove: entriesToRemove, arrayKey: "")
126-
try? writePlist(plist!, toPath: "/var/mobile/Documents/disabled.plist")
124+
RootHelper.setPermission(url: URL(fileURLWithPath: "/var/mobile/Documents/disabled.plist"))
125+
if var plist = try? readPlist(atPath: "/var/mobile/Documents/disabled.plist") {
126+
removeEntriesFromPlistArray(plist, entriesToRemove: entriesToRemove, arrayKey: "")
127+
try? writePlist(plist, toPath: "/var/mobile/Documents/disabled.plist")
128+
} else {
129+
sendLog("ST_REENABLE_ERR_PLIST")
130+
}
127131
RootHelper.removeItem(at: URL(fileURLWithPath: "/var/db/com.apple.xpc.launchd/disabled.plist"))
128132
RootHelper.move(from: URL(fileURLWithPath :"/var/mobile/Documents/disabled.plist"), to: URL(fileURLWithPath: "/var/db/com.apple.xpc.launchd/disabled.plist"))
129133
RootHelper.removeItem(at: URL(fileURLWithPath: "/var/mobile/Documents/disabled.plist"))

0 commit comments

Comments
 (0)