Skip to content

Conversation

@Senape3000
Copy link
Contributor

Proposed Changes

Refactored MIFARE keys management by separating storage from main config (bruce.conf) into dedicated file (/BruceRFID/keys.conf). Fixes SD card path bug and improves performance with human-readable format.

Types of Changes

  • Bugfix: SD card directory creation before file operations
  • New Feature: Dedicated keys file with comment support
  • Performance optimization: Append-only writes, reduced config size by 50%

Verification

  1. First boot creates /BruceRFID/keys.conf with 3 standard keys
  2. Add custom key via UI and verify append (no full rewrite)
  3. Test duplicate rejection and hex validation
  4. Verify SD ↔ LittleFS sync and fallback
  5. Test RFID authentication with loaded keys

Testing

✅ Full testing completed ([file:19]):

  • First boot, key addition, duplicate/invalid rejection
  • SD/LittleFS fallback scenarios
  • Manual file editing support
  • PN532 module integration verified
  • Backward compatibility confirmed

Linked Issues

Resolves SD card path bug where keys file was created in root instead of /BruceRFID/ directory.

User-Facing Change

MIFARE keys now stored in `/BruceRFID/keys.conf` (human-readable text file). Users can manually edit keys with any text editor. Automatic migration from old config format. No action required.
Further Comments
Zero breaking changes. Modified files: src/core/config.h, src/core/config.cpp. Full backward compatibility with existing RFID modules maintained

[MIFARE_KEYS_UPDATE.md](https://github.com/user-attachments/files/24414642/MIFARE_KEYS_UPDATE.md)

This document provides a comprehensive technical overview of SRIX and ST25TB contactless RFID memory chips, detailing their features, operating conditions, memory organization, command set, and application patterns.
Add custom documentation directory to .gitignore
Added a comprehensive README for the RFID JavaScript API, detailing features, usage, and implementation.
Updated RFID API documentation to reflect new features, including headless operation and enhanced JavaScript bindings.
Updated the README to include author information and credits, and modified the status of supported modules.
Updated README to include development goals and installation instructions.
Added a comprehensive refactoring report for MIFARE keys management, detailing the separation of key storage, new file structure, technical implementation, benefits, and testing checklist.
Refactor MIFARE key handling to load from a separate file and validate keys. Remove old MIFARE key handling code and ensure keys are appended correctly.
@Senape3000 Senape3000 mentioned this pull request Jan 4, 2026
@bmorcelli bmorcelli changed the base branch from main to dev January 5, 2026 11:46
bmorcelli and others added 5 commits January 5, 2026 08:48
Use external mifare keys manager
Updated for use mifare_keys_manager, external file for better code organization
external manager for mifare keys management
@Senape3000
Copy link
Contributor Author

Rewritten, the old version took up unnecessary space in config, now it's cleaner, more maintainable and clear. It has fallbacks for various eventualities. Already tested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants