Kunzisoft / KeePassDX

Lightweight vault and password manager for Android, KeePassDX allows editing encrypted data in a single file in KeePass format and fill in the forms in a secure way.
https://www.keepassdx.com/
GNU General Public License v3.0
4.69k stars 276 forks source link

Slow fingerprint API bug even if biometric unlocking is turned off #1400

Open MDP43140 opened 2 years ago

MDP43140 commented 2 years ago

Describe the bug opening a KeePass database, or anything that has something to do with fingerprint/biometric stuff took wayyy too long

To Reproduce

  1. Just open any database in KeePassDX.
  2. password dialog appears, after this, the app freezes for couple seconds...
  3. This also happened if you try to open Settings > Device Unlocking, the same freeze happens again...

Expected behavior When opening database or opening Device Unlock settings, it should be smooth without any delay.

KeePass DB (I just created a blank kdbx in KeePassDX, but this applies to any kdbx file).

KeePassDX:

Android:

Additional context after finding out the culprit, looks like this was caused by buggy fingerprint API checking. this only happens on certain (samsung?) device. In total, it took 1min:30sec. its so annoying every single time i want to open a database i have to go through a very very slow password authenticating just to get password/OTP. it didn't happen on other device, just on my Samsung a6 and Samsung j5 prime (BTW those 2 phones are rooted, and have fingerprint sensor). EDIT: new version isn't lagging as bad but its still really annoying (took ~10 seconds every time i opened a database)

My suggestion is to only check/use fingerprint API if the advanced unlocking is enabled on settings.

J-Jamet commented 2 years ago

This bug comes from a problem in the fingerprint API of some Samsung devices and not from KeePassDX which is optimized to be fast.

My suggestion is to make fingerprint optional, and only check/use fingerprint API if it ever enabled on settings (idk how KeepassDX exactly works because i'm not viewing the source code (yet)).

This is already the case, the setting is disabled by default since the bug appeared. https://github.com/Kunzisoft/KeePassDX/blob/09988a858df569904ff2cb4bc2c58c9ff2725f9a/app/src/main/res/values/donottranslate.xml#L96

Linked to https://github.com/Kunzisoft/KeePassDX/issues/1269

J-Jamet commented 1 year ago

Do you still have the problem with version 4.0.0?

MDP43140 commented 1 year ago

Woah, didn't expect KeePassDX on version 4.0.2 already, i'm literally waiting F-Droid updates for so long until i got an notification email about version 4.0.0, sorry if i'm too late to reply, i'm currently testing this right now

MDP43140 commented 1 year ago

Nope, still lagging, as you can see in the video i linked above, the app still freezes when trying to enter password for the database vault (the same happened when trying to open settings > device unlocking)

J-Jamet commented 1 year ago

Will be fixed in 4.0.3

MDP43140 commented 1 year ago

I tried updating to 4.0.4, but the same problem still persists

J-Jamet commented 1 year ago

I'm sorry, but I don't see how biometrics can be involved. The fragment containing the initialization is not even loaded with the new filter by parameter. Since I can't reproduce the problem, I don't know why you have this behavior on your device.