| | |
| | | static let searchPaths: [URL] = [ |
| | | URL(fileURLWithPath: "/Applications"), |
| | | URL(fileURLWithPath: "/System/Applications"), |
| | | URL(fileURLWithPath: "/System/Library/CoreServices/Applications"), |
| | | URL(fileURLWithPath: "/System/Cryptexes/App/System/Applications"), |
| | | URL(fileURLWithPath: "/System/Volumes/Preboot/Cryptexes/App/System/Applications"), |
| | | FileManager.default.homeDirectoryForCurrentUser |
| | |
| | | |
| | | private static let systemAppPathPrefixes = [ |
| | | "/System/Applications/", |
| | | "/System/Library/CoreServices/Applications/", |
| | | "/System/Cryptexes/App/System/Applications/", |
| | | "/System/Volumes/Preboot/Cryptexes/App/System/Applications/" |
| | | ] |
| | |
| | | scanCacheLock.unlock() |
| | | } |
| | | |
| | | static func shouldRefreshForSearchPathChanges() -> Bool { |
| | | scanCacheLock.lock() |
| | | let hasCachedApps = cachedScanApps != nil |
| | | let cachedSignature = cachedSearchPathSignature |
| | | scanCacheLock.unlock() |
| | | |
| | | guard hasCachedApps else { return true } |
| | | return cachedSignature != currentSearchPathSignature() |
| | | } |
| | | |
| | | private static func cachedScanIfFresh(matching searchPathSignature: [SearchPathSignature]) -> [AppInfo]? { |
| | | scanCacheLock.lock() |
| | | defer { scanCacheLock.unlock() } |