@@ -26,8 +26,8 @@ void nfc_maker_scene_result_on_enter(void* context) {
26
26
do {
27
27
if (!flipper_format_file_open_new (file , furi_string_get_cstr (path ))) break ;
28
28
29
- if (!flipper_format_write_header_cstr (file , "Flipper NFC device" , 3 )) break ;
30
- if (!flipper_format_write_string_cstr (file , "Device type" , "NTAG215 " )) break ;
29
+ if (!flipper_format_write_header_cstr (file , "Flipper NFC device" , 4 )) break ;
30
+ if (!flipper_format_write_string_cstr (file , "Device type" , "NTAG/Ultralight " )) break ;
31
31
32
32
// Serial number
33
33
size_t i = 0 ;
@@ -41,6 +41,8 @@ void nfc_maker_scene_result_on_enter(void* context) {
41
41
if (!flipper_format_write_hex (file , "UID" , uid , sizeof (uid ))) break ;
42
42
if (!flipper_format_write_string_cstr (file , "ATQA" , "00 44" )) break ;
43
43
if (!flipper_format_write_string_cstr (file , "SAK" , "00" )) break ;
44
+ if (!flipper_format_write_string_cstr (file , "Data format version" , "2" )) break ;
45
+ if (!flipper_format_write_string_cstr (file , "NTAG/Ultralight type" , "NTAG215" )) break ;
44
46
// TODO: Maybe randomize?
45
47
if (!flipper_format_write_string_cstr (
46
48
file ,
@@ -57,6 +59,7 @@ void nfc_maker_scene_result_on_enter(void* context) {
57
59
if (!flipper_format_write_string_cstr (file , "Counter 2" , "0" )) break ;
58
60
if (!flipper_format_write_string_cstr (file , "Tearing 2" , "00" )) break ;
59
61
if (!flipper_format_write_uint32 (file , "Pages total" , & pages , 1 )) break ;
62
+ if (!flipper_format_write_uint32 (file , "Pages read" , & pages , 1 )) break ;
60
63
61
64
// Static data
62
65
buf [i ++ ] = 0x48 ; // Internal
@@ -68,7 +71,7 @@ void nfc_maker_scene_result_on_enter(void* context) {
68
71
buf [i ++ ] = 0x3E ; // ...
69
72
buf [i ++ ] = 0x00 ; // ...
70
73
71
- buf [i ++ ] = 0x03 ; // Container flags
74
+ buf [i ++ ] = 0x03 ; // NDEF TLV block
72
75
73
76
// NDEF Docs: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/protocols/nfc/index.html#nfc-data-exchange-format-ndef
74
77
uint8_t tnf = 0x00 ;
@@ -126,7 +129,7 @@ void nfc_maker_scene_result_on_enter(void* context) {
126
129
}
127
130
case NfcMakerSceneHttps : {
128
131
tnf = 0x01 ; // NFC Forum well-known type [NFC RTD]
129
- type = "\x55 " ;
132
+ type = "U " ;
130
133
131
134
data_len = newstrnlen (app -> big_buf , BIG_INPUT_LEN );
132
135
payload_len = data_len + 1 ;
@@ -139,7 +142,7 @@ void nfc_maker_scene_result_on_enter(void* context) {
139
142
}
140
143
case NfcMakerSceneMail : {
141
144
tnf = 0x01 ; // NFC Forum well-known type [NFC RTD]
142
- type = "\x55 " ;
145
+ type = "U " ;
143
146
144
147
data_len = newstrnlen (app -> mail_buf , MAIL_INPUT_LEN );
145
148
payload_len = data_len + 1 ;
@@ -152,7 +155,7 @@ void nfc_maker_scene_result_on_enter(void* context) {
152
155
}
153
156
case NfcMakerScenePhone : {
154
157
tnf = 0x01 ; // NFC Forum well-known type [NFC RTD]
155
- type = "\x55 " ;
158
+ type = "U " ;
156
159
157
160
data_len = newstrnlen (app -> phone_buf , PHONE_INPUT_LEN );
158
161
payload_len = data_len + 1 ;
@@ -165,22 +168,22 @@ void nfc_maker_scene_result_on_enter(void* context) {
165
168
}
166
169
case NfcMakerSceneText : {
167
170
tnf = 0x01 ; // NFC Forum well-known type [NFC RTD]
168
- type = "\x54 " ;
171
+ type = "T " ;
169
172
170
173
data_len = newstrnlen (app -> big_buf , BIG_INPUT_LEN );
171
174
payload_len = data_len + 3 ;
172
175
payload = malloc (payload_len );
173
176
174
177
payload [j ++ ] = 0x02 ;
175
- payload [j ++ ] = 0x65 ; // e
176
- payload [j ++ ] = 0x6E ; // n
178
+ payload [j ++ ] = 'e' ;
179
+ payload [j ++ ] = 'n' ;
177
180
memcpy (& payload [j ], app -> big_buf , data_len );
178
181
j += data_len ;
179
182
break ;
180
183
}
181
184
case NfcMakerSceneUrl : {
182
185
tnf = 0x01 ; // NFC Forum well-known type [NFC RTD]
183
- type = "\x55 " ;
186
+ type = "U " ;
184
187
185
188
data_len = newstrnlen (app -> big_buf , BIG_INPUT_LEN );
186
189
payload_len = data_len + 1 ;
@@ -282,15 +285,15 @@ void nfc_maker_scene_result_on_enter(void* context) {
282
285
283
286
size_t record_len = header_len + payload_len ;
284
287
if (record_len < 0xFF ) {
285
- buf [i ++ ] = record_len ; // Record length
288
+ buf [i ++ ] = record_len ; // TLV length
286
289
} else {
287
- buf [i ++ ] = 0xFF ; // Record length
290
+ buf [i ++ ] = 0xFF ; // TLV length
288
291
buf [i ++ ] = record_len >> 8 ; // ...
289
292
buf [i ++ ] = record_len & 0xFF ; // ...
290
293
}
291
294
buf [i ++ ] = flags ; // Flags and TNF
292
295
buf [i ++ ] = type_len ; // Type length
293
- if (flags & 1 << 4 ) { // SR (Short Record)
296
+ if (flags & ( 1 << 4 ) ) { // SR (Short Record)
294
297
buf [i ++ ] = payload_len ; // Payload length
295
298
} else {
296
299
buf [i ++ ] = 0x00 ; // Payload length
@@ -352,6 +355,8 @@ void nfc_maker_scene_result_on_enter(void* context) {
352
355
}
353
356
if (!ok ) break ;
354
357
358
+ if (!flipper_format_write_string_cstr (file , "Failed authentication attempts" , "0" )) break ;
359
+
355
360
success = true;
356
361
357
362
} while (false);
@@ -362,11 +367,11 @@ void nfc_maker_scene_result_on_enter(void* context) {
362
367
furi_record_close (RECORD_STORAGE );
363
368
364
369
if (success ) {
365
- popup_set_icon (popup , 32 , 5 , & I_DolphinNice_96x59 );
370
+ popup_set_icon (popup , 36 , 5 , & I_DolphinDone_80x58 );
366
371
popup_set_header (popup , "Saved!" , 13 , 22 , AlignLeft , AlignBottom );
367
372
} else {
368
- popup_set_icon (popup , 32 , 5 , & I_DolphinNice_96x59 );
369
- popup_set_header (popup , "Saved !" , 13 , 22 , AlignLeft , AlignBottom );
373
+ popup_set_icon (popup , 69 , 15 , & I_WarningDolphinFlip_45x42 );
374
+ popup_set_header (popup , "Error !" , 13 , 22 , AlignLeft , AlignBottom );
370
375
}
371
376
popup_set_timeout (popup , 1500 );
372
377
popup_set_context (popup , app );
0 commit comments