mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-11-23 13:03:13 +00:00
[FL-2410] SubGhz: fix launching an incorrect Sub-GHz key from the archive. (#1080)
This commit is contained in:
parent
0bf2702210
commit
cb7d43f7e1
2 changed files with 18 additions and 13 deletions
|
@ -309,20 +309,26 @@ int32_t subghz_app(void* p) {
|
||||||
subghz_environment_load_keystore(
|
subghz_environment_load_keystore(
|
||||||
subghz->txrx->environment, "/ext/subghz/assets/keeloq_mfcodes_user");
|
subghz->txrx->environment, "/ext/subghz/assets/keeloq_mfcodes_user");
|
||||||
// Check argument and run corresponding scene
|
// Check argument and run corresponding scene
|
||||||
if(p && subghz_key_load(subghz, p)) {
|
if(p) {
|
||||||
string_t filename;
|
if(subghz_key_load(subghz, p)) {
|
||||||
string_init(filename);
|
string_t filename;
|
||||||
|
string_init(filename);
|
||||||
|
|
||||||
path_extract_filename_no_ext(p, filename);
|
path_extract_filename_no_ext(p, filename);
|
||||||
strcpy(subghz->file_name, string_get_cstr(filename));
|
strcpy(subghz->file_name, string_get_cstr(filename));
|
||||||
string_clear(filename);
|
string_clear(filename);
|
||||||
if((!strcmp(subghz->txrx->decoder_result->protocol->name, "RAW"))) {
|
if((!strcmp(subghz->txrx->decoder_result->protocol->name, "RAW"))) {
|
||||||
//Load Raw TX
|
//Load Raw TX
|
||||||
subghz->txrx->rx_key_state = SubGhzRxKeyStateRAWLoad;
|
subghz->txrx->rx_key_state = SubGhzRxKeyStateRAWLoad;
|
||||||
scene_manager_next_scene(subghz->scene_manager, SubGhzSceneReadRAW);
|
scene_manager_next_scene(subghz->scene_manager, SubGhzSceneReadRAW);
|
||||||
|
} else {
|
||||||
|
//Load transmitter TX
|
||||||
|
scene_manager_next_scene(subghz->scene_manager, SubGhzSceneTransmitter);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
//Load transmitter TX
|
//exit app
|
||||||
scene_manager_next_scene(subghz->scene_manager, SubGhzSceneTransmitter);
|
scene_manager_stop(subghz->scene_manager);
|
||||||
|
view_dispatcher_stop(subghz->view_dispatcher);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if(load_database) {
|
if(load_database) {
|
||||||
|
|
|
@ -277,7 +277,6 @@ bool subghz_key_load(SubGhz* subghz, const char* file_path) {
|
||||||
}
|
}
|
||||||
|
|
||||||
string_clear(temp_str);
|
string_clear(temp_str);
|
||||||
//string_clear(path);
|
|
||||||
flipper_format_free(fff_data_file);
|
flipper_format_free(fff_data_file);
|
||||||
furi_record_close("storage");
|
furi_record_close("storage");
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue