1
mirror of https://github.com/DarkFlippers/unleashed-firmware.git synced 2025-12-12 20:49:49 +04:00

Remove extra furi logs

This commit is contained in:
r3df0xx
2022-04-28 13:29:32 +03:00
parent 7ee400182c
commit 7038a88655
5 changed files with 3 additions and 65 deletions

View File

@@ -114,7 +114,6 @@ void subghz_protocol_encoder_faac_slh_free(void* context) {
static bool subghz_protocol_faac_slh_gen_data(SubGhzProtocolEncoderFaacSLH* instance) { static bool subghz_protocol_faac_slh_gen_data(SubGhzProtocolEncoderFaacSLH* instance) {
instance->generic.cnt++; instance->generic.cnt++;
FURI_LOG_I(TAG, "SEED (gen_data): %8X\n", instance->generic.seed);
uint32_t fix = instance->generic.serial << 4 | instance->generic.btn; uint32_t fix = instance->generic.serial << 4 | instance->generic.btn;
uint32_t hop = 0; uint32_t hop = 0;
uint32_t decrypt = 0; uint32_t decrypt = 0;
@@ -140,17 +139,8 @@ static bool subghz_protocol_faac_slh_gen_data(SubGhzProtocolEncoderFaacSLH* inst
switch(manufacture_code->type) { switch(manufacture_code->type) {
case KEELOQ_LEARNING_FAAC: case KEELOQ_LEARNING_FAAC:
//FAAC Learning //FAAC Learning
man = man = subghz_protocol_keeloq_common_faac_learning(instance->generic.seed, manufacture_code->key);
subghz_protocol_keeloq_common_faac_learning(instance->generic.seed, manufacture_code->key);
uint32_t hi = manufacture_code->key >> 32;
uint32_t lo = manufacture_code->key & 0xFFFFFFFF;
FURI_LOG_I(TAG, "mfkey: %08lX%08lX mf: %s\n", hi, lo, manufacture_code->name);
FURI_LOG_I(TAG, "SEED (encrypt): %8X\n", instance->generic.seed);
uint32_t mlhi = man >> 32;
uint32_t mllo = man & 0xFFFFFFFF;
FURI_LOG_I(TAG, "man_learning: %8X%8X\n", mlhi, mllo);
hop = subghz_protocol_keeloq_common_encrypt(decrypt, man); hop = subghz_protocol_keeloq_common_encrypt(decrypt, man);
FURI_LOG_I(TAG, "hop: %8X\n", hop);
break; break;
} }
break; break;
@@ -182,7 +172,6 @@ bool subghz_protocol_faac_slh_create_data(
instance->manufacture_name = manufacture_name; instance->manufacture_name = manufacture_name;
instance->generic.data_count_bit = 64; instance->generic.data_count_bit = 64;
bool res = subghz_protocol_faac_slh_gen_data(instance); bool res = subghz_protocol_faac_slh_gen_data(instance);
FURI_LOG_I(TAG, "SEED (create_data): %8X\n", instance->generic.seed);
if(res) { if(res) {
res = subghz_block_generic_serialize(&instance->generic, flipper_format, frequency, preset); res = subghz_block_generic_serialize(&instance->generic, flipper_format, frequency, preset);
} }
@@ -418,24 +407,15 @@ static void subghz_protocol_faac_slh_check_remote_controller
for for
M_EACH(manufacture_code, *subghz_keystore_get_data(keystore), SubGhzKeyArray_t) { M_EACH(manufacture_code, *subghz_keystore_get_data(keystore), SubGhzKeyArray_t) {
uint32_t hi = manufacture_code->key >> 32;
uint32_t lo = manufacture_code->key & 0xFFFFFFFF;
switch(manufacture_code->type) { switch(manufacture_code->type) {
case KEELOQ_LEARNING_FAAC: case KEELOQ_LEARNING_FAAC:
// FAAC Learning // FAAC Learning
man = subghz_protocol_keeloq_common_faac_learning(instance->seed, manufacture_code->key); man = subghz_protocol_keeloq_common_faac_learning(instance->seed, manufacture_code->key);
FURI_LOG_I(TAG, "mfkey: %08lX%08lX mf: %s\n", hi, lo, manufacture_code->name);
FURI_LOG_I(TAG, "SEED (decrypt): %8X\n", instance->seed);
uint32_t mlhi = man >> 32;
uint32_t mllo = man & 0xFFFFFFFF;
FURI_LOG_I(TAG, "man_learning: %8X%8X\n", mlhi, mllo);
decrypt = subghz_protocol_keeloq_common_decrypt(code_hop, man); decrypt = subghz_protocol_keeloq_common_decrypt(code_hop, man);
FURI_LOG_I(TAG, "hop: %8X\n", code_hop);
*manufacture_name = string_get_cstr(manufacture_code->name); *manufacture_name = string_get_cstr(manufacture_code->name);
break; break;
} }
} }
instance->cnt = decrypt & 0xFFFF; instance->cnt = decrypt & 0xFFFF;
} }

View File

@@ -154,7 +154,6 @@ static bool subghz_protocol_keeloq_gen_data(SubGhzProtocolEncoderKeeloq* instanc
code_found_reverse = subghz_protocol_blocks_reverse_key( code_found_reverse = subghz_protocol_blocks_reverse_key(
instance->generic.data, instance->generic.data_count_bit); instance->generic.data, instance->generic.data_count_bit);
hop = code_found_reverse & 0x00000000ffffffff; hop = code_found_reverse & 0x00000000ffffffff;
FURI_LOG_I(TAG, "hop = %08lX", hop);
break; break;
} }
break; break;
@@ -479,13 +478,10 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector(
for for
M_EACH(manufacture_code, *subghz_keystore_get_data(keystore), SubGhzKeyArray_t) { M_EACH(manufacture_code, *subghz_keystore_get_data(keystore), SubGhzKeyArray_t) {
uint32_t hi = manufacture_code->key >> 32;
uint32_t lo = manufacture_code->key & 0xFFFFFFFF;
switch(manufacture_code->type) { switch(manufacture_code->type) {
case KEELOQ_LEARNING_SIMPLE: case KEELOQ_LEARNING_SIMPLE:
// Simple Learning // Simple Learning
decrypt = subghz_protocol_keeloq_common_decrypt(hop, manufacture_code->key); decrypt = subghz_protocol_keeloq_common_decrypt(hop, manufacture_code->key);
FURI_LOG_I(TAG, "mfkey: %08lX%08lX mf: %s", hi, lo, manufacture_code->name);
if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) { if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) {
*manufacture_name = string_get_cstr(manufacture_code->name); *manufacture_name = string_get_cstr(manufacture_code->name);
return 1; return 1;
@@ -495,7 +491,6 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector(
// Normal Learning // Normal Learning
// https://phreakerclub.com/forum/showpost.php?p=43557&postcount=37 // https://phreakerclub.com/forum/showpost.php?p=43557&postcount=37
man = subghz_protocol_keeloq_common_normal_learning(fix, manufacture_code->key); man = subghz_protocol_keeloq_common_normal_learning(fix, manufacture_code->key);
FURI_LOG_I(TAG, "mfkey: %08lX%08lX mf: %s", hi, lo, manufacture_code->name);
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man); decrypt = subghz_protocol_keeloq_common_decrypt(hop, man);
if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) { if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) {
*manufacture_name = string_get_cstr(manufacture_code->name); *manufacture_name = string_get_cstr(manufacture_code->name);
@@ -505,7 +500,6 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector(
case KEELOQ_LEARNING_SECURE: case KEELOQ_LEARNING_SECURE:
man = subghz_protocol_keeloq_common_secure_learning( man = subghz_protocol_keeloq_common_secure_learning(
fix, seed, manufacture_code->key); fix, seed, manufacture_code->key);
FURI_LOG_I(TAG, "mfkey: %08lX%08lX mf: %s", hi, lo, manufacture_code->name);
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man); decrypt = subghz_protocol_keeloq_common_decrypt(hop, man);
if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) { if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) {
*manufacture_name = string_get_cstr(manufacture_code->name); *manufacture_name = string_get_cstr(manufacture_code->name);
@@ -515,7 +509,6 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector(
case KEELOQ_LEARNING_MAGIC_XOR_TYPE_1: case KEELOQ_LEARNING_MAGIC_XOR_TYPE_1:
man = subghz_protocol_keeloq_common_magic_xor_type1_learning( man = subghz_protocol_keeloq_common_magic_xor_type1_learning(
fix, manufacture_code->key); fix, manufacture_code->key);
FURI_LOG_I(TAG, "mfkey: %08lX%08lX mf: %s", hi, lo, manufacture_code->name);
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man); decrypt = subghz_protocol_keeloq_common_decrypt(hop, man);
if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) { if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) {
*manufacture_name = string_get_cstr(manufacture_code->name); *manufacture_name = string_get_cstr(manufacture_code->name);
@@ -525,7 +518,6 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector(
case KEELOQ_LEARNING_UNKNOWN: case KEELOQ_LEARNING_UNKNOWN:
// Simple Learning // Simple Learning
decrypt = subghz_protocol_keeloq_common_decrypt(hop, manufacture_code->key); decrypt = subghz_protocol_keeloq_common_decrypt(hop, manufacture_code->key);
FURI_LOG_I(TAG, "mfkey: %08lX%08lX mf: %s", hi, lo, manufacture_code->name);
if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) { if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) {
*manufacture_name = string_get_cstr(manufacture_code->name); *manufacture_name = string_get_cstr(manufacture_code->name);
return 1; return 1;
@@ -546,7 +538,6 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector(
// Normal Learning // Normal Learning
// https://phreakerclub.com/forum/showpost.php?p=43557&postcount=37 // https://phreakerclub.com/forum/showpost.php?p=43557&postcount=37
man = subghz_protocol_keeloq_common_normal_learning(fix, manufacture_code->key); man = subghz_protocol_keeloq_common_normal_learning(fix, manufacture_code->key);
FURI_LOG_I(TAG, "mfkey: %08lX%08lX mf: %s", hi, lo, manufacture_code->name);
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man); decrypt = subghz_protocol_keeloq_common_decrypt(hop, man);
if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) { if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) {
*manufacture_name = string_get_cstr(manufacture_code->name); *manufacture_name = string_get_cstr(manufacture_code->name);
@@ -564,7 +555,6 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector(
// Secure Learning // Secure Learning
man = subghz_protocol_keeloq_common_secure_learning( man = subghz_protocol_keeloq_common_secure_learning(
fix, seed, manufacture_code->key); fix, seed, manufacture_code->key);
FURI_LOG_I(TAG, "mfkey: %08lX%08lX mf: %s", hi, lo, manufacture_code->name);
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man); decrypt = subghz_protocol_keeloq_common_decrypt(hop, man);
if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) { if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) {
*manufacture_name = string_get_cstr(manufacture_code->name); *manufacture_name = string_get_cstr(manufacture_code->name);
@@ -582,7 +572,6 @@ static uint8_t subghz_protocol_keeloq_check_remote_controller_selector(
// Magic xor type1 learning // Magic xor type1 learning
man = subghz_protocol_keeloq_common_magic_xor_type1_learning( man = subghz_protocol_keeloq_common_magic_xor_type1_learning(
fix, manufacture_code->key); fix, manufacture_code->key);
FURI_LOG_I(TAG, "mfkey: %08lX%08lX mf: %s", hi, lo, manufacture_code->name);
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man); decrypt = subghz_protocol_keeloq_common_decrypt(hop, man);
if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) { if(subghz_protocol_keeloq_check_decrypt(instance, decrypt, btn, end_serial)) {
*manufacture_name = string_get_cstr(manufacture_code->name); *manufacture_name = string_get_cstr(manufacture_code->name);

View File

@@ -127,17 +127,8 @@ static void
} }
instance->generic.cnt++; instance->generic.cnt++;
FURI_LOG_I(TAG, "serial = %7X", instance->generic.serial);
FURI_LOG_I(TAG, "counter = %4X", instance->generic.cnt);
FURI_LOG_I(TAG, "button = %1X", btn);
uint64_t decrypt = ((uint64_t)instance->generic.serial << 16) | instance->generic.cnt; uint64_t decrypt = ((uint64_t)instance->generic.serial << 16) | instance->generic.cnt;
uint32_t hi = decrypt >> 32;
uint32_t lo = decrypt & 0xFFFFFFFF;
FURI_LOG_I(TAG, "decrypt = %3X%8X", hi, lo);
uint64_t enc_part = subghz_protocol_nice_flor_s_encrypt(decrypt, file_name); uint64_t enc_part = subghz_protocol_nice_flor_s_encrypt(decrypt, file_name);
hi = enc_part >> 32;
lo = enc_part & 0xFFFFFFFF;
FURI_LOG_I(TAG, "enc_part = %3X%8X", hi, lo);
for (int i = 0; i < 16; i++) { for (int i = 0; i < 16; i++) {
@@ -149,10 +140,6 @@ static void
byte = btn << 4 | (0xF ^ btn ^ loops[i]); byte = btn << 4 | (0xF ^ btn ^ loops[i]);
instance->generic.data = (uint64_t)byte << 44 | enc_part; instance->generic.data = (uint64_t)byte << 44 | enc_part;
hi = instance->generic.data >> 32;
lo = instance->generic.data & 0xFFFFFFFF;
FURI_LOG_I(TAG, "key = %5X%8X", hi, lo);
//Send header //Send header
instance->encoder.upload[index++] = instance->encoder.upload[index++] =
level_duration_make(false, (uint32_t)subghz_protocol_nice_flor_s_const.te_short * 34); level_duration_make(false, (uint32_t)subghz_protocol_nice_flor_s_const.te_short * 34);
@@ -302,9 +289,7 @@ uint64_t subghz_protocol_nice_flor_s_encrypt(uint64_t data, const char* file_nam
k = ~p[3]; k = ~p[3];
p[3] = ~p[1]; p[3] = ~p[1];
p[1] = k; p[1] = k;
uint32_t hi = data >> 32;
uint32_t lo = data & 0xFFFFFFFF;
FURI_LOG_I(TAG, "encrypted_data = %3X%8X", hi, lo);
return data; return data;
} }
@@ -343,9 +328,7 @@ static uint64_t
p[1] = k; p[1] = k;
} }
} }
uint32_t hi = data >> 32;
uint32_t lo = data & 0xFFFFFFFF;
FURI_LOG_I(TAG, "decrypted_data = %5X%8X", hi, lo);
return data; return data;
} }
@@ -490,9 +473,6 @@ static void subghz_protocol_nice_flor_s_remote_controller(
instance->btn = 0; instance->btn = 0;
} else { } else {
uint64_t decrypt = subghz_protocol_nice_flor_s_decrypt(instance, file_name); uint64_t decrypt = subghz_protocol_nice_flor_s_decrypt(instance, file_name);
uint32_t hi = decrypt >> 32;
uint32_t lo = decrypt & 0xFFFFFFFF;
FURI_LOG_I(TAG, "init_decrypted_data = %5X%8X", hi, lo);
instance->cnt = decrypt & 0xFFFF; instance->cnt = decrypt & 0xFFFF;
instance->serial = (decrypt >> 16) & 0xFFFFFFF; instance->serial = (decrypt >> 16) & 0xFFFFFFF;
instance->btn = (decrypt >> 48) & 0xF; instance->btn = (decrypt >> 48) & 0xF;

View File

@@ -153,7 +153,6 @@ static bool subghz_protocol_star_line_gen_data(SubGhzProtocolEncoderStarLine* in
code_found_reverse = subghz_protocol_blocks_reverse_key( code_found_reverse = subghz_protocol_blocks_reverse_key(
instance->generic.data, instance->generic.data_count_bit); instance->generic.data, instance->generic.data_count_bit);
hop = code_found_reverse & 0x00000000ffffffff; hop = code_found_reverse & 0x00000000ffffffff;
FURI_LOG_I(TAG, "hop = %08lX", hop);
break; break;
} }
break; break;
@@ -457,13 +456,10 @@ static uint8_t subghz_protocol_star_line_check_remote_controller_selector(
for for
M_EACH(manufacture_code, *subghz_keystore_get_data(keystore), SubGhzKeyArray_t) { M_EACH(manufacture_code, *subghz_keystore_get_data(keystore), SubGhzKeyArray_t) {
uint32_t hi = manufacture_code->key >> 32;
uint32_t lo = manufacture_code->key & 0xFFFFFFFF;
switch(manufacture_code->type) { switch(manufacture_code->type) {
case KEELOQ_LEARNING_SIMPLE: case KEELOQ_LEARNING_SIMPLE:
//Simple Learning //Simple Learning
decrypt = subghz_protocol_keeloq_common_decrypt(hop, manufacture_code->key); decrypt = subghz_protocol_keeloq_common_decrypt(hop, manufacture_code->key);
FURI_LOG_I(TAG, "mfkey: %08lX%08lX mf: %s", hi, lo, manufacture_code->name);
if(subghz_protocol_star_line_check_decrypt(instance, decrypt, btn, end_serial)) { if(subghz_protocol_star_line_check_decrypt(instance, decrypt, btn, end_serial)) {
*manufacture_name = string_get_cstr(manufacture_code->name); *manufacture_name = string_get_cstr(manufacture_code->name);
return 1; return 1;
@@ -474,7 +470,6 @@ static uint8_t subghz_protocol_star_line_check_remote_controller_selector(
// https://phreakerclub.com/forum/showpost.php?p=43557&postcount=37 // https://phreakerclub.com/forum/showpost.php?p=43557&postcount=37
man_normal_learning = man_normal_learning =
subghz_protocol_keeloq_common_normal_learning(fix, manufacture_code->key); subghz_protocol_keeloq_common_normal_learning(fix, manufacture_code->key);
FURI_LOG_I(TAG, "mfkey: %08lX%08lX mf: %s", hi, lo, manufacture_code->name);
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man_normal_learning); decrypt = subghz_protocol_keeloq_common_decrypt(hop, man_normal_learning);
if(subghz_protocol_star_line_check_decrypt(instance, decrypt, btn, end_serial)) { if(subghz_protocol_star_line_check_decrypt(instance, decrypt, btn, end_serial)) {
*manufacture_name = string_get_cstr(manufacture_code->name); *manufacture_name = string_get_cstr(manufacture_code->name);
@@ -484,7 +479,6 @@ static uint8_t subghz_protocol_star_line_check_remote_controller_selector(
case KEELOQ_LEARNING_UNKNOWN: case KEELOQ_LEARNING_UNKNOWN:
// Simple Learning // Simple Learning
decrypt = subghz_protocol_keeloq_common_decrypt(hop, manufacture_code->key); decrypt = subghz_protocol_keeloq_common_decrypt(hop, manufacture_code->key);
FURI_LOG_I(TAG, "mfkey: %08lX%08lX mf: %s", hi, lo, manufacture_code->name);
if(subghz_protocol_star_line_check_decrypt(instance, decrypt, btn, end_serial)) { if(subghz_protocol_star_line_check_decrypt(instance, decrypt, btn, end_serial)) {
*manufacture_name = string_get_cstr(manufacture_code->name); *manufacture_name = string_get_cstr(manufacture_code->name);
return 1; return 1;
@@ -506,7 +500,6 @@ static uint8_t subghz_protocol_star_line_check_remote_controller_selector(
// https://phreakerclub.com/forum/showpost.php?p=43557&postcount=37 // https://phreakerclub.com/forum/showpost.php?p=43557&postcount=37
man_normal_learning = man_normal_learning =
subghz_protocol_keeloq_common_normal_learning(fix, manufacture_code->key); subghz_protocol_keeloq_common_normal_learning(fix, manufacture_code->key);
FURI_LOG_I(TAG, "mfkey: %08lX%08lX mf: %s", hi, lo, manufacture_code->name);
decrypt = subghz_protocol_keeloq_common_decrypt(hop, man_normal_learning); decrypt = subghz_protocol_keeloq_common_decrypt(hop, man_normal_learning);
if(subghz_protocol_star_line_check_decrypt(instance, decrypt, btn, end_serial)) { if(subghz_protocol_star_line_check_decrypt(instance, decrypt, btn, end_serial)) {
*manufacture_name = string_get_cstr(manufacture_code->name); *manufacture_name = string_get_cstr(manufacture_code->name);

View File

@@ -139,7 +139,6 @@ static bool subghz_keystore_read_file(SubGhzKeystore* instance, Stream* stream,
if(furi_hal_crypto_decrypt( if(furi_hal_crypto_decrypt(
(uint8_t*)encrypted_line, (uint8_t*)decrypted_line, len)) { (uint8_t*)encrypted_line, (uint8_t*)decrypted_line, len)) {
subghz_keystore_process_line(instance, decrypted_line); subghz_keystore_process_line(instance, decrypted_line);
FURI_LOG_I(TAG, "decrypted line: %016lX", decrypted_line);
} else { } else {
FURI_LOG_E(TAG, "Decryption failed"); FURI_LOG_E(TAG, "Decryption failed");
result = false; result = false;
@@ -580,9 +579,7 @@ bool subghz_keystore_raw_get_data(const char* file_name, size_t offset, uint8_t*
buffer[i / 2] = (hi_nibble << 4) | lo_nibble; buffer[i / 2] = (hi_nibble << 4) | lo_nibble;
} }
FURI_LOG_I(TAG, "decrypted line: %016lX", decrypted_line);
memset(decrypted_line, 0, SUBGHZ_KEYSTORE_FILE_DECRYPTED_LINE_SIZE); memset(decrypted_line, 0, SUBGHZ_KEYSTORE_FILE_DECRYPTED_LINE_SIZE);
FURI_LOG_I(TAG, "decrypted line: %016lX", decrypted_line);
if(!furi_hal_crypto_decrypt( if(!furi_hal_crypto_decrypt(
(uint8_t*)buffer, (uint8_t*)decrypted_line, bufer_size / 2)) { (uint8_t*)buffer, (uint8_t*)decrypted_line, bufer_size / 2)) {
@@ -591,7 +588,6 @@ bool subghz_keystore_raw_get_data(const char* file_name, size_t offset, uint8_t*
break; break;
} }
memcpy(data, (uint8_t*)decrypted_line + (offset - (offset / 16) * 16), len); memcpy(data, (uint8_t*)decrypted_line + (offset - (offset / 16) * 16), len);
FURI_LOG_I(TAG, "decrypted line: %016lX", decrypted_line);
} while(0); } while(0);
furi_hal_crypto_store_unload_key(SUBGHZ_KEYSTORE_FILE_ENCRYPTION_KEY_SLOT); furi_hal_crypto_store_unload_key(SUBGHZ_KEYSTORE_FILE_ENCRYPTION_KEY_SLOT);