From df8c4c168a33c98b4029612edbfad35426461e4b Mon Sep 17 00:00:00 2001 From: MX <10697207+xMasterX@users.noreply.github.com> Date: Sat, 15 Jun 2024 18:22:25 +0300 Subject: [PATCH 01/12] Revert "disable mjs logging +2k free flash" This reverts commit d7330c7c2b6c6a24ce29d73b0c56547095d22728. --- lib/mjs/mjs_internal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/mjs/mjs_internal.h b/lib/mjs/mjs_internal.h index fd096aa11..eb1bccbd7 100644 --- a/lib/mjs/mjs_internal.h +++ b/lib/mjs/mjs_internal.h @@ -48,7 +48,7 @@ #endif #ifndef CS_ENABLE_STDIO -#define CS_ENABLE_STDIO 0 +#define CS_ENABLE_STDIO 1 #endif #include "common/cs_dbg.h" From cdc7e36d5cadc5be158c6095268b9e383f765814 Mon Sep 17 00:00:00 2001 From: SkorP Date: Sat, 15 Jun 2024 21:10:59 +0400 Subject: [PATCH 02/12] [FL-3853] SubGhz: fix Missed the "Deleted" screen when deleting RAW Subghz --- .../subghz/scenes/subghz_scene_delete_raw.c | 8 +------ .../scenes/subghz_scene_delete_success.c | 22 ++++++++++++++----- .../main/subghz/scenes/subghz_scene_saved.c | 1 + 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/applications/main/subghz/scenes/subghz_scene_delete_raw.c b/applications/main/subghz/scenes/subghz_scene_delete_raw.c index 5862ad7c7..53f13b68e 100644 --- a/applications/main/subghz/scenes/subghz_scene_delete_raw.c +++ b/applications/main/subghz/scenes/subghz_scene_delete_raw.c @@ -58,13 +58,7 @@ bool subghz_scene_delete_raw_on_event(void* context, SceneManagerEvent event) { if(event.event == SubGhzCustomEventSceneDeleteRAW) { furi_string_set(subghz->file_path_tmp, subghz->file_path); if(subghz_delete_file(subghz)) { - if(subghz_rx_key_state_get(subghz) != SubGhzRxKeyStateRAWLoad) { - subghz_rx_key_state_set(subghz, SubGhzRxKeyStateIDLE); - scene_manager_next_scene(subghz->scene_manager, SubGhzSceneDeleteSuccess); - } else { - scene_manager_next_scene(subghz->scene_manager, SubGhzSceneSaved); - } - + scene_manager_next_scene(subghz->scene_manager, SubGhzSceneDeleteSuccess); } else { scene_manager_search_and_switch_to_previous_scene( subghz->scene_manager, SubGhzSceneStart); diff --git a/applications/main/subghz/scenes/subghz_scene_delete_success.c b/applications/main/subghz/scenes/subghz_scene_delete_success.c index 0150f2996..ddfd23abb 100644 --- a/applications/main/subghz/scenes/subghz_scene_delete_success.c +++ b/applications/main/subghz/scenes/subghz_scene_delete_success.c @@ -26,14 +26,24 @@ bool subghz_scene_delete_success_on_event(void* context, SceneManagerEvent event if(event.type == SceneManagerEventTypeCustom) { if(event.event == SubGhzCustomEventSceneDeleteSuccess) { - if(scene_manager_search_and_switch_to_previous_scene( - subghz->scene_manager, SubGhzSceneReadRAW)) { - } else if(scene_manager_search_and_switch_to_previous_scene( - subghz->scene_manager, SubGhzSceneSaved)) { + if(subghz_rx_key_state_get(subghz) == SubGhzRxKeyStateRAWLoad) { + if(scene_manager_search_and_switch_to_previous_scene( + subghz->scene_manager, SubGhzSceneSaved)) { + } else { + scene_manager_search_and_switch_to_previous_scene( + subghz->scene_manager, SubGhzSceneStart); + } } else { - scene_manager_search_and_switch_to_previous_scene( - subghz->scene_manager, SubGhzSceneStart); + subghz_rx_key_state_set(subghz, SubGhzRxKeyStateIDLE); + + if(scene_manager_search_and_switch_to_previous_scene( + subghz->scene_manager, SubGhzSceneReadRAW)) { + } else { + scene_manager_search_and_switch_to_previous_scene( + subghz->scene_manager, SubGhzSceneStart); + } } + return true; } } diff --git a/applications/main/subghz/scenes/subghz_scene_saved.c b/applications/main/subghz/scenes/subghz_scene_saved.c index 3daedd33f..ef039c16f 100644 --- a/applications/main/subghz/scenes/subghz_scene_saved.c +++ b/applications/main/subghz/scenes/subghz_scene_saved.c @@ -8,6 +8,7 @@ void subghz_scene_saved_on_enter(void* context) { subghz_rx_key_state_set(subghz, SubGhzRxKeyStateRAWLoad); scene_manager_next_scene(subghz->scene_manager, SubGhzSceneReadRAW); } else { + subghz_rx_key_state_set(subghz, SubGhzRxKeyStateRAWLoad); scene_manager_next_scene(subghz->scene_manager, SubGhzSceneSavedMenu); } } else { From f027c15e37e197a74c92bdbba80703aea2fa9282 Mon Sep 17 00:00:00 2001 From: MX <10697207+xMasterX@users.noreply.github.com> Date: Sun, 16 Jun 2024 14:37:37 +0300 Subject: [PATCH 03/12] upd changelog --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 75753a645..c7169c0e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,7 +20,8 @@ * CLI: Move part of the CLI to microsd to free up space for COMPACT 0 builds (by @Willy-JL) * NFC: Fix typo in parsers * Apps: Fix `input_callback` and `timer_callback` usage of non `void` argument as input -* JS: Disable mjs logging +2k free flash (by @hedger) +* OFW: SubGhz: fix Missed the "Deleted" screen when deleting RAW Subghz (by @Skorpionm) +* OFW: JS: Disable logging in mjs +2k free flash (by @hedger) * OFW: Archive: fix memory leak in favorites add/remove * OFW: Furi: Fix EventLoop state persisting on same thread after free * OFW: Cli: top From 0bb2738d36f3cfe284f8b81b76225d47883a4dbc Mon Sep 17 00:00:00 2001 From: MX <10697207+xMasterX@users.noreply.github.com> Date: Mon, 17 Jun 2024 01:18:39 +0300 Subject: [PATCH 04/12] remove outdated sdk install files due to fbt --- Brewfile | 7 ----- brew-cask/gcc-arm-embedded.rb | 56 ----------------------------------- 2 files changed, 63 deletions(-) delete mode 100644 Brewfile delete mode 100644 brew-cask/gcc-arm-embedded.rb diff --git a/Brewfile b/Brewfile deleted file mode 100644 index be9674970..000000000 --- a/Brewfile +++ /dev/null @@ -1,7 +0,0 @@ -cask "brew-cask/gcc-arm-embedded.rb" -brew "protobuf" -brew "gdb" -brew "open-ocd" -brew "clang-format" -brew "dfu-util" -brew "protobuf-c" diff --git a/brew-cask/gcc-arm-embedded.rb b/brew-cask/gcc-arm-embedded.rb deleted file mode 100644 index 1f9228991..000000000 --- a/brew-cask/gcc-arm-embedded.rb +++ /dev/null @@ -1,56 +0,0 @@ -cask "gcc-arm-embedded" do - # Exists as a cask because it is impractical as a formula: - # https://github.com/Homebrew/homebrew-core/pull/45780#issuecomment-569246452 - version "10.3-2021.07,10.14.6" - sha256 "cae8b168ad16556ca204c0b441f9fb2c05be85362fe10e3b210be6b7177ef2d7" - - url "https://developer.arm.com/-/media/Files/downloads/gnu-rm/#{version.before_comma}/gcc-arm-none-eabi-#{version.before_comma}-mac-#{version.after_comma}-sha1.pkg" - name "GCC ARM Embedded" - desc "Pre-built GNU bare-metal toolchain for 32-bit Arm processors" - homepage "https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm" - - livecheck do - url "https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads" - strategy :page_match do |page| - match = page.match(/href=.*?gcc-arm-none-eabi-(\d+\.\d+-\d+\.\d+)-mac-(\d+\.\d+\.\d+)-sha1.pkg/i) - "#{match[1]},#{match[2]}" - end - end - - pkg "gcc-arm-none-eabi-#{version.before_comma}-mac-#{version.after_comma}-sha1.pkg" - binary "#{appdir}/ARM/bin/arm-none-eabi-addr2line" - binary "#{appdir}/ARM/bin/arm-none-eabi-ar" - binary "#{appdir}/ARM/bin/arm-none-eabi-as" - binary "#{appdir}/ARM/bin/arm-none-eabi-c++" - binary "#{appdir}/ARM/bin/arm-none-eabi-c++filt" - binary "#{appdir}/ARM/bin/arm-none-eabi-cpp" - binary "#{appdir}/ARM/bin/arm-none-eabi-elfedit" - binary "#{appdir}/ARM/bin/arm-none-eabi-g++" - binary "#{appdir}/ARM/bin/arm-none-eabi-gcc" - binary "#{appdir}/ARM/bin/arm-none-eabi-gcc-10.3.1" - binary "#{appdir}/ARM/bin/arm-none-eabi-gcc-ar" - binary "#{appdir}/ARM/bin/arm-none-eabi-gcc-nm" - binary "#{appdir}/ARM/bin/arm-none-eabi-gcc-ranlib" - binary "#{appdir}/ARM/bin/arm-none-eabi-gcov" - binary "#{appdir}/ARM/bin/arm-none-eabi-gcov-dump" - binary "#{appdir}/ARM/bin/arm-none-eabi-gcov-tool" - binary "#{appdir}/ARM/bin/arm-none-eabi-gdb" - binary "#{appdir}/ARM/bin/arm-none-eabi-gdb-add-index" - binary "#{appdir}/ARM/bin/arm-none-eabi-gdb-add-index-py" - binary "#{appdir}/ARM/bin/arm-none-eabi-gdb-py" - binary "#{appdir}/ARM/bin/arm-none-eabi-gprof" - binary "#{appdir}/ARM/bin/arm-none-eabi-ld" - binary "#{appdir}/ARM/bin/arm-none-eabi-ld.bfd" - binary "#{appdir}/ARM/bin/arm-none-eabi-lto-dump" - binary "#{appdir}/ARM/bin/arm-none-eabi-nm" - binary "#{appdir}/ARM/bin/arm-none-eabi-objcopy" - binary "#{appdir}/ARM/bin/arm-none-eabi-objdump" - binary "#{appdir}/ARM/bin/arm-none-eabi-ranlib" - binary "#{appdir}/ARM/bin/arm-none-eabi-readelf" - binary "#{appdir}/ARM/bin/arm-none-eabi-size" - binary "#{appdir}/ARM/bin/arm-none-eabi-strings" - binary "#{appdir}/ARM/bin/arm-none-eabi-strip" - - uninstall pkgutil: "gcc.arm-none-eabi-#{version[/^(\d{2})/]}", - delete: "/Applications/ARM" -end From 0770578d494f73675eb1e295314c4b114d66aaf0 Mon Sep 17 00:00:00 2001 From: MX <10697207+xMasterX@users.noreply.github.com> Date: Mon, 17 Jun 2024 02:16:20 +0300 Subject: [PATCH 05/12] fix incorrect state in decode raw exit causing keys to be not removed from history and showing up in Read menu after exit from decode raw --- applications/main/subghz/scenes/subghz_scene_decode_raw.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/applications/main/subghz/scenes/subghz_scene_decode_raw.c b/applications/main/subghz/scenes/subghz_scene_decode_raw.c index 85a524117..331c7c704 100644 --- a/applications/main/subghz/scenes/subghz_scene_decode_raw.c +++ b/applications/main/subghz/scenes/subghz_scene_decode_raw.c @@ -207,6 +207,8 @@ bool subghz_scene_decode_raw_on_event(void* context, SceneManagerEvent event) { subghz_txrx_set_rx_callback(subghz->txrx, NULL, subghz); + subghz_rx_key_state_set(subghz, SubGhzRxKeyStateIDLE); + if(subghz_file_encoder_worker_is_running(subghz->decode_raw_file_worker_encoder)) { subghz_file_encoder_worker_stop(subghz->decode_raw_file_worker_encoder); } From b48c6dd7f845a4536fc3cc4c7061ddd15b2cbe1f Mon Sep 17 00:00:00 2001 From: MX <10697207+xMasterX@users.noreply.github.com> Date: Mon, 17 Jun 2024 02:17:05 +0300 Subject: [PATCH 06/12] princeton reject guard time more than 900 and show guard time in UI --- lib/subghz/protocols/princeton.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/subghz/protocols/princeton.c b/lib/subghz/protocols/princeton.c index 4e62f2eef..966f33e70 100644 --- a/lib/subghz/protocols/princeton.c +++ b/lib/subghz/protocols/princeton.c @@ -268,6 +268,9 @@ void subghz_protocol_decoder_princeton_feed(void* context, bool level, uint32_t instance->generic.data = instance->decoder.decode_data; instance->generic.data_count_bit = instance->decoder.decode_count_bit; instance->guard_time = roundf((float)duration / instance->te); + if(instance->guard_time > 900) { + instance->guard_time = PRINCETON_GUARD_TIME_DEFALUT; + } if(instance->base.callback) instance->base.callback(&instance->base, instance->base.context); @@ -388,12 +391,13 @@ void subghz_protocol_decoder_princeton_get_string(void* context, FuriString* out "Key:0x%08lX\r\n" "Yek:0x%08lX\r\n" "Sn:0x%05lX Btn:%01X\r\n" - "Te:%luus\r\n", + "Te:%luus GdTime:%lu\r\n", instance->generic.protocol_name, instance->generic.data_count_bit, (uint32_t)(instance->generic.data & 0xFFFFFF), data_rev, instance->generic.serial, instance->generic.btn, - instance->te); + instance->te, + instance->guard_time); } From a3356ad20862978e52cbabbd133fbc4e964eabde Mon Sep 17 00:00:00 2001 From: Astra Date: Mon, 17 Jun 2024 20:30:37 +0900 Subject: [PATCH 07/12] Don't crash on reading weird cards --- lib/nfc/protocols/mf_plus/mf_plus_i.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/nfc/protocols/mf_plus/mf_plus_i.c b/lib/nfc/protocols/mf_plus/mf_plus_i.c index d5fe5be82..13bf8c5d8 100644 --- a/lib/nfc/protocols/mf_plus/mf_plus_i.c +++ b/lib/nfc/protocols/mf_plus/mf_plus_i.c @@ -4,13 +4,15 @@ MF_PLUS_FFF_PICC_PREFIX " " \ "Version" +#define MF_PLUS_T1_TK_VALUE_LEN 7 + #define MF_PLUS_FFF_SECURITY_LEVEL_KEY "Security Level" #define MF_PLUS_FFF_CARD_TYPE_KEY "Card Type" #define MF_PLUS_FFF_MEMORY_SIZE_KEY "Memory Size" #define TAG "MfPlus" -const uint8_t mf_plus_ats_t1_tk_values[][7] = { +const uint8_t mf_plus_ats_t1_tk_values[][MF_PLUS_T1_TK_VALUE_LEN] = { {0xC1, 0x05, 0x2F, 0x2F, 0x00, 0x35, 0xC7}, // Mifare Plus S {0xC1, 0x05, 0x2F, 0x2F, 0x01, 0xBC, 0xD6}, // Mifare Plus X {0xC1, 0x05, 0x2F, 0x2F, 0x00, 0xF6, 0xD1}, // Mifare Plus SE @@ -97,6 +99,10 @@ MfPlusError MfPlusError error = MfPlusErrorProtocol; + if(simple_array_get_count(iso4_data->ats_data.t1_tk) != MF_PLUS_T1_TK_VALUE_LEN) { + return MfPlusErrorProtocol; + } + switch(iso4_data->iso14443_3a_data->sak) { case 0x08: if(memcmp( From 0b8ddb6173c58d24c27d3af390c4d6d7fbb54a05 Mon Sep 17 00:00:00 2001 From: gornekich Date: Mon, 17 Jun 2024 12:58:55 +0100 Subject: [PATCH 08/12] mf plus: fix incorrect read fail event handler --- .../main/nfc/helpers/protocol_support/mf_plus/mf_plus.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/applications/main/nfc/helpers/protocol_support/mf_plus/mf_plus.c b/applications/main/nfc/helpers/protocol_support/mf_plus/mf_plus.c index eebed2a8d..eb2299cb5 100644 --- a/applications/main/nfc/helpers/protocol_support/mf_plus/mf_plus.c +++ b/applications/main/nfc/helpers/protocol_support/mf_plus/mf_plus.c @@ -41,8 +41,7 @@ static NfcCommand nfc_scene_read_poller_callback_mf_plus(NfcGenericEvent event, view_dispatcher_send_custom_event(instance->view_dispatcher, NfcCustomEventPollerSuccess); command = NfcCommandStop; } else if(mf_plus_event->type == MfPlusPollerEventTypeReadFailed) { - view_dispatcher_send_custom_event(instance->view_dispatcher, NfcCustomEventPollerFailure); - command = NfcCommandStop; + command = NfcCommandReset; } return command; From 2a163db3ad74d8a550563675a7774cad96285fc0 Mon Sep 17 00:00:00 2001 From: MX <10697207+xMasterX@users.noreply.github.com> Date: Mon, 17 Jun 2024 15:33:08 +0300 Subject: [PATCH 09/12] fix add manually and fix check --- .../helpers/subghz_txrx_create_protocol_key.c | 4 ++-- lib/subghz/protocols/princeton.c | 17 +++++++++++++++-- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/applications/main/subghz/helpers/subghz_txrx_create_protocol_key.c b/applications/main/subghz/helpers/subghz_txrx_create_protocol_key.c index 5f96c0c0d..5148ca20d 100644 --- a/applications/main/subghz/helpers/subghz_txrx_create_protocol_key.c +++ b/applications/main/subghz/helpers/subghz_txrx_create_protocol_key.c @@ -81,11 +81,11 @@ bool subghz_txrx_gen_data_protocol_and_te( ret = true; } } - if(ret == SubGhzProtocolStatusOk) { + if(ret) { uint32_t guard_time = 30; if(!flipper_format_update_uint32( instance->fff_data, "Guard_time", (uint32_t*)&guard_time, 1)) { - ret = SubGhzProtocolStatusErrorParserOthers; + ret = false; FURI_LOG_E(TAG, "Unable to update Guard_time"); } } diff --git a/lib/subghz/protocols/princeton.c b/lib/subghz/protocols/princeton.c index 966f33e70..247ac3fc6 100644 --- a/lib/subghz/protocols/princeton.c +++ b/lib/subghz/protocols/princeton.c @@ -14,6 +14,7 @@ #define TAG "SubGhzProtocolPrinceton" #define PRINCETON_GUARD_TIME_DEFALUT 30 //GUARD_TIME = PRINCETON_GUARD_TIME_DEFALUT * TE +// Guard Time value should be between 15 -> 72 otherwise default value will be used static const SubGhzBlockConst subghz_protocol_princeton_const = { .te_short = 390, @@ -172,6 +173,11 @@ SubGhzProtocolStatus if(!flipper_format_read_uint32( flipper_format, "Guard_time", (uint32_t*)&instance->guard_time, 1)) { instance->guard_time = PRINCETON_GUARD_TIME_DEFALUT; + } else { + // Guard Time value should be between 15 -> 72 otherwise default value will be used + if((instance->guard_time < 15) || (instance->guard_time > 72)) { + instance->guard_time = PRINCETON_GUARD_TIME_DEFALUT; + } } flipper_format_read_uint32( @@ -268,7 +274,8 @@ void subghz_protocol_decoder_princeton_feed(void* context, bool level, uint32_t instance->generic.data = instance->decoder.decode_data; instance->generic.data_count_bit = instance->decoder.decode_count_bit; instance->guard_time = roundf((float)duration / instance->te); - if(instance->guard_time > 900) { + // Guard Time value should be between 15 -> 72 otherwise default value will be used + if((instance->guard_time < 15) || (instance->guard_time > 72)) { instance->guard_time = PRINCETON_GUARD_TIME_DEFALUT; } @@ -372,7 +379,13 @@ SubGhzProtocolStatus if(!flipper_format_read_uint32( flipper_format, "Guard_time", (uint32_t*)&instance->guard_time, 1)) { instance->guard_time = PRINCETON_GUARD_TIME_DEFALUT; + } else { + // Guard Time value should be between 15 -> 72 otherwise default value will be used + if((instance->guard_time < 15) || (instance->guard_time > 72)) { + instance->guard_time = PRINCETON_GUARD_TIME_DEFALUT; + } } + } while(false); return ret; @@ -391,7 +404,7 @@ void subghz_protocol_decoder_princeton_get_string(void* context, FuriString* out "Key:0x%08lX\r\n" "Yek:0x%08lX\r\n" "Sn:0x%05lX Btn:%01X\r\n" - "Te:%luus GdTime:%lu\r\n", + "Te:%luus GT:Te*%lu\r\n", instance->generic.protocol_name, instance->generic.data_count_bit, (uint32_t)(instance->generic.data & 0xFFFFFF), From 30b376f4e3d0d0ca83420bbd210b10e78a55cb74 Mon Sep 17 00:00:00 2001 From: MX <10697207+xMasterX@users.noreply.github.com> Date: Mon, 17 Jun 2024 16:40:10 +0300 Subject: [PATCH 10/12] subghz sync delete scene with ofw --- .../main/subghz/helpers/subghz_custom_event.h | 1 + .../main/subghz/scenes/subghz_scene_delete.c | 62 ++++++++++++------- 2 files changed, 40 insertions(+), 23 deletions(-) diff --git a/applications/main/subghz/helpers/subghz_custom_event.h b/applications/main/subghz/helpers/subghz_custom_event.h index 56bc7fe5f..2bf308e28 100644 --- a/applications/main/subghz/helpers/subghz_custom_event.h +++ b/applications/main/subghz/helpers/subghz_custom_event.h @@ -8,6 +8,7 @@ typedef enum { //SubGhzCustomEvent SubGhzCustomEventSceneDeleteSuccess = 100, SubGhzCustomEventSceneDelete, + SubGhzCustomEventSceneDeleteBack, SubGhzCustomEventSceneDeleteRAW, SubGhzCustomEventSceneDeleteRAWBack, diff --git a/applications/main/subghz/scenes/subghz_scene_delete.c b/applications/main/subghz/scenes/subghz_scene_delete.c index 3fc4be069..601e2711d 100644 --- a/applications/main/subghz/scenes/subghz_scene_delete.c +++ b/applications/main/subghz/scenes/subghz_scene_delete.c @@ -6,43 +6,57 @@ void subghz_scene_delete_callback(GuiButtonType result, InputType type, void* co SubGhz* subghz = context; if((result == GuiButtonTypeRight) && (type == InputTypeShort)) { view_dispatcher_send_custom_event(subghz->view_dispatcher, SubGhzCustomEventSceneDelete); + } else if((result == GuiButtonTypeLeft) && (type == InputTypeShort)) { + view_dispatcher_send_custom_event( + subghz->view_dispatcher, SubGhzCustomEventSceneDeleteBack); } } void subghz_scene_delete_on_enter(void* context) { SubGhz* subghz = context; - FuriString* frequency_str = furi_string_alloc(); - FuriString* modulation_str = furi_string_alloc(); - FuriString* text = furi_string_alloc(); - subghz_txrx_get_frequency_and_modulation(subghz->txrx, frequency_str, modulation_str, false); - widget_add_string_element( - subghz->widget, - 78, - 0, - AlignLeft, - AlignTop, - FontSecondary, - furi_string_get_cstr(frequency_str)); + FuriString* frequency_str; + FuriString* modulation_str; + FuriString* text_out; + FuriString* text; + text_out = furi_string_alloc(); + text = furi_string_alloc(); - widget_add_string_element( - subghz->widget, - 113, - 0, - AlignLeft, - AlignTop, - FontSecondary, - furi_string_get_cstr(modulation_str)); + path_extract_filename(subghz->file_path, text, true); + furi_string_cat_printf(text_out, "\e#Delete %s?\e#\n", furi_string_get_cstr(text)); + + furi_string_reset(text); subghz_protocol_decoder_base_get_string(subghz_txrx_get_decoder(subghz->txrx), text); - widget_add_string_multiline_element( - subghz->widget, 0, 0, AlignLeft, AlignTop, FontSecondary, furi_string_get_cstr(text)); + + size_t dot = furi_string_search_char(text, '\r'); + if(dot > 0) { + furi_string_left(text, dot); + } + furi_string_cat_printf(text_out, "%s\n", furi_string_get_cstr(text)); + + furi_string_free(text); + + frequency_str = furi_string_alloc(); + modulation_str = furi_string_alloc(); + subghz_txrx_get_frequency_and_modulation(subghz->txrx, frequency_str, modulation_str, false); + + furi_string_cat_printf( + text_out, + "%s %s", + furi_string_get_cstr(frequency_str), + furi_string_get_cstr(modulation_str)); + + widget_add_text_box_element( + subghz->widget, 0, 0, 128, 54, AlignCenter, AlignTop, furi_string_get_cstr(text_out), false); furi_string_free(frequency_str); furi_string_free(modulation_str); - furi_string_free(text); + furi_string_free(text_out); widget_add_button_element( subghz->widget, GuiButtonTypeRight, "Delete", subghz_scene_delete_callback, subghz); + widget_add_button_element( + subghz->widget, GuiButtonTypeLeft, "Cancel", subghz_scene_delete_callback, subghz); view_dispatcher_switch_to_view(subghz->view_dispatcher, SubGhzViewIdWidget); } @@ -59,6 +73,8 @@ bool subghz_scene_delete_on_event(void* context, SceneManagerEvent event) { subghz->scene_manager, SubGhzSceneStart); } return true; + } else if(event.event == SubGhzCustomEventSceneDeleteBack) { + return scene_manager_previous_scene(subghz->scene_manager); } } return false; From e52d5ab5791f7a5451507062caa9dc81b0b8a42e Mon Sep 17 00:00:00 2001 From: MX <10697207+xMasterX@users.noreply.github.com> Date: Tue, 18 Jun 2024 00:37:44 +0300 Subject: [PATCH 11/12] upd changelog --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c7169c0e8..e6f712d13 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,9 +2,11 @@ - SubGHz: - Add new protocol - legrand 18bit (by @user890104) - OFW: Princeton protocol add custom guard time support + - Princeton fix guard time bounds and show guard time multiplier in UI - NFC: - Fix Mifare DESFire reading (revert of buffer check workaround for rare emv cases) (some emv cards can be read only via Extra Actions -> Read specific card type -> EMV) - Better plugins(parsers) loading - much faster emulation launch from favourites, no more lags in Saved menu + - OFW: MF Ultralight Original write support - OFW: Mifare Plus detection support - OFW: Felica emulation - OFW: Write to ultralight cards is now possible (no UID writing) @@ -15,11 +17,17 @@ * Archive: Fix SubGHz Remote files in favourites falling into non working and non removable state * Apps: **Check out more Apps updates and fixes by following** [this link](https://github.com/xMasterX/all-the-plugins/commits/dev) ## Other changes +* SubGHz: Fix add manually princeton +* SubGHz: Sync signal delete scene with OFW +* SubGHz: Fix incorrect state in decode raw exit - causing keys to be not removed from history and showing up in Read menu after exit from decode raw +* Misc: Remove outdated brew sdk install files * Misc: Revert USB CDC changes to fix usb serial * Misc: Fix usage of deprecated `icon_get_data` * CLI: Move part of the CLI to microsd to free up space for COMPACT 0 builds (by @Willy-JL) * NFC: Fix typo in parsers * Apps: Fix `input_callback` and `timer_callback` usage of non `void` argument as input +* OFW: ELF, Flipper application: do not crash on "out of memory" +* OFW: Don't crash on reading weird cards * OFW: SubGhz: fix Missed the "Deleted" screen when deleting RAW Subghz (by @Skorpionm) * OFW: JS: Disable logging in mjs +2k free flash (by @hedger) * OFW: Archive: fix memory leak in favorites add/remove From 5c3e64bd0b4a9e361f7a71178b0fc12b888a6bca Mon Sep 17 00:00:00 2001 From: MX <10697207+xMasterX@users.noreply.github.com> Date: Tue, 18 Jun 2024 00:38:26 +0300 Subject: [PATCH 12/12] upd chaneglog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e6f712d13..1bb92f1f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,7 +27,7 @@ * NFC: Fix typo in parsers * Apps: Fix `input_callback` and `timer_callback` usage of non `void` argument as input * OFW: ELF, Flipper application: do not crash on "out of memory" -* OFW: Don't crash on reading weird cards +* OFW: MF Plus - Don't crash on reading weird cards * OFW: SubGhz: fix Missed the "Deleted" screen when deleting RAW Subghz (by @Skorpionm) * OFW: JS: Disable logging in mjs +2k free flash (by @hedger) * OFW: Archive: fix memory leak in favorites add/remove