Files
unleashed-firmware/lib/nfc/protocols
e4e8a8ef2b [NFC] Trim MIFARE Plus generator & admin-key mapping (in-place cleanup) (#1035)
* [NFC] Data-drive MIFARE Plus manual-add generators

Replace the 18 near-identical MIFARE Plus generator thunks and their
handler-table entries with a data-driven mf_plus_generator_configs[]
table (uid_len / type / size / ATS per variant), dispatched via a small
range predicate. The Ultralight/NTAG and Classic types keep their
bespoke handlers, so the handler table now stops before the MF Plus
range.

Also drop mf_plus_ats_hist_ev, which was byte-identical to
mf_plus_ats_hist_s (EV1/EV2 are identified by GetVersion, not the ATS).

Pure refactor: the Add-Manually menu entries, the generated cards and the
public SDK API are all unchanged. Trims firmware flash by removing the
per-variant functions and the duplicate blob; a _Static_assert pins the
config table to the enum range so a future type can't desync it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* [NFC] MIFARE Plus: single source for admin-key addresses

Fold the three copies of the admin-key address<->type mapping
(0x9000 CardMaster, 0x9001 CardConfig, 0x9003 L3Switch, 0x9004
SL1CardAuth) into one mf_plus_admin_key_addresses[] table with a forward
helper (mf_plus_get_admin_key_address, replaces the poller's local id
array) and a reverse helper (mf_plus_admin_key_type_from_address,
replaces two identical switch statements in the listener's key-resolve
and write-store paths).

Behavior-preserving: both listener default fall-throughs are kept (resolve
returns false; store falls through to data/config block handling), the
poller authenticates the same addresses, and a _Static_assert pins the
table to MfPlusAdminKeyNum. Internal helpers only; no SDK API change.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* [NFC] Changelog: MIFARE Plus generator/admin-map cleanup

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-07 23:08:54 +03:00
..
2024-07-15 20:02:45 +03:00
2025-06-30 19:53:45 +03:00
2025-06-30 19:53:45 +03:00
fmt
2026-04-01 16:34:41 +03:00
2025-06-30 19:53:45 +03:00
2026-06-09 03:17:56 +03:00
2023-10-24 12:08:09 +09:00
2025-06-30 19:53:45 +03:00
2023-10-24 12:08:09 +09:00
2023-10-24 12:08:09 +09:00
2023-10-24 12:08:09 +09:00
2025-06-30 19:53:45 +03:00
2025-06-30 19:53:45 +03:00
2025-06-30 19:53:45 +03:00