mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2026-07-18 03:26:15 +00:00
* [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>