[FL-3800, FL-3801] Fixed plugins and UI (#3543)

* Fixed some UI mismatches in plugin and nfc app
* Fixed nameing mismatches in mosgortrans_util
* Fix ultralight naming display

Co-authored-by: gornekich <n.gorbadey@gmail.com>
Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
RebornedBrain 2024-03-29 05:45:01 +03:00 committed by GitHub
parent 538422e2a9
commit c353182353
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 22 additions and 16 deletions

View File

@ -464,21 +464,21 @@ void parse_transport_type(BlockData* data_block, FuriString* transport) {
bool mosgortrans_parse_transport_block(const MfClassicBlock* block, FuriString* result) {
BlockData data_block = {};
const uint16_t valid_departments[] = {0x106, 0x108, 0x10A, 0x10E, 0x110, 0x117};
uint16_t transport_departament = bit_lib_get_bits_16(block->data, 0, 10);
uint16_t transport_department = bit_lib_get_bits_16(block->data, 0, 10);
if(furi_hal_rtc_is_flag_set(FuriHalRtcFlagDebug)) {
furi_string_cat_printf(result, "Transport departament: %x\n", transport_departament);
furi_string_cat_printf(result, "Transport department: %x\n", transport_department);
}
bool departament_valid = false;
bool department_valid = false;
for(uint8_t i = 0; i < 6; i++) {
if(transport_departament == valid_departments[i]) {
departament_valid = true;
if(transport_department == valid_departments[i]) {
department_valid = true;
break;
}
}
if(!departament_valid) {
if(!department_valid) {
return false;
}
FURI_LOG_D(TAG, "Transport departament: %x", transport_departament);
FURI_LOG_D(TAG, "Transport department: %x", transport_department);
uint16_t layout_type = bit_lib_get_bits_16(block->data, 52, 4);
if(layout_type == 0xE) {
layout_type = bit_lib_get_bits_16(block->data, 52, 9);

View File

@ -30,6 +30,8 @@ static void nfc_scene_info_on_enter_mf_ultralight(NfcApp* instance) {
furi_string_cat_printf(
temp_str, "\e#%s\n", nfc_device_get_name(device, NfcDeviceNameTypeFull));
furi_string_replace(temp_str, "Mifare", "MIFARE");
nfc_render_mf_ultralight_info(data, NfcProtocolFormatTypeFull, temp_str);
widget_add_text_scroll_element(

View File

@ -1,22 +1,27 @@
#include "st25tb_render.h"
#include <nfc/protocols/st25tb/st25tb.h>
#include <machine/endian.h>
void nfc_render_st25tb_info(
const St25tbData* data,
NfcProtocolFormatType format_type,
FuriString* str) {
furi_string_cat_printf(str, "UID");
furi_string_cat_printf(str, "UID:");
for(size_t i = 0; i < ST25TB_UID_SIZE; i++) {
furi_string_cat_printf(str, " %02X", data->uid[i]);
}
if(format_type == NfcProtocolFormatTypeFull) {
furi_string_cat_printf(str, "\nSys. OTP: %08lX", data->system_otp_block);
furi_string_cat_printf(str, "\nBlocks:");
furi_string_cat_printf(str, "\nSys. OTP: %08lX", __bswap32(data->system_otp_block));
furi_string_cat_printf(str, "\n::::::::::::::::::::::[Blocks]::::::::::::::::::::::");
for(size_t i = 0; i < st25tb_get_block_count(data->type); i += 2) {
furi_string_cat_printf(
str, "\n %02X %08lX %08lX", i, data->blocks[i], data->blocks[i + 1]);
str,
"\n %02X %08lX %08lX",
i,
__bswap32(data->blocks[i]),
__bswap32(data->blocks[i + 1]));
}
}
}

View File

@ -453,7 +453,7 @@ void nfc_append_filename_string_when_present(NfcApp* instance, FuriString* strin
furi_assert(string);
if(!furi_string_empty(instance->file_name)) {
furi_string_cat_printf(string, "Name:%s\n", furi_string_get_cstr(instance->file_name));
furi_string_cat_printf(string, "Name: %s\n", furi_string_get_cstr(instance->file_name));
}
}

View File

@ -85,11 +85,10 @@ static bool mykey_parse(const NfcDevice* device, FuriString* parsed_data) {
bool is_blank = mykey_is_blank(data);
furi_string_cat_printf(parsed_data, "Serial#: %08lX\n", (uint32_t)__bswap32(data->blocks[7]));
furi_string_cat_printf(parsed_data, "Blank: %s\n", is_blank ? "yes" : "no");
furi_string_cat_printf(parsed_data, "LockID: %s\n", mykey_has_lockid(data) ? "maybe" : "no");
furi_string_cat_printf(
parsed_data, "Prod. date: %02X/%02X/%04X", mfg_day, mfg_month, mfg_year);
parsed_data, "Prod. date: %02X/%02X/%04X\n", mfg_day, mfg_month, mfg_year);
furi_string_cat_printf(parsed_data, "Blank: %s\n", is_blank ? "yes" : "no");
furi_string_cat_printf(parsed_data, "LockID: %s", mykey_has_lockid(data) ? "maybe" : "no");
if(!is_blank) {
furi_string_cat_printf(