94 Commits
Author SHA1 Message Date
MX 65d4ddabd8 Merge remote-tracking branch 'OFW/dev' into dev 2026-07-27 23:15:43 +03:00
Cole MunzandGitHub 9c173b4651 LFRFID: fix the Pyramid trailing Wiegand parity bit (#4426)
protocol_pyramid_add_wiegand_parity() computes the trailing odd-parity
bit with protocol_pyramid_get_parity(source + length / 2, ...). length is
a bit count (24), so source + length / 2 moves the pointer 12 bytes,
but wiegand[] in protocol_pyramid_encode() is 3 bytes. It should read
bits 12..23 of the same buffer.

So the parity bit we transmit comes from stack memory past wiegand[]
instead of the card number. Checked every 8-bit FC against every 16-bit
card number: the bit is wrong for essentially half of them, which a
reader that validates 26-bit Wiegand parity rejects. Our own decoder only
checks the CRC-8 and the format length, so reading a written card back
with a Flipper doesn't show it.

Give get_parity an explicit start position instead of doing pointer
arithmetic with a bit count. The even-parity call keeps reading bits
0..11 and is unchanged.

Signed-off-by: Cole Munz <colemunz@gmail.com>
2026-07-27 20:19:53 +03:00
Cole MunzandGitHub 9d1bd9e4f2 LFRFID: NUL-terminate the PAC/Stanley card id before parsing it (#4427)
protocol_pac_stanley_decode() fills an 8-byte asciiCardId[] and hands it
to hex_chars_to_uint8(), which takes no length and loops
while(*value_str && value_str[1]) - it stops at a terminator the buffer
doesn't have. So every successful decode reads asciiCardId[8] and [9] off
the end of the array, and if those two stack bytes happen to be hex
digits it also writes past protocol->data, which is 4 bytes.

Made the buffer 9 bytes and zeroed it. The loop still fills [0..7] and
the parse now stops after exactly 4 bytes, which is what
PAC_STANLEY_DECODED_DATA_SIZE expects.

Signed-off-by: Cole Munz <colemunz@gmail.com>
2026-07-27 19:58:24 +03:00
b8c5858f40 [RFID]: Fix reading T5577 tags that hold multiple EM4100 IDs (#1025)
* [LFRFID]: Fix reading T5577 tags that hold multiple EM4100 IDs

A T5577 configured to emit more than one EM4100 frame per cycle (e.g. two IDs
written by the T5577 Multi Writer app) hung on Read.

The Electra protocol (2024) gave the EM4100 decoder a 64-bit "the frame must be
followed by a header" lookahead to tell EM4100 and Electra apart. That pushed
each decode ~128 bits past the read worker's per-decode reset, so a two-frame
tag locked into rigid A/B alternation and never produced the 3 identical decodes
in a row that Read requires.

Only a 9-bit lookahead is actually needed (Electra's epilogue never begins with
9 ones), so shrink the epilogue register to 9 bits. This restores the
pre-Electra decode timing while keeping EM4100/Electra disambiguation. Also reset
encoded_epilogue in decoder_start, which the original change omitted.

Fixes #1024

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* [LFRFID]: Reset encoded_data in PAC/Stanley decoder_start

protocol_pac_stanley_decoder_start reset data/inverted/got_preamble but never
the encoded_data shift buffer - missing since the protocol was added, and unlike
every sibling decoder. Latent in practice (the buffer self-refreshes and
decoding is preamble/parity/checksum-gated), fixed for consistency.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* [LFRFID]: Changelog for multi-EM4100 T5577 read fix (#1025)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-04 18:28:11 +03:00
Skye GibbsandGitHub 97d6628f32 Make FDX-B readout more descriptive (#4297) 2026-06-30 20:04:05 +03:00
Mykhailo ShevchukandClaude Opus 4.8 c5242a5ae5 LFRFID Hitag micro: cold-reset for back-to-back writes + cleanup
Fix the 2nd-consecutive-write failure (same tag, not moved): a successful
write leaves the chip warm and emitting (its read-back verify holds the
field on, and the post-write latch cycles drive TTF emission), but the next
write's open-loop select chain assumed a cold power-on reset. Add a leading
cold field-off (HITAGMICRO_COLD_RESET_US) at the start of hitagmicro_write
so every session starts from a known cold state.

Review + simplify cleanup:
- pass the LOGIN password as an explicit hitagmicro_write(data, password)
  argument instead of a struct field the worker patched in; normalize the
  API version to 87.9 (a single bump over dev)
- collapse the variant password/name parallel arrays into one table
- use bit_lib_set_bit/get_bit instead of hand-rolled bit twiddling
- factor the field power-cycle into hitagmicro_field_on/off helpers
- guard the debug frame dump behind the log level
- name the write_chip_name buffer size; one scene status-text helper
- revert the global MAX_UNSUCCESSFUL_READS 10->5 (the too-long timer already
  shows the same "Still Trying" popup); fix a stale docstring + comments

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-07 17:51:13 +03:00
Mykhailo ShevchukandClaude Opus 4.8 5f54625479 LFRFID: write EM4100 to Hitag micro / ID82xx magic chips
Add an open-loop writer (lib/lfrfid/tools/hitagmicro.c) that clones an
EM4100 ID onto ID82xx / Hitag micro 8265 magic chips, mirroring
Proxmark3 `lf em 410x clone --htu`. Folded into the existing sequential
Write flow (no UI picker): each target (T5577, EM4305, Hitag micro x3
passwords) is written then verified by read-back, and the chip/variant
that actually took is reported on the success screen.

- New firmware API 87.10: hitagmicro_write, hitagmicro_variant_password,
  hitagmicro_variant_name, lfrfid_worker_get_write_chip_name.
- Detection verifies after each write (perf trade-off, see PR notes).
- Open-loop port of a closed-loop PM3 path; a few frame constants
  (flags 0x04/0x05, config byte1) still need on-tag validation.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-06 20:25:44 +03:00
MX aa75974395 feat: add Indala 224-bit (long format) RFID protocol support
OFW PR 4343 by kuzaxak
2026-03-07 23:53:22 +03:00
MX f7da751d5f Make FDX-B readout more descriptive
OFW PR 4297 by snowsign
2026-03-07 23:50:06 +03:00
MX 0c1c54c949 Merge remote-tracking branch 'OFW/dev' into dev 2025-09-25 23:42:49 +03:00
8c0c7f1bb9 LFRFID: Show ISO-3166 Country Names For Pet Chips (#4091)
* Country list header and printf

* off load country list to asset

* lint

* Field specific getters

* check string length before cutting

* lfrfid: minor iso3166 cleanup

---------

Co-authored-by: hedger <hedger@users.noreply.github.com>
Co-authored-by: hedger <hedger@nanode.su>
2025-09-25 21:22:56 +04:00
MX 610fd68b75 RFID: Add additional procotols supported by EM4305 chipset
by jamisonderek
2025-07-30 04:59:05 +03:00
MX 0b53be5cbd Add DEZ10
by realcatgirly

https://github.com/Next-Flip/Momentum-Firmware/pull/418/files
2025-06-25 02:50:18 +03:00
hedgerandGitHub 5fcaef25b0 Stricter constness for const data (#4126)
* libs: stricter constness for saving RAM with .rodata section; fbt: sdk: fixed signature generation for nested const params

* hal: additional fixes for constness in USB subsystem

* debug apps: additional usb-related fixes

* mjs: more consts for token parser

* fatfs: const driver struct

* hal: more consts for ble & nfc vars

* hal: made FuriHalSpiBusHandle static

* hal: made FuriHalI2cBusHandle static

* usb: restored previous api

* linter fixes

* API fixes
2025-03-31 19:23:32 +04:00
9f5e93bed8 LFRFID: Fix Detection Conflict Between Securakey and Noralsy Format (#4125)
* Securakey added parity check
* Format Sources

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2025-02-25 04:59:05 +09:00
MX b38d239eb8 Merge remote-tracking branch 'OFW/hedger/more-constness' into dev [ci skip] 2025-02-24 21:18:11 +03:00
MX 248341ac0a merge ofw pr 4125
by zinongli
2025-02-24 20:57:43 +03:00
hedger b0835220ac libs: stricter constness for saving RAM with .rodata section; fbt: sdk: fixed signature generation for nested const params 2025-02-22 16:05:56 +00:00
MX 1e3100e26e Merge remote-tracking branch 'OFW/dev' into dev 2025-02-20 04:22:42 +03:00
3698fc8d02 Fixed repeat in subghz tx_from_file command (#4099)
* Fixed repeat in subghz tx_from_file command
* Fix PVS warnings

Co-authored-by: あく <alleteam@gmail.com>
2025-02-20 10:10:41 +09:00
04fa7a9a7f LFRFID: Noralsy Format/Brand (#4090)
* beta version
* Working. No parsing yet. No checksum yet.
* T5 config caveat
* parsings

Co-authored-by: あく <alleteam@gmail.com>
2025-02-20 09:36:39 +09:00
MX 2919105bdb Merge remote-tracking branch 'OFW/dev' into dev [ci skip] 2025-02-13 01:01:02 +03:00
00f287e297 [FL-2754, FL-3945] EM4305 support (#4069)
* Initial EM4305 write support
* Support for writing EM4100 data to EM4305 blank tags
* F18 API version bump
* Satisfy pvs
* Lib: cleanup em4305 code
* Mask size fix
* Electra
* Fix leftovers from a previous implementation
* Viking
* Gallagher
* LFRFID: cleanup em4305

Co-authored-by: あく <alleteam@gmail.com>
2025-02-13 03:04:24 +09:00
AstraandGitHub 09a7cc2b46 [FL-3805] Fix EM4100 T5577 writing block order (#3904) 2024-10-02 13:10:19 +01:00
MX 876cbc40b7 Merge remote-tracking branch 'OFW/dev' into dev 2024-09-10 05:48:55 +03:00
Zinong LiandGitHub 78c5dd95d8 LFRFID GProxII Fix Writing and Rendering Conflict (#3888) 2024-09-09 18:23:18 +01:00
MX b6644d7727 merge fixes [ci skip] 2024-09-09 04:13:10 +03:00
MX 7711b2daae Merge remote-tracking branch 'OFW/dev' into dev 2024-09-09 04:11:35 +03:00
a122ee75f6 LFRFID: Guard GProxII Wiegand Check Against False Positive and Correct 36-bit Parsing (#3868)
* Update protocol_gproxii.c
* 36 bit format parsing fix
* Update protocol_gproxii.c
* wiegand checks as single function
* LfRfid: simplify gprox wiegand payload validation flow
* LfRfid: extra furi_check in gprox wiegand validation code

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2024-09-08 11:25:31 +01:00
3c75356b49 Fix detection of GProx II cards and false detection of other cards (#3869)
* Fix detection of GProx II cards and false detection of other cards as GProx II
* Fix incorrect parity starting bit

Co-authored-by: あく <alleteam@gmail.com>
2024-09-07 12:12:06 +01:00
MX 2e787dea47 merge ofw pr 3868 [ci skip]
by zinongli

LFRFID: Fix Guard GProxII False Positive and 36-bit Parsing
2024-09-04 04:46:31 +03:00
MX d2f0fbad45 Merge remote-tracking branch 'OFW/astra/gproxii-fix-detection' into dev 2024-09-04 03:17:29 +03:00
Astra a8482984de Fix incorrect parity starting bit 2024-09-03 17:42:49 +09:00
Astra 14a49759ce Fix detection of GProx II cards and false detection of other cards as GProx II 2024-09-03 17:20:49 +09:00
MX 856fe752de Merge remote-tracking branch 'OFW/dev' into dev 2024-08-02 11:09:56 +03:00
bec6bd381f Add lfrfid GProxII support (#3796)
* Add lfrfid GProxII support
* Add rfid GProxII support and correct linting issues.
* Add GProxII support for 26 and 36 bit cards
* Add GProxII 26 and 36 bit key - fixing minor typos
* Add GProxII 26 and 36 bit key - fix typo
* Add GProxII 26 and 36 Bit support - Change comment to not fail lint checking on XOR Value

Co-authored-by: あく <alleteam@gmail.com>
2024-08-01 07:21:49 +09:00
MX 57f3bce8e3 merge manually formatted stuff too 2024-07-16 01:01:17 +03:00
MX 726cb770d0 formatting 2024-07-15 20:02:45 +03:00
ffa3996a5e [FL-3867] Code formatting update (#3765)
* clang-format: AllowShortEnumsOnASingleLine: false
* clang-format: InsertNewlineAtEOF: true
* clang-format: Standard:        c++20
* clang-format: AlignConsecutiveBitFields
* clang-format: AlignConsecutiveMacros
* clang-format: RemoveParentheses: ReturnStatement
* clang-format: RemoveSemicolon: true
* Restored RemoveParentheses: Leave, retained general changes for it
* formatting: fixed logging TAGs
* Formatting update for dev

Co-authored-by: あく <alleteam@gmail.com>
2024-07-15 13:38:49 +09:00
MX e4f315188b fbt format 2024-07-08 07:37:28 +03:00
MX a7ca56cf4e Merge remote-tracking branch 'OFW/dev' into dev 2024-07-07 02:22:08 +03:00
hedgerandGitHub 7879876ba1 [FL-3863] toolchain: v37 (#3746)
* toolchain: v36
* toolchain: fixed cert path; lib: nanopb: updated to 0.4.8
* fbtenv: rolled back cert path for 3.11
* clang-format: updated config for v18
* linter fixes
* clang-format: properly regenerated config (`clang-format -style=file:.clang-format -dump-config > .clang-format-new; mv .clang-format-new .clang-format`)
* clang-format: AllowShortLoopsOnASingleLine: false
* toolchain: v37
* fbt: compilation_db.py: fixes for Windows
2024-07-05 18:27:21 +01:00
Mykhailo ShevchukandGitHub 9c8ab2bf3b Updated to DEZ 8 2024-07-05 01:05:48 +03:00
KorDenandGitHub 379d3c2008 LFRFID: add DEZ 10 display form for EM4100 2024-07-04 22:42:55 +03:00
d36396f35b LFRFID Securakey: Add Support for RKKTH Plain Text Format (#3728)
* Create protocol_securakey.c
* decode and render done
* Support for Radio Key Securakey
  Support both 26- and 32-bit format
  Solves issue #2619
* debugs and improvements
* Formatting in response to requested changes
* fixed wiegand parity bit calculation
* format
* debug unnecessary assert
* LfRfid: swap vendor and protocol names in securakey
* fixed manually generated keys issues
* fix bit length render error caused by bit length fix
* 1.0
* edit the citation in comments
* backward compatibility
* debug
* debug preamble false positives
* temporary fix: writing RKKTH causes second to last byte not encoded. unknown reason
* slightly more elegant solution to the weird bug
* plausible solution, much more elegant
* finally fixed it. stupid mistake
* clean up and format. ready for new PR

Co-authored-by: あく <alleteam@gmail.com>
2024-06-30 19:11:49 +01:00
MX ed2cef5eb0 merge ofw PR 3728 [ci skip]
by zinongli

https://github.com/flipperdevices/flipperzero-firmware/pull/3728/files
2024-06-22 17:17:27 +03:00
MX ec747892c9 Merge remote-tracking branch 'OFW/dev' into dev [ci skip] 2024-06-13 23:27:27 +03:00
e7d0afdc50 [LFRFID] Added Support for Securakey Protocol (#3697)
* Create protocol_securakey.c
* decode and render done
* Support for Radio Key Securakey
  Support both 26- and 32-bit format
  Solves issue #2619
* debugs and improvements
* Formatting in response to requested changes
* fixed wiegand parity bit calculation
* format
* debug unnecessary assert
* LfRfid: swap vendor and protocol names in securakey
* fixed manually generated keys issues
* fix bit length render error caused by bit length fix

Co-authored-by: あく <alleteam@gmail.com>
2024-06-13 12:55:51 +01:00
MX 17dbb4105d Merge remote-tracking branch 'OFW/dev' into dev 2024-06-06 00:35:40 +03:00
hedgerandGitHub 03196fa110 cleanup of various warnings from clangd (#3682)
* cleanup of various warnings from clangs
* lfrfid_debug: cast fixes
* subghz: binraw: round->roundf
* furi: thread: updated internal stack size variable to size_t
* github: fail faster on unsuccessful build
* unit_tests: double trouble
2024-06-03 14:43:23 +01:00