Commit Graph

13552 Commits

Author SHA1 Message Date
Willy-JL b1886e5593 Merge remote-tracking branch 'mntm/dev' into ofw-3822-nestednonces 2024-09-18 02:12:13 +01:00
Willy-JL 97879c3bf3 Update apps
- NFC Playlist: Add playlist already exists error, general improvements (by acegoal07)
2024-09-18 02:11:30 +01:00
jay candel 65df2e4d1f NFC: SmartRider Parser (#203)
* adding smartrider_parser

* adding SmartRider parser

new parser for SmartRider cards, a public transport smart card system used in Western Australia.
extracts and interprets key information from the card, including:
-Current balance
-Card serial number
-Concession type
-Purchase cost
-Details of the last two trips (including tag on/off status, cost, route, transaction number, and journey number)

* optimising

- removed all logging to simplify output.
- used early returns for clearer error handling.
- optimized setups outside loops to improve memory use.
- simplified flows by removing unnecessary loops.
- placed variables closer to their use for better readability.
- cached data blocks to streamline data handling.
- added a helper function for parsing trips, reducing redundancy.
- corrected loop counter types to avoid compile-time errors.

* cleaning displayed data

- removed transaction (txn) and journey (jrn) numbers to declutter the trip details.
- shortened "previous trip" to "prev trip" to optimize screen space usage.

* added and refined displayed data

added auto load field "threshold amount / reload amount"
changed serial to display first two digits as SR0 for consistency with physical card.

* Format

* Improved Verification Process

- Added definitions for STANDARD_KEY_2 and STANDARD_KEY_3
- Enhanced smartrider_verify function to check for all three specific keys:
  - STANDARD_KEY_1 in Sector 0 as Key A
  - STANDARD_KEY_2 in Sector 6 as Key A
  - STANDARD_KEY_3 in Sector 6 as Key B
- Implemented read operations to verify actual key values stored on the card
- Added comparisons between read key data and expected key values
- Improved debug logging for each step of the verification process

* Integrated Verification into Parse Function

- Added key verification for sectors 0 and 6
- Implemented do-while loop structure for early exit on verification failure
- Moved block readability checks inside verification process
- Added parsed flag to indicate successful parsing
- Updated return value to reflect parsing success
- Maintained existing parsing logic and output format

* fixed false positives

recieved some cuid cards today so was able to test for myself can confirm works... finally
changes made: 
-updated key assignment in smartrider_read
-simplified key verification in smartrider_parse
-improved error handling and logging
-streamlined data parsing process
-corrected key checking logic
-added checks for required block readability
-improved flow control with strategic breaks
-adjusted block data access method

* small optimizations

- refactored `smartrider_verify` and `smartrider_read` by abstracting repeated key operations into `authenticate_and_read` function for improved code maintainability.
- optimized `smartrider_read` by introducing a loop for key setup, reducing redundancy and improving efficiency.
- streamlined error handling in `smartrider_read` by replacing do-while loop with conditional checks.
- changed standard key references to use `standard_keys` array indices

* formatting

* Delete duplicate smartrider.c

* updated smartrider.c

* found 'fbt format'

* transaction parsing updates

-removed last trip/prev trip wording and replaced with "Trip History" header
-added date in front of each transaction 
-only shows transaction cost if it's higher than 0
-changed tag on/tag off to +/- to save room
-added 8 more transactions to Trip History
-verified still working and formatted with fbt

* fixed reboot with partially unlocked card

-added bounds checking for all block accesses to prevent out-of-range memory access
-implemented improved error handling with an error_occurred flag
-introduced a maximum iteration count for date calculation to prevent infinite loops
-used snprintf with size limits for all string operations to avoid buffer overflows
-added validation for trip count to ensure it doesn't exceed the maximum allowed
-implemented checks to skip unread or out-of-range blocks during trip parsing
-added safeguards against corrupted or invalid timestamp data

* optimized SmartRider card parsing and verification

- replaced do-while loop with direct error checks in smartrider_parse
- optimized key verification using direct memcmp in smartrider_verify
- introduced inline functions for common operations (e.g., set_key, read_le16)
- replaced bubble sort with insertion sort for trip data
- simplified date calculation using a lookup table for days in month
- used uint_fast8_t for loop counters to allow compiler optimization
- added __attribute__((hot)) to key functions for aggressive optimization
- removed redundant variable declarations and function calls
- optimized memory usage with static const arrays for required blocks
- simplified error handling in smartrider_read and authenticate_and_read
- used __builtin_memcpy and __builtin_memcmp for potential compiler optimizations
- tested and formatted with fbt

* small fixes

-renamed "Trip History" to "Tag On/Off History"
-fixed date calculation to account for leap years
-misc changes

* Update changelog

---------

Co-authored-by: Willy-JL <49810075+Willy-JL@users.noreply.github.com>
2024-09-18 03:00:49 +02:00
m7i-org df273950cc Sub-GHz: Show satellites count with an icon (#215)
* feat(subghz): show satellites if enabled

Replaces the display of the number of satellites during SubGHz scanning. If GPS is enabled (an an external module connected) it will blink a GPS icon with the number of sats currently in range (even if zero).
Using a 10x10px "positioning" icon that replaces the SubGHz icon on the bottom right.

* Revert api version to ofw release

* f18 too

* Tweak icon a little

* Update changelog

* Format

---------

Co-authored-by: Willy-JL <49810075+Willy-JL@users.noreply.github.com>
2024-09-18 01:43:30 +02:00
m7i-org 3351f9b636 Sub-GHz: Add Bresser 3CH weather station protocol (#217)
* feat(subghz): added Bresser 3CH weather station

Added the Bresser 3CH, a weather station supported by rtl_433 already.

* Update changelog

---------

Co-authored-by: Willy-JL <49810075+Willy-JL@users.noreply.github.com>
2024-09-18 01:14:29 +02:00
Willy-JL 2ed1366b67 Add PR number --nobuild 2024-09-17 23:50:52 +01:00
Mihai 425a97fe95 NFC: Added 6 new Mifare Classic keys from Bulgaria Hotel (#216)
* Update mf_classic_dict.nfc

Added 6 new keys from Bulgaria Hotel
Keys are not duplicated!

* Add section delimiter

* No LF at EOF

* Update changelog

---------

Co-authored-by: Willy-JL <49810075+Willy-JL@users.noreply.github.com>
2024-09-18 00:24:21 +02:00
Willy-JL de5b0a42d1 Add Sub-GHz: Radio Scanner app (by RocketGod-git) 2024-09-17 23:18:03 +01:00
Willy-JL 2b8159fcd6 Picopass: Force ISO15693 1OutOf4 mode (by aaronjamt)
- Fixes crashes in some noisy readers
2024-09-17 23:13:35 +01:00
noproto d8864a490b Add nested_target_key 64 to TODO 2024-09-17 17:40:17 -04:00
Willy-JL f6025cee28 Revert, app is not ready for new lib yet
maybe git subtrees need some more work, to better sync with submodule indexes?
2024-09-17 22:39:26 +01:00
Aaron Tulino 5afc01a4c3 NFC: Add API to enforce ISO15693 mode (#225)
* Add API to enforce ISO15693 mode
See https://github.com/flipperdevices/flipperzero-firmware/pull/3885

* Revert symbols version

* Format

* Update changelog

---------

Co-authored-by: Willy-JL <49810075+Willy-JL@users.noreply.github.com>
2024-09-17 23:32:03 +02:00
Willy-JL 12f9bd73b7 Update apps --nobuild
- Laser Tag: Crash fixes (by RocketGod-git), thread leak fix (by jamisonderek)
- Pokemon Trading: Update gblink library with printer support (by kbembedded)
2024-09-17 22:20:58 +01:00
noproto 8eae5c0608 Fix Hardnested sector/key type logging 2024-09-17 17:07:31 -04:00
Willy-JL 8d43f8f7cc Merge remote-tracking branch 'ul/dev' into mntm-dev --nobuild 2024-09-17 22:03:37 +01:00
Willy-JL d1bc8e53f3 Merge remote-tracking branch 'ofw/dev' into mntm-dev --nobuild 2024-09-17 22:02:22 +01:00
noproto 3ab752b7a0 Clean up various issues 2024-09-17 14:38:14 -04:00
Anna Antonenko ea9a5f42e0 style: fix linter error(?) 2024-09-17 13:26:28 +03:00
Anna Antonenko 4a8202514d style: fix linter errors 2024-09-16 19:29:55 +03:00
MX 31df2c0655 upd changelog 2024-09-16 19:17:05 +03:00
MX 2826382970 fix check [ci skip] 2024-09-16 18:31:02 +03:00
MX 2af87cdb70 hollarm button codes and gangqi validator allow more serials [ci skip] 2024-09-16 18:01:51 +03:00
MX 521de2bc04 Merge remote-tracking branch 'OFW/dev' into dev 2024-09-16 18:00:02 +03:00
Anna Antonenko 1a9aca2d8c fix: always autolock if pin set 2024-09-16 17:11:31 +03:00
Anna Antonenko 15b271bd92 fix: cli autolock inhibit 2024-09-16 16:27:24 +03:00
Anna Antonenko a5b3d71e59 feat: cli icon on the desktop 2024-09-16 15:37:40 +03:00
Nathan N 4836a54847 Merge branch 'flipperdevices:dev' into nestednonces 2024-09-16 05:27:52 -04:00
noproto 18f8cfbef0 Do not reset the poller between collected nonces 2024-09-16 05:28:04 -04:00
EntranceJew 913a86bbec kerel typo (#3901)
Co-authored-by: あく <alleteam@gmail.com>
2024-09-15 16:07:04 +01: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
Willy-JL 9c54336f1d Update apps
- Quac!: iButton support (by rdefeo)
- DTMF Dolphin: Add EAS tone support (by JendrBendr)
2024-09-14 03:02:53 +02:00
Willy-JL 0ce62a0792 Update changelog 2024-09-14 02:37:53 +02:00
Willy-JL 3c1ff413e2 Add some docs of Unleashed FW, adapted to Momentum and with credits 2024-09-14 02:34:40 +02:00
Willy-JL 1fec32daa1 Merge remote-tracking branch 'ul/dev' into mntm-dev 2024-09-14 01:30:48 +02:00
Willy-JL b31dec8e71 Merge remote-tracking branch 'ofw/dev' into mntm-dev 2024-09-14 01:10:44 +02: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
noproto 8edafa3f39 Do not enter nested attack if card is already finished 2024-09-12 14:28:18 -04:00
porta 0428e82b14 Fix USB-UART bridge exit screen stopping the bridge prematurely (#3892)
* fix: exit screen stopping bridge prematurely
* refactor: merge exit confirmation scene into main usb uart scene
2024-09-12 17:32:07 +01:00
noproto 13411da449 I'll try freeing memory, that's a good trick! 2024-09-11 16:22:52 -04:00
Nathan N 8d26636fba Merge branch 'flipperdevices:dev' into nestednonces 2024-09-10 20:13:20 -04:00
MX c2f6ce7e54 upd readme [ci skip] 2024-09-11 03:00:09 +03:00
MX f9f2938bd4 upd changelog 2024-09-11 02:28:00 +03:00
noproto ab0debba02 Add additional condition to backdoor check 2024-09-10 19:20:53 -04:00
MX 1ca240b624 princeton custom buttons support [ci skip] 2024-09-11 01:59:41 +03:00
MMX 69598746bc Merge pull request #805 from chrostino/patch-1
Update SubGHzRemoteProg.md to improve BFT Mitto steps
2024-09-11 01:58:56 +03:00
MX 2aa4797b12 Merge remote-tracking branch 'OFW/portasynthinca3/usbuart-stay-fix' into dev 2024-09-11 01:44:29 +03:00
chrostino 117e1789c1 Update SubGHzRemoteProg.md
Improved the description steps to create a new remote BFT Mitto with more detailed and accurate instructions
2024-09-10 22:30:58 +02:00
Willy-JL c82991b3e1 Merge remote-tracking branch 'mntm/dev' into ofw-3822-nestednonces 2024-09-10 20:38:40 +02:00
Willy-JL c0d8659a2c Fix API symbols version for OFW 1.0.1 2024-09-10 20:38:32 +02:00