LFRFID PSK Raws in debug

This commit is contained in:
MX 2023-05-28 06:36:19 +03:00
parent 1e1b85a575
commit 0d1fea9861
No known key found for this signature in database
GPG Key ID: 7CCC66B7DBDD1C83
3 changed files with 7 additions and 20 deletions

View File

@ -7,6 +7,7 @@
* SubGHz Remote: Full refactoring, app was re-made from scratch (by @gid9798) * SubGHz Remote: Full refactoring, app was re-made from scratch (by @gid9798)
* Archive: Fix rename, show error message to user * Archive: Fix rename, show error message to user
* API: Cleanup, mini refactoring of some apps (+6k of free flash space) * API: Cleanup, mini refactoring of some apps (+6k of free flash space)
* LFRFID: Debug: Allow PSK RAW emulation in gui
* SubGHz: Security+ 2.0 -> add extra custom button `0x78` - Fixes issue #469 * SubGHz: Security+ 2.0 -> add extra custom button `0x78` - Fixes issue #469
* SubGHz: Various fixes (by @gid9798) * SubGHz: Various fixes (by @gid9798)
* SubGHz: Fix counter settings in debug * SubGHz: Fix counter settings in debug

View File

@ -252,8 +252,7 @@ bool lfrfid_load_raw_key_from_file_select(LfRfid* app) {
furi_assert(app); furi_assert(app);
DialogsFileBrowserOptions browser_options; DialogsFileBrowserOptions browser_options;
dialog_file_browser_set_basic_options( dialog_file_browser_set_basic_options(&browser_options, ".raw", &I_125_10px);
&browser_options, LFRFID_APP_RAW_ASK_EXTENSION, &I_125_10px);
browser_options.base_path = LFRFID_APP_FOLDER; browser_options.base_path = LFRFID_APP_FOLDER;
// Input events and views are managed by file_browser // Input events and views are managed by file_browser
@ -261,9 +260,9 @@ bool lfrfid_load_raw_key_from_file_select(LfRfid* app) {
dialog_file_browser_show(app->dialogs, app->file_path, app->file_path, &browser_options); dialog_file_browser_show(app->dialogs, app->file_path, app->file_path, &browser_options);
if(result) { if(result) {
// Extract .raw and then .ask // Extract .raw
path_extract_filename(app->file_path, app->file_name, true); path_extract_filename(app->file_path, app->file_name, true);
path_extract_filename(app->file_name, app->file_name, true); //path_extract_filename(app->file_name, app->file_name, true);
} }
return result; return result;

View File

@ -3,7 +3,6 @@
#define TAG "ADC" #define TAG "ADC"
typedef struct { typedef struct {
FuriString* string_file_name;
bool error; bool error;
} LfRfidEmulateRawState; } LfRfidEmulateRawState;
@ -23,26 +22,15 @@ void lfrfid_scene_raw_emulate_on_enter(void* context) {
LfRfidEmulateRawState* state = malloc(sizeof(LfRfidEmulateRawState)); LfRfidEmulateRawState* state = malloc(sizeof(LfRfidEmulateRawState));
scene_manager_set_scene_state(app->scene_manager, LfRfidSceneRawEmulate, (uint32_t)state); scene_manager_set_scene_state(app->scene_manager, LfRfidSceneRawEmulate, (uint32_t)state);
state->string_file_name = furi_string_alloc();
popup_set_icon(popup, 0, 3, &I_RFIDDolphinReceive_97x61); popup_set_icon(popup, 0, 3, &I_RFIDDolphinReceive_97x61);
view_dispatcher_switch_to_view(app->view_dispatcher, LfRfidViewPopup); view_dispatcher_switch_to_view(app->view_dispatcher, LfRfidViewPopup);
lfrfid_worker_start_thread(app->lfworker); lfrfid_worker_start_thread(app->lfworker);
lfrfid_make_app_folder(app); lfrfid_make_app_folder(app);
furi_string_printf( popup_set_header(popup, "Emulating\nRAW RFID", 89, 30, AlignCenter, AlignTop);
state->string_file_name,
"%s/%s%s",
LFRFID_SD_FOLDER,
furi_string_get_cstr(app->file_name),
LFRFID_APP_RAW_ASK_EXTENSION);
FURI_LOG_D(TAG, "raw_emulate->file_name=%s", furi_string_get_cstr(state->string_file_name));
popup_set_header(popup, "Emulating\nRAW RFID\nASK", 89, 30, AlignCenter, AlignTop);
lfrfid_worker_emulate_raw_start( lfrfid_worker_emulate_raw_start(
app->lfworker, app->lfworker, furi_string_get_cstr(app->file_path), lfrfid_raw_emulate_callback, app);
furi_string_get_cstr(state->string_file_name),
lfrfid_raw_emulate_callback,
app);
notification_message(app->notifications, &sequence_blink_start_cyan); notification_message(app->notifications, &sequence_blink_start_cyan);
@ -63,7 +51,7 @@ bool lfrfid_scene_raw_emulate_on_event(void* context, SceneManagerEvent event) {
consumed = true; consumed = true;
state->error = true; state->error = true;
popup_set_header( popup_set_header(
popup, "Reading\nRAW RFID\nFile error", 89, 30, AlignCenter, AlignTop); popup, "Emulating\nRAW RFID\nFile error", 89, 30, AlignCenter, AlignTop);
notification_message(app->notifications, &sequence_blink_start_red); notification_message(app->notifications, &sequence_blink_start_red);
} }
} }
@ -81,6 +69,5 @@ void lfrfid_scene_raw_emulate_on_exit(void* context) {
lfrfid_worker_stop(app->lfworker); lfrfid_worker_stop(app->lfworker);
lfrfid_worker_stop_thread(app->lfworker); lfrfid_worker_stop_thread(app->lfworker);
furi_string_free(state->string_file_name);
free(state); free(state);
} }