mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-04-24 03:29:57 -07:00
Merge branch 'dev' of https://github.com/DarkFlippers/unleashed-firmware into dev --nobuild
This commit is contained in:
2
.github/workflows/hotfix.yml
vendored
2
.github/workflows/hotfix.yml
vendored
@@ -39,7 +39,7 @@ jobs:
|
||||
set -e
|
||||
for TARGET in ${TARGETS}; do
|
||||
TARGET_HW="$(echo "${TARGET}" | sed 's/f//')"; \
|
||||
./fbt TARGET_HW=$TARGET_HW DIST_SUFFIX=$VERSION_TAG FORCE_NO_DIRTY=1 updater_package
|
||||
./fbt TARGET_HW=$TARGET_HW DIST_SUFFIX=$VERSION_TAG updater_package
|
||||
done
|
||||
|
||||
- name: "Check for uncommitted changes"
|
||||
|
||||
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
@@ -39,7 +39,7 @@ jobs:
|
||||
set -e
|
||||
for TARGET in ${TARGETS}; do
|
||||
TARGET_HW="$(echo "${TARGET}" | sed 's/f//')"; \
|
||||
./fbt TARGET_HW=$TARGET_HW DIST_SUFFIX=$VERSION_TAG FORCE_NO_DIRTY=1 updater_package
|
||||
./fbt TARGET_HW=$TARGET_HW DIST_SUFFIX=$VERSION_TAG updater_package
|
||||
done
|
||||
|
||||
- name: "Check for uncommitted changes"
|
||||
|
||||
@@ -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"
|
||||
@@ -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");
|
||||
@@ -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(
|
||||
|
||||
@@ -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;
|
||||
@@ -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);
|
||||
@@ -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));
|
||||
|
||||
|
||||
@@ -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
|
||||
@@ -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) {
|
||||
@@ -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);
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -807,3 +807,155 @@ type: raw
|
||||
frequency: 38000
|
||||
duty_cycle: 0.330000
|
||||
data: 6175 7369 602 1570 602 1570 601 1570 573 1598 574 1598 573 1597 574 1597 574 1598 574 525 574 526 573 526 573 527 572 528 571 529 570 529 570 530 568 1603 568 1627 544 1627 544 1627 544 1628 544 554 545 1627 544 1628 544 555 544 555 544 555 544 555 544 554 544 1627 545 555 544 554 545 1627 544 1627 544 1627 544 1627 544 1627 544 1603 568 1602 569 1603 569 530 569 529 570 529 570 529 570 529 570 529 570 529 570 528 570 1601 571 528 570 1602 570 529 570 528 570 1601 570 1600 571 1601 571 528 571 1601 570 528 570 1601 570 1602 570 529 570 529 570 528 570 1601 570 1601 570 1600 571 1601 571 528 570 1601 570 1601 571 528 571 528 571 529 570 528 571 528 570 1601 571 528 571 528 570 1603 570 529 571 1603 570 529 570 1603 570 529 570 1603 570 529 571 1602 571 1603 570 529 571 1603 570 529 571 1603 570 529 571 1603 570 530 570 7370 570
|
||||
#
|
||||
# Model: AUX YKR-H/006E
|
||||
#
|
||||
name: Off
|
||||
type: raw
|
||||
frequency: 38000
|
||||
duty_cycle: 0.330000
|
||||
data: 8957 4502 539 1683 538 1681 540 559 538 559 538 556 541 557 540 1683 538 1682 539 1684 537 1682 539 1681 540 1684 537 1684 537 1682 539 1684 537 558 539 558 539 558 539 558 539 559 538 558 539 1682 539 1681 540 1683 538 557 540 558 539 558 539 557 540 559 538 557 540 557 540 561 536 559 538 558 539 557 540 558 539 558 539 1683 538 558 539 1682 540 557 540 559 538 557 540 557 540 561 536 558 539 559 538 558 539 560 537 557 540 558 539 558 539 558 539 559 538 558 539 1682 539 557 540 558 539 557 540 557 540 558 539 560 537 557 540 557 540 558 539 559 538 557 540 559 538 556 541 558 539 558 539 558 539 556 541 559 538 557 540 558 539 558 539 558 539 557 540 558 539 557 541 557 540 557 540 559 538 558 539 558 539 558 539 558 539 1681 540 557 540 1683 538 558 539 559 538 557 540 559 538 559 538 1683 538 1683 538 1683 538 557 540 558 539 558 540 1683 538 560 563
|
||||
#
|
||||
name: Dh
|
||||
type: raw
|
||||
frequency: 38000
|
||||
duty_cycle: 0.330000
|
||||
data: 8956 4504 536 1684 537 1687 534 559 538 559 538 559 538 560 537 1683 538 1685 536 1682 539 1684 537 1683 538 1684 537 1683 538 1684 537 1683 538 558 539 562 535 559 538 558 539 562 535 560 537 1683 538 1684 537 1683 538 561 536 561 536 561 537 560 537 561 536 558 539 560 537 559 538 560 537 561 536 561 536 563 534 559 538 1684 537 559 538 1684 537 561 536 560 537 560 537 560 537 560 537 560 537 559 538 559 538 559 538 588 509 558 539 559 538 559 538 564 533 1684 537 559 538 560 537 559 538 588 509 563 534 559 538 559 538 558 539 562 535 558 539 561 536 560 537 560 537 559 538 588 509 561 536 560 537 561 536 563 534 561 536 560 537 561 536 1684 537 559 538 559 538 559 538 561 536 560 537 560 537 559 538 561 536 558 539 560 537 1684 537 559 538 1683 538 561 536 561 536 563 534 559 538 558 539 1683 538 1684 537 1684 537 560 537 560 537 1683 538 560 537 560 563
|
||||
#
|
||||
name: Cool_hi
|
||||
type: raw
|
||||
frequency: 38000
|
||||
duty_cycle: 0.330000
|
||||
data: 8957 4502 538 1683 538 1684 537 562 535 560 537 559 538 559 539 1683 538 1682 539 1711 510 1685 536 1683 538 558 539 588 509 557 540 1682 539 557 540 558 539 559 538 559 538 558 539 561 536 1681 540 1682 539 1683 538 559 538 559 538 559 538 561 536 560 537 559 538 558 539 559 538 559 538 559 538 559 538 560 537 560 537 1685 536 560 537 1685 536 560 537 559 538 560 537 560 537 559 538 558 539 559 538 560 537 587 510 562 535 559 538 560 537 557 540 1685 536 559 538 560 537 587 510 588 509 559 538 562 535 560 537 557 540 559 538 557 540 560 537 587 510 560 538 558 539 559 538 559 538 561 536 560 537 560 537 558 540 560 537 559 538 560 537 1683 538 562 535 560 537 559 538 560 537 558 539 559 538 558 539 560 537 560 537 559 538 1683 538 558 539 1684 537 559 538 558 539 559 538 558 539 558 539 1682 539 1684 537 1684 537 1683 538 560 537 558 539 1683 538 1684 564
|
||||
#
|
||||
name: Cool_lo
|
||||
type: raw
|
||||
frequency: 38000
|
||||
duty_cycle: 0.330000
|
||||
data: 8956 4501 539 1682 539 1682 539 559 538 557 540 587 510 558 539 1684 537 1682 539 1682 539 1682 539 1680 541 1682 539 1682 539 1682 539 1681 540 558 539 558 539 558 539 557 540 558 539 557 540 1683 538 1683 538 1683 538 558 539 558 539 558 539 557 540 560 537 560 537 557 540 558 539 557 540 558 539 557 540 560 537 558 539 1681 540 556 541 1684 537 558 539 557 540 559 538 558 539 557 540 558 539 558 539 560 537 559 538 558 539 558 539 557 540 559 538 1685 536 559 538 558 539 587 510 557 540 559 538 559 538 560 537 560 537 558 539 559 538 558 539 559 538 562 535 558 539 557 540 557 540 559 538 559 538 558 539 559 538 558 539 558 539 557 540 1682 539 557 540 558 539 559 538 557 540 558 539 560 537 559 538 557 540 561 536 558 539 1682 539 558 539 1682 539 559 538 557 540 558 539 559 538 559 538 1682 539 1684 537 1683 538 557 540 558 539 558 539 560 537 559 564
|
||||
#
|
||||
name: Heat_hi
|
||||
type: raw
|
||||
frequency: 38000
|
||||
duty_cycle: 0.330000
|
||||
data: 8959 4502 539 1682 539 1682 539 556 541 559 538 558 539 559 538 1680 541 1681 540 1684 537 1683 538 1684 537 557 540 560 537 558 539 1683 538 1682 539 558 539 559 538 559 538 558 539 558 539 1683 538 1681 540 1683 538 559 538 560 537 560 537 559 538 561 536 560 537 559 538 559 538 559 538 559 538 559 538 560 537 557 540 1682 539 557 540 1682 539 559 538 558 539 560 538 558 539 558 539 558 539 558 539 558 539 559 538 559 538 557 540 558 539 558 539 559 538 560 537 1684 537 561 536 557 540 559 538 559 538 557 540 558 539 559 538 560 537 558 539 558 539 559 538 558 539 559 539 559 538 557 540 559 538 557 540 558 540 561 536 558 539 558 539 1683 538 558 539 559 538 557 540 559 538 557 540 558 539 559 538 559 538 558 539 559 538 1681 540 558 539 1684 537 562 535 560 537 559 538 559 538 560 537 1682 539 1682 539 1682 539 1686 535 559 538 1682 539 559 538 1682 565
|
||||
#
|
||||
name: Heat_lo
|
||||
type: raw
|
||||
frequency: 38000
|
||||
duty_cycle: 0.330000
|
||||
data: 8961 4501 539 1681 540 1681 540 559 538 558 539 558 539 557 540 1682 539 1682 539 1681 540 1682 539 1682 539 1683 538 1682 539 1683 538 1682 539 557 540 560 537 558 539 560 537 560 537 558 539 1681 540 1681 540 1682 539 557 540 558 539 561 536 558 539 560 537 558 539 556 541 558 539 558 539 557 540 559 538 558 539 559 538 1684 537 559 538 1682 539 558 539 556 541 559 538 562 535 556 541 558 539 558 539 557 540 558 539 557 540 558 539 559 538 560 537 557 540 557 540 1682 539 558 539 557 540 558 539 559 538 559 538 557 540 558 539 558 539 558 539 558 539 557 540 561 536 558 539 586 511 558 539 557 540 586 511 559 539 556 541 557 540 557 540 1682 539 559 538 558 539 558 539 559 538 558 539 560 537 558 539 559 538 558 539 557 540 1681 540 558 539 1680 541 557 540 557 540 559 538 558 539 559 538 1682 539 1682 539 1682 539 558 539 558 539 1682 539 1682 539 558 565
|
||||
#
|
||||
# Model: Carrier 42QG5A580SC
|
||||
#
|
||||
name: Off
|
||||
type: raw
|
||||
frequency: 38000
|
||||
duty_cycle: 0.330000
|
||||
data: 8403 4308 519 1425 518 625 520 1461 485 1427 518 559 517 564 567 1386 518 1429 517 562 597 524 519 1431 517 1430 518 567 516 1426 518 565 517 1429 518 1431 518 1425 519 565 517 1457 485 562 518 1429 519 1424 520 565 516 1426 517 561 519 1430 515 1427 518 563 595 525 518 1428 517 528 489 21085 8424 4296 642 467 568 1400 569 533 569 536 647 1402 569 1395 569 535 568 534 569 1405 566 1397 567 549 568 535 569 1401 567 533 570 1399 571 537 570 534 568 537 567 1397 570 535 571 1401 568 534 567 533 567 1399 567 539 568 1402 569 565 569 532 571 1399 571 1397 569 535 566 1358 489 21085 8401 4318 512 1438 517 573 515 1476 532 1389 516 573 518 609 535 1393 568 1392 516 574 567 528 566 1393 565 1390 516 576 516 1437 517 574 517 1441 516 1445 567 1389 517 578 566 1390 516 578 568 1398 566 1392 515 575 516 1437 516 574 517 1442 567 1425 483 597 515 575 516 1446 514 539 490
|
||||
#
|
||||
name: Dh
|
||||
type: raw
|
||||
frequency: 38000
|
||||
duty_cycle: 0.330000
|
||||
data: 8391 4318 536 1417 518 564 516 1432 517 1428 518 563 518 562 517 1433 516 1428 518 564 519 565 513 1433 517 1430 517 562 518 1463 483 561 517 1430 516 1428 518 563 595 1393 516 559 519 565 514 1425 519 1429 517 569 514 1426 518 566 514 1466 485 562 518 559 518 561 518 1425 519 531 488 21116 8369 4318 569 534 641 1326 640 462 641 465 641 1330 641 1325 639 464 568 534 595 1403 641 1328 641 462 639 467 640 1328 568 536 642 1367 568 531 567 536 569 1398 568 537 542 1432 640 1327 567 532 568 535 567 1400 567 539 567 1399 568 536 568 1402 569 1402 568 1401 567 537 565 1359 487 21117 8392 4294 565 1388 517 575 566 1393 516 1443 514 574 516 573 517 1443 567 1391 515 574 516 577 566 1393 565 1390 566 528 567 1392 516 575 567 1395 565 1390 515 576 568 1391 515 572 566 528 565 1395 565 1393 515 572 564 1391 515 581 563 1389 516 578 513 609 483 576 566 1391 514 538 487
|
||||
#
|
||||
name: Cool_hi
|
||||
type: raw
|
||||
frequency: 38000
|
||||
duty_cycle: 0.330000
|
||||
data: 8424 4292 514 1428 518 559 518 1431 514 1432 517 561 515 566 512 1433 516 1434 516 562 519 562 516 1432 517 1426 518 566 516 1429 517 566 516 1429 518 1428 517 562 516 1467 481 570 517 561 518 565 519 563 515 566 516 567 516 1433 516 1429 514 564 518 561 518 562 519 1428 519 536 562 21009 8478 4280 638 461 641 1328 641 456 642 467 637 1325 643 1326 568 597 568 537 639 1330 641 1327 568 535 640 468 639 1324 568 534 543 1432 566 535 641 494 637 1327 566 532 640 1329 567 1398 640 1327 641 1327 640 1326 642 1328 568 531 568 538 567 1402 567 1406 566 1402 568 532 569 1357 489 21085 8401 4319 565 1394 516 577 567 1396 565 1390 515 574 543 566 516 1441 568 1392 516 575 566 531 566 1393 567 1390 516 576 515 1456 515 579 562 1392 515 1440 515 575 566 1391 516 576 544 569 563 525 516 574 514 606 514 576 514 1439 567 1390 515 575 515 574 570 566 567 1390 515 540 488
|
||||
#
|
||||
name: Cool_lo
|
||||
type: raw
|
||||
frequency: 38000
|
||||
duty_cycle: 0.330000
|
||||
data: 8401 4306 518 1460 483 566 518 1432 517 1430 514 561 516 564 517 1429 518 1430 519 592 485 564 517 1427 517 1432 516 561 545 1430 516 566 518 1462 483 1430 515 568 517 1427 516 566 516 564 517 1430 518 1425 518 559 518 562 518 1426 518 1425 517 593 484 561 516 573 516 1427 517 530 564 21007 8401 4322 642 465 643 1324 643 457 643 458 643 1327 643 1327 641 463 642 461 644 1325 644 1324 643 462 642 483 643 1328 641 460 645 1321 643 458 643 464 641 1325 643 459 644 1327 642 1323 643 461 643 461 642 1347 644 1331 641 463 639 462 641 1327 571 1405 542 1428 670 462 645 1282 562 21007 8402 4317 515 1436 517 606 641 1321 516 1438 517 572 515 578 516 1441 515 1440 516 572 515 575 515 1474 610 1316 515 574 644 1314 516 574 567 1394 640 1316 517 578 639 1319 516 576 517 575 513 1447 641 1315 516 576 515 577 566 1396 514 1440 516 573 518 571 638 456 565 1393 515 538 564
|
||||
#
|
||||
name: Heat_hi
|
||||
type: raw
|
||||
frequency: 38000
|
||||
duty_cycle: 0.330000
|
||||
data: 8399 4307 519 1426 518 560 517 1432 517 1460 485 561 518 558 517 1436 518 1427 518 555 520 561 517 1430 519 1428 516 560 519 1425 518 566 517 1430 516 1432 519 563 519 1425 518 563 515 1429 517 1433 517 1430 516 1432 518 1429 518 568 516 1432 515 1429 519 561 516 567 517 1427 519 533 487 21083 8424 4339 567 536 568 1402 641 493 608 462 545 1431 640 1326 567 532 568 538 640 1331 640 1329 641 536 565 534 641 1329 567 537 639 1329 640 462 642 467 641 1325 568 532 642 1332 640 488 568 534 565 536 566 566 536 567 641 1329 570 535 638 464 569 1401 641 1326 568 534 639 1287 490 21083 8403 4313 567 1390 516 579 514 1441 515 1438 517 575 516 576 568 1393 568 1394 515 606 534 530 515 1441 567 1425 482 576 568 1392 514 578 566 1392 569 1432 515 576 568 1389 517 577 515 1444 515 1437 569 1393 516 1444 566 1389 566 528 567 1394 566 1419 517 575 513 578 515 1440 516 539 490
|
||||
#
|
||||
name: Heat_lo
|
||||
type: raw
|
||||
frequency: 38000
|
||||
duty_cycle: 0.330000
|
||||
data: 8425 4291 542 1401 544 538 542 1404 518 1427 544 534 570 540 516 1434 542 1399 544 539 544 539 541 1403 541 1402 516 570 517 1427 545 566 511 1406 517 1431 542 534 544 1406 543 536 517 567 543 1404 542 1400 595 525 544 1405 542 534 516 1433 516 1428 544 537 544 535 543 1403 542 505 488 21084 8424 4298 566 535 569 1402 567 533 568 537 570 1403 570 1403 565 534 566 537 566 1402 569 1398 569 533 569 538 592 1446 569 535 570 1400 569 567 535 535 568 1437 568 533 568 1398 569 1402 565 533 567 534 569 1403 568 536 569 1402 568 535 567 534 571 1403 568 1415 566 536 571 1362 489 21084 8403 4313 516 1439 517 574 515 1442 515 1441 518 573 516 574 567 1397 514 1440 515 573 516 575 516 1443 515 1439 518 574 516 1440 517 608 535 1396 517 1441 517 579 515 1438 515 576 517 578 568 1390 569 1391 516 575 518 1439 516 573 517 1445 566 1391 516 571 517 572 516 1441 514 543 487
|
||||
#
|
||||
# Model: Samsung DB93
|
||||
#
|
||||
name: Off
|
||||
type: raw
|
||||
frequency: 38000
|
||||
duty_cycle: 0.330000
|
||||
data: 667 17837 3089 8903 555 445 578 1411 583 442 554 442 529 468 528 468 554 443 554 442 554 444 552 1441 552 472 523 475 522 1473 522 1473 522 475 547 1447 548 1446 548 1446 548 1446 548 1446 548 449 548 450 547 451 546 474 523 476 521 476 521 476 522 476 521 475 546 451 547 450 548 449 548 449 548 449 548 449 548 449 548 449 548 450 547 450 547 451 546 474 523 474 523 476 521 477 520 477 520 477 521 476 521 476 546 450 547 450 547 450 546 450 547 451 546 451 546 1448 546 1472 522 2982 3005 8963 522 1499 495 502 495 502 495 502 496 501 496 501 521 476 522 475 522 475 522 1472 522 475 522 475 522 1473 521 475 522 1473 522 1499 495 1500 494 1500 496 1499 521 1473 522 475 522 475 522 475 522 475 522 475 522 475 522 476 521 475 522 476 521 476 521 476 521 502 495 503 494 503 495 502 495 501 496 501 521 476 522 476 521 476 521 476 521 476 521 476 521 476 521 476 521 476 521 476 521 476 521 503 494 503 494 503 493 504 494 502 495 502 495 502 520 477 520 2984 3003 8966 519 1475 520 477 520 477 520 477 520 478 519 477 520 478 519 479 518 504 493 1502 493 504 493 503 494 503 494 1501 519 1476 518 1475 519 478 519 1476 518 1476 519 1477 517 1501 493 1503 491 1503 493 1502 493 1502 518 479 518 479 518 479 518 1476 518 1477 517 1477 517 504 493 504 493 504 493 531 466 507 490 1529 467 506 491 529 468 1527 492 1502 492 505 493 1502 492 1502 492 505 492 504 493 504 492 505 492 506 491 532 465 532 465 531 467 530 467 530 467 1528 467 1527 492
|
||||
#
|
||||
name: Dh
|
||||
type: raw
|
||||
frequency: 38000
|
||||
duty_cycle: 0.330000
|
||||
data: 667 17829 3090 8902 556 444 579 1410 584 441 529 468 529 468 554 443 554 442 555 443 553 444 551 1442 551 474 522 475 522 1473 522 475 522 475 547 1448 547 1447 547 1447 547 1447 548 1447 547 449 548 450 547 474 523 474 523 476 521 476 521 476 521 477 521 475 522 476 546 450 547 449 548 449 548 450 547 449 548 450 547 450 547 450 547 451 546 474 523 474 523 474 523 479 518 479 518 479 518 501 496 501 496 477 545 475 522 452 545 474 523 474 523 1472 522 1472 522 1472 522 1472 523 2981 3005 8990 494 1499 495 502 496 501 496 501 496 501 522 475 522 475 522 475 522 475 522 1473 521 475 522 475 522 1473 521 475 522 1473 521 1500 494 1500 495 1499 520 1474 522 1473 522 475 522 475 522 476 521 475 522 476 521 476 521 476 521 476 521 476 521 477 520 503 494 503 494 503 495 502 495 502 520 477 521 476 521 476 521 476 521 476 521 476 521 476 521 476 521 476 521 476 521 476 521 477 520 504 493 503 494 503 494 503 495 502 495 502 495 502 520 477 520 477 520 2984 3003 8966 519 1475 519 477 520 478 519 478 519 478 519 479 518 503 494 505 492 505 492 1503 493 504 493 504 493 504 518 1477 518 1476 518 1476 518 479 518 1477 517 1477 517 1501 493 1504 490 1528 468 1527 468 1527 493 1501 493 504 493 504 493 504 493 1501 493 1502 492 1502 492 504 493 505 491 532 440 556 466 531 467 530 468 530 467 530 467 1527 492 1503 491 505 492 504 493 504 493 505 491 1503 492 505 467 530 492 506 466 557 464 533 464 532 466 1528 467 1528 467 1528 466 1528 491
|
||||
#
|
||||
name: Cool_hi
|
||||
type: raw
|
||||
frequency: 38000
|
||||
duty_cycle: 0.330000
|
||||
data: 667 17831 3089 8903 581 420 578 1411 583 442 529 468 528 468 554 443 554 442 554 443 553 445 551 1443 550 475 521 475 522 1473 522 475 547 449 548 1447 548 1446 548 1446 548 1446 548 1446 548 449 548 449 548 450 547 473 524 476 521 475 522 476 520 476 522 475 522 475 547 449 549 449 548 449 548 449 548 449 548 449 548 449 548 449 548 449 548 450 547 474 523 474 523 476 521 476 521 476 520 477 521 476 546 451 547 450 547 450 547 449 548 450 547 1447 547 1448 546 1448 546 1472 523 2957 3029 8967 518 1477 517 502 495 501 496 501 521 475 522 475 522 475 522 475 522 475 522 1472 522 474 523 475 522 1473 521 475 522 1472 522 1499 495 1500 495 1499 520 1474 522 1473 521 475 522 475 522 475 522 475 522 475 522 475 522 475 522 475 522 476 521 502 495 502 495 503 494 502 496 501 496 501 521 476 522 476 521 475 522 475 522 476 521 476 521 476 521 476 521 476 521 476 521 476 521 476 521 503 494 503 494 503 494 503 495 502 495 502 520 477 520 476 521 476 521 2984 3003 8965 520 1474 521 477 520 477 520 477 520 477 520 477 520 478 519 504 493 504 493 1502 494 503 494 502 495 1500 520 1475 519 1475 519 1475 519 478 519 1475 519 1476 518 1501 493 1502 492 1503 493 1501 494 1501 518 1476 518 478 519 478 519 478 519 1476 518 1476 518 1477 517 504 493 506 491 506 491 506 491 506 492 505 492 504 493 504 518 481 516 1501 493 504 493 504 493 480 517 1501 493 504 493 504 493 504 493 505 491 532 466 531 466 532 466 1528 467 1527 468 1527 492 1502 492
|
||||
#
|
||||
name: Cool_lo
|
||||
type: raw
|
||||
frequency: 38000
|
||||
duty_cycle: 0.330000
|
||||
data: 667 17832 3088 8903 575 448 555 1411 583 441 529 468 529 468 554 443 554 442 554 443 553 444 551 1443 550 474 522 475 522 1473 522 475 522 475 547 1447 548 1446 548 1446 548 1446 548 1447 547 449 548 449 548 474 523 474 523 476 521 476 521 476 521 477 521 475 522 475 547 450 548 449 548 450 547 449 548 449 548 450 547 450 547 449 547 451 546 452 545 474 523 474 523 477 520 478 519 477 519 478 520 477 545 452 545 451 547 451 546 474 523 474 523 1450 544 1472 522 1472 522 1472 523 2981 3005 8990 494 1499 495 502 496 501 496 501 521 476 521 475 522 475 522 475 522 475 522 1473 521 475 522 475 522 1473 521 476 521 1473 521 1500 494 1500 495 1499 495 1499 521 1473 522 475 522 475 522 476 521 475 522 476 521 476 521 476 521 476 521 476 521 477 520 503 494 503 494 503 495 502 495 502 520 477 520 476 521 476 521 476 521 476 521 476 521 476 521 476 521 476 521 476 521 477 520 477 520 478 519 503 493 504 493 504 494 503 494 502 519 478 520 477 520 477 520 2984 3003 8966 519 1475 519 477 520 477 520 478 519 478 519 478 519 503 494 504 493 505 492 1503 493 504 493 504 493 503 519 478 519 1476 518 1476 518 478 519 1476 518 1477 517 1501 493 1504 490 1504 490 1503 493 1502 493 1502 517 480 517 504 493 480 517 1477 517 1502 492 1502 492 504 493 504 493 504 493 531 466 531 466 1529 467 1527 467 1527 492 504 493 1502 492 505 492 504 493 505 492 1503 492 505 492 505 492 505 467 557 464 532 441 556 466 532 466 1528 466 1528 491 1503 491 1503 466
|
||||
#
|
||||
name: Heat_hi
|
||||
type: raw
|
||||
frequency: 38000
|
||||
duty_cycle: 0.330000
|
||||
data: 665 17827 3090 8902 556 444 579 1412 583 441 530 467 529 468 554 442 555 442 554 442 554 444 551 1443 550 473 523 475 522 1472 521 475 523 474 523 1471 549 1446 548 1445 549 1446 548 1445 549 448 549 448 549 449 548 473 523 473 524 475 522 475 522 475 523 475 522 474 548 449 548 449 549 448 549 448 549 448 549 448 549 448 549 449 548 449 548 449 548 450 547 473 524 474 523 476 521 476 521 476 521 476 522 475 547 450 547 450 548 449 548 449 548 1447 547 1447 547 1447 547 1448 546 2957 3030 8962 522 1475 519 501 496 501 497 478 519 500 522 475 522 475 523 474 523 474 523 1472 522 474 523 474 523 1472 522 475 522 1472 522 1499 495 1499 496 1499 496 1498 522 1473 522 474 522 475 522 475 522 474 523 475 522 475 522 475 522 475 522 475 522 475 522 502 495 502 495 502 495 501 496 501 496 501 521 476 522 475 522 475 522 475 522 475 522 475 522 475 522 475 522 475 522 475 522 476 521 476 521 502 495 502 495 502 495 503 495 502 495 501 521 476 521 476 521 2983 3004 8964 521 1474 520 476 521 476 521 477 520 476 521 477 520 477 520 503 494 503 494 1501 494 502 495 502 495 502 520 477 521 1474 520 1474 520 477 520 1474 520 1475 519 1475 519 1500 494 1502 492 1502 493 1501 494 1500 519 478 519 477 520 477 520 1475 519 1475 519 1475 519 478 519 478 519 503 494 505 492 505 492 505 492 1503 493 1502 493 1502 517 1476 518 479 518 479 518 479 518 480 517 479 518 1501 493 504 493 504 493 530 467 531 466 531 467 1527 468 1527 491 1502 493 1501 493
|
||||
#
|
||||
name: Heat_lo
|
||||
type: raw
|
||||
frequency: 38000
|
||||
duty_cycle: 0.330000
|
||||
data: 668 17822 3064 8902 582 442 555 1413 581 442 528 468 529 494 528 469 502 495 527 470 526 471 525 1468 552 446 550 448 549 1446 548 448 549 448 549 1446 548 1448 546 1471 523 1473 521 1473 521 476 521 475 522 475 547 449 548 449 548 449 548 449 548 449 548 449 548 449 548 449 548 450 547 474 523 474 523 474 523 477 520 477 520 477 520 477 521 476 521 476 546 450 548 450 547 474 523 474 523 450 547 474 523 474 523 452 545 474 523 474 523 474 523 1500 494 1499 495 1499 496 1498 522 2955 3032 8963 521 1472 522 475 522 474 523 475 522 475 522 475 522 475 522 475 522 475 522 1499 495 502 495 502 495 1499 496 501 521 1473 522 1473 522 1472 522 1472 522 1473 521 1473 522 475 522 475 522 502 495 502 495 502 495 503 495 501 496 501 496 501 521 476 521 476 521 476 521 476 521 476 521 476 521 476 521 476 521 476 521 476 521 477 520 504 493 503 494 503 494 503 495 502 495 502 495 502 520 477 521 476 521 476 521 476 521 477 520 477 520 477 520 476 521 477 520 2984 3003 8967 518 1502 492 504 493 504 494 503 494 503 494 503 519 478 519 478 519 478 519 1476 518 478 518 479 518 478 519 478 519 1501 493 1501 493 506 491 1504 491 1527 468 1503 492 1526 493 1501 493 1501 494 1501 493 1501 493 504 493 504 493 504 493 1528 466 1529 466 1528 467 529 468 529 493 504 493 504 493 504 493 1502 492 1502 492 1502 467 529 493 1502 491 533 465 532 465 532 465 531 467 530 467 1528 467 530 467 530 467 530 467 530 467 530 467 1527 467 1528 466 1528 466 1529 492
|
||||
#
|
||||
# Model: Samsung AR-EH04
|
||||
#
|
||||
name: Off
|
||||
type: raw
|
||||
frequency: 38000
|
||||
duty_cycle: 0.330000
|
||||
data: 663 17769 3057 8901 529 492 527 1434 556 465 529 464 529 464 555 439 555 438 556 438 554 440 553 1435 552 444 549 470 524 1465 524 1466 522 473 522 1467 522 1466 549 1440 549 1440 548 1440 548 445 549 445 549 446 548 447 547 471 523 470 524 471 523 472 522 472 521 473 522 472 522 472 523 472 548 446 549 445 548 446 548 447 547 447 547 446 548 447 547 470 524 471 523 471 523 471 523 471 523 498 496 475 519 498 496 497 498 497 522 472 523 471 524 470 523 471 523 1443 546 1442 547 2947 3023 8935 522 1466 522 471 523 472 522 474 520 498 496 498 496 498 497 497 497 497 523 1466 523 471 523 471 523 1466 523 471 523 1466 522 1467 522 1467 522 1493 495 1493 496 1493 497 497 522 472 523 471 523 471 522 472 522 472 522 472 522 472 522 472 522 472 522 472 522 472 522 472 522 499 495 499 495 499 495 499 495 499 496 498 522 472 523 472 523 471 522 472 522 472 522 472 522 472 522 473 521 473 521 473 521 473 521 473 521 499 495 500 494 499 495 499 496 499 521 2947 3024 8937 521 1467 521 473 521 473 521 472 521 473 521 473 521 473 521 473 521 474 520 1469 520 500 494 500 494 1495 495 500 495 499 520 474 521 1468 520 1468 521 1468 521 1468 521 1468 521 1469 519 1470 518 1495 493 1496 493 500 495 499 520 474 521 1468 520 1469 520 1469 520 473 521 474 520 474 520 475 519 476 518 500 494 502 492 502 491 1497 493 1495 495 499 495 499 520 474 520 475 519 475 519 475 519 475 519 475 519 500 494 501 493 501 493 501 493 501 493 1498 491 1497 519
|
||||
#
|
||||
name: Dh
|
||||
type: raw
|
||||
frequency: 38000
|
||||
duty_cycle: 0.330000
|
||||
data: 665 17760 3083 8875 553 468 527 1432 584 438 555 439 529 464 555 439 555 438 556 438 555 439 553 1435 552 443 550 470 524 1466 523 471 522 473 521 1467 523 1466 549 1439 549 1440 549 1439 549 445 549 445 549 445 549 446 548 470 524 470 524 471 523 472 522 472 522 473 521 472 522 472 547 447 548 445 549 445 549 445 549 445 549 446 548 445 549 445 549 447 547 470 524 471 523 471 523 471 523 473 521 473 521 473 521 473 521 472 523 472 548 446 548 1441 547 1441 548 1441 547 1441 547 2947 3023 8935 522 1466 522 472 522 474 519 475 519 475 519 474 521 473 546 448 547 448 546 1465 523 449 545 448 546 1466 522 471 523 1467 522 1466 522 1493 495 1493 495 1493 496 1493 522 471 523 471 523 471 523 471 523 471 523 471 523 471 523 472 522 472 522 472 522 472 522 472 522 499 495 498 495 499 496 498 496 498 496 498 522 472 523 471 522 472 522 472 522 472 522 472 522 472 522 472 522 472 522 472 522 473 521 473 521 499 495 500 494 500 495 499 495 499 495 498 522 2947 3023 8937 520 1467 521 473 521 473 521 473 521 473 521 473 521 473 521 474 520 474 520 1495 494 500 494 500 495 500 494 1494 520 1468 521 1467 521 473 521 1468 521 1468 520 1469 519 1469 519 1471 517 1495 494 1495 494 1494 520 474 521 473 521 473 520 1468 521 1468 521 1468 520 474 520 475 519 475 519 500 493 500 494 501 493 501 493 501 493 1495 495 1494 520 474 520 474 520 474 520 475 519 1470 518 475 519 476 518 500 493 501 493 501 493 501 493 1497 492 1497 492 1496 493 1495 518
|
||||
#
|
||||
name: Cool_hi
|
||||
type: raw
|
||||
frequency: 38000
|
||||
duty_cycle: 0.330000
|
||||
data: 666 17765 3056 8901 529 492 526 1434 556 465 529 464 530 464 555 438 556 438 555 439 554 440 552 1436 551 443 550 470 524 1465 524 471 523 472 522 1467 521 1467 548 1441 549 1440 548 1440 548 445 549 445 549 445 549 446 548 447 547 470 524 471 523 471 523 473 521 472 522 473 521 473 521 473 522 472 548 446 549 446 548 446 548 447 547 447 547 470 524 447 547 471 523 471 523 471 523 471 523 471 523 475 519 498 496 498 496 498 496 497 498 497 523 1466 524 1443 545 1441 548 1442 546 2947 3023 8935 522 1466 522 472 522 472 522 498 496 498 496 498 496 498 496 498 522 472 523 1466 522 471 523 471 523 1466 523 471 523 1466 523 1467 522 1467 521 1493 496 1493 495 1493 497 497 522 472 523 471 523 471 523 472 522 472 522 472 522 472 522 472 522 472 522 472 522 472 522 473 521 499 495 499 495 499 495 499 496 498 496 498 522 472 522 472 523 472 521 472 522 472 522 472 522 472 522 473 521 473 521 473 521 473 521 474 520 500 494 500 494 500 495 500 495 499 521 2947 3024 8937 520 1467 521 473 521 473 521 473 521 473 521 473 521 473 521 474 520 474 520 1469 520 500 494 500 493 1496 494 1494 495 1494 520 1468 520 473 521 1469 519 1468 521 1469 519 1470 519 1470 519 1495 493 1496 493 1495 495 499 520 474 520 474 520 1469 520 1469 519 1469 519 474 520 475 519 500 494 500 494 500 494 502 492 502 492 502 493 501 493 1496 494 500 519 475 520 475 518 1470 519 475 518 476 518 475 519 476 494 525 493 501 493 501 493 1498 491 1498 491 1497 493 1496 518
|
||||
#
|
||||
name: Cool_lo
|
||||
type: raw
|
||||
frequency: 38000
|
||||
duty_cycle: 0.330000
|
||||
data: 664 17763 3082 8874 553 444 552 1433 583 438 529 464 530 464 555 439 555 438 556 438 555 440 553 1435 552 443 550 470 524 1466 523 472 521 472 522 1467 523 1466 549 1439 549 1439 549 1439 550 444 550 445 549 445 549 447 547 470 524 471 523 471 523 472 522 472 522 473 521 472 523 472 522 471 549 446 549 445 549 446 548 446 548 446 548 446 548 446 548 448 546 471 523 471 523 471 523 471 523 475 519 497 497 474 520 475 520 497 497 496 524 471 524 1465 523 1442 547 1442 547 1442 547 2946 3024 8935 522 1466 522 471 523 474 520 474 520 498 496 474 521 497 522 471 523 471 523 1465 523 471 523 471 523 1466 522 471 523 1466 523 1466 523 1493 495 1493 495 1493 496 1492 523 471 523 471 523 471 523 471 523 471 523 471 523 471 523 472 522 472 522 472 522 472 522 473 521 499 495 499 495 499 496 498 497 498 497 497 523 472 522 471 522 472 522 472 522 472 522 472 522 472 522 472 522 472 522 473 521 473 521 473 521 499 495 499 495 499 496 499 496 498 496 498 522 2946 3024 8937 521 1467 521 472 522 472 522 473 521 473 521 473 521 473 521 474 520 474 520 1495 493 500 494 499 495 499 495 499 496 1493 521 1468 520 473 521 1468 520 1468 521 1468 520 1469 519 1470 518 1495 494 1495 494 1494 495 499 520 473 521 473 521 1468 520 1469 520 1468 521 474 520 474 520 475 519 475 519 476 518 1496 492 1496 494 1495 495 499 520 1469 520 474 520 474 520 474 519 1470 520 474 520 476 518 476 519 477 517 500 494 500 494 503 491 1497 492 1496 493 1495 519 1470 519
|
||||
#
|
||||
name: Heat_hi
|
||||
type: raw
|
||||
frequency: 38000
|
||||
duty_cycle: 0.330000
|
||||
data: 666 17758 3056 8901 528 493 526 1434 580 441 554 439 529 465 554 439 555 439 555 439 554 440 553 1435 552 443 549 470 524 1465 524 472 522 472 521 1467 523 1467 548 1440 549 1440 548 1440 549 445 549 445 549 446 548 446 548 471 523 471 523 471 523 471 523 473 521 473 521 473 521 473 522 472 547 446 549 446 549 445 548 446 548 446 548 446 548 446 548 447 547 471 523 471 523 471 523 471 523 473 521 474 520 473 521 474 521 473 522 473 546 447 548 1441 548 1442 547 1442 547 1442 546 2948 3021 8936 521 1466 522 472 522 498 496 499 494 476 519 476 519 497 497 497 523 472 522 1466 523 471 523 472 522 1466 522 472 522 1466 522 1467 522 1467 522 1493 494 1495 495 1493 522 472 522 472 522 471 522 472 522 472 522 472 522 472 522 472 522 472 522 472 522 472 522 473 521 473 521 499 495 499 495 499 495 499 496 498 521 473 522 472 523 472 522 472 522 472 522 473 521 472 522 472 522 472 522 473 521 473 521 474 520 473 521 499 495 500 494 500 495 499 495 499 521 2947 3023 8938 520 1468 520 473 521 473 521 473 521 473 521 473 521 473 521 474 520 474 520 1495 494 500 494 500 494 500 495 500 494 1494 520 1468 521 474 520 1468 520 1469 520 1468 520 1469 520 1470 518 1496 493 1496 493 1495 495 499 519 475 520 474 520 1468 520 1469 519 1469 519 474 520 475 519 475 519 476 518 500 494 500 494 1497 492 1497 492 1496 493 1495 519 475 519 475 519 475 519 475 519 475 519 1471 518 476 518 500 494 501 493 501 493 501 493 1498 491 1498 491 1496 518 1472 517
|
||||
#
|
||||
name: Heat_lo
|
||||
type: raw
|
||||
frequency: 38000
|
||||
duty_cycle: 0.330000
|
||||
data: 664 17757 3057 8901 528 469 550 1434 556 465 553 440 529 465 554 439 555 439 555 438 555 440 553 1435 552 443 550 470 524 1466 522 472 522 472 521 1467 523 1466 549 1440 549 1440 548 1440 548 445 549 445 549 445 549 446 548 470 524 471 523 471 523 471 523 472 522 472 522 473 522 472 523 472 548 446 549 445 550 445 548 446 548 446 548 446 548 446 548 447 547 470 524 471 523 471 523 471 523 471 523 474 519 474 521 474 521 473 522 473 546 447 547 1441 548 1442 546 1442 547 1442 546 2947 3023 8935 522 1466 522 472 522 498 496 498 495 499 496 498 496 498 521 473 522 471 523 1466 522 471 523 471 522 1466 523 471 523 1467 522 1467 522 1467 521 1493 495 1494 496 1493 521 473 522 472 522 471 523 472 522 471 523 472 522 472 522 472 522 472 522 472 522 472 522 472 522 473 521 499 495 499 495 499 495 499 496 498 522 473 522 472 523 471 522 472 522 472 522 472 522 472 522 472 522 472 522 473 521 473 521 473 521 473 521 499 495 500 494 500 495 499 496 498 522 2947 3023 8937 521 1468 520 473 521 473 521 473 521 473 521 473 521 473 521 474 520 474 520 1470 518 500 494 500 494 500 494 500 494 1494 521 1468 521 473 521 1468 520 1468 520 1469 520 1469 520 1470 518 1495 493 1496 493 1495 494 500 519 475 520 474 520 1469 519 1469 520 1469 519 474 520 474 520 475 519 477 517 500 494 1496 493 1496 493 1496 493 500 495 1495 519 475 518 475 519 475 518 476 518 475 519 1470 519 500 494 500 494 501 493 501 493 501 493 1499 490 1497 493 1497 492 1496 518
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
Filetype: IR library file
|
||||
Version: 1
|
||||
# Last Updated 1st Sept, 2023
|
||||
# Last Checked 1st Oct, 2023
|
||||
# Last Updated 21st Dec, 2023
|
||||
# Last Checked 21st Dec, 2023
|
||||
#
|
||||
name: Power
|
||||
type: parsed
|
||||
@@ -3896,3 +3896,159 @@ type: parsed
|
||||
protocol: NECext
|
||||
address: 80 70 00 00
|
||||
command: C1 3E 00 00
|
||||
#
|
||||
name: Power
|
||||
type: parsed
|
||||
protocol: NECext
|
||||
address: 87 7C 00 00
|
||||
command: C8 37 00 00
|
||||
#
|
||||
name: Pause
|
||||
type: parsed
|
||||
protocol: NECext
|
||||
address: 87 7C 00 00
|
||||
command: 4A B5 00 00
|
||||
#
|
||||
name: Play
|
||||
type: parsed
|
||||
protocol: NECext
|
||||
address: 87 7C 00 00
|
||||
command: 01 FE 00 00
|
||||
#
|
||||
name: Prev
|
||||
type: parsed
|
||||
protocol: NECext
|
||||
address: 87 7C 00 00
|
||||
command: 05 FA 00 00
|
||||
#
|
||||
name: Next
|
||||
type: parsed
|
||||
protocol: NECext
|
||||
address: 87 7C 00 00
|
||||
command: 06 F9 00 00
|
||||
#
|
||||
name: Power
|
||||
type: parsed
|
||||
protocol: NECext
|
||||
address: 12 34 00 00
|
||||
command: 01 FE 00 00
|
||||
#
|
||||
name: Vol_up
|
||||
type: parsed
|
||||
protocol: NECext
|
||||
address: 12 34 00 00
|
||||
command: 0A F5 00 00
|
||||
#
|
||||
name: Vol_dn
|
||||
type: parsed
|
||||
protocol: NECext
|
||||
address: 12 34 00 00
|
||||
command: 0B F4 00 00
|
||||
#
|
||||
name: Mute
|
||||
type: parsed
|
||||
protocol: NECext
|
||||
address: 12 34 00 00
|
||||
command: 09 F6 00 00
|
||||
#
|
||||
name: Power
|
||||
type: parsed
|
||||
protocol: NEC
|
||||
address: 01 00 00 00
|
||||
command: 67 00 00 00
|
||||
#
|
||||
name: Next
|
||||
type: parsed
|
||||
protocol: NEC
|
||||
address: 01 00 00 00
|
||||
command: 38 00 00 00
|
||||
#
|
||||
name: Vol_up
|
||||
type: parsed
|
||||
protocol: NEC
|
||||
address: 01 00 00 00
|
||||
command: 3C 00 00 00
|
||||
#
|
||||
name: Vol_dn
|
||||
type: parsed
|
||||
protocol: NEC
|
||||
address: 01 00 00 00
|
||||
command: 3D 00 00 00
|
||||
#
|
||||
name: Mute
|
||||
type: parsed
|
||||
protocol: NEC
|
||||
address: 01 00 00 00
|
||||
command: 8C 00 00 00
|
||||
#
|
||||
name: Prev
|
||||
type: parsed
|
||||
protocol: NEC
|
||||
address: 00 00 00 00
|
||||
command: 44 00 00 00
|
||||
#
|
||||
name: Vol_dn
|
||||
type: parsed
|
||||
protocol: NEC
|
||||
address: 00 00 00 00
|
||||
command: 07 00 00 00
|
||||
#
|
||||
name: Vol_up
|
||||
type: parsed
|
||||
protocol: NEC
|
||||
address: 00 00 00 00
|
||||
command: 1C 00 00 00
|
||||
#
|
||||
name: Power
|
||||
type: raw
|
||||
frequency: 38000
|
||||
duty_cycle: 0.33
|
||||
data: 9120 4354 714 1539 660 497 633 499 631 500 630 503 628 503 628 503 629 503 628 503 628 1627 628 1627 628 1627 628 1627 628 1626 628 1627 628 1627 628 1627 628 1627 628 503 628 503 628 503 628 503 628 504 627 503 628 504 627 503 628 1627 628 1628 627 1628 627 1627 628 1627 628 1628 627 40094 9038 2194 628
|
||||
#
|
||||
name: Prev
|
||||
type: parsed
|
||||
protocol: NEC
|
||||
address: 01 00 00 00
|
||||
command: 5A 00 00 00
|
||||
#
|
||||
name: Next
|
||||
type: parsed
|
||||
protocol: NEC
|
||||
address: 01 00 00 00
|
||||
command: 5B 00 00 00
|
||||
#
|
||||
name: Pause
|
||||
type: parsed
|
||||
protocol: NEC
|
||||
address: 01 00 00 00
|
||||
command: B2 00 00 00
|
||||
#
|
||||
name: Pause
|
||||
type: parsed
|
||||
protocol: NECext
|
||||
address: 00 EF 00 00
|
||||
command: 11 EE 00 00
|
||||
#
|
||||
name: Pause
|
||||
type: parsed
|
||||
protocol: NEC
|
||||
address: 01 00 00 00
|
||||
command: 2C 00 00 00
|
||||
#
|
||||
name: Play
|
||||
type: parsed
|
||||
protocol: NEC
|
||||
address: 01 00 00 00
|
||||
command: B2 00 00 00
|
||||
#
|
||||
name: Play
|
||||
type: parsed
|
||||
protocol: NECext
|
||||
address: 00 EF 00 00
|
||||
command: 11 EE 00 00
|
||||
#
|
||||
name: Play
|
||||
type: parsed
|
||||
protocol: NEC
|
||||
address: 01 00 00 00
|
||||
command: 2C 00 00 00
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
Filetype: IR library file
|
||||
Version: 1
|
||||
#Last Updated 1st Oct, 2023
|
||||
#Last Checked 1st Oct, 2023
|
||||
#Last Updated 21st Dec, 2023
|
||||
#Last Checked 21st Dec, 2023
|
||||
#
|
||||
name: Power
|
||||
type: raw
|
||||
@@ -2103,3 +2103,39 @@ type: raw
|
||||
frequency: 38000
|
||||
duty_cycle: 0.33
|
||||
data: 1330 376 1303 376 460 1192 1331 376 1302 376 459 1191 463 1217 462 1218 1331 376 459 1195 484 1219 460 7907 1300 379 1300 380 456 1223 1300 380 1300 380 456 1224 456 1224 456 1224 1299 380 456 1224 456 1224 456 8166 1299 380 1299 380 456 1224 1299 380 1299 380 456 1224 456 1224 455 1224 1299 380 456 1224 455 1224 456 7909 1299 380 1299 380 455 1224 1299 380 1299 380 456 1224 455 1225 455 1225 1298 381 455 1225 454 1225 455
|
||||
#
|
||||
name: Power
|
||||
type: raw
|
||||
frequency: 38000
|
||||
duty_cycle: 0.33
|
||||
data: 9213 4493 613 530 612 529 613 528 614 526 616 1631 615 1631 615 529 613 528 614 1631 615 1631 615 1632 614 1632 614 529 613 528 614 1632 614 1630 616 527 615 1631 615 528 614 1634 611 527 614 527 615 527 615 1630 616 1635 611 528 614 1632 614 527 615 1634 612 1631 615 1632 614 527 615 39730 9215 2228 617 95835 9215 2231 614
|
||||
#
|
||||
name: Speed_up
|
||||
type: parsed
|
||||
protocol: NEC
|
||||
address: 30 00 00 00
|
||||
command: 89 00 00 00
|
||||
#
|
||||
name: Timer
|
||||
type: raw
|
||||
frequency: 38000
|
||||
duty_cycle: 0.33
|
||||
data: 9279 4487 620 526 617 528 614 527 615 527 615 1633 612 1631 614 526 615 527 614 1634 611 1631 614 1633 612 1633 612 529 612 531 610 1633 612 1632 614 528 613 1630 615 1633 613 1632 613 526 615 529 613 527 615 1633 613 1632 614 526 615 526 616 527 615 1632 614 1631 614 1632 614 526 615 39731 9204 2230 614
|
||||
#
|
||||
name: Power
|
||||
type: raw
|
||||
frequency: 38000
|
||||
duty_cycle: 0.33
|
||||
data: 2227 839 757 1597 751 1599 749 829 757 815 750 817 748 814 751 806 749 866 751 836 750 832 754 823 753 819 757 811 754 807 758 799 756 103041 2229 837 749 1605 754 1597 751 826 750 823 753 815 750 812 753 804 751 864 753 834 752 830 756 821 755 818 758 809 756 806 749 808 757 64662 2229 774 749 1558 748 60749 2229 775 748 1559 758
|
||||
#
|
||||
name: Speed_up
|
||||
type: raw
|
||||
frequency: 38000
|
||||
duty_cycle: 0.33
|
||||
data: 2222 843 753 1626 732 1590 758 820 756 817 759 808 757 804 751 806 749 893 724 1603 755 827 748 1595 753 820 756 1578 759 1570 757 827 728 99745 2231 834 752 1601 757 1592 756 821 755 817 759 808 757 805 750 807 758 856 751 1630 728 827 749 1622 726 820 756 1605 732 1570 757 800 755
|
||||
#
|
||||
name: Speed_dn
|
||||
type: raw
|
||||
frequency: 38000
|
||||
duty_cycle: 0.33
|
||||
data: 2221 844 752 1600 758 1591 757 820 756 816 749 817 748 813 752 804 751 1632 758 1596 752 1597 751 1594 754 1585 752 1582 756 806 749 808 757 102464 2224 841 756 1597 751 1599 749 828 748 824 752 815 750 811 754 802 753 1629 750 1604 754 1595 753 1591 757 1583 755 1579 759 804 751 806 749
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
Filetype: IR library file
|
||||
Version: 1
|
||||
# Last Updated 1st Oct, 2023
|
||||
# Last Checked 1st Oct, 2023
|
||||
# Last Checked 21st Dec, 2023
|
||||
#
|
||||
# TEMP FIX FOR POWER
|
||||
#
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
Filetype: IR library file
|
||||
Version: 1
|
||||
# Last Updated 29th Oct, 2023
|
||||
# Last Checked 29th Oct, 2023
|
||||
# Last Updated 21st Dec, 2023
|
||||
# Last Checked 21st Dec, 2023
|
||||
#
|
||||
name: Power
|
||||
type: parsed
|
||||
@@ -2459,3 +2459,9 @@ type: parsed
|
||||
protocol: NEC
|
||||
address: 38 00 00 00
|
||||
command: 1C 00 00 00
|
||||
#
|
||||
name: Mute
|
||||
type: parsed
|
||||
protocol: NEC
|
||||
address: 38 00 00 00
|
||||
command: 04 00 00 00
|
||||
|
||||
@@ -54,11 +54,11 @@ static void infrared_progress_view_draw_callback(Canvas* canvas, void* _model) {
|
||||
float progress_value = (float)model->progress / model->progress_total;
|
||||
elements_progress_bar(canvas, x + 4, y + 19, width - 7, progress_value);
|
||||
|
||||
uint8_t percent_value = 100 * model->progress / model->progress_total;
|
||||
char percents_string[10] = {0};
|
||||
snprintf(percents_string, sizeof(percents_string), "%d%%", percent_value);
|
||||
char number_string[10] = {0};
|
||||
snprintf(
|
||||
number_string, sizeof(number_string), "%d/%d", model->progress, model->progress_total);
|
||||
elements_multiline_text_aligned(
|
||||
canvas, x + 33, y + 37, AlignCenter, AlignCenter, percents_string);
|
||||
canvas, x + 33, y + 37, AlignCenter, AlignCenter, number_string);
|
||||
|
||||
canvas_draw_icon(canvas, x + 14, y + height - 14, &I_Pin_back_arrow_10x8);
|
||||
canvas_draw_str(canvas, x + 30, y + height - 6, "= stop");
|
||||
|
||||
@@ -164,6 +164,24 @@ App(
|
||||
sources=["plugins/supported_cards/microel.c"],
|
||||
)
|
||||
|
||||
App(
|
||||
appid="zolotaya_korona_parser",
|
||||
apptype=FlipperAppType.PLUGIN,
|
||||
entry_point="zolotaya_korona_plugin_ep",
|
||||
targets=["f7"],
|
||||
requires=["nfc"],
|
||||
sources=["plugins/supported_cards/zolotaya_korona.c"],
|
||||
)
|
||||
|
||||
App(
|
||||
appid="hid_parser",
|
||||
apptype=FlipperAppType.PLUGIN,
|
||||
entry_point="hid_plugin_ep",
|
||||
targets=["f7"],
|
||||
requires=["nfc"],
|
||||
sources=["plugins/supported_cards/hid.c"],
|
||||
)
|
||||
|
||||
App(
|
||||
appid="nfc_start",
|
||||
targets=["f7"],
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "mf_user_dict.h"
|
||||
|
||||
#include <nfc/helpers/nfc_dict.h>
|
||||
#include <toolbox/keys_dict.h>
|
||||
#include <nfc/protocols/mf_classic/mf_classic.h>
|
||||
#include <furi/furi.h>
|
||||
|
||||
@@ -15,22 +15,22 @@ struct MfUserDict {
|
||||
MfUserDict* mf_user_dict_alloc(size_t max_keys_to_load) {
|
||||
MfUserDict* instance = malloc(sizeof(MfUserDict));
|
||||
|
||||
NfcDict* dict = nfc_dict_alloc(
|
||||
NFC_APP_MF_CLASSIC_DICT_USER_PATH, NfcDictModeOpenAlways, sizeof(MfClassicKey));
|
||||
KeysDict* dict = keys_dict_alloc(
|
||||
NFC_APP_MF_CLASSIC_DICT_USER_PATH, KeysDictModeOpenAlways, sizeof(MfClassicKey));
|
||||
furi_assert(dict);
|
||||
|
||||
size_t dict_keys_num = nfc_dict_get_total_keys(dict);
|
||||
size_t dict_keys_num = keys_dict_get_total_keys(dict);
|
||||
instance->keys_num = MIN(max_keys_to_load, dict_keys_num);
|
||||
|
||||
if(instance->keys_num > 0) {
|
||||
instance->keys_arr = malloc(instance->keys_num * sizeof(MfClassicKey));
|
||||
for(size_t i = 0; i < instance->keys_num; i++) {
|
||||
bool key_loaded =
|
||||
nfc_dict_get_next_key(dict, instance->keys_arr[i].data, sizeof(MfClassicKey));
|
||||
keys_dict_get_next_key(dict, instance->keys_arr[i].data, sizeof(MfClassicKey));
|
||||
furi_assert(key_loaded);
|
||||
}
|
||||
}
|
||||
nfc_dict_free(dict);
|
||||
keys_dict_free(dict);
|
||||
|
||||
return instance;
|
||||
}
|
||||
@@ -67,13 +67,13 @@ bool mf_user_dict_delete_key(MfUserDict* instance, uint32_t index) {
|
||||
furi_assert(index < instance->keys_num);
|
||||
furi_assert(instance->keys_arr);
|
||||
|
||||
NfcDict* dict = nfc_dict_alloc(
|
||||
NFC_APP_MF_CLASSIC_DICT_USER_PATH, NfcDictModeOpenAlways, sizeof(MfClassicKey));
|
||||
KeysDict* dict = keys_dict_alloc(
|
||||
NFC_APP_MF_CLASSIC_DICT_USER_PATH, KeysDictModeOpenAlways, sizeof(MfClassicKey));
|
||||
furi_assert(dict);
|
||||
|
||||
bool key_delete_success =
|
||||
nfc_dict_delete_key(dict, instance->keys_arr[index].data, sizeof(MfClassicKey));
|
||||
nfc_dict_free(dict);
|
||||
keys_dict_delete_key(dict, instance->keys_arr[index].data, sizeof(MfClassicKey));
|
||||
keys_dict_free(dict);
|
||||
|
||||
if(key_delete_success) {
|
||||
instance->keys_num--;
|
||||
|
||||
@@ -344,7 +344,7 @@ bool nfc_load_file(NfcApp* instance, FuriString* path, bool show_dialog) {
|
||||
nfc_supported_cards_load_cache(instance->nfc_supported_cards);
|
||||
|
||||
FuriString* load_path = furi_string_alloc();
|
||||
if(nfc_has_shadow_file_internal(instance, path)) {
|
||||
if(nfc_has_shadow_file_internal(instance, path)) { //-V1051
|
||||
nfc_set_shadow_file_path(path, load_path);
|
||||
} else if(furi_string_end_with(path, NFC_APP_SHADOW_EXTENSION)) {
|
||||
size_t path_len = furi_string_size(path);
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
|
||||
#include <nfc/nfc_device.h>
|
||||
#include <nfc/helpers/nfc_data_generator.h>
|
||||
#include <nfc/helpers/nfc_dict.h>
|
||||
#include <toolbox/keys_dict.h>
|
||||
|
||||
#include <gui/modules/validators.h>
|
||||
#include <toolbox/path.h>
|
||||
@@ -80,7 +80,7 @@ typedef enum {
|
||||
} NfcRpcState;
|
||||
|
||||
typedef struct {
|
||||
NfcDict* dict;
|
||||
KeysDict* dict;
|
||||
uint8_t sectors_total;
|
||||
uint8_t sectors_read;
|
||||
uint8_t current_sector;
|
||||
|
||||
153
applications/main/nfc/plugins/supported_cards/hid.c
Normal file
153
applications/main/nfc/plugins/supported_cards/hid.c
Normal file
@@ -0,0 +1,153 @@
|
||||
#include "nfc_supported_card_plugin.h"
|
||||
|
||||
#include <flipper_application/flipper_application.h>
|
||||
|
||||
#include <nfc/nfc_device.h>
|
||||
#include <nfc/helpers/nfc_util.h>
|
||||
#include <nfc/protocols/mf_classic/mf_classic_poller_sync.h>
|
||||
|
||||
#define TAG "HID"
|
||||
|
||||
static const uint64_t hid_key = 0x484944204953;
|
||||
|
||||
bool hid_verify(Nfc* nfc) {
|
||||
bool verified = false;
|
||||
|
||||
do {
|
||||
const uint8_t verify_sector = 1;
|
||||
uint8_t block_num = mf_classic_get_first_block_num_of_sector(verify_sector);
|
||||
FURI_LOG_D(TAG, "Verifying sector %u", verify_sector);
|
||||
|
||||
MfClassicKey key = {};
|
||||
nfc_util_num2bytes(hid_key, COUNT_OF(key.data), key.data);
|
||||
|
||||
MfClassicAuthContext auth_ctx = {};
|
||||
MfClassicError error =
|
||||
mf_classic_poller_sync_auth(nfc, block_num, &key, MfClassicKeyTypeA, &auth_ctx);
|
||||
|
||||
if(error != MfClassicErrorNone) {
|
||||
FURI_LOG_D(TAG, "Failed to read block %u: %d", block_num, error);
|
||||
break;
|
||||
}
|
||||
|
||||
verified = true;
|
||||
} while(false);
|
||||
|
||||
return verified;
|
||||
}
|
||||
|
||||
static bool hid_read(Nfc* nfc, NfcDevice* device) {
|
||||
furi_assert(nfc);
|
||||
furi_assert(device);
|
||||
|
||||
bool is_read = false;
|
||||
|
||||
MfClassicData* data = mf_classic_alloc();
|
||||
nfc_device_copy_data(device, NfcProtocolMfClassic, data);
|
||||
|
||||
do {
|
||||
MfClassicType type = MfClassicType1k;
|
||||
MfClassicError error = mf_classic_poller_sync_detect_type(nfc, &type);
|
||||
if(error != MfClassicErrorNone) break;
|
||||
|
||||
data->type = type;
|
||||
MfClassicDeviceKeys keys = {};
|
||||
for(size_t i = 0; i < mf_classic_get_total_sectors_num(data->type); i++) {
|
||||
nfc_util_num2bytes(hid_key, sizeof(MfClassicKey), keys.key_a[i].data);
|
||||
FURI_BIT_SET(keys.key_a_mask, i);
|
||||
nfc_util_num2bytes(hid_key, sizeof(MfClassicKey), keys.key_b[i].data);
|
||||
FURI_BIT_SET(keys.key_b_mask, i);
|
||||
}
|
||||
|
||||
error = mf_classic_poller_sync_read(nfc, &keys, data);
|
||||
if(error != MfClassicErrorNone) {
|
||||
FURI_LOG_W(TAG, "Failed to read data");
|
||||
break;
|
||||
}
|
||||
|
||||
nfc_device_set_data(device, NfcProtocolMfClassic, data);
|
||||
|
||||
is_read = true;
|
||||
} while(false);
|
||||
|
||||
mf_classic_free(data);
|
||||
|
||||
return is_read;
|
||||
}
|
||||
|
||||
static uint8_t get_bit_length(const uint8_t* half_block) {
|
||||
uint8_t bitLength = 0;
|
||||
uint32_t* halves = (uint32_t*)half_block;
|
||||
if(halves[0] == 0) {
|
||||
uint8_t leading0s = __builtin_clz(REVERSE_BYTES_U32(halves[1]));
|
||||
bitLength = 31 - leading0s;
|
||||
} else {
|
||||
uint8_t leading0s = __builtin_clz(REVERSE_BYTES_U32(halves[0]));
|
||||
bitLength = 63 - leading0s;
|
||||
}
|
||||
|
||||
return bitLength;
|
||||
}
|
||||
|
||||
static uint64_t get_pacs_bits(const uint8_t* block, uint8_t bitLength) {
|
||||
// Remove sentinel bit from credential. Byteswapping to handle array of bytes vs 64bit value
|
||||
uint64_t sentinel = __builtin_bswap64(1ULL << bitLength);
|
||||
uint64_t swapped = 0;
|
||||
memcpy(&swapped, block, sizeof(uint64_t));
|
||||
swapped = __builtin_bswap64(swapped ^ sentinel);
|
||||
FURI_LOG_D(TAG, "PACS: (%d) %016llx", bitLength, swapped);
|
||||
return swapped;
|
||||
}
|
||||
|
||||
static bool hid_parse(const NfcDevice* device, FuriString* parsed_data) {
|
||||
furi_assert(device);
|
||||
|
||||
const MfClassicData* data = nfc_device_get_data(device, NfcProtocolMfClassic);
|
||||
|
||||
bool parsed = false;
|
||||
|
||||
do {
|
||||
// verify key
|
||||
const uint8_t verify_sector = 1;
|
||||
MfClassicSectorTrailer* sec_tr =
|
||||
mf_classic_get_sector_trailer_by_sector(data, verify_sector);
|
||||
uint64_t key = nfc_util_bytes2num(sec_tr->key_a.data, 6);
|
||||
if(key != hid_key) break;
|
||||
|
||||
// Currently doesn't support bit length > 63
|
||||
const uint8_t* credential_block = data->block[5].data + 8;
|
||||
|
||||
uint8_t bitLength = get_bit_length(credential_block);
|
||||
if(bitLength == 0) break;
|
||||
|
||||
uint64_t credential = get_pacs_bits(credential_block, bitLength);
|
||||
if(credential == 0) break;
|
||||
|
||||
furi_string_printf(parsed_data, "\e#HID Card\n%dbit\n%llx", bitLength, credential);
|
||||
|
||||
parsed = true;
|
||||
|
||||
} while(false);
|
||||
|
||||
return parsed;
|
||||
}
|
||||
|
||||
/* Actual implementation of app<>plugin interface */
|
||||
static const NfcSupportedCardsPlugin hid_plugin = {
|
||||
.protocol = NfcProtocolMfClassic,
|
||||
.verify = hid_verify,
|
||||
.read = hid_read,
|
||||
.parse = hid_parse,
|
||||
};
|
||||
|
||||
/* Plugin descriptor to comply with basic plugin specification */
|
||||
static const FlipperAppPluginDescriptor hid_plugin_descriptor = {
|
||||
.appid = NFC_SUPPORTED_CARD_PLUGIN_APP_ID,
|
||||
.ep_api_version = NFC_SUPPORTED_CARD_PLUGIN_API_VERSION,
|
||||
.entry_point = &hid_plugin,
|
||||
};
|
||||
|
||||
/* Plugin entry point - must return a pointer to const descriptor */
|
||||
const FlipperAppPluginDescriptor* hid_plugin_ep() {
|
||||
return &hid_plugin_descriptor;
|
||||
}
|
||||
@@ -250,19 +250,18 @@ static bool kazan_parse(const NfcDevice* device, FuriString* parsed_data) {
|
||||
last_trip.day = block_start_ptr[2];
|
||||
last_trip.hour = block_start_ptr[3];
|
||||
last_trip.minute = block_start_ptr[4];
|
||||
bool is_last_trip_valid = (block_start_ptr[0] | block_start_ptr[1] | block_start_ptr[0]) &&
|
||||
bool is_last_trip_valid = (block_start_ptr[0] | block_start_ptr[1] | block_start_ptr[2]) &&
|
||||
(last_trip.day < 32 && last_trip.month < 12 &&
|
||||
last_trip.hour < 24 && last_trip.minute < 60);
|
||||
|
||||
start_block_num = mf_classic_get_first_block_num_of_sector(balance_sector_number);
|
||||
block_start_ptr = &data->block[start_block_num].data[0];
|
||||
|
||||
const uint32_t trip_counter = (block_start_ptr[3] << 24) | (block_start_ptr[2] << 16) |
|
||||
(block_start_ptr[1] << 8) | (block_start_ptr[0]);
|
||||
const uint32_t trip_counter = nfc_util_bytes2num_little_endian(block_start_ptr, 4);
|
||||
|
||||
size_t uid_len = 0;
|
||||
const uint8_t* uid = mf_classic_get_uid(data, &uid_len);
|
||||
const uint32_t card_number = (uid[3] << 24) | (uid[2] << 16) | (uid[1] << 8) | (uid[0]);
|
||||
const uint32_t card_number = nfc_util_bytes2num_little_endian(uid, 4);
|
||||
|
||||
furi_string_cat_printf(
|
||||
parsed_data, "\e#Kazan transport card\nCard number: %lu\n", card_number);
|
||||
|
||||
@@ -148,15 +148,14 @@ static bool metromoney_parse(const NfcDevice* device, FuriString* parsed_data) {
|
||||
const uint8_t* block_start_ptr =
|
||||
&data->block[start_block_num + ticket_block_number].data[0];
|
||||
|
||||
uint32_t balance = (block_start_ptr[3] << 24) | (block_start_ptr[2] << 16) |
|
||||
(block_start_ptr[1] << 8) | (block_start_ptr[0]);
|
||||
uint32_t balance = nfc_util_bytes2num_little_endian(block_start_ptr, 4);
|
||||
|
||||
uint32_t balance_lari = balance / 100;
|
||||
uint8_t balance_tetri = balance % 100;
|
||||
|
||||
size_t uid_len = 0;
|
||||
const uint8_t* uid = mf_classic_get_uid(data, &uid_len);
|
||||
uint32_t card_number = (uid[3] << 24) | (uid[2] << 16) | (uid[1] << 8) | (uid[0]);
|
||||
uint32_t card_number = nfc_util_bytes2num_little_endian(uid, 4);
|
||||
|
||||
furi_string_printf(
|
||||
parsed_data,
|
||||
|
||||
254
applications/main/nfc/plugins/supported_cards/zolotaya_korona.c
Normal file
254
applications/main/nfc/plugins/supported_cards/zolotaya_korona.c
Normal file
@@ -0,0 +1,254 @@
|
||||
/*
|
||||
* Parser for Zolotaya Korona card (Russia).
|
||||
*
|
||||
* Copyright 2023 Leptoptilos <leptoptilos@icloud.com>
|
||||
*
|
||||
* More info about Zolotaya Korona cards: https://github.com/metrodroid/metrodroid/wiki/Zolotaya-Korona
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include "core/core_defines.h"
|
||||
#include "core/string.h"
|
||||
#include "furi_hal_rtc.h"
|
||||
#include "nfc_supported_card_plugin.h"
|
||||
|
||||
#include "protocols/mf_classic/mf_classic.h"
|
||||
#include <flipper_application/flipper_application.h>
|
||||
|
||||
#include <nfc/nfc_device.h>
|
||||
#include <nfc/helpers/nfc_util.h>
|
||||
#include <nfc/protocols/mf_classic/mf_classic_poller_sync.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#define TAG "Zolotaya Korona"
|
||||
|
||||
#define TRIP_SECTOR_NUM (4)
|
||||
#define PURSE_SECTOR_NUM (6)
|
||||
#define INFO_SECTOR_NUM (15)
|
||||
|
||||
typedef struct {
|
||||
uint64_t a;
|
||||
uint64_t b;
|
||||
} MfClassicKeyPair;
|
||||
|
||||
// Sector 15 data. Byte [11] contains the mistake. If byte [11] was 0xEF, bytes [1-18] means "ЗАО Золотая Корона"
|
||||
static const uint8_t info_sector_signature[] = {0xE2, 0x87, 0x80, 0x8E, 0x20, 0x87, 0xAE,
|
||||
0xAB, 0xAE, 0xF2, 0xA0, 0xEF, 0x20, 0x8A,
|
||||
0xAE, 0xE0, 0xAE, 0xAD, 0xA0, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00};
|
||||
|
||||
#define FURI_HAL_RTC_SECONDS_PER_MINUTE 60
|
||||
#define FURI_HAL_RTC_SECONDS_PER_HOUR (FURI_HAL_RTC_SECONDS_PER_MINUTE * 60)
|
||||
#define FURI_HAL_RTC_SECONDS_PER_DAY (FURI_HAL_RTC_SECONDS_PER_HOUR * 24)
|
||||
#define FURI_HAL_RTC_EPOCH_START_YEAR 1970
|
||||
|
||||
void timestamp_to_datetime(uint32_t timestamp, FuriHalRtcDateTime* datetime) {
|
||||
uint32_t days = timestamp / FURI_HAL_RTC_SECONDS_PER_DAY;
|
||||
uint32_t seconds_in_day = timestamp % FURI_HAL_RTC_SECONDS_PER_DAY;
|
||||
|
||||
datetime->year = FURI_HAL_RTC_EPOCH_START_YEAR;
|
||||
|
||||
while(days >= furi_hal_rtc_get_days_per_year(datetime->year)) {
|
||||
days -= furi_hal_rtc_get_days_per_year(datetime->year);
|
||||
(datetime->year)++;
|
||||
}
|
||||
|
||||
datetime->month = 1;
|
||||
while(days >= furi_hal_rtc_get_days_per_month(
|
||||
furi_hal_rtc_is_leap_year(datetime->year), datetime->month)) {
|
||||
days -= furi_hal_rtc_get_days_per_month(
|
||||
furi_hal_rtc_is_leap_year(datetime->year), datetime->month);
|
||||
(datetime->month)++;
|
||||
}
|
||||
|
||||
datetime->day = days + 1;
|
||||
datetime->hour = seconds_in_day / FURI_HAL_RTC_SECONDS_PER_HOUR;
|
||||
datetime->minute =
|
||||
(seconds_in_day % FURI_HAL_RTC_SECONDS_PER_HOUR) / FURI_HAL_RTC_SECONDS_PER_MINUTE;
|
||||
datetime->second = seconds_in_day % FURI_HAL_RTC_SECONDS_PER_MINUTE;
|
||||
}
|
||||
|
||||
uint64_t bytes2num_bcd(const uint8_t* src, uint8_t len_bytes) {
|
||||
furi_assert(src);
|
||||
|
||||
uint64_t res = 0;
|
||||
|
||||
for(uint8_t i = 0; i < len_bytes; i++) {
|
||||
res *= 10;
|
||||
res += src[i] / 16;
|
||||
res *= 10;
|
||||
res += src[i] % 16;
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
static bool zolotaya_korona_parse(const NfcDevice* device, FuriString* parsed_data) {
|
||||
furi_assert(device);
|
||||
|
||||
const MfClassicData* data = nfc_device_get_data(device, NfcProtocolMfClassic);
|
||||
|
||||
bool parsed = false;
|
||||
|
||||
do {
|
||||
// Verify info sector data
|
||||
const uint8_t start_info_block_number =
|
||||
mf_classic_get_first_block_num_of_sector(INFO_SECTOR_NUM);
|
||||
const uint8_t* block_start_ptr = &data->block[start_info_block_number].data[0];
|
||||
|
||||
bool verified = true;
|
||||
for(uint8_t i = 0; i < sizeof(info_sector_signature); i++) {
|
||||
if(i == 16) {
|
||||
block_start_ptr = &data->block[start_info_block_number + 1].data[0];
|
||||
}
|
||||
if(block_start_ptr[i % 16] != info_sector_signature[i]) {
|
||||
verified = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(!verified) break;
|
||||
|
||||
// Parse data
|
||||
|
||||
// INFO SECTOR
|
||||
// block 1
|
||||
const uint8_t region_number = bytes2num_bcd(block_start_ptr + 10, 1);
|
||||
|
||||
// block 2
|
||||
block_start_ptr = &data->block[start_info_block_number + 2].data[4];
|
||||
const uint64_t card_number =
|
||||
bytes2num_bcd(block_start_ptr, 9) * 10 + bytes2num_bcd(block_start_ptr + 9, 1) / 10;
|
||||
|
||||
// TRIP SECTOR
|
||||
const uint8_t start_trip_block_number =
|
||||
mf_classic_get_first_block_num_of_sector(TRIP_SECTOR_NUM);
|
||||
// block 0
|
||||
block_start_ptr = &data->block[start_trip_block_number].data[7];
|
||||
|
||||
const uint8_t status = block_start_ptr[0] % 16;
|
||||
const uint16_t sequence_number = nfc_util_bytes2num(block_start_ptr + 1, 2);
|
||||
const uint8_t discount_code = nfc_util_bytes2num(block_start_ptr + 3, 1);
|
||||
|
||||
// block 1: refill block
|
||||
block_start_ptr = &data->block[start_trip_block_number + 1].data[1];
|
||||
|
||||
const uint16_t refill_machine_id = nfc_util_bytes2num_little_endian(block_start_ptr, 2);
|
||||
const uint32_t last_refill_timestamp =
|
||||
nfc_util_bytes2num_little_endian(block_start_ptr + 2, 4);
|
||||
const uint32_t last_refill_amount =
|
||||
nfc_util_bytes2num_little_endian(block_start_ptr + 6, 4);
|
||||
const uint32_t last_refill_amount_rub = last_refill_amount / 100;
|
||||
const uint8_t last_refill_amount_kop = last_refill_amount % 100;
|
||||
const uint16_t refill_counter = nfc_util_bytes2num_little_endian(block_start_ptr + 10, 2);
|
||||
|
||||
FuriHalRtcDateTime last_refill_datetime = {0};
|
||||
timestamp_to_datetime(last_refill_timestamp, &last_refill_datetime);
|
||||
|
||||
// block 2: trip block
|
||||
block_start_ptr = &data->block[start_trip_block_number + 2].data[0];
|
||||
const char validator_first_letter =
|
||||
nfc_util_bytes2num_little_endian(block_start_ptr + 1, 1);
|
||||
const uint32_t validator_id = bytes2num_bcd(block_start_ptr + 2, 3);
|
||||
const uint32_t last_trip_timestamp =
|
||||
nfc_util_bytes2num_little_endian(block_start_ptr + 6, 4);
|
||||
const uint8_t track_number = nfc_util_bytes2num_little_endian(block_start_ptr + 10, 1);
|
||||
const uint32_t prev_balance = nfc_util_bytes2num_little_endian(block_start_ptr + 11, 4);
|
||||
const uint32_t prev_balance_rub = prev_balance / 100;
|
||||
const uint8_t prev_balance_kop = prev_balance % 100;
|
||||
|
||||
FuriHalRtcDateTime last_trip_datetime = {0};
|
||||
timestamp_to_datetime(last_trip_timestamp, &last_trip_datetime);
|
||||
|
||||
// PARSE DATA FROM PURSE SECTOR
|
||||
const uint8_t start_purse_block_number =
|
||||
mf_classic_get_first_block_num_of_sector(PURSE_SECTOR_NUM);
|
||||
block_start_ptr = &data->block[start_purse_block_number].data[0];
|
||||
|
||||
// block 0
|
||||
uint32_t balance = nfc_util_bytes2num_little_endian(block_start_ptr, 4);
|
||||
|
||||
uint32_t balance_rub = balance / 100;
|
||||
uint8_t balance_kop = balance % 100;
|
||||
|
||||
furi_string_cat_printf(
|
||||
parsed_data,
|
||||
"\e#Zolotaya korona\nCard number: %llu\nRegion: %u\nBalance: %lu.%02u RUR\nPrev. balance: %lu.%02u RUR",
|
||||
card_number,
|
||||
region_number,
|
||||
balance_rub,
|
||||
balance_kop,
|
||||
prev_balance_rub,
|
||||
prev_balance_kop);
|
||||
|
||||
furi_string_cat_printf(
|
||||
parsed_data,
|
||||
"\nLast refill amount: %lu.%02u RUR\nRefill counter: %u\nLast refill: %u.%02u.%02u %02u:%02u\nRefill machine id: %u",
|
||||
last_refill_amount_rub,
|
||||
last_refill_amount_kop,
|
||||
refill_counter,
|
||||
last_refill_datetime.day,
|
||||
last_refill_datetime.month,
|
||||
last_refill_datetime.year,
|
||||
last_refill_datetime.hour,
|
||||
last_refill_datetime.minute,
|
||||
refill_machine_id);
|
||||
|
||||
furi_string_cat_printf(
|
||||
parsed_data,
|
||||
"\nLast trip: %u.%02u.%02u %02u:%02u\nTrack number: %u\nValidator: %c%06lu",
|
||||
last_trip_datetime.day,
|
||||
last_trip_datetime.month,
|
||||
last_trip_datetime.year,
|
||||
last_trip_datetime.hour,
|
||||
last_trip_datetime.minute,
|
||||
track_number,
|
||||
validator_first_letter,
|
||||
validator_id);
|
||||
|
||||
if(furi_hal_rtc_is_flag_set(FuriHalRtcFlagDebug)) {
|
||||
furi_string_cat_printf(
|
||||
parsed_data,
|
||||
"\nStatus: %u\nSequence num: %u\nDiscount code: %u",
|
||||
status,
|
||||
sequence_number,
|
||||
discount_code);
|
||||
}
|
||||
|
||||
parsed = true;
|
||||
} while(false);
|
||||
|
||||
return parsed;
|
||||
}
|
||||
|
||||
/* Actual implementation of app<>plugin interface */
|
||||
static const NfcSupportedCardsPlugin zolotaya_korona_plugin = {
|
||||
.protocol = NfcProtocolMfClassic,
|
||||
.verify = NULL,
|
||||
.read = NULL,
|
||||
.parse = zolotaya_korona_parse,
|
||||
};
|
||||
|
||||
/* Plugin descriptor to comply with basic plugin specification */
|
||||
static const FlipperAppPluginDescriptor zolotaya_korona_plugin_descriptor = {
|
||||
.appid = NFC_SUPPORTED_CARD_PLUGIN_APP_ID,
|
||||
.ep_api_version = NFC_SUPPORTED_CARD_PLUGIN_API_VERSION,
|
||||
.entry_point = &zolotaya_korona_plugin,
|
||||
};
|
||||
|
||||
/* Plugin entry point - must return a pointer to const descriptor */
|
||||
const FlipperAppPluginDescriptor* zolotaya_korona_plugin_ep() {
|
||||
return &zolotaya_korona_plugin_descriptor;
|
||||
}
|
||||
@@ -4363,4 +4363,39 @@ EB9D9C1B03F6
|
||||
5A4920FD6F87
|
||||
544954CBB2C4
|
||||
4752533E1965
|
||||
17C06D19E92F
|
||||
17C06D19E92F
|
||||
|
||||
# Bandai Namco Passport [fka Banapassport] / Sega Aime Card
|
||||
6090D00632F5
|
||||
019761AA8082
|
||||
574343467632
|
||||
A99164400748
|
||||
62742819AD7C
|
||||
CC5075E42BA1
|
||||
B9DF35A0814C
|
||||
8AF9C718F23D
|
||||
58CD5C3673CB
|
||||
FC80E88EB88C
|
||||
7A3CDAD7C023
|
||||
30424C029001
|
||||
024E4E44001F
|
||||
ECBBFA57C6AD
|
||||
4757698143BD
|
||||
1D30972E6485
|
||||
F8526D1A8D6D
|
||||
1300EC8C7E80
|
||||
F80A65A87FFA
|
||||
DEB06ED4AF8E
|
||||
4AD96BF28190
|
||||
000390014D41
|
||||
0800F9917CB0
|
||||
730050555253
|
||||
4146D4A956C4
|
||||
131157FBB126
|
||||
E69DD9015A43
|
||||
337237F254D5
|
||||
9A8389F32FBF
|
||||
7B8FB4A7100B
|
||||
C8382A233993
|
||||
7B304F2A12A6
|
||||
FC9418BF788B
|
||||
|
||||
@@ -41,7 +41,8 @@ NfcCommand nfc_dict_attack_worker_callback(NfcGenericEvent event, void* context)
|
||||
instance->view_dispatcher, NfcCustomEventDictAttackDataUpdate);
|
||||
} else if(mfc_event->type == MfClassicPollerEventTypeRequestKey) {
|
||||
MfClassicKey key = {};
|
||||
if(nfc_dict_get_next_key(instance->nfc_dict_context.dict, key.data, sizeof(MfClassicKey))) {
|
||||
if(keys_dict_get_next_key(
|
||||
instance->nfc_dict_context.dict, key.data, sizeof(MfClassicKey))) {
|
||||
mfc_event->data->key_request_data.key = key;
|
||||
mfc_event->data->key_request_data.key_provided = true;
|
||||
instance->nfc_dict_context.dict_keys_current++;
|
||||
@@ -60,7 +61,7 @@ NfcCommand nfc_dict_attack_worker_callback(NfcGenericEvent event, void* context)
|
||||
view_dispatcher_send_custom_event(
|
||||
instance->view_dispatcher, NfcCustomEventDictAttackDataUpdate);
|
||||
} else if(mfc_event->type == MfClassicPollerEventTypeNextSector) {
|
||||
nfc_dict_rewind(instance->nfc_dict_context.dict);
|
||||
keys_dict_rewind(instance->nfc_dict_context.dict);
|
||||
instance->nfc_dict_context.dict_keys_current = 0;
|
||||
instance->nfc_dict_context.current_sector =
|
||||
mfc_event->data->next_sector_data.current_sector;
|
||||
@@ -79,7 +80,7 @@ NfcCommand nfc_dict_attack_worker_callback(NfcGenericEvent event, void* context)
|
||||
view_dispatcher_send_custom_event(
|
||||
instance->view_dispatcher, NfcCustomEventDictAttackDataUpdate);
|
||||
} else if(mfc_event->type == MfClassicPollerEventTypeKeyAttackStop) {
|
||||
nfc_dict_rewind(instance->nfc_dict_context.dict);
|
||||
keys_dict_rewind(instance->nfc_dict_context.dict);
|
||||
instance->nfc_dict_context.is_key_attack = false;
|
||||
instance->nfc_dict_context.dict_keys_current = 0;
|
||||
view_dispatcher_send_custom_event(
|
||||
@@ -124,15 +125,15 @@ static void nfc_scene_mf_classic_dict_attack_prepare_view(NfcApp* instance) {
|
||||
scene_manager_get_scene_state(instance->scene_manager, NfcSceneMfClassicDictAttack);
|
||||
if(state == DictAttackStateUserDictInProgress) {
|
||||
do {
|
||||
if(!nfc_dict_check_presence(NFC_APP_MF_CLASSIC_DICT_USER_PATH)) {
|
||||
if(!keys_dict_check_presence(NFC_APP_MF_CLASSIC_DICT_USER_PATH)) {
|
||||
state = DictAttackStateSystemDictInProgress;
|
||||
break;
|
||||
}
|
||||
|
||||
instance->nfc_dict_context.dict = nfc_dict_alloc(
|
||||
NFC_APP_MF_CLASSIC_DICT_USER_PATH, NfcDictModeOpenAlways, sizeof(MfClassicKey));
|
||||
if(nfc_dict_get_total_keys(instance->nfc_dict_context.dict) == 0) {
|
||||
nfc_dict_free(instance->nfc_dict_context.dict);
|
||||
instance->nfc_dict_context.dict = keys_dict_alloc(
|
||||
NFC_APP_MF_CLASSIC_DICT_USER_PATH, KeysDictModeOpenAlways, sizeof(MfClassicKey));
|
||||
if(keys_dict_get_total_keys(instance->nfc_dict_context.dict) == 0) {
|
||||
keys_dict_free(instance->nfc_dict_context.dict);
|
||||
state = DictAttackStateSystemDictInProgress;
|
||||
break;
|
||||
}
|
||||
@@ -141,13 +142,13 @@ static void nfc_scene_mf_classic_dict_attack_prepare_view(NfcApp* instance) {
|
||||
} while(false);
|
||||
}
|
||||
if(state == DictAttackStateSystemDictInProgress) {
|
||||
instance->nfc_dict_context.dict = nfc_dict_alloc(
|
||||
NFC_APP_MF_CLASSIC_DICT_SYSTEM_PATH, NfcDictModeOpenExisting, sizeof(MfClassicKey));
|
||||
instance->nfc_dict_context.dict = keys_dict_alloc(
|
||||
NFC_APP_MF_CLASSIC_DICT_SYSTEM_PATH, KeysDictModeOpenExisting, sizeof(MfClassicKey));
|
||||
dict_attack_set_header(instance->dict_attack, "MF Classic System Dictionary");
|
||||
}
|
||||
|
||||
instance->nfc_dict_context.dict_keys_total =
|
||||
nfc_dict_get_total_keys(instance->nfc_dict_context.dict);
|
||||
keys_dict_get_total_keys(instance->nfc_dict_context.dict);
|
||||
dict_attack_set_total_dict_keys(
|
||||
instance->dict_attack, instance->nfc_dict_context.dict_keys_total);
|
||||
instance->nfc_dict_context.dict_keys_current = 0;
|
||||
@@ -185,7 +186,7 @@ bool nfc_scene_mf_classic_dict_attack_on_event(void* context, SceneManagerEvent
|
||||
if(state == DictAttackStateUserDictInProgress) {
|
||||
nfc_poller_stop(instance->poller);
|
||||
nfc_poller_free(instance->poller);
|
||||
nfc_dict_free(instance->nfc_dict_context.dict);
|
||||
keys_dict_free(instance->nfc_dict_context.dict);
|
||||
scene_manager_set_scene_state(
|
||||
instance->scene_manager,
|
||||
NfcSceneMfClassicDictAttack,
|
||||
@@ -215,7 +216,7 @@ bool nfc_scene_mf_classic_dict_attack_on_event(void* context, SceneManagerEvent
|
||||
if(instance->nfc_dict_context.is_card_present) {
|
||||
nfc_poller_stop(instance->poller);
|
||||
nfc_poller_free(instance->poller);
|
||||
nfc_dict_free(instance->nfc_dict_context.dict);
|
||||
keys_dict_free(instance->nfc_dict_context.dict);
|
||||
scene_manager_set_scene_state(
|
||||
instance->scene_manager,
|
||||
NfcSceneMfClassicDictAttack,
|
||||
@@ -253,7 +254,7 @@ void nfc_scene_mf_classic_dict_attack_on_exit(void* context) {
|
||||
scene_manager_set_scene_state(
|
||||
instance->scene_manager, NfcSceneMfClassicDictAttack, DictAttackStateUserDictInProgress);
|
||||
|
||||
nfc_dict_free(instance->nfc_dict_context.dict);
|
||||
keys_dict_free(instance->nfc_dict_context.dict);
|
||||
|
||||
instance->nfc_dict_context.current_sector = 0;
|
||||
instance->nfc_dict_context.sectors_total = 0;
|
||||
|
||||
@@ -14,20 +14,20 @@ void nfc_scene_mf_classic_keys_on_enter(void* context) {
|
||||
|
||||
// Load flipper dict keys total
|
||||
uint32_t flipper_dict_keys_total = 0;
|
||||
NfcDict* dict = nfc_dict_alloc(
|
||||
NFC_APP_MF_CLASSIC_DICT_SYSTEM_PATH, NfcDictModeOpenExisting, sizeof(MfClassicKey));
|
||||
KeysDict* dict = keys_dict_alloc(
|
||||
NFC_APP_MF_CLASSIC_DICT_SYSTEM_PATH, KeysDictModeOpenExisting, sizeof(MfClassicKey));
|
||||
if(dict) {
|
||||
flipper_dict_keys_total = nfc_dict_get_total_keys(dict);
|
||||
nfc_dict_free(dict);
|
||||
flipper_dict_keys_total = keys_dict_get_total_keys(dict);
|
||||
keys_dict_free(dict);
|
||||
}
|
||||
|
||||
// Load user dict keys total
|
||||
uint32_t user_dict_keys_total = 0;
|
||||
dict = nfc_dict_alloc(
|
||||
NFC_APP_MF_CLASSIC_DICT_USER_PATH, NfcDictModeOpenAlways, sizeof(MfClassicKey));
|
||||
dict = keys_dict_alloc(
|
||||
NFC_APP_MF_CLASSIC_DICT_USER_PATH, KeysDictModeOpenAlways, sizeof(MfClassicKey));
|
||||
if(dict) {
|
||||
user_dict_keys_total = nfc_dict_get_total_keys(dict);
|
||||
nfc_dict_free(dict);
|
||||
user_dict_keys_total = keys_dict_get_total_keys(dict);
|
||||
keys_dict_free(dict);
|
||||
}
|
||||
|
||||
FuriString* temp_str = furi_string_alloc();
|
||||
|
||||
@@ -29,23 +29,23 @@ bool nfc_scene_mf_classic_keys_add_on_event(void* context, SceneManagerEvent eve
|
||||
if(event.type == SceneManagerEventTypeCustom) {
|
||||
if(event.event == NfcCustomEventByteInputDone) {
|
||||
// Add key to dict
|
||||
NfcDict* dict = nfc_dict_alloc(
|
||||
NFC_APP_MF_CLASSIC_DICT_USER_PATH, NfcDictModeOpenAlways, sizeof(MfClassicKey));
|
||||
KeysDict* dict = keys_dict_alloc(
|
||||
NFC_APP_MF_CLASSIC_DICT_USER_PATH, KeysDictModeOpenAlways, sizeof(MfClassicKey));
|
||||
furi_assert(dict);
|
||||
|
||||
MfClassicKey key = {};
|
||||
memcpy(key.data, instance->byte_input_store, sizeof(MfClassicKey));
|
||||
if(nfc_dict_is_key_present(dict, key.data, sizeof(MfClassicKey))) {
|
||||
if(keys_dict_is_key_present(dict, key.data, sizeof(MfClassicKey))) {
|
||||
scene_manager_next_scene(
|
||||
instance->scene_manager, NfcSceneMfClassicKeysWarnDuplicate);
|
||||
} else if(nfc_dict_add_key(dict, key.data, sizeof(MfClassicKey))) {
|
||||
} else if(keys_dict_add_key(dict, key.data, sizeof(MfClassicKey))) {
|
||||
scene_manager_next_scene(instance->scene_manager, NfcSceneSaveSuccess);
|
||||
dolphin_deed(DolphinDeedNfcMfcAdd);
|
||||
} else {
|
||||
scene_manager_previous_scene(instance->scene_manager);
|
||||
}
|
||||
|
||||
nfc_dict_free(dict);
|
||||
keys_dict_free(dict);
|
||||
consumed = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,6 +27,8 @@ typedef enum {
|
||||
SubmenuIndexGibidi433,
|
||||
SubmenuIndexNiceMHouse_433_92,
|
||||
SubmenuIndexJCM_433_92,
|
||||
SubmenuIndexFAACRCXT_433_92,
|
||||
SubmenuIndexFAACRCXT_868,
|
||||
SubmenuIndexNormstahl_433_92,
|
||||
SubmenuIndexGSN,
|
||||
SubmenuIndexAprimatic,
|
||||
|
||||
@@ -133,6 +133,22 @@ static void subghz_scene_add_to_history_callback(
|
||||
preset.latitude = subghz->gps->latitude;
|
||||
preset.longitude = subghz->gps->longitude;
|
||||
|
||||
if(subghz->last_settings->delete_old_signals) {
|
||||
if(subghz_history_get_last_index(subghz->history) >= 54) {
|
||||
subghz->state_notifications = SubGhzNotificationStateRx;
|
||||
|
||||
subghz_view_receiver_disable_draw_callback(subghz->subghz_receiver);
|
||||
|
||||
subghz_history_delete_item(subghz->history, 0);
|
||||
subghz_view_receiver_delete_item(subghz->subghz_receiver, 0);
|
||||
subghz_view_receiver_enable_draw_callback(subghz->subghz_receiver);
|
||||
|
||||
subghz_scene_receiver_update_statusbar(subghz);
|
||||
subghz->idx_menu_chosen =
|
||||
subghz_view_receiver_get_idx_menu(subghz->subghz_receiver);
|
||||
idx--;
|
||||
}
|
||||
}
|
||||
if(subghz_history_add_to_history(history, decoder_base, &preset)) {
|
||||
furi_string_reset(item_name);
|
||||
furi_string_reset(item_time);
|
||||
@@ -189,7 +205,7 @@ static void subghz_scene_add_to_history_callback(
|
||||
furi_string_free(item_time);
|
||||
subghz_rx_key_state_set(subghz, SubGhzRxKeyStateAddKey);
|
||||
} else {
|
||||
FURI_LOG_I(TAG, "%s protocol ignored", decoder_base->protocol->name);
|
||||
FURI_LOG_D(TAG, "%s protocol ignored", decoder_base->protocol->name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ enum SubGhzSettingIndex {
|
||||
SubGhzSettingIndexIgnoreNiceFlorS,
|
||||
SubGhzSettingIndexIgnoreWeather,
|
||||
SubGhzSettingIndexIgnoreTPMS,
|
||||
SubGhzSettingIndexDeleteOldSignals,
|
||||
SubGhzSettingIndexSound,
|
||||
SubGhzSettingIndexResetToDefault,
|
||||
SubGhzSettingIndexLock,
|
||||
@@ -378,6 +379,15 @@ static void subghz_scene_receiver_config_set_tpms(VariableItem* item) {
|
||||
subghz_scene_receiver_config_set_ignore_filter(item, SubGhzProtocolFilter_TPMS);
|
||||
}
|
||||
|
||||
static void subghz_scene_receiver_config_set_delete_old_signals(VariableItem* item) {
|
||||
SubGhz* subghz = variable_item_get_context(item);
|
||||
uint8_t index = variable_item_get_current_value_index(item);
|
||||
|
||||
variable_item_set_current_value_text(item, combobox_text[index]);
|
||||
|
||||
subghz->last_settings->delete_old_signals = index == 1;
|
||||
}
|
||||
|
||||
static void subghz_scene_receiver_config_var_list_enter_callback(void* context, uint32_t index) {
|
||||
furi_assert(context);
|
||||
SubGhz* subghz = context;
|
||||
@@ -416,6 +426,7 @@ static void subghz_scene_receiver_config_var_list_enter_callback(void* context,
|
||||
subghz->last_settings->filter = subghz->filter;
|
||||
subghz->last_settings->repeater_state = SubGhzRepeaterStateOff;
|
||||
subghz->repeater = SubGhzRepeaterStateOff;
|
||||
subghz->last_settings->delete_old_signals = false;
|
||||
|
||||
subghz_txrx_speaker_set_state(subghz->txrx, speaker_value[default_index]);
|
||||
subghz->last_settings->enable_sound = false;
|
||||
@@ -607,6 +618,17 @@ void subghz_scene_receiver_config_on_enter(void* context) {
|
||||
subghz->ignore_filter, SubGhzProtocolFilter_TPMS);
|
||||
variable_item_set_current_value_index(item, value_index);
|
||||
variable_item_set_current_value_text(item, combobox_text[value_index]);
|
||||
|
||||
item = variable_item_list_add(
|
||||
subghz->variable_item_list,
|
||||
"Delete old signals when memory is full",
|
||||
COMBO_BOX_COUNT,
|
||||
subghz_scene_receiver_config_set_delete_old_signals,
|
||||
subghz);
|
||||
|
||||
value_index = subghz->last_settings->delete_old_signals;
|
||||
variable_item_set_current_value_index(item, value_index);
|
||||
variable_item_set_current_value_text(item, combobox_text[value_index]);
|
||||
}
|
||||
|
||||
// Enable speaker, will send all incoming noises and signals to speaker so you can listen how your remote sounds like :)
|
||||
|
||||
@@ -181,6 +181,18 @@ void subghz_scene_set_type_on_enter(void* context) {
|
||||
SubmenuIndexJCM_433_92,
|
||||
subghz_scene_set_type_submenu_callback,
|
||||
subghz);
|
||||
submenu_add_item(
|
||||
subghz->submenu,
|
||||
"KL: FAAC RC,XT 433MHz",
|
||||
SubmenuIndexFAACRCXT_433_92,
|
||||
subghz_scene_set_type_submenu_callback,
|
||||
subghz);
|
||||
submenu_add_item(
|
||||
subghz->submenu,
|
||||
"KL: FAAC RC,XT 868MHz",
|
||||
SubmenuIndexFAACRCXT_868,
|
||||
subghz_scene_set_type_submenu_callback,
|
||||
subghz);
|
||||
submenu_add_item(
|
||||
subghz->submenu,
|
||||
"KL: Nice Mhouse 433MHz",
|
||||
@@ -744,6 +756,36 @@ bool subghz_scene_set_type_on_event(void* context, SceneManagerEvent event) {
|
||||
scene_manager_next_scene(subghz->scene_manager, SubGhzSceneShowError);
|
||||
}
|
||||
break;
|
||||
case SubmenuIndexFAACRCXT_433_92:
|
||||
generated_protocol = subghz_txrx_gen_keeloq_protocol(
|
||||
subghz->txrx,
|
||||
"AM650",
|
||||
433920000,
|
||||
(key & 0x0000FFFF) | 0x00100000,
|
||||
0x2,
|
||||
0x0003,
|
||||
"FAAC_RC,XT");
|
||||
if(!generated_protocol) {
|
||||
furi_string_set(
|
||||
subghz->error_str, "Function requires\nan SD card with\nfresh databases.");
|
||||
scene_manager_next_scene(subghz->scene_manager, SubGhzSceneShowError);
|
||||
}
|
||||
break;
|
||||
case SubmenuIndexFAACRCXT_868:
|
||||
generated_protocol = subghz_txrx_gen_keeloq_protocol(
|
||||
subghz->txrx,
|
||||
"AM650",
|
||||
868350000,
|
||||
(key & 0x0000FFFF) | 0x00100000,
|
||||
0x2,
|
||||
0x0003,
|
||||
"FAAC_RC,XT");
|
||||
if(!generated_protocol) {
|
||||
furi_string_set(
|
||||
subghz->error_str, "Function requires\nan SD card with\nfresh databases.");
|
||||
scene_manager_next_scene(subghz->scene_manager, SubGhzSceneShowError);
|
||||
}
|
||||
break;
|
||||
case SubmenuIndexNormstahl_433_92:
|
||||
generated_protocol = subghz_txrx_gen_keeloq_protocol(
|
||||
subghz->txrx, "AM650", 433920000, key & 0x00FFFFFF, 0x2, 0x0003, "Normstahl");
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#define SUBGHZ_LAST_SETTING_FIELD_RSSI_THRESHOLD "RSSI"
|
||||
#define SUBGHZ_LAST_SETTING_FIELD_REPEATER "Repeater"
|
||||
#define SUBGHZ_LAST_SETTING_FIELD_ENABLE_SOUND "Sound"
|
||||
#define SUBGHZ_LAST_SETTING_FIELD_DELETE_OLD "DelOldSignals"
|
||||
|
||||
SubGhzLastSettings* subghz_last_settings_alloc(void) {
|
||||
SubGhzLastSettings* instance = malloc(sizeof(SubGhzLastSettings));
|
||||
@@ -51,6 +52,7 @@ void subghz_last_settings_load(SubGhzLastSettings* instance, size_t preset_count
|
||||
bool temp_enable_sound = false;
|
||||
uint32_t temp_repeater_state;
|
||||
bool temp_remove_duplicates = false;
|
||||
bool temp_delete_old_sig = false;
|
||||
uint32_t temp_ignore_filter = 0;
|
||||
uint32_t temp_filter = 0;
|
||||
float temp_rssi = 0;
|
||||
@@ -129,6 +131,8 @@ void subghz_last_settings_load(SubGhzLastSettings* instance, size_t preset_count
|
||||
fff_data_file, SUBGHZ_LAST_SETTING_FIELD_REPEATER, (uint32_t*)&temp_repeater_state, 1);
|
||||
enable_sound_was_read = flipper_format_read_bool(
|
||||
fff_data_file, SUBGHZ_LAST_SETTING_FIELD_ENABLE_SOUND, (bool*)&temp_enable_sound, 1);
|
||||
flipper_format_read_bool(
|
||||
fff_data_file, SUBGHZ_LAST_SETTING_FIELD_DELETE_OLD, (bool*)&temp_delete_old_sig, 1);
|
||||
|
||||
} else {
|
||||
FURI_LOG_E(TAG, "Error open file %s", SUBGHZ_LAST_SETTINGS_PATH);
|
||||
@@ -184,6 +188,8 @@ void subghz_last_settings_load(SubGhzLastSettings* instance, size_t preset_count
|
||||
|
||||
instance->timestamp_file_names = temp_timestamp_file_names;
|
||||
|
||||
instance->delete_old_signals = temp_delete_old_sig;
|
||||
|
||||
// External power amp CC1101
|
||||
instance->external_module_power_amp = temp_external_module_power_amp;
|
||||
|
||||
@@ -322,6 +328,10 @@ bool subghz_last_settings_save(SubGhzLastSettings* instance) {
|
||||
file, SUBGHZ_LAST_SETTING_FIELD_ENABLE_SOUND, &instance->enable_sound, 1)) {
|
||||
break;
|
||||
}
|
||||
if(!flipper_format_insert_or_update_bool(
|
||||
file, SUBGHZ_LAST_SETTING_FIELD_DELETE_OLD, &instance->delete_old_signals, 1)) {
|
||||
break;
|
||||
}
|
||||
saved = true;
|
||||
} while(0);
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@ typedef struct {
|
||||
uint32_t ignore_filter;
|
||||
uint32_t filter;
|
||||
float rssi;
|
||||
bool delete_old_signals;
|
||||
} SubGhzLastSettings;
|
||||
|
||||
SubGhzLastSettings* subghz_last_settings_alloc(void);
|
||||
|
||||
@@ -5,6 +5,41 @@
|
||||
#include <flipper.pb.h>
|
||||
#include <gui.pb.h>
|
||||
|
||||
// Contract assertion
|
||||
_Static_assert(InputKeyMAX == 6, "InputKeyMAX");
|
||||
_Static_assert(InputTypeMAX == 5, "InputTypeMAX");
|
||||
|
||||
_Static_assert(InputKeyUp == (int32_t)PB_Gui_InputKey_UP, "InputKeyUp != PB_Gui_InputKey_UP");
|
||||
_Static_assert(
|
||||
InputKeyDown == (int32_t)PB_Gui_InputKey_DOWN,
|
||||
"InputKeyDown != PB_Gui_InputKey_DOWN");
|
||||
_Static_assert(
|
||||
InputKeyRight == (int32_t)PB_Gui_InputKey_RIGHT,
|
||||
"InputKeyRight != PB_Gui_InputKey_RIGHT");
|
||||
_Static_assert(
|
||||
InputKeyLeft == (int32_t)PB_Gui_InputKey_LEFT,
|
||||
"InputKeyLeft != PB_Gui_InputKey_LEFT");
|
||||
_Static_assert(InputKeyOk == (int32_t)PB_Gui_InputKey_OK, "InputKeyOk != PB_Gui_InputKey_OK");
|
||||
_Static_assert(
|
||||
InputKeyBack == (int32_t)PB_Gui_InputKey_BACK,
|
||||
"InputKeyBack != PB_Gui_InputKey_BACK");
|
||||
|
||||
_Static_assert(
|
||||
InputTypePress == (int32_t)PB_Gui_InputType_PRESS,
|
||||
"InputTypePress != PB_Gui_InputType_PRESS");
|
||||
_Static_assert(
|
||||
InputTypeRelease == (int32_t)PB_Gui_InputType_RELEASE,
|
||||
"InputTypeRelease != PB_Gui_InputType_RELEASE");
|
||||
_Static_assert(
|
||||
InputTypeShort == (int32_t)PB_Gui_InputType_SHORT,
|
||||
"InputTypeShort != PB_Gui_InputType_SHORT");
|
||||
_Static_assert(
|
||||
InputTypeLong == (int32_t)PB_Gui_InputType_LONG,
|
||||
"InputTypeLong != PB_Gui_InputType_LONG");
|
||||
_Static_assert(
|
||||
InputTypeRepeat == (int32_t)PB_Gui_InputType_REPEAT,
|
||||
"InputTypeRepeat != PB_Gui_InputType_REPEAT");
|
||||
|
||||
#define TAG "RpcGui"
|
||||
|
||||
typedef enum {
|
||||
@@ -168,63 +203,20 @@ static void
|
||||
RpcSession* session = rpc_gui->session;
|
||||
furi_assert(session);
|
||||
|
||||
InputEvent event;
|
||||
bool is_valid = (request->content.gui_send_input_event_request.key < (int32_t)InputKeyMAX) &&
|
||||
(request->content.gui_send_input_event_request.type < (int32_t)InputTypeMAX);
|
||||
|
||||
bool invalid = false;
|
||||
|
||||
switch(request->content.gui_send_input_event_request.key) {
|
||||
case PB_Gui_InputKey_UP:
|
||||
event.key = InputKeyUp;
|
||||
break;
|
||||
case PB_Gui_InputKey_DOWN:
|
||||
event.key = InputKeyDown;
|
||||
break;
|
||||
case PB_Gui_InputKey_RIGHT:
|
||||
event.key = InputKeyRight;
|
||||
break;
|
||||
case PB_Gui_InputKey_LEFT:
|
||||
event.key = InputKeyLeft;
|
||||
break;
|
||||
case PB_Gui_InputKey_OK:
|
||||
event.key = InputKeyOk;
|
||||
break;
|
||||
case PB_Gui_InputKey_BACK:
|
||||
event.key = InputKeyBack;
|
||||
break;
|
||||
default:
|
||||
// Invalid key
|
||||
invalid = true;
|
||||
break;
|
||||
}
|
||||
|
||||
switch(request->content.gui_send_input_event_request.type) {
|
||||
case PB_Gui_InputType_PRESS:
|
||||
event.type = InputTypePress;
|
||||
break;
|
||||
case PB_Gui_InputType_RELEASE:
|
||||
event.type = InputTypeRelease;
|
||||
break;
|
||||
case PB_Gui_InputType_SHORT:
|
||||
event.type = InputTypeShort;
|
||||
break;
|
||||
case PB_Gui_InputType_LONG:
|
||||
event.type = InputTypeLong;
|
||||
break;
|
||||
case PB_Gui_InputType_REPEAT:
|
||||
event.type = InputTypeRepeat;
|
||||
break;
|
||||
default:
|
||||
// Invalid type
|
||||
invalid = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if(invalid) {
|
||||
if(!is_valid) {
|
||||
rpc_send_and_release_empty(
|
||||
session, request->command_id, PB_CommandStatus_ERROR_INVALID_PARAMETERS);
|
||||
return;
|
||||
}
|
||||
|
||||
InputEvent event = {
|
||||
.key = (int32_t)request->content.gui_send_input_event_request.key,
|
||||
.type = (int32_t)request->content.gui_send_input_event_request.type,
|
||||
};
|
||||
|
||||
// Event sequence shenanigans
|
||||
event.sequence_source = INPUT_SEQUENCE_SOURCE_SOFTWARE;
|
||||
if(event.type == InputTypePress) {
|
||||
@@ -264,6 +256,29 @@ static void rpc_system_gui_virtual_display_render_callback(Canvas* canvas, void*
|
||||
canvas_draw_xbm(canvas, 0, 0, canvas->width, canvas->height, rpc_gui->virtual_display_buffer);
|
||||
}
|
||||
|
||||
static void rpc_system_gui_virtual_display_input_callback(InputEvent* event, void* context) {
|
||||
furi_assert(event);
|
||||
furi_assert(event->key < InputKeyMAX);
|
||||
furi_assert(event->type < InputTypeMAX);
|
||||
furi_assert(context);
|
||||
|
||||
RpcGuiSystem* rpc_gui = context;
|
||||
RpcSession* session = rpc_gui->session;
|
||||
|
||||
FURI_LOG_D(TAG, "VirtulDisplay: SendInputEvent");
|
||||
|
||||
PB_Main rpc_message = {
|
||||
.command_id = 0,
|
||||
.command_status = PB_CommandStatus_OK,
|
||||
.has_next = false,
|
||||
.which_content = PB_Main_gui_send_input_event_request_tag,
|
||||
.content.gui_send_input_event_request.key = (int32_t)event->key,
|
||||
.content.gui_send_input_event_request.type = (int32_t)event->type,
|
||||
};
|
||||
|
||||
rpc_send_and_release(session, &rpc_message);
|
||||
}
|
||||
|
||||
static void rpc_system_gui_start_virtual_display_process(const PB_Main* request, void* context) {
|
||||
furi_assert(request);
|
||||
furi_assert(context);
|
||||
@@ -300,6 +315,15 @@ static void rpc_system_gui_start_virtual_display_process(const PB_Main* request,
|
||||
rpc_gui->virtual_display_view_port,
|
||||
rpc_system_gui_virtual_display_render_callback,
|
||||
rpc_gui);
|
||||
|
||||
if(request->content.gui_start_virtual_display_request.send_input) {
|
||||
FURI_LOG_D(TAG, "VirtulDisplay: input forwarding requested");
|
||||
view_port_input_callback_set(
|
||||
rpc_gui->virtual_display_view_port,
|
||||
rpc_system_gui_virtual_display_input_callback,
|
||||
rpc_gui);
|
||||
}
|
||||
|
||||
gui_add_view_port(rpc_gui->gui, rpc_gui->virtual_display_view_port, GuiLayerFullscreen);
|
||||
|
||||
rpc_send_and_release_empty(session, request->command_id, PB_CommandStatus_OK);
|
||||
|
||||
Submodule assets/protobuf updated: 23ad19a756...1956b83bba
@@ -48,7 +48,6 @@ env.Append(
|
||||
File("helpers/iso14443_crc.h"),
|
||||
File("helpers/iso13239_crc.h"),
|
||||
File("helpers/nfc_data_generator.h"),
|
||||
File("helpers/nfc_dict.h"),
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
@@ -1,270 +0,0 @@
|
||||
#include "nfc_dict.h"
|
||||
|
||||
#include <storage/storage.h>
|
||||
#include <flipper_format/flipper_format.h>
|
||||
#include <toolbox/stream/file_stream.h>
|
||||
#include <toolbox/stream/buffered_file_stream.h>
|
||||
#include <toolbox/args.h>
|
||||
|
||||
#include <nfc/helpers/nfc_util.h>
|
||||
|
||||
#define TAG "NfcDict"
|
||||
|
||||
struct NfcDict {
|
||||
Stream* stream;
|
||||
size_t key_size;
|
||||
size_t key_size_symbols;
|
||||
uint32_t total_keys;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
const char* path;
|
||||
FS_OpenMode open_mode;
|
||||
} NfcDictFile;
|
||||
|
||||
bool nfc_dict_check_presence(const char* path) {
|
||||
furi_assert(path);
|
||||
|
||||
Storage* storage = furi_record_open(RECORD_STORAGE);
|
||||
|
||||
bool dict_present = storage_common_stat(storage, path, NULL) == FSE_OK;
|
||||
|
||||
furi_record_close(RECORD_STORAGE);
|
||||
|
||||
return dict_present;
|
||||
}
|
||||
|
||||
NfcDict* nfc_dict_alloc(const char* path, NfcDictMode mode, size_t key_size) {
|
||||
furi_assert(path);
|
||||
|
||||
NfcDict* instance = malloc(sizeof(NfcDict));
|
||||
Storage* storage = furi_record_open(RECORD_STORAGE);
|
||||
instance->stream = buffered_file_stream_alloc(storage);
|
||||
furi_record_close(RECORD_STORAGE);
|
||||
|
||||
FS_OpenMode open_mode = FSOM_OPEN_EXISTING;
|
||||
if(mode == NfcDictModeOpenAlways) {
|
||||
open_mode = FSOM_OPEN_ALWAYS;
|
||||
}
|
||||
instance->key_size = key_size;
|
||||
// Byte = 2 symbols + 1 end of line
|
||||
instance->key_size_symbols = key_size * 2 + 1;
|
||||
|
||||
bool dict_loaded = false;
|
||||
do {
|
||||
if(!buffered_file_stream_open(instance->stream, path, FSAM_READ_WRITE, open_mode)) {
|
||||
buffered_file_stream_close(instance->stream);
|
||||
break;
|
||||
}
|
||||
|
||||
// Check for new line ending
|
||||
if(!stream_eof(instance->stream)) {
|
||||
if(!stream_seek(instance->stream, -1, StreamOffsetFromEnd)) break;
|
||||
uint8_t last_char = 0;
|
||||
if(stream_read(instance->stream, &last_char, 1) != 1) break;
|
||||
if(last_char != '\n') {
|
||||
FURI_LOG_D(TAG, "Adding new line ending");
|
||||
if(stream_write_char(instance->stream, '\n') != 1) break;
|
||||
}
|
||||
if(!stream_rewind(instance->stream)) break;
|
||||
}
|
||||
|
||||
// Read total amount of keys
|
||||
FuriString* next_line;
|
||||
next_line = furi_string_alloc();
|
||||
while(true) {
|
||||
if(!stream_read_line(instance->stream, next_line)) {
|
||||
FURI_LOG_T(TAG, "No keys left in dict");
|
||||
break;
|
||||
}
|
||||
FURI_LOG_T(
|
||||
TAG,
|
||||
"Read line: %s, len: %zu",
|
||||
furi_string_get_cstr(next_line),
|
||||
furi_string_size(next_line));
|
||||
if(furi_string_get_char(next_line, 0) == '#') continue;
|
||||
if(furi_string_size(next_line) != instance->key_size_symbols) continue;
|
||||
instance->total_keys++;
|
||||
}
|
||||
furi_string_free(next_line);
|
||||
stream_rewind(instance->stream);
|
||||
|
||||
dict_loaded = true;
|
||||
FURI_LOG_I(TAG, "Loaded dictionary with %lu keys", instance->total_keys);
|
||||
} while(false);
|
||||
|
||||
if(!dict_loaded) {
|
||||
buffered_file_stream_close(instance->stream);
|
||||
free(instance);
|
||||
instance = NULL;
|
||||
}
|
||||
|
||||
return instance;
|
||||
}
|
||||
|
||||
void nfc_dict_free(NfcDict* instance) {
|
||||
furi_assert(instance);
|
||||
furi_assert(instance->stream);
|
||||
|
||||
buffered_file_stream_close(instance->stream);
|
||||
stream_free(instance->stream);
|
||||
free(instance);
|
||||
}
|
||||
|
||||
static void nfc_dict_int_to_str(NfcDict* instance, const uint8_t* key_int, FuriString* key_str) {
|
||||
furi_string_reset(key_str);
|
||||
for(size_t i = 0; i < instance->key_size; i++) {
|
||||
furi_string_cat_printf(key_str, "%02X", key_int[i]);
|
||||
}
|
||||
}
|
||||
|
||||
static void nfc_dict_str_to_int(NfcDict* instance, FuriString* key_str, uint64_t* key_int) {
|
||||
uint8_t key_byte_tmp;
|
||||
|
||||
*key_int = 0ULL;
|
||||
for(uint8_t i = 0; i < instance->key_size * 2; i += 2) {
|
||||
args_char_to_hex(
|
||||
furi_string_get_char(key_str, i), furi_string_get_char(key_str, i + 1), &key_byte_tmp);
|
||||
*key_int |= (uint64_t)key_byte_tmp << (8 * (instance->key_size - 1 - i / 2));
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t nfc_dict_get_total_keys(NfcDict* instance) {
|
||||
furi_assert(instance);
|
||||
|
||||
return instance->total_keys;
|
||||
}
|
||||
|
||||
bool nfc_dict_rewind(NfcDict* instance) {
|
||||
furi_assert(instance);
|
||||
furi_assert(instance->stream);
|
||||
|
||||
return stream_rewind(instance->stream);
|
||||
}
|
||||
|
||||
static bool nfc_dict_get_next_key_str(NfcDict* instance, FuriString* key) {
|
||||
furi_assert(instance);
|
||||
furi_assert(instance->stream);
|
||||
|
||||
bool key_read = false;
|
||||
furi_string_reset(key);
|
||||
while(!key_read) {
|
||||
if(!stream_read_line(instance->stream, key)) break;
|
||||
if(furi_string_get_char(key, 0) == '#') continue;
|
||||
if(furi_string_size(key) != instance->key_size_symbols) continue;
|
||||
furi_string_left(key, instance->key_size_symbols - 1);
|
||||
key_read = true;
|
||||
}
|
||||
|
||||
return key_read;
|
||||
}
|
||||
|
||||
bool nfc_dict_get_next_key(NfcDict* instance, uint8_t* key, size_t key_size) {
|
||||
furi_assert(instance);
|
||||
furi_assert(instance->stream);
|
||||
furi_assert(instance->key_size == key_size);
|
||||
|
||||
FuriString* temp_key = furi_string_alloc();
|
||||
uint64_t key_int = 0;
|
||||
bool key_read = nfc_dict_get_next_key_str(instance, temp_key);
|
||||
if(key_read) {
|
||||
nfc_dict_str_to_int(instance, temp_key, &key_int);
|
||||
nfc_util_num2bytes(key_int, key_size, key);
|
||||
}
|
||||
furi_string_free(temp_key);
|
||||
return key_read;
|
||||
}
|
||||
|
||||
static bool nfc_dict_is_key_present_str(NfcDict* instance, FuriString* key) {
|
||||
furi_assert(instance);
|
||||
furi_assert(instance->stream);
|
||||
|
||||
FuriString* next_line;
|
||||
next_line = furi_string_alloc();
|
||||
|
||||
bool key_found = false;
|
||||
stream_rewind(instance->stream);
|
||||
while(!key_found) { //-V654
|
||||
if(!stream_read_line(instance->stream, next_line)) break;
|
||||
if(furi_string_get_char(next_line, 0) == '#') continue;
|
||||
if(furi_string_size(next_line) != instance->key_size_symbols) continue;
|
||||
furi_string_left(next_line, instance->key_size_symbols - 1);
|
||||
if(!furi_string_equal(key, next_line)) continue;
|
||||
key_found = true;
|
||||
}
|
||||
|
||||
furi_string_free(next_line);
|
||||
return key_found;
|
||||
}
|
||||
|
||||
bool nfc_dict_is_key_present(NfcDict* instance, const uint8_t* key, size_t key_size) {
|
||||
furi_assert(instance);
|
||||
furi_assert(key);
|
||||
furi_assert(instance->stream);
|
||||
furi_assert(instance->key_size == key_size);
|
||||
|
||||
FuriString* temp_key = furi_string_alloc();
|
||||
nfc_dict_int_to_str(instance, key, temp_key);
|
||||
bool key_found = nfc_dict_is_key_present_str(instance, temp_key);
|
||||
furi_string_free(temp_key);
|
||||
|
||||
return key_found;
|
||||
}
|
||||
|
||||
static bool nfc_dict_add_key_str(NfcDict* instance, FuriString* key) {
|
||||
furi_assert(instance);
|
||||
furi_assert(instance->stream);
|
||||
|
||||
furi_string_cat_printf(key, "\n");
|
||||
|
||||
bool key_added = false;
|
||||
do {
|
||||
if(!stream_seek(instance->stream, 0, StreamOffsetFromEnd)) break;
|
||||
if(!stream_insert_string(instance->stream, key)) break;
|
||||
instance->total_keys++;
|
||||
key_added = true;
|
||||
} while(false);
|
||||
|
||||
furi_string_left(key, instance->key_size_symbols - 1);
|
||||
return key_added;
|
||||
}
|
||||
|
||||
bool nfc_dict_add_key(NfcDict* instance, const uint8_t* key, size_t key_size) {
|
||||
furi_assert(instance);
|
||||
furi_assert(key);
|
||||
furi_assert(instance->stream);
|
||||
furi_assert(instance->key_size == key_size);
|
||||
|
||||
FuriString* temp_key = furi_string_alloc();
|
||||
nfc_dict_int_to_str(instance, key, temp_key);
|
||||
bool key_added = nfc_dict_add_key_str(instance, temp_key);
|
||||
furi_string_free(temp_key);
|
||||
|
||||
return key_added;
|
||||
}
|
||||
|
||||
bool nfc_dict_delete_key(NfcDict* instance, const uint8_t* key, size_t key_size) {
|
||||
furi_assert(instance);
|
||||
furi_assert(instance->stream);
|
||||
furi_assert(key);
|
||||
furi_assert(instance->key_size == key_size);
|
||||
|
||||
bool key_removed = false;
|
||||
uint8_t* temp_key = malloc(key_size);
|
||||
|
||||
nfc_dict_rewind(instance);
|
||||
while(!key_removed) {
|
||||
if(!nfc_dict_get_next_key(instance, temp_key, key_size)) break;
|
||||
if(memcmp(temp_key, key, key_size) == 0) {
|
||||
int32_t offset = (-1) * (instance->key_size_symbols);
|
||||
stream_seek(instance->stream, offset, StreamOffsetFromCurrent);
|
||||
if(!stream_delete(instance->stream, instance->key_size_symbols)) break;
|
||||
instance->total_keys--;
|
||||
key_removed = true;
|
||||
}
|
||||
}
|
||||
nfc_dict_rewind(instance);
|
||||
free(temp_key);
|
||||
|
||||
return key_removed;
|
||||
}
|
||||
@@ -1,103 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum {
|
||||
NfcDictModeOpenExisting,
|
||||
NfcDictModeOpenAlways,
|
||||
} NfcDictMode;
|
||||
|
||||
typedef struct NfcDict NfcDict;
|
||||
|
||||
/** Check dictionary presence
|
||||
*
|
||||
* @param path - dictionary path
|
||||
*
|
||||
* @return true if dictionary exists, false otherwise
|
||||
*/
|
||||
bool nfc_dict_check_presence(const char* path);
|
||||
|
||||
/** Open or create dictionary
|
||||
* Depending on mode, dictionary will be opened or created.
|
||||
*
|
||||
* @param path - dictionary path
|
||||
* @param mode - NfcDictMode value
|
||||
* @param key_size - size of dictionary keys in bytes
|
||||
*
|
||||
* @return NfcDict dictionary instance
|
||||
*/
|
||||
NfcDict* nfc_dict_alloc(const char* path, NfcDictMode mode, size_t key_size);
|
||||
|
||||
/** Close dictionary
|
||||
*
|
||||
* @param instance - NfcDict dictionary instance
|
||||
*/
|
||||
void nfc_dict_free(NfcDict* instance);
|
||||
|
||||
/** Get total number of keys in dictionary
|
||||
*
|
||||
* @param instance - NfcDict dictionary instance
|
||||
*
|
||||
* @return total number of keys in dictionary
|
||||
*/
|
||||
uint32_t nfc_dict_get_total_keys(NfcDict* instance);
|
||||
|
||||
/** Rewind dictionary
|
||||
*
|
||||
* @param instance - NfcDict dictionary instance
|
||||
*
|
||||
* @return true if rewind was successful, false otherwise
|
||||
*/
|
||||
bool nfc_dict_rewind(NfcDict* instance);
|
||||
|
||||
/** Check if key is present in dictionary
|
||||
*
|
||||
* @param instance - NfcDict dictionary instance
|
||||
* @param key - key to check
|
||||
* @param key_size - size of key in bytes
|
||||
*
|
||||
* @return true if key is present, false otherwise
|
||||
*/
|
||||
bool nfc_dict_is_key_present(NfcDict* instance, const uint8_t* key, size_t key_size);
|
||||
|
||||
/** Get next key from dictionary
|
||||
* This function will return next key from dictionary. If there are no more
|
||||
* keys, it will return false, and nfc_dict_rewind() should be called.
|
||||
*
|
||||
* @param instance - NfcDict dictionary instance
|
||||
* @param key - buffer to store key
|
||||
* @param key_size - size of key in bytes
|
||||
*
|
||||
* @return true if key was successfully retrieved, false otherwise
|
||||
*/
|
||||
bool nfc_dict_get_next_key(NfcDict* instance, uint8_t* key, size_t key_size);
|
||||
|
||||
/** Add key to dictionary
|
||||
*
|
||||
* @param instance - NfcDict dictionary instance
|
||||
* @param key - key to add
|
||||
* @param key_size - size of key in bytes
|
||||
*
|
||||
* @return true if key was successfully added, false otherwise
|
||||
*/
|
||||
bool nfc_dict_add_key(NfcDict* instance, const uint8_t* key, size_t key_size);
|
||||
|
||||
/** Delete key from dictionary
|
||||
*
|
||||
* @param instance - NfcDict dictionary instance
|
||||
* @param key - key to delete
|
||||
* @param key_size - size of key in bytes
|
||||
*
|
||||
* @return true if key was successfully deleted, false otherwise
|
||||
*/
|
||||
bool nfc_dict_delete_key(NfcDict* instance, const uint8_t* key, size_t key_size);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -150,7 +150,7 @@ static int32_t nfc_worker_listener(void* context) {
|
||||
} else if(command == NfcCommandReset) {
|
||||
furi_hal_nfc_listener_enable_rx();
|
||||
} else if(command == NfcCommandSleep) {
|
||||
furi_hal_nfc_listener_sleep();
|
||||
furi_hal_nfc_listener_idle();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,8 +18,8 @@ typedef struct FelicaPoller FelicaPoller;
|
||||
* @brief Enumeration of possible Felica poller event types.
|
||||
*/
|
||||
typedef enum {
|
||||
FelicaPollerEventTypeError, /**< The card was activated by the poller. */
|
||||
FelicaPollerEventTypeReady, /**< An error occured during activation procedure. */
|
||||
FelicaPollerEventTypeError, /**< An error occured during activation procedure. */
|
||||
FelicaPollerEventTypeReady, /**< The card was activated by the poller. */
|
||||
} FelicaPollerEventType;
|
||||
|
||||
/**
|
||||
|
||||
@@ -18,8 +18,8 @@ typedef struct Iso14443_3aPoller Iso14443_3aPoller;
|
||||
* @brief Enumeration of possible Iso14443_3a poller event types.
|
||||
*/
|
||||
typedef enum {
|
||||
Iso14443_3aPollerEventTypeError, /**< The card was activated by the poller. */
|
||||
Iso14443_3aPollerEventTypeReady, /**< An error occured during activation procedure. */
|
||||
Iso14443_3aPollerEventTypeError, /**< An error occured during activation procedure. */
|
||||
Iso14443_3aPollerEventTypeReady, /**< The card was activated by the poller. */
|
||||
} Iso14443_3aPollerEventType;
|
||||
|
||||
/**
|
||||
|
||||
@@ -18,8 +18,8 @@ typedef struct Iso14443_3bPoller Iso14443_3bPoller;
|
||||
* @brief Enumeration of possible Iso14443_3b poller event types.
|
||||
*/
|
||||
typedef enum {
|
||||
Iso14443_3bPollerEventTypeError, /**< The card was activated by the poller. */
|
||||
Iso14443_3bPollerEventTypeReady, /**< An error occured during activation procedure. */
|
||||
Iso14443_3bPollerEventTypeError, /**< An error occured during activation procedure. */
|
||||
Iso14443_3bPollerEventTypeReady, /**< The card was activated by the poller. */
|
||||
} Iso14443_3bPollerEventType;
|
||||
|
||||
/**
|
||||
|
||||
@@ -17,8 +17,8 @@ typedef struct Iso14443_4aPoller Iso14443_4aPoller;
|
||||
* @brief Enumeration of possible Iso14443_4a poller event types.
|
||||
*/
|
||||
typedef enum {
|
||||
Iso14443_4aPollerEventTypeError, /**< The card was activated by the poller. */
|
||||
Iso14443_4aPollerEventTypeReady, /**< An error occured during activation procedure. */
|
||||
Iso14443_4aPollerEventTypeError, /**< An error occured during activation procedure. */
|
||||
Iso14443_4aPollerEventTypeReady, /**< The card was activated by the poller. */
|
||||
} Iso14443_4aPollerEventType;
|
||||
|
||||
/**
|
||||
|
||||
@@ -17,8 +17,8 @@ typedef struct Iso14443_4bPoller Iso14443_4bPoller;
|
||||
* @brief Enumeration of possible Iso14443_4b poller event types.
|
||||
*/
|
||||
typedef enum {
|
||||
Iso14443_4bPollerEventTypeError, /**< The card was activated by the poller. */
|
||||
Iso14443_4bPollerEventTypeReady, /**< An error occured during activation procedure. */
|
||||
Iso14443_4bPollerEventTypeError, /**< An error occured during activation procedure. */
|
||||
Iso14443_4bPollerEventTypeReady, /**< The card was activated by the poller. */
|
||||
} Iso14443_4bPollerEventType;
|
||||
|
||||
/**
|
||||
|
||||
@@ -17,8 +17,8 @@ typedef struct Iso15693_3Poller Iso15693_3Poller;
|
||||
* @brief Enumeration of possible Iso15693_3 poller event types.
|
||||
*/
|
||||
typedef enum {
|
||||
Iso15693_3PollerEventTypeError, /**< The card was activated by the poller. */
|
||||
Iso15693_3PollerEventTypeReady, /**< An error occured during activation procedure. */
|
||||
Iso15693_3PollerEventTypeError, /**< An error occured during activation procedure. */
|
||||
Iso15693_3PollerEventTypeReady, /**< The card was activated by the poller. */
|
||||
} Iso15693_3PollerEventType;
|
||||
|
||||
/**
|
||||
|
||||
@@ -33,6 +33,7 @@ static void mf_classic_listener_reset_state(MfClassicListener* instance) {
|
||||
instance->state = MfClassicListenerStateIdle;
|
||||
instance->cmd_in_progress = false;
|
||||
instance->current_cmd_handler_idx = 0;
|
||||
instance->write_block = 0;
|
||||
instance->transfer_value = 0;
|
||||
instance->transfer_valid = false;
|
||||
instance->value_cmd = MfClassicValueCommandInvalid;
|
||||
@@ -240,11 +241,13 @@ static MfClassicListenerCommand mf_classic_listener_write_block_first_part_handl
|
||||
|
||||
uint8_t block_num = bit_buffer_get_byte(buff, 1);
|
||||
if(block_num >= instance->total_block_num) break;
|
||||
if(block_num == 0) break;
|
||||
|
||||
uint8_t sector_num = mf_classic_get_sector_by_block(block_num);
|
||||
uint8_t auth_sector_num = mf_classic_get_sector_by_block(auth_ctx->block_num);
|
||||
if(sector_num != auth_sector_num) break;
|
||||
|
||||
instance->write_block = block_num;
|
||||
instance->cmd_in_progress = true;
|
||||
instance->current_cmd_handler_idx++;
|
||||
command = MfClassicListenerCommandAck;
|
||||
@@ -265,7 +268,7 @@ static MfClassicListenerCommand mf_classic_listener_write_block_second_part_hand
|
||||
size_t buff_size = bit_buffer_get_size_bytes(buff);
|
||||
if(buff_size != sizeof(MfClassicBlock)) break;
|
||||
|
||||
uint8_t block_num = auth_ctx->block_num;
|
||||
uint8_t block_num = instance->write_block;
|
||||
MfClassicKeyType key_type = auth_ctx->key_type;
|
||||
MfClassicBlock block = instance->data->block[block_num];
|
||||
|
||||
@@ -609,6 +612,7 @@ NfcCommand mf_classic_listener_run(NfcGenericEvent event, void* context) {
|
||||
|
||||
mf_classic_listener_send_short_frame(instance, nack);
|
||||
mf_classic_listener_reset_state(instance);
|
||||
command = NfcCommandSleep;
|
||||
} else if(mfc_command == MfClassicListenerCommandSilent) {
|
||||
command = NfcCommandReset;
|
||||
} else if(mfc_command == MfClassicListenerCommandSleep) {
|
||||
|
||||
@@ -40,6 +40,9 @@ struct MfClassicListener {
|
||||
Crypto1* crypto;
|
||||
MfClassicAuthContext auth_context;
|
||||
|
||||
// Write block context
|
||||
uint8_t write_block;
|
||||
|
||||
// Value operation data
|
||||
int32_t transfer_value;
|
||||
bool transfer_valid;
|
||||
|
||||
@@ -34,6 +34,7 @@ env.Append(
|
||||
File("hex.h"),
|
||||
File("simple_array.h"),
|
||||
File("bit_buffer.h"),
|
||||
File("keys_dict.h"),
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
334
lib/toolbox/keys_dict.c
Normal file
334
lib/toolbox/keys_dict.c
Normal file
@@ -0,0 +1,334 @@
|
||||
#include "keys_dict.h"
|
||||
|
||||
#include <storage/storage.h>
|
||||
#include <flipper_format/flipper_format.h>
|
||||
#include <toolbox/stream/file_stream.h>
|
||||
#include <toolbox/stream/buffered_file_stream.h>
|
||||
#include <toolbox/args.h>
|
||||
|
||||
#define TAG "KeysDict"
|
||||
|
||||
struct KeysDict {
|
||||
Stream* stream;
|
||||
size_t key_size;
|
||||
size_t key_size_symbols;
|
||||
size_t total_keys;
|
||||
};
|
||||
|
||||
static inline void keys_dict_add_ending_new_line(KeysDict* instance) {
|
||||
if(stream_seek(instance->stream, -1, StreamOffsetFromEnd)) {
|
||||
uint8_t last_char = 0;
|
||||
|
||||
// Check if the last char is new line or add a new line
|
||||
if(stream_read(instance->stream, &last_char, 1) == 1 && last_char != '\n') {
|
||||
FURI_LOG_D(TAG, "Adding new line ending");
|
||||
stream_write_char(instance->stream, '\n');
|
||||
}
|
||||
|
||||
stream_rewind(instance->stream);
|
||||
}
|
||||
}
|
||||
|
||||
static bool keys_dict_read_key_line(KeysDict* instance, FuriString* line, bool* is_endfile) {
|
||||
if(stream_read_line(instance->stream, line) == false) {
|
||||
*is_endfile = true;
|
||||
}
|
||||
|
||||
else {
|
||||
FURI_LOG_T(
|
||||
TAG, "Read line: %s, len: %zu", furi_string_get_cstr(line), furi_string_size(line));
|
||||
|
||||
bool is_comment = furi_string_get_char(line, 0) == '#';
|
||||
|
||||
if(!is_comment) {
|
||||
furi_string_left(line, instance->key_size_symbols - 1);
|
||||
}
|
||||
|
||||
bool is_correct_size = furi_string_size(line) == instance->key_size_symbols - 1;
|
||||
|
||||
return !is_comment && is_correct_size;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool keys_dict_check_presence(const char* path) {
|
||||
furi_assert(path);
|
||||
|
||||
Storage* storage = furi_record_open(RECORD_STORAGE);
|
||||
|
||||
bool dict_present = storage_common_stat(storage, path, NULL) == FSE_OK;
|
||||
|
||||
furi_record_close(RECORD_STORAGE);
|
||||
|
||||
return dict_present;
|
||||
}
|
||||
|
||||
KeysDict* keys_dict_alloc(const char* path, KeysDictMode mode, size_t key_size) {
|
||||
furi_assert(path);
|
||||
furi_assert(key_size > 0);
|
||||
|
||||
KeysDict* instance = malloc(sizeof(KeysDict));
|
||||
|
||||
Storage* storage = furi_record_open(RECORD_STORAGE);
|
||||
furi_assert(storage);
|
||||
|
||||
instance->stream = buffered_file_stream_alloc(storage);
|
||||
furi_assert(instance->stream);
|
||||
|
||||
FS_OpenMode open_mode = (mode == KeysDictModeOpenAlways) ? FSOM_OPEN_ALWAYS :
|
||||
FSOM_OPEN_EXISTING;
|
||||
|
||||
// Byte = 2 symbols + 1 end of line
|
||||
instance->key_size = key_size;
|
||||
instance->key_size_symbols = key_size * 2 + 1;
|
||||
|
||||
instance->total_keys = 0;
|
||||
|
||||
bool file_exists =
|
||||
buffered_file_stream_open(instance->stream, path, FSAM_READ_WRITE, open_mode);
|
||||
|
||||
if(!file_exists) {
|
||||
buffered_file_stream_close(instance->stream);
|
||||
} else {
|
||||
// Eventually add new line character in the last line to avoid skipping keys
|
||||
keys_dict_add_ending_new_line(instance);
|
||||
}
|
||||
|
||||
FuriString* line = furi_string_alloc();
|
||||
|
||||
bool is_endfile = false;
|
||||
|
||||
// In this loop we only count the entries in the file
|
||||
// We prefer not to load the whole file in memory for space reasons
|
||||
while(file_exists && !is_endfile) {
|
||||
bool read_key = keys_dict_read_key_line(instance, line, &is_endfile);
|
||||
if(read_key) {
|
||||
instance->total_keys++;
|
||||
}
|
||||
}
|
||||
stream_rewind(instance->stream);
|
||||
FURI_LOG_I(TAG, "Loaded dictionary with %zu keys", instance->total_keys);
|
||||
|
||||
furi_string_free(line);
|
||||
|
||||
return instance;
|
||||
}
|
||||
|
||||
void keys_dict_free(KeysDict* instance) {
|
||||
furi_assert(instance);
|
||||
furi_assert(instance->stream);
|
||||
|
||||
buffered_file_stream_close(instance->stream);
|
||||
stream_free(instance->stream);
|
||||
free(instance);
|
||||
|
||||
furi_record_close(RECORD_STORAGE);
|
||||
}
|
||||
|
||||
static void keys_dict_int_to_str(KeysDict* instance, const uint8_t* key_int, FuriString* key_str) {
|
||||
furi_assert(instance);
|
||||
furi_assert(key_str);
|
||||
furi_assert(key_int);
|
||||
|
||||
furi_string_reset(key_str);
|
||||
|
||||
for(size_t i = 0; i < instance->key_size; i++)
|
||||
furi_string_cat_printf(key_str, "%02X", key_int[i]);
|
||||
}
|
||||
|
||||
static void keys_dict_str_to_int(KeysDict* instance, FuriString* key_str, uint64_t* key_int) {
|
||||
furi_assert(instance);
|
||||
furi_assert(key_str);
|
||||
furi_assert(key_int);
|
||||
|
||||
uint8_t key_byte_tmp;
|
||||
char h, l;
|
||||
|
||||
*key_int = 0ULL;
|
||||
|
||||
for(size_t i = 0; i < instance->key_size_symbols - 1; i += 2) {
|
||||
h = furi_string_get_char(key_str, i);
|
||||
l = furi_string_get_char(key_str, i + 1);
|
||||
|
||||
args_char_to_hex(h, l, &key_byte_tmp);
|
||||
*key_int |= (uint64_t)key_byte_tmp << (8 * (instance->key_size - 1 - i / 2));
|
||||
}
|
||||
}
|
||||
|
||||
size_t keys_dict_get_total_keys(KeysDict* instance) {
|
||||
furi_assert(instance);
|
||||
|
||||
return instance->total_keys;
|
||||
}
|
||||
|
||||
bool keys_dict_rewind(KeysDict* instance) {
|
||||
furi_assert(instance);
|
||||
furi_assert(instance->stream);
|
||||
|
||||
return stream_rewind(instance->stream);
|
||||
}
|
||||
|
||||
static bool keys_dict_get_next_key_str(KeysDict* instance, FuriString* key) {
|
||||
furi_assert(instance);
|
||||
furi_assert(instance->stream);
|
||||
furi_assert(key);
|
||||
|
||||
bool key_read = false;
|
||||
bool is_endfile = false;
|
||||
|
||||
furi_string_reset(key);
|
||||
|
||||
while(!key_read && !is_endfile) key_read = keys_dict_read_key_line(instance, key, &is_endfile);
|
||||
|
||||
return key_read;
|
||||
}
|
||||
|
||||
bool keys_dict_get_next_key(KeysDict* instance, uint8_t* key, size_t key_size) {
|
||||
furi_assert(instance);
|
||||
furi_assert(instance->stream);
|
||||
furi_assert(instance->key_size == key_size);
|
||||
furi_assert(key);
|
||||
|
||||
FuriString* temp_key = furi_string_alloc();
|
||||
|
||||
bool key_read = keys_dict_get_next_key_str(instance, temp_key);
|
||||
|
||||
if(key_read) {
|
||||
size_t tmp_len = key_size;
|
||||
uint64_t key_int = 0;
|
||||
|
||||
keys_dict_str_to_int(instance, temp_key, &key_int);
|
||||
|
||||
while(tmp_len--) {
|
||||
key[tmp_len] = (uint8_t)key_int;
|
||||
key_int >>= 8;
|
||||
}
|
||||
}
|
||||
|
||||
furi_string_free(temp_key);
|
||||
return key_read;
|
||||
}
|
||||
|
||||
static bool keys_dict_is_key_present_str(KeysDict* instance, FuriString* key) {
|
||||
furi_assert(instance);
|
||||
furi_assert(instance->stream);
|
||||
furi_assert(key);
|
||||
|
||||
FuriString* line = furi_string_alloc();
|
||||
|
||||
bool is_endfile = false;
|
||||
bool line_found = false;
|
||||
|
||||
uint32_t actual_pos = stream_tell(instance->stream);
|
||||
stream_rewind(instance->stream);
|
||||
|
||||
while(!line_found && !is_endfile)
|
||||
line_found = // The line is found if the line was read and the key is equal to the line
|
||||
(keys_dict_read_key_line(instance, line, &is_endfile)) &&
|
||||
(furi_string_equal(key, line));
|
||||
|
||||
furi_string_free(line);
|
||||
|
||||
// Restore the position of the stream
|
||||
stream_seek(instance->stream, actual_pos, StreamOffsetFromStart);
|
||||
|
||||
return line_found;
|
||||
}
|
||||
|
||||
bool keys_dict_is_key_present(KeysDict* instance, const uint8_t* key, size_t key_size) {
|
||||
furi_assert(instance);
|
||||
furi_assert(instance->stream);
|
||||
furi_assert(instance->key_size == key_size);
|
||||
furi_assert(key);
|
||||
|
||||
FuriString* temp_key = furi_string_alloc();
|
||||
|
||||
keys_dict_int_to_str(instance, key, temp_key);
|
||||
bool key_found = keys_dict_is_key_present_str(instance, temp_key);
|
||||
furi_string_free(temp_key);
|
||||
|
||||
return key_found;
|
||||
}
|
||||
|
||||
static bool keys_dict_add_key_str(KeysDict* instance, FuriString* key) {
|
||||
furi_assert(instance);
|
||||
furi_assert(instance->stream);
|
||||
furi_assert(key);
|
||||
|
||||
furi_string_cat_str(key, "\n");
|
||||
|
||||
bool key_added = false;
|
||||
|
||||
uint32_t actual_pos = stream_tell(instance->stream);
|
||||
|
||||
if(stream_seek(instance->stream, 0, StreamOffsetFromEnd) &&
|
||||
stream_insert_string(instance->stream, key)) {
|
||||
instance->total_keys++;
|
||||
key_added = true;
|
||||
}
|
||||
|
||||
stream_seek(instance->stream, actual_pos, StreamOffsetFromStart);
|
||||
|
||||
return key_added;
|
||||
}
|
||||
|
||||
bool keys_dict_add_key(KeysDict* instance, const uint8_t* key, size_t key_size) {
|
||||
furi_assert(instance);
|
||||
furi_assert(instance->stream);
|
||||
furi_assert(instance->key_size == key_size);
|
||||
furi_assert(key);
|
||||
|
||||
FuriString* temp_key = furi_string_alloc();
|
||||
furi_assert(temp_key);
|
||||
|
||||
keys_dict_int_to_str(instance, key, temp_key);
|
||||
bool key_added = keys_dict_add_key_str(instance, temp_key);
|
||||
|
||||
FURI_LOG_I(TAG, "Added key %s", furi_string_get_cstr(temp_key));
|
||||
|
||||
furi_string_free(temp_key);
|
||||
|
||||
return key_added;
|
||||
}
|
||||
|
||||
bool keys_dict_delete_key(KeysDict* instance, const uint8_t* key, size_t key_size) {
|
||||
furi_assert(instance);
|
||||
furi_assert(instance->stream);
|
||||
furi_assert(instance->key_size == key_size);
|
||||
furi_assert(key);
|
||||
|
||||
bool key_removed = false;
|
||||
|
||||
uint8_t* temp_key = malloc(key_size);
|
||||
|
||||
stream_rewind(instance->stream);
|
||||
|
||||
while(!key_removed) {
|
||||
if(!keys_dict_get_next_key(instance, temp_key, key_size)) {
|
||||
break;
|
||||
}
|
||||
|
||||
if(memcmp(temp_key, key, key_size) == 0) {
|
||||
stream_seek(instance->stream, -instance->key_size_symbols, StreamOffsetFromCurrent);
|
||||
if(stream_delete(instance->stream, instance->key_size_symbols) == false) {
|
||||
break;
|
||||
}
|
||||
instance->total_keys--;
|
||||
key_removed = true;
|
||||
}
|
||||
}
|
||||
|
||||
FuriString* tmp = furi_string_alloc();
|
||||
|
||||
keys_dict_int_to_str(instance, key, tmp);
|
||||
|
||||
FURI_LOG_I(TAG, "Removed key %s", furi_string_get_cstr(tmp));
|
||||
|
||||
furi_string_free(tmp);
|
||||
|
||||
stream_rewind(instance->stream);
|
||||
free(temp_key);
|
||||
|
||||
return key_removed;
|
||||
}
|
||||
103
lib/toolbox/keys_dict.h
Normal file
103
lib/toolbox/keys_dict.h
Normal file
@@ -0,0 +1,103 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum {
|
||||
KeysDictModeOpenExisting,
|
||||
KeysDictModeOpenAlways,
|
||||
} KeysDictMode;
|
||||
|
||||
typedef struct KeysDict KeysDict;
|
||||
|
||||
/** Check if the file list exists
|
||||
*
|
||||
* @param path - list path
|
||||
*
|
||||
* @return true if list exists, false otherwise
|
||||
*/
|
||||
bool keys_dict_check_presence(const char* path);
|
||||
|
||||
/** Open or create list
|
||||
* Depending on mode, list will be opened or created.
|
||||
*
|
||||
* @param path - Path of the file that contain the list
|
||||
* @param mode - ListKeysMode value
|
||||
* @param key_size - Size of each key in bytes
|
||||
*
|
||||
* @return Returns KeysDict list instance
|
||||
*/
|
||||
KeysDict* keys_dict_alloc(const char* path, KeysDictMode mode, size_t key_size);
|
||||
|
||||
/** Close list
|
||||
*
|
||||
* @param instance - KeysDict list instance
|
||||
*/
|
||||
void keys_dict_free(KeysDict* instance);
|
||||
|
||||
/** Get total number of keys in list
|
||||
*
|
||||
* @param instance - KeysDict list instance
|
||||
*
|
||||
* @return Returns total number of keys in list
|
||||
*/
|
||||
size_t keys_dict_get_total_keys(KeysDict* instance);
|
||||
|
||||
/** Rewind list
|
||||
*
|
||||
* @param instance - KeysDict list instance
|
||||
*
|
||||
* @return Returns true if rewind was successful, false otherwise
|
||||
*/
|
||||
bool keys_dict_rewind(KeysDict* instance);
|
||||
|
||||
/** Check if key is present in list
|
||||
*
|
||||
* @param instance - KeysDict list instance
|
||||
* @param key - key to check
|
||||
* @param key_size - Size of the key in bytes
|
||||
*
|
||||
* @return Returns true if key is present, false otherwise
|
||||
*/
|
||||
bool keys_dict_is_key_present(KeysDict* instance, const uint8_t* key, size_t key_size);
|
||||
|
||||
/** Get next key from the list
|
||||
* This function will return next key from list. If there are no more
|
||||
* keys, it will return false, and keys_dict_rewind() should be called.
|
||||
*
|
||||
* @param instance - KeysDict list instance
|
||||
* @param key - Array where to store key
|
||||
* @param key_size - Size of key in bytes
|
||||
*
|
||||
* @return Returns true if key was successfully retrieved, false otherwise
|
||||
*/
|
||||
bool keys_dict_get_next_key(KeysDict* instance, uint8_t* key, size_t key_size);
|
||||
|
||||
/** Add key to list
|
||||
*
|
||||
* @param instance - KeysDict list instance
|
||||
* @param key - Key to add
|
||||
* @param key_size - Size of the key in bytes
|
||||
*
|
||||
* @return Returns true if key was successfully added, false otherwise
|
||||
*/
|
||||
bool keys_dict_add_key(KeysDict* instance, const uint8_t* key, size_t key_size);
|
||||
|
||||
/** Delete key from list
|
||||
*
|
||||
* @param instance - KeysDict list instance
|
||||
* @param key - Key to delete
|
||||
* @param key_size - Size of the key in bytes
|
||||
*
|
||||
* @return Returns true if key was successfully deleted, false otherwise
|
||||
*/
|
||||
bool keys_dict_delete_key(KeysDict* instance, const uint8_t* key, size_t key_size);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -11,6 +11,27 @@ WINPATHSEP_RE = re.compile(r"\\([^\"'\\]|$)")
|
||||
# Excludes all files ending with ~, usually created by editors as backup files
|
||||
GLOB_FILE_EXCLUSION = ["*~"]
|
||||
|
||||
# List of environment variables to proxy to child processes
|
||||
FORWARDED_ENV_VARIABLES = [
|
||||
# CI/CD variables
|
||||
"WORKFLOW_BRANCH_OR_TAG",
|
||||
"DIST_SUFFIX",
|
||||
# Python & other tools
|
||||
"HOME",
|
||||
"APPDATA",
|
||||
"PYTHONHOME",
|
||||
"PYTHONNOUSERSITE",
|
||||
"TMP",
|
||||
"TEMP",
|
||||
# ccache
|
||||
"CCACHE_DISABLE",
|
||||
# Colors for tools
|
||||
"TERM",
|
||||
# Toolchain
|
||||
"FBT_TOOLCHAIN_PATH",
|
||||
"UFBT_HOME",
|
||||
]
|
||||
|
||||
|
||||
def tempfile_arg_esc_func(arg):
|
||||
arg = quote_spaces(arg)
|
||||
|
||||
@@ -74,7 +74,7 @@ class Main(App):
|
||||
self.parser_list.set_defaults(func=self.list)
|
||||
|
||||
self.parser_stress = self.subparsers.add_parser("stress", help="Stress test")
|
||||
self.parser.add_argument(
|
||||
self.parser_stress.add_argument(
|
||||
"-c", "--count", type=int, default=10, help="Iteration count"
|
||||
)
|
||||
self.parser_stress.add_argument("flipper_path", help="Flipper path")
|
||||
|
||||
@@ -25,33 +25,10 @@ forward_os_env = {
|
||||
"PATH": os.environ["PATH"],
|
||||
}
|
||||
|
||||
# Proxying environment to child processes & scripts
|
||||
variables_to_forward = [
|
||||
# CI/CD variables
|
||||
"WORKFLOW_BRANCH_OR_TAG",
|
||||
"DIST_SUFFIX",
|
||||
# Python & other tools
|
||||
"HOME",
|
||||
"APPDATA",
|
||||
"PYTHONHOME",
|
||||
"PYTHONNOUSERSITE",
|
||||
"TMP",
|
||||
"TEMP",
|
||||
# Colors for tools
|
||||
"TERM",
|
||||
]
|
||||
|
||||
if proxy_env := GetOption("proxy_env"):
|
||||
variables_to_forward.extend(proxy_env.split(","))
|
||||
|
||||
for env_value_name in variables_to_forward:
|
||||
if environ_value := os.environ.get(env_value_name, None):
|
||||
forward_os_env[env_value_name] = environ_value
|
||||
|
||||
# Core environment init - loads SDK state, sets up paths, etc.
|
||||
core_env = Environment(
|
||||
variables=ufbt_variables,
|
||||
ENV=forward_os_env,
|
||||
UFBT_STATE_DIR=ufbt_state_dir,
|
||||
UFBT_CURRENT_SDK_DIR=ufbt_current_sdk_dir,
|
||||
UFBT_SCRIPT_DIR=ufbt_script_dir,
|
||||
@@ -69,6 +46,7 @@ core_env.Append(CPPDEFINES=GetOption("extra_defines"))
|
||||
from fbt.appmanifest import FlipperApplication, FlipperAppType
|
||||
from fbt.sdk.cache import SdkCache
|
||||
from fbt.util import (
|
||||
FORWARDED_ENV_VARIABLES,
|
||||
path_as_posix,
|
||||
resolve_real_dir_node,
|
||||
single_quote,
|
||||
@@ -76,8 +54,19 @@ from fbt.util import (
|
||||
wrap_tempfile,
|
||||
)
|
||||
|
||||
variables_to_forward = list(FORWARDED_ENV_VARIABLES)
|
||||
|
||||
if proxy_env := GetOption("proxy_env"):
|
||||
variables_to_forward.extend(proxy_env.split(","))
|
||||
|
||||
for env_value_name in variables_to_forward:
|
||||
if environ_value := os.environ.get(env_value_name, None):
|
||||
forward_os_env[env_value_name] = environ_value
|
||||
|
||||
|
||||
# Base environment with all tools loaded from SDK
|
||||
env = core_env.Clone(
|
||||
ENV=forward_os_env,
|
||||
toolpath=[core_env["FBT_SCRIPT_DIR"].Dir("fbt_tools")],
|
||||
tools=[
|
||||
"fbt_tweaks",
|
||||
@@ -477,9 +466,12 @@ else:
|
||||
|
||||
dist_env.PhonyTarget("dolphin_ext", Action(missing_dolphin_folder, None))
|
||||
|
||||
# print(env.Dump())
|
||||
dist_env.PhonyTarget(
|
||||
"env",
|
||||
"@echo $( ${FBT_SCRIPT_DIR.abspath}/toolchain/fbtenv.sh $)",
|
||||
'@echo "FBT_TOOLCHAIN_PATH='
|
||||
+ forward_os_env["FBT_TOOLCHAIN_PATH"]
|
||||
+ '" source $( "${FBT_SCRIPT_DIR.abspath}/toolchain/fbtenv.sh" $)',
|
||||
)
|
||||
|
||||
dist_env.PostConfigureUfbtEnvionment()
|
||||
|
||||
4
scripts/ufbt/project_template/.gitignore
vendored
4
scripts/ufbt/project_template/.gitignore
vendored
@@ -1,4 +1,6 @@
|
||||
dist/*
|
||||
.vscode
|
||||
.clang-format
|
||||
.editorconfig
|
||||
.editorconfig
|
||||
.env
|
||||
.ufbt
|
||||
|
||||
@@ -44,7 +44,11 @@ How to create a new application:
|
||||
4. Run `ufbt launch` to build and upload your application.
|
||||
|
||||
How to open a shell with toolchain environment and other build tools:
|
||||
In your shell, type "source `ufbt -s env`". You can also use "." instead of "source".
|
||||
In your shell, type "eval `ufbt -s env`".
|
||||
|
||||
How to update uFBT SDK:
|
||||
Run "ufbt update" to fetch latest SDK.
|
||||
You can also specify branch, target and/or channel options. See "ufbt update -h" for details.
|
||||
"""
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import json
|
||||
import os
|
||||
import pathlib
|
||||
import sys
|
||||
from functools import reduce
|
||||
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
from SCons.Platform import TempFileMunge
|
||||
from fbt.util import (
|
||||
tempfile_arg_esc_func,
|
||||
single_quote,
|
||||
wrap_tempfile,
|
||||
resolve_real_dir_node,
|
||||
)
|
||||
|
||||
import os
|
||||
import multiprocessing
|
||||
import os
|
||||
|
||||
from fbt.util import (
|
||||
FORWARDED_ENV_VARIABLES,
|
||||
resolve_real_dir_node,
|
||||
single_quote,
|
||||
tempfile_arg_esc_func,
|
||||
wrap_tempfile,
|
||||
)
|
||||
from SCons.Platform import TempFileMunge
|
||||
|
||||
Import("VAR_ENV")
|
||||
|
||||
@@ -15,23 +16,9 @@ forward_os_env = {
|
||||
# Import PATH from OS env - scons doesn't do that by default
|
||||
"PATH": os.environ["PATH"],
|
||||
}
|
||||
# Proxying CI environment to child processes & scripts
|
||||
variables_to_forward = [
|
||||
# CI/CD variables
|
||||
"WORKFLOW_BRANCH_OR_TAG",
|
||||
"DIST_SUFFIX",
|
||||
# Python & other tools
|
||||
"HOME",
|
||||
"APPDATA",
|
||||
"PYTHONHOME",
|
||||
"PYTHONNOUSERSITE",
|
||||
"TMP",
|
||||
"TEMP",
|
||||
# ccache
|
||||
"CCACHE_DISABLE",
|
||||
# Colors for tools
|
||||
"TERM",
|
||||
]
|
||||
|
||||
variables_to_forward = list(FORWARDED_ENV_VARIABLES)
|
||||
|
||||
if proxy_env := GetOption("proxy_env"):
|
||||
variables_to_forward.extend(proxy_env.split(","))
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
entry,status,name,type,params
|
||||
Version,+,49.3,,
|
||||
Version,+,50.1,,
|
||||
Header,+,applications/services/bt/bt_service/bt.h,,
|
||||
Header,+,applications/services/cli/cli.h,,
|
||||
Header,+,applications/services/cli/cli_vcp.h,,
|
||||
@@ -139,6 +139,7 @@ Header,+,lib/toolbox/crc32_calc.h,,
|
||||
Header,+,lib/toolbox/dir_walk.h,,
|
||||
Header,+,lib/toolbox/float_tools.h,,
|
||||
Header,+,lib/toolbox/hex.h,,
|
||||
Header,+,lib/toolbox/keys_dict.h,,
|
||||
Header,+,lib/toolbox/manchester_decoder.h,,
|
||||
Header,+,lib/toolbox/manchester_encoder.h,,
|
||||
Header,+,lib/toolbox/name_generator.h,,
|
||||
@@ -1329,7 +1330,9 @@ Function,+,furi_hal_version_get_mic_id,const char*,
|
||||
Function,+,furi_hal_version_get_model_code,const char*,
|
||||
Function,+,furi_hal_version_get_model_name,const char*,
|
||||
Function,+,furi_hal_version_get_name_ptr,const char*,
|
||||
Function,+,furi_hal_version_get_ncc_id,const char*,
|
||||
Function,+,furi_hal_version_get_otp_version,FuriHalVersionOtpVersion,
|
||||
Function,+,furi_hal_version_get_srrc_id,const char*,
|
||||
Function,-,furi_hal_version_init,void,
|
||||
Function,+,furi_hal_version_uid,const uint8_t*,
|
||||
Function,+,furi_hal_version_uid_size,size_t,
|
||||
@@ -1592,6 +1595,15 @@ Function,-,j1f,float,float
|
||||
Function,-,jn,double,"int, double"
|
||||
Function,-,jnf,float,"int, float"
|
||||
Function,-,jrand48,long,unsigned short[3]
|
||||
Function,+,keys_dict_add_key,_Bool,"KeysDict*, const uint8_t*, size_t"
|
||||
Function,+,keys_dict_alloc,KeysDict*,"const char*, KeysDictMode, size_t"
|
||||
Function,+,keys_dict_check_presence,_Bool,const char*
|
||||
Function,+,keys_dict_delete_key,_Bool,"KeysDict*, const uint8_t*, size_t"
|
||||
Function,+,keys_dict_free,void,KeysDict*
|
||||
Function,+,keys_dict_get_next_key,_Bool,"KeysDict*, uint8_t*, size_t"
|
||||
Function,+,keys_dict_get_total_keys,size_t,KeysDict*
|
||||
Function,+,keys_dict_is_key_present,_Bool,"KeysDict*, const uint8_t*, size_t"
|
||||
Function,+,keys_dict_rewind,_Bool,KeysDict*
|
||||
Function,-,l64a,char*,long
|
||||
Function,-,labs,long,long
|
||||
Function,-,lcong48,void,unsigned short[7]
|
||||
|
||||
|
@@ -23,3 +23,11 @@ const char* furi_hal_version_get_ic_id() {
|
||||
const char* furi_hal_version_get_mic_id() {
|
||||
return "Pending";
|
||||
}
|
||||
|
||||
const char* furi_hal_version_get_srrc_id() {
|
||||
return "Pending";
|
||||
}
|
||||
|
||||
const char* furi_hal_version_get_ncc_id() {
|
||||
return "Pending";
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
entry,status,name,type,params
|
||||
Version,+,49.3,,
|
||||
Version,+,50.1,,
|
||||
Header,+,applications/drivers/subghz/cc1101_ext/cc1101_ext_interconnect.h,,
|
||||
Header,+,applications/main/archive/helpers/archive_helpers_ext.h,,
|
||||
Header,+,applications/services/applications.h,,
|
||||
@@ -119,7 +119,6 @@ Header,+,lib/nanopb/pb_encode.h,,
|
||||
Header,+,lib/nfc/helpers/iso13239_crc.h,,
|
||||
Header,+,lib/nfc/helpers/iso14443_crc.h,,
|
||||
Header,+,lib/nfc/helpers/nfc_data_generator.h,,
|
||||
Header,+,lib/nfc/helpers/nfc_dict.h,,
|
||||
Header,+,lib/nfc/helpers/nfc_util.h,,
|
||||
Header,+,lib/nfc/nfc.h,,
|
||||
Header,+,lib/nfc/nfc_device.h,,
|
||||
@@ -211,6 +210,7 @@ Header,+,lib/toolbox/crc32_calc.h,,
|
||||
Header,+,lib/toolbox/dir_walk.h,,
|
||||
Header,+,lib/toolbox/float_tools.h,,
|
||||
Header,+,lib/toolbox/hex.h,,
|
||||
Header,+,lib/toolbox/keys_dict.h,,
|
||||
Header,+,lib/toolbox/manchester_decoder.h,,
|
||||
Header,+,lib/toolbox/manchester_encoder.h,,
|
||||
Header,+,lib/toolbox/name_generator.h,,
|
||||
@@ -1602,7 +1602,9 @@ Function,+,furi_hal_version_get_mic_id,const char*,
|
||||
Function,+,furi_hal_version_get_model_code,const char*,
|
||||
Function,+,furi_hal_version_get_model_name,const char*,
|
||||
Function,+,furi_hal_version_get_name_ptr,const char*,
|
||||
Function,+,furi_hal_version_get_ncc_id,const char*,
|
||||
Function,+,furi_hal_version_get_otp_version,FuriHalVersionOtpVersion,
|
||||
Function,+,furi_hal_version_get_srrc_id,const char*,
|
||||
Function,-,furi_hal_version_init,void,
|
||||
Function,-,furi_hal_version_set_name,void,const char*
|
||||
Function,+,furi_hal_version_uid,const uint8_t*,
|
||||
@@ -2050,6 +2052,15 @@ Function,-,j1f,float,float
|
||||
Function,-,jn,double,"int, double"
|
||||
Function,-,jnf,float,"int, float"
|
||||
Function,-,jrand48,long,unsigned short[3]
|
||||
Function,+,keys_dict_add_key,_Bool,"KeysDict*, const uint8_t*, size_t"
|
||||
Function,+,keys_dict_alloc,KeysDict*,"const char*, KeysDictMode, size_t"
|
||||
Function,+,keys_dict_check_presence,_Bool,const char*
|
||||
Function,+,keys_dict_delete_key,_Bool,"KeysDict*, const uint8_t*, size_t"
|
||||
Function,+,keys_dict_free,void,KeysDict*
|
||||
Function,+,keys_dict_get_next_key,_Bool,"KeysDict*, uint8_t*, size_t"
|
||||
Function,+,keys_dict_get_total_keys,size_t,KeysDict*
|
||||
Function,+,keys_dict_is_key_present,_Bool,"KeysDict*, const uint8_t*, size_t"
|
||||
Function,+,keys_dict_rewind,_Bool,KeysDict*
|
||||
Function,-,l64a,char*,long
|
||||
Function,-,labs,long,long
|
||||
Function,-,lcong48,void,unsigned short[7]
|
||||
@@ -2527,15 +2538,6 @@ Function,+,nfc_device_save,_Bool,"NfcDevice*, const char*"
|
||||
Function,+,nfc_device_set_data,void,"NfcDevice*, NfcProtocol, const NfcDeviceData*"
|
||||
Function,+,nfc_device_set_loading_callback,void,"NfcDevice*, NfcLoadingCallback, void*"
|
||||
Function,+,nfc_device_set_uid,_Bool,"NfcDevice*, const uint8_t*, size_t"
|
||||
Function,+,nfc_dict_add_key,_Bool,"NfcDict*, const uint8_t*, size_t"
|
||||
Function,+,nfc_dict_alloc,NfcDict*,"const char*, NfcDictMode, size_t"
|
||||
Function,+,nfc_dict_check_presence,_Bool,const char*
|
||||
Function,+,nfc_dict_delete_key,_Bool,"NfcDict*, const uint8_t*, size_t"
|
||||
Function,+,nfc_dict_free,void,NfcDict*
|
||||
Function,+,nfc_dict_get_next_key,_Bool,"NfcDict*, uint8_t*, size_t"
|
||||
Function,+,nfc_dict_get_total_keys,uint32_t,NfcDict*
|
||||
Function,+,nfc_dict_is_key_present,_Bool,"NfcDict*, const uint8_t*, size_t"
|
||||
Function,+,nfc_dict_rewind,_Bool,NfcDict*
|
||||
Function,+,nfc_felica_listener_set_sensf_res_data,NfcError,"Nfc*, const uint8_t*, const uint8_t, const uint8_t*, const uint8_t"
|
||||
Function,+,nfc_free,void,Nfc*
|
||||
Function,+,nfc_iso14443a_listener_set_col_res_data,NfcError,"Nfc*, uint8_t*, uint8_t, uint8_t*, uint8_t"
|
||||
|
||||
|
@@ -23,3 +23,11 @@ const char* furi_hal_version_get_ic_id() {
|
||||
const char* furi_hal_version_get_mic_id() {
|
||||
return "210-175991";
|
||||
}
|
||||
|
||||
const char* furi_hal_version_get_srrc_id() {
|
||||
return "2023DJ16420";
|
||||
}
|
||||
|
||||
const char* furi_hal_version_get_ncc_id() {
|
||||
return "CCAJ23LP34D0T3";
|
||||
}
|
||||
@@ -93,6 +93,18 @@ const char* furi_hal_version_get_ic_id();
|
||||
*/
|
||||
const char* furi_hal_version_get_mic_id();
|
||||
|
||||
/** Get SRRC id
|
||||
*
|
||||
* @return SRRC id as C-string
|
||||
*/
|
||||
const char* furi_hal_version_get_srrc_id();
|
||||
|
||||
/** Get NCC id
|
||||
*
|
||||
* @return NCC id as C-string
|
||||
*/
|
||||
const char* furi_hal_version_get_ncc_id();
|
||||
|
||||
/** Get OTP version
|
||||
*
|
||||
* @return OTP Version
|
||||
|
||||
Reference in New Issue
Block a user