Reputation: 1765
I am currently implementing a library for generating and scanning of qr-codes and I'd like to ask, whether it's possible to make my QR-code somehow unique and val path unscannable for other devices if user does not use my app.
Is it actually possible using these dependencies implementation 'com.google.zxing:core:3.3.0'
and implementation 'com.journeyapps:zxing-android-embedded:3.4.0'
?
Upvotes: 0
Views: 783
Reputation: 5042
Of course it is possible to make a non-standards-compliant "QR code" that all stock apps would be unable/unwilling to interpret. I'm not sure that you could still call it a "QR code", in this case, but it could still look substantially the same.
It is possible you could get most readers to ignore your barcode simply by screwing up the error-correction codes (that is, if you don't want to bother re-imagining the whole QR code format). You could use your own codes (for instance), or simply invert those bits that are involved in error-correction.
I've never attempted this, and I don't know how to do it, directly, using the libraries you have mentioned.
Upvotes: -2
Reputation: 1380
Any other QR code scanner can get the information from your QR code.
If you purpose is to not let others know what is exactly in your QR code, you can encrypt the data before generate as QR code and decrypt after scan.
Example:
val msg = "hello"
val encryptedMsg = encrypt(msg) // can be something like "dc93jv56"
// generate QR Code for encryptedMsg
// scan the QR code in your app and decrypted
val decrypedMsg = decrypt(scanResult) // the original msg "hello" which only you can get it
Upvotes: 3