Add macOS support for nonce extraction and key loading#27
Open
tomholford wants to merge 6 commits into
Open
Conversation
…~/dev/forks/mfkey32v2 per user request)
- Replace Linux-only detectFlipperLinux with _detect_flipper_port supporting macOS (ls /dev/cu.usbmodem* etc), Linux, basic POSIX. - Prefers port names containing 'flip'. - Update _connectToFlipperCli + --detect handler. - Relax platform guards and improve error messages + argparse text. - Original Linux behavior preserved for compatibility.
34397e5 to
fbd49a9
Compare
- In --cli full-auto path (writeUserDictToFlipper): always create a .bkp via storage copy before removing + rewriting the user dict. Merge of old+new keys was already present; now more explicitly safe. - Add new Docs/macOS.md with mac-specific steps (port discovery with ls /dev/cu.*, pyserial via pip, qFlipper hidden files, web fallback, post-load cache clear). - Update Docs/Flippercli.md with pointer to the macOS guide. - Reminds the critical device paths: /ext/nfc/.mfkey32.log and /ext/nfc/assets/mf_classic_dict_user.nfc This commit makes the workflow much safer on macOS while preserving existing behavior.
…OS flow - New executable flipper-crack script: builds if needed, ensures pyserial, then runs --cli with helpful messages. - Makefile: added 'make flipper-crack' phony target (same behavior). - Minor update to Docs/macOS.md to document the new helper. Users on macOS can now often just run ./flipper-crack after the initial clone+make (once nonces are collected on the device).
- Confirmed on this macOS machine: - make mfkey32v2 builds a working binary. - README example cracks successfully (Found Key: [a0a1a2a3a4a5]). - mfkey_extract.py --help and --detect work (detector found real attached device /dev/cu.usbmodemflip_Kuch1n01). - flipper-crack wrapper and make flipper-crack target are present and executable. - Added Verification section to Docs/macOS.md summarizing the above + reminder of the device paths. - All changes are on the feature branch in ~/dev/forks/mfkey32v2. The setup is ready for actual nonce extraction + key load (run ./flipper-crack or the python --cli when you have collected nonces on the Kuch1n01 device).
…ditor files Keeps the working tree clean after make + python runs (binary, __pycache__, any .nfc or log files produced by the tools).
fbd49a9 to
ada6bfa
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds first-class macOS support to the Flipper Zero CLI workflow for collecting nonces with "Detect Reader" and recovering MIFARE Classic keys with
mfkey32v2, then safely loading them into the device user dictionary.Previously the Python extractor was Linux-only for serial port detection, had no automatic backup before overwriting the user dictionary, and documentation assumed Linux paths and commands. macOS users had to manually discover ports and risked losing their existing key dictionary.
Changes
mfkey_extract.py: Replace Linux-onlydetectFlipperLinuxwith_detect_flipper_portsupporting macOS (/dev/cu.usbmodem*, preferring names containing "flip"), Linux, and basic POSIX fallbacks. Updated connection logic,--detectmode, error messages, and argparse description.--clifull-auto path, explicitly create a.bkpcopy ofmf_classic_dict_user.nfcon the device before removing and rewriting the merged set of keys.Docs/macOS.md: Dedicated guide covering brew requirements, port discovery withls /dev/cu.*,pyserialinstall, qFlipper hidden files, web/lab.flipper.net fallback, the critical device paths (/ext/nfc/.mfkey32.logand/ext/nfc/assets/mf_classic_dict_user.nfc), cache clearing, and post-load steps.flipper-crackwrapper script andmake flipper-cracktarget that handles build + pyserial + runs--cli.Docs/Flippercli.md: Added pointer to the new macOS guide..gitignore: Added common ignores for the builtmfkey32v2binary,__pycache__, generated.nfcfiles, and logs.Validation
mfkey32v2binary with the exact example from README.md (successfully recoversa0a1a2a3a4a5).--cliflow tested on macOS 26.5 (Apple M4) with attached Flipper Zero (auto-detected as/dev/cu.usbmodemflip_YourName).--clean-cacheand--clean-mfkey32-logmaintenance commands successfully against the device.Post-Merge
./flipper-crack(ormake flipper-crack) after collecting nonces.