bitwarden / android

Bitwarden mobile app for Android.
https://bitwarden.com
GNU General Public License v3.0
6.47k stars 812 forks source link

TOTP scanning fails on tall android devices #2244

Closed varunyellina closed 1 year ago

varunyellina commented 1 year ago

Steps To Reproduce

  1. On Android device, edit a saved login to add TOTP for 2FA.
  2. If your device is not the standard aspect ratio of 16:9, then the camera preview will look stretched vertically in Bitwarden.
  3. Scanning fails on my 21:9 Flip phone.

Expected Result

It should scan normally.

Actual Result

It is not scanning. It is scanning normally if I fold the phone into a 90deg shape. The camera preview is not warped in this mode.

Screenshots or Videos

PXL_20221215_052038660 PXL_20221215_052104632 PXL_20221215_052204934

Additional Context

No response

Operating System

Android

Operating System Version

13

Device

Samsung Z Flip 3

Build Version

2022.11.0 (5880)

Beta

ntlv commented 1 year ago

I can repro this on an Asus Zenfone 9 though it is less extreme. Perhaps Google's recently released Viewfinder library could be used to solve this issue.

dal00 commented 1 year ago

@varunyellina you should change that TOTP if you are using it because it is readable in the reflection of your phone.

Cheesebaron commented 1 year ago

ZXing.Net.Mobile is kind of a dead project and has so many issues with regards to handling aspect ratios with cameras. Detecting cameras and their resolutions. Handling frames from high resolution cameras and more. Mainly on Android though.

For simple QR codes I highly recommend just rolling your own AVFoundation code for iOS reading AVMetadataObjects and for Android using AndroidX.Camera.View + a simple frame analyzer that sends the data to ZXing.Net.

This has solved most QR code reading issues in most of my Apps, where I was using ZXing.Net.Mobile before.

N1c093 commented 1 year ago

I can confirm this issue on my Google Pixel 6 with Android 13.

Greenderella commented 1 year ago

Hi there,

This issue appears to be duplicated from this one: https://github.com/bitwarden/mobile/issues/1130

I will proceed to close this one. If you wish to add any further information/screenshots/recordings etc., please feel free to do so here: https://github.com/bitwarden/mobile/issues/1130 - our engineering team will be happy to review these.

test4testUnlimit commented 1 year ago

Same problem on Samsung Galaxy A30s (and A50)

capatina commented 1 year ago

HELLO, SAME PROBLEM HERE. PLEASE FIX IT ASAP (GALAXY Z FOLD 5)

test4testUnlimit commented 12 months ago

Dude, I see your secret QR in reflection...

varunyellina commented 10 months ago

Dude, I see your secret QR in reflection...

Changed the TOTP.