* Linear and dickert mahs fixes
* fix dip pattern
* proper fix
by WillyJL
* Fix unit tests
Linear Decoder now decodes more linear signals
---------
Co-authored-by: hedger <hedger@users.noreply.github.com>
* FeliCa: Handle non-hardware Polling commands
NFC TagInfo and possibly other readers rely on Polling commands with Request Code of 1 (default System Code request) or non-FFFF System Code to detect card type. Since the NFC controller doesn't seem to handle them in hardware and simply bubbles them up, and then the Flipper firmware will just ignore them and refuse to respond afterwards, this causes the reading operation to fail.
This commit adds a simple handler for such Polling commands so that readers behaving like NFC TagInfo could read the emulated card without failing.
* Only handle cases when System Code is not FFFF
The NFC controller should handle Polling commands with the System Code set to FFFF, so it's not necessary for the firmware to handle it.
* Remove system code logging
* More cleanups
* Remove the claim that we need a poller change
We already have enough information to determine whether or not the card supports NDEF since SYS_OP register value is included in all current Lite-S card dumps.
* Respond to 12FC polling command when needed
* Handle Polling with NDEF and Lite-S Service Code
This allows the reader to specifically select the service by naming the Service Code.
* Introduce API for manual handling of Polling commands
Introduce nfc_felica_listener_timer_anticol_start() and nfc_felica_listener_timer_anticol_stop(). These are for now just wrappers around the block_tx timer that can be used to delay the response until the desired Time Slot. Thanks to the loose timing constraints of FeliCa collision resolution protocol, no compensation seems to be necessary. Also enabled the block_tx timer for FeliCa listener, but with both compensation and fdt set to 0 to keep the original behavior of not using the timer during normal data exchange.
This API is now being used for handling Polling commands that are not handled by the NFC controller on the hardware side.
* Document target_time_slot
* Implement changes suggested by @RebornedBrain
* api: f18 version sync
* nfc: added stubs for `nfc_felica_listener_timer_anticol` for unit tests
---------
Co-authored-by: hedger <hedger@users.noreply.github.com>
Co-authored-by: hedger <hedger@nanode.su>
* CLI: Fix long delay with quick connect/disconnect
noticeable with qflipper, for some reason it sets DTR on/off/on again
so flipper starts CLI, stops it, then starts again
but cli shell is trying to print motd, and pipe is already broken
so each character of motd times out for 100ms
changing pipe timeout to 10ms works too, but is just a workaround
it didnt always happen, i think that variable time of loading ext cmds
made it so on ofw it usually manages to print motd before pipe is broken
on cfw with more ext commands it always hung, on ofw only sometimes
important part is bailing early in cli shell
in cli vcp i made it cleanup cli shell on disconnect so it doesnt stay
around after disconnecting usb, might free a little ram maybe
* cli_shell: possibly more robust fix?
* Fix use after free crash
* cli_shell: waste even less time
Co-Authored-By: WillyJL <me@willyjl.dev>
---------
Co-authored-by: Anna Antonenko <portasynthinca3@gmail.com>
Co-authored-by: hedger <hedger@users.noreply.github.com>
* feat: pinning settings in favorites
* include archive in unit tests fw
* change settings icon
* update text with suggestions from the ui team
* Small touch of constness
---------
Co-authored-by: あく <alleteam@gmail.com>
Co-authored-by: hedger <hedger@users.noreply.github.com>
Co-authored-by: hedger <hedger@nanode.su>
* Support longer advertised BLE UUID
* BLE: support manufacturer data
* Don't pair when GapPairingNone
* Add PR feedback
---------
Co-authored-by: hedger <hedger@users.noreply.github.com>
* Update and fix JS docs
This could really use some automation, atleast for API reference
There are TypeScript definitions and typedocs, we don't need to be monkeys copying and reformatting this to API reference by hand
* Fix bugged character
* JS: Fix Number.toString() with decimals
* Fix
* Forgot this one
* docs: mention per-view child format
* Added @portasynthinca3 to docs' codeowners
* Updated CODEOWNERS
---------
Co-authored-by: Anna Antonenko <portasynthinca3@gmail.com>
Co-authored-by: hedger <hedger@nanode.su>
Co-authored-by: hedger <hedger@users.noreply.github.com>
* Add div() to API
* Revert "Add div() to API"
This reverts commit e03b5c4244.
* Use / and %
* NFC: More MFC NDEF fixes
* Simplify duplicated code in MFC data generator
* NFC: Print NDEF hex data with pretty format
* NFC: Consider NDEF strings with last \0 byte as text
* Pretty Format: Add padding to last line to keep table width
---------
Co-authored-by: hedger <hedger@users.noreply.github.com>
* NFC: Possibly fix ISO15693-3 save crash with no data
* Also prevent malloc(0) if block size or count is 0
---------
Co-authored-by: hedger <hedger@users.noreply.github.com>
* 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
* Move OTG controls to the power service
* Accessor: add missing power service import
* Power: add is_otg_enabled to info and properly handle OTG enable with VBUS voltage present
* Power: method naming
* Power: add backward compatibility with old-style use of furi_hal_power
* Scripts: lower MIN_GAP_PAGES to 1
* SubGhz: fix incorrect logging tag
* SubGhz: delegate OTG management to power service
* Power: fix condition race, various improvements
Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
* feat: universal ir signal selection
* fix: f18, format specifiers
* update labels with suggestions from the ui team
Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
* Fixed MF3ICD40 DESFire cards soft-locking NFC application due to read free memory being an unsupported function, added naming for DESFire cards
* NFC: slightly more granular desfire card type resolution
Co-authored-by: あく <alleteam@gmail.com>
* nfc: Fix MIFARE Plus detection
MIFARE Plus original doesn't have GetVersion support, so detection for SL2 has been moved. Also, SL2 only exists in MIFARE Plus X, so despite it not being specified in the type identification procedure chart, it's safe to call it for what it is.
* Fix spelling
* TODO: mark as non flipper one
Co-authored-by: あく <alleteam@gmail.com>
* WIP: fix lost BadBLE keystrokes
* Switch to semaphores for synchronization
* Move checking to the gap level
* Remove leftovers from hid_service
* Remove more leftovers from hid_service
* De-allocate the semaphore after use
* Change the timeout to account for unforeseen situation
* Update F18 API
* Fix naming and unbump api version
* Move away from semaphores
* Remove the left over include
* Ble: cleanup error handling in ble_gatt_characteristic_update
* Fix PVS warning
Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
* Initial structure for nonce collection
* Nonce logging
* Dictionary attack structure
* Fix compilation
* Identified method to reduce candidate states
* Use EXT_PATH instead of ANY_PATH
* Use median calibrated distance, collect parity bits
* Modify parity collection
* Fixed parity bit collection
* Add note to fix nonce logging
* Fix nonce logging
* Clean redundant code
* Fix valid_nonce
* First attempt disambiguous nonce implementation
* FM11RF08S backdoor detection
* Initial accelerated dictionary attack for weak PRNGs
* Refactor to nested dictionary attack
* Renaming some variables
* Hard PRNG support for accelerated dictionary attack
* Update found keys, initial attempt
* Update found keys, second attempt
* Code cleanup
* Misc bugfixes
* Only use dicts in search_dicts_for_nonce_key if we have them
* Collect nonces again
* Should be detecting both backdoors now
* Relocate backdoor detection
* Hardnested support
* Fix regression for regular nested attack
* Backdoor read
* Backdoor working up to calibration
* Backdoor nested calibration
* Don't recalibrate hard PRNG tags
* Static encrypted nonce collection
* Update TODO
* NFC app UI updates, MVP
* Bump f18 API version (all functions are NFC related)
* Add new backdoor key, fix UI status update carrying over from previous read
* Clear TODO line
* Fix v1/v2 backdoor nonce collection
* Speed up backdoor detection, alert on new backdoor
* Add additional condition to backdoor check
* I'll try freeing memory, that's a good trick!
* Do not enter nested attack if card is already finished
* Do not reset the poller between collected nonces
* Clean up various issues
* Fix Hardnested sector/key type logging
* Add nested_target_key 64 to TODO
* Implement progress bar for upgraded attacks in NFC app
* Typo
* Zero nested_target_key and msb_count on exit
* Note TODO (malloc)
* Dismiss duplicate nonces
* Fix calibration (ensure values are within 3 standard deviations)
* Log static
* No nested dictionary attack re-entry
* Note minor inefficiency
* Uniformly use crypto1_ prefix for symbols in Crypto1 API
* Fix include paths
* Fix include paths cont
* Support CUID dictionary
* Fix log levels
* Avoid storage errors, clean up temporary files
* Handle invalid key candidates
* Fix memory leak in static encrypted attack
* Fix memory leak, use COUNT_OF macro
* Use single call to free FuriString
* Refactor enums to avoid redefinition
* Fix multiple crashes and state machine logic
* Fix inconsistent assignment of known key and known key type/sector
* Backdoor known key logic still needs the current key
* Larger data type for 4K support
* Fix typo
* Fix issue with resume logic
* Mark TODOs for next PR
* Remove redundant assignment
* Fix size_t format specifier
* Simplify auth_passed condition
Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
Co-authored-by: gornekich <n.gorbadey@gmail.com>
Per the comment at the top of the file, defining DIGITAL_SIGNAL_DEBUG_OUTPUT_PIN
to be a GpioPin variable name should allow additional debug output on
that pin. However, this would not work without modifying the file as
well to add the furi_hal.h header. Wrap including that header in the
same macro define to automatically include it when used.
Fixes: d92b0a82cc ("NFC refactoring (#3050)")
Signed-off-by: Kris Bahnsen <Kris@KBEmbedded.com>
Co-authored-by: hedger <hedger@users.noreply.github.com>
* reduced reserved memory size for system stack; added temporary markup to monitor usage
* fbt: relink elf file on linker script change; removed debug memory fill
* Make PVS Happy
* Make doxygen happy
Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>