Digitaler-Impfnachweis / covpass-android

The official CovPass(-Check) Android apps and SDK.
https://digitaler-impfnachweis-app.de
Apache License 2.0
185 stars 59 forks source link

Cant scan QR code - No Autofocus (Lineageos / AOSP) #114

Closed bartman081523 closed 11 months ago

bartman081523 commented 2 years ago

Avoid duplicates

Technical details

Describe the bug

Not able to scan the code. Camera does not auto-focus in Android CovPass Check App when scanning the code. In other Apps (like CWA or Camera) the Camera auto-focuses without problem.

Steps to reproduce the issue

Install the App on Android 7.1.2 and try to scan a code

Expected behaviour

Camera autofocuses when scanning the code.

Possible Fix

Continously - or tap-to-focus -autofocus the camera when scanning.

Additional context

Section:Tap-To-Focus https://proandroiddev.com/android-camerax-tap-to-focus-pinch-to-zoom-zoom-slider-eb88f3aa6fc6

https://gist.github.com/husaynhakeem/1eec93bc18ff863ae84c0acb6d406ac8#file-camerax_tap_to_focus-kt

oltdaniel commented 2 years ago

Can confirm this issue with the same device (SM-G900F) with Lineage OS 18.1 running Android 11. Normal autofocus in the Camera App or even the Corona Warn App do work.

oltdaniel commented 2 years ago

I've implemented a fix using the android developers documentation on the Control Focus topic, see https://github.com/oltdaniel/covpass-android/commit/e4efbbc7141fc2bcf7cfe3698f28c279472f4643 .

Edit: On tap focus has been added as well in https://github.com/oltdaniel/covpass-android/commit/13fd5ee7bb909c65cc53c9a5648dc12bd110727f .

oltdaniel commented 2 years ago

I've implemented a fix using the android developers documentation on the Control Focus topic, see oltdaniel@e4efbbc . Edit: On tap focus has been added as well in oltdaniel@13fd5ee .

Great! Awesome. Can you send me the apk to test? Or should i assemble it myself from source?

Do you trust a stranger from the Internet with giving you a random APK? I wouldn't.

bartman081523 commented 2 years ago

Thanks for taking your time to resolve this.

bartman081523 commented 2 years ago

In the meantime until PR #125 is merged, please use the Austrian GreenCheck App https://greencheck.gv.at/ it has continous auto-focus and tap-to-focus on older smartphones.

beevelop commented 2 years ago

Issue can currently be reproduced on a SM-G900F with Android 6.0.1 and app version 1.13.2

rhurlin commented 2 years ago

Thank you very much for the patch in PR https://github.com/Digitaler-Impfnachweis/covpass-android/pull/125 to oltdaniel !

I have exactly the described problem with a Samsung Galaxy SM-J500FN from 2015, Android OS version 6.0.1. App version here is also 1.13.2

Until a few weeks ago, scanning QR codes on this device with the CovPass app still worked, older vaccination certificates have already been scanned. The fact that the autofocus no longer works is definitely due to the CovPass app. With other apps, QR code scanning on this device still works as expected.

For older devices like the SM-J500FN the app is no longer usable, a merge of this patch would be very important :)

jleufgen commented 2 years ago

@chlorophyll-zz thanks for the hint. We are working on the topic. In one of the next releases this bug should be fixed.

HagenSdt commented 2 years ago

Workaround for now: I did a normal photo of the QR code, increased the size to full screen on my monitor and used the CovPass app to scan it from my monitor.

rhurlin commented 2 years ago

Workaround for now: I did a normal photo of the QR code, increased the size to full screen on my monitor and used the CovPass app to scan it from my monitor.

Hi @HagenSdt, Thank you for this workaround. I tried it and it worked right away! \o/

Now we have at least a few months to wait for the commit of the patch for autofocus. And my 2015 device doesn't have to be retired yet. That would be a shame too, since it works fine :)

KBrand101 commented 2 years ago

@jleufgen Can you approximately say which release will incorporate the fix and when we can expect it? Is it worth waiting for an update of the official app or will I need to build it myself?

The affected device is the same as @beevelop mentioned, but the app version is 1.13.3:

Issue can currently be reproduced on a SM-G900F with Android 6.0.1 and app version 1.13.2

jleufgen commented 2 years ago

In the next release the bug should be fixed @KBrand101 :)

rhurlin commented 2 years ago

In the next release the bug should be fixed @KBrand101 :)

Nice to hear, thanks a lot!

thomaszbz commented 2 years ago

One more confirmation with autofocus not working:

rhurlin commented 2 years ago

Just a small feedback after the last update: Since v1.15.0 the app works again on Samsung Galaxy SM-J500FN from 2015 with Android OS version 6.0.1. Many thanks! \o/

pucherd commented 2 years ago

Hello @chlorophyll-zz, the bug should be fixed with our latest 1.16.1 release.

Art4 commented 2 years ago

the bug should be fixed with our latest 1.16.1 release.

When will version 1.16.1 be released?

Ein-Tim commented 2 years ago

@Art4 Version 1.16.1 is in the Google Play Store already.

Art4 commented 2 years ago

Version 1.16.1 is in the Google Play Store already.

Is there a public way to see which versions have been released? The releases and git tags in this repo are not up to date. And the Google Playstore still shows me 1.15.0.

https://play.google.com/store/apps/details?id=de.rki.covpass.checkapp

pucherd commented 2 years ago

@Art4 CovPass 1.16.1 is release but CovPassCheck is still in review - will be released soon.

HagenSdt commented 2 years ago

Autofocus is now working on my SM-N910F. (Android 6.0.1) Thanks a lot for the update.

thomaszbz commented 2 years ago

I updated to App version 1.16.1, but still there is no autofocus.

Device name: SM-G900F (klte, Samsung Galaxy S5)
OS version: LineageOS 16.0, Android 9
App version: 1.16.1

I do not have such problems in CWA. Update: Since CWA 2.16.2, the autofocus is broken in CWA as well.

I also rebooted with a deleted dalvik cache and cache. Still no autofocus.

I also tried if it autofocuses right in the very first seconds. And I tried if there was a tap-to-focus feature. But all that did not work.

KBrand101 commented 2 years ago

I thankfully can report that it is working fine for me now since I updated to version 1.16.1. As said previously I'm using a SM-G900F which at the moment is running the stock Android 6.0.1.

@thomaszbz: In the current state the autofocus appears to be applied automatically and continously rather than by tapping the screen. I also didn't need to change any configuration or clear any cache. It basically just worked.

ossilator commented 2 years ago

i'm also using a SM-G900F, and 1.16.1 does not work for me. i'm on lineageOS 18.1 (android 11), though.

Ein-Tim commented 2 years ago

FYI it seems like this is a bug in LineageOS: https://gitlab.com/LineageOS/issues/android/-/issues/4189

bartman081523 commented 2 years ago

Can confirm that contiunous auto-focus now works with CovPass Check v 1.16 on Lineageos 14.1 (Android 7.1.2) However, I will leave this open until the continuous auto-focus also works with Lineageos 18.1 and AOSP 10.

KrautHolg commented 2 years ago

Same problem with SM-G900F Android Version 10 aosp_klte-userdebug 10 QQ3A.200705.002 1670e198 realease-keys

bartman081523 commented 2 years ago

@KrautHolg @ossilator @thomaszbz You can clone this fork from @oltdaniel for yourself: https://github.com/oltdaniel/covpass-android/tree/feature/fix-autofocus and build the App on your computer, and try wether this fork works for you, and you want a working (continous and tap-to-focus) autofocus before an update (and the developers are again failing to address that issue for some months, ignoring/regarding that the App is (state-sponsored (15.400.000€)) critical infrastructure):

I could also give you the link to the 1.12 autofocus-fork apk file from above, if you dont have a problem with trusting that file.

Building the app You'll need a GitHub personal access token with read:packages access: https://github.com/settings/tokens - "Generate new token" - Select read:pacackages - create the token - reveal the token secret - copy the token secret.

and in the parent folder above your repository (covpass-android folder) create a file called covpass.properties:

git clone https://github.com/oltdaniel/covpass-android.git --branch feature/fix-autofocus
nano/Notepad covpass.properties
githubUsername=github-username
githubPassword=paste here your copied token secret

To actually build the app:

Install Android Studio: https://developer.android.com/studio/install

Open the project/covpass-android folder with Android Studio. In the toolbar at the top, select the app you want to run (e.g. app-covpass-check) and the device. Select Grade Build Flavour/Build Type "debug" Connect your Device in ADB mode, select your Device next to the play button Press the "play"/run button

EDIT: You could also use this App: https://play.google.com/store/apps/details?id=com.green_pass

pucherd commented 2 years ago

Hello @chlorophyll-zz, The 1.16.1 version we released last week already contains the autofocus fix (continuous autofocus) which is based on the implementation you are referring to. Have you already tested if the autofocus works in Lineageos with https://github.com/oltdaniel/covpass-android/tree/feature/fix-autofocus fork?

bartman081523 commented 2 years ago

@pucherd the fork works at least with 7.1.2. I dont know wether the fork also works with LOS 18.1, so the users could test the fork. And your fix does not support Lineageos 18 and 16 and AOSP 10, so I am not closing this issue, until a fix is fully adressed. https://github.com/Digitaler-Impfnachweis/covpass-android/issues/114#issuecomment-1017845881 https://github.com/Digitaler-Impfnachweis/covpass-android/issues/114#issuecomment-1017560966 https://github.com/Digitaler-Impfnachweis/covpass-android/issues/114#issuecomment-1022265683

pucherd commented 2 years ago

@chlorophyll-zz right but looks like the issue is in Lineageos: https://github.com/Digitaler-Impfnachweis/covpass-android/issues/114#issuecomment-1018648594

bartman081523 commented 2 years ago

@pucherd that depends on the app. The camera app works as expected, like the issue on gitlab suggests and other apps like cwa and many other apps also can autofocus well with LOS 18.1.

Which means the issue could be resolved by this app. The issue is not fixable on the LOS side for pre-18.1, because e.g. LOS 16 is EOL. And definately not fixable for the users of the devices running that OS. So I am leaving this open, because the developers could address this so it is a valid bugreport.

https://gitlab.com/LineageOS/issues/android/-/issues/4189 " Some Apps can't use the autofocus function of the device's camera and therefore they can't scan QR-codes or other grafics, because they can't focus them. The ordinary camera App of the device can use the autofocus without a problem. " It could also certainly be, that the issue opener on LOS gitlab is concretely meaning the covpass app, because he suggests that QR codes are not readable with autofocus. As no app is mentioned in the bug report, this is speculation and will have to be investigated on the LOS gitlab.

memartinb commented 2 years ago

I can confirm this is still an issue with CovPass v1.27.0 (15 Jul 2022) on Samsung SM-G800F (S5 mini / kminilte) with LineageOS 16 (Android 9).

Corona Tracing App can scan Certificates fine, CovPass still can't. Camera opens up, but stutters badly and freezes after 3 refreshes. Might be a different problem, but I've had the focus problem with other Apps (DATEV SmartLogin, DHL App) where it was fixed on App level. So should defininitely be an issue with ensuring proper camera access.

I'd really like to use CovPass over the Tracing App, because Certificates is the only thing I use and CovPass would be more lightweight.

pucherd commented 2 years ago

Hello @bartman081523, @memartinb, are you still experiencing this issue in version 1.30.0? We did some minor improvements in this version.

bartman081523 commented 2 years ago

@pucherd I confirm continuous autofocus is now working, I have version 1.32.0. From my view, issue seems fixed for LineageOS 14.1 / AOSP 7.1.2.

@KrautHolg @ossilator @thomaszbz could you test CovpassCheck above version 1.30 too on your devices? Then we can confirm for AOSP 7,9,10 and 11 a working continuous autofocus.

ossilator commented 2 years ago

still doesn't work on my device. it clearly needs some Very Special Treatment (TM) (both the pre-installed camera app and opencamera can do it just fine, so it can't be that hard).

bartman081523 commented 2 years ago

still doesn't work on my device.

thats bad. I summarize: @pucherd Still no continuous autofocus on LineageOS 18.1 (klte) with Version >=1.30 @ossilator please correct me if I'm wrong.

ossilator commented 2 years ago

according to my research (which dates back quite some months), it's also specific to the device model (or more accurately, a bunch of models). i suppose it's an adverse interaction with the (proprietary) camera driver. see also the previously linked CWA issue.

memartinb commented 2 years ago

Not fixed for me (camera stutter) using v1.31.1 from F-Droid. Not seeing 1.32 yet. Will report.

However, #20 has become a workaround, so I was already able to switch from CTA to CovPass.

ingowerren commented 11 months ago

In 2021, the European Union introduced the digital COVID certificate as an EU-wide recognised proof of vaccination, recovery or negative testing for COVID-19. This regulation expired on 30 June 2023. On a transitional basis, the EU will continue to operate the technical systems to enable cross-border certificate checks until 31 December 2023. The transitional operation will end on that date. In Germany, the possibility of issuing digital COVID certificates such as vaccination and recovery certificates will therefore be discontinued on 31 December 2023. The CovPass app and the CovPassCheck app will therefore also be discontinued. The CovPass app will be switched to wallet mode, where the stored certificates will be retained.

What does this mean for you? All functionalities will continue to beavailable until 31 December 2023.

From 1 January 2024:

Support for the app will no longer be offered.