Closed dhleong closed 4 years ago
hey @dhleong, so are you sure that this bug only appears in the newest version? Would make finding the bug easier for us...
I'm not certain, but it's possible. I was using 1.1.1 previously and I don't see any reports of this issue in my logs for the old version that used that at a cursory glance.
Unfortunately we haven't been able to reproduce this locally, but given the stacktrace here it seems likely this is caused by the changes in https://github.com/adorsys/secure-storage-android/commit/320eb4544a1d4c4b2fa4c282889485de7fd40532. Do you happen to know the context behind that change? The associated PR just says "fixes the keyPairExists function" which isn't very illuminating.
For what it's worth, we have one of the devices that supposedly reproduces it, but it's running 6.0.1; the reports seem to be mostly on Android 8 and 9 (indeed, the Moto Z Play report is from 8.0).
I thought perhaps the version switches were causing an issue if a user upgraded across the boundary, but we have at least one user saying they reinstalled the app and still encounter the issue.
Please let me know if there's anything else I can do to move this along!
@drilonrecica any idea?
make sure that your context is valid @dhleong
e.g. use application context or service context to interact with secure storage, instead of e.g. activity
@dhleong @luckyhandler I will look into this, thanks for bringing it to our attention.
@kibotu Yep, I wrote a wrapper class around this library to emulate a regular SharedPreferences
API that has the Application
context injected via Dagger. It's definitely not an Activity context.
@drilonrecica Thanks!
@kibotu the context shouldn't be a problem as we internally use the application context whatever you pass.
Version 1.2.4 is out now. The bug should not reappear. I have tested on ,multiple devices and emulator with different API levels and different installation configurations and cannot reproduce the bug with the logic of v.1.2.4
Thank you all for the contributions to SecureStorage
Since the bug caused the library to find a certificate but it had no public key, will updating to 1.2.4 fix the issue for the users already affected by it?
Using 1.2.2; haven't reproduced this consistently but have a few reports of it in our logs (a bit messy due to retracing):