MX 2 лет назад
Родитель
Сommit
ee022710ef

+ 1 - 1
ReadMe.md

@@ -20,7 +20,7 @@ Sources of "integrated/bundled" apps are added now in this repo too, to allow pu
 
 The Flipper and its community wouldn't be as rich as it is without your contributions and support. Thank you for all you have done.
 
-### Apps checked & updated at `13 Jul 23:41 GMT +3`
+### Apps checked & updated at `13 Jul 23:51 GMT +3`
 
 ## Games
 - [Pong (By nmrr)](https://github.com/nmrr/flipperzero-pong) - Modified by [SimplyMinimal](https://github.com/SimplyMinimal/FlipperZero-Pong)

BIN
apps/GPIO/mag.fap


BIN
apps/Tools/flipbip.fap


+ 1 - 1
apps_source_code/FlipBIP/flipbip.h

@@ -15,7 +15,7 @@
 #include "views/flipbip_startscreen.h"
 #include "views/flipbip_scene_1.h"
 
-#define FLIPBIP_VERSION "v0.0.9"
+#define FLIPBIP_VERSION "v1.0.0"
 
 #define COIN_BTC 0
 #define COIN_DOGE 3

+ 38 - 36
apps_source_code/FlipBIP/lib/crypto/rand.c

@@ -21,28 +21,18 @@
  * OTHER DEALINGS IN THE SOFTWARE.
  */
 
-// NOTE:
-// random32() and random_buffer() have been replaced in this implementation
-// with Flipper Zero specific code. The original code is commented out below.
+#define FLIPPER_HAL_RANDOM
 
 #include "rand.h"
 
-// Flipper Zero RNG code:
-#include <furi_hal_random.h>
-
-#ifndef RAND_PLATFORM_INDEPENDENT
+#ifdef FLIPPER_HAL_RANDOM
 
-// Original code:
-// #pragma message("NOT SUITABLE FOR PRODUCTION USE! Replace random32() function with your own secure code.")
+// NOTE:
+// random32() and random_buffer() have been replaced in this implementation
+// with Flipper Zero specific code. The original code is disabled by #define.
 
-// The following code is not supposed to be used in a production environment.
-// It's included only to make the library testable.
-// The message above tries to prevent any accidental use outside of the test
-// environment.
-//
-// You are supposed to replace the random8() and random32() function with your
-// own secure code. There is also a possibility to replace the random_buffer()
-// function as it is defined as a weak symbol.
+// Flipper Zero RNG code:
+#include <furi_hal_random.h>
 
 static uint32_t seed = 0;
 
@@ -50,14 +40,6 @@ void random_reseed(const uint32_t value) {
     seed = value;
 }
 
-// Original code:
-// uint32_t random32(void) {
-//   // Linear congruential generator from Numerical Recipes
-//   // https://en.wikipedia.org/wiki/Linear_congruential_generator
-//   seed = 1664525 * seed + 1013904223;
-//   return seed;
-// }
-
 // Flipper Zero RNG code:
 uint32_t random32(void) {
     return furi_hal_random_get();
@@ -68,22 +50,42 @@ void random_buffer(uint8_t* buf, size_t len) {
     furi_hal_random_fill_buf(buf, len);
 }
 
-#endif /* RAND_PLATFORM_INDEPENDENT */
+#else /* PLATFORM INDEPENDENT */
+
+#pragma message( \
+        "NOT SUITABLE FOR PRODUCTION USE! Replace random32() function with your own secure code.")
+
+// The following code is not supposed to be used in a production environment.
+// It's included only to make the library testable.
+// The message above tries to prevent any accidental use outside of the test
+// environment.
+//
+// You are supposed to replace the random8() and random32() function with your
+// own secure code. There is also a possibility to replace the random_buffer()
+// function as it is defined as a weak symbol.
 
 //
 // The following code is platform independent
 //
 
-// Original code:
-// void __attribute__((weak)) random_buffer(uint8_t *buf, size_t len) {
-//   uint32_t r = 0;
-//   for (size_t i = 0; i < len; i++) {
-//     if (i % 4 == 0) {
-//       r = random32();
-//     }
-//     buf[i] = (r >> ((i % 4) * 8)) & 0xFF;
-//   }
-// }
+uint32_t random32(void) {
+    // Linear congruential generator from Numerical Recipes
+    // https://en.wikipedia.org/wiki/Linear_congruential_generator
+    seed = 1664525 * seed + 1013904223;
+    return seed;
+}
+
+void __attribute__((weak)) random_buffer(uint8_t* buf, size_t len) {
+    uint32_t r = 0;
+    for(size_t i = 0; i < len; i++) {
+        if(i % 4 == 0) {
+            r = random32();
+        }
+        buf[i] = (r >> ((i % 4) * 8)) & 0xFF;
+    }
+}
+
+#endif /* FLIPPER_HAL_RANDOM */
 
 uint32_t random_uniform(uint32_t n) {
     uint32_t x = 0, max = 0xFFFFFFFF - (0xFFFFFFFF % n);

+ 1 - 1
apps_source_code/FlipBIP/scenes/flipbip_scene_scene_1.c

@@ -47,4 +47,4 @@ bool flipbip_scene_scene_1_on_event(void* context, SceneManagerEvent event) {
 void flipbip_scene_scene_1_on_exit(void* context) {
     FlipBip* app = context;
     UNUSED(app);
-}
+}

+ 71 - 43
apps_source_code/FlipBIP/views/flipbip_scene_1.c

@@ -22,7 +22,9 @@
 #define DERIV_ACCOUNT 0
 #define DERIV_CHANGE 0
 
-#define MAX_ADDR_LEN 42 + 1 // 42 = max length of address + null terminator
+#define MAX_TEXT_LEN 30 // 30 = max length of text
+#define MAX_TEXT_BUF (MAX_TEXT_LEN + 1) // max length of text + null terminator
+#define MAX_ADDR_BUF (42 + 1) // 42 = max length of address + null terminator
 #define NUM_ADDRS 6
 
 #define PAGE_LOADING 0
@@ -43,10 +45,10 @@
 #define TEXT_RECEIVE_ADDRESS "receive address:"
 #define TEXT_DEFAULT_DERIV "m/44'/X'/0'/0"
 const char* TEXT_INFO = "-Scroll pages with up/down-"
-                        "p1,2)    Mnemonic/Seed     "
-                        "p3)       xprv Root Key    "
-                        "p4,5)  xprv/xpub Accnt Keys"
-                        "p6,7)  xprv/xpub Extnd Keys"
+                        "p1,2)   BIP39 Mnemonic/Seed"
+                        "p3)       BIP32 Root Key   "
+                        "p4,5)  Prv/Pub Account Keys"
+                        "p6,7)  Prv/Pub BIP32 Keys  "
                         "p8+)    Receive Addresses  ";
 
 // #define TEXT_SAVE_QR "Save QR"
@@ -97,6 +99,10 @@ static CONFIDENTIAL char* s_disp_text5 = NULL;
 static CONFIDENTIAL char* s_disp_text6 = NULL;
 // Derivation path text
 static const char* s_derivation_text = TEXT_DEFAULT_DERIV;
+// Warning text
+static bool s_warn_insecure = false;
+#define WARN_INSECURE_TEXT_1 "Recommendation:"
+#define WARN_INSECURE_TEXT_2 "Set BIP39 Passphrase"
 //static bool s_busy = false;
 
 void flipbip_scene_1_set_callback(
@@ -116,13 +122,15 @@ static void flipbip_scene_1_init_address(
     uint32_t addr_index) {
     //s_busy = true;
 
-    // Buffer for address serialization
-    const size_t buflen = 40;
-    char buf[40 + 1] = {0};
+    // buffer for address serialization
+    // subtract 2 for "0x", 1 for null terminator
+    const size_t buflen = MAX_ADDR_BUF - (2 + 1);
+    // subtract 2 for "0x"
+    char buf[MAX_ADDR_BUF - 2] = {0};
 
     // Use static node for address generation
     memcpy(s_addr_node, node, sizeof(HDNode));
-    memzero(addr_text, MAX_ADDR_LEN);
+    memzero(addr_text, MAX_ADDR_BUF);
 
     hdnode_private_ckd(s_addr_node, addr_index);
     hdnode_fill_public_key(s_addr_node);
@@ -157,8 +165,13 @@ static void flipbip_scene_1_init_address(
     //s_busy = false;
 }
 
-static void flipbip_scene_1_draw_generic(const char* text, size_t line_len) {
+static void
+    flipbip_scene_1_draw_generic(const char* text, const size_t line_len, const bool chunk) {
     // Split the text into parts
+    size_t len = line_len;
+    if(len > MAX_TEXT_LEN) {
+        len = MAX_TEXT_LEN;
+    }
     for(size_t si = 1; si <= 6; si++) {
         char* ptr = NULL;
 
@@ -175,11 +188,18 @@ static void flipbip_scene_1_draw_generic(const char* text, size_t line_len) {
         else if(si == 6)
             ptr = s_disp_text6;
 
-        memzero(ptr, 30 + 1);
-        if(line_len > 30) {
-            strncpy(ptr, text + ((si - 1) * 30), 30);
-        } else {
-            strncpy(ptr, text + ((si - 1) * line_len), line_len);
+        memzero(ptr, MAX_TEXT_BUF);
+        strncpy(ptr, text + ((si - 1) * len), len);
+        // add a space every 4 characters and shift the text
+        if(len < 23 && chunk) {
+            for(size_t i = 0; i < strlen(ptr); i++) {
+                if(i % 5 == 0) {
+                    for(size_t j = strlen(ptr); j > i; j--) {
+                        ptr[j] = ptr[j - 1];
+                    }
+                    ptr[i] = ' ';
+                }
+            }
         }
     }
 }
@@ -219,9 +239,9 @@ static void flipbip_scene_1_draw_mnemonic(const char* mnemonic) {
         else if(mi == 6)
             ptr = s_disp_text6;
 
-        memzero(ptr, 30 + 1);
-        if(strlen(mnemonic_part) > 30) {
-            strncpy(ptr, mnemonic_part, 30);
+        memzero(ptr, MAX_TEXT_BUF);
+        if(strlen(mnemonic_part) > MAX_TEXT_LEN) {
+            strncpy(ptr, mnemonic_part, MAX_TEXT_LEN);
         } else {
             strncpy(ptr, mnemonic_part, strlen(mnemonic_part));
         }
@@ -240,7 +260,7 @@ static void flipbip_scene_1_draw_seed(FlipBipScene1Model* const model) {
     // Convert the seed to a hex string
     flipbip_btox(model->seed, 64, seed_working);
 
-    flipbip_scene_1_draw_generic(seed_working, 22);
+    flipbip_scene_1_draw_generic(seed_working, 22, false);
 
     // Free the working seed memory
     memzero(seed_working, seed_working_len);
@@ -248,12 +268,12 @@ static void flipbip_scene_1_draw_seed(FlipBipScene1Model* const model) {
 }
 
 static void flipbip_scene_1_clear_text() {
-    memzero((void*)s_disp_text1, 30 + 1);
-    memzero((void*)s_disp_text2, 30 + 1);
-    memzero((void*)s_disp_text3, 30 + 1);
-    memzero((void*)s_disp_text4, 30 + 1);
-    memzero((void*)s_disp_text5, 30 + 1);
-    memzero((void*)s_disp_text6, 30 + 1);
+    memzero((void*)s_disp_text1, MAX_TEXT_BUF);
+    memzero((void*)s_disp_text2, MAX_TEXT_BUF);
+    memzero((void*)s_disp_text3, MAX_TEXT_BUF);
+    memzero((void*)s_disp_text4, MAX_TEXT_BUF);
+    memzero((void*)s_disp_text5, MAX_TEXT_BUF);
+    memzero((void*)s_disp_text6, MAX_TEXT_BUF);
 }
 
 void flipbip_scene_1_draw(Canvas* canvas, FlipBipScene1Model* model) {
@@ -263,35 +283,40 @@ void flipbip_scene_1_draw(Canvas* canvas, FlipBipScene1Model* model) {
 
     flipbip_scene_1_clear_text();
     if(model->page == PAGE_INFO) {
-        flipbip_scene_1_draw_generic(TEXT_INFO, 27);
+        flipbip_scene_1_draw_generic(TEXT_INFO, 27, false);
     } else if(model->page == PAGE_MNEMONIC) {
         flipbip_scene_1_draw_mnemonic(model->mnemonic);
     } else if(model->page == PAGE_SEED) {
         flipbip_scene_1_draw_seed(model);
     } else if(model->page == PAGE_XPRV_ROOT) {
-        flipbip_scene_1_draw_generic(model->xprv_root, 20);
+        flipbip_scene_1_draw_generic(model->xprv_root, 20, false);
     } else if(model->page == PAGE_XPRV_ACCT) {
-        flipbip_scene_1_draw_generic(model->xprv_account, 20);
+        flipbip_scene_1_draw_generic(model->xprv_account, 20, false);
     } else if(model->page == PAGE_XPUB_ACCT) {
-        flipbip_scene_1_draw_generic(model->xpub_account, 20);
+        flipbip_scene_1_draw_generic(model->xpub_account, 20, false);
     } else if(model->page == PAGE_XPRV_EXTD) {
-        flipbip_scene_1_draw_generic(model->xprv_extended, 20);
+        flipbip_scene_1_draw_generic(model->xprv_extended, 20, false);
     } else if(model->page == PAGE_XPUB_EXTD) {
-        flipbip_scene_1_draw_generic(model->xpub_extended, 20);
+        flipbip_scene_1_draw_generic(model->xpub_extended, 20, false);
     } else if(model->page >= PAGE_ADDR_BEGIN && model->page <= PAGE_ADDR_END) {
-        uint32_t line_len = 12;
+        size_t line_len = 12;
         if(model->coin == FlipBipCoinETH60) {
             line_len = 14;
         }
         flipbip_scene_1_draw_generic(
-            model->recv_addresses[model->page - PAGE_ADDR_BEGIN], line_len);
+            model->recv_addresses[model->page - PAGE_ADDR_BEGIN], line_len, true);
     }
 
     if(model->page == PAGE_LOADING) {
         canvas_set_font(canvas, FontPrimary);
         canvas_draw_str(canvas, 2, 10, TEXT_LOADING);
         canvas_draw_str(canvas, 7, 30, s_derivation_text);
-        canvas_draw_icon(canvas, 86, 25, &I_Keychain_39x36);
+        canvas_draw_icon(canvas, 86, 22, &I_Keychain_39x36);
+        if(s_warn_insecure) {
+            canvas_set_font(canvas, FontSecondary);
+            canvas_draw_str(canvas, 2, 50, WARN_INSECURE_TEXT_1);
+            canvas_draw_str(canvas, 2, 60, WARN_INSECURE_TEXT_2);
+        }
     } else if(model->page >= PAGE_ADDR_BEGIN && model->page <= PAGE_ADDR_END) {
         // draw address header
         canvas_set_font(canvas, FontSecondary);
@@ -460,8 +485,8 @@ static int flipbip_scene_1_model_init(
 
     // Initialize addresses
     for(uint8_t a = 0; a < NUM_ADDRS; a++) {
-        model->recv_addresses[a] = malloc(MAX_ADDR_LEN);
-        memzero(model->recv_addresses[a], MAX_ADDR_LEN);
+        model->recv_addresses[a] = malloc(MAX_ADDR_BUF);
+        memzero(model->recv_addresses[a], MAX_ADDR_BUF);
         flipbip_scene_1_init_address(model->recv_addresses[a], node, coin, a);
 
         // Save QR code file
@@ -585,7 +610,7 @@ void flipbip_scene_1_exit(void* context) {
                 free((void*)model->xprv_extended);
                 free((void*)model->xpub_extended);
                 for(int a = 0; a < NUM_ADDRS; a++) {
-                    memzero((void*)model->recv_addresses[a], MAX_ADDR_LEN);
+                    memzero((void*)model->recv_addresses[a], MAX_ADDR_BUF);
                     free((void*)model->recv_addresses[a]);
                 }
             }
@@ -613,6 +638,9 @@ void flipbip_scene_1_enter(void* context) {
     const char* passphrase_text = "";
     if(app->passphrase == FlipBipPassphraseOn && strlen(app->passphrase_text) > 0) {
         passphrase_text = app->passphrase_text;
+        s_warn_insecure = false;
+    } else {
+        s_warn_insecure = true;
     }
 
     // BIP44 Coin setting
@@ -684,12 +712,12 @@ FlipBipScene1* flipbip_scene_1_alloc() {
     s_addr_node = (HDNode*)malloc(sizeof(HDNode));
 
     // allocate the display text
-    s_disp_text1 = (char*)malloc(30 + 1);
-    s_disp_text2 = (char*)malloc(30 + 1);
-    s_disp_text3 = (char*)malloc(30 + 1);
-    s_disp_text4 = (char*)malloc(30 + 1);
-    s_disp_text5 = (char*)malloc(30 + 1);
-    s_disp_text6 = (char*)malloc(30 + 1);
+    s_disp_text1 = (char*)malloc(MAX_TEXT_BUF);
+    s_disp_text2 = (char*)malloc(MAX_TEXT_BUF);
+    s_disp_text3 = (char*)malloc(MAX_TEXT_BUF);
+    s_disp_text4 = (char*)malloc(MAX_TEXT_BUF);
+    s_disp_text5 = (char*)malloc(MAX_TEXT_BUF);
+    s_disp_text6 = (char*)malloc(MAX_TEXT_BUF);
 
     return instance;
 }

+ 1 - 1
non_catalog_apps/magspoof_flipper/helpers/mag_helpers.c

@@ -158,7 +158,7 @@ void tx_deinit_rfid() {
 void tx_init_rf(int hz) {
     // presets and frequency will need some experimenting
     furi_hal_subghz_reset();
-    furi_hal_subghz_load_preset(FuriHalSubGhzPresetOok650Async);
+    // furi_hal_subghz_load_preset(FuriHalSubGhzPresetOok650Async);
     // furi_hal_subghz_load_preset(FuriHalSubGhzPresetGFSK9_99KbAsync);
     // furi_hal_subghz_load_preset(FuriHalSubGhzPresetMSK99_97KbAsync);
     // furi_hal_subghz_load_preset(FuriHalSubGhzPreset2FSKDev238Async);

+ 37 - 30
non_catalog_apps/magspoof_flipper/scenes/mag_scene_read.c

@@ -7,7 +7,7 @@
 
 #define TAG "MagSceneRead"
 
-void uart_callback(UartIrqEvent event, uint8_t data, void *context) {
+void uart_callback(UartIrqEvent event, uint8_t data, void* context) {
     Mag* mag = context;
     if(event == UartIrqEventRXNE) {
         furi_stream_buffer_send(mag->uart_rx_stream, &data, 1, 0);
@@ -20,24 +20,28 @@ static int32_t uart_worker(void* context) {
     mag->uart_rx_stream = furi_stream_buffer_alloc(UART_RX_BUF_SIZE, 1);
     mag->uart_text_box_store_strlen = 0;
 
-    while (1) {
-        uint32_t events = furi_thread_flags_wait(WORKER_ALL_RX_EVENTS, FuriFlagWaitAny, FuriWaitForever);
+    while(1) {
+        uint32_t events =
+            furi_thread_flags_wait(WORKER_ALL_RX_EVENTS, FuriFlagWaitAny, FuriWaitForever);
         // furi_check((events & FuriFlagError) == 0);
-        
+
         if(events & WorkerEvtStop) break;
         if(events & WorkerEvtRxDone) {
             FURI_LOG_D(TAG, "WorkerEvtRxDone");
             // notification_message(mag->notifications, &sequence_success);
-            size_t len = furi_stream_buffer_receive(mag->uart_rx_stream, mag->uart_rx_buf, UART_RX_BUF_SIZE, 200);
+            size_t len = furi_stream_buffer_receive(
+                mag->uart_rx_stream, mag->uart_rx_buf, UART_RX_BUF_SIZE, 200);
             FURI_LOG_D(TAG, "UART RX len: %d", len);
-            
-            if (len > 0) {
+
+            if(len > 0) {
                 // If text box store gets too big, then truncate it
                 mag->uart_text_box_store_strlen += len;
 
                 if(mag->uart_text_box_store_strlen >= UART_TERMINAL_TEXT_BOX_STORE_SIZE - 1) {
-                    furi_string_right(mag->uart_text_box_store, mag->uart_text_box_store_strlen / 2);
-                    mag->uart_text_box_store_strlen = furi_string_size(mag->uart_text_box_store) + len;
+                    furi_string_right(
+                        mag->uart_text_box_store, mag->uart_text_box_store_strlen / 2);
+                    mag->uart_text_box_store_strlen =
+                        furi_string_size(mag->uart_text_box_store) + len;
                 }
 
                 // Add '\0' to the end of the string, and then add the new data
@@ -45,18 +49,16 @@ static int32_t uart_worker(void* context) {
                 furi_string_cat_printf(mag->uart_text_box_store, "%s", mag->uart_rx_buf);
 
                 FURI_LOG_D(TAG, "UART RX buf: %*.s", len, mag->uart_rx_buf);
-                FURI_LOG_D(TAG, "UART RX store: %s", furi_string_get_cstr(mag->uart_text_box_store));
-
+                FURI_LOG_D(
+                    TAG, "UART RX store: %s", furi_string_get_cstr(mag->uart_text_box_store));
             }
 
             FURI_LOG_D(TAG, "UARTEventRxData");
-            
-            view_dispatcher_send_custom_event(
-                mag->view_dispatcher, UARTEventRxData);
-            
+
+            view_dispatcher_send_custom_event(mag->view_dispatcher, UARTEventRxData);
         }
     }
-    
+
     furi_stream_buffer_free(mag->uart_rx_stream);
 
     return 0;
@@ -72,7 +74,8 @@ void update_widgets(Mag* mag) {
     widget_add_icon_element(mag->widget, 81, -1, &I_mag_file_10px);
 
     // Text box
-    widget_add_text_scroll_element(mag->widget, 0, 10, 128, 40, furi_string_get_cstr(mag->uart_text_box_store));
+    widget_add_text_scroll_element(
+        mag->widget, 0, 10, 128, 40, furi_string_get_cstr(mag->uart_text_box_store));
 
     // Buttons
     widget_add_button_element(mag->widget, GuiButtonTypeLeft, "Clear", mag_widget_callback, mag);
@@ -84,12 +87,11 @@ void mag_scene_read_on_enter(void* context) {
     FuriString* message = furi_string_alloc();
     furi_string_printf(message, "Please swipe a card!\n");
     mag->uart_text_box_store = message;
-    furi_string_free(message);
+
     view_dispatcher_switch_to_view(mag->view_dispatcher, MagViewWidget);
-    
+
     update_widgets(mag);
-    
-    
+
     // Initialize UART
     // furi_hal_console_disable();
     furi_hal_uart_deinit(FuriHalUartIdUSART1);
@@ -109,7 +111,7 @@ void mag_scene_read_on_enter(void* context) {
 
 bool mag_scene_read_on_event(void* context, SceneManagerEvent event) {
     Mag* mag = context;
-    
+
     bool consumed = false;
 
     if(event.type == SceneManagerEventTypeCustom) {
@@ -132,11 +134,16 @@ bool mag_scene_read_on_event(void* context, SceneManagerEvent event) {
             furi_string_reset(mag->uart_text_box_store);
             if(res) {
                 notification_message(mag->notifications, &sequence_success);
-                
-                furi_string_printf(mag->uart_text_box_store, "Track 1: %.*s\nTrack 2: %.*s\nTrack 3: %.*s",
-                    mag_dev->dev_data.track[0].len, furi_string_get_cstr(mag_dev->dev_data.track[0].str),
-                    mag_dev->dev_data.track[1].len, furi_string_get_cstr(mag_dev->dev_data.track[1].str),
-                    mag_dev->dev_data.track[2].len, furi_string_get_cstr(mag_dev->dev_data.track[2].str));
+
+                furi_string_printf(
+                    mag->uart_text_box_store,
+                    "Track 1: %.*s\nTrack 2: %.*s\nTrack 3: %.*s",
+                    mag_dev->dev_data.track[0].len,
+                    furi_string_get_cstr(mag_dev->dev_data.track[0].str),
+                    mag_dev->dev_data.track[1].len,
+                    furi_string_get_cstr(mag_dev->dev_data.track[1].str),
+                    mag_dev->dev_data.track[2].len,
+                    furi_string_get_cstr(mag_dev->dev_data.track[2].str));
 
                 // Switch to saved menu scene
                 scene_manager_next_scene(mag->scene_manager, MagSceneSavedMenu);
@@ -160,7 +167,7 @@ void mag_scene_read_on_exit(void* context) {
     // notification_message(mag->notifications, &sequence_blink_stop);
     widget_reset(mag->widget);
     // view_dispatcher_remove_view(mag->view_dispatcher, MagViewWidget);
-    
+
     // Stop UART worker
     FURI_LOG_D(TAG, "Stopping UART worker");
     furi_thread_flags_set(furi_thread_get_id(mag->uart_rx_thread), WorkerEvtStop);
@@ -173,6 +180,6 @@ void mag_scene_read_on_exit(void* context) {
     furi_hal_uart_set_irq_cb(FuriHalUartIdUSART1, NULL, NULL);
     furi_hal_uart_deinit(FuriHalUartIdUSART1);
     // furi_hal_console_enable();
-    
+
     notification_message(mag->notifications, &sequence_blink_stop);
-}
+}