revert old nfc debug defines was used to save space

This commit is contained in:
MX 2023-08-05 14:25:16 +03:00
parent 07f6859a80
commit f70d2b5ae7
No known key found for this signature in database
GPG Key ID: 7CCC66B7DBDD1C83
7 changed files with 8 additions and 30 deletions

View File

@ -53,18 +53,14 @@ ADD_SCENE(nfc, mf_classic_update_success, MfClassicUpdateSuccess)
ADD_SCENE(nfc, mf_classic_wrong_card, MfClassicWrongCard) ADD_SCENE(nfc, mf_classic_wrong_card, MfClassicWrongCard)
ADD_SCENE(nfc, emv_read_success, EmvReadSuccess) ADD_SCENE(nfc, emv_read_success, EmvReadSuccess)
ADD_SCENE(nfc, emv_menu, EmvMenu) ADD_SCENE(nfc, emv_menu, EmvMenu)
#if FURI_DEBUG
ADD_SCENE(nfc, emulate_apdu_sequence, EmulateApduSequence) ADD_SCENE(nfc, emulate_apdu_sequence, EmulateApduSequence)
#endif
ADD_SCENE(nfc, device_info, DeviceInfo) ADD_SCENE(nfc, device_info, DeviceInfo)
ADD_SCENE(nfc, delete, Delete) ADD_SCENE(nfc, delete, Delete)
ADD_SCENE(nfc, delete_success, DeleteSuccess) ADD_SCENE(nfc, delete_success, DeleteSuccess)
ADD_SCENE(nfc, restore_original_confirm, RestoreOriginalConfirm) ADD_SCENE(nfc, restore_original_confirm, RestoreOriginalConfirm)
ADD_SCENE(nfc, restore_original, RestoreOriginal) ADD_SCENE(nfc, restore_original, RestoreOriginal)
#if FURI_DEBUG
ADD_SCENE(nfc, debug, Debug) ADD_SCENE(nfc, debug, Debug)
ADD_SCENE(nfc, field, Field) ADD_SCENE(nfc, field, Field)
#endif
ADD_SCENE(nfc, dict_not_found, DictNotFound) ADD_SCENE(nfc, dict_not_found, DictNotFound)
ADD_SCENE(nfc, rpc, Rpc) ADD_SCENE(nfc, rpc, Rpc)
ADD_SCENE(nfc, exit_confirm, ExitConfirm) ADD_SCENE(nfc, exit_confirm, ExitConfirm)

View File

@ -1,4 +1,3 @@
#if FURI_DEBUG
#include "../nfc_i.h" #include "../nfc_i.h"
enum SubmenuDebugIndex { enum SubmenuDebugIndex {
@ -53,4 +52,3 @@ void nfc_scene_debug_on_exit(void* context) {
submenu_reset(nfc->submenu); submenu_reset(nfc->submenu);
} }
#endif

View File

@ -1,4 +1,3 @@
#if FURI_DEBUG
#include "../nfc_i.h" #include "../nfc_i.h"
#include <core/common_defines.h> #include <core/common_defines.h>
@ -33,4 +32,3 @@ void nfc_scene_emulate_apdu_sequence_on_exit(void* context) {
nfc_blink_stop(nfc); nfc_blink_stop(nfc);
} }
#endif

View File

@ -1,4 +1,3 @@
#if FURI_DEBUG
#include "../nfc_i.h" #include "../nfc_i.h"
void nfc_scene_field_on_enter(void* context) { void nfc_scene_field_on_enter(void* context) {
@ -32,4 +31,3 @@ void nfc_scene_field_on_exit(void* context) {
notification_internal_message(nfc->notifications, &sequence_reset_blue); notification_internal_message(nfc->notifications, &sequence_reset_blue);
popup_reset(nfc->popup); popup_reset(nfc->popup);
} }
#endif

View File

@ -8,9 +8,7 @@ enum SubmenuIndex {
SubmenuIndexSaved, SubmenuIndexSaved,
SubmenuIndexExtraAction, SubmenuIndexExtraAction,
SubmenuIndexAddManually, SubmenuIndexAddManually,
#if FURI_DEBUG
SubmenuIndexDebug, SubmenuIndexDebug,
#endif
}; };
void nfc_scene_start_submenu_callback(void* context, uint32_t index) { void nfc_scene_start_submenu_callback(void* context, uint32_t index) {
@ -31,12 +29,12 @@ void nfc_scene_start_on_enter(void* context) {
submenu, "Extra Actions", SubmenuIndexExtraAction, nfc_scene_start_submenu_callback, nfc); submenu, "Extra Actions", SubmenuIndexExtraAction, nfc_scene_start_submenu_callback, nfc);
submenu_add_item( submenu_add_item(
submenu, "Add Manually", SubmenuIndexAddManually, nfc_scene_start_submenu_callback, nfc); submenu, "Add Manually", SubmenuIndexAddManually, nfc_scene_start_submenu_callback, nfc);
#if FURI_DEBUG
if(furi_hal_rtc_is_flag_set(FuriHalRtcFlagDebug)) { if(furi_hal_rtc_is_flag_set(FuriHalRtcFlagDebug)) {
submenu_add_item( submenu_add_item(
submenu, "Debug", SubmenuIndexDebug, nfc_scene_start_submenu_callback, nfc); submenu, "Debug", SubmenuIndexDebug, nfc_scene_start_submenu_callback, nfc);
} }
#endif
submenu_set_selected_item( submenu_set_selected_item(
submenu, scene_manager_get_scene_state(nfc->scene_manager, NfcSceneStart)); submenu, scene_manager_get_scene_state(nfc->scene_manager, NfcSceneStart));
@ -84,14 +82,11 @@ bool nfc_scene_start_on_event(void* context, SceneManagerEvent event) {
nfc->scene_manager, NfcSceneStart, SubmenuIndexAddManually); nfc->scene_manager, NfcSceneStart, SubmenuIndexAddManually);
scene_manager_next_scene(nfc->scene_manager, NfcSceneSetType); scene_manager_next_scene(nfc->scene_manager, NfcSceneSetType);
consumed = true; consumed = true;
} } else if(event.event == SubmenuIndexDebug) {
#if FURI_DEBUG
else if(event.event == SubmenuIndexDebug) {
scene_manager_set_scene_state(nfc->scene_manager, NfcSceneStart, SubmenuIndexDebug); scene_manager_set_scene_state(nfc->scene_manager, NfcSceneStart, SubmenuIndexDebug);
scene_manager_next_scene(nfc->scene_manager, NfcSceneDebug); scene_manager_next_scene(nfc->scene_manager, NfcSceneDebug);
consumed = true; consumed = true;
} }
#endif
} }
return consumed; return consumed;
} }

View File

@ -95,13 +95,9 @@ int32_t nfc_worker_task(void* context) {
} }
} else if(nfc_worker->state == NfcWorkerStateUidEmulate) { } else if(nfc_worker->state == NfcWorkerStateUidEmulate) {
nfc_worker_emulate_uid(nfc_worker); nfc_worker_emulate_uid(nfc_worker);
} } else if(nfc_worker->state == NfcWorkerStateEmulateApdu) {
#if FURI_DEBUG
else if(nfc_worker->state == NfcWorkerStateEmulateApdu) {
nfc_worker_emulate_apdu(nfc_worker); nfc_worker_emulate_apdu(nfc_worker);
} } else if(nfc_worker->state == NfcWorkerStateMfUltralightEmulate) {
#endif
else if(nfc_worker->state == NfcWorkerStateMfUltralightEmulate) {
nfc_worker_emulate_mf_ultralight(nfc_worker); nfc_worker_emulate_mf_ultralight(nfc_worker);
} else if(nfc_worker->state == NfcWorkerStateMfClassicEmulate) { } else if(nfc_worker->state == NfcWorkerStateMfClassicEmulate) {
nfc_worker_emulate_mf_classic(nfc_worker); nfc_worker_emulate_mf_classic(nfc_worker);
@ -755,7 +751,7 @@ void nfc_worker_emulate_uid(NfcWorker* nfc_worker) {
} }
} }
} }
#if FURI_DEBUG
void nfc_worker_emulate_apdu(NfcWorker* nfc_worker) { void nfc_worker_emulate_apdu(NfcWorker* nfc_worker) {
FuriHalNfcTxRxContext tx_rx = {}; FuriHalNfcTxRxContext tx_rx = {};
FuriHalNfcDevData params = { FuriHalNfcDevData params = {
@ -788,7 +784,6 @@ void nfc_worker_emulate_apdu(NfcWorker* nfc_worker) {
reader_analyzer_stop(nfc_worker->reader_analyzer); reader_analyzer_stop(nfc_worker->reader_analyzer);
} }
} }
#endif
void nfc_worker_mf_ultralight_auth_received_callback(MfUltralightAuth auth, void* context) { void nfc_worker_mf_ultralight_auth_received_callback(MfUltralightAuth auth, void* context) {
furi_assert(context); furi_assert(context);

View File

@ -44,7 +44,7 @@ const PDOLValue* const pdol_values[] = {
&pdol_transaction_cert, &pdol_transaction_cert,
&pdol_unpredict_number, &pdol_unpredict_number,
}; };
#if FURI_DEBUG
static const uint8_t select_ppse_ans[] = {0x6F, 0x29, 0x84, 0x0E, 0x32, 0x50, 0x41, 0x59, 0x2E, static const uint8_t select_ppse_ans[] = {0x6F, 0x29, 0x84, 0x0E, 0x32, 0x50, 0x41, 0x59, 0x2E,
0x53, 0x59, 0x53, 0x2E, 0x44, 0x44, 0x46, 0x30, 0x31, 0x53, 0x59, 0x53, 0x2E, 0x44, 0x44, 0x46, 0x30, 0x31,
0xA5, 0x17, 0xBF, 0x0C, 0x14, 0x61, 0x12, 0x4F, 0x07, 0xA5, 0x17, 0xBF, 0x0C, 0x14, 0x61, 0x12, 0x4F, 0x07,
@ -61,7 +61,7 @@ static const uint8_t pdol_ans[] = {0x77, 0x40, 0x82, 0x02, 0x20, 0x00, 0x57, 0x1
0x00, 0x9F, 0x26, 0x08, 0x7A, 0x65, 0x7F, 0xD3, 0x52, 0x96, 0x00, 0x9F, 0x26, 0x08, 0x7A, 0x65, 0x7F, 0xD3, 0x52, 0x96,
0xC9, 0x85, 0x9F, 0x27, 0x01, 0x00, 0x9F, 0x36, 0x02, 0x06, 0xC9, 0x85, 0x9F, 0x27, 0x01, 0x00, 0x9F, 0x36, 0x02, 0x06,
0x0C, 0x9F, 0x6C, 0x02, 0x10, 0x00, 0x90, 0x00}; 0x0C, 0x9F, 0x6C, 0x02, 0x10, 0x00, 0x90, 0x00};
#endif
static void emv_trace(FuriHalNfcTxRxContext* tx_rx, const char* message) { static void emv_trace(FuriHalNfcTxRxContext* tx_rx, const char* message) {
if(furi_log_get_level() == FuriLogLevelTrace) { if(furi_log_get_level() == FuriLogLevelTrace) {
FURI_LOG_T(TAG, "%s", message); FURI_LOG_T(TAG, "%s", message);
@ -409,7 +409,6 @@ bool emv_read_bank_card(FuriHalNfcTxRxContext* tx_rx, EmvApplication* emv_app) {
return card_num_read; return card_num_read;
} }
#if FURI_DEBUG
bool emv_card_emulation(FuriHalNfcTxRxContext* tx_rx) { bool emv_card_emulation(FuriHalNfcTxRxContext* tx_rx) {
furi_assert(tx_rx); furi_assert(tx_rx);
bool emulation_complete = false; bool emulation_complete = false;
@ -443,4 +442,3 @@ bool emv_card_emulation(FuriHalNfcTxRxContext* tx_rx) {
return emulation_complete; return emulation_complete;
} }
#endif