From 6b91c660d4c75eb4a00af86f6336a24ced8c3a41 Mon Sep 17 00:00:00 2001 From: Haoxi Tan Date: Wed, 14 Sep 2022 20:10:49 +1000 Subject: [PATCH] random uid each time NFC app exists and comes back --- lib/nfc/helpers/reader_analyzer.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/nfc/helpers/reader_analyzer.c b/lib/nfc/helpers/reader_analyzer.c index 680b8cef9..90b917296 100644 --- a/lib/nfc/helpers/reader_analyzer.c +++ b/lib/nfc/helpers/reader_analyzer.c @@ -3,6 +3,7 @@ #include #include #include +#include #include "mfkey32.h" #include "nfc_debug_pcap.h" @@ -38,7 +39,7 @@ struct ReaderAnalyzer { NfcDebugPcap* pcap; }; -const FuriHalNfcDevData reader_analyzer_nfc_data[] = { +static FuriHalNfcDevData reader_analyzer_nfc_data[] = { //XXX [ReaderAnalyzerNfcDataMfClassic] = {.sak = 0x08, .atqa = {0x44, 0x00}, @@ -99,7 +100,8 @@ int32_t reader_analyzer_thread(void* context) { ReaderAnalyzer* reader_analyzer_alloc() { ReaderAnalyzer* instance = malloc(sizeof(ReaderAnalyzer)); - + reader_analyzer_nfc_data[ReaderAnalyzerNfcDataMfClassic].cuid = rand(); //XXX + furi_hal_random_fill_buf((uint8_t*) &reader_analyzer_nfc_data[ReaderAnalyzerNfcDataMfClassic].uid, 7); instance->nfc_data = reader_analyzer_nfc_data[ReaderAnalyzerNfcDataMfClassic]; instance->alive = false; instance->stream =