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

Can't copy data of a binary QR #389

Closed Radiokot closed 1 year ago

Radiokot commented 1 year ago

Hi Markus πŸ‘‹πŸ» I like your scanner because it shows the raw QR data without data type prefixes or end padding. It helps me to debug custom QRs, but I really miss the ability to copy HEX data.

Currently, if the QR content can't be decoded as text, there are no "Copy" and "Share" buttons on the decoded code, and you have to write it as a file:

However, in the code there is the ability to copy HEX instead of text if the code is binary: https://github.com/markusfisch/BinaryEye/blob/e99e2d7dccba2f6ffb6d7d6d2e6428288834dcf5/app/src/main/kotlin/de/markusfisch/android/binaryeye/fragment/DecodeFragment.kt#L321-L324

But the "Copy" button gets hidden when the code is binary: https://github.com/markusfisch/BinaryEye/blob/e99e2d7dccba2f6ffb6d7d6d2e6428288834dcf5/app/src/main/kotlin/de/markusfisch/android/binaryeye/fragment/DecodeFragment.kt#L302-L305

Is this a bug or feature? If the buttons are actually meant to be available for binary content, I'll submit a PR with the fix.

markusfisch commented 1 year ago

Hi Radiokot, this is a bug actually! Good catch!

Line 303 is a remnant from before there was textOrHex() and should be removed. So, if you like to do a PR please go ahead! Otherwise I would fix it, if you wouldn't mind.

Radiokot commented 1 year ago

Many thanks for clarifying, will submit the fix soon.