New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scan QR code not working on v2.0.1 #802
Comments
Thanks for reporting this. We haven't received any reports of issues with scanning QR codes since v2.0 was released, so this is a bit surprising. Do you have an example of a QR code that Aegis fails to scan, so that we can try to reproduce? Which website is showing you the QR code? Does Aegis fail to scan all QR codes or is it just the ones from this source? |
Thanks for your response. As far as I can tell this happens on all web sites with any QR code. I would like to not share the original website and QR code as it contains the OTP secret. But looking e.g. at the example QR codes on this page, the behaviour of Aegis 2.0.1 on my Moto G100 is that the camera opens but then simply nothing happens for any of the codes. In contrast, the builtin camera app on the same phone pops up a notification with the decoded text for all these QR codes. Also in contrast, I tried Aegis 2.0.1 on an older phone (HTC, running Android 8) and there the above QR codes all produce a response -- they all pop up an error about the protocol not being supported (which is expected as none of these codes are Authenticator codes). Also, on the older phone Aegis was able to detect and decode the authenticator QR code that gave me trouble. The odd thing is that scanning from an image also doesn't work (on the Moto G100) with, as mentioned, the |
Ok, here is a valid authenticator QR code, generated by this web site. As expected, on my Moto G100 Aegis doesn't detect anything when scanning. (I've tried orienting the camera sideways and upside down as well, to no avail.) Using the phone's camera app (which is able to decode the code) I took the following photo: This is the original image as saved by the camera app, except that I stripped all exif data for privacy, which is why it appears here rotated. The original orientation is correct. I've then tried Aegis "scan image" with this image, resulting in the error:
Seeing that the (exifless) raw image is rotated, I've used
That said, I've found a workaround: As my phone's camera app can decode the QR code, I can simply tap the notification with the decoded |
@traktofon Is it working in v2.0? |
Thanks for the extra information. I'll work on a debug build with some additional logging so that we can get some more info on what data CameraX is processing on your device. Glad you've found a workaround in the mean time. |
having the same issue. Camera is not reading the QR code. I'm able to read the QR with my camera, however not while using the app |
enabled QR on my "Camera" app and was able to scan multiple QR. |
Same problem with 2.0.2, download from f-droid, android 9 (lineageos). The qrcode scan soesn't work. i have to tipe the code manually. |
On version 2.0.2 from f-droid on LineageOS 10, no problem scanning this ACME QRCode |
Nowadays the QR Code Scanning is back by Machine Leaning. Maybe we could use the Google ML Kit Barcode Scaning to replace the zxing |
Didn't work for me with 2.0.2 from F-droid on Xiaomi RedMi Note 4x running ResurrectionRemix Android 10. Tried on https://code.videolan.org/-/profile/two_factor_auth |
@wafer-li We can use but using it requires Google Play Services, This app needs to be independent and not dependent on Google |
I too have got the issue |
@Hacker437 Actually, it is not the case, the Google ML Kit Barcode Scanning offer a bundled version of itself, and do not require the Play Services. Although it will increase the APK size for around 3MB |
Have to test it! |
As a workaround you can use this QR Code Scanner SecScanQR https://f-droid.org/en/packages/de.t_dankworth.secscanqr/ available on F-Droid |
Same with Yahoo, but various other QR codes are fine. |
Encountering the same bug. Aegis version: 2.0.3 Behavior: Behavior: Additional notes: |
I am also having this issue on my Google Pixel 3a. I am unable to scan QR codes to add to Aegis. |
I am also getting the same error trying to scan a QR code of google authenticator export in order to import my 2FA codes:
So I installed Zxing app from the play store (from Zxing Team) and now I get this error:
|
I recently scanned a QR code successfully with Aegis. It's still the same version, Aegis v2.0.3 Not sure why it's working now. Something must have changed behind the scenes, maybe at Google? |
Aegis v2.0.3, vault encrypted with password, Samsung Galaxy A20, Android 11 |
The latest beta release features various reliability improvements for the QR code scanner: v2.1-beta1. Both for images and for camera. Please give it a shot and let us know if you can still reproduce this issue. |
v2.1 is out! For those of you who were having issues scanning QR codes, please let us know whether the situation has improved. If so, we'll go ahead and close this issue. |
I just tested v2.1 and scanned a QR code. It worked. |
Many thanks for your continued efforts to work on this issue. Unfortunately for me, on v2.1 scanning QR codes still doesn't work. Same behaviour as before, the camera opens and shows what it "sees", but no code is detected. Moreover, my previous workaround of using the phone's built-in camera app to detect the code and then open the otpauth link in Aegis no longer works. The camera app still detects the code, but only shows the decoded text ( FWIW, Google authenticator has no problem scanning the QR code and adding the OTP entry. What does work now for me (compared to v2.0.1) is that I can take a photo of a QR code, and then use Aegis' scan from image. So thanks very much for fixing this! I guess this will be my new workaround. However, if #1033 could be implemented, that would be a more convenient workaround. |
Thanks for reporting back. I'm very confused as to why QR code scanning still doesn't work at all on some devices. I thought we had things all ironed out with fb58c87 and the recent support for scanning slightly invalid QR codes. We'll have to come up with some elaborate debug logging for QR code scanning and ask one of you to run some tests on your devices, but I'm not sure yet when I'll be able to get to actually implementing that. |
Same issue with Samsung 10e / Aegis 2.1.3 / Keycloak Also tried with https://play.google.com/store/apps/details?id=com.google.zxing.client.android app -> works fine
|
Aegis v2.1.3, vault encrypted with password, on Samsung Galaxy A20, Android 11, external VGA display Vizio 26" TV/monitor. |
Aegis v2.2.2 on Samsung Galaxy S22 Ultra with Android 13 doesn't work either. I was set on switching everything over from Google, but this 2 year old problem is making me have second thoughts. I tried everything. I tried installing the Google Play and Fdroid versions. I tried rotating my phone 360 degrees. I tried both front and back cameras. I tried setting my laptop brightness to 100% even though my other camera apps can decode the QR code without issue at 60%. I tried tapping the screen because maybe it needs me to tell it to do something? I tried close up and far away. I tried with or without password protecting the vault. This was the one 2FA I use the most as it was for work. It was for a Microsoft account. It also seems to affect only Samsung phones. Anyone with a Samsung phone confirm it works? Tested both Google Authenticator and Aegis on this website. Instantly added to Google, but Aegis refused to read it. It does work if I scan with the Samsung camera app and open it with Aegis. Seems like there's a lot of reference to a com.google.zxing. I downloaded the Barcode Scanner from ZXing Team on Google Play and that scanner cannot read the 2fas.com test token as well. |
There's still some things we can do to try to help ZXing find the QR code. Like not asking it to scan the full image, but just the portion inside the rectangle of a viewfinder that we could introduce, like some other QR scanning apps do. Are you able to scan QR codes using https://github.com/GrapheneOS/Camera on that device? |
Yes, their version of the ZXing can read both Microsoft phonefactor QR and the 2FAS otpauth QR codes. I thought I could get by with scanning in the Samsung camera app and opening the link in Aegis since it worked for the otpauth links, but Aegis cannot open phonefactor links. Which makes me wonder if I will be able to add that TOTP to the app later if the camera works. |
Thanks for checking. Looks like there's still room for us to improve here.
Phonefactor is a proprietary Microsoft thing that Aegis can't and doesn't support. |
I found this and created the alternate QR code. So I was able to add the Microsoft TOTP using the Samsung camera. It would be nice if the Aegis camera would work. Edit: |
For those of you still having issues scanning QR codes with Aegis, please install this debug APK and:
By sharing the ZIP file you'll be sharing the full image your tried to scan, so make sure it is not an actual 2FA QR code for one of your actual accounts. The debug APK is based on this patch: alexbakker@708f5d0 |
-- Link removed -- |
Thanks, that looks like a sharp image to me. It is fairly large though: 4608x3456. ZXing is known to struggle with high resolution images. That's why we try a couple of different sizes when scanning from an image, and ask CameraX for a resolution somewhere in the neighborhood of 1600x1200, though in your case we still somehow ended up with 4608x3456. I noticed that https://github.com/zxing-cpp/zxing-cpp has been seeing some more activity recently, including a wrapper for Android. I'll experiment with that. |
I've experimented a bit with zxing-cpp: alexbakker@28fe2a2. It's able to scan that high resolution image. Couple of downsides:
I think we have two options:
|
Thanks @alexbakker for reaching out. I'm the maintainer of zxing-cpp and have couple of thoughts:
That should be like 1.5MB at most, I believe. Is that what you consider "a couple"?
That is true a.t.m. but there are two things to notice:
I'm definitively open to add this. We'll discuss it at the linked issue.
Go for it! :)
If you want to stick with ZXing, simply cropping the image will not help (except for performance). Downscaling the image will. And if you do that already but it is not enough, you are likely out of luck. Note that while zxing-cpp started out as a port of ZXing, particularly the QRCode detector is completely rewritten and is now considerably faster while detecting a lot more difficult input at the same time. |
Just looking at Not saying it's not worth it. Perhaps it is. |
For what it's worth, I just reduced the size of each binary by approx. 90kB |
I was having this same QR code scanning problem on some websites. What worked for me was disabling the Dark Reader extension on Firefox. (Makes webpages in "dark mode".) As soon as I disabled it and made the background all around the QR code white, Aegis scanned the QR code just fine. If anyone else is trying to scan QR codes with dark/black backgrounds (whether a theme or from a browser extension), I recommend trying with white/light instead. |
Dark mode extensions mangling web interfaces is a known but different issue. |
I've also had issues with QR codes. For example X (Twitter) their QR code worked perfectly fine. But i tried to add a QR code from dropbox (made sure dark mode was disabled)... nada and not just aegis but other QR readers didn't recognize it either. Possible Solution: OCR?Disclaimer: I'm not an android dev / familiar with aegis architecture, so please forgive the following ignorance. Many websites also have the option to "enter your secret key manually" which is how i've ended up having to add them. The issue being those keys, much like software product keys in ye ol' times before the internet / subscription models were the norm, can be 20+ character monsters and a real pain to enter on a smartphone keypad. With that in mind... what are the thoughts on adding OCR to aegis? In theory it should be just as convenient as a QR code. In addition it also has the potential, to prevent a whole class of attacks via keyloggers. Since a touch keypad on android is, at it's core, just software (and customizable / replaceable by the user) it's vulnerable to that kind of exploit. With baked-in OCR there'd be no need to ever use the keypad thus preventing a catastrophe of having your seeds stolen. |
I can't also scan dropbox's 2FA QR code with Aegis from F-Droid. |
Info
Steps to reproduce
Add a new entry via QR code from camera.. Camera opens but doesn't detect any QR code.
Open camera app and take photo of QR code. (Phone's camera app already shows the decoded text, so quality is ok.) Close camera app, open Aegis, and add new entry via QR code from image. Select the photo just taken. Result is Error, cannot decode QR code, details are
com.google.zxing.NotFoundException
.What do you expect to happen?
Can add entry via QR code both from camera or photo/image.
What happens instead?
Camera doesn't detect any QR code.
Scan from image results in error
com.google.zxing.NotFoundException
.The text was updated successfully, but these errors were encountered: