Skip to content

Commit 80e0f14

Browse files
committed
fix duplicate value error on ios
1 parent 845cdc8 commit 80e0f14

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

ios/SecureStorage.m

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -184,12 +184,12 @@ - (BOOL)searchKeychainCopyMatchingExists:(NSString *)identifier {
184184
}
185185

186186
- (BOOL)createKeychainValue:(NSString *)value forIdentifier:(NSString *)identifier options: (NSDictionary * __nullable)options {
187-
CFStringRef accessible = accessibleValue(options);
187+
CFStringRef accessibleVal = _accessibleValue(options);
188188
NSMutableDictionary *dictionary = [self newSearchDictionary:identifier];
189189

190190
NSData *valueData = [value dataUsingEncoding:NSUTF8StringEncoding];
191191
[dictionary setObject:valueData forKey:(id)kSecValueData];
192-
dictionary[(__bridge NSString *)kSecAttrAccessible] = (__bridge id)accessible;
192+
dictionary[(__bridge NSString *)kSecAttrAccessible] = (__bridge id)accessibleVal;
193193

194194
OSStatus status = SecItemAdd((CFDictionaryRef)dictionary, NULL);
195195

@@ -201,12 +201,12 @@ - (BOOL)createKeychainValue:(NSString *)value forIdentifier:(NSString *)identifi
201201

202202
- (BOOL)updateKeychainValue:(NSString *)password forIdentifier:(NSString *)identifier options:(NSDictionary * __nullable)options {
203203

204-
CFStringRef accessible = accessibleValue(options);
204+
CFStringRef accessibleVal = _accessibleValue(options);
205205
NSMutableDictionary *searchDictionary = [self newSearchDictionary:identifier];
206206
NSMutableDictionary *updateDictionary = [[NSMutableDictionary alloc] init];
207207
NSData *passwordData = [password dataUsingEncoding:NSUTF8StringEncoding];
208208
[updateDictionary setObject:passwordData forKey:(id)kSecValueData];
209-
updateDictionary[(__bridge NSString *)kSecAttrAccessible] = (__bridge id)accessible;
209+
updateDictionary[(__bridge NSString *)kSecAttrAccessible] = (__bridge id)accessibleVal;
210210
OSStatus status = SecItemUpdate((CFDictionaryRef)searchDictionary,
211211
(CFDictionaryRef)updateDictionary);
212212

@@ -255,7 +255,7 @@ - (void)handleAppUninstallation
255255

256256

257257

258-
CFStringRef accessibleValue(NSDictionary *options)
258+
CFStringRef _accessibleValue(NSDictionary *options)
259259
{
260260
if (options && options[@"accessible"] != nil) {
261261
NSDictionary *keyMap = @{

0 commit comments

Comments
 (0)