Skip to content
This repository has been archived by the owner on Nov 7, 2023. It is now read-only.

Would be great to have kSecAttrAccessible param #104

Open
therobertgrigorian opened this issue Dec 15, 2022 · 1 comment
Open

Would be great to have kSecAttrAccessible param #104

therobertgrigorian opened this issue Dec 15, 2022 · 1 comment

Comments

@therobertgrigorian
Copy link

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch react-native-encrypted-storage@4.0.2 for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-encrypted-storage/android/build.gradle b/node_modules/react-native-encrypted-storage/android/build.gradle
index b762894..dd8f5ff 100644
--- a/node_modules/react-native-encrypted-storage/android/build.gradle
+++ b/node_modules/react-native-encrypted-storage/android/build.gradle
@@ -125,8 +125,8 @@ dependencies {

   testImplementation 'junit:junit:4.13.1'

-  androidTestImplementation 'androidx.test.ext:junit:1.1.2'
+  androidTestImplementation 'androidx.test.ext:junit:1.1.3'
   //noinspection GradleDependency
-  androidTestImplementation 'org.mockito:mockito-android:3.4.6'
-  androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
+  androidTestImplementation 'org.mockito:mockito-android:4.6.1'
+  androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
 }
diff --git a/node_modules/react-native-encrypted-storage/ios/RNEncryptedStorage.m b/node_modules/react-native-encrypted-storage/ios/RNEncryptedStorage.m
index 9ad4b23..987b731 100644
--- a/node_modules/react-native-encrypted-storage/ios/RNEncryptedStorage.m
+++ b/node_modules/react-native-encrypted-storage/ios/RNEncryptedStorage.m
@@ -41,7 +41,8 @@ + (BOOL)requiresMainQueueSetup
     NSDictionary* storeQuery = @{
         (__bridge id)kSecClass : (__bridge id)kSecClassGenericPassword,
         (__bridge id)kSecAttrAccount : key,
-        (__bridge id)kSecValueData : dataFromValue
+        (__bridge id)kSecValueData : dataFromValue,
+        (__bridge id)kSecAttrAccessible : kSecAttrAccessibleAfterFirstUnlock
     };

     // Deletes the existing item prior to inserting the new one

This issue body was partially generated by patch-package.

@rivaros
Copy link

rivaros commented Mar 18, 2023

this fix won't compile for ios,

should be
(__bridge id)kSecAttrAccessible : (__bridge id) kSecAttrAccessibleAfterFirstUnlock

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants