Skip to content

Commit

Permalink
V39 Release Candidate Changes (Flipper-XFW#91)
Browse files Browse the repository at this point in the history
  • Loading branch information
Clara K authored Jan 17, 2023
2 parents 8e5f648 + a095cc8 commit cd557ec
Show file tree
Hide file tree
Showing 355 changed files with 8,338 additions and 6,670 deletions.
7 changes: 7 additions & 0 deletions ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,5 +148,12 @@ $ ./fbt resources icons dolphin_ext
<img src="https://user-images.githubusercontent.com/55334727/212134625-21383102-02f3-453f-b1d7-8a9c65b27612.svg">
</p>

----
## SAST Tools

This helps us a lot, thanks for the free license for this project!

[PVS-Studio](https://pvs-studio.com/en/pvs-studio/?utm_source=github&utm_medium=organic&utm_campaign=open_source) - static analyzer for C, C++, C#, and Java code.

----
<p align="center"> "What we do for ourselves dies with us. What we do for others and the world remains and is immortal.” ― Albert Pike </p>
12 changes: 9 additions & 3 deletions applications/main/archive/helpers/archive_browser.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,13 @@ static void
archive_add_file_item(browser, is_folder, furi_string_get_cstr(item_path));
} else {
with_view_model(
browser->view, ArchiveBrowserViewModel * model, { files_array_sort(model->files); model->list_loading = false; }, true);
browser->view,
ArchiveBrowserViewModel * model,
{
files_array_sort(model->files);
model->list_loading = false;
},
true);
}
}

Expand Down Expand Up @@ -139,7 +145,7 @@ void archive_update_focus(ArchiveBrowserView* browser, const char* target) {
archive_get_items(browser, furi_string_get_cstr(browser->path));

if(!archive_file_get_array_size(browser) && archive_is_home(browser)) {
archive_switch_tab(browser, TAB_RIGHT);
archive_switch_tab(browser, TAB_LEFT);
} else {
with_view_model(
browser->view,
Expand Down Expand Up @@ -206,7 +212,7 @@ void archive_file_array_rm_selected(ArchiveBrowserView* browser) {
false);

if((items_cnt == 0) && (archive_is_home(browser))) {
archive_switch_tab(browser, TAB_RIGHT);
archive_switch_tab(browser, TAB_LEFT);
}

archive_update_offset(browser);
Expand Down
2 changes: 1 addition & 1 deletion applications/main/archive/helpers/archive_browser.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "../archive_i.h"
#include <storage/storage.h>

#define TAB_RIGHT InputKeyRight // Default tab switch direction
#define TAB_LEFT InputKeyLeft // Default tab switch direction
#define TAB_DEFAULT ArchiveTabFavorites // Start tab
#define FILE_LIST_BUF_LEN 50

Expand Down
5 changes: 2 additions & 3 deletions applications/main/bad_usb/scenes/bad_usb_scene_error.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ void bad_usb_scene_error_on_enter(void* context) {
app->widget, GuiButtonTypeLeft, "Back", bad_usb_scene_error_event_callback, app);
} else if(app->error == BadUsbAppErrorCloseRpc) {
widget_add_icon_element(app->widget, 78, 0, &I_ActiveConnection_50x64);
if (settings->sfw_mode) {
if(settings->sfw_mode) {
widget_add_string_multiline_element(
app->widget, 3, 2, AlignLeft, AlignTop, FontPrimary, "Connection\nis active!");
widget_add_string_multiline_element(
Expand All @@ -45,8 +45,7 @@ void bad_usb_scene_error_on_enter(void* context) {
AlignTop,
FontSecondary,
"Disconnect from\nPC or phone to\nuse this function.");
}
else {
} else {
widget_add_string_multiline_element(
app->widget, 3, 2, AlignLeft, AlignTop, FontPrimary, "I am not\na whore!");
widget_add_string_multiline_element(
Expand Down
15 changes: 6 additions & 9 deletions applications/main/bad_usb/views/bad_usb_view.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,9 @@ static void bad_usb_draw_callback(Canvas* canvas, void* _model) {

if((model->state.state == BadUsbStateIdle) || (model->state.state == BadUsbStateDone) ||
(model->state.state == BadUsbStateNotConnected)) {
if (settings->sfw_mode) {
if(settings->sfw_mode) {
elements_button_center(canvas, "Start");
}
else {
} else {
elements_button_center(canvas, "Cum");
}
} else if((model->state.state == BadUsbStateRunning) || (model->state.state == BadUsbStateDelay)) {
Expand All @@ -70,21 +69,19 @@ static void bad_usb_draw_callback(Canvas* canvas, void* _model) {
if(model->state.state == BadUsbStateNotConnected) {
canvas_draw_icon(canvas, 4, 26, &I_Clock_18x18);
canvas_set_font(canvas, FontPrimary);
if (settings->sfw_mode) {
if(settings->sfw_mode) {
canvas_draw_str_aligned(canvas, 127, 31, AlignRight, AlignBottom, "Connect to");
canvas_draw_str_aligned(canvas, 127, 43, AlignRight, AlignBottom, "a device");
}
else {
} else {
canvas_draw_str_aligned(canvas, 127, 31, AlignRight, AlignBottom, "Plug me");
canvas_draw_str_aligned(canvas, 127, 43, AlignRight, AlignBottom, "in, Daddy");
}
} else if(model->state.state == BadUsbStateWillRun) {
canvas_draw_icon(canvas, 4, 26, &I_Clock_18x18);
canvas_set_font(canvas, FontPrimary);
if (settings->sfw_mode) {
if(settings->sfw_mode) {
canvas_draw_str_aligned(canvas, 127, 31, AlignRight, AlignBottom, "Will run");
}
else {
} else {
canvas_draw_str_aligned(canvas, 127, 31, AlignRight, AlignBottom, "Will cum");
}
canvas_draw_str_aligned(canvas, 127, 43, AlignRight, AlignBottom, "on connect");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@ void ibutton_scene_delete_success_on_enter(void* context) {
DesktopSettings* settings = malloc(sizeof(DesktopSettings));
DESKTOP_SETTINGS_LOAD(settings);

if (settings->sfw_mode) {
if(settings->sfw_mode) {
popup_set_icon(popup, 0, 2, &I_DolphinMafia_115x62_sfw);
}
else {
} else {
popup_set_icon(popup, 0, 2, &I_DolphinMafia_115x62);
}
popup_set_header(popup, "Deleted", 83, 19, AlignLeft, AlignBottom);
Expand Down
5 changes: 2 additions & 3 deletions applications/main/ibutton/scenes/ibutton_scene_read.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@ void ibutton_scene_read_on_enter(void* context) {

popup_set_header(popup, "iButton", 95, 26, AlignCenter, AlignBottom);
popup_set_text(popup, "Waiting\nfor key ...", 95, 30, AlignCenter, AlignTop);
if (settings->sfw_mode) {
if(settings->sfw_mode) {
popup_set_icon(popup, 0, 5, &I_DolphinWait_61x59_sfw);
}
else {
} else {
popup_set_icon(popup, 0, 5, &I_DolphinWait_61x59);
}

Expand Down
5 changes: 2 additions & 3 deletions applications/main/ibutton/scenes/ibutton_scene_save_success.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@ void ibutton_scene_save_success_on_enter(void* context) {
DesktopSettings* settings = malloc(sizeof(DesktopSettings));
DESKTOP_SETTINGS_LOAD(settings);

if (settings->sfw_mode) {
if(settings->sfw_mode) {
popup_set_icon(popup, 32, 5, &I_DolphinNice_96x59_sfw);
}
else {
} else {
popup_set_icon(popup, 32, 5, &I_DolphinNice_96x59);
}
popup_set_header(popup, "Saved!", 5, 7, AlignLeft, AlignTop);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@ void ibutton_scene_write_success_on_enter(void* context) {
DesktopSettings* settings = malloc(sizeof(DesktopSettings));
DESKTOP_SETTINGS_LOAD(settings);

if (settings->sfw_mode) {
if(settings->sfw_mode) {
popup_set_icon(popup, 0, 12, &I_iButtonDolphinVerySuccess_108x52_sfw);
}
else {
} else {
popup_set_icon(popup, 0, 12, &I_iButtonDolphinVerySuccess_108x52);
}
popup_set_text(popup, "Successfully written!", 40, 12, AlignLeft, AlignBottom);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ void infrared_scene_edit_rename_done_on_enter(void* context) {
DesktopSettings* settings = malloc(sizeof(DesktopSettings));
DESKTOP_SETTINGS_LOAD(settings);

if (settings->sfw_mode) {
if(settings->sfw_mode) {
popup_set_icon(popup, 32, 5, &I_DolphinNice_96x59_sfw);
}
else {
} else {
popup_set_icon(popup, 32, 5, &I_DolphinNice_96x59);
}
popup_set_header(popup, "Saved!", 5, 7, AlignLeft, AlignTop);
Expand Down
10 changes: 4 additions & 6 deletions applications/main/infrared/scenes/infrared_scene_learn_done.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,14 @@ void infrared_scene_learn_done_on_enter(void* context) {
DesktopSettings* settings = malloc(sizeof(DesktopSettings));
DESKTOP_SETTINGS_LOAD(settings);

if (settings->sfw_mode) {
if(settings->sfw_mode) {
popup_set_icon(popup, 32, 5, &I_DolphinNice_96x59_sfw);
if (infrared->app_state.is_learning_new_remote) {
if(infrared->app_state.is_learning_new_remote) {
popup_set_header(popup, "New remote\ncreated!", 0, 0, AlignLeft, AlignTop);
}
else {
} else {
popup_set_header(popup, "Saved!", 5, 7, AlignLeft, AlignTop);
}
}
else {
} else {
popup_set_icon(popup, 32, 5, &I_DolphinNice_96x59);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,9 @@ void infrared_scene_learn_success_on_enter(void* context) {
dialog_ex_set_left_button_text(dialog_ex, "Retry");
dialog_ex_set_right_button_text(dialog_ex, "Save");
dialog_ex_set_center_button_text(dialog_ex, "Send");
if (settings->sfw_mode) {
if(settings->sfw_mode) {
dialog_ex_set_icon(dialog_ex, 0, 1, &I_DolphinReadingSuccess_59x63_sfw);
}
else {
} else {
dialog_ex_set_icon(dialog_ex, 0, 1, &I_DolphinReadingSuccess_59x63);
}
dialog_ex_set_result_callback(dialog_ex, infrared_scene_learn_success_dialog_result_callback);
Expand Down
1 change: 0 additions & 1 deletion applications/main/infrared/scenes/infrared_scene_start.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ bool infrared_scene_start_on_event(void* context, SceneManagerEvent event) {
} else if(
submenu_index == SubmenuIndexLearnNewRemote ||
submenu_index == SubmenuIndexLearnNewRemoteRaw) {

// enable automatic signal decoding if "Learn New Remote"
// disable automatic signal decoding if "Learn New Remote (RAW)"
infrared_worker_rx_enable_signal_decoding(
Expand Down
10 changes: 4 additions & 6 deletions applications/main/lfrfid/scenes/lfrfid_scene_clear_t5577.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,9 @@ static void lfrfid_clear_t5577_password_and_config_to_EM(LfRfid* app) {
writer_initialize(t55xxtiming);

popup_set_header(popup, "Removing\npassword", 90, 36, AlignCenter, AlignCenter);
if (settings->sfw_mode) {
if(settings->sfw_mode) {
popup_set_icon(popup, 0, 3, &I_RFIDDolphinSend_97x61_sfw);
}
else {
} else {
popup_set_icon(popup, 0, 3, &I_RFIDDolphinSend_97x61);
}
popup_set_text(popup, curr_buf, 90, 56, AlignCenter, AlignCenter);
Expand Down Expand Up @@ -81,10 +80,9 @@ void lfrfid_scene_clear_t5577_on_enter(void* context) {

notification_message(app->notifications, &sequence_success);
popup_set_header(popup, "Done!", 94, 10, AlignCenter, AlignTop);
if (settings->sfw_mode) {
if(settings->sfw_mode) {
popup_set_icon(popup, 0, 7, &I_RFIDDolphinSuccess_108x57_sfw);
}
else {
} else {
popup_set_icon(popup, 0, 7, &I_RFIDDolphinSuccess_108x57);
}
popup_set_context(popup, app);
Expand Down
5 changes: 2 additions & 3 deletions applications/main/lfrfid/scenes/lfrfid_scene_delete_success.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ void lfrfid_scene_delete_success_on_enter(void* context) {
DesktopSettings* settings = malloc(sizeof(DesktopSettings));
DESKTOP_SETTINGS_LOAD(settings);

if (settings->sfw_mode) {
if(settings->sfw_mode) {
popup_set_icon(popup, 0, 2, &I_DolphinMafia_115x62_sfw);
}
else {
} else {
popup_set_icon(popup, 0, 2, &I_DolphinMafia_115x62);
}
popup_set_header(popup, "Deleted", 83, 19, AlignLeft, AlignBottom);
Expand Down
5 changes: 2 additions & 3 deletions applications/main/lfrfid/scenes/lfrfid_scene_emulate.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,9 @@ void lfrfid_scene_emulate_on_enter(void* context) {
AlignCenter,
AlignTop);
}
if (settings->sfw_mode) {
if(settings->sfw_mode) {
popup_set_icon(popup, 0, 3, &I_RFIDDolphinSend_97x61_sfw);
}
else {
} else {
popup_set_icon(popup, 0, 3, &I_RFIDDolphinSend_97x61);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ void lfrfid_scene_extra_actions_on_enter(void* context) {

submenu_add_item(
submenu,
"Read ASK (FDX,Regular)",
"Read ASK (Animal, FDX)",
SubmenuIndexASK,
lfrfid_scene_extra_actions_submenu_callback,
app);
Expand Down
5 changes: 2 additions & 3 deletions applications/main/lfrfid/scenes/lfrfid_scene_raw_read.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,9 @@ void lfrfid_scene_raw_read_on_enter(void* context) {
LfRfidReadRawState* state = malloc(sizeof(LfRfidReadRawState));
scene_manager_set_scene_state(app->scene_manager, LfRfidSceneRawRead, (uint32_t)state);
state->string_file_name = furi_string_alloc();
if (settings->sfw_mode) {
if(settings->sfw_mode) {
popup_set_icon(popup, 0, 3, &I_RFIDDolphinReceive_97x61_sfw);
}
else {
} else {
popup_set_icon(popup, 0, 3, &I_RFIDDolphinReceive_97x61);
}
view_dispatcher_switch_to_view(app->view_dispatcher, LfRfidViewPopup);
Expand Down
5 changes: 2 additions & 3 deletions applications/main/lfrfid/scenes/lfrfid_scene_rpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@ void lfrfid_scene_rpc_on_enter(void* context) {

popup_set_header(popup, "LF RFID", 89, 42, AlignCenter, AlignBottom);
popup_set_text(popup, "RPC mode", 89, 44, AlignCenter, AlignTop);
if (settings->sfw_mode) {
if(settings->sfw_mode) {
popup_set_icon(popup, 0, 12, &I_RFIDDolphinSend_97x61_sfw);
}
else {
} else {
popup_set_icon(popup, 0, 12, &I_RFIDDolphinSend_97x61);
}

Expand Down
5 changes: 2 additions & 3 deletions applications/main/lfrfid/scenes/lfrfid_scene_save_success.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@ void lfrfid_scene_save_success_on_enter(void* context) {

// Clear state of data enter scene
scene_manager_set_scene_state(app->scene_manager, LfRfidSceneSaveData, 0);
if (settings->sfw_mode) {
if(settings->sfw_mode) {
popup_set_icon(popup, 32, 5, &I_DolphinNice_96x59_sfw);
}
else {
} else {
popup_set_icon(popup, 32, 5, &I_DolphinNice_96x59);
}
popup_set_header(popup, "Saved!", 5, 7, AlignLeft, AlignTop);
Expand Down
5 changes: 2 additions & 3 deletions applications/main/lfrfid/scenes/lfrfid_scene_write.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,9 @@ void lfrfid_scene_write_on_enter(void* context) {
AlignCenter,
AlignTop);
}
if (settings->sfw_mode) {
if(settings->sfw_mode) {
popup_set_icon(popup, 0, 3, &I_RFIDDolphinSend_97x61_sfw);
}
else {
} else {
popup_set_icon(popup, 0, 3, &I_RFIDDolphinSend_97x61);
}

Expand Down
5 changes: 2 additions & 3 deletions applications/main/lfrfid/scenes/lfrfid_scene_write_success.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@ void lfrfid_scene_write_success_on_enter(void* context) {
DESKTOP_SETTINGS_LOAD(settings);

popup_set_header(popup, "Successfully\nwritten!", 94, 3, AlignCenter, AlignTop);
if (settings->sfw_mode) {
if(settings->sfw_mode) {
popup_set_icon(popup, 0, 6, &I_RFIDDolphinSuccess_108x57_sfw);
}
else {
} else {
popup_set_icon(popup, 0, 6, &I_RFIDDolphinSuccess_108x57);
}
popup_set_context(popup, app);
Expand Down
5 changes: 2 additions & 3 deletions applications/main/nfc/scenes/nfc_scene_delete_success.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@ void nfc_scene_delete_success_on_enter(void* context) {

// Setup view
Popup* popup = nfc->popup;
if (settings->sfw_mode) {
if(settings->sfw_mode) {
popup_set_icon(popup, 0, 2, &I_DolphinMafia_115x62_sfw);
}
else {
} else {
popup_set_icon(popup, 0, 2, &I_DolphinMafia_115x62);
}
popup_set_header(popup, "Deleted", 83, 19, AlignLeft, AlignBottom);
Expand Down
12 changes: 11 additions & 1 deletion applications/main/nfc/scenes/nfc_scene_emulate_nfcv.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "../nfc_i.h"
#include "../../../settings/desktop_settings/desktop_settings_app.h"

#define NFC_SCENE_EMULATE_NFCV_LOG_SIZE_MAX (100)

Expand Down Expand Up @@ -37,7 +38,15 @@ static void nfc_scene_emulate_nfcv_widget_config(Nfc* nfc, bool data_received) {
FuriString* info_str;
info_str = furi_string_alloc();

widget_add_icon_element(widget, 0, 3, &I_RFIDDolphinSend_97x61);
DesktopSettings* settings = malloc(sizeof(DesktopSettings));
DESKTOP_SETTINGS_LOAD(settings);

if(settings->sfw_mode) {
widget_add_icon_element(widget, 0, 3, &I_RFIDDolphinSend_97x61_sfw);
} else {
widget_add_icon_element(widget, 0, 3, &I_RFIDDolphinSend_97x61);
}

widget_add_string_element(
widget, 89, 32, AlignCenter, AlignTop, FontPrimary, "Emulating NfcV");
if(strcmp(nfc->dev->dev_name, "")) {
Expand All @@ -55,6 +64,7 @@ static void nfc_scene_emulate_nfcv_widget_config(Nfc* nfc, bool data_received) {
widget_add_button_element(
widget, GuiButtonTypeCenter, "Log", nfc_scene_emulate_nfcv_widget_callback, nfc);
}
free(settings);
}

void nfc_scene_emulate_nfcv_on_enter(void* context) {
Expand Down
Loading

0 comments on commit cd557ec

Please sign in to comment.