Skip to content

Commit

Permalink
savepoint
Browse files Browse the repository at this point in the history
  • Loading branch information
llbartekll committed Nov 30, 2023
1 parent bab4983 commit 7bf3088
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 15 deletions.
3 changes: 2 additions & 1 deletion Example/WalletApp/ApplicationLayer/Application.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Foundation
import WalletConnectChat
import WalletConnectUtils
import WalletConnectSigner

final class Application {
var uri: WalletConnectURI?
Expand Down
16 changes: 2 additions & 14 deletions Sources/WalletConnectKMS/Keychain/KeychainStorage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,7 @@ public final class KeychainStorage: KeychainStorageProtocol {
updateQuery[kSecAttrAccessible] = kSecAttrAccessibleWhenUnlockedThisDeviceOnly

let attributes = [kSecAttrAccessible: kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly]
let status = secItem.update(updateQuery as CFDictionary, attributes as CFDictionary)

if status == errSecSuccess {
print("Successfuly migrated with kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly")
} else {
print("Item for query not found, item potentially already migrated with kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly")
}
let _ = secItem.update(updateQuery as CFDictionary, attributes as CFDictionary)
}

private func tryToMigrateKeyToNewAccessGroupOnRead(key: String) throws -> Data? {
Expand Down Expand Up @@ -189,12 +183,6 @@ public final class KeychainStorage: KeychainStorageProtocol {
kSecAttrAccessGroup: accessGroup
] as [CFString: Any]

let status = secItem.update(query as CFDictionary, attributesToUpdate as CFDictionary)

if status == errSecSuccess {
print("Successfuly migrated with kSecAttrAccessGroup")
} else {
print("Item for query not found, item potentially already migrated with kSecAttrAccessGroup")
}
let _ = secItem.update(query as CFDictionary, attributesToUpdate as CFDictionary)
}
}

0 comments on commit 7bf3088

Please sign in to comment.