Skip to content
This repository has been archived by the owner on Apr 16, 2021. It is now read-only.

Adding Fingerprint after call to .read() gives READY state #5

Open
danh32 opened this issue Aug 9, 2016 · 4 comments
Open

Adding Fingerprint after call to .read() gives READY state #5

danh32 opened this issue Aug 9, 2016 · 4 comments

Comments

@danh32
Copy link
Contributor

danh32 commented Aug 9, 2016

In SampleActivity, there's a "How How did you do that!?" toast. Here's how:

  1. Launch the Whorlwind sample app
  2. Click "READ" on a row
  3. Navigate to Android's fingerprint settings
  4. Add a new fingerprint
  5. Navigate back to Whorlwind sample app
  6. Tap READ again
  7. Toast appears

I haven't had a chance to debug any further but will update here if I find any more.

@mattprecious
Copy link
Contributor

This is probably a bug in the sample app. It should probably cancel the fingerprint authentication when the activity is paused.

@danh32
Copy link
Contributor Author

danh32 commented Aug 9, 2016

I think it does - I have to click the "READ" button again for it to start listening to the sensor again anyhow.

@xxfast
Copy link

xxfast commented Oct 30, 2018

I'm getting a crash when I try step 6 as seen on #50

@oldergod
Copy link
Member

oldergod commented Oct 30, 2018

So I looked things up:

First, every time one subscribes to whorldwind#read(), the each time newly created FingerprintAuthOnSubscribe, prepare the whorldwind.keystore which actually clears the storage if necessary.
Actually adding fingerprints to the device invalidates the key we have. This means that every time the keystore is prepared, it will clear the storage.

Second, although we're gonna clear the storage, the adapter isn't updated on resume. Because when the activity paused, and started again, the sample apps subscribes only when a tap event has been emitted by the adapter (not on resume); which means the storage gets cleared every time the user tap an item for the first time, not on loading.
On creation, this isn't a problem because when we seed the storage, the keystore is prepared by the write happening via the seeding.

  1. Not sure how to fix the adapter.
  2. Not sure if we should also change the API of wholdwind to let the user proactively be sure the keys are still valid.

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

4 participants