[FL-2706, FL-2709] SubGhz: checking saved key files for length (#1485)
* [FL-2706] SubGhz: checking saved key files for length * SubGhz: fix RAW file upload error * [FL-2709] GubGhz: RAW screen fix Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
@@ -514,7 +514,11 @@ bool subghz_protocol_encoder_secplus_v2_deserialize(void* context, FlipperFormat
|
||||
FURI_LOG_E(TAG, "Deserialize error");
|
||||
break;
|
||||
}
|
||||
|
||||
if(instance->generic.data_count_bit !=
|
||||
subghz_protocol_secplus_v2_const.min_count_bit_for_found) {
|
||||
FURI_LOG_E(TAG, "Wrong number of bits in key");
|
||||
break;
|
||||
}
|
||||
uint8_t key_data[sizeof(uint64_t)] = {0};
|
||||
if(!flipper_format_read_hex(
|
||||
flipper_format, "Secplus_packet_1", key_data, sizeof(uint64_t))) {
|
||||
@@ -689,7 +693,7 @@ void subghz_protocol_decoder_secplus_v2_feed(void* context, bool level, uint32_t
|
||||
} else if(
|
||||
duration >= (uint32_t)(subghz_protocol_secplus_v2_const.te_long * 2 +
|
||||
subghz_protocol_secplus_v2_const.te_delta)) {
|
||||
if(instance->decoder.decode_count_bit >=
|
||||
if(instance->decoder.decode_count_bit ==
|
||||
subghz_protocol_secplus_v2_const.min_count_bit_for_found) {
|
||||
instance->generic.data = instance->decoder.decode_data;
|
||||
instance->generic.data_count_bit = instance->decoder.decode_count_bit;
|
||||
@@ -782,6 +786,11 @@ bool subghz_protocol_decoder_secplus_v2_deserialize(void* context, FlipperFormat
|
||||
FURI_LOG_E(TAG, "Deserialize error");
|
||||
break;
|
||||
}
|
||||
if(instance->generic.data_count_bit !=
|
||||
subghz_protocol_secplus_v2_const.min_count_bit_for_found) {
|
||||
FURI_LOG_E(TAG, "Wrong number of bits in key");
|
||||
break;
|
||||
}
|
||||
if(!flipper_format_rewind(flipper_format)) {
|
||||
FURI_LOG_E(TAG, "Rewind error");
|
||||
break;
|
||||
|
Reference in New Issue
Block a user