doc-rj / smartcard-reader

Android NFC contactless smart card reader
GNU General Public License v3.0
240 stars 96 forks source link

Unwanted AIDs (D2 76 00 00 85 01 01) is sending, when using the enableForegroundDispatch #10

Open ManikandanVellaiyan opened 3 years ago

ManikandanVellaiyan commented 3 years ago

I written the onresume code like this,

// reader mode flags: listen for type A (not B), skipping ndef check
    private static final int READER_FLAGS =
            NfcAdapter.FLAG_READER_NFC_A |NfcAdapter.FLAG_READER_NFC_B |
                    NfcAdapter.FLAG_READER_SKIP_NDEF_CHECK | NfcAdapter.FLAG_READER_NO_PLATFORM_SOUNDS;

  /**
     * Re-enable the tag dispatch if the app is in the foreground
     */
    @RequiresApi(api = Build.VERSION_CODES.KITKAT)
    @Override
    public void onResume() {
 super.onResume();
        // register broadcast receiver
        IntentFilter filter = new IntentFilter(NfcAdapter.ACTION_ADAPTER_STATE_CHANGED);
        this.registerReceiver(mBroadcastReceiver, filter);

        mAdapter = NfcAdapter.getDefaultAdapter(this);
        mAdapter.enableReaderMode(this,
                new NfcAdapter.ReaderCallback() {
                    @RequiresApi(api = Build.VERSION_CODES.O)
                    @Override
                    public void onTagDiscovered(final Tag t) {
                        // do something
                        tag = t;
                        startTransaction();
                    }
                },
                READER_FLAGS,
                null);

when doing the NFC transaction, sometimes this AID D2 76 00 00 85 01 01 is sending. Can you help me with this issue?