Reply To: Switching MiFare Plus to S3

Forum MIFARE SDK Switching MiFare Plus to S3 Reply To: Switching MiFare Plus to S3

Re: Switching MiFare Plus to S3

14. October 2020 at 11:45
Hi all,

This post is quite old, but the switch from SL1 to SL3 with an Android phone is still a current topic. It needs a little bit of an explanation, because a side effect needs to consider.

First, if you tap a card on a NFC reader in Android devices, the firmware starts and tries to detect which kind of card is present. This dispatch mechanism can be controlled with ACTION_NDEF_DISCOVERED, ACTION_TECH_DISCOVERED and ACTION_TAG_DISCOVERED. However, this action tags does not help in this case of selecting SL1 or SL3 cards. Check the link below for a detailed explanation of Android dispatch mechanism. But if an ISO 14443-3 or an ISO 14443-4 card is detected it cannot be controlled by user. A MIFARE Classic or a MIFARE Plus SL1 is an ISO 14443-3 and a MIFARE Plus SL3 is an ISO 14443-4 card.

A switch of a MIFARE Plus from SL1 to SL3 is also always a change of protocol type of the card (this is what the “-3” and “-4” describes). This might succeed by writing the perso data, commit and remove the card from reader and tap it again. But the dispatch mechanism in Android firmware is always in between and cannot be overruled from user software. The NFC firmware is not part of the Android package, but part of the software implementation of the device manufacturer.

The MIFARE Plus EV1 can be used in a so called “mixed mode” where some blocks using SL1 mode and other blocks SL3 mode. There is no way to force Android to start SL1 communication mode or SL3 communication mode for such cards. This depends always from the firmware and which card type and protocol was detected. It is even worse, this cards shows that they are an ISO 14443-3 AND an ISO 14443-4 an card!

Sorry for this elaborated explanation. But it is required to understand why the switch might fail on Android devices. My recommendation is to do the switch with a stationary USB reader on a desktop system where the card type can be defined always by software.  

Now some words to the listings above. The MIFARE Plus S has some limitations. The Plus S allows communication mode “data in plain” and “MAC on command” and “MAC on response” only! Communication modes “data encrypted” and “no MAC” is possible only with MIFARE Plus X! Therefore, in the post from Rafael Kemish where a MIFARE Plus S is used in encrypted mode will not work. I recommend to go to MIFARE Plus EV1 to skip this limitations.

For any user who want to report an issue, please let us know which card type is used and what operation failed. This more helpful instead of dozen lines of log output.

The TapLinx team

Android Developer pages of NFC:

https://developer.android.com/guide/topics/connectivity/nfc/nfc
+ 0  |  - 0