mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-07-08 23:08:10 -07:00
oh no
This commit is contained in:
@@ -121,14 +121,14 @@ bool flipper_format_stream_seek_to_key(Stream* stream, const char* key, bool str
|
||||
return found;
|
||||
}
|
||||
|
||||
static bool flipper_format_stream_read_value(Stream* stream, string_t value, bool* last) {
|
||||
static bool flipper_format_stream_read_value(Stream* stream, FuriString* value, bool* last) {
|
||||
enum { LeadingSpace, ReadValue, TrailingSpace } state = LeadingSpace;
|
||||
const size_t buffer_size = 32;
|
||||
uint8_t buffer[buffer_size];
|
||||
bool result = false;
|
||||
bool error = false;
|
||||
|
||||
string_reset(value);
|
||||
furi_string_reset(value);
|
||||
|
||||
while(true) {
|
||||
size_t was_read = stream_read(stream, buffer, buffer_size);
|
||||
@@ -154,7 +154,7 @@ static bool flipper_format_stream_read_value(Stream* stream, string_t value, boo
|
||||
break;
|
||||
} else {
|
||||
state = ReadValue;
|
||||
string_push_back(value, data);
|
||||
furi_string_push_back(value, data);
|
||||
}
|
||||
} else if(state == ReadValue) {
|
||||
if(flipper_format_stream_is_space(data)) {
|
||||
@@ -168,7 +168,7 @@ static bool flipper_format_stream_read_value(Stream* stream, string_t value, boo
|
||||
}
|
||||
break;
|
||||
} else {
|
||||
string_push_back(value, data);
|
||||
furi_string_push_back(value, data);
|
||||
}
|
||||
} else if(state == TrailingSpace) {
|
||||
if(flipper_format_stream_is_space(data)) {
|
||||
|
||||
@@ -64,7 +64,7 @@ bool mf_classic_dict_get_next_key_str(MfClassicDict* dict, FuriString* key);
|
||||
*/
|
||||
bool mf_classic_dict_get_key_at_index(MfClassicDict* dict, uint64_t* key, uint32_t target);
|
||||
|
||||
/** Get key at target offset as string_t
|
||||
/** Get key at target offset as FuriString*
|
||||
*
|
||||
* @param dict MfClassicDict instance
|
||||
* @param[out] key Found key destination buffer
|
||||
|
||||
@@ -91,9 +91,9 @@ void mfkey32_set_callback(Mfkey32* instance, Mfkey32ParseDataCallback callback,
|
||||
}
|
||||
|
||||
static bool mfkey32_write_params(Mfkey32* instance, Mfkey32Params* params) {
|
||||
string_t str;
|
||||
string_init_printf(
|
||||
str,
|
||||
FuriString* str;
|
||||
|
||||
str = furi_string_alloc_printf(
|
||||
"Sec %d key %c cuid %08x nt0 %08x nr0 %08x ar0 %08x nt1 %08x nr1 %08x ar1 %08x\n",
|
||||
params->sector,
|
||||
params->key == MfClassicKeyA ? 'A' : 'B',
|
||||
|
||||
@@ -950,9 +950,9 @@ static bool nfc_device_save_mifare_classic_keys(NfcDevice* dev) {
|
||||
}
|
||||
if(!key_save_success) break;
|
||||
if(FURI_BIT(data->key_b_mask, i)) {
|
||||
string_printf(temp_str, "Key B sector %d", i);
|
||||
key_save_success =
|
||||
flipper_format_write_hex(file, string_get_cstr(temp_str), sec_tr->key_b, 6);
|
||||
furi_string_printf(temp_str, "Key B sector %d", i);
|
||||
key_save_success = flipper_format_write_hex(
|
||||
file, furi_string_get_cstr(temp_str), sec_tr->key_b, 6);
|
||||
}
|
||||
}
|
||||
save_success = key_save_success;
|
||||
|
||||
@@ -19,6 +19,8 @@ SubGhzEnvironment* subghz_environment_alloc() {
|
||||
void subghz_environment_free(SubGhzEnvironment* instance) {
|
||||
furi_assert(instance);
|
||||
|
||||
instance->came_atomo_rainbow_table_file_name = NULL;
|
||||
instance->nice_flor_s_rainbow_table_file_name = NULL;
|
||||
subghz_keystore_free(instance->keystore);
|
||||
|
||||
free(instance);
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include "faac_slh.h"
|
||||
#include "../subghz_keystore.h"
|
||||
#include <m-string.h>
|
||||
#include <m-array.h>
|
||||
#include "keeloq_common.h"
|
||||
#include "../blocks/const.h"
|
||||
@@ -131,7 +130,7 @@ static bool subghz_protocol_faac_slh_gen_data(SubGhzProtocolEncoderFaacSLH* inst
|
||||
}
|
||||
for
|
||||
M_EACH(manufacture_code, *subghz_keystore_get_data(instance->keystore), SubGhzKeyArray_t) {
|
||||
res = strcmp(string_get_cstr(manufacture_code->name), instance->manufacture_name);
|
||||
res = strcmp(furi_string_get_cstr(manufacture_code->name), instance->manufacture_name);
|
||||
if(res == 0) {
|
||||
switch(manufacture_code->type) {
|
||||
case KEELOQ_LEARNING_FAAC:
|
||||
@@ -409,7 +408,7 @@ static void subghz_protocol_faac_slh_check_remote_controller(
|
||||
man = subghz_protocol_keeloq_common_faac_learning(
|
||||
instance->seed, manufacture_code->key);
|
||||
decrypt = subghz_protocol_keeloq_common_decrypt(code_hop, man);
|
||||
*manufacture_name = string_get_cstr(manufacture_code->name);
|
||||
*manufacture_name = furi_string_get_cstr(manufacture_code->name);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -579,7 +579,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector(
|
||||
// Simple Learning
|
||||
decrypt = subghz_protocol_keeloq_common_decrypt(hop, manufacture_code->key);
|
||||
if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) {
|
||||
*manufacture_name = string_get_cstr(manufacture_code->name);
|
||||
*manufacture_name = furi_string_get_cstr(manufacture_code->name);
|
||||
mfname = *manufacture_name;
|
||||
return 1;
|
||||
}
|
||||
@@ -590,7 +590,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector(
|
||||
man = subghz_protocol_keeloq_common_normal_learning(fix, manufacture_code->key);
|
||||
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man);
|
||||
if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) {
|
||||
*manufacture_name = string_get_cstr(manufacture_code->name);
|
||||
*manufacture_name = furi_string_get_cstr(manufacture_code->name);
|
||||
mfname = *manufacture_name;
|
||||
return 1;
|
||||
}
|
||||
@@ -600,7 +600,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector(
|
||||
fix, instance->seed, manufacture_code->key);
|
||||
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man);
|
||||
if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) {
|
||||
*manufacture_name = string_get_cstr(manufacture_code->name);
|
||||
*manufacture_name = furi_string_get_cstr(manufacture_code->name);
|
||||
mfname = *manufacture_name;
|
||||
return 1;
|
||||
}
|
||||
@@ -610,7 +610,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector(
|
||||
fix, manufacture_code->key);
|
||||
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man);
|
||||
if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) {
|
||||
*manufacture_name = string_get_cstr(manufacture_code->name);
|
||||
*manufacture_name = furi_string_get_cstr(manufacture_code->name);
|
||||
mfname = *manufacture_name;
|
||||
return 1;
|
||||
}
|
||||
@@ -620,7 +620,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector(
|
||||
fix, manufacture_code->key);
|
||||
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man);
|
||||
if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) {
|
||||
*manufacture_name = string_get_cstr(manufacture_code->name);
|
||||
*manufacture_name = furi_string_get_cstr(manufacture_code->name);
|
||||
mfname = *manufacture_name;
|
||||
return 1;
|
||||
}
|
||||
@@ -629,7 +629,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector(
|
||||
// Simple Learning
|
||||
decrypt = subghz_protocol_keeloq_common_decrypt(hop, manufacture_code->key);
|
||||
if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) {
|
||||
*manufacture_name = string_get_cstr(manufacture_code->name);
|
||||
*manufacture_name = furi_string_get_cstr(manufacture_code->name);
|
||||
mfname = *manufacture_name;
|
||||
kl_type = 1;
|
||||
return 1;
|
||||
@@ -645,7 +645,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector(
|
||||
|
||||
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man_rev);
|
||||
if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) {
|
||||
*manufacture_name = string_get_cstr(manufacture_code->name);
|
||||
*manufacture_name = furi_string_get_cstr(manufacture_code->name);
|
||||
mfname = *manufacture_name;
|
||||
kl_type = 1;
|
||||
return 1;
|
||||
@@ -657,7 +657,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector(
|
||||
man = subghz_protocol_keeloq_common_normal_learning(fix, manufacture_code->key);
|
||||
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man);
|
||||
if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) {
|
||||
*manufacture_name = string_get_cstr(manufacture_code->name);
|
||||
*manufacture_name = furi_string_get_cstr(manufacture_code->name);
|
||||
mfname = *manufacture_name;
|
||||
kl_type = 2;
|
||||
return 1;
|
||||
@@ -667,7 +667,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector(
|
||||
man = subghz_protocol_keeloq_common_normal_learning(fix, man_rev);
|
||||
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man);
|
||||
if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) {
|
||||
*manufacture_name = string_get_cstr(manufacture_code->name);
|
||||
*manufacture_name = furi_string_get_cstr(manufacture_code->name);
|
||||
mfname = *manufacture_name;
|
||||
kl_type = 2;
|
||||
return 1;
|
||||
@@ -678,7 +678,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector(
|
||||
fix, instance->seed, manufacture_code->key);
|
||||
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man);
|
||||
if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) {
|
||||
*manufacture_name = string_get_cstr(manufacture_code->name);
|
||||
*manufacture_name = furi_string_get_cstr(manufacture_code->name);
|
||||
mfname = *manufacture_name;
|
||||
kl_type = 3;
|
||||
return 1;
|
||||
@@ -688,7 +688,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector(
|
||||
man = subghz_protocol_keeloq_common_secure_learning(fix, instance->seed, man_rev);
|
||||
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man);
|
||||
if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) {
|
||||
*manufacture_name = string_get_cstr(manufacture_code->name);
|
||||
*manufacture_name = furi_string_get_cstr(manufacture_code->name);
|
||||
mfname = *manufacture_name;
|
||||
kl_type = 3;
|
||||
return 1;
|
||||
@@ -699,7 +699,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector(
|
||||
fix, manufacture_code->key);
|
||||
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man);
|
||||
if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) {
|
||||
*manufacture_name = string_get_cstr(manufacture_code->name);
|
||||
*manufacture_name = furi_string_get_cstr(manufacture_code->name);
|
||||
mfname = *manufacture_name;
|
||||
kl_type = 4;
|
||||
return 1;
|
||||
@@ -709,7 +709,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector(
|
||||
man = subghz_protocol_keeloq_common_magic_xor_type1_learning(fix, man_rev);
|
||||
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man);
|
||||
if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) {
|
||||
*manufacture_name = string_get_cstr(manufacture_code->name);
|
||||
*manufacture_name = furi_string_get_cstr(manufacture_code->name);
|
||||
mfname = *manufacture_name;
|
||||
kl_type = 4;
|
||||
return 1;
|
||||
@@ -723,14 +723,14 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector(
|
||||
} else {
|
||||
for
|
||||
M_EACH(manufacture_code, *subghz_keystore_get_data(keystore), SubGhzKeyArray_t) {
|
||||
res = strcmp(string_get_cstr(manufacture_code->name), mfname);
|
||||
res = strcmp(furi_string_get_cstr(manufacture_code->name), mfname);
|
||||
if(res == 0) {
|
||||
switch(manufacture_code->type) {
|
||||
case KEELOQ_LEARNING_SIMPLE:
|
||||
// Simple Learning
|
||||
decrypt = subghz_protocol_keeloq_common_decrypt(hop, manufacture_code->key);
|
||||
if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) {
|
||||
*manufacture_name = string_get_cstr(manufacture_code->name);
|
||||
*manufacture_name = furi_string_get_cstr(manufacture_code->name);
|
||||
mfname = *manufacture_name;
|
||||
return 1;
|
||||
}
|
||||
@@ -742,7 +742,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector(
|
||||
subghz_protocol_keeloq_common_normal_learning(fix, manufacture_code->key);
|
||||
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man);
|
||||
if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) {
|
||||
*manufacture_name = string_get_cstr(manufacture_code->name);
|
||||
*manufacture_name = furi_string_get_cstr(manufacture_code->name);
|
||||
mfname = *manufacture_name;
|
||||
return 1;
|
||||
}
|
||||
@@ -752,7 +752,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector(
|
||||
fix, instance->seed, manufacture_code->key);
|
||||
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man);
|
||||
if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) {
|
||||
*manufacture_name = string_get_cstr(manufacture_code->name);
|
||||
*manufacture_name = furi_string_get_cstr(manufacture_code->name);
|
||||
mfname = *manufacture_name;
|
||||
return 1;
|
||||
}
|
||||
@@ -762,7 +762,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector(
|
||||
fix, manufacture_code->key);
|
||||
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man);
|
||||
if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) {
|
||||
*manufacture_name = string_get_cstr(manufacture_code->name);
|
||||
*manufacture_name = furi_string_get_cstr(manufacture_code->name);
|
||||
mfname = *manufacture_name;
|
||||
return 1;
|
||||
}
|
||||
@@ -772,7 +772,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector(
|
||||
fix, manufacture_code->key);
|
||||
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man);
|
||||
if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) {
|
||||
*manufacture_name = string_get_cstr(manufacture_code->name);
|
||||
*manufacture_name = furi_string_get_cstr(manufacture_code->name);
|
||||
mfname = *manufacture_name;
|
||||
return 1;
|
||||
}
|
||||
@@ -781,7 +781,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector(
|
||||
// Simple Learning
|
||||
decrypt = subghz_protocol_keeloq_common_decrypt(hop, manufacture_code->key);
|
||||
if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) {
|
||||
*manufacture_name = string_get_cstr(manufacture_code->name);
|
||||
*manufacture_name = furi_string_get_cstr(manufacture_code->name);
|
||||
mfname = *manufacture_name;
|
||||
kl_type = 1;
|
||||
return 1;
|
||||
@@ -795,7 +795,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector(
|
||||
}
|
||||
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man_rev);
|
||||
if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) {
|
||||
*manufacture_name = string_get_cstr(manufacture_code->name);
|
||||
*manufacture_name = furi_string_get_cstr(manufacture_code->name);
|
||||
mfname = *manufacture_name;
|
||||
kl_type = 1;
|
||||
return 1;
|
||||
@@ -807,7 +807,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector(
|
||||
subghz_protocol_keeloq_common_normal_learning(fix, manufacture_code->key);
|
||||
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man);
|
||||
if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) {
|
||||
*manufacture_name = string_get_cstr(manufacture_code->name);
|
||||
*manufacture_name = furi_string_get_cstr(manufacture_code->name);
|
||||
mfname = *manufacture_name;
|
||||
kl_type = 2;
|
||||
return 1;
|
||||
@@ -817,7 +817,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector(
|
||||
man = subghz_protocol_keeloq_common_normal_learning(fix, man_rev);
|
||||
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man);
|
||||
if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) {
|
||||
*manufacture_name = string_get_cstr(manufacture_code->name);
|
||||
*manufacture_name = furi_string_get_cstr(manufacture_code->name);
|
||||
mfname = *manufacture_name;
|
||||
kl_type = 2;
|
||||
return 1;
|
||||
@@ -828,7 +828,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector(
|
||||
fix, instance->seed, manufacture_code->key);
|
||||
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man);
|
||||
if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) {
|
||||
*manufacture_name = string_get_cstr(manufacture_code->name);
|
||||
*manufacture_name = furi_string_get_cstr(manufacture_code->name);
|
||||
mfname = *manufacture_name;
|
||||
kl_type = 3;
|
||||
return 1;
|
||||
@@ -839,7 +839,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector(
|
||||
fix, instance->seed, man_rev);
|
||||
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man);
|
||||
if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) {
|
||||
*manufacture_name = string_get_cstr(manufacture_code->name);
|
||||
*manufacture_name = furi_string_get_cstr(manufacture_code->name);
|
||||
mfname = *manufacture_name;
|
||||
kl_type = 3;
|
||||
return 1;
|
||||
@@ -850,7 +850,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector(
|
||||
fix, manufacture_code->key);
|
||||
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man);
|
||||
if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) {
|
||||
*manufacture_name = string_get_cstr(manufacture_code->name);
|
||||
*manufacture_name = furi_string_get_cstr(manufacture_code->name);
|
||||
mfname = *manufacture_name;
|
||||
kl_type = 4;
|
||||
return 1;
|
||||
@@ -860,7 +860,7 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector(
|
||||
man = subghz_protocol_keeloq_common_magic_xor_type1_learning(fix, man_rev);
|
||||
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man);
|
||||
if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) {
|
||||
*manufacture_name = string_get_cstr(manufacture_code->name);
|
||||
*manufacture_name = furi_string_get_cstr(manufacture_code->name);
|
||||
mfname = *manufacture_name;
|
||||
kl_type = 4;
|
||||
return 1;
|
||||
@@ -981,7 +981,7 @@ void subghz_protocol_decoder_keeloq_get_string(void* context, FuriString* output
|
||||
uint32_t code_found_reverse_lo = code_found_reverse & 0x00000000ffffffff;
|
||||
|
||||
if(strcmp(instance->manufacture_name, "BFT") == 0) {
|
||||
string_cat_printf(
|
||||
furi_string_cat_printf(
|
||||
output,
|
||||
"%s %dbit\r\n"
|
||||
"Key:%08lX%08lX\r\n"
|
||||
@@ -999,7 +999,7 @@ void subghz_protocol_decoder_keeloq_get_string(void* context, FuriString* output
|
||||
instance->manufacture_name,
|
||||
instance->generic.seed);
|
||||
} else {
|
||||
string_cat_printf(
|
||||
furi_string_cat_printf(
|
||||
output,
|
||||
"%s %dbit\r\n"
|
||||
"Key:%08lX%08lX\r\n"
|
||||
|
||||
+10
-10
@@ -254,7 +254,7 @@ void* subghz_protocol_decoder_raw_alloc(SubGhzEnvironment* environment) {
|
||||
instance->file_is_open = RAWFileIsOpenClose;
|
||||
instance->postroll_frames = 0;
|
||||
instance->rssi_threshold = SUBGHZ_AUTO_DETECT_RAW_THRESHOLD;
|
||||
string_init(instance->file_name);
|
||||
instance->file_name = furi_string_alloc();
|
||||
|
||||
return instance;
|
||||
}
|
||||
@@ -262,7 +262,7 @@ void* subghz_protocol_decoder_raw_alloc(SubGhzEnvironment* environment) {
|
||||
void subghz_protocol_decoder_raw_free(void* context) {
|
||||
furi_assert(context);
|
||||
SubGhzProtocolDecoderRAW* instance = context;
|
||||
string_clear(instance->file_name);
|
||||
furi_string_free(instance->file_name);
|
||||
if(instance->upload_raw != NULL) {
|
||||
free(instance->upload_raw);
|
||||
instance->upload_raw = NULL;
|
||||
@@ -352,12 +352,12 @@ uint8_t subghz_protocol_decoder_raw_get_hash_data(void* context) {
|
||||
&instance->decoder, (instance->decoder.decode_count_bit / 8) + 1);
|
||||
}
|
||||
|
||||
void subghz_protocol_decoder_raw_get_string(void* context, string_t output) {
|
||||
void subghz_protocol_decoder_raw_get_string(void* context, FuriString* output) {
|
||||
furi_assert(context);
|
||||
//SubGhzProtocolDecoderRAW* instance = context;
|
||||
UNUSED(context);
|
||||
//ToDo no use
|
||||
string_cat_printf(output, "RAW Data");
|
||||
furi_string_cat_printf(output, "RAW Data");
|
||||
}
|
||||
|
||||
void* subghz_protocol_encoder_raw_alloc(SubGhzEnvironment* environment) {
|
||||
@@ -443,8 +443,8 @@ bool subghz_protocol_decoder_raw_serialize(
|
||||
if(instance->auto_mode) {
|
||||
furi_assert(instance);
|
||||
bool res = false;
|
||||
string_t temp_str;
|
||||
string_init(temp_str);
|
||||
FuriString* temp_str;
|
||||
temp_str = furi_string_alloc();
|
||||
|
||||
do {
|
||||
stream_clean(flipper_format_get_raw_stream(flipper_format));
|
||||
@@ -458,13 +458,13 @@ bool subghz_protocol_decoder_raw_serialize(
|
||||
FURI_LOG_E(TAG, "Unable to add Frequency");
|
||||
break;
|
||||
}
|
||||
subghz_block_generic_get_preset_name(string_get_cstr(preset->name), temp_str);
|
||||
subghz_block_generic_get_preset_name(furi_string_get_cstr(preset->name), temp_str);
|
||||
if(!flipper_format_write_string_cstr(
|
||||
flipper_format, "Preset", string_get_cstr(temp_str))) {
|
||||
flipper_format, "Preset", furi_string_get_cstr(temp_str))) {
|
||||
FURI_LOG_E(TAG, "Unable to add Preset");
|
||||
break;
|
||||
}
|
||||
if(!strcmp(string_get_cstr(temp_str), "FuriHalSubGhzPresetCustom")) {
|
||||
if(!strcmp(furi_string_get_cstr(temp_str), "FuriHalSubGhzPresetCustom")) {
|
||||
if(!flipper_format_write_string_cstr(
|
||||
flipper_format, "Custom_preset_module", "CC1101")) {
|
||||
FURI_LOG_E(TAG, "Unable to add Custom_preset_module");
|
||||
@@ -491,7 +491,7 @@ bool subghz_protocol_decoder_raw_serialize(
|
||||
}
|
||||
res = true;
|
||||
} while(false);
|
||||
string_clear(temp_str);
|
||||
furi_string_free(temp_str);
|
||||
return res;
|
||||
} else {
|
||||
return false;
|
||||
|
||||
@@ -149,7 +149,7 @@ static bool
|
||||
} else {
|
||||
for
|
||||
M_EACH(manufacture_code, *subghz_keystore_get_data(instance->keystore), SubGhzKeyArray_t) {
|
||||
res = strcmp(string_get_cstr(manufacture_code->name), instance->manufacture_name);
|
||||
res = strcmp(furi_string_get_cstr(manufacture_code->name), instance->manufacture_name);
|
||||
if(res == 0) {
|
||||
switch(manufacture_code->type) {
|
||||
case KEELOQ_LEARNING_SIMPLE:
|
||||
@@ -487,7 +487,7 @@ static uint8_t subghz_protocol_star_line_check_remote_controller_selector(
|
||||
// Simple Learning
|
||||
decrypt = subghz_protocol_keeloq_common_decrypt(hop, manufacture_code->key);
|
||||
if(subghz_protocol_star_line_check_decrypt(instance, decrypt, btn, end_serial)) {
|
||||
*manufacture_name = string_get_cstr(manufacture_code->name);
|
||||
*manufacture_name = furi_string_get_cstr(manufacture_code->name);
|
||||
mfname = *manufacture_name;
|
||||
return 1;
|
||||
}
|
||||
@@ -499,7 +499,7 @@ static uint8_t subghz_protocol_star_line_check_remote_controller_selector(
|
||||
subghz_protocol_keeloq_common_normal_learning(fix, manufacture_code->key);
|
||||
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man_normal_learning);
|
||||
if(subghz_protocol_star_line_check_decrypt(instance, decrypt, btn, end_serial)) {
|
||||
*manufacture_name = string_get_cstr(manufacture_code->name);
|
||||
*manufacture_name = furi_string_get_cstr(manufacture_code->name);
|
||||
mfname = *manufacture_name;
|
||||
return 1;
|
||||
}
|
||||
@@ -508,7 +508,7 @@ static uint8_t subghz_protocol_star_line_check_remote_controller_selector(
|
||||
// Simple Learning
|
||||
decrypt = subghz_protocol_keeloq_common_decrypt(hop, manufacture_code->key);
|
||||
if(subghz_protocol_star_line_check_decrypt(instance, decrypt, btn, end_serial)) {
|
||||
*manufacture_name = string_get_cstr(manufacture_code->name);
|
||||
*manufacture_name = furi_string_get_cstr(manufacture_code->name);
|
||||
mfname = *manufacture_name;
|
||||
kl_type = 1;
|
||||
return 1;
|
||||
@@ -522,7 +522,7 @@ static uint8_t subghz_protocol_star_line_check_remote_controller_selector(
|
||||
}
|
||||
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man_rev);
|
||||
if(subghz_protocol_star_line_check_decrypt(instance, decrypt, btn, end_serial)) {
|
||||
*manufacture_name = string_get_cstr(manufacture_code->name);
|
||||
*manufacture_name = furi_string_get_cstr(manufacture_code->name);
|
||||
mfname = *manufacture_name;
|
||||
kl_type = 1;
|
||||
return 1;
|
||||
@@ -534,7 +534,7 @@ static uint8_t subghz_protocol_star_line_check_remote_controller_selector(
|
||||
subghz_protocol_keeloq_common_normal_learning(fix, manufacture_code->key);
|
||||
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man_normal_learning);
|
||||
if(subghz_protocol_star_line_check_decrypt(instance, decrypt, btn, end_serial)) {
|
||||
*manufacture_name = string_get_cstr(manufacture_code->name);
|
||||
*manufacture_name = furi_string_get_cstr(manufacture_code->name);
|
||||
mfname = *manufacture_name;
|
||||
kl_type = 2;
|
||||
return 1;
|
||||
@@ -543,7 +543,7 @@ static uint8_t subghz_protocol_star_line_check_remote_controller_selector(
|
||||
man_normal_learning = subghz_protocol_keeloq_common_normal_learning(fix, man_rev);
|
||||
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man_normal_learning);
|
||||
if(subghz_protocol_star_line_check_decrypt(instance, decrypt, btn, end_serial)) {
|
||||
*manufacture_name = string_get_cstr(manufacture_code->name);
|
||||
*manufacture_name = furi_string_get_cstr(manufacture_code->name);
|
||||
mfname = *manufacture_name;
|
||||
kl_type = 2;
|
||||
return 1;
|
||||
@@ -556,7 +556,7 @@ static uint8_t subghz_protocol_star_line_check_remote_controller_selector(
|
||||
} else {
|
||||
for
|
||||
M_EACH(manufacture_code, *subghz_keystore_get_data(keystore), SubGhzKeyArray_t) {
|
||||
res = strcmp(string_get_cstr(manufacture_code->name), mfname);
|
||||
res = strcmp(furi_string_get_cstr(manufacture_code->name), mfname);
|
||||
if(res == 0) {
|
||||
switch(manufacture_code->type) {
|
||||
case KEELOQ_LEARNING_SIMPLE:
|
||||
@@ -564,7 +564,7 @@ static uint8_t subghz_protocol_star_line_check_remote_controller_selector(
|
||||
decrypt = subghz_protocol_keeloq_common_decrypt(hop, manufacture_code->key);
|
||||
if(subghz_protocol_star_line_check_decrypt(
|
||||
instance, decrypt, btn, end_serial)) {
|
||||
*manufacture_name = string_get_cstr(manufacture_code->name);
|
||||
*manufacture_name = furi_string_get_cstr(manufacture_code->name);
|
||||
mfname = *manufacture_name;
|
||||
return 1;
|
||||
}
|
||||
@@ -577,7 +577,7 @@ static uint8_t subghz_protocol_star_line_check_remote_controller_selector(
|
||||
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man_normal_learning);
|
||||
if(subghz_protocol_star_line_check_decrypt(
|
||||
instance, decrypt, btn, end_serial)) {
|
||||
*manufacture_name = string_get_cstr(manufacture_code->name);
|
||||
*manufacture_name = furi_string_get_cstr(manufacture_code->name);
|
||||
mfname = *manufacture_name;
|
||||
return 1;
|
||||
}
|
||||
@@ -587,7 +587,7 @@ static uint8_t subghz_protocol_star_line_check_remote_controller_selector(
|
||||
decrypt = subghz_protocol_keeloq_common_decrypt(hop, manufacture_code->key);
|
||||
if(subghz_protocol_star_line_check_decrypt(
|
||||
instance, decrypt, btn, end_serial)) {
|
||||
*manufacture_name = string_get_cstr(manufacture_code->name);
|
||||
*manufacture_name = furi_string_get_cstr(manufacture_code->name);
|
||||
mfname = *manufacture_name;
|
||||
kl_type = 1;
|
||||
return 1;
|
||||
@@ -602,7 +602,7 @@ static uint8_t subghz_protocol_star_line_check_remote_controller_selector(
|
||||
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man_rev);
|
||||
if(subghz_protocol_star_line_check_decrypt(
|
||||
instance, decrypt, btn, end_serial)) {
|
||||
*manufacture_name = string_get_cstr(manufacture_code->name);
|
||||
*manufacture_name = furi_string_get_cstr(manufacture_code->name);
|
||||
mfname = *manufacture_name;
|
||||
kl_type = 1;
|
||||
return 1;
|
||||
@@ -615,7 +615,7 @@ static uint8_t subghz_protocol_star_line_check_remote_controller_selector(
|
||||
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man_normal_learning);
|
||||
if(subghz_protocol_star_line_check_decrypt(
|
||||
instance, decrypt, btn, end_serial)) {
|
||||
*manufacture_name = string_get_cstr(manufacture_code->name);
|
||||
*manufacture_name = furi_string_get_cstr(manufacture_code->name);
|
||||
mfname = *manufacture_name;
|
||||
kl_type = 2;
|
||||
return 1;
|
||||
@@ -627,7 +627,7 @@ static uint8_t subghz_protocol_star_line_check_remote_controller_selector(
|
||||
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man_normal_learning);
|
||||
if(subghz_protocol_star_line_check_decrypt(
|
||||
instance, decrypt, btn, end_serial)) {
|
||||
*manufacture_name = string_get_cstr(manufacture_code->name);
|
||||
*manufacture_name = furi_string_get_cstr(manufacture_code->name);
|
||||
mfname = *manufacture_name;
|
||||
kl_type = 2;
|
||||
return 1;
|
||||
|
||||
@@ -81,14 +81,14 @@ bool subghz_file_encoder_worker_data_parse(SubGhzFileEncoderWorker* instance, co
|
||||
|
||||
void subghz_file_encoder_worker_get_text_progress(
|
||||
SubGhzFileEncoderWorker* instance,
|
||||
string_t output) {
|
||||
FuriString* output) {
|
||||
UNUSED(output);
|
||||
Stream* stream = flipper_format_get_raw_stream(instance->flipper_format);
|
||||
size_t total_size = stream_size(stream);
|
||||
size_t current_offset = stream_tell(stream);
|
||||
size_t buffer_avail = xStreamBufferBytesAvailable(instance->stream);
|
||||
|
||||
string_printf(output, "%03u%%", 100 * (current_offset - buffer_avail) / total_size);
|
||||
furi_string_printf(output, "%03u%%", 100 * (current_offset - buffer_avail) / total_size);
|
||||
}
|
||||
|
||||
LevelDuration subghz_file_encoder_worker_get_level_duration(void* context) {
|
||||
|
||||
@@ -35,7 +35,7 @@ void subghz_file_encoder_worker_free(SubGhzFileEncoderWorker* instance);
|
||||
*/
|
||||
void subghz_file_encoder_worker_get_text_progress(
|
||||
SubGhzFileEncoderWorker* instance,
|
||||
string_t output);
|
||||
FuriString* output);
|
||||
|
||||
/**
|
||||
* Getting the level and duration of the upload to be loaded into DMA.
|
||||
|
||||
Reference in New Issue
Block a user