Commit Graph

34 Commits

Author SHA1 Message Date
Sergey Gavrilov
c511c67e71
Core: thread allocation shortcut (#2007)
* Core: thread alloc+set shortcut
* Apps: use thread allocation shortcut
* Mark some service threads as services
* Init BT as soon as possible

Co-authored-by: あく <alleteam@gmail.com>
2022-11-23 21:49:17 +09:00
hedger
f9730bcafe
fbt: lint fixes (#2008)
* lint: exclude "lib" subfolder from naming checks; fbt: moved LINT_SOURCES from literal strings to Dir() nodes
* lint: also exclude hidden directories

Co-authored-by: あく <alleteam@gmail.com>
2022-11-12 19:03:22 +09:00
Astra
e7c4b40dbe
Force card types in extra actions (#1961)
* Mifare Classic forced read
* Add all the needed card types
* nfc: remove unused scene
* nfc: remove unused worker state
* nfc: fix read card type scene state usage
* nfc: move NfcReadMode to NfcDevData struct
* nfc: fix bank card reading and scene navigation
* nfc magic: fix magic deactifate function

Co-authored-by: gornekich <n.gorbadey@gmail.com>
Co-authored-by: あく <alleteam@gmail.com>
2022-11-11 01:29:57 +09:00
Astra
820afd2aec
NFC Unit tests part 1.1 (#1927)
* Mifare Classic 1/4K, 4/7b uid, NFC-A: NFC-A is not complete yet, as there are no 4b uid tests. Also, Mifare Classic tests don't cover the key cache yet.
* NFC unit tests require access to the NFC app
* Made nfc_device_save accept full path as an argument
* Move from cstrs to furi strings and fix logic
* nfc tests: fix memory leak
* nfc: add mf_classic_get_total_blocks() to API
* nfc tests: simplify nfc tests
* nfc: fix memory leak in shadow file saving
* nfc: fix set uid scene
* nfc: fix saving files
* nfc: fix preload nfc file path
* nfc: remove comments

Co-authored-by: Sergey Gavrilov <who.just.the.doctor@gmail.com>
Co-authored-by: gornekich <n.gorbadey@gmail.com>
Co-authored-by: あく <alleteam@gmail.com>
2022-11-11 01:20:35 +09:00
gornekich
3985b456c3
NFC: fix crash on MFC read (#1993)
* nfc: fix nfc_worker_stop logic
* nfc: fix stop order

Co-authored-by: あく <alleteam@gmail.com>
2022-11-10 03:12:55 +09:00
gornekich
bf8fd71c00
NFC magic cards support (#1966)
* nfc magic: introduce nfc app to work with magic cards
* nfc: add nfc device functions to API
* nfc magic: add bacis scenes
* nfc magic: add wrong card and write confirm scenes
* nfc magic: introduce magic lib
* nfc magic: write magic lib
* nfc magic: add write commands to magic lib
* nfc magic: work on worker
* furi_hal_nfc: add bits data exchage method to API
* nfc magic: rework with new API
* nfc magic: add check and wipe scenes
* nfc magic: add icons, gui fixes
* nfc: format python src

Co-authored-by: あく <alleteam@gmail.com>
2022-11-04 16:01:44 +09:00
gornekich
93a6e17ce5
[FL-2933] Mf Classic initial write, update, detect reader (#1941)
* nfc: introduce nfc write
* nfc: add write logic
* nfc worker: add write state
* nfc: add mfc update logic
* nfc: add update success logic
* nfc: add custom card for detect reader
* nfc: update write logic
* nfc: add halt command, add notifications
* nfc: add write fail scene
* nfc: fixes and clean up
* nfc: fix navigation ad notifications
* nfc: fix detect reader nfc data setter

Co-authored-by: あく <alleteam@gmail.com>
2022-10-29 01:10:16 +09:00
gornekich
dfbe21e720
NFC fixes part 3 (#1885)
* nfc: fix read next key
* nfc: verify new line ending in user dictionary file
* nfc: fix cache save
* nfc: add unit test for dict load
* nfc: fix total key count in dictionary

Co-authored-by: あく <alleteam@gmail.com>
2022-10-18 02:10:41 +09:00
Astra
55f8beef9f
[FL-2876] MFC Improvements Part 2/2 (#1868)
* Remove keys incorrectly added by the key cache
* Improve responsiveness while checking for re-used keys and fix skipping keys when card is removed
* Actually check if the card is completely read
* Discard incorrect keys on a lower level
* nfc: clean up

Co-authored-by: gornekich <n.gorbadey@gmail.com>
2022-10-14 01:23:29 +09:00
gornekich
2552278a3d
[FL-2883] NFC: bank card rework reading (#1858)
* nfc: remove bank card save option
* nfc: remove bank card save from nfc device
* nfc: remove unused function in emv
* nfc: try several times to start emv application
* nfc: add AID display fallback for bank cards

Co-authored-by: あく <alleteam@gmail.com>
2022-10-12 02:13:12 +09:00
Sergey Gavrilov
4000f0cac5
[FL-2870] Printf function attributes (#1841)
* Furi strings: printf attribute
* Logs: printf attribute
* Plugins: adapt
* Plugins: accommodate
* Unit tests: accommodate

Co-authored-by: あく <alleteam@gmail.com>
2022-10-07 22:35:15 +09:00
Sergey Gavrilov
38a82a1907
[FL-2839] Furi stream buffer (#1834)
* Core: stream buffer
* stream buffer: API and usage
* stream buffer: documentation
* stream buffer: more documentation
* Furi: fix spelling

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2022-10-07 21:27:11 +09:00
Astra
eaa3adf98a
[FL-2868] Remove string_push_uint64 (#1832)
* Remove string_pust_uint64
* Oops, furi strings now
* Remove dead code
* Remove unneeded import

Co-authored-by: あく <alleteam@gmail.com>
2022-10-07 03:51:30 +09:00
Astra
6dde5586af
[FL-2803] Mifare Classic read improvements Part 1 (#1822)
* Reuse found keys when reading a card
* Fix keys not being read if no newline at the end of the file
* Actually read all keys from the dictionary
* Support for furi_string
* Check only for re-used key after the current sector
* Declare the key attack function as static
* nfc: change logs, check worker state

Co-authored-by: gornekich <n.gorbadey@gmail.com>
Co-authored-by: あく <alleteam@gmail.com>
2022-10-07 02:07:56 +09:00
gornekich
5de2c32c81
[FL-2864] NFC update detect reader (#1820)
* nfc: update detect reader view
* nfc: make detect reader more interractive
* nfc: update icons
* nfc: fix detect reader gui
* nfc: fix gui, fix worker events
* nfc: fix notifications
* nfc: add nfc_worker NULL assert

Co-authored-by: あく <alleteam@gmail.com>
2022-10-07 01:58:17 +09:00
Sergey Gavrilov
4bf29827f8
M*LIB: non-inlined strings, FuriString primitive (#1795)
* Quicksave 1
* Header stage complete
* Source stage complete
* Lint & merge fixes
* Includes
* Documentation step 1
* FBT: output free size considering BT STACK
* Documentation step 2
* py lint
* Fix music player plugin
* unit test stage 1: string allocator, mem, getters, setters, appends, compare, search.
* unit test: string equality
* unit test: string replace
* unit test: string start_with, end_with
* unit test: string trim
* unit test: utf-8
* Rename
* Revert fw_size changes
* Simplify CLI backspace handling
* Simplify CLI character insert
* Merge fixes
* Furi: correct filenaming and spelling
* Bt: remove furi string include

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2022-10-06 00:15:23 +09:00
Tom Samstag
e6e1e7fe15 Add formatting to DESfire data dump (#1784)
Co-authored-by: gornekich <n.gorbadey@gmail.com>
2022-09-28 02:02:18 +09:00
Andrea Sacchi
3846852f2b
NFC Fix Mifare Classic (#1769)
* Fix Mifare Classic key str to int conversion: Wrong cast lead to unexpected behavior converting key from str to int.
* Nfc: fix type cast in mf_classic_dict and add basic unit tests

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2022-09-23 02:35:28 +09:00
David
f5ff6438d1
NFC user dict list, delete, and de-duplication. (#1533)
* Add MFC user keys list
* Leakey submenu fix
* Set next target for Save/Delete success scenes
* Delete individual user keys
* Update count of total keys
* Fix memory leak
* Check for duplicate keys
* Remove a submodule that I never added?
* Swap and position icons
* Revamp according to design doc
* Rename icons to include size and replace keychain icon with smaller variant
* Fix typos
* Final fixes
* Fufill requested changes
* Cleanup comments
* Merge dev after SD app loading
* Fixing icon names
* Revert merge mistakes and API version
* Scene switching adjustments
* F7: add/change/remove some nfc icons in api_symbols.csv

Co-authored-by: あく <alleteam@gmail.com>
2022-09-20 01:43:53 +09:00
Astra
9f3b80e606
Add new card parsers (#1503)
* Add the "Two cities" parser
* Add plantain and plantain4k parsers
* Add new parsers to the supported list
* United card PoC
* Fix nfc device not sleeping
* Completely read the 4K troika variants
* Correct naming
* Update to reflect upstream changes
* Add support for MfUl info
* Fix parsers
* Card type detection fixes
* Remove debug info
* Fixes for the verification of cards
* nfc: fix verification for supported cards
* nfc: remove unused vars
* Improve card reading reliability and fix plantain
* plantain: change log level

Co-authored-by: gornekich <n.gorbadey@gmail.com>
2022-09-20 01:05:04 +09:00
SG
b9a766d909 [FL-2627] Flipper applications: SDK, build and debug system (#1387)
* Added support for running applications from SD card (FAPs - Flipper Application Packages)
* Added plugin_dist target for fbt to build FAPs
* All apps of type FlipperAppType.EXTERNAL and FlipperAppType.PLUGIN are built as FAPs by default
* Updated VSCode configuration for new fbt features - re-deploy stock configuration to use them
* Added debugging support for FAPs with fbt debug & VSCode
* Added public firmware API with automated versioning

Co-authored-by: hedger <hedger@users.noreply.github.com>
Co-authored-by: SG <who.just.the.doctor@gmail.com>
Co-authored-by: あく <alleteam@gmail.com>
2022-09-15 02:21:03 +09:00
VVX7
8d8481b17f
fix buffer overflow in mifar ul load (#1697)
Co-authored-by: gornekich <n.gorbadey@gmail.com>
2022-09-05 20:42:59 +09:00
gornekich
1853359d78
[FL-2759], [FL-2766] NFC collect params for mfkey32 attack (#1643)
* nfc: start nfc over rpc
* nfc: add detect reader state
* nfc: add reader analyzer
* nfc: rework reader analyzer
* reader_analyzer: print collected nonces to debug
* reader analyzer: add save on SD card
* reader_analyzer: separate mfkey related part to different file
* mfkey32: add logic for collecting parameters
* nfc: rework pcap with reader analyzer
* nfc: add logger for reader
* nfc: clean up
* nfc: add detect reader view
* nfc: add detect reader and mfkey nonces scenes
* nfc: add mfkey comlplete scene
* nfc: add new assets
* nfc: fix gui
* nfc: fix iso14443-4 UID emulation
* nfc: add no sd card notification
* nfc: fix grammar

Co-authored-by: あく <alleteam@gmail.com>
2022-09-03 21:25:36 +09:00
Walter Doekes
611b7e15ed
Remove execute permissions from *.c and *.h files (#1651)
* Add permission fix (no execute bit for source files) to fbt lint|format
* Remove execute bit from 59 source files using fbt format
* Also list which permissions are unwanted in lint.py
* Also remove exec permissions from lib/../rfal_nfc.c

Co-authored-by: あく <alleteam@gmail.com>
2022-08-30 01:20:57 +09:00
Sebastian Mauer
1350dcaf63
Add support for PAC/Stanley tags (#1648)
* Add support for PAC/Stanley tags
* Address review comments
2022-08-30 01:04:17 +10:00
Yukai Li
ab4bb55d0f
nfc: Change furi_assert to furi_crash for default switch cases (#1662)
* nfc: Change furi_assert to furi_crash for default switch cases
* Nfc: change MiFare Ultralight crash message

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2022-08-26 01:07:54 +09:00
gornekich
8992f8ac36
Fix mifare ultralight/ntag unlock #1624
Co-authored-by: あく <alleteam@gmail.com>
2022-08-23 02:14:31 +09:00
gornekich
560ea5f995
[FL-2714] New NFC info screens (#1605)
* nfc: add scroll element for info
* widget: format lines for scroll text element
* widget: fix new line generation
* widget: finish element text scroll
* nfc: rework ultralight and NTAG info scenes
* nfc: rework mf classic info screens
* nfc: rework nfca info scenes
* nfc: fix mf ultralight navigation
* widget: add documentation
* nfc: rework bank card infO
* nfc: rework device info scene
* nfc: fix incorrect atqa order
* mf ultralight: remove unused function
* widget: add mutex for model protection
* widget: fix memory leak
* nfc: rework delete scene
* nfc: fix selected item in saved menu scene
* widget: fix naming in text scroll element
* nfc: fix navigation from delete success
* nfc: add dictionary icon
* widget: fix memory leak
2022-08-18 00:08:13 +09:00
Astra
01eb92db06
Mifare Classic emulation fixes (#1566)
* Add fix for field
* More small bugfixes
* Clean up
2022-08-10 01:45:52 +10:00
gornekich
173c94156d
NFC: Add Skylanders support (#1553)
* nfc: add skylanders support
* nfc: format sources

Co-authored-by: あく <alleteam@gmail.com>
2022-08-08 00:33:14 +09:00
Vitaliya Chumakova
9ffcc52ada
Mifare Ultralight authentication (#1365)
* mifare ultralight auth prototype
* it works!
* Reference source
* use countof
* rework everything
* oops forgot scenes
* build: revert changes in manifest, stack size
* build: fix buid, format sources
* nfc: update unlock ultralight GUI
* nfc: fix byte input header
* nfc: add new scenes for locked ultralight
* nfc: add data read to ultralights
* nfc: add unlock option in mf ultralight menu
* nfc: add data read init in ultralight generation
* nfc: lin sources, fix unlocked save
* nfc: format python sources
* nfc: clean up

Co-authored-by: gornekich <n.gorbadey@gmail.com>
2022-08-08 00:09:00 +09:00
Fedor Indutny
3ee93e1a82
nfc: make dict attack more interactive (#1462)
* nfc: deduplify dict attack worker code
* nfc: make dict attack more interactive

Co-authored-by: gornekich <n.gorbadey@gmail.com>
Co-authored-by: あく <alleteam@gmail.com>
2022-08-04 02:07:35 +09:00
gornekich
c40e8811d6
[FL-2701], [FL-2702], [FL-2699] NFC fixes (#1478)
* nfc: change read scene views
* nfc: rework return after save success
* nfc: add fallback to read UID of unrecognized iso14443-3
* nfc: show mifare desfire on read success
* nfc: add restore original confirm scene
* nfc: fix icon name
* nfc: clear 6 bit in SAK to emulate 14443-4 uids
* nfc: don't change original sak
2022-07-28 21:34:28 +09:00
gornekich
9c59bcd776
[FL-2605] NFC new design (#1364)
* nfc: add new read scene

* lib: refactore nfc library

* mifare desfire: add read card fuction

* lib nfc: add auto read worker

* nfc: add supported cards

* nfc: add mifare classic read success scene

* nfc: add troyka support

* submodule: update protobuf

* nfc: mifare classic keys cache

* nfc: rework mifare classic key cache

* Correct spelling

* nfc: add user dictionary

* nfc: introduce block read map in fff

* nfc: rework dict attack

* nfc: improve dict attack

* nfc: rework mifare classic format

* nfc: rework MFC read with Reader

* nfc: add gui for MFC read success scene

* nfc: fix dict attack view gui

* nfc: add retry and exit confirm scenes

* nfc: add retry and exit scenes navigation

* nfc: check user dictionary

* nfc: remove unused scenes

* nfc: rename functions in nfc worker

* nfc: rename mf_classic_dict_attack -> dict_attack

* nfc: change scenes names
* nfc: remove scene tick events
* nfc: rework dict calls with buffer streams
* nfc: fix notifications
* nfc: fix mf desfire navigation
* nfc: remove notification from mf classic read success
* nfc: fix read sectors calculation
* nfc: add fallback for unknown card
* nfc: show file name while emulating
* nfc: fix build
* nfc: fix memory leak
* nfc: fix desfire read
* nfc: add no dict found navigation
* nfc: add read views
* nfc: update card fix
* nfc: fix access bytes save
* nfc: add exit and retry confirm to mf ultralight read success
* nfc: introduce detect reader
* nfc: change record open arg to macros
* nfc: fix start from archive

Co-authored-by: Astra <astra@astrra.space>
Co-authored-by: あく <alleteam@gmail.com>
2022-07-27 00:30:49 +09:00