SecUSo/privacy-friendly-qr-scanner

Deep-link handling

Opened this issue · 1 comments

First of all thanks for the awesome app :)
I have a corner-case that isn't working as expected. I want to start an app via QR code containing a deep-link with custom schema.
See this regarding deep-links: https://developer.android.com/training/app-links/deep-linking https://medium.com/androiddevelopers/the-deep-links-crash-course-part-1-introduction-to-deep-links-2189e509e269

E.g. bm://test/bla

When scanning such custom QR codes the app always tries to open with a browser.
The reason seems to be that the code always adds "http://" in front of the deeplink. bm://test/bla -> http://bm://test/bla

When replacing (quick and dirty for testing) this line

if (!lowercase_qrurl.startsWith("http://") && !lowercase_qrurl.startsWith("https://")) {
by if(false) { so the app always ends up in else the deep-link handling is working fine in my usecase.

I've created a pull request that is working for the scenarios I've tested. But it's not unlikely I've missed something.

#225