@@ -649,11 +649,11 @@ bool parse_transport_block(const MfClassicBlock* block, FuriString* result) {
649
649
card_crc16_2 );
650
650
card_validator = card_validator1 * 1024 + card_validator2 ;
651
651
FuriHalRtcDateTime card_use_before_date_s = {0 };
652
- from_days_to_datetime (card_valid_by_date - 1 , & card_use_before_date_s , 1992 );
652
+ from_days_to_datetime (card_valid_by_date , & card_use_before_date_s , 1992 );
653
653
654
654
FuriHalRtcDateTime card_start_trip_minutes_s = {0 };
655
655
from_minutes_to_datetime (
656
- (card_start_trip_date - 1 ) * 24 * 60 + card_start_trip_time ,
656
+ (card_start_trip_date ) * 24 * 60 + card_start_trip_time ,
657
657
& card_start_trip_minutes_s ,
658
658
1992 );
659
659
furi_string_printf (
@@ -711,7 +711,7 @@ bool parse_transport_block(const MfClassicBlock* block, FuriString* result) {
711
711
card_valid_from_date ,
712
712
card_rfu3 );
713
713
FuriHalRtcDateTime card_use_before_date_s = {0 };
714
- from_days_to_datetime (card_use_before_date - 1 , & card_use_before_date_s , 1992 );
714
+ from_days_to_datetime (card_use_before_date , & card_use_before_date_s , 1992 );
715
715
716
716
furi_string_printf (
717
717
result ,
@@ -1483,7 +1483,8 @@ static bool social_moscow_verify_type(Nfc* nfc, MfClassicType type) {
1483
1483
}
1484
1484
1485
1485
static bool social_moscow_verify (Nfc * nfc ) {
1486
- return social_moscow_verify_type (nfc , MfClassicType4k );
1486
+ return social_moscow_verify_type (nfc , MfClassicType1k ) ||
1487
+ social_moscow_verify_type (nfc , MfClassicType4k );
1487
1488
}
1488
1489
1489
1490
static bool social_moscow_read (Nfc * nfc , NfcDevice * device ) {
@@ -1546,27 +1547,29 @@ static bool social_moscow_parse(const NfcDevice* device, FuriString* parsed_data
1546
1547
1547
1548
FuriString * metro_result = furi_string_alloc ();
1548
1549
FuriString * ground_result = furi_string_alloc ();
1549
-
1550
- parse_transport_block (& data -> block [4 ], metro_result );
1551
- parse_transport_block (& data -> block [16 ], ground_result );
1552
-
1553
- furi_string_printf (
1554
- parsed_data ,
1555
- "\e#Social \ecard\nNumber: %lx %x %llx %x\nOMC: %llx\nValid for: %02x/%02x %02x%02x\n%s\n%s" ,
1556
- card_code ,
1557
- card_region ,
1558
- card_number ,
1559
- card_control ,
1560
- omc_number ,
1561
- month ,
1562
- year ,
1563
- data -> block [60 ].data [13 ],
1564
- data -> block [60 ].data [14 ],
1565
- furi_string_get_cstr (metro_result ),
1566
- furi_string_get_cstr (ground_result ));
1567
- furi_string_free (metro_result );
1568
- furi_string_free (ground_result );
1569
- parsed = true;
1550
+ bool result1 = parse_transport_block (& data -> block [4 ], metro_result );
1551
+ bool result2 = parse_transport_block (& data -> block [16 ], ground_result );
1552
+ if (result1 || result2 ) {
1553
+ furi_string_printf (
1554
+ parsed_data ,
1555
+ "\e#Social \ecard\nNumber: %lx %x %llx %x\nOMC: %llx\nValid for: %02x/%02x %02x%02x\n\e#Metro\n%s\n\e#Ground\n%s" ,
1556
+ card_code ,
1557
+ card_region ,
1558
+ card_number ,
1559
+ card_control ,
1560
+ omc_number ,
1561
+ month ,
1562
+ year ,
1563
+ data -> block [60 ].data [13 ],
1564
+ data -> block [60 ].data [14 ],
1565
+ furi_string_get_cstr (metro_result ),
1566
+ furi_string_get_cstr (ground_result ));
1567
+ furi_string_free (metro_result );
1568
+ furi_string_free (ground_result );
1569
+ parsed = true;
1570
+ } else {
1571
+ return false;
1572
+ }
1570
1573
} while (false);
1571
1574
1572
1575
return parsed ;
0 commit comments