From e23327c9dce2af0c2b3efe5de6c24a6b955573fa Mon Sep 17 00:00:00 2001 From: Micah Alpern Date: Thu, 30 Jul 2026 11:22:56 -0700 Subject: [PATCH] Fix stopping disabled KeepAlive service --- Sources/KeyPathApp/Info.plist | 2 +- .../KeyPathCore/KeyPathHelperContract.swift | 2 +- Sources/KeyPathHelper/HelperService.swift | 46 ++++++++++++++----- Sources/KeyPathHelper/Info.plist | 4 +- ...erServiceKeepAliveLifecycleLintTests.swift | 5 +- .../bugs/cli-service-control-helper-bypass.md | 14 ++++-- 6 files changed, 53 insertions(+), 20 deletions(-) diff --git a/Sources/KeyPathApp/Info.plist b/Sources/KeyPathApp/Info.plist index f86e321df..5dbafacfc 100644 --- a/Sources/KeyPathApp/Info.plist +++ b/Sources/KeyPathApp/Info.plist @@ -11,7 +11,7 @@ CFBundleDisplayName KeyPath CFBundleVersion - 10 + 11 CFBundleShortVersionString 1.0.1 CFBundlePackageType diff --git a/Sources/KeyPathCore/KeyPathHelperContract.swift b/Sources/KeyPathCore/KeyPathHelperContract.swift index 1a412e62e..336d31613 100644 --- a/Sources/KeyPathCore/KeyPathHelperContract.swift +++ b/Sources/KeyPathCore/KeyPathHelperContract.swift @@ -1,5 +1,5 @@ /// Shared identity and compatibility contract for the privileged helper. public enum KeyPathHelperContract { /// Version returned by the helper XPC service and packaged in its Info.plist. - public static let version = "1.3.1" + public static let version = "1.3.2" } diff --git a/Sources/KeyPathHelper/HelperService.swift b/Sources/KeyPathHelper/HelperService.swift index c9d17c8ee..8ce613761 100644 --- a/Sources/KeyPathHelper/HelperService.swift +++ b/Sources/KeyPathHelper/HelperService.swift @@ -171,6 +171,13 @@ class HelperService: NSObject, HelperProtocol { executePrivilegedOperation( name: "stopKanataService", operation: { + // Capture the live process before disabling the service. Once a + // launchd job is disabled, `launchctl kill system/