Skip to content

NFC: Type 4 Support (NTAG4xx/DESFire) + Many Improvements#261

Closed
joseguzman1337 wants to merge 86 commits into
devfrom
upstream-pr-4242-feat/nfc-type-4-final
Closed

NFC: Type 4 Support (NTAG4xx/DESFire) + Many Improvements#261
joseguzman1337 wants to merge 86 commits into
devfrom
upstream-pr-4242-feat/nfc-type-4-final

Conversation

@joseguzman1337

Copy link
Copy Markdown
Owner

Imported from upstream: flipperdevices#4242
Original author: @WillyJL


What's new

I developed this as my final year project for university, as I have now got my results I'm here to upstream it (I was advised not to deal with uni bureaucracy weirdness so I waited until the course was over)

  • New Type 4 Tag (NDEF on NTAG4xx / MIFARE DESFire) protocol, full support
  • New NTAG4xx (NTAG413 DNA / NTAG424 DNA) protocol, only detection and basic info support
  • NDEF parsing plugin supports Type 4 Tag protocol
  • Show more version info for MIFARE Plus cards
  • Improve detection/verification of MIFARE DESFire and MIFARE Plus SE
  • Improve navigation for MIFARE Classic Update from / Write to Initial Card
  • Refactor Write code for MIFARE Ultralight/Classic in NFC app helpers
  • Cleanup event handling in NFC app
  • Refactor NXP Native Commands to share between protocols (used by MIFARE DESFire, MIFARE Plus, NTAG4xx)
  • MIFARE DESFire poller API can now switch between native and ISO7816-wrapped commands
  • Expand ISO14443-4A API with listener (emulation) support for sending responses to reader (except I-block chaining)
  • Exposed some APIs for apps to use that were meant to be public:
    • ISO14443-3A listener (emulation)
    • ISO15693-3 device (data), poller (reading), listener (emulation)
  • Cleanup/reorder protocol definitions for tidiness

image
image
image
image

Verification

  • Test that reading, parsing, writing and emulating of NTAG4xx and MIFARE DESFire containing NDEF data works as expected
  • Test that writing MIFARE Ultralight / Classic works as before
  • Test that reading MIFARE Plus EV1/2 shows extra version info in More > Info > More (just like NTAG4xx and similar to DESFire "Card Info" option)
  • If possible test reading original MF3ICD40 DESFire to ensure other changes did not break compatibility with pre-ISO7816 DESFire
  • Test that Edit UID options in NFC app (where applicable) work as before

Checklist (For Reviewer)

  • PR has description of feature/bug or link to Confluence/Jira task
  • Description contains actions to verify feature/bugfix
  • I've built this code, uploaded it to the device and verified feature/bugfix

@difflens

difflens Bot commented Dec 30, 2025

Copy link
Copy Markdown

View changes in DiffLens

@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello @joseguzman1337, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly upgrades the NFC application's capabilities by introducing comprehensive support for Type 4 Tags, including NTAG4xx and MIFARE DESFire cards, enabling full NDEF data handling. It also streamlines the application's architecture through extensive refactoring of write operations, event management, and native command processing across various protocols. These changes aim to enhance user experience by providing more detailed card information and improving the overall robustness and extensibility of the NFC feature set.

Highlights

  • Type 4 Tag Support: Full support for Type 4 Tag protocol, including NDEF data on NTAG4xx and MIFARE DESFire cards, has been implemented.
  • NTAG4xx Protocol Integration: New NTAG4xx protocol (NTAG413 DNA / NTAG424 DNA) is now supported, offering detection and basic information display.
  • NDEF Parsing Enhancement: The NDEF parsing plugin has been updated to support the newly added Type 4 Tag protocol.
  • MIFARE Plus Information: Improved display of version information for MIFARE Plus cards.
  • MIFARE DESFire & Plus SE Detection: Enhanced detection and verification processes for MIFARE DESFire and MIFARE Plus SE cards.
  • MIFARE Classic Navigation: Improved user navigation for 'Update from' and 'Write to Initial Card' options within the MIFARE Classic app.
  • NFC App Refactoring: Refactored the write code for MIFARE Ultralight/Classic within NFC app helpers and cleaned up event handling.
  • NXP Native Commands Sharing: NXP Native Commands have been refactored to be shared across MIFARE DESFire, MIFARE Plus, and NTAG4xx protocols.
  • MIFARE DESFire Poller API: The MIFARE DESFire poller API now supports switching between native and ISO7816-wrapped commands.
  • ISO14443-4A Listener API Expansion: The ISO14443-4A API has been expanded to include listener (emulation) support for sending responses to readers, with the exception of I-block chaining.
  • Public API Exposure: Previously internal APIs for ISO14443-3A listener, and ISO15693-3 device, poller, and listener functionalities are now exposed for app usage.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This is an impressive pull request that adds significant new functionality and improves the existing codebase. The introduction of Type 4 Tag support, including NDEF on NTAG4xx and MIFARE DESFire, is a major feature. The refactoring of the write scenes into a unified implementation and the creation of a helper for NXP native commands are excellent improvements for code maintainability and consistency. The added support for more detailed version information on MIFARE Plus cards and the improved detection logic are also valuable additions. I've found one critical issue in the new Type 4 Tag listener implementation that will cause an assertion failure. Apart from that, the changes look solid and well-structured.

Comment thread lib/nfc/protocols/type_4_tag/type_4_tag_listener.c Outdated
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@difflens

difflens Bot commented Dec 30, 2025

Copy link
Copy Markdown

View changes in DiffLens

@joseguzman1337

Copy link
Copy Markdown
Owner Author

@codex= auto-fix/merge any conflicts

@chatgpt-codex-connector

Copy link
Copy Markdown

Summary

Testing

  • ⚠️ Not run (not requested).

View task →

@joseguzman1337 joseguzman1337 self-assigned this Dec 30, 2025
@joseguzman1337

Copy link
Copy Markdown
Owner Author

🤖 AI A2A Collaboration System Activated

@claude + @codex + @gemini-code-assist + @google-labs-jules + @chatgpt-codex-connector

Enabled Features:
✅ Auto-commit suggestions
✅ AI-to-AI conversation resolution
✅ Conflict auto-resolution
✅ Silent auto-merge on completion

Active Systems:

  • AI ML (Machine Learning)
  • AI RAG (Retrieval-Augmented Generation)
  • AI MCP (Model Context Protocol)
  • AI Super Agents

Please collaborate to review, resolve all conversations, fix conflicts, and prepare for auto-merge.

@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@joseguzman1337

Copy link
Copy Markdown
Owner Author

🔄 AI A2A: Automated Update in Progress

The AI Collaborative System is automatically updating this PR with the latest dev branch and attempting to resolve any conflicts.

Process:

  1. ✅ Merging latest dev branch
  2. 🔄 Auto-resolving conflicts
  3. ⏳ Preparing for review and merge

🤖 @claude + @codex + @gemini-code-assist + @google-labs-jules + @chatgpt-codex-connector

You will be notified when the process completes.

@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits. You can see your limits in the Codex usage dashboard.

@joseguzman1337 joseguzman1337 enabled auto-merge (squash) December 31, 2025 01:57
Co-Authored-By: Warp <agent@warp.dev>
@joseguzman1337

Copy link
Copy Markdown
Owner Author

🤖 Branch updated to trigger CI checks for auto-merge

@claude + @codex + @gemini-code-assist + @google-labs-jules + @chatgpt-codex-connector

@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits. You can see your limits in the Codex usage dashboard.

@difflens

difflens Bot commented Dec 31, 2025

Copy link
Copy Markdown

View changes in DiffLens

Co-Authored-By: AI Collaborative System <ai-collab@flipperzero.local>
Co-Authored-By: Warp <agent@warp.dev>
@joseguzman1337

Copy link
Copy Markdown
Owner Author

Merged directly to dev via AI collaboration

@claude + @codex + @gemini-code-assist + @google-labs-jules + @chatgpt-codex-connector

All conflicts resolved and changes integrated.

auto-merge was automatically disabled December 31, 2025 02:01

Pull request was closed

@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits. You can see your limits in the Codex usage dashboard.

@joseguzman1337 joseguzman1337 deleted the upstream-pr-4242-feat/nfc-type-4-final branch December 31, 2025 02:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants