Commit Graph

310 Commits

Author SHA1 Message Date
MX
04c8093672
Merge remote-tracking branch 'OFW/dev' into dev 2024-10-31 21:17:01 +03:00
あく
561b4e947a
目覚め時計 (#3906)
* FuriHal: add RTC alarm support

* FuriHal: RTC alarm API. Alarm settings app. Alarm app.

* FuriHal: remove unnecessery init mode enters in RTC

* Update targets/f7/furi_hal/furi_hal_rtc.h

Co-authored-by: Silent <CookiePLMonster@users.noreply.github.com>

* Update targets/f7/furi_hal/furi_hal_rtc.c

Co-authored-by: Silent <CookiePLMonster@users.noreply.github.com>

* Update targets/f7/furi_hal/furi_hal_rtc.h

Co-authored-by: Silent <CookiePLMonster@users.noreply.github.com>

* FuriHal: add seconds in rtc alarm getter

* Alarm & Clock: redesign and cleanup setting and alarm apps, cleanup API

* Spelling and time separator in alarm

* Api Symbols: hide rtc alarm related methods

* Clock alarm: new thread cleanup routine, hour/minute separator in alarm

* Clock: move clock_settings_start into clock_settings fam

* Seettings: update clock and alarm UI according to figma

* Format icons

---------

Co-authored-by: Silent <CookiePLMonster@users.noreply.github.com>
2024-10-31 15:42:03 +04:00
Skorpionm
6d823835df
FurEventLoop: add support for FuriEventFlag, simplify API (#3958)
* Core: event_flag, removing duplicate code
* event_loop: add support furi_event_flags
* Examples: add missing free in event loop examples
* Furi: fix event flag
* Sync api symbols
* Unit_test: evet_loop_event_flags
* Fix multiple waiting list elements handling
* Unit_test: add event_loop_event_flag test
* FURI: event_loop add restrictions
* Fix multiple waiting lists items for good
* Improve FuriEventLoop unit tests
* Abolish callback return value
* Remove return value from callback signature
* Use bool level value instead of int32_t
* Add unit tests for FuriStreamBuffer
* Add unit tests for FuriSemaphore
* Speed up test execution
* Improve docs
* Add a stub for furi os-level primitives
* Add more checks for edge cases
* Allow event loop notification from ISR
* Bump api version

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
Co-authored-by: Georgii Surkov <georgii.surkov@outlook.com>
Co-authored-by: Georgii Surkov <37121527+gsurkov@users.noreply.github.com>
2024-10-31 10:58:16 +09:00
Nathan N
8427ec0098
MIFARE Classic Key Recovery Improvements (#3822)
* 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>
2024-10-31 09:53:58 +09:00
MX
3ba530555d
Merge remote-tracking branch 'noproto/nestednonces' into dev 2024-10-18 14:30:43 +03:00
noproto
db26c85b23 Backdoor known key logic still needs the current key 2024-10-18 00:46:24 -04:00
noproto
897817a829 Fix inconsistent assignment of known key and known key type/sector 2024-10-18 00:33:49 -04:00
MX
4b9b1769f7
Merge remote-tracking branch 'OFW/dev' into dev 2024-10-15 00:08:47 +03:00
あく
02f7c6b421
Merge branch 'dev' into nestednonces 2024-10-14 21:06:56 +01:00
porta
8a95cb8d6b
[FL-3893] JS modules (#3841)
* feat: backport js_gpio from unleashed
* feat: backport js_keyboard, TextInputModel::minimum_length from unleashed
* fix: api version inconsistency
* style: js_gpio
* build: fix submodule ._ .
* refactor: js_gpio
* docs: type declarations for gpio
* feat: gpio interrupts
* fix: js_gpio freeing, resetting and minor stylistic changes
* style: js_gpio
* style: mlib array, fixme's
* feat: js_gpio adc
* feat: js_event_loop
* docs: js_event_loop
* feat: js_event_loop subscription cancellation
* feat: js_event_loop + js_gpio integration
* fix: js_event_loop memory leak
* feat: stop event loop on back button
* test: js: basic, math, event_loop
* feat: js_event_loop queue
* feat: js linkage to previously loaded plugins
* build: fix ci errors
* feat: js module ordered teardown
* feat: js_gui_defer_free
* feat: basic hourglass view
* style: JS ASS (Argument Schema for Scripts)
* fix: js_event_loop mem leaks and lifetime problems
* fix: crashing test and pvs false positives
* feat: mjs custom obj destructors, gui submenu view
* refactor: yank js_gui_defer_free (yuck)
* refactor: maybe_unsubscribe
* empty_screen, docs, typing fix-ups
* docs: navigation event & demo
* feat: submenu setHeader
* feat: text_input
* feat: text_box
* docs: text_box availability
* ci: silence irrelevant pvs low priority warning
* style: use furistring
* style: _get_at -> _safe_get
* fix: built-in module name assignment
* feat: js_dialog; refactor, optimize: js_gui
* docs: js_gui
* ci: silence pvs warning: Memory allocation is infallible
* style: fix storage spelling
* feat: foreign pointer signature checks
* feat: js_storage
* docs: js_storage
* fix: my unit test was breaking other tests ;_;
* ci: fix ci?
* Make doxygen happy
* docs: flipper, math, notification, global
* style: review suggestions
* style: review fixups
* fix: badusb demo script
* docs: badusb
* ci: add nofl
* ci: make linter happy
* Bump api version

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2024-10-14 19:42:11 +01:00
hedger
57c438d91a
heap: increased size (#3924)
* 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>
2024-10-14 19:26:17 +01:00
RebornedBrain
0902fd49e1
NFC: iso14443_4a improvements. Canvas: extended icon draw. (#3918)
* Now 4a listener invokes upper level callback on Halt and FieldOff
* Added new method for drawing mirrored XBM bitmaps
* iso14443_4a poller logic enhanced
* Function renamed accroding to review suggestions
* Rename #2
* Api adjustements
* Correct API bump

Co-authored-by: あく <alleteam@gmail.com>
2024-10-14 18:22:47 +01:00
MX
2f102e61a9
Merge remote-tracking branch 'RebornedBrain/reborned/some_api_adjustments' into dev 2024-10-14 19:52:41 +03:00
RebornedBrain
ddd0fc80f8 Merge branch 'reborned/some_api_adjustments' of github.com:RebornedBrain/flipperzero-firmware into reborned/some_api_adjustments 2024-10-14 18:33:15 +03:00
RebornedBrain
9839db70f5 Api adjustements 2024-10-14 18:31:48 +03:00
Nathan N
889b19be92
Merge branch 'dev' into nestednonces 2024-10-14 10:42:21 -04:00
あく
edafd70d84
Merge branch 'dev' into reborned/some_api_adjustments 2024-10-14 14:59:52 +01:00
MX
ce32463b3e
Merge remote-tracking branch 'OFW/dev' into dev 2024-10-14 16:50:56 +03:00
あく
5190aace88
Furi: A Lot of Fixes (#3942)
- BT Service: cleanup code
- Dialog: correct release order in file browser
- Rpc: rollback to pre #3881 state
- Kernel: fix inverted behavior in furi_kernel_is_running
- Log: properly take mutex when kernel is not running
- Thread: rework tread control block scrubbing procedure, ensure that we don't do stupid things in idle task, add new priority for init task
- Timer: add control queue flush method, force flush on stop
- Furi: system init task now performs thread scrubbing
- BleGlue: add some extra checks
- FreeRTOSConfig: fix bunch of issues that were preventing configuration from being properly applied and cleanup
2024-10-14 14:39:09 +01:00
MX
a17cbd0419
Merge remote-tracking branch 'RebornedBrain/reborned/some_api_adjustments' into dev 2024-10-12 03:20:32 +03:00
RebornedBrain
676eab29f2 Function renamed accroding to review suggestions 2024-10-11 22:49:54 +03:00
MX
3ee8e3b18b
Merge remote-tracking branch 'noproto/nestednonces' into dev 2024-10-09 10:49:54 +03:00
Nathan N
56febb12b1
Merge branch 'dev' into nestednonces 2024-10-08 18:48:47 -04:00
Silent
5b36c5465d
FuriThread: Improve state callbacks (#3881)
State callbacks assumed they were invoked from the thread that changed
its state, but this wasn't true for FuriThreadStateStarting in the past,
and now it's not true for FuriThreadStateStopped either.

Now it is safe to release the thread memory form the state callback
once it switches to FuriThreadStateStopped. Therefore, pending deletion
calls can be removed.

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2024-10-08 20:50:31 +01:00
MX
306e34c64b
Merge remote-tracking branch 'OFW/dev' into dev 2024-10-07 04:47:24 +03:00
Nathan N
f346412e27
Merge branch 'dev' into nestednonces 2024-10-06 16:22:03 -04:00
あく
0469ef0e55
FuriHal, drivers: rework gauge initialization routine (#3912)
* FuriHal, drivers: rework gauge initialization, ensure that we can recover from any kind of internal/external issue
* Make PVS happy
* Format sources
* bq27220: add gaps injection into write operations
* Drivers: bq27220 cleanup and various fixes
* Drivers: bq27220 verbose logging and full access routine fix
* Drivers: better cfg mode exit handling in bq27220 driver
* Drivers: rewrite bq27220 based on bqstudio+ev2400, experiments and guessing. Fixes all known issues.
* PVS: hello license check
* Drivers: minimize reset count in bq27220 init sequence
* Drivers: bq27220 hide debug logging, reorganize routine to ensure predictable result and minimum amount of interaction with gauge, add documentation and notes.
* Drivers: more reliable bq27220_full_access routine
* Drivers: replace some warning with error in bq27220
* Drivers: move static asserts to headers in bq27220
* Fix PVS warnings
* Drivers: simplify logic in bq27220

---------

Co-authored-by: hedger <hedger@users.noreply.github.com>
2024-10-06 22:36:05 +04:00
Nikolay Marchuk
cfb9c991cb
furi_hal_random: Wait for ready state and no errors before sampling (#3933)
When random output is not ready, but error state flags are not set,
sampling of random generator samples zero until next value is ready.
2024-10-06 16:56:35 +01:00
MX
0d8d71ff1c
Merge remote-tracking branch 'RebornedBrain/reborned/some_api_adjustments' into dev [ci skip] 2024-10-05 10:19:32 +03:00
MX
1ceb1eb256
Allow to disable control of GPIO pin on rx/tx states in subghz [ci skip]
in radio settings with debug ON, settings is saved on microsd, please don't use unless you know what you are doing
2024-10-05 08:44:21 +03:00
MX
9bb3853c80
Merge remote-tracking branch 'noproto/nestednonces' into dev 2024-10-05 05:02:08 +03:00
MX
83b0e46ccd
merge ofw PR 3933
furi_hal_random: Wait for ready state and no errors before sampling

by n1kolasM

https://github.com/flipperdevices/flipperzero-firmware/pull/3933/files
2024-10-05 04:46:43 +03:00
Nathan N
232560f8e9
Merge branch 'dev' into nestednonces 2024-10-03 11:38:09 -04:00
MX
d91e390690
Merge remote-tracking branch 'OFW/dev' into dev 2024-10-02 23:18:30 +03:00
Silent
56d2923f1f
Prevent idle priority threads from potentially starving the FreeRTOS idle task (#3909)
* FuriThread: Make FuriThreadPriorityIdle equal to the FreeRTOS one, remove FuriThreadPriorityNone
  This magic constant was meaningless,
  FuriThreadPriorityNormal is now assigned by default instead.
* Make furi_thread_list_process private
  Its 'runtime' parameter is to be obtained from FreeRTOS,
  which means apps cannot do it.
* DirectDraw: Remove an useless include and fix memory leak
  Makes this debug app compileable with uFBT out of the box

Co-authored-by: あく <alleteam@gmail.com>
2024-10-02 18:11:13 +01:00
RebornedBrain
180d1f0471 iso14443_4a poller logic enhanced 2024-09-28 22:19:18 +03:00
noproto
0ba8ac4ed0 Uniformly use crypto1_ prefix for symbols in Crypto1 API 2024-09-23 19:44:08 -04:00
RebornedBrain
8027c300c3 Added new method for drawing mirrored XBM bitmaps 2024-09-23 11:16:23 +03:00
MX
16e4b9219a
merge ofw pr 3885 - Add API to enforce ISO15693 mode [ci skip]
by aaronjamt

https://github.com/flipperdevices/flipperzero-firmware/pull/3885/files
2024-09-21 03:50:03 +03:00
MX
521de2bc04
Merge remote-tracking branch 'OFW/dev' into dev 2024-09-16 18:00:02 +03:00
Nathan N
4836a54847
Merge branch 'flipperdevices:dev' into nestednonces 2024-09-16 05:27:52 -04:00
porta
19a3736fe5
[FL-3891] Folder rename fails (#3896)
* fix, refactor: storage is_subdir API
* docs: fix incorrect comment
* test: new storage apis
* test: use temporary path
* style: fix formatting
* UnitTest: storage path macros naming
* UnitTest: storage path macros naming part 2

Co-authored-by: あく <alleteam@gmail.com>
2024-09-15 16:01:42 +01:00
MX
891a6c047a
Merge remote-tracking branch 'OFW/dev' into dev 2024-09-13 22:26:58 +03:00
porta
b670d5b6e2
[FL-3885] Put errno into TCB (#3893)
* feat: thread-safe errno
* ci: fix pvs warning
* ci: silence pvs warning
* fix: 🤯
* test: convert test app into a unit test
2024-09-13 18:31:07 +01:00
Nathan N
8d26636fba
Merge branch 'flipperdevices:dev' into nestednonces 2024-09-10 20:13:20 -04:00
MX
876cbc40b7
Merge remote-tracking branch 'OFW/dev' into dev 2024-09-10 05:48:55 +03:00
RebornedBrain
5f4f4fcc60
FeliCa anti-collision fix (#3889)
* System code added to felica hal config functions
* Felica sensf_res setup logic adjusted with new struct
* Set api symbols version to 73.0
* Felica unit tests fix
* Furi: prevent use after free on xEventGroupSetBits call

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2024-09-09 22:11:53 +01:00
gornekich
9558a5fa08
Merge branch 'dev' into nestednonces 2024-09-09 13:34:47 +01:00
MX
6911ba12ad
Merge remote-tracking branch 'OFW/dev' into dev 2024-09-07 22:31:11 +03:00
Silent
8672a1d94c
Replace all calls to strncpy with strlcpy, use strdup more, expose strlcat (#3866)
strlcpy doesn't zero the buffer and ensures null termination,
just like snprintf

strlcat is already used by mjs and it's a safe alternative to strcat,
so it should be OK to expose to apps
2024-09-07 17:16:56 +01:00