[FL-1723, FL-1662, FL-1870] NFC bug fixes (#745)
* nfc: fix notifications in read EMV sequence * nfc: set focus on previously saved card * nfc: add incorrect file format message * mifare ultralight: increase size of max dump * elements: draw multiline text only until it fits screen * nfc: support variable PAN number length * nfc: change AID display * nfc: change worker custom event to prevent scene reenter * nfc: double check for PAN tag * nfc: fix edit card name appearance * Nfc: read EMV card without name if PDOL is present. * Desktop: increase unlock key press interval, switch to OS ticks instead of HAL. * Desktop: remove debug logging Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
This commit is contained in:
@@ -16,9 +16,6 @@ void nfc_scene_read_emv_data_success_on_enter(void* context) {
|
||||
NfcEmvData* emv_data = &nfc->dev.dev_data.emv_data;
|
||||
NfcDeviceCommonData* nfc_data = &nfc->dev.dev_data.nfc_data;
|
||||
|
||||
// Clear device name
|
||||
nfc_device_set_name(&nfc->dev, "");
|
||||
|
||||
// Setup Custom Widget view
|
||||
// Add frame
|
||||
widget_add_frame_element(nfc->widget, 0, 0, 128, 64, 6);
|
||||
@@ -39,20 +36,15 @@ void nfc_scene_read_emv_data_success_on_enter(void* context) {
|
||||
widget_add_string_element(
|
||||
nfc->widget, 64, 3, AlignCenter, AlignTop, FontSecondary, nfc->dev.dev_data.emv_data.name);
|
||||
// Add cad number
|
||||
char pan_str[32];
|
||||
snprintf(
|
||||
pan_str,
|
||||
sizeof(pan_str),
|
||||
"%02X%02X %02X%02X %02X%02X %02X%02X",
|
||||
emv_data->number[0],
|
||||
emv_data->number[1],
|
||||
emv_data->number[2],
|
||||
emv_data->number[3],
|
||||
emv_data->number[4],
|
||||
emv_data->number[5],
|
||||
emv_data->number[6],
|
||||
emv_data->number[7]);
|
||||
widget_add_string_element(nfc->widget, 64, 13, AlignCenter, AlignTop, FontSecondary, pan_str);
|
||||
string_t pan_str;
|
||||
string_init(pan_str);
|
||||
for(uint8_t i = 0; i < emv_data->number_len; i += 2) {
|
||||
string_cat_printf(pan_str, "%02X%02X ", emv_data->number[i], emv_data->number[i + 1]);
|
||||
}
|
||||
string_strim(pan_str);
|
||||
widget_add_string_element(
|
||||
nfc->widget, 64, 13, AlignCenter, AlignTop, FontSecondary, string_get_cstr(pan_str));
|
||||
string_clear(pan_str);
|
||||
// Parse country code
|
||||
string_t country_name;
|
||||
string_init(country_name);
|
||||
@@ -110,6 +102,14 @@ void nfc_scene_read_emv_data_success_on_enter(void* context) {
|
||||
widget_add_string_element(nfc->widget, 7, 32, AlignLeft, AlignTop, FontSecondary, exp_str);
|
||||
}
|
||||
|
||||
// Send notification
|
||||
if(scene_manager_get_scene_state(nfc->scene_manager, NfcSceneReadEmvDataSuccess) ==
|
||||
NFC_SEND_NOTIFICATION_TRUE) {
|
||||
notification_message(nfc->notifications, &sequence_success);
|
||||
scene_manager_set_scene_state(
|
||||
nfc->scene_manager, NfcSceneReadEmvDataSuccess, NFC_SEND_NOTIFICATION_FALSE);
|
||||
}
|
||||
|
||||
view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewWidget);
|
||||
}
|
||||
|
||||
@@ -121,6 +121,8 @@ bool nfc_scene_read_emv_data_success_on_event(void* context, SceneManagerEvent e
|
||||
return scene_manager_search_and_switch_to_previous_scene(
|
||||
nfc->scene_manager, NfcSceneReadEmvAppSuccess);
|
||||
} else if(event.event == GuiButtonTypeRight) {
|
||||
// Clear device name
|
||||
nfc_device_set_name(&nfc->dev, "");
|
||||
nfc->dev.format = NfcDeviceSaveFormatBankCard;
|
||||
scene_manager_next_scene(nfc->scene_manager, NfcSceneSaveName);
|
||||
return true;
|
||||
|
Reference in New Issue
Block a user