Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ClusterM/flipperzero-firmware.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSkorpionm <85568270+Skorpionm@users.noreply.github.com>2022-04-01 14:10:21 +0300
committerGitHub <noreply@github.com>2022-04-01 14:10:21 +0300
commitcb7d43f7e1464ed3276a2772b7a0142f9252f181 (patch)
treec14625350ba8c723286ec6cab674bc5f1e800337 /applications/subghz/subghz.c
parent0bf2702210a70f37a51538b37839e4fd1fb30c4b (diff)
[FL-2410] SubGhz: fix launching an incorrect Sub-GHz key from the archive. (#1080)
Diffstat (limited to 'applications/subghz/subghz.c')
-rw-r--r--applications/subghz/subghz.c32
1 files changed, 19 insertions, 13 deletions
diff --git a/applications/subghz/subghz.c b/applications/subghz/subghz.c
index 0fb2f6d9..a6c6e24f 100644
--- a/applications/subghz/subghz.c
+++ b/applications/subghz/subghz.c
@@ -309,20 +309,26 @@ int32_t subghz_app(void* p) {
subghz_environment_load_keystore(
subghz->txrx->environment, "/ext/subghz/assets/keeloq_mfcodes_user");
// Check argument and run corresponding scene
- if(p && subghz_key_load(subghz, p)) {
- string_t filename;
- string_init(filename);
-
- path_extract_filename_no_ext(p, filename);
- strcpy(subghz->file_name, string_get_cstr(filename));
- string_clear(filename);
- if((!strcmp(subghz->txrx->decoder_result->protocol->name, "RAW"))) {
- //Load Raw TX
- subghz->txrx->rx_key_state = SubGhzRxKeyStateRAWLoad;
- scene_manager_next_scene(subghz->scene_manager, SubGhzSceneReadRAW);
+ if(p) {
+ if(subghz_key_load(subghz, p)) {
+ string_t filename;
+ string_init(filename);
+
+ path_extract_filename_no_ext(p, filename);
+ strcpy(subghz->file_name, string_get_cstr(filename));
+ string_clear(filename);
+ if((!strcmp(subghz->txrx->decoder_result->protocol->name, "RAW"))) {
+ //Load Raw TX
+ subghz->txrx->rx_key_state = SubGhzRxKeyStateRAWLoad;
+ scene_manager_next_scene(subghz->scene_manager, SubGhzSceneReadRAW);
+ } else {
+ //Load transmitter TX
+ scene_manager_next_scene(subghz->scene_manager, SubGhzSceneTransmitter);
+ }
} else {
- //Load transmitter TX
- scene_manager_next_scene(subghz->scene_manager, SubGhzSceneTransmitter);
+ //exit app
+ scene_manager_stop(subghz->scene_manager);
+ view_dispatcher_stop(subghz->view_dispatcher);
}
} else {
if(load_database) {