Kaynağa Gözat

Separate pcaps and logs into their own folders

0xchocolate 3 yıl önce
ebeveyn
işleme
54a229bae0

+ 2 - 2
applications/external/wifi_marauder_companion/scenes/wifi_marauder_scene_settings_init.c

@@ -34,7 +34,7 @@ void wifi_marauder_scene_settings_init_setup_widget(WifiMarauderApp* app) {
             12,
             128,
             38,
-            "With compatible marauder\nfirmware, you can choose to\nsave captures (pcaps) to the\nflipper sd card here:\n/" MARAUDER_APP_FOLDER_USER
+            "With compatible marauder\nfirmware, you can choose to\nsave captures (pcaps) to the\nflipper sd card here:\n" MARAUDER_APP_FOLDER_USER_PCAPS
             "\n\nYou can change this setting in the app at any time. Would\nyou like to enable this feature now?");
     } else {
         widget_add_string_element(widget, 0, 0, AlignLeft, AlignTop, FontPrimary, "Save logs?");
@@ -44,7 +44,7 @@ void wifi_marauder_scene_settings_init_setup_widget(WifiMarauderApp* app) {
             12,
             128,
             38,
-            "This app supports saving text\nlogs of console output to the\nflipper sd card here:\n/" MARAUDER_APP_FOLDER_USER
+            "This app supports saving text\nlogs of console output to the\nflipper sd card here:\n" MARAUDER_APP_FOLDER_USER_LOGS
             "\n\nYou can change this setting in the app at any time. Would\nyou like to enable this feature now?");
     }
 }

+ 8 - 0
applications/external/wifi_marauder_companion/wifi_marauder_app.c

@@ -88,6 +88,14 @@ void wifi_marauder_make_app_folder(WifiMarauderApp* app) {
     if(!storage_simply_mkdir(app->storage, MARAUDER_APP_FOLDER)) {
         dialog_message_show_storage_error(app->dialogs, "Cannot create\napp folder");
     }
+
+    if(!storage_simply_mkdir(app->storage, MARAUDER_APP_FOLDER_PCAPS)) {
+        dialog_message_show_storage_error(app->dialogs, "Cannot create\npcaps folder");
+    }
+
+    if(!storage_simply_mkdir(app->storage, MARAUDER_APP_FOLDER_LOGS)) {
+        dialog_message_show_storage_error(app->dialogs, "Cannot create\npcaps folder");
+    }
 }
 
 void wifi_marauder_load_settings(WifiMarauderApp* app) {

+ 4 - 0
applications/external/wifi_marauder_companion/wifi_marauder_app_i.h

@@ -26,6 +26,10 @@
 
 #define MARAUDER_APP_FOLDER_USER "apps_data/marauder"
 #define MARAUDER_APP_FOLDER ANY_PATH(MARAUDER_APP_FOLDER_USER)
+#define MARAUDER_APP_FOLDER_PCAPS MARAUDER_APP_FOLDER "/pcaps"
+#define MARAUDER_APP_FOLDER_LOGS MARAUDER_APP_FOLDER "/logs"
+#define MARAUDER_APP_FOLDER_USER_PCAPS MARAUDER_APP_FOLDER_USER "/pcaps"
+#define MARAUDER_APP_FOLDER_USER_LOGS MARAUDER_APP_FOLDER_USER "/logs"
 #define SAVE_PCAP_SETTING_FILEPATH MARAUDER_APP_FOLDER "/save_pcaps_here.setting"
 #define SAVE_LOGS_SETTING_FILEPATH MARAUDER_APP_FOLDER "/save_logs_here.setting"
 

+ 7 - 2
applications/external/wifi_marauder_companion/wifi_marauder_pcap.c

@@ -28,7 +28,7 @@ void wifi_marauder_create_pcap_file(WifiMarauderApp* app) {
             capture_file_path,
             sizeof(capture_file_path),
             "%s/%s_%d.pcap",
-            MARAUDER_APP_FOLDER,
+            MARAUDER_APP_FOLDER_PCAPS,
             prefix,
             i);
         i++;
@@ -47,7 +47,12 @@ void wifi_marauder_create_log_file(WifiMarauderApp* app) {
     int i = 0;
     do {
         snprintf(
-            log_file_path, sizeof(log_file_path), "%s/%s_%d.log", MARAUDER_APP_FOLDER, prefix, i);
+            log_file_path,
+            sizeof(log_file_path),
+            "%s/%s_%d.log",
+            MARAUDER_APP_FOLDER_LOGS,
+            prefix,
+            i);
         i++;
     } while(storage_file_exists(app->storage, log_file_path));