corona-warn-app / cwa-event-landingpage

Small event landing page for new CWA users when using the native camera. The CWA development ends on May 31, 2023. You still can warn other users until April 30, 2023. More information:
https://coronawarn.app/en/faq/#ramp_down
Apache License 2.0
7 stars 5 forks source link

Scan event QR code with Firefox scanner gives error #46

Closed MikeMcC399 closed 1 year ago

MikeMcC399 commented 2 years ago

Technical details

The Firefox issue is reproducible on other Android versions, such as Android 8.0 as well.

Describe the issue

Firefox's built-in QR code scanner fails to transfer a CWA event QR code to the CWA app. This seems to be a limitation of Firefox, not a bug in CWA.

If CWA is installed and there is internet connectivity then scanning an event QR code using the built-in Firefox scanner first results in a compatibility error message "Your browser is not compatible" followed by "Invalid QR Code ... Invalid URI - no matchedDescriptor".

I only could get the Firefox scan option to work under the following conditions:

Steps to reproduce

  1. Install CWA Android
  2. Open CWA, tap "CREATE QR CODE", tap "+ QR CODE", select "Workplace", enter a Description and a Place, tap SAVE
  3. Tap three-dot menu symbol, select "Display Print Version"
  4. Save print version (for instance using share and Google Drive)
  5. Display print version of event code by printing out or displaying on another device
  6. Install Mozilla Firefox on Android
  7. Open Firefox, tap on three-dot menu symbol, tap Settings, enable "Open links in apps"
  8. Tap in search field
  9. Tap "Scan" and point at displayed event code
  10. Firefox displays "Allow Firefox to open https://e.coronawarn.app?v=1#xxxxxxxx"

Firefox allow

  1. Tap "ALLOW"
  2. e.coronawarn.app/en displays "Your browser is not compatible"

Firefox not compatible

  1. Tap Firefox three-dot symbol, tap "Open in app"

Firefox open in app

  1. CWA opens and displays error "Invalid QR Code ... Invalid URI - no matchedDescriptor"

CWA invalid qr code

Workarounds

Scan a CWA event code using ...

  1. the built-in scanner of the Corona-Warn-App.
  2. the camera app of Android if this has QR code recognition capability
  3. the built-in QR code scanner of your Android device, if available
  4. a third-party QR code scanner.
MikeMcC399 commented 2 years ago

I submitted this just for information and to list the workarounds.

I think there is a flaw in the Firefox for Android browser when the Firefox built-in QR code scanner is used (tap the search field to get the Scan option to appear).

If Firefox is set as default browser, CWA is installed, and the camera app with built-in QR code recognition is used (instead of the built-in Firefox QR code scanner), then Firefox successfully sends the event URI to CWA.

MikeMcC399 commented 2 years ago

When I looked at this with an Android debugger, I found that in the error case the URI passed to CWA is truncated and the log looks like this:

I/CheckInsViewModel$verifyUri: uri: https://e.coronawarn.app/en/

That is if the Firefox built-in QR scanner is used.

Using any other QR code scanner, when the process is successful, I see a much longer URI:

I/CheckInsViewModel$verifyUri: uri: https://e.coronawarn.app?v=1#CAESFAgBEghDV0EgVGVzdBoGT25saW5lGnYIARJggwLMzE153tQwAOf2MZoUXXfzWTdlSpfS99iZffmcmxOG9njSK4RTimFOFwDh6t0Tyw8XR01ugDYjtuKwjjuK49Oh83FWct6XpefPi9Skjxvvz53i9gaMmUEc96pbtoaAGhCNiJREEStS5-j30fh2F98DIgYIARAGGHg

So it seems that Firefox has an issue with cwa-event-landingpage changing the URL, stripping out the ?v=1#..... part and replacing it with /en/.