bitwarden / mobile

Retired Bitwarden mobile app for iOS and Android (MAUI/Xamarin).
https://bitwarden.com
GNU General Public License v3.0
81 stars 9 forks source link

Autofocus for TOTP QR code on Android is not working #1031

Open v1RMPblKOGecxcx1GbNcHhgM9u3Zn2nnTI5lZGT opened 4 years ago

v1RMPblKOGecxcx1GbNcHhgM9u3Zn2nnTI5lZGT commented 4 years ago

Describe the Bug

Months ago scan a QR code to add 2FA keys was working great. You can see that the camera is trying to focus the QR. Like other apps (Google Authenticator, for example).

But from the last month (I don't know how many) autofocus is not working, I can add in seconds the code to Google Authenticator, but when I open Bitwarden -> (entry) -> scan code I only see a blury screen and it never focus. I need to do some triks like zomm in the screen to have a bigger QR and move my phone far from the screen (where it has focus)

Steps To Reproduce

  1. Open BitWarden
  2. Open one entry
  3. Edit the entry
  4. Click on the "camera" icon to add a TOTP QR code
  5. Point with the camera to the screen and the focus will not be modified, so almost all normal Qr codes will not be scaned without some screen zoom that permit move your phone until screen is in focus and QR elements are distingible (thank to the zoom)

Expected Result

In 5. autofocus will try to focus the screen / QR code, like before and like other 2FA apps (Google Authenticator, for example). When the code is in focus BitWarden/QR Lib will decode the image and extract the QR Code

Actual Result

  1. Autofocus dosn't work, so screen is blurry and BitWarden can't add a normal size QR code. You need to move your phone far from the screen, but at this point QR is too small, so you need to perform a zoom in screen.

Screenshots or Videos

Environment

Additional Context

ylgRh69FzA8vYqD0bZQQks0XKM7lJqnsve1aoJU commented 4 years ago

I can't reproduce this. Autofocus is working at my phone.

Device: OnePlus 8 Operating system: Android 10 (OxygenOS 10.5.9.IN21BA) Build Version: 2.5.0 (3093) Is this a Beta release? No

Greenderella commented 4 years ago

Can't reproduce either. App is grabbing the code instantly

Device: Xiaomi MI A1 Operating system: Android 9 Build Version: 2.5.0 (3093) Is this a Beta release? Yes

v1RMPblKOGecxcx1GbNcHhgM9u3Zn2nnTI5lZGT commented 4 years ago

But your autofocus is working? If you move your cellphone it is focusing different things? Maybe your "initial" focus is correct for your screen but if you point to other places you can see that the focus is the same.

I can't take a screnshot, it says something that for security I can't do this at this moment (with the camera on bitwarden), but I see very blurry the screen.

While I was writing this the phone was automatically locked. I unlocked it and autofocus start working! But... I locked it again and unloked and focus was fixed again, I can't restore the autofocus on BitWarden. I saw this very clearly because aI was pointing to my keyboard and I see how is focusing it. I pointed to the screen and focus worked too... until it stopped after lock the screen.

I can activate again autofocus on BitWarden a second time after try to take a screenshot that minimized BitWarden and poped-up a notification "You can't take a screenshot for security policies". After this autofocus on BW was working, I closed BW and opened again and focus is fixed again and I can't reproduce again the autofocus temporal fix.

So there is something that brokes BW autofocus on my phone, but I know that it can wok always because camera app and Google Authenticator doesn't have this problem

Edit: I can recover autofocus a third time moving BW to background and foreground, but I don't know why this happens.

4M4ggsuRNCvSEMXdTMY3Tjr1hnRFNVybfrQCQ6V commented 3 years ago

Galaxy S10, Android 10. Also experiencing auto focus issues.

q4hRJB7e6bSPRjqFc2faSKREwXxlHqTE39Okz3z commented 3 years ago

Hi, I'm using Asus Zenfone M2 and I have several issues, including Auto Focus not working and the Camera view is skewed/stretched according to the phone orientation.

For example, if it's Portrait mode, the camera view stretched top and down, making the QR Code tall and probably unreadable for the scanner, in addition with that, the Auto Focus fails and resulting in blurry, stretched image.

Edit: Device: Asus Zenfone M2 Operating System: Android 9 Bild Version: 2.7.0 (3258) Is this a Beta release? Yes

i4YaRA6a5i7ZJFlD3kwS8WaZr3QFxCRnJTekwtW commented 3 years ago

I'm affected by the issue, cant really scan any QR at all:

gfIwpGdK9d962G40C2U08JsixCOndEBxRW2OpeT commented 3 years ago

As I was writing this, I thought of something. Perhaps, my phone is somehow unable to connect to Google's image recognition servers in order to read a QR code... That sounds like a stretch, because shouldn't your phone be able to read a QR code on its own and process it? But sure enough, I disconnected from my WiFi (with PiHole) and used mobile data, and Bitwarden immediately recognized the QR code.

If you're running PiHole, or a similar DNS blocking service, please try disconnecting from it and trying again. Although, I wonder, why does my phone need Google? in order to read a simple QR code?

I left the original message below anyways:

I have this same issue with a Samsung Galaxy S8 running Android 9.

Although, what I'm wondering, is if this issue actually has anything to do with Bitwarden. In my case, I've seen this exact same behavior in another app a few months ago. I forgot what it was, but while the view wasn't stretched, it refused to recognize/scan the QR code.

lsa6suzdpL102fWSTy7yXrj5VaUUNNHHiwKgCIq commented 3 years ago

Experiencing the same issue.

Device: OnePlus 3T
OS Version:  Android 9
Bitwarden: 2.8.0 (3349)
lfkgquGuSxZZv759xQJWjogll00U1l5GRUTgObA commented 2 years ago

Same issue. Device: Xiaomi MI A1 OS Version: Android 9 Bitwarden 2.14.2

8sDnPAepSASzcZ6P9bvDUFoqw06VYKrlzbJ5VMu commented 2 years ago

Same issue. Device: Samsung Galaxy J3 (SM-J320A) OS Version: Android 6.0.1

vvolkgang commented 2 years ago

@ingalfsan Hi! Can you re-test using the latest released version please?

WA0Qp1kTsSNJD3wLrr9nDIRIgHM2j0vBkhMwLA6 commented 1 year ago

Hi folks, I am facing this issue even now. Phone: Redmi Note 11 App: 2023.1.0 Android: 12 MIUI: 13.0.4

Let me know if any other info is required to help out

2X5yVO88zKTaDDgMhpzvXKfQ7KkDO8eulrdba2D commented 10 months ago

I have the same problem on a Motorola Edge 30 PRO with pure Android 13.

v1RMPblKOGecxcx1GbNcHhgM9u3Zn2nnTI5lZGT commented 3 months ago

The problem is still present, and now I can't get focus.

I was trying to add a TOTP and it's impossible for this in particular. I opened "Google Authenticator" and it detects the code inmediately, i very very fast, I can't almost see what Google Authenticator sees because it add the code almost inmediatelly.

I opened the samsung Camera and and pointed to the screen and it decodes inmediatelly the Qr (giving to me the text). The Qr is focused.

But if I open Bitwarden app -> TOTP it's imposible. It shows a bigger image (like if it is zoomed compared with Samsung Camera) and some points very blury. I move the phone until I seee the Qr clearly (at least on the screen) but it is not scanned.

Now I'm using a "Galaxy A13" phone.

I'm trying to add OpenAI TOTP.