Android NFC: tag lost when APDU command sent to smart card

I am using the EMV application for Android OS (Samsung Galaxy).

I can send several APDU commands without problems, but when I try to send an internal authentication command. I have this error: tag is lost. Do you have any ideas regarding the purpose of this error? I'm not an experimental Android developer, maybe I forgot something.

  • the right team.
  • I can replace another command, it works (I mean that I can restore the answer).

When can NFC connectivity break on Android?

Here you can see my problem when sending the command:

D / ECInfoGrabber (14088): Send: 00 88 00 00 04 14 16 67 3D
D / OpenGLRenderer (14088): Flushing caches (mode 0) D / dalvikvm (14088): GC_FOR_ALLOC released 227K, 4% free 14298K / 14855K, suspended 29ms I / dalvikvm-heap (14088): grow heap (fragment) to 14.142 MB for 115216-byte distribution D / dalvikvm (14088): GC_FOR_ALLOC released 3K, 4% free 14408K / 14983K, suspended for 15 ms

thanks

+6
source share
1 answer

One possibility is that the response from the card takes longer than the default timeout. This often happens when the card must perform some internal calculations; usually in the case of cryptographic operations such as authentication.

You can change the timeout value using IsoDep.setTimeout() :

  IsoDep iso = IsoDep.get(tag); iso.connect(); iso.setTimeOut(5000); // 5 sec time out iso.transceive(apduCommand); // now send your command 
+10
source

Source: https://habr.com/ru/post/921939/


All Articles