Max Lynch 9 gadi atpakaļ
vecāks
revīzija
1584564151
2 mainītis faili ar 15 papildinājumiem un 7 dzēšanām
  1. 7 7
      src/ios/A0KeyChain/A0SimpleKeychain.m
  2. 8 0
      src/ios/CDVKeychain.m

+ 7 - 7
src/ios/A0KeyChain/A0SimpleKeychain.m

@@ -73,7 +73,7 @@
     if (!key) {
         return nil;
     }
-    
+
     NSDictionary *query = [self queryFetchOneByKey:key message:message];
     CFTypeRef data = nil;
     OSStatus status = SecItemCopyMatching((__bridge CFDictionaryRef)query, &data);
@@ -83,12 +83,12 @@
         }
         return nil;
     }
-    
+
     NSData *dataFound = [NSData dataWithData:(__bridge NSData *)data];
     if (data) {
         CFRelease(data);
     }
-    
+
     return dataFound;
 }
 
@@ -119,9 +119,9 @@
     if (!key) {
         return NO;
     }
-    
+
     NSDictionary *query = [self queryFindByKey:key message:message];
-    
+
     // Touch ID case
     if (self.useAccessControl && self.defaultAccessiblity == A0SimpleKeychainItemAccessibleWhenPasscodeSetThisDeviceOnly) {
         // TouchId case. Doesn't support updating keychain items
@@ -134,7 +134,7 @@
             return status == errSecSuccess;
         }
     }
-    
+
     // Normal case
     OSStatus status = SecItemCopyMatching((__bridge CFDictionaryRef)query, NULL);
     if (status == errSecSuccess) {
@@ -246,7 +246,7 @@
 }
 
 - (NSString*)stringForSecStatus:(OSStatus)status {
-    
+
     switch(status) {
         case errSecSuccess:
             return NSLocalizedStringFromTable(@"errSecSuccess: No error", @"SimpleKeychain", @"Possible error from keychain. ");

+ 8 - 0
src/ios/CDVKeychain.m

@@ -39,7 +39,14 @@
 
     NSString *message = NSLocalizedString(touchIDMessage, @"Prompt TouchID message");
 
+    NSLog(@"Getting value from TouchID %@ - %@", touchIDMessage, message);
+
     A0SimpleKeychain *keychain = [A0SimpleKeychain keychain];
+
+    NSLog(@"Setting to use access control");
+    keychain.useAccessControl = YES;
+    keychain.defaultAccessiblity = A0SimpleKeychainItemAccessibleWhenPasscodeSetThisDeviceOnly;
+    
     NSString *value = [keychain stringForKey:key promptMessage:message];
 
     pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:value];
@@ -66,6 +73,7 @@
     A0SimpleKeychain *keychain = [A0SimpleKeychain keychain];
 
     if(useTouchID) {
+      NSLog(@"Setting to use access control");
       keychain.useAccessControl = YES;
       keychain.defaultAccessiblity = A0SimpleKeychainItemAccessibleWhenPasscodeSetThisDeviceOnly;
     }