From 7fcf2547339b28ac0b4b450f1c1a5dcad3c07191 Mon Sep 17 00:00:00 2001 From: Willy-JL <49810075+Willy-JL@users.noreply.github.com> Date: Sun, 13 Apr 2025 03:23:51 +0100 Subject: [PATCH] NFC: Add missing API imports --- .../main/nfc/api/nfc_app_api_table_i.h | 10 ++- applications/main/nfc/application.fam | 64 +++++++++++++++---- .../nfc_protocol_support_unlock_helper.h | 8 +++ scripts/fbt_tools/fbt_extapps.py | 8 +++ 4 files changed, 76 insertions(+), 14 deletions(-) diff --git a/applications/main/nfc/api/nfc_app_api_table_i.h b/applications/main/nfc/api/nfc_app_api_table_i.h index 679d3cd49..d31857b09 100644 --- a/applications/main/nfc/api/nfc_app_api_table_i.h +++ b/applications/main/nfc/api/nfc_app_api_table_i.h @@ -2,6 +2,7 @@ #include "mosgortrans/mosgortrans_util.h" #include "../nfc_app_i.h" #include "../helpers/protocol_support/nfc_protocol_support_gui_common.h" +#include "../helpers/protocol_support/nfc_protocol_support_unlock_helper.h" /* * A list of app's private functions and objects to expose for plugins. @@ -29,8 +30,15 @@ static constexpr auto nfc_app_api_table = sort(create_array_t( nfc_append_filename_string_when_present, void, (NfcApp * instance, FuriString* string)), + API_METHOD(nfc_protocol_support_common_submenu_callback, void, (void* context, uint32_t index)), + API_METHOD( + nfc_protocol_support_common_widget_callback, + void, + (GuiButtonType result, InputType type, void* context)), API_METHOD(nfc_protocol_support_common_on_enter_empty, void, (NfcApp * instance)), API_METHOD( nfc_protocol_support_common_on_event_empty, bool, - (NfcApp * instance, SceneManagerEvent event)))); + (NfcApp * instance, SceneManagerEvent event)), + API_METHOD(nfc_unlock_helper_setup_from_state, void, (NfcApp * instance)), + API_METHOD(nfc_unlock_helper_card_detected_handler, void, (NfcApp * instance)))); diff --git a/applications/main/nfc/application.fam b/applications/main/nfc/application.fam index 32b03072a..061c593fe 100644 --- a/applications/main/nfc/application.fam +++ b/applications/main/nfc/application.fam @@ -27,7 +27,9 @@ App( apptype=FlipperAppType.PLUGIN, entry_point="nfc_emv_ep", requires=["nfc"], - sources=["helpers/protocol_support/**/*.c"], + sources=[ + "helpers/protocol_support/emv/*.c", + ], fal_embedded=True, ) @@ -37,7 +39,10 @@ App( apptype=FlipperAppType.PLUGIN, entry_point="nfc_felica_ep", requires=["nfc"], - sources=["helpers/protocol_support/**/*.c"], + sources=[ + "helpers/protocol_support/felica/*.c", + "helpers/felica_*.c", + ], fal_embedded=True, ) @@ -47,7 +52,9 @@ App( apptype=FlipperAppType.PLUGIN, entry_point="nfc_iso14443_3a_ep", requires=["nfc"], - sources=["helpers/protocol_support/**/*.c"], + sources=[ + "helpers/protocol_support/iso14443_3a/*.c", + ], fal_embedded=True, ) @@ -57,7 +64,9 @@ App( apptype=FlipperAppType.PLUGIN, entry_point="nfc_iso14443_3b_ep", requires=["nfc"], - sources=["helpers/protocol_support/**/*.c"], + sources=[ + "helpers/protocol_support/iso14443_3b/*.c", + ], fal_embedded=True, ) @@ -67,7 +76,10 @@ App( apptype=FlipperAppType.PLUGIN, entry_point="nfc_iso14443_4a_ep", requires=["nfc"], - sources=["helpers/protocol_support/**/*.c"], + sources=[ + "helpers/protocol_support/iso14443_4a/*.c", + "helpers/protocol_support/iso14443_3a/*.c", + ], fal_embedded=True, ) @@ -77,7 +89,10 @@ App( apptype=FlipperAppType.PLUGIN, entry_point="nfc_iso14443_4b_ep", requires=["nfc"], - sources=["helpers/protocol_support/**/*.c"], + sources=[ + "helpers/protocol_support/iso14443_4b/*.c", + "helpers/protocol_support/iso14443_3b/*.c", + ], fal_embedded=True, ) @@ -87,7 +102,9 @@ App( apptype=FlipperAppType.PLUGIN, entry_point="nfc_iso15693_3_ep", requires=["nfc"], - sources=["helpers/protocol_support/**/*.c"], + sources=[ + "helpers/protocol_support/iso15693_3/*.c", + ], fal_embedded=True, ) @@ -97,7 +114,10 @@ App( apptype=FlipperAppType.PLUGIN, entry_point="nfc_mf_classic_ep", requires=["nfc"], - sources=["helpers/protocol_support/**/*.c"], + sources=[ + "helpers/protocol_support/mf_classic/*.c", + "helpers/protocol_support/iso14443_3a/*.c", + ], fal_embedded=True, ) @@ -107,7 +127,11 @@ App( apptype=FlipperAppType.PLUGIN, entry_point="nfc_mf_desfire_ep", requires=["nfc"], - sources=["helpers/protocol_support/**/*.c"], + sources=[ + "helpers/protocol_support/mf_desfire/*.c", + "helpers/protocol_support/iso14443_4a/*.c", + "helpers/protocol_support/iso14443_3a/*.c", + ], fal_embedded=True, ) @@ -117,7 +141,11 @@ App( apptype=FlipperAppType.PLUGIN, entry_point="nfc_mf_plus_ep", requires=["nfc"], - sources=["helpers/protocol_support/**/*.c"], + sources=[ + "helpers/protocol_support/mf_plus/*.c", + "helpers/protocol_support/iso14443_4a/*.c", + "helpers/protocol_support/iso14443_3a/*.c", + ], fal_embedded=True, ) @@ -127,7 +155,12 @@ App( apptype=FlipperAppType.PLUGIN, entry_point="nfc_mf_ultralight_ep", requires=["nfc"], - sources=["helpers/protocol_support/**/*.c"], + sources=[ + "helpers/protocol_support/mf_ultralight/*.c", + "helpers/protocol_support/iso14443_3a/*.c", + "helpers/mf_ultralight_*.c", + ], + fap_libs=["mbedtls"], fal_embedded=True, ) @@ -137,7 +170,10 @@ App( apptype=FlipperAppType.PLUGIN, entry_point="nfc_slix_ep", requires=["nfc"], - sources=["helpers/protocol_support/**/*.c"], + sources=[ + "helpers/protocol_support/slix/*.c", + "helpers/protocol_support/iso15693_3/*.c", + ], fal_embedded=True, ) @@ -147,7 +183,9 @@ App( apptype=FlipperAppType.PLUGIN, entry_point="nfc_st25tb_ep", requires=["nfc"], - sources=["helpers/protocol_support/**/*.c"], + sources=[ + "helpers/protocol_support/st25tb/*.c", + ], fal_embedded=True, ) diff --git a/applications/main/nfc/helpers/protocol_support/nfc_protocol_support_unlock_helper.h b/applications/main/nfc/helpers/protocol_support/nfc_protocol_support_unlock_helper.h index 34f52496b..9cb35971e 100644 --- a/applications/main/nfc/helpers/protocol_support/nfc_protocol_support_unlock_helper.h +++ b/applications/main/nfc/helpers/protocol_support/nfc_protocol_support_unlock_helper.h @@ -5,5 +5,13 @@ typedef enum { NfcSceneReadMenuStateCardFound, } NfcSceneUnlockReadState; +#ifdef __cplusplus +extern "C" { +#endif + void nfc_unlock_helper_setup_from_state(NfcApp* instance); void nfc_unlock_helper_card_detected_handler(NfcApp* instance); + +#ifdef __cplusplus +} +#endif diff --git a/scripts/fbt_tools/fbt_extapps.py b/scripts/fbt_tools/fbt_extapps.py index 61e5f58c8..16cda6c13 100644 --- a/scripts/fbt_tools/fbt_extapps.py +++ b/scripts/fbt_tools/fbt_extapps.py @@ -338,6 +338,13 @@ def _validate_app_imports(target, source, env): "GALLAGHER_CARDAX_ASCII", "mosgortrans_parse_transport_block", "render_section_header", + "nfc_append_filename_string_when_present", + "nfc_protocol_support_common_submenu_callback", + "nfc_protocol_support_common_widget_callback", + "nfc_protocol_support_common_on_enter_empty", + "nfc_protocol_support_common_on_event_empty", + "nfc_unlock_helper_setup_from_state", + "nfc_unlock_helper_card_detected_handler", # totp app_api_table "totp_", "memset_s", @@ -369,6 +376,7 @@ def _validate_app_imports(target, source, env): "smartrider_plugin", "troika_plugin", # nfc_app_api_table + "nfc_", "gallagher", "social_moscow", "troika",