whorlwind icon indicating copy to clipboard operation
whorlwind copied to clipboard

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

Open danh32 opened this issue 8 years ago • 4 comments

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.

danh32 avatar Aug 09 '16 19:08 danh32

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

mattprecious avatar Aug 09 '16 19:08 mattprecious

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

danh32 avatar Aug 09 '16 19:08 danh32

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

xxfast avatar Oct 30 '18 02:10 xxfast

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.

oldergod avatar Oct 30 '18 19:10 oldergod