flipperdevices / flipperzero-firmware

Flipper Zero firmware source code
https://flipperzero.one
GNU General Public License v3.0
12.44k stars 2.67k forks source link

Emulation of Amiibo cards (NTAG215) does not work #3188

Closed bl13pbl03p closed 10 months ago

bl13pbl03p commented 10 months ago

Describe the bug.

The Nintendo Switch does not recognize emulated Amiibo cards from the Flipper, since I updated the firmware to release 0.94.1. Even when a real Amiibo card is read (with the regular read function within NFC) and emulated, the Nintendo Switch will still give the same error: 'This is not an Amiibo.'

Workaround for emulating from real Amiibos: NFC > Extra Actions > Unlock NTAG/Ultralight > Auth as Ameebo and then scanning a original Amiibo sortof fixed the issue.

It seems that something has changed in the latest update that emulates NFC (NTAG125 specifically) differently.

Thank you advance, I am curious about how this bug could be fixed 😊

Reproduction

Requirements:

Steps:

  1. Download any .nfc file from https://github.com/Gioman101/FlipperAmiibo/tree/main to your pc
  2. Open the qflipper Desktop application
  3. Connect your flipper to the pc
  4. Navigate to 'File manager' within in qflipper
  5. Navigate to SD Card > nfc
  6. Drag the donwloaded .nfc file to the File manager
  7. Unplug your flipper from the pc
  8. On your flipper, click the 'Ok' button
  9. Navigate to NFC > Saved
  10. Choose the .nfc file you downloaded
  11. Choose 'Emulate'
  12. Take your Nintendo Switch
  13. Go to System Settings > amiibo >Reset amiibo`
  14. Place your flipper on top of the right joy-con of the nintendo switch
  15. An error message now appears: This is not an Amiibo.

Target

NFC (NTAG215)

Logs

No response

Anything else?

No response

gornekich commented 10 months ago

Hello @bl13pbl03p . Thanks for the report.

When reader polls NTAG215 tags, it may perform authentication with password. Previous firmware version doesn't compare password with saved one and always responds with hardcoded PACK. That's why the emulation works. Current firmware version compares received password with saved one and responds NACK if the password is incorrect. From protocol implementation point of view, current firmware works correctly, but I can see two problems.

Firstly, Flipper doesn't display information that it didn't find password. We will fix that soon. However, you can see "Unlock" option in card menu, and if you find algorithm to guess password, you can save full dump and emulation will work correctly.

Second problem is with saved dumps from mentioned repository. There are no password and pack saved in that files, and they will not work with new firmware version. Quick workaround here is to add password to 133 and pack to 134 pages.

u1735067 commented 10 months ago

I got curious on this and NFC formats (and lost hours of time I don't have 🙃), if anyone else is interested:

u1735067 commented 10 months ago

You can try https://github.com/Lanjelin/AmiiboFlipperConverter/pull/1/files to generate .nfc files (with regenerated PWD and PACK) from .bin files (one possible source for that is allmiibo).

gornekich commented 10 months ago

3207 just got merged. Now flipper will display that it didn't read Ultralight/NTAG cards passwords and you can try to "unlock" them in the menu.

Emulation works as expected, all other issues are connected with emulated files. I will close this issue, if you have any other questions feel free to reopen this issue or create new.

batstar3 commented 10 months ago

I have the same error, yesterday I could emulate normally, but today it gives me the problem that this is not an amiibo

turbospok commented 10 months ago

You can try script from here https://github.com/turbospok/Flipper-NTAG215-password-converter which will convert cards and calculate passwords for the existing ones

professorsugoi commented 9 months ago

You can try script from here https://github.com/turbospok/Flipper-NTAG215-password-converter which will convert cards and calculate passwords for the existing ones

this worked for me! big thanks (using qFlipper ver 1.3.3, firmware ver 0.95.0)

fanfannnmn commented 9 months ago

You can try script from here https://github.com/turbospok/Flipper-NTAG215-password-converter which will convert cards and calculate passwords for the existing ones

It also works well for me! I've incorporated your password generation code into one of the popular project, now it's work again.

olg857 commented 7 months ago

Hello I been trying to go to nfc add manually and then click NTAG215 to read the amiibo from an amiibo app on iPhone and it’s not working I use to be able to do this multiple times to keep making more amiibo made a new UID every time so though it was a new amiibo sadly I don’t have a laptop I only have the flipper zero app on my iPhone