mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-07-27 01:58:09 -07:00
Rename bad usb to bad kb
This commit is contained in:
@@ -16,7 +16,7 @@ static const char* app_dirsDolphinBackup[] = {
|
||||
"nfc",
|
||||
"infrared",
|
||||
"ibutton",
|
||||
"badusb",
|
||||
"badkb",
|
||||
".bt.settings",
|
||||
".desktop.settings",
|
||||
".dolphin.state",
|
||||
|
||||
|
Before Width: | Height: | Size: 576 B After Width: | Height: | Size: 576 B |
|
Before Width: | Height: | Size: 576 B After Width: | Height: | Size: 576 B |
@@ -112,7 +112,7 @@ static bool open_ducky_script(Stream* stream, PluginState* plugin_state) {
|
||||
|
||||
DialogsFileBrowserOptions browser_options;
|
||||
dialog_file_browser_set_basic_options(
|
||||
&browser_options, MOUSEJACKER_APP_PATH_EXTENSION, &I_badusb_10px);
|
||||
&browser_options, MOUSEJACKER_APP_PATH_EXTENSION, &I_badkb_10px);
|
||||
browser_options.hide_ext = false;
|
||||
|
||||
bool ret = dialog_file_browser_show(dialogs, path, path, &browser_options);
|
||||
@@ -396,4 +396,4 @@ int32_t mousejacker_app(void* p) {
|
||||
free(plugin_state);
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -132,7 +132,7 @@ static TotpConfigFileOpenResult totp_open_config_file(Storage* storage, FlipperF
|
||||
flipper_format_write_comment_cstr(fff_data_file, " ");
|
||||
flipper_format_write_comment_cstr(
|
||||
fff_data_file,
|
||||
"How to notify user when new token is generated or badusb mode is activated (possible values: 0 - do not notify, 1 - sound, 2 - vibro, 3 sound and vibro)");
|
||||
"How to notify user when new token is generated or badkb mode is activated (possible values: 0 - do not notify, 1 - sound, 2 - vibro, 3 sound and vibro)");
|
||||
flipper_format_write_uint32(
|
||||
fff_data_file, TOTP_CONFIG_KEY_NOTIFICATION_METHOD, &tmp_uint32, 1);
|
||||
|
||||
@@ -769,4 +769,4 @@ void totp_config_file_reset() {
|
||||
Storage* storage = totp_open_storage();
|
||||
storage_simply_remove(storage, CONFIG_FILE_PATH);
|
||||
totp_close_storage();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ typedef struct {
|
||||
uint32_t last_token_gen_time;
|
||||
TotpTypeCodeWorkerContext* type_code_worker_context;
|
||||
NotificationMessage const** notification_sequence_new_token;
|
||||
NotificationMessage const** notification_sequence_badusb;
|
||||
NotificationMessage const** notification_sequence_badkb;
|
||||
} SceneState;
|
||||
|
||||
static const NotificationSequence*
|
||||
@@ -69,8 +69,8 @@ static const NotificationSequence*
|
||||
}
|
||||
|
||||
static const NotificationSequence*
|
||||
get_notification_sequence_badusb(const PluginState* plugin_state, SceneState* scene_state) {
|
||||
if(scene_state->notification_sequence_badusb == NULL) {
|
||||
get_notification_sequence_badkb(const PluginState* plugin_state, SceneState* scene_state) {
|
||||
if(scene_state->notification_sequence_badkb == NULL) {
|
||||
uint8_t i = 0;
|
||||
uint8_t length = 3;
|
||||
if(plugin_state->notification_method & NotificationMethodVibro) {
|
||||
@@ -81,36 +81,36 @@ static const NotificationSequence*
|
||||
length += 6;
|
||||
}
|
||||
|
||||
scene_state->notification_sequence_badusb = malloc(sizeof(void*) * length);
|
||||
furi_check(scene_state->notification_sequence_badusb != NULL);
|
||||
scene_state->notification_sequence_badkb = malloc(sizeof(void*) * length);
|
||||
furi_check(scene_state->notification_sequence_badkb != NULL);
|
||||
|
||||
scene_state->notification_sequence_badusb[i++] = &message_blue_255;
|
||||
scene_state->notification_sequence_badkb[i++] = &message_blue_255;
|
||||
if(plugin_state->notification_method & NotificationMethodVibro) {
|
||||
scene_state->notification_sequence_badusb[i++] = &message_vibro_on;
|
||||
scene_state->notification_sequence_badkb[i++] = &message_vibro_on;
|
||||
}
|
||||
|
||||
if(plugin_state->notification_method & NotificationMethodSound) {
|
||||
scene_state->notification_sequence_badusb[i++] = &message_note_d5; //-V525
|
||||
scene_state->notification_sequence_badusb[i++] = &message_delay_50;
|
||||
scene_state->notification_sequence_badusb[i++] = &message_note_e4;
|
||||
scene_state->notification_sequence_badusb[i++] = &message_delay_50;
|
||||
scene_state->notification_sequence_badusb[i++] = &message_note_f3;
|
||||
scene_state->notification_sequence_badkb[i++] = &message_note_d5; //-V525
|
||||
scene_state->notification_sequence_badkb[i++] = &message_delay_50;
|
||||
scene_state->notification_sequence_badkb[i++] = &message_note_e4;
|
||||
scene_state->notification_sequence_badkb[i++] = &message_delay_50;
|
||||
scene_state->notification_sequence_badkb[i++] = &message_note_f3;
|
||||
}
|
||||
|
||||
scene_state->notification_sequence_badusb[i++] = &message_delay_50;
|
||||
scene_state->notification_sequence_badkb[i++] = &message_delay_50;
|
||||
|
||||
if(plugin_state->notification_method & NotificationMethodVibro) {
|
||||
scene_state->notification_sequence_badusb[i++] = &message_vibro_off;
|
||||
scene_state->notification_sequence_badkb[i++] = &message_vibro_off;
|
||||
}
|
||||
|
||||
if(plugin_state->notification_method & NotificationMethodSound) {
|
||||
scene_state->notification_sequence_badusb[i++] = &message_sound_off;
|
||||
scene_state->notification_sequence_badkb[i++] = &message_sound_off;
|
||||
}
|
||||
|
||||
scene_state->notification_sequence_badusb[i++] = NULL;
|
||||
scene_state->notification_sequence_badkb[i++] = NULL;
|
||||
}
|
||||
|
||||
return (NotificationSequence*)scene_state->notification_sequence_badusb;
|
||||
return (NotificationSequence*)scene_state->notification_sequence_badkb;
|
||||
}
|
||||
|
||||
static void int_token_to_str(uint32_t i_token_code, char* str, TokenDigitsCount len) {
|
||||
@@ -340,7 +340,7 @@ bool totp_scene_generate_token_handle_event(
|
||||
scene_state->type_code_worker_context, TotpTypeCodeWorkerEventType);
|
||||
notification_message(
|
||||
plugin_state->notification_app,
|
||||
get_notification_sequence_badusb(plugin_state, scene_state));
|
||||
get_notification_sequence_badkb(plugin_state, scene_state));
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -399,8 +399,8 @@ void totp_scene_generate_token_deactivate(PluginState* plugin_state) {
|
||||
free(scene_state->notification_sequence_new_token);
|
||||
}
|
||||
|
||||
if(scene_state->notification_sequence_badusb != NULL) {
|
||||
free(scene_state->notification_sequence_badusb);
|
||||
if(scene_state->notification_sequence_badkb != NULL) {
|
||||
free(scene_state->notification_sequence_badkb);
|
||||
}
|
||||
|
||||
free(scene_state);
|
||||
|
||||
Reference in New Issue
Block a user