2021-11-26 16:53:51 +03:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "bad_usb_app.h"
|
|
|
|
#include "scenes/bad_usb_scene.h"
|
2023-03-20 20:22:03 +03:00
|
|
|
#include "helpers/ducky_script.h"
|
2021-11-26 16:53:51 +03:00
|
|
|
|
|
|
|
#include <gui/gui.h>
|
2022-10-28 17:08:50 +03:00
|
|
|
#include <assets_icons.h>
|
2021-11-26 16:53:51 +03:00
|
|
|
#include <gui/view_dispatcher.h>
|
|
|
|
#include <gui/scene_manager.h>
|
|
|
|
#include <gui/modules/submenu.h>
|
|
|
|
#include <dialogs/dialogs.h>
|
2022-01-05 19:10:18 +03:00
|
|
|
#include <notification/notification_messages.h>
|
|
|
|
#include <gui/modules/variable_item_list.h>
|
2022-02-02 17:27:33 +03:00
|
|
|
#include <gui/modules/widget.h>
|
2021-11-26 16:53:51 +03:00
|
|
|
#include "views/bad_usb_view.h"
|
2023-02-13 18:43:29 +03:00
|
|
|
#include <furi_hal_usb.h>
|
2021-11-26 16:53:51 +03:00
|
|
|
|
2023-02-08 18:01:00 +03:00
|
|
|
#define BAD_USB_APP_BASE_FOLDER ANY_PATH("badusb")
|
|
|
|
#define BAD_USB_APP_PATH_LAYOUT_FOLDER BAD_USB_APP_BASE_FOLDER "/assets/layouts"
|
|
|
|
#define BAD_USB_APP_SCRIPT_EXTENSION ".txt"
|
|
|
|
#define BAD_USB_APP_LAYOUT_EXTENSION ".kl"
|
2021-11-26 16:53:51 +03:00
|
|
|
|
2022-03-24 18:45:03 +03:00
|
|
|
typedef enum {
|
|
|
|
BadUsbAppErrorNoFiles,
|
|
|
|
BadUsbAppErrorCloseRpc,
|
|
|
|
} BadUsbAppError;
|
|
|
|
|
2021-11-26 16:53:51 +03:00
|
|
|
struct BadUsbApp {
|
|
|
|
Gui* gui;
|
|
|
|
ViewDispatcher* view_dispatcher;
|
|
|
|
SceneManager* scene_manager;
|
|
|
|
NotificationApp* notifications;
|
|
|
|
DialogsApp* dialogs;
|
2022-02-02 17:27:33 +03:00
|
|
|
Widget* widget;
|
2023-02-08 18:01:00 +03:00
|
|
|
Submenu* submenu;
|
2021-11-26 16:53:51 +03:00
|
|
|
|
2022-03-24 18:45:03 +03:00
|
|
|
BadUsbAppError error;
|
2022-10-05 18:15:23 +03:00
|
|
|
FuriString* file_path;
|
2023-02-08 18:01:00 +03:00
|
|
|
FuriString* keyboard_layout;
|
2021-11-26 16:53:51 +03:00
|
|
|
BadUsb* bad_usb_view;
|
|
|
|
BadUsbScript* bad_usb_script;
|
2023-02-13 18:43:29 +03:00
|
|
|
|
|
|
|
FuriHalUsbInterface* usb_if_prev;
|
2021-11-26 16:53:51 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
typedef enum {
|
2022-02-02 17:27:33 +03:00
|
|
|
BadUsbAppViewError,
|
2021-11-26 16:53:51 +03:00
|
|
|
BadUsbAppViewWork,
|
2023-02-08 18:01:00 +03:00
|
|
|
BadUsbAppViewConfig,
|
|
|
|
} BadUsbAppView;
|