MacAppStoreUpdateDetector: Detect StoreAEService correctly

In macOS 10.15 and macOS 11, the quit Apple event is sent by:
  com.apple.AppStoreDaemon.StoreAEService

In some earlier macOS release, the quit Apple event was sent by:
  com.apple.CommerceKit.StoreAEService

Signed-off-by: Roopesh Chander <roop@roopc.net>
This commit is contained in:
Roopesh Chander 2021-07-22 12:38:45 +05:30 committed by Jason A. Donenfeld
parent f5a14b8434
commit ba4d1e7b21
1 changed files with 1 additions and 1 deletions

View File

@ -13,7 +13,7 @@ class MacAppStoreUpdateDetector {
wg_log(.debug, message: "aevt/quit Apple event received from executable: \(executablePath)") wg_log(.debug, message: "aevt/quit Apple event received from executable: \(executablePath)")
if executablePath.hasPrefix("/System/Library/") { if executablePath.hasPrefix("/System/Library/") {
let executableName = URL(fileURLWithPath: executablePath, isDirectory: false).lastPathComponent let executableName = URL(fileURLWithPath: executablePath, isDirectory: false).lastPathComponent
return executableName == "com.apple.CommerceKit.StoreAEService" return executableName.hasPrefix("com.apple.") && executableName.hasSuffix(".StoreAEService")
} }
return false return false
} }