From c5d077fc7a73893d67958c984483347e2d0b0741 Mon Sep 17 00:00:00 2001 From: MX <10697207+xMasterX@users.noreply.github.com> Date: Sun, 11 May 2025 19:38:34 +0300 Subject: [PATCH] various fixes by WillyJL --- .../main/bad_usb/helpers/ducky_script.c | 4 +--- applications/main/nfc/nfc_cli.c | 19 ++----------------- lib/toolbox/cli/cli_registry.c | 4 ++-- 3 files changed, 5 insertions(+), 22 deletions(-) diff --git a/applications/main/bad_usb/helpers/ducky_script.c b/applications/main/bad_usb/helpers/ducky_script.c index a64629af2..43621de78 100644 --- a/applications/main/bad_usb/helpers/ducky_script.c +++ b/applications/main/bad_usb/helpers/ducky_script.c @@ -213,9 +213,7 @@ static int32_t ducky_parse_line(BadUsbScript* bad_usb, FuriString* line) { // Main key char next_char = *line_cstr; - uint16_t main_key = ducky_get_keycode_by_name(line_cstr); - if(!main_key && next_char) main_key = BADUSB_ASCII_TO_KEY(bad_usb, next_char); - key = modifiers | main_key; + key = modifiers | ducky_get_keycode(bad_usb, line_cstr, true); if(key == 0 && next_char) ducky_error(bad_usb, "No keycode defined for %s", line_cstr); diff --git a/applications/main/nfc/nfc_cli.c b/applications/main/nfc/nfc_cli.c index 5b54d38db..2b4cdf6d3 100644 --- a/applications/main/nfc/nfc_cli.c +++ b/applications/main/nfc/nfc_cli.c @@ -7,7 +7,6 @@ #include #include #include -#include #include #include @@ -15,13 +14,12 @@ #define FLAG_EVENT (1 << 10) #define NFC_MAX_BUFFER_SIZE (256) -#define NFC_BASE_PROTOCOL_MAX (3) +#define NFC_BASE_PROTOCOL_MAX (2) #define POLLER_DONE (1 << 0) #define POLLER_ERR (1 << 1) static NfcProtocol BASE_PROTOCOL[NFC_BASE_PROTOCOL_MAX] = { NfcProtocolIso14443_4a, - NfcProtocolIso14443_4b, - NfcProtocolIso15693_3}; + NfcProtocolIso14443_4b}; typedef struct ApduContext { BitBuffer* tx_buffer; BitBuffer* rx_buffer; @@ -88,19 +86,6 @@ static NfcCommand trx_callback(NfcGenericEvent event, void* context) { furi_thread_flags_set(apdu_context->thread_id, POLLER_ERR); return NfcCommandStop; } - } else if(NfcProtocolIso15693_3 == event.protocol) { - Iso15693_3Error err = iso15693_3_poller_send_frame( - event.instance, - apdu_context->tx_buffer, - apdu_context->rx_buffer, - ISO15693_3_FDT_POLL_FC); - if(Iso15693_3ErrorNone == err) { - furi_thread_flags_set(apdu_context->thread_id, POLLER_DONE); - return NfcCommandContinue; - } else { - furi_thread_flags_set(apdu_context->thread_id, POLLER_ERR); - return NfcCommandStop; - } } else { // should never reach here furi_crash("Unknown protocol"); diff --git a/lib/toolbox/cli/cli_registry.c b/lib/toolbox/cli/cli_registry.c index 91f7c4046..45661ee90 100644 --- a/lib/toolbox/cli/cli_registry.c +++ b/lib/toolbox/cli/cli_registry.c @@ -136,9 +136,9 @@ void cli_registry_reload_external_commands( FURI_LOG_T(TAG, "Plugin: %s", plugin_filename); furi_string_set_str(plugin_name, plugin_filename); - furi_check(furi_string_end_with_str(plugin_name, ".fal")); + if(!furi_string_end_with_str(plugin_name, ".fal")) continue; furi_string_replace_all_str(plugin_name, ".fal", ""); - furi_check(furi_string_start_with_str(plugin_name, config->fal_prefix)); + if(!furi_string_start_with_str(plugin_name, config->fal_prefix)) continue; furi_string_replace_at(plugin_name, 0, strlen(config->fal_prefix), ""); CliRegistryCommand command = {