diff --git a/applications/main/lfrfid/scenes/lfrfid_scene_clear_t5577.c b/applications/main/lfrfid/scenes/lfrfid_scene_clear_t5577.c index db9718669..a95eed7db 100644 --- a/applications/main/lfrfid/scenes/lfrfid_scene_clear_t5577.c +++ b/applications/main/lfrfid/scenes/lfrfid_scene_clear_t5577.c @@ -1,5 +1,6 @@ #include "../lfrfid_i.h" #include "../helpers/rfid_writer.h" +#include "../../../settings/desktop_settings/desktop_settings_app.h" static void writer_initialize(T55xxTiming* t55xxtiming) { t55xxtiming->wait_time = 400; @@ -14,6 +15,9 @@ static void lfrfid_clear_t5577_password_and_config_to_EM(LfRfid* app) { T55xxTiming* t55xxtiming = malloc(sizeof(T55xxTiming)); Popup* popup = app->popup; char curr_buf[32] = {}; + DesktopSettings* settings = malloc(sizeof(DesktopSettings)); + DESKTOP_SETTINGS_LOAD(settings); + //TODO: use .txt file in resourses for passwords. const uint32_t default_passwords[] = { 0x51243648, 0x000D8787, 0x19920427, 0x50524F58, 0xF9DCEBA0, 0x65857569, 0x05D73B9F, @@ -41,7 +45,12 @@ 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); - popup_set_icon(popup, 0, 3, &I_RFIDDolphinSend_97x61); + if (settings->sfw_mode) { + popup_set_icon(popup, 0, 3, &I_RFIDDolphinSend_97x61_sfw); + } + else { + popup_set_icon(popup, 0, 3, &I_RFIDDolphinSend_97x61); + } popup_set_text(popup, curr_buf, 90, 56, AlignCenter, AlignCenter); notification_message(app->notifications, &sequence_blink_start_magenta); @@ -59,17 +68,25 @@ static void lfrfid_clear_t5577_password_and_config_to_EM(LfRfid* app) { notification_message(app->notifications, &sequence_blink_stop); popup_reset(app->popup); free(t55xxtiming); + free(settings); } void lfrfid_scene_clear_t5577_on_enter(void* context) { LfRfid* app = context; Popup* popup = app->popup; + DesktopSettings* settings = malloc(sizeof(DesktopSettings)); + DESKTOP_SETTINGS_LOAD(settings); lfrfid_clear_t5577_password_and_config_to_EM(app); notification_message(app->notifications, &sequence_success); popup_set_header(popup, "Done!", 94, 10, AlignCenter, AlignTop); - popup_set_icon(popup, 0, 7, &I_RFIDDolphinSuccess_108x57); + if (settings->sfw_mode) { + popup_set_icon(popup, 0, 7, &I_RFIDDolphinSuccess_108x57_sfw); + } + else { + popup_set_icon(popup, 0, 7, &I_RFIDDolphinSuccess_108x57); + } popup_set_context(popup, app); popup_set_callback(popup, lfrfid_popup_timeout_callback); popup_set_timeout(popup, 1500); @@ -77,6 +94,7 @@ void lfrfid_scene_clear_t5577_on_enter(void* context) { view_dispatcher_switch_to_view(app->view_dispatcher, LfRfidViewPopup); notification_message_block(app->notifications, &sequence_set_green_255); + free(settings); } bool lfrfid_scene_clear_t5577_on_event(void* context, SceneManagerEvent event) { diff --git a/applications/main/lfrfid/scenes/lfrfid_scene_emulate.c b/applications/main/lfrfid/scenes/lfrfid_scene_emulate.c index dc3918994..a0e9b8609 100644 --- a/applications/main/lfrfid/scenes/lfrfid_scene_emulate.c +++ b/applications/main/lfrfid/scenes/lfrfid_scene_emulate.c @@ -1,8 +1,11 @@ #include "../lfrfid_i.h" +#include "../../../settings/desktop_settings/desktop_settings_app.h" void lfrfid_scene_emulate_on_enter(void* context) { LfRfid* app = context; Popup* popup = app->popup; + DesktopSettings* settings = malloc(sizeof(DesktopSettings)); + DESKTOP_SETTINGS_LOAD(settings); popup_set_header(popup, "Emulating", 89, 30, AlignCenter, AlignTop); if(!furi_string_empty(app->file_name)) { @@ -16,13 +19,19 @@ void lfrfid_scene_emulate_on_enter(void* context) { AlignCenter, AlignTop); } - popup_set_icon(popup, 0, 3, &I_RFIDDolphinSend_97x61); + if (settings->sfw_mode) { + popup_set_icon(popup, 0, 3, &I_RFIDDolphinSend_97x61_sfw); + } + else { + popup_set_icon(popup, 0, 3, &I_RFIDDolphinSend_97x61); + } lfrfid_worker_start_thread(app->lfworker); lfrfid_worker_emulate_start(app->lfworker, (LFRFIDProtocol)app->protocol_id); notification_message(app->notifications, &sequence_blink_start_magenta); view_dispatcher_switch_to_view(app->view_dispatcher, LfRfidViewPopup); + free(settings); } bool lfrfid_scene_emulate_on_event(void* context, SceneManagerEvent event) { diff --git a/applications/main/lfrfid/scenes/lfrfid_scene_raw_read.c b/applications/main/lfrfid/scenes/lfrfid_scene_raw_read.c index b2c7c364e..1d6a63f91 100644 --- a/applications/main/lfrfid/scenes/lfrfid_scene_raw_read.c +++ b/applications/main/lfrfid/scenes/lfrfid_scene_raw_read.c @@ -1,4 +1,5 @@ #include "../lfrfid_i.h" +#include "../../../settings/desktop_settings/desktop_settings_app.h" #define RAW_READ_TIME 5000 @@ -28,12 +29,18 @@ static void timer_callback(void* context) { void lfrfid_scene_raw_read_on_enter(void* context) { LfRfid* app = context; Popup* popup = app->popup; + DesktopSettings* settings = malloc(sizeof(DesktopSettings)); + DESKTOP_SETTINGS_LOAD(settings); LfRfidReadRawState* state = malloc(sizeof(LfRfidReadRawState)); scene_manager_set_scene_state(app->scene_manager, LfRfidSceneRawRead, (uint32_t)state); state->string_file_name = furi_string_alloc(); - - popup_set_icon(popup, 0, 3, &I_RFIDDolphinReceive_97x61); + if (settings->sfw_mode) { + popup_set_icon(popup, 0, 3, &I_RFIDDolphinReceive_97x61_sfw); + } + else { + popup_set_icon(popup, 0, 3, &I_RFIDDolphinReceive_97x61); + } view_dispatcher_switch_to_view(app->view_dispatcher, LfRfidViewPopup); lfrfid_worker_start_thread(app->lfworker); lfrfid_make_app_folder(app); @@ -58,6 +65,7 @@ void lfrfid_scene_raw_read_on_enter(void* context) { state->is_psk = false; state->error = false; + free(settings); } bool lfrfid_scene_raw_read_on_event(void* context, SceneManagerEvent event) { diff --git a/applications/main/lfrfid/scenes/lfrfid_scene_rpc.c b/applications/main/lfrfid/scenes/lfrfid_scene_rpc.c index 156dd97af..a7161e069 100644 --- a/applications/main/lfrfid/scenes/lfrfid_scene_rpc.c +++ b/applications/main/lfrfid/scenes/lfrfid_scene_rpc.c @@ -1,18 +1,27 @@ #include "../lfrfid_i.h" +#include "../../../settings/desktop_settings/desktop_settings_app.h" void lfrfid_scene_rpc_on_enter(void* context) { LfRfid* app = context; Popup* popup = app->popup; + DesktopSettings* settings = malloc(sizeof(DesktopSettings)); + DESKTOP_SETTINGS_LOAD(settings); popup_set_header(popup, "LF RFID", 89, 42, AlignCenter, AlignBottom); popup_set_text(popup, "RPC mode", 89, 44, AlignCenter, AlignTop); - popup_set_icon(popup, 0, 12, &I_RFIDDolphinSend_97x61); + if (settings->sfw_mode) { + popup_set_icon(popup, 0, 12, &I_RFIDDolphinSend_97x61_sfw); + } + else { + popup_set_icon(popup, 0, 12, &I_RFIDDolphinSend_97x61); + } view_dispatcher_switch_to_view(app->view_dispatcher, LfRfidViewPopup); notification_message(app->notifications, &sequence_display_backlight_on); app->rpc_state = LfRfidRpcStateIdle; + free(settings); } bool lfrfid_scene_rpc_on_event(void* context, SceneManagerEvent event) { diff --git a/applications/main/lfrfid/scenes/lfrfid_scene_write.c b/applications/main/lfrfid/scenes/lfrfid_scene_write.c index b7faed69f..f4bd8f45a 100644 --- a/applications/main/lfrfid/scenes/lfrfid_scene_write.c +++ b/applications/main/lfrfid/scenes/lfrfid_scene_write.c @@ -1,4 +1,5 @@ #include "../lfrfid_i.h" +#include "../../../settings/desktop_settings/desktop_settings_app.h" static void lfrfid_write_callback(LFRFIDWorkerWriteResult result, void* context) { LfRfid* app = context; @@ -20,6 +21,8 @@ static void lfrfid_write_callback(LFRFIDWorkerWriteResult result, void* context) void lfrfid_scene_write_on_enter(void* context) { LfRfid* app = context; Popup* popup = app->popup; + DesktopSettings* settings = malloc(sizeof(DesktopSettings)); + DESKTOP_SETTINGS_LOAD(settings); popup_set_header(popup, "Writing", 89, 30, AlignCenter, AlignTop); if(!furi_string_empty(app->file_name)) { @@ -33,7 +36,12 @@ void lfrfid_scene_write_on_enter(void* context) { AlignCenter, AlignTop); } - popup_set_icon(popup, 0, 3, &I_RFIDDolphinSend_97x61); + if (settings->sfw_mode) { + popup_set_icon(popup, 0, 3, &I_RFIDDolphinSend_97x61_sfw); + } + else { + popup_set_icon(popup, 0, 3, &I_RFIDDolphinSend_97x61); + } view_dispatcher_switch_to_view(app->view_dispatcher, LfRfidViewPopup); @@ -44,6 +52,7 @@ void lfrfid_scene_write_on_enter(void* context) { lfrfid_worker_write_start( app->lfworker, (LFRFIDProtocol)app->protocol_id, lfrfid_write_callback, app); notification_message(app->notifications, &sequence_blink_start_magenta); + free(settings); } bool lfrfid_scene_write_on_event(void* context, SceneManagerEvent event) { diff --git a/applications/main/lfrfid/scenes/lfrfid_scene_write_success.c b/applications/main/lfrfid/scenes/lfrfid_scene_write_success.c index 52e30d6b6..6ba138879 100644 --- a/applications/main/lfrfid/scenes/lfrfid_scene_write_success.c +++ b/applications/main/lfrfid/scenes/lfrfid_scene_write_success.c @@ -1,11 +1,19 @@ #include "../lfrfid_i.h" +#include "../../../settings/desktop_settings/desktop_settings_app.h" void lfrfid_scene_write_success_on_enter(void* context) { LfRfid* app = context; Popup* popup = app->popup; + DesktopSettings* settings = malloc(sizeof(DesktopSettings)); + DESKTOP_SETTINGS_LOAD(settings); popup_set_header(popup, "Successfully\nwritten!", 94, 3, AlignCenter, AlignTop); - popup_set_icon(popup, 0, 6, &I_RFIDDolphinSuccess_108x57); + if (settings->sfw_mode) { + popup_set_icon(popup, 0, 6, &I_RFIDDolphinSuccess_108x57_sfw); + } + else { + popup_set_icon(popup, 0, 6, &I_RFIDDolphinSuccess_108x57); + } popup_set_context(popup, app); popup_set_callback(popup, lfrfid_popup_timeout_callback); popup_set_timeout(popup, 1500); @@ -13,6 +21,7 @@ void lfrfid_scene_write_success_on_enter(void* context) { view_dispatcher_switch_to_view(app->view_dispatcher, LfRfidViewPopup); notification_message_block(app->notifications, &sequence_set_green_255); + free(settings); } bool lfrfid_scene_write_success_on_event(void* context, SceneManagerEvent event) { diff --git a/applications/main/subghz/scenes/subghz_scene_rpc.c b/applications/main/subghz/scenes/subghz_scene_rpc.c index 68f2e0199..e78e7fa71 100644 --- a/applications/main/subghz/scenes/subghz_scene_rpc.c +++ b/applications/main/subghz/scenes/subghz_scene_rpc.c @@ -1,6 +1,7 @@ #include "../subghz_i.h" #include #include +#include "../../../settings/desktop_settings/desktop_settings_app.h" typedef enum { SubGhzRpcStateIdle, @@ -10,17 +11,24 @@ typedef enum { void subghz_scene_rpc_on_enter(void* context) { SubGhz* subghz = context; Popup* popup = subghz->popup; + DesktopSettings* settings = malloc(sizeof(DesktopSettings)); + DESKTOP_SETTINGS_LOAD(settings); popup_set_header(popup, "Sub-GHz", 89, 42, AlignCenter, AlignBottom); popup_set_text(popup, "RPC mode", 89, 44, AlignCenter, AlignTop); - - popup_set_icon(popup, 0, 12, &I_RFIDDolphinSend_97x61); + if (settings->sfw_mode) { + popup_set_icon(popup, 0, 12, &I_RFIDDolphinSend_97x61_sfw); + } + else { + popup_set_icon(popup, 0, 12, &I_RFIDDolphinSend_97x61); + } view_dispatcher_switch_to_view(subghz->view_dispatcher, SubGhzViewIdPopup); scene_manager_set_scene_state(subghz->scene_manager, SubGhzSceneRpc, SubGhzRpcStateIdle); notification_message(subghz->notifications, &sequence_display_backlight_on); + free(settings); } bool subghz_scene_rpc_on_event(void* context, SceneManagerEvent event) { diff --git a/assets/icons/RFID/RFIDDolphinReceive_97x61_sfw.png b/assets/icons/RFID/RFIDDolphinReceive_97x61_sfw.png new file mode 100644 index 000000000..e1f5f9f80 Binary files /dev/null and b/assets/icons/RFID/RFIDDolphinReceive_97x61_sfw.png differ diff --git a/assets/icons/RFID/RFIDDolphinSend_97x61_sfw.png b/assets/icons/RFID/RFIDDolphinSend_97x61_sfw.png new file mode 100644 index 000000000..380a970d9 Binary files /dev/null and b/assets/icons/RFID/RFIDDolphinSend_97x61_sfw.png differ diff --git a/assets/icons/RFID/RFIDDolphinSuccess_108x57_sfw.png b/assets/icons/RFID/RFIDDolphinSuccess_108x57_sfw.png new file mode 100644 index 000000000..341999109 Binary files /dev/null and b/assets/icons/RFID/RFIDDolphinSuccess_108x57_sfw.png differ