NFC: NDEF parser Mifare Classic support, protocol-agnostic refactor and more improvements (#265)

* Update ndef.c

included mifare classic support

* Update application.fam

* Update ndef.c

* Update ndef.c

* Update ndef.c

* Update ndef.c

* Update ndef.c for better parsing

Because mifare classic 1k has a sector trailer, the ndef parser might conflict with it if the payload is long enough or if there's too many payloads. This code removes all sector trailer in a new buffer and uses that for parsing without any problems.

* Rewrite NDEF as protocol agnostic

* Move type name buffer to stack when possible

* Parse URI without heap buffer

* Reduce binary sizes by using preprocessor defines

* Parse MFC without clone buffer and support MAD2

* Keep message count between different TLVs

* Simplify macro check

* Simplify length conversion

* Improve output of unparsed types

* Add some more logging

* Fix WiFi parsing

* Check MAD key before reading

* Rename ndef_read() to ndef_get()

* Update changelog

* Wording

---------

Co-authored-by: Willy-JL <49810075+Willy-JL@users.noreply.github.com>
This commit is contained in:
Luu
2024-10-24 07:55:47 +02:00
committed by GitHub
parent 1d65d3171e
commit 8174ffa5b3
4 changed files with 712 additions and 310 deletions

View File

@@ -115,9 +115,10 @@
- OFW: USB/BT Remote: Mouse clicker option to click as fast as possible (by @sumukhj1219) - OFW: USB/BT Remote: Mouse clicker option to click as fast as possible (by @sumukhj1219)
- CLI: Print plugin name on load fail (by @Willy-JL) - CLI: Print plugin name on load fail (by @Willy-JL)
- NFC: - NFC:
- Added 6 new Mifare Classic keys from Bulgaria Hotel (#216 by @z3r0l1nk) - NDEF parser supports Mifare Classic (#265 by @luu176), rewritten to be protocol-agnostic and more improvements (#265 by @Willy-JL)
- NDEF parser supports NTAG I2C Plus 1k and 2k chips too (by @RocketGod-git) - NDEF parser supports NTAG I2C Plus 1k and 2k chips too (by @RocketGod-git)
- NDEF parser decodes URL-encoded URI characters (#267 by @jaylikesbunda) - NDEF parser decodes URL-encoded URI characters (#267 by @jaylikesbunda)
- Added 6 new Mifare Classic keys from Bulgaria Hotel (#216 by @z3r0l1nk)
- UL: Add iq aparts hotel key (by @xMasterX) - UL: Add iq aparts hotel key (by @xMasterX)
- OFW/UL: Rename 'Detect Reader' to 'Extract MFC Keys' (by @bettse & @xMasterX) - OFW/UL: Rename 'Detect Reader' to 'Extract MFC Keys' (by @bettse & @xMasterX)
- OFW: Plantain parser improvements (by @assasinfil) - OFW: Plantain parser improvements (by @assasinfil)

View File

@@ -255,8 +255,19 @@ App(
) )
App( App(
appid="ndef_parser", appid="ndef_ul_parser",
apptype=FlipperAppType.PLUGIN, apptype=FlipperAppType.PLUGIN,
cdefines=[("NDEF_PROTO", "NDEF_PROTO_UL")],
entry_point="ndef_plugin_ep",
targets=["f7"],
requires=["nfc"],
sources=["plugins/supported_cards/ndef.c"],
)
App(
appid="ndef_mfc_parser",
apptype=FlipperAppType.PLUGIN,
cdefines=[("NDEF_PROTO", "NDEF_PROTO_MFC")],
entry_point="ndef_plugin_ep", entry_point="ndef_plugin_ep",
targets=["f7"], targets=["f7"],
requires=["nfc"], requires=["nfc"],

File diff suppressed because it is too large Load Diff

View File

@@ -975,7 +975,7 @@ Function,+,dir_walk_read,DirWalkResult,"DirWalk*, FuriString*, FileInfo*"
Function,+,dir_walk_set_filter_cb,void,"DirWalk*, DirWalkFilterCb, void*" Function,+,dir_walk_set_filter_cb,void,"DirWalk*, DirWalkFilterCb, void*"
Function,+,dir_walk_set_recurse_filter,void,"DirWalk*, const char**, size_t" Function,+,dir_walk_set_recurse_filter,void,"DirWalk*, const char**, size_t"
Function,+,dir_walk_set_recursive,void,"DirWalk*, _Bool" Function,+,dir_walk_set_recursive,void,"DirWalk*, _Bool"
Function,-,div,div_t,"int, int" Function,+,div,div_t,"int, int"
Function,+,dolphin_deed,void,DolphinDeed Function,+,dolphin_deed,void,DolphinDeed
Function,+,dolphin_deed_get_app,DolphinApp,DolphinDeed Function,+,dolphin_deed_get_app,DolphinApp,DolphinDeed
Function,+,dolphin_deed_get_app_limit,uint8_t,DolphinApp Function,+,dolphin_deed_get_app_limit,uint8_t,DolphinApp
1 entry status name type params
975 Function + dir_walk_set_filter_cb void DirWalk*, DirWalkFilterCb, void*
976 Function + dir_walk_set_recurse_filter void DirWalk*, const char**, size_t
977 Function + dir_walk_set_recursive void DirWalk*, _Bool
978 Function - + div div_t int, int
979 Function + dolphin_deed void DolphinDeed
980 Function + dolphin_deed_get_app DolphinApp DolphinDeed
981 Function + dolphin_deed_get_app_limit uint8_t DolphinApp