IsoDep Tag send always 0x0B as result for all APDUs

Viewed 14

I've a problem with my MobiGo2F terminal.

The Android system version is 10. When I send APDUs to my smartcard, I always receive 0B as result. Find below my code:

String action = intent.getAction();
        if (NfcAdapter.ACTION_TAG_DISCOVERED.equals(action)
                || NfcAdapter.ACTION_TECH_DISCOVERED.equals(action)
                || NfcAdapter.ACTION_NDEF_DISCOVERED.equals(action)) {
            Tag tagI = (Tag) intent.getParcelableExtra(NfcAdapter.EXTRA_TAG);
            byte[] serial=intent.getByteArrayExtra(NfcAdapter.EXTRA_ID);
            Log.v("SN : ", Utils.bytesToHex(serial));
            assert tagI != null;
            byte[] payload = detectTagData(tagI).getBytes();
            IsoDep tag = IsoDep.get(tagI);

            byte[] APDU = {
                    (byte) 0x00, // CLA Class
                    (byte) 0x84, // INS Instruction
                    (byte) 0x00, // P1  Parameter 1
                    (byte) 0x00, // P2  Parameter 2
                    (byte) 0x08  // LE  maximal number of bytes expected in result
            };
            byte[] result = new byte[0];
            try {
                tag.connect();
                tag.setTimeout(10000);
                result = tag.transceive(APDU);
                Log.v("result =", Utils.bytesToHex(result) + " & lenght = " + result.length);
            } catch (Exception e) {
                e.printStackTrace();
            }

        }

The result that I got is: Result

I received 0B for any APDUs that I send. Normally, ISO7816 describe APDU response as 2 bytes, SW1 and SW2.

Need your support and enjoy Code!

0 Answers
Related