Fix: Resolve Incompatibility Between react-native-keychain Versions 8.2.0 and 9.0.0 for getGenericPassword #707
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves [#704]
Description:
This PR addresses an incompatibility issue in
react-native-keychain
between versions 8.2.0 and 9+. The issue arises when passwords set using version 8.2.0 cannot be retrieved using version 9+ due to differences inEntity
prefix construction during encryption and decryption.Issue Summary:
getGenericPassword
in version 9+, the following error is encountered:Root Cause:
Entity
prefix construction caused a mismatch between how encrypted data was stored in version 8.2.0 and how it is retrieved in version 9+Changes Made:
createPasswordEntity
andcreateUsernameEntity
methods in the Kotlin implementation to ensure consistent prefix generation with the Java implementation.RN_KEYCHAIN:<alias>pass
RN_KEYCHAIN:<alias>pass
(now consistent).Impact:
Environment Details:
Checklist: