diff --git a/AutofillCredentialProvider/CredentialProvider/CredentialProviderViewController.swift b/AutofillCredentialProvider/CredentialProvider/CredentialProviderViewController.swift index 35f730611e..557b7292e7 100644 --- a/AutofillCredentialProvider/CredentialProvider/CredentialProviderViewController.swift +++ b/AutofillCredentialProvider/CredentialProvider/CredentialProviderViewController.swift @@ -22,6 +22,7 @@ import SwiftUI import BrowserServicesKit import Core import Common +import os.log class CredentialProviderViewController: ASCredentialProviderViewController { @@ -37,7 +38,11 @@ class CredentialProviderViewController: ASCredentialProviderViewController { tld: tld) private lazy var secureVault: (any AutofillSecureVault)? = { - try? AutofillSecureVaultFactory.makeVault(reporter: SecureVaultReporter()) + if findKeychainItemsWithV4() { + return try? AutofillSecureVaultFactory.makeVault(reporter: SecureVaultReporter()) + } else { + return nil + } }() private lazy var tld: TLD = TLD() @@ -110,7 +115,9 @@ class CredentialProviderViewController: ASCredentialProviderViewController { installChildViewController(hostingController) Task { - await credentialIdentityStoreManager.populateCredentialStore() + if findKeychainItemsWithV4() { + await credentialIdentityStoreManager.populateCredentialStore() + } } Pixel.fire(pixel: .autofillExtensionEnabled) @@ -203,4 +210,31 @@ class CredentialProviderViewController: ASCredentialProviderViewController { } } } + + private func findKeychainItemsWithV4() -> Bool { + var itemsWithV4: [String] = [] + + let query: [String: Any] = [ + kSecClass as String: kSecClassGenericPassword, + kSecReturnAttributes as String: kCFBooleanTrue!, + kSecMatchLimit as String: kSecMatchLimitAll + ] + + var result: AnyObject? + + let status = SecItemCopyMatching(query as CFDictionary, &result) + + if status == errSecSuccess, let items = result as? [[String: Any]] { + for item in items { + if let service = item[kSecAttrService as String] as? String, + service.contains("v4") { + itemsWithV4.append(service) + } + } + } else { + Logger.autofill.debug("No items found or error: \(status)") + } + + return !itemsWithV4.isEmpty + } } diff --git a/Configuration/Version.xcconfig b/Configuration/Version.xcconfig index 70fa812aec..fde561fa40 100644 --- a/Configuration/Version.xcconfig +++ b/Configuration/Version.xcconfig @@ -1 +1 @@ -MARKETING_VERSION = 7.150.0 +MARKETING_VERSION = 7.149.1 diff --git a/DuckDuckGo.xcodeproj/xcshareddata/xcschemes/AutofillCredentialProvider.xcscheme b/DuckDuckGo.xcodeproj/xcshareddata/xcschemes/AutofillCredentialProvider.xcscheme index 02ee5661e7..7708563eda 100644 --- a/DuckDuckGo.xcodeproj/xcshareddata/xcschemes/AutofillCredentialProvider.xcscheme +++ b/DuckDuckGo.xcodeproj/xcshareddata/xcschemes/AutofillCredentialProvider.xcscheme @@ -46,7 +46,7 @@ shouldAutocreateTestPlan = "YES"> DefaultValue - 7.150.0 + 7.149.1 Key version Title diff --git a/fastlane/metadata/default/release_notes.txt b/fastlane/metadata/default/release_notes.txt index 66b16c0810..58bb2b4a63 100644 --- a/fastlane/metadata/default/release_notes.txt +++ b/fastlane/metadata/default/release_notes.txt @@ -1 +1 @@ -- Bug fixes and other improvements \ No newline at end of file + - If you use dark mode, you'll notice the app icon has an improved look, whether you've stuck with the classic orange or picked a custom icon color. \ No newline at end of file