[NFC]: drop the unreachable EMV render code that called an undefined function (#1085)

* NFC: drop the unreachable EMV render island

nfc_render_emv_data() called nfc_render_emv_name(), which is declared in
emv_render.h and defined nowhere in the tree. It only escaped being a
link error because nfc_render_emv_data() has no callers itself, so
--gc-sections dropped the whole island before the linker had to resolve
it. Wiring it into any render path would have given nfc_emv.fal an
unresolved import, and the import check does not run for plugins, so it
would have shipped as a plugin that silently never loads - which is
exactly how the EMV plugin was broken until #1073.

The functionality is not lost: plugins/supported_cards/emv.c already
renders the application label or name, the PAN with the same F-padding
trim, and the cardholder name, and that is the path that actually runs.

Fixes #1084

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* NFC: drop the unused iso14443_4a render include from emv_render

emv_render.c includes ../iso14443_4a/iso14443_4a_render.h, which
declares only nfc_render_iso14443_4a_info/_brief/_extra - none of which
this file calls. NfcProtocolFormatType, the one type it might have been
there for, arrives via emv_render.h instead.

Pre-existing and unrelated to the undefined function above; folded in
because it is the same file and the same kind of leftover.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* NFC: remove declarations of things that are defined nowhere

Same class as the EMV render fix, found by sweeping every header under
applications/main/nfc and lib/nfc for prototypes with no definition.

nfc_make_app_folder is the dangerous one: a singular typo of
nfc_make_app_folders, sitting in the extern "C" block of nfc_app_i.h,
which every protocol plugin includes. It is one character away from a
real function and is not in the app API table, so a plugin calling it
would compile clean, link clean, and ship as a .fal that never loads.
The real function has one caller in its own file, so it is now static
rather than an undeclared global.

nfc_task is a relic - the entry point has been nfc_app() for a long time.

auth1/2/3_backdoor_key were superseded by mf_classic_backdoor_keys[] and
have been referenced by nothing since. Those three are firmware core, so
a stray reference would be a hard link error rather than a silent plugin
failure - listed here for completeness, not danger.

No functional change: none of the five had a caller, and API version
stays at 88.4.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Mykhailo Shevchuk
2026-08-20 21:59:39 +03:00
committed by GitHub
co-authored by Claude Opus 5
parent 2b4411f234
commit d2d537f2bb
6 changed files with 2 additions and 37 deletions
+1
View File
@@ -10,6 +10,7 @@
- Apps: Build tag (**18aug2026p2**) - **Check out more Apps updates and fixes by following** [this link](https://github.com/xMasterX/all-the-plugins/commits/dev)
## Other changes
- BadUSB: Moved demo files to examples folder
- NFC: Removed unreachable EMV render code that called an undefined function (by @mishamyte | PR #1085 | Fixes #1084)
<br><br>
----
@@ -1,6 +1,5 @@
#include "emv_render.h"
#include "../iso14443_4a/iso14443_4a_render.h"
#include <bit_lib.h>
#include "nfc/nfc_app_i.h"
@@ -30,28 +29,6 @@ void nfc_render_emv_uid(const uint8_t* uid, const uint8_t uid_len, FuriString* s
furi_string_cat_printf(str, "\n");
}
void nfc_render_emv_data(const EmvData* data, FuriString* str) {
nfc_render_emv_pan(data->emv_application.pan, data->emv_application.pan_len, str);
nfc_render_emv_name(data->emv_application.application_name, str);
}
void nfc_render_emv_pan(const uint8_t* data, const uint8_t len, FuriString* str) {
if(len == 0) return;
FuriString* card_number = furi_string_alloc();
for(uint8_t i = 0; i < len; i++) {
if((i % 2 == 0) && (i != 0)) furi_string_cat_printf(card_number, " ");
furi_string_cat_printf(card_number, "%02X", data[i]);
}
// Cut padding 'F' from card number
furi_string_trim(card_number, "F");
furi_string_cat(str, card_number);
furi_string_free(card_number);
furi_string_cat_printf(str, "\n");
}
void nfc_render_emv_currency(uint16_t cur_code, FuriString* str) {
if(!cur_code) return;
@@ -7,12 +7,6 @@
void nfc_render_emv_info(const EmvData* data, NfcProtocolFormatType format_type, FuriString* str);
void nfc_render_emv_data(const EmvData* data, FuriString* str);
void nfc_render_emv_pan(const uint8_t* data, const uint8_t len, FuriString* str);
void nfc_render_emv_name(const char* data, FuriString* str);
void nfc_render_emv_application(const EmvApplication* data, FuriString* str);
void nfc_render_emv_application_interchange_profile(const EmvApplication* apl, FuriString* str);
+1 -1
View File
@@ -265,7 +265,7 @@ void nfc_blink_stop(NfcApp* nfc) {
notification_message(nfc->notifications, &sequence_blink_stop);
}
void nfc_make_app_folders(NfcApp* instance) {
static void nfc_make_app_folders(NfcApp* instance) {
furi_assert(instance);
if(!storage_simply_mkdir(instance->storage, NFC_APP_FOLDER)) {
-4
View File
@@ -261,8 +261,6 @@ typedef enum {
extern "C" {
#endif
int32_t nfc_task(void* p);
void nfc_text_store_set(NfcApp* nfc, const char* text, ...);
void nfc_text_store_clear(NfcApp* nfc);
@@ -298,8 +296,6 @@ bool nfc_load_file(NfcApp* instance, FuriString* path, bool show_dialog);
bool nfc_save_file(NfcApp* instance, FuriString* path);
void nfc_make_app_folder(NfcApp* instance);
void nfc_append_filename_string_when_present(NfcApp* instance, FuriString* string);
void nfc_app_run_external(NfcApp* nfc, const char* app_path);
@@ -33,9 +33,6 @@ extern "C" {
#define SET_PACKED_BIT(arr, bit) ((arr)[(bit) / 8] |= (1 << ((bit) % 8)))
#define GET_PACKED_BIT(arr, bit) ((arr)[(bit) / 8] & (1 << ((bit) % 8)))
extern const MfClassicKey auth1_backdoor_key;
extern const MfClassicKey auth2_backdoor_key;
extern const MfClassicKey auth3_backdoor_key;
extern const uint16_t valid_sums[19];
typedef enum {