Skip to content

Commit adb6e16

Browse files
committed
Release 1.1.2
1 parent c327072 commit adb6e16

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

Sources/SystemExtensionKit/SystemExtensionKit.swift

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ import SystemExtensions
1212
#error("SystemExtensionKit doesn't support Swift versions below 5.5.")
1313
#endif
1414

15-
/// Current SystemExtensionKit version 1.1.1. Necessary since SPM doesn't use dynamic libraries. Plus this will be more accurate.
16-
public let version = "1.1.1"
15+
/// Current SystemExtensionKit version 1.1.2. Necessary since SPM doesn't use dynamic libraries. Plus this will be more accurate.
16+
public let version = "1.1.2"
1717

1818
public let SystemExtension = SystemExtensionKit.shared
1919

@@ -156,14 +156,6 @@ extension SystemExtensionKit: OSSystemExtensionRequestDelegate {
156156
}
157157

158158
public func request(_ request: OSSystemExtensionRequest, actionForReplacingExtension existing: OSSystemExtensionProperties, withExtension extension: OSSystemExtensionProperties) -> OSSystemExtensionRequest.ReplacementAction {
159-
if needForceUpdate {
160-
return .replace
161-
}
162-
if #available(macOS 12.0, *) {
163-
if existing.isAwaitingUserApproval {
164-
return .replace
165-
}
166-
}
167159
// existing
168160
let existingBundleIdentifier = existing.bundleIdentifier
169161
let existingBundleVersion = existing.bundleVersion
@@ -174,6 +166,17 @@ extension SystemExtensionKit: OSSystemExtensionRequestDelegate {
174166
let extensionBundleVersion = `extension`.bundleVersion
175167
let extensionBundleShortVersion = `extension`.bundleShortVersion
176168

169+
if needForceUpdate {
170+
delegate?.systemExtensionKit(self, requestResult: .replacingExtension(request, existingBundleShortVersion, extensionBundleShortVersion))
171+
return .replace
172+
}
173+
if #available(macOS 12.0, *) {
174+
if existing.isAwaitingUserApproval {
175+
delegate?.systemExtensionKit(self, requestResult: .replacingExtension(request, existingBundleShortVersion, extensionBundleShortVersion))
176+
return .replace
177+
}
178+
}
179+
177180
guard existingBundleIdentifier == extensionBundleIdentifier,
178181
existingBundleVersion == extensionBundleVersion,
179182
existingBundleShortVersion == extensionBundleShortVersion

0 commit comments

Comments
 (0)