5

I'm trying to communicate between a Samsung Galaxy S3 and a smartcard that supports NfcA and IsoDep (Mifare DESFire EV1). To do this, I enabled forgeground dispatch and started a task when a tag is discovered. The code in the task looks like this:

IsoDep isoDep = IsoDep.get(tag);

byte[] selectCommand = {
        (byte)0x00, // CLA
        (byte)0xA4, // INS
        (byte)0x04, // P1
        (byte)0x00, // P2
        (byte)0x0A, // LC
        (byte)0x01,(byte)0x02,(byte)0x03,(byte)0x04,(byte)0x05,(byte)0x06,(byte)0x07,(byte)0x08,(byte)0x09,(byte)0xFF, // AID
        (byte)0x7F  // LE
};

try {
    isoDep.connect();
    byte[] response = isoDep.transceive(selectCommand);
    String result = bytesToString(response);
    isoDep.close();
    return result;
} catch (Exception e) {
    e.printStackTrace();
}

The transceive method throws this exception:

java.io.IOException: Transceive failed

All other methods of IsoDep (like getTimeout()) can be executed without error. Increasing the timeout doesn't change the behaviour. The applet with the AID in the select command is present on the card. I also tried to use the NfcA class. But then I get the exception "tag is lost".

Could the Galaxy S3 be the problem?

Michael Roland
  • 39,663
  • 10
  • 99
  • 206
P. Sherman
  • 135
  • 1
  • 7
  • Did you try to set _Le=0x00_? – vlp Oct 19 '15 at 11:40
  • Does `00 A4 04 00 07 D2 76 00 00 85 01 01 00` command APDU work? – vlp Oct 19 '15 at 12:06
  • It's the same exception for both your suggestions. – P. Sherman Oct 20 '15 at 12:37
  • And `905A00000300000000`? – vlp Oct 20 '15 at 13:58
  • I've worked with DESFire EV1 in ISO mode on S3 without problems. Could you check your card with [this app](https://play.google.com/store/apps/details?id=com.nxp.taginfolite)? – vlp Oct 20 '15 at 14:03
  • I tried to scan the card with this app on two phones (including the s3), on both i get the message "The tag was unexpectedly removed. Analysis may be incomplete or wrong." – P. Sherman Oct 20 '15 at 14:28
  • That is strange, is your card OK? Do you have any other card to check? – vlp Oct 20 '15 at 14:30
  • I haven't had any problems with the card so far. However, i worked mainly with a card reader until now. I don't have any other card to check. – P. Sherman Oct 20 '15 at 14:33

1 Answers1

2

I just tried the same app on another phone and it worked without any problems. The Galaxy S3 is indeed the problem.

P. Sherman
  • 135
  • 1
  • 7