From 323a56e987bda3c181db9539da9993f7ecf2cb64 Mon Sep 17 00:00:00 2001 From: DerSkythe Date: Mon, 10 Oct 2022 03:05:51 +0400 Subject: [PATCH] fix saving files --- applications/plugins/subbrute/application.fam | 4 ++-- .../subbrute/scenes/subbrute_scene_save_name.c | 2 +- applications/plugins/subbrute/subbrute_device.c | 3 ++- .../plugins/subbrute/subbrute_protocols.c | 16 ++++++++-------- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/applications/plugins/subbrute/application.fam b/applications/plugins/subbrute/application.fam index 5e9dd9c8d..62d59a188 100644 --- a/applications/plugins/subbrute/application.fam +++ b/applications/plugins/subbrute/application.fam @@ -1,6 +1,6 @@ App( - appid="SubGHz_Bruteforcer", - name="Sub-GHz Bruteforcer", + appid="SubGHz_Bruteforcer_v3", + name="Sub-GHz Bruteforcer v3", apptype=FlipperAppType.EXTERNAL, entry_point="subbrute_app", cdefines=["APP_SUB_BRUTE"], diff --git a/applications/plugins/subbrute/scenes/subbrute_scene_save_name.c b/applications/plugins/subbrute/scenes/subbrute_scene_save_name.c index f0acb30df..b5919ae5a 100644 --- a/applications/plugins/subbrute/scenes/subbrute_scene_save_name.c +++ b/applications/plugins/subbrute/scenes/subbrute_scene_save_name.c @@ -47,7 +47,7 @@ bool subbrute_scene_save_name_on_event(void* context, SceneManagerEvent event) { if(strcmp(instance->text_store, "")) { furi_string_reset(instance->file_path); furi_string_cat_printf( - instance->file_path, "/%s%s", instance->text_store, SUBBRUTE_FILE_EXT); + instance->file_path, "%s/%s%s", SUBBRUTE_PATH, instance->text_store, SUBBRUTE_FILE_EXT); if(subbrute_device_save_file(instance->device, furi_string_get_cstr(instance->file_path))) { scene_manager_next_scene(instance->scene_manager, SubBruteSceneSaveSuccess); diff --git a/applications/plugins/subbrute/subbrute_device.c b/applications/plugins/subbrute/subbrute_device.c index 0b23e61e2..bf85e3a66 100644 --- a/applications/plugins/subbrute/subbrute_device.c +++ b/applications/plugins/subbrute/subbrute_device.c @@ -20,7 +20,7 @@ SubBruteDevice* subbrute_device_alloc() { instance->environment = subghz_environment_alloc(); #ifdef FURI_DEBUG - subbrute_device_attack_set_default_values(instance, SubBruteAttackLoadFile); + subbrute_device_attack_set_default_values(instance, SubBruteAttackCAME12bit433); #else subbrute_device_attack_set_default_values(instance, SubBruteAttackCAME12bit433); #endif @@ -88,6 +88,7 @@ bool subbrute_device_save_file(SubBruteDevice* instance, const char* dev_file_na bool result = false; do { if(!flipper_format_file_open_always(file, dev_file_name)) { + FURI_LOG_E(TAG, "Failed to open file: %s", dev_file_name); break; } Stream* stream = flipper_format_get_raw_stream(file); diff --git a/applications/plugins/subbrute/subbrute_protocols.c b/applications/plugins/subbrute/subbrute_protocols.c index c4ef1c662..b6595fefd 100644 --- a/applications/plugins/subbrute/subbrute_protocols.c +++ b/applications/plugins/subbrute/subbrute_protocols.c @@ -362,8 +362,8 @@ void subbrute_protocol_default_generate_file( stream, subbrute_key_file_start_with_tail, frequency, - preset, - file, + subbrute_protocol_preset(preset), + subbrute_protocol_file(file), bits, furi_string_get_cstr(candidate), te, @@ -373,8 +373,8 @@ void subbrute_protocol_default_generate_file( stream, subbrute_key_file_start_no_tail, frequency, - preset, - file, + subbrute_protocol_preset(preset), + subbrute_protocol_file(file), bits, furi_string_get_cstr(candidate), repeat); @@ -409,8 +409,8 @@ void subbrute_protocol_file_generate_file( stream, subbrute_key_file_start_with_tail, frequency, - preset, - file, + subbrute_protocol_preset(preset), + subbrute_protocol_file(file), bits, furi_string_get_cstr(candidate), te, @@ -420,8 +420,8 @@ void subbrute_protocol_file_generate_file( stream, subbrute_key_file_start_no_tail, frequency, - preset, - file, + subbrute_protocol_preset(preset), + subbrute_protocol_file(file), bits, furi_string_get_cstr(candidate), repeat);