How ikarus23/mifareclassictool works
Purpose and runtime
MIFARE Classic Tool is a native Android NFC application for reading, writing, cloning, analyzing, editing, and sharing MIFARE Classic RFID tag data. It runs on Android devices whose NFC controllers support MIFARE Classic; it can also support external NFC readers. The Gradle Android app module is rooted at Mifare Classic Tool/app/build.gradle, with packaging and Android/NFC declarations in Mifare Classic Tool/app/src/main/AndroidManifest.xml.
Entry points and UI orchestration
Android launches the activity set declared in the manifest. Activities/MainMenu.java is the user-facing navigation hub, routing users to tag workflows, file/key management, and offline tools. Activities are traditional Android screen controllers paired with XML layouts, e.g. Activities/ReadTag.java and res/layout/activity_read_tag.xml. Activities/BasicActivity.java provides shared activity behavior.
NFC reader boundary
MCReader.java is the core hardware-facing abstraction for MIFARE Classic communication: authentication, sector/block access, reads, and writes pass through the Android NFC stack here. NFC intent/technology filtering is defined in res/xml/nfc_tech_filter.xml. This is the critical boundary where device compatibility, tag presence, and Android NFC API limitations constrain application behavior.
Read and key-mapping flow
The primary acquisition workflow starts in Activities/ReadTag.java: a user chooses a key dictionary, scans a tag, and the app attempts keys against sectors to construct a readable dump. Activities/KeyMapCreator.java handles the dictionary-based key-to-sector mapping stage, while MCReader.java executes authentication and reads. Built-in default dictionaries are shipped as immutable assets: assets/key-files/std.keys, assets/key-files/extended-std.keys, and assets/key-files/hotel-std.keys.
Dump persistence, editing, and writing
Tag dumps and key files are user-managed local files, selected and managed through Activities/FileChooser.java, Activities/DumpEditor.java, and Activities/KeyEditor.java. Activities/WriteTag.java consumes a selected dump plus available credentials and writes tag blocks/sectors through MCReader.java; it also supports dump-wise cloning behavior. Sharing/import/export crosses the Android file-provider boundary configured by res/xml/file_provider_paths.xml and mediated by Activities/ImportExportTool.java.
Tag analysis and transformation tools
Offline/domain tools operate on dump text, blocks, UIDs, keys, and access metadata rather than directly defining NFC transport. Core examples are Activities/AccessConditionTool.java, Activities/ValueBlockTool.java, and Activities/CloneUidTool.java. MCDiffUtils.java backs dump comparison surfaced by Activities/DiffTool.java; Common.java is the shared domain/utility layer used across NFC and activity workflows.
Content, distribution, and auxiliary tooling
Offline help is bundled in app/src/main/assets/help/help.html; localized Android resources reside under app/src/main/res/values*. The app is distributed through Google Play, F-Droid, and direct APK channels, with store metadata in metadata/. Standalone conversion/interoperability scripts under tools/, such as tools/dump-file-converter/eml2mct.py, are outside the Android runtime and support moving dump/key formats between MCT and external RFID ecosystems.
Main entry points: AndroidManifest.xml Android manifest · build.gradle Android app module · eml2mct.py Dump converter
Components 19
Android app
Native NFC runtime and user workflows.
- Android app module
Mifare Classic Tool/app/build.gradle - Android manifest · Declares activities, NFC integration, and packaging.
Mifare Classic Tool/app/src/main/AndroidManifest.xml - Main menu · Navigation hub for tag, file, and offline workflows.
- Shared activity base
- Read tag · Starts acquisition from a selected key dictionary.
- Key map creator · Maps dictionary keys to tag sectors.
- Write tag · Writes selected dumps and supports cloning.
- MCReader · Authentication and sector/block access boundary.
- NFC tech filter
- Offline tag tools · Access, value-block, UID, and dump comparison tools.
- Common · Shared NFC and activity domain layer.
Local data
User-managed dumps and key dictionaries.
- File and dump editors · Choose, edit, and manage dump and key files.
- Dumps and key files · User-managed tag dumps and credentials.
- Built-in dictionaries · Immutable standard key dictionaries.
- Import/export · Shares and imports files through Android file providers.
- File provider paths
Offline tooling
Bundled content and external conversion support.
- Help and localized resources
- Dump converter · Converts MCT dumps for external RFID ecosystems.
tools/dump-file-converter/eml2mct.py - Distribution metadata · Supports Play, F-Droid, and direct APK distribution.
Connections 24
- Android app module → Android manifest: packages
- Android manifest → Main menu: launches activities
- Android manifest → NFC tech filter: uses NFC filtering
- Main menu → Read tag: opens
- Main menu → Write tag: opens
- Main menu → File and dump editors: opens
- Main menu → Offline tag tools: opens
- Read tag → Key map creator: maps selected keys
- Key map creator → Built-in dictionaries: loads dictionaries
- Key map creator → MCReader: authenticates and reads
- Read tag → Dumps and key files: saves dumps
- Write tag → Dumps and key files: loads dump and keys
- Write tag → MCReader: writes blocks
- File and dump editors → Dumps and key files: manages
- Import/export → Dumps and key files: imports and exports
- Import/export → File provider paths: uses
- Offline tag tools → Dumps and key files: analyzes dumps
- Read tag → Shared activity base: shares behavior
- Write tag → Shared activity base: shares behavior
- MCReader → Common: uses domain utilities
- Offline tag tools → Common: uses domain utilities
- Dump converter → Dumps and key files: converts formats
- Android app module → Help and localized resources: bundles
- Distribution metadata → Android app module: publishes