8000 Use system PIN prompt when possible on Android by janicduplessis · Pull Request #6645 · rainbow-me/rainbow · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Use system PIN prompt when possible on Android #6645

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
May 30, 2025

Conversation

janicduplessis
Copy link
Contributor
@janicduplessis janicduplessis commented May 22, 2025

Fixes APP-####

What changed (plus any additional context for devs)

  • Upgrade react-native-keychain and use device passcode when possible instead of rainbow pin.
  • Fix creating backup with rainbow pin.

Screen recordings / screenshots

What to test

Tests scenarios in the notion doc.

Copy link
socket-security bot commented May 22, 2025

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatednpm/​react-native-keychain@​9.2.3 ⏵ 10.0.010010010081100

View full report

@janicduplessis janicduplessis marked this pull request as ready for review May 27, 2025 15:10
@janicduplessis janicduplessis changed the title PoC implementation of using system pin prompt Use system PIN prompt when possible on Android May 27, 2025
@jinchung
Copy link
Member

Launch in simulator or device for 1009880

8000
Copy link
Member
@derHowie derHowie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 ✅

BiometricManager.Authenticators.DEVICE_CREDENTIAL

else ->
- null
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a new part of the patch, in our case we do not specify what authenticators to use when we get values, but if we do not specify any it will prompt for class 2 when available, which will then fail to decode the keychain. This changes this so it defaults to BiometricManager.Authenticators.BIOMETRIC_STRONG or BiometricManager.Authenticators.DEVICE_CREDENTIAL. This part of the patch could probably be upstreamed.

}
}

+ override fun canOverrideExistingModule(): Boolean {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part of the patch was not needed.

storage: CipherStorage,
promptInfo: BiometricPrompt.PromptInfo
): ResultHandler {
- return if (storage.isAuthSupported()) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this might actually not be needed, leftover from previous changes I will try to remove.

@derHowie derHowie self-requested a review May 27, 2025 19:44
@jinchung
Copy link
Member

Launch in simulator or device for 139aef7

privateKey: decryptedPrivateKey,
});
}
if ((theKeyIsASeedPhrase || theKeyIsAPrivateKey) && secret?.includes('cipher')) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue was that this code assumed the seed or pkey were encrypted as a stringified JSON object like {"seedphrase": "<encrypted_data>"}, but it is actually just the encrypted data.

@jinchung
Copy link
Member

Launch in simulator or device for 14dd3f7

@jinchung
Copy link
Member

Launch in simulator or device for 389f89e

@jinchung
Copy link
Member

Launch in simulator or device for 27a9a46

Copy link
Contributor
@ibrahimtaveras00 ibrahimtaveras00 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QA Passed 👍🏽

@janicduplessis janicduplessis merged commit ac4413e into develop May 30, 2025
8 checks passed
@janicduplessis janicduplessis deleted the @janic/rn-keychain-changes branch May 30, 2025 14:48
ibrahimtaveras00 pushed a commit that referenced this pull request May 30, 2025
* PoC implementation of using system pin prompt

* Cleanup

* Better patch

* Add comment

* Restore IS_DEV check

* Fix import

* Test fix

* Fix secrets decryption

* Fix patch

* Temp: update force to readonly

* Add a comma

---------

Co-authored-by: jinchung <jin.chung17@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0