NFC chip: SN220
Accessing applets in ese always fails.
NfcF -> NO Response.
IsoDep -> 62 82
@Override
public void onTagDiscovered(Tag tag) {
Log.d(TAG, "onTagDiscovered");
long startTime = 0;
boolean success = true;
NfcF tech = null;
try {
if (tag == null) {
Log.e(TAG, "could not get tag!");
}
byte[] tagId = tag.getId();
String tagIdString = HceUtils.getHexBytes("", tagId);
Log.d(TAG, "tag id: " + tagIdString);
tech = NfcF.get(tag);
tech.connect();
Log.d(TAG, "Connected.");
CommandApdu commandApdu = HceUtils.buildSelectApdu(HceUtils.CASD_AID, true);
Log.d(TAG, "commandApdu: " + commandApdu.getApdu());
//CASD_AID = "A00000015153504341534400"
//output: commandApdu: 01A4040010A000000680020000000300000000000100
byte[] response = tech.transceive(HceUtils.hexStringToBytes(commandApdu.getApdu()));
Log.d(TAG, "Recv: " + HceUtils.toHexString(response));
} catch (Exception e) {
Log.e(TAG, e.toString());
} finally {
try {
if (tech != null) {
tech.close();
}
} catch (Exception e) {
Log.e(TAG, e.toString());
}
}
}