Bridouille / android-beacon-scanner

A simple android iBeacon, AltBeacon, Eddystone and RuuviTag beacon scanner
https://play.google.com/store/apps/details?id=com.bridou_n.beaconscanner
331 stars 108 forks source link

"Copy to clipboard" generates not well formatted JSON #9

Closed brunoandretto closed 6 years ago

brunoandretto commented 6 years ago

Hello!

I just downloaded the app from Play Store (current version: 2.1.0) into my Motorola G4 running Android 7.0. While I was testing it, i noticed the "press and hold" to copy information from a card to my clipboard, such as this one:

2435723516812825707

And to my surprise it actually copied all of the cards information into a JSON, which is amazing. The issue is, though, that the JSON seens to be inappropriate:

{ "beaconAddress": "D3:7B:ED:3D:59:CF", "beaconType": "eddystone_uid", "distance": 1.0083072011759482, "hashcode": -430272489, "isBlocked": false, "lastMinuteSeen": 25221370, "lastSeen": 1513282215216, "manufacturer": 65194, "rssi": -82, "txPower": -81 "eddystoneUidData": { "namespaceId": "0xf5ee50f5b45e7d9b0cb6" "instanceId": 0x000091eb78ff, }, }

This one, for example, will break because of the commas. It also happened to iBeacons frame.

Thanks for the great app.

Best regards

Bridouille commented 6 years ago

Hi!

You're absolutely right, I was formatting the JSON by hand to omit certain fields that aren't relevant to the data (business logic in the app).

I need to make a fix to exclude them from the JSON and use the standard JSON encoding 👍

Bridouille commented 6 years ago

Should be fixed in : https://github.com/Bridouille/android-beacon-scanner/commit/52d30d9b5fab47b3742db61e477cc9be1112f7b9

Going to release it in 2.1.1