Просмотр исходного кода

Updating companion app, some extra missing changes

Erwin Ried 2 лет назад
Родитель
Сommit
14d94d1d02
2 измененных файлов с 17 добавлено и 1 удалено
  1. 1 1
      application.fam
  2. 16 0
      scenes/wifi_marauder_scene_console_output.c

+ 1 - 1
application.fam

@@ -10,5 +10,5 @@ App(
     fap_icon="wifi_10px.png",
     fap_category="GPIO",
     fap_icon_assets="assets",
-    fap_description="ESP32-CAM version of Marauder. Includes all functionality from the original plus some options to trigger the camera and flashlight. [Unplug the USB cable to test with Mayhem]"
+    fap_description="ESP32-CAM version of Marauder. Includes all functionality from the original plus some options to trigger the camera and flashlight. [Unplug the USB cable to test with Mayhem]",
 )

+ 16 - 0
scenes/wifi_marauder_scene_console_output.c

@@ -144,11 +144,27 @@ void wifi_marauder_scene_console_output_on_enter(void* context) {
             }
         }
 
+        bool send_html = false;
+        uint8_t* the_html = NULL;
+        size_t html_size = 0;
+        if(app->selected_tx_string && strncmp(
+                                          "evilportal -c sethtmlstr",
+                                          app->selected_tx_string,
+                                          strlen("evilportal -c sethtmlstr")) == 0) {
+            send_html = wifi_marauder_ep_read_html_file(app, &the_html, &html_size);
+        }
+
         // Send command with newline '\n'
         if(app->selected_tx_string) {
             wifi_marauder_uart_tx(
                 (uint8_t*)(app->selected_tx_string), strlen(app->selected_tx_string));
             wifi_marauder_uart_tx((uint8_t*)("\n"), 1);
+            if(send_html && the_html) {
+                wifi_marauder_uart_tx(the_html, html_size);
+                wifi_marauder_uart_tx((uint8_t*)("\n"), 1);
+                free(the_html);
+                send_html = false;
+            }
         }
 
         // Run the script if the file with the script has been opened