markusfisch / BinaryEye

Yet another barcode scanner for Android
https://play.google.com/store/apps/details?id=de.markusfisch.android.binaryeye
MIT License
1.38k stars 114 forks source link

Add starting from MIUI fingerprint shortcut #388

Open cleveHEX opened 1 year ago

cleveHEX commented 1 year ago

Hello, is it be possible to implement starting the app from the MIUI? This happens, when you unlock the device with fingerprint and keep holding the finger on the screen: Screenshot_2023-08-31-09-30-10-530_org mozilla firefox Since I have disabled the built in Xiaomi reader, it does not work, I tried to capture the handle with interceptor and it looks like this: Screenshot_2023-08-29-07-26-07-189_io github muntashirakon AppManager Would it be possible to handle this somehow to open the app?

markusfisch commented 1 year ago

Yes, this should be possible with the corresponding intent filter in the manifest.

Binary Eye already includes a filter for com.google.zxing.client.android.SCAN, which was used in the original (and abandoned) ZXing app.

I'm just not sure if it's a good idea to add it to the official version, because then, on every Xiaomi device, the app chooser would come up (at least once) if a user starts the Xiaomi reader once Binary Eye is installed.

cleveHEX commented 1 year ago

That's a valid concern, however I don't see a reason for installing Binary Eye, if I was fine with the integrated qr scanner, I installed it, because BE works much better and does not call home. I think it would be acceptable sacrifice that person wanting to use both would one time see an app selector.

markusfisch commented 10 months ago

I finally have added the intent to Version 1.61.0, which is on it's way through Google Play and should become available soon. I hope I've configured the intent correctly as I don't have a Xiaomi device to test it, unfortunately 😬

cleveHEX commented 10 months ago

Thank you, I will test it as soon as possible, my phone is unfortunately broken now, so it will take a bit longer.

cleveHEX commented 9 months ago

Unfortunately no one wants to fix my phone, so I assembled it (don't need SIM for this) to test your changes and it does not show BE as option (1.61 from F-Droid), the app is nor listed in Interceptor as handler. Sorry I did not copy the info before, didn't know it was possible:

URI intent://details?id=com.xiaomi.scanner#Intent;scheme=market;launchFlags=0x13000000;end

VERSION 1
ACTION android.intent.action.VIEW
DATA market://details?id=com.xiaomi.scanner
FLAGS 0x13000000

I think if you use interceptor, you can paste this to it and you can see if BE is present or not, if you don't use, I will test it later. I have asked ChatGPT for fun and his code is different than yours (most likely wrong as always), just for fun, as I don't have resources to build app myself:

    <intent-filter>
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <data
            android:scheme="market"
            android:host="details"
            android:pathPrefix="/id/com.xiaomi.scanner" />
        <category android:name="android.intent.category.BROWSABLE" />
    </intent-filter>
markusfisch commented 9 months ago

Thanks a lot for checking this out! Well appreciated!

And with this info I was able to test fire the intent via adb, so it's hopefully correct this time! Here's the commit. ChatGPT got it almost right 😉 Just the pathPrefix didn't match the query part of the URL, but this is a tricky one to get right with Intent Filters anyway.

So this will be in the next version! I'll let you know when it's released, and hopefully you can confirm it to be working this time.

markusfisch commented 9 months ago

Version 1.61.2 with the latest adjustments is out. I hope it's working this time!

cleveHEX commented 9 months ago

Thank you, sadly still not working. Not showing up to choose from and nor interceptor lists this as an available activity :(

markusfisch commented 9 months ago

Too bad 😞 Sorry it's still not working.

Hm, unfortunately I'm also running out of ideas what to try, especially because the intent here is working, and that is matching the info from interceptor.

Can you re-fire the intent from interceptor? Does this work?

cleveHEX commented 9 months ago

My phone is now being repaired, they have told me that they don't know if it will ever work again, if so, I will do testing. When I have opened the interceptor by the shortcut, BE was not listed as an available activity.