multi_fuzzer 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. commit 3b2cf0b6641d360c65e4c9ac38c0c574c3cf91fb
  2. Author: MX <10697207+xMasterX@users.noreply.github.com>
  3. Date: Mon Sep 4 19:41:36 2023 +0300
  4. Naming fixes
  5. thanks Willy-JL
  6. diff --git a/fuzzer.c b/fuzzer.c
  7. index 18fd97aad..96f74c20a 100644
  8. --- a/fuzzer.c
  9. +++ b/fuzzer.c
  10. @@ -140,6 +140,7 @@ int32_t fuzzer_start_ibtn(void* p) {
  11. .key_extension = ".ibtn",
  12. .path_key_folder = "/ext/ibutton",
  13. .key_icon = &I_ibutt_10px,
  14. + .file_prefix = "iBtn",
  15. };
  16. fuzzer_app->fuzzer_const = &app_const;
  17. @@ -159,6 +160,7 @@ int32_t fuzzer_start_rfid(void* p) {
  18. .key_extension = ".rfid",
  19. .path_key_folder = "/ext/lfrfid",
  20. .key_icon = &I_125_10px,
  21. + .file_prefix = "RFID",
  22. };
  23. fuzzer_app->fuzzer_const = &app_const;
  24. diff --git a/fuzzer_i.h b/fuzzer_i.h
  25. index 1edc6b7e7..ad10dd8a2 100644
  26. --- a/fuzzer_i.h
  27. +++ b/fuzzer_i.h
  28. @@ -32,6 +32,7 @@ typedef struct {
  29. const char* key_extension;
  30. const char* path_key_folder;
  31. const Icon* key_icon;
  32. + const char* file_prefix;
  33. } FuzzerConsts;
  34. typedef struct {
  35. diff --git a/scenes/fuzzer_scene_save_name.c b/scenes/fuzzer_scene_save_name.c
  36. index 983bf0a58..c622f59b3 100644
  37. --- a/scenes/fuzzer_scene_save_name.c
  38. +++ b/scenes/fuzzer_scene_save_name.c
  39. @@ -1,6 +1,6 @@
  40. #include "../fuzzer_i.h"
  41. -#include <toolbox/random_name.h>
  42. +#include <toolbox/name_generator.h>
  43. #include <toolbox/path.h>
  44. static void fuzzer_scene_save_name_text_input_callback(void* context) {
  45. @@ -12,7 +12,7 @@ void fuzzer_scene_save_name_on_enter(void* context) {
  46. PacsFuzzerApp* app = context;
  47. TextInput* text_input = app->text_input;
  48. - set_random_name(app->key_name, KEY_NAME_SIZE);
  49. + name_generator_make_auto(app->key_name, KEY_NAME_SIZE, app->fuzzer_const->file_prefix);
  50. text_input_set_header_text(text_input, "Name the key");
  51. text_input_set_result_callback(
  52. @@ -21,7 +21,7 @@ void fuzzer_scene_save_name_on_enter(void* context) {
  53. app,
  54. app->key_name,
  55. KEY_NAME_SIZE,
  56. - false);
  57. + true);
  58. ValidatorIsFile* validator_is_file = validator_is_file_alloc_init(
  59. app->fuzzer_const->path_key_folder, app->fuzzer_const->key_extension, app->key_name);