fix badusb

This commit is contained in:
MX 2022-08-04 22:30:44 +03:00
parent 2731b3bf57
commit ac1a53dbf8
No known key found for this signature in database
GPG Key ID: 6C4C311DFD4B4AB5
2 changed files with 3 additions and 5 deletions

View File

@ -104,7 +104,7 @@ BadUsbApp* bad_usb_app_alloc(char* arg) {
if(!string_empty_p(app->file_path)) {
scene_manager_next_scene(app->scene_manager, BadUsbSceneWork);
} else {
string_set_str(app->file_path, BAD_USB_APP_PATH_SCRIPT_FOLDER);
string_set_str(app->file_path, BAD_USB_APP_BASE_FOLDER);
scene_manager_next_scene(app->scene_manager, BadUsbSceneFileSelect);
}
}
@ -115,14 +115,14 @@ BadUsbApp* bad_usb_app_alloc(char* arg) {
void bad_usb_app_free(BadUsbApp* app) {
furi_assert(app);
if(app->bad_usb_script) {
if(app->bad_usb_script != NULL) {
bad_usb_script_close(app->bad_usb_script);
app->bad_usb_script = NULL;
}
// Views
view_dispatcher_remove_view(app->view_dispatcher, BadUsbAppViewWork);
view_dispatcher_remove_view(app->view_dispatcher, BadUsbAppViewConfigLayout);
bad_usb_free(app->bad_usb_view);
// Custom Widget

View File

@ -15,7 +15,6 @@
#include "views/bad_usb_view.h"
#define BAD_USB_APP_BASE_FOLDER ANY_PATH("badusb")
#define BAD_USB_APP_PATH_SCRIPT_FOLDER BAD_USB_APP_BASE_FOLDER
#define BAD_USB_APP_PATH_LAYOUT_FOLDER BAD_USB_APP_BASE_FOLDER "/layouts"
#define BAD_USB_APP_SCRIPT_EXTENSION ".txt"
#define BAD_USB_APP_LAYOUT_EXTENSION ".kl"
@ -45,5 +44,4 @@ typedef enum {
BadUsbAppViewError,
BadUsbAppViewWork,
BadUsbAppViewConfig,
BadUsbAppViewConfigLayout,
} BadUsbAppView;