mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-11 06:09:08 -07:00
Merge remote-tracking branch 'origin/dev' into nestednonces
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#include "iso14443_3a_render.h"
|
||||
|
||||
void nfc_render_iso14443_3a_format_bytes(FuriString* str, const uint8_t* const data, size_t size) {
|
||||
void nfc_render_iso14443_3a_format_bytes(FuriString* str, const uint8_t* data, size_t size) {
|
||||
for(size_t i = 0; i < size; i++) {
|
||||
furi_string_cat_printf(str, " %02X", data[i]);
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ void nfc_render_iso14443_3a_info(
|
||||
|
||||
void nfc_render_iso14443_tech_type(const Iso14443_3aData* data, FuriString* str);
|
||||
|
||||
void nfc_render_iso14443_3a_format_bytes(FuriString* str, const uint8_t* const data, size_t size);
|
||||
void nfc_render_iso14443_3a_format_bytes(FuriString* str, const uint8_t* data, size_t size);
|
||||
|
||||
void nfc_render_iso14443_3a_brief(const Iso14443_3aData* data, FuriString* str);
|
||||
|
||||
|
||||
@@ -10,22 +10,29 @@ static void nfc_render_mf_ultralight_pages_count(const MfUltralightData* data, F
|
||||
}
|
||||
|
||||
void nfc_render_mf_ultralight_pwd_pack(const MfUltralightData* data, FuriString* str) {
|
||||
MfUltralightConfigPages* config;
|
||||
|
||||
bool all_pages = mf_ultralight_is_all_data_read(data);
|
||||
if(all_pages) {
|
||||
bool has_config = mf_ultralight_get_config_page(data, &config);
|
||||
|
||||
if(!has_config) {
|
||||
furi_string_cat_printf(str, "\e#Already Unlocked!");
|
||||
} else if(all_pages) {
|
||||
furi_string_cat_printf(str, "\e#All Pages Are Unlocked!");
|
||||
} else {
|
||||
furi_string_cat_printf(str, "\e#Some Pages Are Locked!");
|
||||
}
|
||||
|
||||
MfUltralightConfigPages* config;
|
||||
mf_ultralight_get_config_page(data, &config);
|
||||
if(has_config) {
|
||||
furi_string_cat_printf(str, "\nPassword: ");
|
||||
nfc_render_iso14443_3a_format_bytes(
|
||||
str, config->password.data, MF_ULTRALIGHT_AUTH_PASSWORD_SIZE);
|
||||
|
||||
furi_string_cat_printf(str, "\nPassword: ");
|
||||
nfc_render_iso14443_3a_format_bytes(
|
||||
str, config->password.data, MF_ULTRALIGHT_AUTH_PASSWORD_SIZE);
|
||||
|
||||
furi_string_cat_printf(str, "\nPACK: ");
|
||||
nfc_render_iso14443_3a_format_bytes(str, config->pack.data, MF_ULTRALIGHT_AUTH_PACK_SIZE);
|
||||
furi_string_cat_printf(str, "\nPACK: ");
|
||||
nfc_render_iso14443_3a_format_bytes(str, config->pack.data, MF_ULTRALIGHT_AUTH_PACK_SIZE);
|
||||
} else {
|
||||
furi_string_cat_printf(str, "\nThis card does not support\npassword protection!");
|
||||
}
|
||||
|
||||
nfc_render_mf_ultralight_pages_count(data, str);
|
||||
}
|
||||
|
||||
@@ -717,6 +717,10 @@ static bool nfc_protocol_support_scene_rpc_on_event(NfcApp* instance, SceneManag
|
||||
if(nfc_load_file(instance, instance->file_path, false)) {
|
||||
nfc_protocol_support_scene_rpc_setup_ui_and_emulate(instance);
|
||||
success = true;
|
||||
} else {
|
||||
rpc_system_app_set_error_code(
|
||||
instance->rpc_ctx, RpcAppSystemErrorCodeParseFile);
|
||||
rpc_system_app_set_error_text(instance->rpc_ctx, "Cannot load key file");
|
||||
}
|
||||
}
|
||||
rpc_system_app_confirm(instance->rpc_ctx, success);
|
||||
|
||||
@@ -488,7 +488,7 @@ int32_t nfc_app(void* p) {
|
||||
nfc->view_dispatcher, nfc->gui, ViewDispatcherTypeFullscreen);
|
||||
|
||||
furi_string_set(nfc->file_path, args);
|
||||
if(nfc_load_file(nfc, nfc->file_path, false)) {
|
||||
if(nfc_load_file(nfc, nfc->file_path, true)) {
|
||||
nfc_show_initial_scene_for_device(nfc);
|
||||
} else {
|
||||
view_dispatcher_stop(nfc->view_dispatcher);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
#include <flipper_application/flipper_application.h>
|
||||
#include <lib/nfc/protocols/mf_desfire/mf_desfire.h>
|
||||
#include <lib/toolbox/strint.h>
|
||||
|
||||
#include <applications/services/locale/locale.h>
|
||||
#include <datetime/datetime.h>
|
||||
@@ -72,7 +73,10 @@ static bool itso_parse(const NfcDevice* device, FuriString* parsed_data) {
|
||||
dateBuff[17] = '\0';
|
||||
|
||||
// DateStamp is defined in BS EN 1545 - Days passed since 01/01/1997
|
||||
uint32_t dateStamp = (int)strtol(datep, NULL, 16);
|
||||
uint32_t dateStamp;
|
||||
if(strint_to_uint32(datep, NULL, &dateStamp, 16) != StrintParseNoError) {
|
||||
return false;
|
||||
}
|
||||
uint32_t unixTimestamp = dateStamp * 24 * 60 * 60 + 852076800U;
|
||||
|
||||
furi_string_set(parsed_data, "\e#ITSO Card\n");
|
||||
|
||||
Reference in New Issue
Block a user