I am sending AES authentication command on MifareDesfire tag and getting Tag Lost exception.
As first command code in desfire is : 0xAA with card key num 0x00(master card key)
have tried this on Native authentication (DES) and is working fine for native the command is : (0x0A,0x00)
Sample code
:
public void onNewIntent(Intent intent) {
TextView text2 = (TextView) findViewById(R.id.textView2);
TextView text1 = (TextView) findViewById(R.id.textView1);
String action = intent.getAction();
if (NfcAdapter.ACTION_TAG_DISCOVERED.equals(action)
|| NfcAdapter.ACTION_TECH_DISCOVERED.equals(action)
|| NfcAdapter.ACTION_NDEF_DISCOVERED.equals(action)) {
Toast.makeText(this, "discovered", Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(this, "Falied", Toast.LENGTH_SHORT).show();
}
byte[] tagResponse = null;
desfire = (Tag) intent.getParcelableExtra(NfcAdapter.EXTRA_TAG);
isodep = IsoDep.get(desfire);
try {
isodep.connect();
} catch (IOException e) {
e.printStackTrace();
}
byte[] test = new byte[] { (byte) 0xAA, (byte) 0x00 };
try {
tagResponse = isodep.transceive(test);
} catch (IOException e) {
e.printStackTrace();
}
try {
isodep.close();
} catch (IOException e) {
e.printStackTrace();
}
}
Resolved: RF antina problem, i kept tag strongly in the proximity
AES authentication needs more power to exchange data between PCD and PICC.