diff --git a/applications/main/nfc/scenes/nfc_scene_mf_ultralight_unlock_auto.c b/applications/main/nfc/scenes/nfc_scene_mf_ultralight_unlock_auto.c index 0369afcbd..e94c97f3c 100644 --- a/applications/main/nfc/scenes/nfc_scene_mf_ultralight_unlock_auto.c +++ b/applications/main/nfc/scenes/nfc_scene_mf_ultralight_unlock_auto.c @@ -4,7 +4,7 @@ bool nfc_scene_mf_ultralight_unlock_auto_worker_callback(NfcWorkerEvent event, v Nfc* nfc = context; if(event == NfcWorkerEventMfUltralightPwdAuth) { - MfUltralightAuth* auth = nfc_worker_get_event_data(nfc->worker); + MfUltralightAuth* auth = &nfc->dev->dev_data.mf_ul_auth; memcpy(nfc->byte_input_store, auth->pwd.raw, sizeof(auth->pwd.raw)); nfc->dev->dev_data.mf_ul_data.auth_method = MfUltralightAuthMethodManual; } diff --git a/lib/nfc/nfc_device.h b/lib/nfc/nfc_device.h index 6cac72c6b..76b2f5a01 100644 --- a/lib/nfc/nfc_device.h +++ b/lib/nfc/nfc_device.h @@ -53,6 +53,7 @@ typedef struct { union { NfcReaderRequestData reader_data; NfcMfClassicDictAttackData mf_classic_dict_attack_data; + MfUltralightAuth mf_ul_auth; }; union { EmvData emv_data; diff --git a/lib/nfc/nfc_worker.c b/lib/nfc/nfc_worker.c index fc05b8264..7d1ff34dc 100644 --- a/lib/nfc/nfc_worker.c +++ b/lib/nfc/nfc_worker.c @@ -20,7 +20,6 @@ NfcWorker* nfc_worker_alloc() { nfc_worker->callback = NULL; nfc_worker->context = NULL; - nfc_worker->event_data = NULL; nfc_worker->storage = furi_record_open(RECORD_STORAGE); // Initialize rfal @@ -50,10 +49,6 @@ NfcWorkerState nfc_worker_get_state(NfcWorker* nfc_worker) { return nfc_worker->state; } -void* nfc_worker_get_event_data(NfcWorker* nfc_worker) { - return nfc_worker->event_data; -} - void nfc_worker_start( NfcWorker* nfc_worker, NfcWorkerState state, @@ -449,12 +444,11 @@ void nfc_worker_emulate_mf_ultralight(NfcWorker* nfc_worker) { 5000); // Check if there was an auth attempt if(emulator.auth_attempted) { - nfc_worker->event_data = &emulator.auth_attempt; + nfc_worker->dev_data->mf_ul_auth = emulator.auth_attempt; // Make copy if(nfc_worker->callback) { nfc_worker->callback(NfcWorkerEventMfUltralightPwdAuth, nfc_worker->context); } emulator.auth_attempted = false; - nfc_worker->event_data = NULL; } // Check if data was modified if(emulator.data_changed) { diff --git a/lib/nfc/nfc_worker.h b/lib/nfc/nfc_worker.h index 290d3d741..002b0f1da 100644 --- a/lib/nfc/nfc_worker.h +++ b/lib/nfc/nfc_worker.h @@ -71,8 +71,6 @@ NfcWorker* nfc_worker_alloc(); NfcWorkerState nfc_worker_get_state(NfcWorker* nfc_worker); -void* nfc_worker_get_event_data(NfcWorker* nfc_worker); - void nfc_worker_free(NfcWorker* nfc_worker); void nfc_worker_start( diff --git a/lib/nfc/nfc_worker_i.h b/lib/nfc/nfc_worker_i.h index 5c7592833..526182f9a 100644 --- a/lib/nfc/nfc_worker_i.h +++ b/lib/nfc/nfc_worker_i.h @@ -23,7 +23,6 @@ struct NfcWorker { NfcWorkerCallback callback; void* context; - void* event_data; NfcWorkerState state;