mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-21 05:04:46 -07:00
Move most Bad BLE code to Bad USB
This commit is contained in:
@@ -8,11 +8,12 @@
|
||||
#include <assets_icons.h>
|
||||
#include <gui/view_dispatcher.h>
|
||||
#include <gui/scene_manager.h>
|
||||
#include <gui/modules/submenu.h>
|
||||
#include <dialogs/dialogs.h>
|
||||
#include <notification/notification_messages.h>
|
||||
#include <gui/modules/variable_item_list.h>
|
||||
#include <gui/modules/widget.h>
|
||||
#include <gui/modules/text_input.h>
|
||||
#include <gui/modules/byte_input.h>
|
||||
#include "views/bad_usb_view.h"
|
||||
|
||||
#define BAD_USB_APP_BASE_FOLDER ANY_PATH("badusb")
|
||||
@@ -20,11 +21,20 @@
|
||||
#define BAD_USB_APP_SCRIPT_EXTENSION ".txt"
|
||||
#define BAD_USB_APP_LAYOUT_EXTENSION ".kl"
|
||||
|
||||
#define BAD_USB_MAC_ADDRESS_LEN 6 // need replace with MAC size maccro
|
||||
#define BAD_USB_ADV_NAME_MAX_LEN 18
|
||||
|
||||
typedef enum {
|
||||
BadUsbAppErrorNoFiles,
|
||||
BadUsbAppErrorCloseRpc,
|
||||
} BadUsbAppError;
|
||||
|
||||
typedef enum BadUsbCustomEvent {
|
||||
BadUsbAppCustomEventTextEditResult,
|
||||
BadUsbAppCustomEventByteInputDone,
|
||||
BadUsbCustomEventErrorBack
|
||||
} BadUsbCustomEvent;
|
||||
|
||||
struct BadUsbApp {
|
||||
Gui* gui;
|
||||
ViewDispatcher* view_dispatcher;
|
||||
@@ -32,17 +42,29 @@ struct BadUsbApp {
|
||||
NotificationApp* notifications;
|
||||
DialogsApp* dialogs;
|
||||
Widget* widget;
|
||||
Submenu* submenu;
|
||||
VariableItemList* var_item_list_bt;
|
||||
VariableItemList* var_item_list_usb;
|
||||
|
||||
Bt* bt;
|
||||
TextInput* text_input;
|
||||
ByteInput* byte_input;
|
||||
uint8_t mac[BAD_USB_MAC_ADDRESS_LEN];
|
||||
char name[BAD_USB_ADV_NAME_MAX_LEN + 1];
|
||||
|
||||
BadUsbAppError error;
|
||||
FuriString* file_path;
|
||||
FuriString* keyboard_layout;
|
||||
BadUsb* bad_usb_view;
|
||||
BadUsbScript* bad_usb_script;
|
||||
|
||||
bool is_bluetooth;
|
||||
};
|
||||
|
||||
typedef enum {
|
||||
BadUsbAppViewError,
|
||||
BadUsbAppViewWork,
|
||||
BadUsbAppViewConfig,
|
||||
} BadUsbAppView;
|
||||
BadUsbAppViewConfigBt,
|
||||
BadUsbAppViewConfigUsb,
|
||||
BadUsbAppViewConfigMac,
|
||||
BadUsbAppViewConfigName
|
||||
} BadUsbAppView;
|
||||
|
||||
Reference in New Issue
Block a user