Skip to content

Commit

Permalink
Merge branch 'dev' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
xMasterX committed Dec 26, 2023
2 parents 05b183f + 5ef6adb commit bc2a2f5
Show file tree
Hide file tree
Showing 71 changed files with 1,804 additions and 858 deletions.
84 changes: 24 additions & 60 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,74 +6,38 @@
- Mifare Mini clones reading is broken (original mini working fine) (OFW)
- Mifare Classic dict attack fast skip (multiple presses on OK button) causes glitches/incorrect reading (OFW)
- EMV simple data parser was removed with protocol with refactoring (OFW)
- Mifare Classic Emulation slow response (unconfirmed) (OFW)
- Option to unlock Slix-L (NFC V) with preset or custom password was removed with refactoring (OFW)
- NFC CLI was removed with refactoring (OFW)
### Some apps that was made for old nfc stack is now not compatible with the new API and require complete remake:
**If you want to help with making this apps work again please send PR to the repo at link below**
- Current list of affected apps: https://github.com/xMasterX/all-the-plugins/tree/dev/apps_broken_by_last_refactors
- Also in app **Enhanced Sub-GHz Chat** - NFC part was temporarily removed to make app usable, NFC part of the app requires remaking it with new nfc stack <br>
**API was updated to v49.x**
**API was updated to v50.x**
## New changes
* NFC: Added new parsers for transport cards - Umarsh, Kazan, Moscow, Metromoney(Tbilisi), and fixes for OFW parsers (by @assasinfil and @Leptopt1los) (special thanks for users who provided various dumps of those cards for research)
* NFC: Added simple key name display to UI to fix regression
* NFC: Add keys to mf_classic_dict (by @hnlcory | PR #660)
* NFC: Add Saflok and MyKey KDFs (by @noproto | PR #662)
* NFC: social_moscow parser verification collisions fix (by @Leptopt1los)
* iButton: Fix UI text - protocol name getting out of screen bounds when key name is too large, and other related issues (by @krolchonok | PR #649)
* SubGHz: Fixed feature naming in menu
* SubGHz: Added honeywell protocol [(by @htotoo)](https://github.com/Flipper-XFW/Xtreme-Firmware/commit/ceee551befa0cb8fd8514a4f8a1250fd9e0997ee)
* SubGHz: Add 303.9 Mhz to default frequency list
* SubGHz: Fix Keeloq decoding order bug (random switch to HCS101 or anmotors)
* SubGHz: Fix secplus v1 key display issue
* API: Add new get function for varitemlist (by @Willy-JL)
* Misc code cleanup
* Apps: **Bluetooth Remote / USB Keyboard & Mouse** - `Movie` and `PTT` modes by @hryamzik
* Apps: **BLE Spam app** updated to latest version (New devices support, + Menu by holding Start) (by @Willy-JL) -> (app can be found in builds ` `, `e`, `n`, `r`)
* Apps: **NFC Magic** - Gen4 Actions (option to fix card with broken config) (by @Leptopt1los and @xMasterX)
* IR: Updated infrared assets (by @amec0e | PR #677)
* NFC: Fix Saflok edge case 0.5% of UIDs got wrong result (by @noproto | PR #668)
* NFC: Zolotaya Korona transport card parser added (by @Leptopt1los)
* NFC: Parsers cleanup for new api (by @Leptopt1los)
* SubGHz: Temp fix for subghz keyboard lock display issue (furi_timer is not working properly)
* SubGHz: Added new option to delete old signals on full memory
* SubGHz: Faac rc/xt add manually (unverified)
* SubGHz: Better subghz history element removal (by @Willy-JL)
* SubGHz: Fix key display newline issue in came atomo
* Apps: **Check out Apps updates by following** [this link](https://github.com/xMasterX/all-the-plugins/commits/dev)
* OFW: NFC fixes
* OFW: nfc: m1k-based Aime (non-AIC) card support
* OFW: SubGhz: fix count bit for detect gate_tx protocol
* OFW: Fixed a zero allocation error when reading an iso15693 nfc tag with no additional blocks.
* OFW: Ntag21x write
* OFW: Mifare Classic nested auth support
* OFW: ST25TB poller refining + write support
* OFW: Libraries cleanup; u2f crypto rework to use mbedtls
* OFW: Add the secret door animation
* OFW: Allows you to use UCS-2 in canvas_glyph_width
* OFW: Mifare Classic fixes
* OFW: NFC: Felica UID emulation
* OFW: 64k does not enough
* OFW: fbt: improvements
* OFW: Various Fixes for 0.95
* OFW: Add Mastercode SubGHz Protocol
* OFW: Do not remove file when renaming to itself
* OFW: Fix iButton crash on missing file
* OFW: NFC API improvements
* OFW: MF Ultralight no pwd polling adjustment
* OFW: Fix limited_credit_value having wrong value in mf_desfire_file_settings_parse
* OFW: Infrared remote button index support
* OFW: Fix NFC unit tests
* OFW: fix: invariant format of log time data
* OFW: fbt: dist improvements
* OFW: Fix crash when exiting write mode
* OFW: Dolphin: Extreme butthurt loop fix
* OFW: **Furi, FuriHal: remove FreeRTOS headers leaks**
* OFW: fbt: source collection improvements
* OFW: Rename menu items related to dummy mode and sound
* OFW: fbt: SD card resource handling speedup
* OFW: **Furi: cleanup crash use**
* OFW: Allow for larger Infrared remotes
* OFW: **fbt: reworked assets & resources handling**
* OFW: Storage: speedup write_chunk cli command
* OFW: fix crash after st25tb save
* OFW: Fix crash when reading files > 64B
* OFW: NFC RC fixes
* OFW: Fix MF DESFire record file handling
* OFW: **NFC refactoring** (new NFC stack) -> some apps still require very big changes to make them work with new system - see apps that was temporarily removed from this release here: https://github.com/xMasterX/all-the-plugins/tree/dev/apps_broken_by_last_refactors
* OFW: fbt: glob & git improvements
* OFW: FastFAP: human readable error log
* OFW: USART Bridge: added support for software control of DE/RE pins
* OFW: ufbt: changed toolchain environment invocation; updated .gitignore for app template
* OFW: Keys Dict: fix PVS warnings
* OFW: NfcDict Refactoring
* OFW: Add AC's Carrier 42QG5A580SC and AUX YKR-H/006E
* OFW: NFC Plugins loading rework
* OFW: MFC emulation fix
* OFW: nfc_util: little endian bytes2num functions added
* OFW: Add MyKey parser
* OFW: Update CLI MOTD
* OFW: NFC NTAG and ISO14443-3b reading fix
* OFW: FuriHal: RTC register reset API. New factory reset routine that wipes all RTC backup registers content.
* OFW: FuriHal: various GPIO improvements
* OFW: SubGhz: changed the name of the button when sending RAW to SubGHz

----

Expand Down
4 changes: 2 additions & 2 deletions ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ Also check the [changelog in releases](https://github.com/DarkFlippers/unleashed
### Current modified and new Sub-GHz protocols list:
Thanks to Official team (to their SubGHz Developer, Skorp) for implementing decoders for these protocols in OFW.

Keeloq [Not ALL systems supported for decode or emulation yet!] - [Supported manufacturers list](https://0bin.net/paste/VwR2lNJY#WH9vnPgvcp7w6zVKucFCuNREKAcOij8KsJ6vqLfMn3b)
Keeloq [Not ALL systems supported for decode or emulation!] - [Supported manufacturers list](https://pastes.io/raw/unuj9bhe4m)

Encoders or sending made by @xMasterX:
- Nero Radio 57bit (+ 56bit encoder improvements)
Expand Down Expand Up @@ -167,7 +167,7 @@ You can support us by using links or addresses below:
## Community apps included

### [🎲 Download Extra plugins for Unleashed](https://github.com/xMasterX/all-the-plugins/releases/latest)
### [List of Extra pack](https://github.com/xMasterX/all-the-plugins/tree/dev#extra-pack) | [List of Base *(Deafult)* pack](https://github.com/xMasterX/all-the-plugins/tree/dev#default-pack)
### [List of Extra pack](https://github.com/xMasterX/all-the-plugins/tree/dev#extra-pack) | [List of Base *(Default)* pack](https://github.com/xMasterX/all-the-plugins/tree/dev#default-pack)

See full list and sources here: [xMasterX/all-the-plugins](https://github.com/xMasterX/all-the-plugins/tree/dev)

Expand Down
46 changes: 23 additions & 23 deletions applications/debug/unit_tests/nfc/nfc_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <nfc/protocols/mf_ultralight/mf_ultralight_poller_sync.h>
#include <nfc/protocols/mf_classic/mf_classic_poller_sync.h>

#include <nfc/helpers/nfc_dict.h>
#include <toolbox/keys_dict.h>
#include <nfc/nfc.h>

#include "../minunit.h"
Expand Down Expand Up @@ -443,36 +443,36 @@ MU_TEST(mf_classic_dict_test) {
"Remove test dict failed");
}

NfcDict* dict = nfc_dict_alloc(
NFC_APP_MF_CLASSIC_DICT_UNIT_TEST_PATH, NfcDictModeOpenAlways, sizeof(MfClassicKey));
mu_assert(dict != NULL, "nfc_dict_alloc() failed");
KeysDict* dict = keys_dict_alloc(
NFC_APP_MF_CLASSIC_DICT_UNIT_TEST_PATH, KeysDictModeOpenAlways, sizeof(MfClassicKey));
mu_assert(dict != NULL, "keys_dict_alloc() failed");

size_t dict_keys_total = nfc_dict_get_total_keys(dict);
mu_assert(dict_keys_total == 0, "nfc_dict_keys_total() failed");
size_t dict_keys_total = keys_dict_get_total_keys(dict);
mu_assert(dict_keys_total == 0, "keys_dict_keys_total() failed");

const uint32_t test_key_num = 30;
MfClassicKey* key_arr_ref = malloc(test_key_num * sizeof(MfClassicKey));
for(size_t i = 0; i < test_key_num; i++) {
furi_hal_random_fill_buf(key_arr_ref[i].data, sizeof(MfClassicKey));
mu_assert(
nfc_dict_add_key(dict, key_arr_ref[i].data, sizeof(MfClassicKey)), "add key failed");
keys_dict_add_key(dict, key_arr_ref[i].data, sizeof(MfClassicKey)), "add key failed");

size_t dict_keys_total = nfc_dict_get_total_keys(dict);
mu_assert(dict_keys_total == (i + 1), "nfc_dict_keys_total() failed");
size_t dict_keys_total = keys_dict_get_total_keys(dict);
mu_assert(dict_keys_total == (i + 1), "keys_dict_keys_total() failed");
}

nfc_dict_free(dict);
keys_dict_free(dict);

dict = nfc_dict_alloc(
NFC_APP_MF_CLASSIC_DICT_UNIT_TEST_PATH, NfcDictModeOpenAlways, sizeof(MfClassicKey));
mu_assert(dict != NULL, "nfc_dict_alloc() failed");
dict = keys_dict_alloc(
NFC_APP_MF_CLASSIC_DICT_UNIT_TEST_PATH, KeysDictModeOpenAlways, sizeof(MfClassicKey));
mu_assert(dict != NULL, "keys_dict_alloc() failed");

dict_keys_total = nfc_dict_get_total_keys(dict);
mu_assert(dict_keys_total == test_key_num, "nfc_dict_keys_total() failed");
dict_keys_total = keys_dict_get_total_keys(dict);
mu_assert(dict_keys_total == test_key_num, "keys_dict_keys_total() failed");

MfClassicKey key_dut = {};
size_t key_idx = 0;
while(nfc_dict_get_next_key(dict, key_dut.data, sizeof(MfClassicKey))) {
while(keys_dict_get_next_key(dict, key_dut.data, sizeof(MfClassicKey))) {
mu_assert(
memcmp(key_arr_ref[key_idx].data, key_dut.data, sizeof(MfClassicKey)) == 0,
"Loaded key data mismatch");
Expand All @@ -484,19 +484,19 @@ MU_TEST(mf_classic_dict_test) {
for(size_t i = 0; i < COUNT_OF(delete_keys_idx); i++) {
MfClassicKey* key = &key_arr_ref[delete_keys_idx[i]];
mu_assert(
nfc_dict_is_key_present(dict, key->data, sizeof(MfClassicKey)),
"nfc_dict_is_key_present() failed");
keys_dict_is_key_present(dict, key->data, sizeof(MfClassicKey)),
"keys_dict_is_key_present() failed");
mu_assert(
nfc_dict_delete_key(dict, key->data, sizeof(MfClassicKey)),
"nfc_dict_delete_key() failed");
keys_dict_delete_key(dict, key->data, sizeof(MfClassicKey)),
"keys_dict_delete_key() failed");
}

dict_keys_total = nfc_dict_get_total_keys(dict);
dict_keys_total = keys_dict_get_total_keys(dict);
mu_assert(
dict_keys_total == test_key_num - COUNT_OF(delete_keys_idx),
"nfc_dict_keys_total() failed");
"keys_dict_keys_total() failed");

nfc_dict_free(dict);
keys_dict_free(dict);
free(key_arr_ref);

mu_assert(
Expand Down
17 changes: 17 additions & 0 deletions applications/main/gpio/scenes/gpio_scene_usb_uart_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ static const uint32_t baudrate_list[] = {
460800,
921600,
};
static const char* software_de_re[] = {"None", "4"};

bool gpio_scene_usb_uart_cfg_on_event(void* context, SceneManagerEvent event) {
GpioApp* app = context;
Expand Down Expand Up @@ -84,6 +85,17 @@ static void line_port_cb(VariableItem* item) {
view_dispatcher_send_custom_event(app->view_dispatcher, GpioUsbUartEventConfigSet);
}

static void line_software_de_re_cb(VariableItem* item) {
GpioApp* app = variable_item_get_context(item);
furi_assert(app);
uint8_t index = variable_item_get_current_value_index(item);

variable_item_set_current_value_text(item, software_de_re[index]);

app->usb_uart_cfg->software_de_re = index;
view_dispatcher_send_custom_event(app->view_dispatcher, GpioUsbUartEventConfigSet);
}

static void line_flow_cb(VariableItem* item) {
GpioApp* app = variable_item_get_context(item);
furi_assert(app);
Expand Down Expand Up @@ -155,6 +167,11 @@ void gpio_scene_usb_uart_cfg_on_enter(void* context) {
app->var_item_flow = item;
line_ensure_flow_invariant(app);

item = variable_item_list_add(
var_item_list, "DE/RE Pin", COUNT_OF(software_de_re), line_software_de_re_cb, app);
variable_item_set_current_value_index(item, app->usb_uart_cfg->software_de_re);
variable_item_set_current_value_text(item, software_de_re[app->usb_uart_cfg->software_de_re]);

variable_item_list_set_selected_item(
var_item_list, scene_manager_get_scene_state(app->scene_manager, GpioAppViewUsbUartCfg));

Expand Down
35 changes: 35 additions & 0 deletions applications/main/gpio/usb_uart_bridge.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,16 @@
#include <furi_hal.h>
#include <furi_hal_usb_cdc.h>

//TODO: FL-3276 port to new USART API
#include <stm32wbxx_ll_lpuart.h>
#include <stm32wbxx_ll_usart.h>

#define USB_CDC_PKT_LEN CDC_DATA_SZ
#define USB_UART_RX_BUF_SIZE (USB_CDC_PKT_LEN * 5)

#define USB_CDC_BIT_DTR (1 << 0)
#define USB_CDC_BIT_RTS (1 << 1)
#define USB_USART_DE_RE_PIN &gpio_ext_pa4

static const GpioPin* flow_pins[][2] = {
{&gpio_ext_pa7, &gpio_ext_pa6}, // 2, 3
Expand Down Expand Up @@ -247,6 +252,17 @@ static int32_t usb_uart_worker(void* context) {
usb_uart->cfg.flow_pins = usb_uart->cfg_new.flow_pins;
events |= WorkerEvtCtrlLineSet;
}
if(usb_uart->cfg.software_de_re != usb_uart->cfg_new.software_de_re) {
usb_uart->cfg.software_de_re = usb_uart->cfg_new.software_de_re;
if(usb_uart->cfg.software_de_re != 0) {
furi_hal_gpio_write(USB_USART_DE_RE_PIN, true);
furi_hal_gpio_init(
USB_USART_DE_RE_PIN, GpioModeOutputPushPull, GpioPullNo, GpioSpeedMedium);
} else {
furi_hal_gpio_init(
USB_USART_DE_RE_PIN, GpioModeAnalog, GpioPullNo, GpioSpeedLow);
}
}
api_lock_unlock(usb_uart->cfg_lock);
}
if(events & WorkerEvtLineCfgSet) {
Expand All @@ -260,6 +276,8 @@ static int32_t usb_uart_worker(void* context) {
usb_uart_vcp_deinit(usb_uart, usb_uart->cfg.vcp_ch);
usb_uart_serial_deinit(usb_uart, usb_uart->cfg.uart_ch);

furi_hal_gpio_init(USB_USART_DE_RE_PIN, GpioModeAnalog, GpioPullNo, GpioSpeedLow);

if(usb_uart->cfg.flow_pins != 0) {
furi_hal_gpio_init_simple(flow_pins[usb_uart->cfg.flow_pins - 1][0], GpioModeAnalog);
furi_hal_gpio_init_simple(flow_pins[usb_uart->cfg.flow_pins - 1][1], GpioModeAnalog);
Expand Down Expand Up @@ -298,7 +316,24 @@ static int32_t usb_uart_tx_thread(void* context) {

if(len > 0) {
usb_uart->st.tx_cnt += len;

if(usb_uart->cfg.software_de_re != 0)
furi_hal_gpio_write(USB_USART_DE_RE_PIN, false);

furi_hal_uart_tx(usb_uart->cfg.uart_ch, data, len);

if(usb_uart->cfg.software_de_re != 0) {
//TODO: FL-3276 port to new USART API
if(usb_uart->cfg.uart_ch == FuriHalUartIdUSART1) {
while(!LL_USART_IsActiveFlag_TC(USART1))
;
} else if(usb_uart->cfg.uart_ch == FuriHalUartIdLPUART1) {
while(!LL_LPUART_IsActiveFlag_TC(LPUART1))
;
}

furi_hal_gpio_write(USB_USART_DE_RE_PIN, true);
}
}
}
}
Expand Down
1 change: 1 addition & 0 deletions applications/main/gpio/usb_uart_bridge.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ typedef struct {
uint8_t flow_pins;
uint8_t baudrate_mode;
uint32_t baudrate;
uint8_t software_de_re;
} UsbUartConfig;

typedef struct {
Expand Down
Loading

0 comments on commit bc2a2f5

Please sign in to comment.