Re: DESFire getUID with lite SDK

Forum MIFARE SDK DESFire getUID with lite SDK Re: DESFire getUID with lite SDK

Re: DESFire getUID with lite SDK

22. January 2015 at 15:10
An alternative is to use the Android getId function before you connect to the card with the NXP MIFARE SDK. So, something like this:

@Override
protected void onNewIntent(final Intent intent) {

libInstance.filterIntent(intent, new Nxpnfclibcallback() {

@Override
public void onDESFireCardDetected(final DESFire objDESFire) {
mDESFire = objDESFire;

String action = intent.getAction();
if (NfcAdapter.ACTION_TAG_DISCOVERED.equals(action)) {
try {
Tag tag = intent.getParcelableExtra(NfcAdapter.EXTRA_TAG);
byte[] uid = tag.getId();

... then use the byte array with the Card's UID in here...

I sometimes use the DESFire Card UID as a diversification input, so reading the Card's UID like this before I authenticate access to an application file on the DESFire card is useful.

Robert
+ 0  |  - 0