Skip to content
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

fix: android secure storage #803

Merged
merged 1 commit into from
Jan 16, 2025
Merged

Conversation

edgarkhanzadian
Copy link
Collaborator

@edgarkhanzadian edgarkhanzadian commented Jan 13, 2025

Secure mode now works also for PIN, password, or pattern.

Things that need to get merged into this PR:

@edgarkhanzadian
Copy link
Collaborator Author

@camerow can you, please, try it on your device?

const { mnemonic, passphrase } = await mnemonicStore(fingerprint).getMnemonic();

if (!mnemonic) throw new Error('No mnemonic found for fingerprint ' + fingerprint);
async deriveNextAccountKeychainsFrom(
Copy link
Contributor

Choose a reason for hiding this comment

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

How about having two functions.

  • deriveNextAccountKeychainsFromFingerprint
  • deriveNextAccountKeychains - accepts mnemonic + passphrase and calls deriveNextAccountKeychainsFromFingerprint ?

I think that will make it cleaner and easier to follow

Copy link
Collaborator

Choose a reason for hiding this comment

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

+1

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yea but the problem is that i need to have mnemonic in deriveNextAccountKeychainsFromFingerprint function, such that i'd be able to get a rootKeychain there. And i'm trying not to call mnemonicStore(props.fingerprint).getMnemonic() again so that we don't display a biometrics check multiple times.

So I need to have a function that would have mnemonic, password and fingerprint received as props. But, I don't want to call that function with all of the props as i can derive fingerprint from mnemonic (using biometrics) and vice versa (without biometrics). This way, i can have an overloaded function that can either receive fingerprint or mnemonic, and with that it would be able to derive next account keychains.

Copy link
Contributor

@pete-watters pete-watters left a comment

Choose a reason for hiding this comment

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

Nice work Edgar! I added some suggestions on cleaning the code up a bit.

It would be also good to:

  • add a maestro test or two to confirm it works
  • create Linear tasks for the outstanding issues you mentioned
  • link this PR to the secure storage task

@camerow camerow added the needs:demo-build Create EAS simulator build based on label label Jan 13, 2025
@leather-bot
Copy link
Contributor

@camerow
Copy link
Collaborator

camerow commented Jan 13, 2025

@edgarkhanzadian I'm getting a blank dead screen when creating a new wallet from zero-state freshly installed application after enabling secure mode.

  1. Fresh install of app
  2. Go to settings -> Enable secure mode
  3. Create new wallet
  4. Black screen

After trying a few times the screen was no longer blank but the application crashes when I press the "I've backed it up" button.

@leather-bot
Copy link
Contributor

@edgarkhanzadian
Copy link
Collaborator Author

@camerow

I'm getting a blank dead screen when creating a new wallet from zero-state freshly installed application after enabling secure mode.

yeap that's the blur view issue happening, it's happening on dev too so will fix as part of a separate PR

After trying a few times the screen was no longer blank but the application crashes when I press the "I've backed it up" button.

If that happens on dark mode, then it should be lottie related

Copy link

codecov bot commented Jan 14, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 29.07%. Comparing base (81ab5f9) to head (d8c1f7e).
Report is 1 commits behind head on dev.

Additional details and impacted files
@@           Coverage Diff           @@
##              dev     #803   +/-   ##
=======================================
  Coverage   29.07%   29.07%           
=======================================
  Files         204      204           
  Lines        8132     8132           
  Branches      560      560           
=======================================
  Hits         2364     2364           
  Misses       5768     5768           
Components Coverage Δ
bitcoin 64.15% <ø> (ø)
query 12.60% <ø> (ø)
utils 42.64% <ø> (ø)
crypto 68.21% <ø> (ø)
stacks 71.78% <ø> (ø)

@leather-bot
Copy link
Contributor

@leather-bot
Copy link
Contributor

@camerow
Copy link
Collaborator

camerow commented Jan 14, 2025

@edgarkhanzadian so this isn't quite testable in the current state of the app?

This was referenced Jan 15, 2025
@edgarkhanzadian
Copy link
Collaborator Author

edgarkhanzadian commented Jan 15, 2025

@camerow alrighty, with those 2 fixes now in, this PR should be ready for testing

@leather-bot
Copy link
Contributor

@leather-bot
Copy link
Contributor

@leather-bot
Copy link
Contributor

@leather-bot
Copy link
Contributor

@leather-bot
Copy link
Contributor

@leather-bot
Copy link
Contributor

@edgarkhanzadian edgarkhanzadian removed the needs:demo-build Create EAS simulator build based on label label Jan 15, 2025
@edgarkhanzadian edgarkhanzadian force-pushed the fix/android-secure-storage branch from fad950a to 0818a42 Compare January 15, 2025 14:13
@camerow
Copy link
Collaborator

camerow commented Jan 15, 2025

@edgarkhanzadian tested and this is working for me now! Nice one.

🚀

Copy link
Collaborator

@kyranjamie kyranjamie left a comment

Choose a reason for hiding this comment

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

Great work @edgarkhanzadian

@edgarkhanzadian edgarkhanzadian force-pushed the fix/android-secure-storage branch from c862bdc to b3beee3 Compare January 16, 2025 12:46
@edgarkhanzadian edgarkhanzadian force-pushed the fix/android-secure-storage branch from b3beee3 to d8c1f7e Compare January 16, 2025 15:05
@edgarkhanzadian edgarkhanzadian added this pull request to the merge queue Jan 16, 2025
Merged via the queue into dev with commit 1281837 Jan 16, 2025
13 checks passed
@edgarkhanzadian edgarkhanzadian deleted the fix/android-secure-storage branch January 16, 2025 17:45
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.

6 participants