ikarus23 / MifareClassicTool

An Android NFC app for reading, writing, analyzing, etc. MIFARE Classic RFID tags.
http://www.icaria.de/mct/
GNU General Public License v3.0
4.5k stars 892 forks source link

issues of checkMifareClassicSupport #131

Closed zangetsudo closed 6 years ago

zangetsudo commented 7 years ago

checkMifareClassicSupport method has two issues(as far as i can tell)

  1. the logic in checkMifareClassicSupport doesnot seem right. please double check the code around nfca.getAtqa.

  2. full value of SAK

    SAK is a bit mapping and is recommended to use the bit to check the MIFARE type, the full value of SAK shall not be used to detect a MIFARE type. For detail check in the application note AN10834 - MIFARE ISO/IEC 14443 PICC Selection.

ikarus23 commented 7 years ago

Hi!

  1. Sorry but the information you given are not sufficient. What is wrong? Does the algorithm give you false positives? What device are you using? What tag are you using? Is it a tag emulating a Mifare Classic tag?
  2. Good point. I should update the algorithm according to AN10834 page 7. Maybe this will help to improve it.
zangetsudo commented 7 years ago

code in else imply you are going to do somethings in checkMifareClassicSupport but seems pointless. they are all return value which is less then zero.

ikarus23 commented 7 years ago

But the big else branch is why I have to do this in the first place. It is not only about knowing if both, tag and device, support Mifare Classic. The other case is just as important. Android is not able to tell you wether it is the device or the tag that does NOT support Mifare Classic. I need this stuff to display a proper error message ("not a Mifare Classic tag" vs. "Your phone does not support Mifare Classic").

ikarus23 commented 7 years ago

I'm not sure if your observation is general thing of if you actually have a tag that was identified the wrong way. If you actually have such a tag it would be great if you could test the new identify process that I implemented in this test version.

ikarus23 commented 6 years ago

Any news on this?

Is there anyone else with a bunch of different NFC cards that is willing to test whether the new Mifare Classic check works as expected? You can use this testing version. The expected behavior would be, that MCT should tell you if a tag is Mifare Classic or not.

ikarus23 commented 6 years ago

Hmm... Still no updates. I hope the changes will work for most people because I will merge them now.

ikarus23 commented 6 years ago

The changes have been released with version 2.2.0 (a44921d5156996d0a6ed1d7e8469fe7a5daefb67). Let's hope that it will work for everybody.

ceres-c commented 6 years ago

It works to me. Tested with a couple of tags and these are the results

I don't have any ultralight at hand, but I'll try and check them as soon as I find where I left those :-)

ikarus23 commented 6 years ago

Thanks for testing! Unfortunately I don't have any Mifare Plus in SL1 to check what is causing the issue you mentioned. :-/

ceres-c commented 6 years ago

Don't worry, it looks more like an OS issue... If you need any further testing contact me :-)

ceres-c commented 6 years ago

Checked yesterday against two Mifare Ultralight cards: they are both detected correctly ;-)

ikarus23 commented 6 years ago

That's great! Thanks.