From 4f2560276fd2f134043e8725041ec4f35f104e1e Mon Sep 17 00:00:00 2001 From: A11pwnX Date: Wed, 3 Jun 2026 15:29:02 +0200 Subject: [PATCH 1/2] Implement syncStateFromPlist to verify OTA status Check OTA update status from /private/var/db/com.apple.xpc.launchd/disabled.plist. And removing the unnecessary respring button. --- lara/views/tweaks/OTAView.swift | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/lara/views/tweaks/OTAView.swift b/lara/views/tweaks/OTAView.swift index da79720c..32951cf7 100644 --- a/lara/views/tweaks/OTAView.swift +++ b/lara/views/tweaks/OTAView.swift @@ -51,14 +51,14 @@ struct OTAView: View { } } .disabled(isWorking || !otaDisabled) - - Button("Respring") { - mgr.respring() - } - .disabled(isWorking) } } .navigationTitle("OTA Updates") + .onAppear { + if !otaDisabled { + syncStateFromPlist() + } + } .alert("Result", isPresented: .constant(lastResult != nil)) { Button("OK") { lastResult = nil } } message: { @@ -66,6 +66,28 @@ struct OTAView: View { } } + private func syncStateFromPlist() { + DispatchQueue.global(qos: .userInitiated).async { + let plistPath = "/private/var/db/com.apple.xpc.launchd/disabled.plist" + let daemonLabels = [ + "com.apple.mobile.softwareupdated", + "com.apple.OTATaskingAgent", + "com.apple.softwareupdateservicesd", + "com.apple.mobile.NRDUpdated", + ] + guard let data = NSData(contentsOfFile: plistPath) as Data?, + let plist = try? PropertyListSerialization.propertyList(from: data, options: [], format: nil) as? [String: Any] else { + return + } + let allDisabled = daemonLabels.allSatisfy { (plist[$0] as? Bool) == true } + if allDisabled { + DispatchQueue.main.async { + otaDisabled = true + } + } + } + } + private func apply(disabled: Bool) { isWorking = true DispatchQueue.global(qos: .userInitiated).async { From 028243afbe8cdf0780d0b9f9334f66a3ebde2571 Mon Sep 17 00:00:00 2001 From: A11pwnX Date: Wed, 3 Jun 2026 15:30:13 +0200 Subject: [PATCH 2/2] Implement syncStateFromPlist to manage Screen Time state Check Screen Time status from /private/var/db/com.apple.xpc.launchd/disabled.plist. And removing the unnecessary respring button. --- lara/views/tweaks/ScreenTimeView.swift | 30 +++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/lara/views/tweaks/ScreenTimeView.swift b/lara/views/tweaks/ScreenTimeView.swift index fa997892..5796f813 100644 --- a/lara/views/tweaks/ScreenTimeView.swift +++ b/lara/views/tweaks/ScreenTimeView.swift @@ -80,14 +80,14 @@ struct ScreenTimeView: View { } } .disabled(isWorking || !screenTimeDisabled) - - Button("Respring") { - mgr.respring() - } - .disabled(isWorking) } } .navigationTitle("Screen Time") + .onAppear { + if !screenTimeDisabled { + syncStateFromPlist() + } + } .alert("Result", isPresented: .constant(lastResult != nil)) { Button("OK") { lastResult = nil } } message: { @@ -95,6 +95,26 @@ struct ScreenTimeView: View { } } + private func syncStateFromPlist() { + DispatchQueue.global(qos: .userInitiated).async { + let plistPath = "/private/var/db/com.apple.xpc.launchd/disabled.plist" + let daemonLabels = [ + "com.apple.ScreenTimeAgent", + "com.apple.UsageTrackingAgent", + ] + guard let data = NSData(contentsOfFile: plistPath) as Data?, + let plist = try? PropertyListSerialization.propertyList(from: data, options: [], format: nil) as? [String: Any] else { + return + } + let allDisabled = daemonLabels.allSatisfy { (plist[$0] as? Bool) == true } + if allDisabled { + DispatchQueue.main.async { + screenTimeDisabled = true + } + } + } + } + private func applyDisable() { isWorking = true let agent = killScreenTimeAgent