From e1fd14f2c3e70a5ad90e5d56c91fc70a7418230c Mon Sep 17 00:00:00 2001 From: GameTec_live Date: Mon, 30 Oct 2023 11:44:21 +0100 Subject: [PATCH 1/8] add support for proxmark3 json --- .../lib/helpers/mifare_classic/general.dart | 36 +++++++++ .../lib/sharedprefsprovider.dart | 75 +++++++++++++++---- 2 files changed, 97 insertions(+), 14 deletions(-) diff --git a/chameleonultragui/lib/helpers/mifare_classic/general.dart b/chameleonultragui/lib/helpers/mifare_classic/general.dart index 641e9908..1f9189bf 100644 --- a/chameleonultragui/lib/helpers/mifare_classic/general.dart +++ b/chameleonultragui/lib/helpers/mifare_classic/general.dart @@ -141,6 +141,20 @@ int mfClassicGetBlockCount(MifareClassicType type, {bool isEV1 = false}) { } } +MifareClassicType mfClassicGetCardType(int blockCount) { + if (blockCount == 64 || blockCount == 72) { + return MifareClassicType.m1k; + } else if (blockCount == 128) { + return MifareClassicType.m2k; + } else if (blockCount == 256) { + return MifareClassicType.m4k; + } else if (blockCount == 20) { + return MifareClassicType.mini; + } else { + return MifareClassicType.none; + } +} + int mfClassicGetSectorTrailerBlockBySector(int sector) { if (sector < 32) { return sector * 4 + 3; @@ -217,3 +231,25 @@ List mfClassicGetKeysFromDump(List dump) { return keys; } + +TagType mfClassicTypeToTagType(MifareClassicType type) { + final typeMap = { + MifareClassicType.m1k: TagType.mifare1K, + MifareClassicType.m2k: TagType.mifare2K, + MifareClassicType.m4k: TagType.mifare4K, + MifareClassicType.mini: TagType.mifareMini, + }; + + return typeMap[type] ?? TagType.unknown; +} + +MifareClassicType tagTypeToMfClassicType(TagType type) { + final typeMap = { + TagType.mifare1K: MifareClassicType.m1k, + TagType.mifare2K: MifareClassicType.m2k, + TagType.mifare4K: MifareClassicType.m4k, + TagType.mifareMini: MifareClassicType.mini, + }; + + return typeMap[type] ?? MifareClassicType.none; +} \ No newline at end of file diff --git a/chameleonultragui/lib/sharedprefsprovider.dart b/chameleonultragui/lib/sharedprefsprovider.dart index a1a5d3af..9e513c8d 100644 --- a/chameleonultragui/lib/sharedprefsprovider.dart +++ b/chameleonultragui/lib/sharedprefsprovider.dart @@ -2,12 +2,14 @@ import 'dart:typed_data'; import 'dart:convert'; import 'package:chameleonultragui/bridge/chameleon.dart'; import 'package:chameleonultragui/helpers/general.dart'; +import 'package:chameleonultragui/helpers/mifare_classic/general.dart'; import 'package:flutter/material.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:uuid/uuid.dart'; // Localizations import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:uuid/v4.dart'; class Dictionary { String id; @@ -78,22 +80,67 @@ class CardSave { factory CardSave.fromJson(String json) { Map data = jsonDecode(json); - final id = data['id'] as String; - final uid = data['uid'] as String; - final sak = data['sak'] as int; - final atqa = List.from(data['atqa'] as List); - final ats = List.from((data['ats'] ?? []) as List); - final name = data['name'] as String; - final tag = getTagTypeByValue(data['tag']); - if (data['color'] == null) { - data['color'] = colorToHex(Colors.deepOrange); - } - final color = hexToColor(data['color']); - final encodedData = data['data'] as List; + + final String id; + final String uid; + final int sak; + final List atqa; + final List ats; + final String name; + final TagType tag; + final Color color; List tagData = []; - for (var block in encodedData) { - tagData.add(Uint8List.fromList(List.from(block))); + + if (data['Created'] == "proxmark3") { + // PM3 JSON, parse that + id = const Uuid().v4(); + uid = data['Card']['UID'] as String; + String sakString = data['Card']['SAK'] as String; + sak = hexToBytes(sakString)[0]; + String atqaString = data['Card']['ATQA'] as String; + atqa = [ + int.parse(atqaString.substring(2), radix: 16), + int.parse(atqaString.substring(0, 2), radix: 16) + ]; + ats = []; + name = uid; + color = Colors.deepOrange; + + List blocks = []; + Map blockData = data['blocks'] as Map; + for (int i = 0; blockData.containsKey(i.toString()); i++) { + blocks.add(blockData[i.toString()] as String); + } + + //Check if a block has more than 16 Bytes, Ultralight, return as unknown + if (blocks[0].length > 32) { + tag = TagType.unknown; + } else { + tag = mfClassicTypeToTagType(mfClassicGetCardType(blocks.length)); + } + + for (var block in blocks) { + tagData.add(hexToBytes(block)); + } + + } else { + id = data['id'] as String; + uid = data['uid'] as String; + sak = data['sak'] as int; + atqa = List.from(data['atqa'] as List); + ats = List.from((data['ats'] ?? []) as List); + name = data['name'] as String; + tag = getTagTypeByValue(data['tag']); + if (data['color'] == null) { + data['color'] = colorToHex(Colors.deepOrange); + } + color = hexToColor(data['color']); + final encodedData = data['data'] as List; + for (var block in encodedData) { + tagData.add(Uint8List.fromList(List.from(block))); + } } + return CardSave( id: id, uid: uid, From f9a53802bd01113ea8e5a6cd84653cf76354930c Mon Sep 17 00:00:00 2001 From: GameTec_live Date: Mon, 30 Oct 2023 11:45:21 +0100 Subject: [PATCH 2/8] woops, import --- chameleonultragui/lib/sharedprefsprovider.dart | 2 -- 1 file changed, 2 deletions(-) diff --git a/chameleonultragui/lib/sharedprefsprovider.dart b/chameleonultragui/lib/sharedprefsprovider.dart index 9e513c8d..4452d7ca 100644 --- a/chameleonultragui/lib/sharedprefsprovider.dart +++ b/chameleonultragui/lib/sharedprefsprovider.dart @@ -9,8 +9,6 @@ import 'package:uuid/uuid.dart'; // Localizations import 'package:flutter_gen/gen_l10n/app_localizations.dart'; -import 'package:uuid/v4.dart'; - class Dictionary { String id; String name; From 7e60683ade49aefe7a5a1f779889117e46784c9c Mon Sep 17 00:00:00 2001 From: GameTec_live Date: Mon, 30 Oct 2023 12:35:16 +0100 Subject: [PATCH 3/8] fix: function alrdy exists, whoops --- .../lib/helpers/mifare_classic/general.dart | 22 ------------------- .../lib/sharedprefsprovider.dart | 2 +- 2 files changed, 1 insertion(+), 23 deletions(-) diff --git a/chameleonultragui/lib/helpers/mifare_classic/general.dart b/chameleonultragui/lib/helpers/mifare_classic/general.dart index 1f9189bf..d88c9f9a 100644 --- a/chameleonultragui/lib/helpers/mifare_classic/general.dart +++ b/chameleonultragui/lib/helpers/mifare_classic/general.dart @@ -230,26 +230,4 @@ List mfClassicGetKeysFromDump(List dump) { } return keys; -} - -TagType mfClassicTypeToTagType(MifareClassicType type) { - final typeMap = { - MifareClassicType.m1k: TagType.mifare1K, - MifareClassicType.m2k: TagType.mifare2K, - MifareClassicType.m4k: TagType.mifare4K, - MifareClassicType.mini: TagType.mifareMini, - }; - - return typeMap[type] ?? TagType.unknown; -} - -MifareClassicType tagTypeToMfClassicType(TagType type) { - final typeMap = { - TagType.mifare1K: MifareClassicType.m1k, - TagType.mifare2K: MifareClassicType.m2k, - TagType.mifare4K: MifareClassicType.m4k, - TagType.mifareMini: MifareClassicType.mini, - }; - - return typeMap[type] ?? MifareClassicType.none; } \ No newline at end of file diff --git a/chameleonultragui/lib/sharedprefsprovider.dart b/chameleonultragui/lib/sharedprefsprovider.dart index 4452d7ca..e8748dab 100644 --- a/chameleonultragui/lib/sharedprefsprovider.dart +++ b/chameleonultragui/lib/sharedprefsprovider.dart @@ -114,7 +114,7 @@ class CardSave { if (blocks[0].length > 32) { tag = TagType.unknown; } else { - tag = mfClassicTypeToTagType(mfClassicGetCardType(blocks.length)); + tag = mfClassicGetChameleonTagType(mfClassicGetCardType(blocks.length)); } for (var block in blocks) { From 21af533d26353b6cf265db2b64a5268d01f69fe7 Mon Sep 17 00:00:00 2001 From: GameTec_live Date: Mon, 30 Oct 2023 15:26:37 +0100 Subject: [PATCH 4/8] split it out to seperate function --- .../lib/gui/page/saved_cards.dart | 60 ++++++++++++++- .../lib/sharedprefsprovider.dart | 73 ++++--------------- 2 files changed, 73 insertions(+), 60 deletions(-) diff --git a/chameleonultragui/lib/gui/page/saved_cards.dart b/chameleonultragui/lib/gui/page/saved_cards.dart index 2466b37b..032defd9 100644 --- a/chameleonultragui/lib/gui/page/saved_cards.dart +++ b/chameleonultragui/lib/gui/page/saved_cards.dart @@ -17,6 +17,7 @@ import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; import 'package:provider/provider.dart'; import 'package:chameleonultragui/gui/menu/card_edit.dart'; import 'package:chameleonultragui/gui/menu/dictionary_view.dart'; +import 'package:uuid/uuid.dart'; // Localizations import 'package:flutter_gen/gen_l10n/app_localizations.dart'; @@ -31,6 +32,53 @@ class SavedCardsPage extends StatefulWidget { class SavedCardsPageState extends State { MifareClassicType selectedType = MifareClassicType.m1k; + CardSave pm3JsonToCardSave(String json) { + Map data = jsonDecode(json); + + final String id = const Uuid().v4(); + final String uid = data['Card']['UID'] as String; + String sakString = data['Card']['SAK'] as String; + final int sak = hexToBytes(sakString)[0]; + String atqaString = data['Card']['ATQA'] as String; + final List atqa = [ + int.parse(atqaString.substring(2), radix: 16), + int.parse(atqaString.substring(0, 2), radix: 16) + ]; + final List ats = []; + final String name = uid; + const Color color = Colors.deepOrange; + final TagType tag; + List tagData = []; + + List blocks = []; + Map blockData = data['blocks'] as Map; + for (int i = 0; blockData.containsKey(i.toString()); i++) { + blocks.add(blockData[i.toString()] as String); + } + + //Check if a block has more than 16 Bytes, Ultralight, return as unknown + if (blocks[0].length > 32) { + tag = TagType.unknown; + } else { + tag = mfClassicGetChameleonTagType(mfClassicGetCardType(blocks.length)); + } + + for (var block in blocks) { + tagData.add(hexToBytes(block)); + } + + return CardSave( + id: id, + uid: uid, + sak: sak, + name: name, + tag: tag, + data: tagData, + color: color, + ats: Uint8List.fromList(ats), + atqa: Uint8List.fromList(atqa)); + } + @override Widget build(BuildContext context) { var appState = context.watch(); @@ -73,7 +121,17 @@ class SavedCardsPageState extends State { var string = const Utf8Decoder().convert(contents); var tags = appState.sharedPreferencesProvider.getCards(); - var tag = CardSave.fromJson(string); + CardSave tag; + if (string.contains("\"Created\": \"proxmark3\",")) { + // PM3 JSON + tag = pm3JsonToCardSave(string); + } else if (string.startsWith("Filetype: Flipper NFC device")) { + // Flipper NFC + tag = CardSave.fromJson(string); + } else { + tag = CardSave.fromJson(string); + } + tags.add(tag); appState.sharedPreferencesProvider.setCards(tags); appState.changesMade(); diff --git a/chameleonultragui/lib/sharedprefsprovider.dart b/chameleonultragui/lib/sharedprefsprovider.dart index e8748dab..6a911260 100644 --- a/chameleonultragui/lib/sharedprefsprovider.dart +++ b/chameleonultragui/lib/sharedprefsprovider.dart @@ -78,67 +78,22 @@ class CardSave { factory CardSave.fromJson(String json) { Map data = jsonDecode(json); - - final String id; - final String uid; - final int sak; - final List atqa; - final List ats; - final String name; - final TagType tag; - final Color color; + final id = data['id'] as String; + final uid = data['uid'] as String; + final sak = data['sak'] as int; + final atqa = List.from(data['atqa'] as List); + final ats = List.from((data['ats'] ?? []) as List); + final name = data['name'] as String; + final tag = getTagTypeByValue(data['tag']); + if (data['color'] == null) { + data['color'] = colorToHex(Colors.deepOrange); + } + final color = hexToColor(data['color']); + final encodedData = data['data'] as List; List tagData = []; - - if (data['Created'] == "proxmark3") { - // PM3 JSON, parse that - id = const Uuid().v4(); - uid = data['Card']['UID'] as String; - String sakString = data['Card']['SAK'] as String; - sak = hexToBytes(sakString)[0]; - String atqaString = data['Card']['ATQA'] as String; - atqa = [ - int.parse(atqaString.substring(2), radix: 16), - int.parse(atqaString.substring(0, 2), radix: 16) - ]; - ats = []; - name = uid; - color = Colors.deepOrange; - - List blocks = []; - Map blockData = data['blocks'] as Map; - for (int i = 0; blockData.containsKey(i.toString()); i++) { - blocks.add(blockData[i.toString()] as String); - } - - //Check if a block has more than 16 Bytes, Ultralight, return as unknown - if (blocks[0].length > 32) { - tag = TagType.unknown; - } else { - tag = mfClassicGetChameleonTagType(mfClassicGetCardType(blocks.length)); - } - - for (var block in blocks) { - tagData.add(hexToBytes(block)); - } - - } else { - id = data['id'] as String; - uid = data['uid'] as String; - sak = data['sak'] as int; - atqa = List.from(data['atqa'] as List); - ats = List.from((data['ats'] ?? []) as List); - name = data['name'] as String; - tag = getTagTypeByValue(data['tag']); - if (data['color'] == null) { - data['color'] = colorToHex(Colors.deepOrange); - } - color = hexToColor(data['color']); - final encodedData = data['data'] as List; - for (var block in encodedData) { - tagData.add(Uint8List.fromList(List.from(block))); - } + for (var block in encodedData) { + tagData.add(Uint8List.fromList(List.from(block))); } - return CardSave( id: id, uid: uid, From b935def5b4a830b4698f53d393cc04733ea8745f Mon Sep 17 00:00:00 2001 From: GameTec_live Date: Mon, 30 Oct 2023 18:23:58 +0100 Subject: [PATCH 5/8] aaand flipper nfc support --- .../lib/gui/page/saved_cards.dart | 48 ++++++++++++++++++- 1 file changed, 46 insertions(+), 2 deletions(-) diff --git a/chameleonultragui/lib/gui/page/saved_cards.dart b/chameleonultragui/lib/gui/page/saved_cards.dart index 032defd9..f892bf7a 100644 --- a/chameleonultragui/lib/gui/page/saved_cards.dart +++ b/chameleonultragui/lib/gui/page/saved_cards.dart @@ -79,6 +79,50 @@ class SavedCardsPageState extends State { atqa: Uint8List.fromList(atqa)); } + CardSave flipperNfcToCardSave(String data) { + final String id = const Uuid().v4(); + final String uid = RegExp(r'UID:\s+([\dA-Fa-f ]+)').firstMatch(data)!.group(1)!; + final int sak = hexToBytes(RegExp(r'SAK:\s+([\dA-Fa-f ]+)').firstMatch(data)!.group(1)!)[0]; + String atqaString = RegExp(r'ATQA:\s+([\dA-Fa-f ]+)').firstMatch(data)!.group(1)!; + final List atqa = [ + int.parse(atqaString.substring(0, 2), radix: 16), + int.parse(atqaString.substring(2), radix: 16) + ]; + final List ats = []; + final String name = uid; + const Color color = Colors.deepOrange; + final TagType tag; + List tagData = []; + List blocks = []; + for (var block in data.split("\n")) { + if (block.startsWith("Block")) { + blocks.add(block.split(":")[1].trim()); + } + } + + //Check if a block has more than 16 Bytes, Ultralight, return as unknown + if (blocks[0].replaceAll(' ', '').length > 32) { + tag = TagType.unknown; + } else { + tag = mfClassicGetChameleonTagType(mfClassicGetCardType(blocks.length)); + } + + for (var block in blocks) { + tagData.add(hexToBytesSpace(block)); + } + + return CardSave( + id: id, + uid: uid, + sak: sak, + name: name, + tag: tag, + data: tagData, + color: color, + ats: Uint8List.fromList(ats), + atqa: Uint8List.fromList(atqa)); + } + @override Widget build(BuildContext context) { var appState = context.watch(); @@ -125,9 +169,9 @@ class SavedCardsPageState extends State { if (string.contains("\"Created\": \"proxmark3\",")) { // PM3 JSON tag = pm3JsonToCardSave(string); - } else if (string.startsWith("Filetype: Flipper NFC device")) { + } else if (string.contains("Filetype: Flipper NFC device")) { // Flipper NFC - tag = CardSave.fromJson(string); + tag = flipperNfcToCardSave(string); } else { tag = CardSave.fromJson(string); } From 1c65cfa92bcecd0de68f4b2af5a746647ede0252 Mon Sep 17 00:00:00 2001 From: GameTec_live Date: Mon, 30 Oct 2023 18:50:39 +0100 Subject: [PATCH 6/8] wip mfct; sak and atqa extraction missing --- .../lib/gui/page/saved_cards.dart | 49 +++++++++++++++++++ .../lib/sharedprefsprovider.dart | 1 - 2 files changed, 49 insertions(+), 1 deletion(-) diff --git a/chameleonultragui/lib/gui/page/saved_cards.dart b/chameleonultragui/lib/gui/page/saved_cards.dart index f892bf7a..d7e4acf7 100644 --- a/chameleonultragui/lib/gui/page/saved_cards.dart +++ b/chameleonultragui/lib/gui/page/saved_cards.dart @@ -123,6 +123,51 @@ class SavedCardsPageState extends State { atqa: Uint8List.fromList(atqa)); } + CardSave mfctToCardSave(String data) { + final String id = const Uuid().v4(); + final String uid = data.split("\n")[1].substring(0, 8); + final int sak = hexToBytes("08")[0]; + String atqaString = "0002"; + final List atqa = [ + int.parse(atqaString.substring(0, 2), radix: 16), + int.parse(atqaString.substring(2), radix: 16) + ]; + final List ats = []; + final String name = uid; + const Color color = Colors.deepOrange; + final TagType tag; + List tagData = []; + List blocks = []; + for (var block in data.split("\n")) { + if (!block.startsWith("+Sector")) { + blocks.add(block.trim()); + } + } + + //Check if a block has more than 16 Bytes, Ultralight, return as unknown + if (blocks[0].replaceAll(' ', '').length > 32) { + tag = TagType.unknown; + } else { + tag = mfClassicGetChameleonTagType(mfClassicGetCardType(blocks.length)); + } + + for (var block in blocks) { + tagData.add(hexToBytesSpace(block)); + } + + return CardSave( + id: id, + uid: uid, + sak: sak, + name: name, + tag: tag, + data: tagData, + color: color, + ats: Uint8List.fromList(ats), + atqa: Uint8List.fromList(atqa)); + } + + @override Widget build(BuildContext context) { var appState = context.watch(); @@ -172,6 +217,10 @@ class SavedCardsPageState extends State { } else if (string.contains("Filetype: Flipper NFC device")) { // Flipper NFC tag = flipperNfcToCardSave(string); + } else if (string.contains("+Sector: 0")) { + // Mifare Classic Tool + tag = mfctToCardSave(string); + } else { tag = CardSave.fromJson(string); } diff --git a/chameleonultragui/lib/sharedprefsprovider.dart b/chameleonultragui/lib/sharedprefsprovider.dart index 6a911260..29c3a9f5 100644 --- a/chameleonultragui/lib/sharedprefsprovider.dart +++ b/chameleonultragui/lib/sharedprefsprovider.dart @@ -2,7 +2,6 @@ import 'dart:typed_data'; import 'dart:convert'; import 'package:chameleonultragui/bridge/chameleon.dart'; import 'package:chameleonultragui/helpers/general.dart'; -import 'package:chameleonultragui/helpers/mifare_classic/general.dart'; import 'package:flutter/material.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:uuid/uuid.dart'; From f47e1490c3931aed7a357d3cb2ee0d39c32da198 Mon Sep 17 00:00:00 2001 From: GameTec_live Date: Mon, 30 Oct 2023 19:33:47 +0100 Subject: [PATCH 7/8] mfct import --- chameleonultragui/lib/gui/page/saved_cards.dart | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/chameleonultragui/lib/gui/page/saved_cards.dart b/chameleonultragui/lib/gui/page/saved_cards.dart index d7e4acf7..976bda5d 100644 --- a/chameleonultragui/lib/gui/page/saved_cards.dart +++ b/chameleonultragui/lib/gui/page/saved_cards.dart @@ -96,7 +96,7 @@ class SavedCardsPageState extends State { List blocks = []; for (var block in data.split("\n")) { if (block.startsWith("Block")) { - blocks.add(block.split(":")[1].trim()); + blocks.add(block.split(":")[1].trim().replaceAll('?', '0')); } } @@ -126,11 +126,11 @@ class SavedCardsPageState extends State { CardSave mfctToCardSave(String data) { final String id = const Uuid().v4(); final String uid = data.split("\n")[1].substring(0, 8); - final int sak = hexToBytes("08")[0]; - String atqaString = "0002"; + final int sak = hexToBytes(data.split("\n")[1].substring(10,12))[0]; + String atqaString = data.split("\n")[1].substring(12, 16); final List atqa = [ - int.parse(atqaString.substring(0, 2), radix: 16), - int.parse(atqaString.substring(2), radix: 16) + int.parse(atqaString.substring(2), radix: 16), + int.parse(atqaString.substring(0, 2), radix: 16) ]; final List ats = []; final String name = uid; From bf7a62acfbf0927fbb4b9eac23e390eef4667c24 Mon Sep 17 00:00:00 2001 From: GameTec_live Date: Mon, 30 Oct 2023 19:47:44 +0100 Subject: [PATCH 8/8] rename function --- chameleonultragui/lib/gui/page/saved_cards.dart | 6 +++--- chameleonultragui/lib/helpers/mifare_classic/general.dart | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/chameleonultragui/lib/gui/page/saved_cards.dart b/chameleonultragui/lib/gui/page/saved_cards.dart index 976bda5d..c1524136 100644 --- a/chameleonultragui/lib/gui/page/saved_cards.dart +++ b/chameleonultragui/lib/gui/page/saved_cards.dart @@ -60,7 +60,7 @@ class SavedCardsPageState extends State { if (blocks[0].length > 32) { tag = TagType.unknown; } else { - tag = mfClassicGetChameleonTagType(mfClassicGetCardType(blocks.length)); + tag = mfClassicGetChameleonTagType(mfClassicGetCardTypeByBlockCount(blocks.length)); } for (var block in blocks) { @@ -104,7 +104,7 @@ class SavedCardsPageState extends State { if (blocks[0].replaceAll(' ', '').length > 32) { tag = TagType.unknown; } else { - tag = mfClassicGetChameleonTagType(mfClassicGetCardType(blocks.length)); + tag = mfClassicGetChameleonTagType(mfClassicGetCardTypeByBlockCount(blocks.length)); } for (var block in blocks) { @@ -148,7 +148,7 @@ class SavedCardsPageState extends State { if (blocks[0].replaceAll(' ', '').length > 32) { tag = TagType.unknown; } else { - tag = mfClassicGetChameleonTagType(mfClassicGetCardType(blocks.length)); + tag = mfClassicGetChameleonTagType(mfClassicGetCardTypeByBlockCount(blocks.length)); } for (var block in blocks) { diff --git a/chameleonultragui/lib/helpers/mifare_classic/general.dart b/chameleonultragui/lib/helpers/mifare_classic/general.dart index d88c9f9a..63c2e10c 100644 --- a/chameleonultragui/lib/helpers/mifare_classic/general.dart +++ b/chameleonultragui/lib/helpers/mifare_classic/general.dart @@ -141,7 +141,7 @@ int mfClassicGetBlockCount(MifareClassicType type, {bool isEV1 = false}) { } } -MifareClassicType mfClassicGetCardType(int blockCount) { +MifareClassicType mfClassicGetCardTypeByBlockCount(int blockCount) { if (blockCount == 64 || blockCount == 72) { return MifareClassicType.m1k; } else if (blockCount == 128) {