简体   繁体   中英

Note5 read Mifare classic card UID

I am working on an app that reads just the UID of MIFARE Classic cards. However, every time I scan a card on my Galaxy note 5, I get a toast message "NFC tag type not supported" and the UID doesn't show up.

I know that because NFC Chip of my phone isn't compatible to Mifare Classic, but is there any way to fix it?

static void showToast() {
    if (NfcAdapter.ACTION_TECH_DISCOVERED.equals(getIntent().getAction())) {
        Tag tag = getIntent().getParcelableExtra(NfcAdapter.EXTRA_TAG);

        Toast.makeText(MainActivity.this, 
                "The UID for this card is:" + bin2hex(tag.getId()), 
                Toast.LENGTH_LONG)
                .show();
    }
}

static String bin2hex(byte[] data) {
    return String.format("%0" + (data.length * 2) + "X", new BigInteger(1, data));
}

Thanks in advance.

Galaxy Note 5 doesn't support Mifare Classic. See here: https://www.shopnfc.com/en/content/7-nfc-compatibility#samsung
Mifare Classic is proprietary of NXP and so whichever device Samsung used NXP's chip (Galaxy Note 2 Note 8, Note 9), Mifare classic is supported.
Since it requires hardware change, there is no way you could get this working on your Note 5.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM