Verify card bugfix

This commit is contained in:
assasinfil 2023-11-21 22:34:29 +03:00
parent 4261063c99
commit c145cad653
2 changed files with 8 additions and 8 deletions

View File

@ -10,7 +10,7 @@
#include <furi_hal_rtc.h> #include <furi_hal_rtc.h>
#include <core/check.h> #include <core/check.h>
#define TAG "Social Moscow" #define TAG "Social_Moscow"
typedef struct { typedef struct {
uint64_t a; uint64_t a;
@ -1463,10 +1463,10 @@ bool parse_transport_block(const MfClassicBlock* block, FuriString* result) {
static bool social_moscow_get_card_config(SocialMoscowCardConfig* config, MfClassicType type) { static bool social_moscow_get_card_config(SocialMoscowCardConfig* config, MfClassicType type) {
bool success = true; bool success = true;
if(type == MfClassicType1k) { if(type == MfClassicType1k) {
config->data_sector = 32; config->data_sector = 15;
config->keys = social_moscow_1k_keys; config->keys = social_moscow_1k_keys;
} else if(type == MfClassicType4k) { } else if(type == MfClassicType4k) {
config->data_sector = 32; config->data_sector = 15;
config->keys = social_moscow_4k_keys; config->keys = social_moscow_4k_keys;
} else { } else {
success = false; success = false;
@ -1495,7 +1495,7 @@ static bool social_moscow_verify_type(Nfc* nfc, MfClassicType type) {
FURI_LOG_D(TAG, "Failed to read block %u: %d", block_num, error); FURI_LOG_D(TAG, "Failed to read block %u: %d", block_num, error);
break; break;
} }
FURI_LOG_D(TAG, "Verify success!");
verified = true; verified = true;
} while(false); } while(false);
@ -1517,7 +1517,7 @@ static bool social_moscow_read(Nfc* nfc, NfcDevice* device) {
nfc_device_copy_data(device, NfcProtocolMfClassic, data); nfc_device_copy_data(device, NfcProtocolMfClassic, data);
do { do {
MfClassicType type = MfClassicTypeMini; MfClassicType type = MfClassicType4k;
MfClassicError error = mf_classic_poller_sync_detect_type(nfc, &type); MfClassicError error = mf_classic_poller_sync_detect_type(nfc, &type);
if(error != MfClassicErrorNone) break; if(error != MfClassicErrorNone) break;

View File

@ -1486,10 +1486,10 @@ static bool troika_get_card_config(TroikaCardConfig* config, MfClassicType type)
bool success = true; bool success = true;
if(type == MfClassicType1k) { if(type == MfClassicType1k) {
config->data_sector = 4; config->data_sector = 11;
config->keys = troika_1k_keys; config->keys = troika_1k_keys;
} else if(type == MfClassicType4k) { } else if(type == MfClassicType4k) {
config->data_sector = 8; config->data_sector = 11;
config->keys = troika_4k_keys; config->keys = troika_4k_keys;
} else { } else {
success = false; success = false;
@ -1518,7 +1518,7 @@ static bool troika_verify_type(Nfc* nfc, MfClassicType type) {
FURI_LOG_D(TAG, "Failed to read block %u: %d", block_num, error); FURI_LOG_D(TAG, "Failed to read block %u: %d", block_num, error);
break; break;
} }
FURI_LOG_D(TAG, "Verify success!");
verified = true; verified = true;
} while(false); } while(false);