Skip to content

Commit 3054e8e

Browse files
committed
Fix YubiKey feature detection logics
1 parent 0d1f06b commit 3054e8e

File tree

4 files changed

+3
-6
lines changed

4 files changed

+3
-6
lines changed

pass/AppDelegate.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
3535
}
3636
}
3737
UNUserNotificationCenter.current().delegate = NotificationCenterDispatcher.shared
38-
#if !targetEnvironment(simulator)
39-
_ = passKit.YubiKeyConnection.shared
40-
#endif
4138
return true
4239
}
4340

pass/Controllers/PasswordDetailTableViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ class PasswordDetailTableViewController: UITableViewController, UIGestureRecogni
101101
}
102102

103103
private func decryptThenShowPassword() {
104-
if Defaults.isYubiKeyEnabled {
104+
if Defaults.isYubiKeyEnabled, YubiKitDeviceCapabilities.supportsISO7816NFCTags {
105105
decryptThenShowPasswordYubiKey()
106106
} else {
107107
decryptThenShowPasswordLocalKey()

pass/Controllers/SettingsTableViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ class SettingsTableViewController: UITableViewController, UITabBarControllerDele
185185
)
186186
}
187187

188-
if YubiKitDeviceCapabilities.supportsMFIAccessoryKey {
188+
if YubiKitDeviceCapabilities.supportsISO7816NFCTags {
189189
optionMenu.addAction(
190190
UIAlertAction(title: Defaults.isYubiKeyEnabled ? "✓ YubiKey" : "YubiKey", style: .default) { _ in
191191
Defaults.isYubiKeyEnabled.toggle()

passKit/Helpers/YubiKeyConnection.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public class YubiKeyConnection: NSObject {
1818

1919
override init() {
2020
super.init()
21-
if YubiKitDeviceCapabilities.supportsMFIAccessoryKey {
21+
if YubiKitDeviceCapabilities.supportsISO7816NFCTags {
2222
YubiKitManager.shared.delegate = self
2323
YubiKitManager.shared.startAccessoryConnection()
2424
}

0 commit comments

Comments
 (0)