Search code examples
androidnfcrfidmifare

Why does reading Mifare Classic card on Android give different value that being read on PC?


I am trying to develop an android app that will read a Mifare Classic card.

Tablet: Samsung Tab Active Pro SM-T545 Android: 9 Using built in NFC Reader

On the PC we use RFIDeas reader and with this I get something like the following:

3 Raw Bytes Read

which when formatted with the following code looks something like:

String.Format("{0:X2}", Id[i])

0000000000A92ED8

I get the same value when using the pcProxConfig utility to read the card. We use the pcProxDLLAPI for reading the card in our code.

I have tried a heap of different apps on Android as well as some libs with my own code, and they all return the same value, which is different from the value I get when reading the card on the PC as outlined above.

The value I get on the Android device is something like:

4 Raw Bytes Read

Which give a formatted value of something like 7F:4F:42:02

So we have different bytes read on Android compared to PC of the same card which result in a different value.

When I scanned the same card with NFC Tools app on Android it says:

Tag Type: ISO 14443-4 NXP MIFARE Classic 1k

Technologies Available: IsoDep, NfcA, MifareClassic, NdefFormatable

Can anyone tell me why is this happening, and how can I get the same value as I do on the PC?

Thank you for your time.


Solution

  • I have just solved this and so am passing it on in the hope it may save someone else some time.

    The RFIDeas reader had been configured to strip out the leading and trailing parity bit. Once I configured the reader to leave these in both the Android and PC swipe data matched.