[FL-1547], [FL-1500] NFC app v1 (#593)
* nfc: remove mifare read debug view and scene * nfc: change mifare ultralight data structure * mifare_ultralight: add more commands * nfc: add emulate mifare ul scene * nfc: rework data structures, remove debug scenes and views * nfc: add read emv scenes * nfc: mifare emulation wip * nfc cli: increase detecting time * nfc: save nfc files with new format * nfc: store Mifare Ultralight * nfc: start loading mifare ultralight * nfc: add delete scenes * nfc: add edit UID and name * nfc: finish parsing uid and mifare ul data * nfc: delete success fix * gui_widget: introduce GuiWidget * gui_widget: add string element * gui_widget: add button element * gui_widget: move free elements into gui_widget * nfc: rework info scene with GuiWidget * nfc: rework device info scene * nfc: rework delete scene gui * nfc: add compatible script support * nfc: rework emv reading scenes * nfc: rework bank card save * nfc: add bank card custom view * gui_widget: add icon element * nfc: add icon to bank card * nfc: start worker after switching view Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
@@ -3,11 +3,11 @@
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "mifare_ultralight.h"
|
||||
|
||||
#define NFC_DEV_NAME_MAX_LEN 22
|
||||
#define NFC_FILE_NAME_MAX_LEN 120
|
||||
|
||||
#define NFC_MIFARE_UL_MAX_SIZE 256
|
||||
|
||||
typedef enum {
|
||||
NfcDeviceNfca,
|
||||
NfcDeviceNfcb,
|
||||
@@ -18,9 +18,15 @@ typedef enum {
|
||||
typedef enum {
|
||||
NfcDeviceProtocolUnknown,
|
||||
NfcDeviceProtocolEMV,
|
||||
NfcDeviceProtocolMfUltralight,
|
||||
NfcDeviceProtocolMifareUl,
|
||||
} NfcProtocol;
|
||||
|
||||
typedef enum {
|
||||
NfcDeviceSaveFormatUid,
|
||||
NfcDeviceSaveFormatBankCard,
|
||||
NfcDeviceSaveFormatMifareUl,
|
||||
} NfcDeviceSaveFormat;
|
||||
|
||||
typedef struct {
|
||||
uint8_t uid_len;
|
||||
uint8_t uid[10];
|
||||
@@ -28,27 +34,31 @@ typedef struct {
|
||||
uint8_t sak;
|
||||
NfcDeviceType device;
|
||||
NfcProtocol protocol;
|
||||
} NfcDeviceData;
|
||||
} NfcDeviceCommomData;
|
||||
|
||||
typedef struct {
|
||||
NfcDeviceData nfc_data;
|
||||
char name[32];
|
||||
uint8_t aid[16];
|
||||
uint16_t aid_len;
|
||||
uint8_t number[8];
|
||||
uint8_t exp_mon;
|
||||
uint16_t exp_year;
|
||||
char cardholder[32];
|
||||
} NfcEmvData;
|
||||
|
||||
typedef struct {
|
||||
NfcDeviceData nfc_data;
|
||||
uint8_t full_dump[NFC_MIFARE_UL_MAX_SIZE];
|
||||
uint16_t dump_size;
|
||||
// TODO delete with debug view
|
||||
uint8_t man_block[12];
|
||||
uint8_t otp[4];
|
||||
} NfcMifareUlData;
|
||||
NfcDeviceCommomData nfc_data;
|
||||
union {
|
||||
NfcEmvData emv_data;
|
||||
MifareUlData mf_ul_data;
|
||||
};
|
||||
} NfcDeviceData;
|
||||
|
||||
typedef struct {
|
||||
NfcDeviceData data;
|
||||
NfcDeviceData dev_data;
|
||||
char dev_name[NFC_DEV_NAME_MAX_LEN];
|
||||
char file_name[NFC_FILE_NAME_MAX_LEN];
|
||||
NfcDeviceSaveFormat format;
|
||||
} NfcDevice;
|
||||
|
||||
void nfc_device_set_name(NfcDevice* dev, const char* name);
|
||||
@@ -58,3 +68,7 @@ bool nfc_device_save(NfcDevice* dev, const char* dev_name);
|
||||
bool nfc_device_load(NfcDevice* dev, const char* file_path);
|
||||
|
||||
bool nfc_file_select(NfcDevice* dev);
|
||||
|
||||
void nfc_device_clear(NfcDevice* dev);
|
||||
|
||||
bool nfc_device_delete(NfcDevice* dev);
|
||||
|
Reference in New Issue
Block a user