mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-13 23:18:35 -07:00
Fix nfc and fuzzer dynamic naming
This commit is contained in:
@@ -25,7 +25,7 @@
|
|||||||
#include <assets_icons.h>
|
#include <assets_icons.h>
|
||||||
|
|
||||||
#define FUZZ_TIME_DELAY_MAX (80)
|
#define FUZZ_TIME_DELAY_MAX (80)
|
||||||
#define KEY_NAME_SIZE 22
|
#define KEY_NAME_SIZE 24
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
const char* custom_dict_extension;
|
const char* custom_dict_extension;
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ void nfc_scene_save_name_on_enter(void* context) {
|
|||||||
furi_string_replace_all(prefix, " ", "_");
|
furi_string_replace_all(prefix, " ", "_");
|
||||||
furi_string_left(prefix, 12);
|
furi_string_left(prefix, 12);
|
||||||
name_generator_make_auto(
|
name_generator_make_auto(
|
||||||
nfc->text_store, NFC_DEV_NAME_MAX_LEN, furi_string_get_cstr(prefix));
|
nfc->text_store, sizeof(nfc->text_store), furi_string_get_cstr(prefix));
|
||||||
furi_string_free(prefix);
|
furi_string_free(prefix);
|
||||||
dev_name_empty = true;
|
dev_name_empty = true;
|
||||||
} else {
|
} else {
|
||||||
@@ -37,7 +37,7 @@ void nfc_scene_save_name_on_enter(void* context) {
|
|||||||
nfc_scene_save_name_text_input_callback,
|
nfc_scene_save_name_text_input_callback,
|
||||||
nfc,
|
nfc,
|
||||||
nfc->text_store,
|
nfc->text_store,
|
||||||
NFC_DEV_NAME_MAX_LEN,
|
sizeof(nfc->text_store),
|
||||||
dev_name_empty);
|
dev_name_empty);
|
||||||
|
|
||||||
FuriString* folder_path;
|
FuriString* folder_path;
|
||||||
@@ -71,7 +71,7 @@ bool nfc_scene_save_name_on_event(void* context, SceneManagerEvent event) {
|
|||||||
(!scene_manager_has_previous_scene(nfc->scene_manager, NfcSceneSetTypeMfUid))) {
|
(!scene_manager_has_previous_scene(nfc->scene_manager, NfcSceneSetTypeMfUid))) {
|
||||||
nfc->dev->dev_data.nfc_data = nfc->dev_edit_data;
|
nfc->dev->dev_data.nfc_data = nfc->dev_edit_data;
|
||||||
}
|
}
|
||||||
strlcpy(nfc->dev->dev_name, nfc->text_store, strlen(nfc->text_store) + 1);
|
strlcpy(nfc->dev->dev_name, nfc->text_store, sizeof(nfc->dev->dev_name));
|
||||||
if(nfc_save_file(nfc)) {
|
if(nfc_save_file(nfc)) {
|
||||||
scene_manager_next_scene(nfc->scene_manager, NfcSceneSaveSuccess);
|
scene_manager_next_scene(nfc->scene_manager, NfcSceneSaveSuccess);
|
||||||
if(!scene_manager_has_previous_scene(nfc->scene_manager, NfcSceneSavedMenu)) {
|
if(!scene_manager_has_previous_scene(nfc->scene_manager, NfcSceneSavedMenu)) {
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define NFC_DEV_NAME_MAX_LEN 31
|
#define NFC_DEV_NAME_MAX_LEN 22
|
||||||
#define NFC_READER_DATA_MAX_SIZE 64
|
#define NFC_READER_DATA_MAX_SIZE 64
|
||||||
#define NFC_DICT_KEY_BATCH_SIZE 10
|
#define NFC_DICT_KEY_BATCH_SIZE 10
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user