Skip to content

Commit

Permalink
Merge branch 'hotfix/7.149.1'
Browse files Browse the repository at this point in the history
# Conflicts:
#	Configuration/Version.xcconfig
#	DuckDuckGo/Settings.bundle/Root.plist
  • Loading branch information
amddg44 committed Dec 18, 2024
2 parents 4baa50b + 1e0fa7a commit cb89fea
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import SwiftUI
import BrowserServicesKit
import Core
import Common
import os.log

class CredentialProviderViewController: ASCredentialProviderViewController {

Expand All @@ -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()
Expand Down Expand Up @@ -110,7 +115,9 @@ class CredentialProviderViewController: ASCredentialProviderViewController {
installChildViewController(hostingController)

Task {
await credentialIdentityStoreManager.populateCredentialStore()
if findKeychainItemsWithV4() {
await credentialIdentityStoreManager.populateCredentialStore()
}
}

Pixel.fire(pixel: .autofillExtensionEnabled)
Expand Down Expand Up @@ -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
}
}
2 changes: 1 addition & 1 deletion Configuration/Version.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1 @@
MARKETING_VERSION = 7.150.0
MARKETING_VERSION = 7.149.1
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
shouldAutocreateTestPlan = "YES">
</TestAction>
<LaunchAction
buildConfiguration = "Alpha Debug"
buildConfiguration = "Debug"
selectedDebuggerIdentifier = ""
selectedLauncherIdentifier = "Xcode.IDEFoundation.Launcher.PosixSpawn"
launchStyle = "0"
Expand Down
23 changes: 19 additions & 4 deletions DuckDuckGo/AutofillUsageMonitor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,34 @@

import Core
import AuthenticationServices
import BrowserServicesKit

final class AutofillUsageMonitor {

private lazy var credentialIdentityStoreManager: AutofillCredentialIdentityStoreManager? = {
guard let vault = try? AutofillSecureVaultFactory.makeVault(reporter: SecureVaultReporter()) else {
return nil
}

return AutofillCredentialIdentityStoreManager(vault: vault,
tld: AppDependencyProvider.shared.storageCache.tld)
}()

init() {
NotificationCenter.default.addObserver(self, selector: #selector(didReceiveSaveEvent), name: .autofillSaveEvent, object: nil)

ASCredentialIdentityStore.shared.getState({ state in
ASCredentialIdentityStore.shared.getState({ [weak self] state in
if state.isEnabled {
self.autofillExtensionEnabled = true
if self?.autofillExtensionEnabled == nil {
Task {
await self?.credentialIdentityStoreManager?.populateCredentialStore()
}
}
self?.autofillExtensionEnabled = true
} else {
if self.autofillExtensionEnabled != nil {
if self?.autofillExtensionEnabled != nil {
Pixel.fire(pixel: .autofillExtensionDisabled)
self.autofillExtensionEnabled = false
self?.autofillExtensionEnabled = false
}
}
})
Expand Down
2 changes: 1 addition & 1 deletion DuckDuckGo/Settings.bundle/Root.plist
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<array>
<dict>
<key>DefaultValue</key>
<string>7.150.0</string>
<string>7.149.1</string>
<key>Key</key>
<string>version</string>
<key>Title</key>
Expand Down
2 changes: 1 addition & 1 deletion fastlane/metadata/default/release_notes.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
- Bug fixes and other improvements
- 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.

0 comments on commit cb89fea

Please sign in to comment.