This repository was archived by the owner on Nov 7, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -96,15 +96,16 @@ CFStringRef getKeychainAccessibility(NSDictionary *options)
9696
9797RCT_EXPORT_METHOD (getItem:(NSString *)key withOptions:(NSDictionary *) options resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject)
9898{
99- CFStringRef keychainAccessibility = getKeychainAccessibility (options);
10099 NSString *keychainService = getKeychainService (options);
100+ /*
101+ The unique key for kSecClassGenericPassword is composed of: kSecAttrAccount and kSecAttrService
102+ https://stackoverflow.com/a/22519700
103+ */
101104 NSDictionary * getQuery = @{
102- (__bridge id )kSecClass : (__bridge id )kSecClassGenericPassword ,
103105 (__bridge id )kSecAttrAccount : key,
106+ (__bridge id )kSecAttrService : keychainService,
104107 (__bridge id )kSecReturnData : (__bridge id )kCFBooleanTrue ,
105- (__bridge id )kSecMatchLimit : (__bridge id )kSecMatchLimitOne ,
106- (__bridge id )kSecAttrAccessible : (__bridge id )keychainAccessibility,
107- (__bridge id )kSecAttrService : keychainService
108+ (__bridge id )kSecMatchLimit : (__bridge id )kSecMatchLimitOne
108109 };
109110
110111 CFTypeRef dataRef = NULL ;
You can’t perform that action at this time.
0 commit comments