Przeglądaj źródła

feat: fixes from Momentum

Struan 1 rok temu
rodzic
commit
6c08905ab9

+ 1 - 1
.github/workflows/build.yml

@@ -7,7 +7,7 @@ on:
       - develop
       - develop
 
 
 env:
 env:
-  firmware_version: '0.88.0'
+  firmware_version: '0.101.2'
 
 
 jobs:
 jobs:
   build:
   build:

+ 1 - 1
.github/workflows/release.yml

@@ -6,7 +6,7 @@ on:
       - 'v[0-9]+.[0-9]+.[0-9]+'
       - 'v[0-9]+.[0-9]+.[0-9]+'
 
 
 env:
 env:
-  firmware_version: '0.88.0'
+  firmware_version: '0.101.2'
 
 
 jobs:
 jobs:
   build:
   build:

+ 2 - 2
.github/workflows/ufbt_build.yml

@@ -1,4 +1,4 @@
-name: "FAP: Build for multiple SDK sources"
+name: "uFBT Build"
 on:
 on:
   push:
   push:
     branches: 
     branches: 
@@ -32,4 +32,4 @@ jobs:
         uses: actions/upload-artifact@v3
         uses: actions/upload-artifact@v3
         with:
         with:
           name: ${{ github.event.repository.name }}-${{ steps.build-app.outputs.suffix }}
           name: ${{ github.event.repository.name }}-${{ steps.build-app.outputs.suffix }}
-          path: ${{ steps.build-app.outputs.fap-artifacts }}
+          path: ${{ steps.build-app.outputs.fap-artifacts }}

+ 2 - 3
README.md

@@ -3,9 +3,8 @@
 [![Build](https://github.com/xtruan/FlipBIP/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/xtruan/FlipBIP/actions/workflows/build.yml)
 [![Build](https://github.com/xtruan/FlipBIP/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/xtruan/FlipBIP/actions/workflows/build.yml)
 
 
 ## Crypto toolkit for Flipper Zero
 ## Crypto toolkit for Flipper Zero
-- Last built against `0.88.0` Flipper Zero firmware release
+- Last built against `0.101.2` Flipper Zero firmware release
 - Using Trezor crypto libs from `core/v2.5.3` release
 - Using Trezor crypto libs from `core/v2.5.3` release
-- Included in [RogueMaster Custom Firmware](https://github.com/RogueMaster/flipperzero-firmware-wPlugins)
 - NOTE: This app uses very close to the maximum Flipper Zero RAM. If you get `furi_check failed` on launch, try running again!
 - NOTE: This app uses very close to the maximum Flipper Zero RAM. If you get `furi_check failed` on launch, try running again!
 
 
 ### DONATE IF YOU FIND THE APP USEFUL
 ### DONATE IF YOU FIND THE APP USEFUL
@@ -63,7 +62,7 @@ The application will be compiled and copied onto your device
   - Addresses are now generated at the same time as other pieces of wallet info
   - Addresses are now generated at the same time as other pieces of wallet info
     - This slows down initial wallet load, but makes UI much more responsive
     - This slows down initial wallet load, but makes UI much more responsive
   - QR code files are now generated for each address and stored in the `apps_data/flipbip` directory
   - QR code files are now generated for each address and stored in the `apps_data/flipbip` directory
-    - This app is required to view the QR code files: https://github.com/bmatcuk/flipperzero-qrcode (included in RM firmware)
+    - This app is required to view the QR code files: https://github.com/bmatcuk/flipperzero-qrcode
     - NOTE: This happens during the `View Wallet` step; you must view a wallet after generating/importing a wallet in order to ensure the address QR files are correct
     - NOTE: This happens during the `View Wallet` step; you must view a wallet after generating/importing a wallet in order to ensure the address QR files are correct
 - Broke out crypto functionality into its own library using `fap_private_libs` feature
 - Broke out crypto functionality into its own library using `fap_private_libs` feature
 
 

+ 3 - 3
flipbip.c

@@ -102,8 +102,7 @@ static void flipbip_scene_renew_dialog_callback(DialogExResult result, void* con
 static void flipbip_wallet_create(void* context) {
 static void flipbip_wallet_create(void* context) {
     FlipBip* app = context;
     FlipBip* app = context;
     furi_assert(app);
     furi_assert(app);
-    scene_manager_set_scene_state(
-        app->scene_manager, FlipBipSceneMenu, SubmenuIndexScene1New);
+    scene_manager_set_scene_state(app->scene_manager, FlipBipSceneMenu, SubmenuIndexScene1New);
     scene_manager_next_scene(app->scene_manager, FlipBipSceneScene_1);
     scene_manager_next_scene(app->scene_manager, FlipBipSceneScene_1);
 }
 }
 
 
@@ -171,7 +170,8 @@ FlipBip* flipbip_app_alloc() {
     dialog_ex_set_context(app->renew_dialog, app);
     dialog_ex_set_context(app->renew_dialog, app);
     dialog_ex_set_left_button_text(app->renew_dialog, "No");
     dialog_ex_set_left_button_text(app->renew_dialog, "No");
     dialog_ex_set_right_button_text(app->renew_dialog, "Yes");
     dialog_ex_set_right_button_text(app->renew_dialog, "Yes");
-    dialog_ex_set_header(app->renew_dialog, "Current wallet\nWill be lost.\nProceed?", 16, 12, AlignLeft, AlignTop);
+    dialog_ex_set_header(
+        app->renew_dialog, "Current wallet\nWill be lost.\nProceed?", 16, 12, AlignLeft, AlignTop);
     view_dispatcher_add_view(
     view_dispatcher_add_view(
         app->view_dispatcher, FlipBipViewRenewConfirm, dialog_ex_get_view(app->renew_dialog));
         app->view_dispatcher, FlipBipViewRenewConfirm, dialog_ex_get_view(app->renew_dialog));
 
 

+ 1 - 3
flipbip.h

@@ -24,8 +24,6 @@
 
 
 #define TEXT_BUFFER_SIZE 256
 #define TEXT_BUFFER_SIZE 256
 
 
-
-
 typedef struct {
 typedef struct {
     Gui* gui;
     Gui* gui;
     // NotificationApp* notification;
     // NotificationApp* notification;
@@ -50,7 +48,7 @@ typedef struct {
     char import_mnemonic_text[TEXT_BUFFER_SIZE];
     char import_mnemonic_text[TEXT_BUFFER_SIZE];
     char input_text[TEXT_BUFFER_SIZE];
     char input_text[TEXT_BUFFER_SIZE];
 
 
-    void (* wallet_create)(void* context);
+    void (*wallet_create)(void* context);
 } FlipBip;
 } FlipBip;
 
 
 typedef enum {
 typedef enum {

+ 3 - 3
helpers/flipbip_file.c

@@ -39,12 +39,12 @@ bool flipbip_load_file(
     const char* file_name) {
     const char* file_name) {
     bool ret = false;
     bool ret = false;
     const char* path;
     const char* path;
+    char path_buf[FILE_MAX_PATH_LEN] = {0};
     if(file_type == FlipBipFileKey) {
     if(file_type == FlipBipFileKey) {
         path = FLIPBIP_KEY_PATH;
         path = FLIPBIP_KEY_PATH;
     } else if(file_type == FlipBipFileDat) {
     } else if(file_type == FlipBipFileDat) {
         path = FLIPBIP_DAT_PATH;
         path = FLIPBIP_DAT_PATH;
     } else {
     } else {
-        char path_buf[FILE_MAX_PATH_LEN] = {0};
         strcpy(path_buf, FLIPBIP_APP_BASE_FOLDER); // 22
         strcpy(path_buf, FLIPBIP_APP_BASE_FOLDER); // 22
         strcpy(path_buf + strlen(path_buf), "/");
         strcpy(path_buf + strlen(path_buf), "/");
         strcpy(path_buf + strlen(path_buf), file_name);
         strcpy(path_buf + strlen(path_buf), file_name);
@@ -96,12 +96,12 @@ bool flipbip_load_file(
 bool flipbip_has_file(const FlipBipFile file_type, const char* file_name, const bool remove) {
 bool flipbip_has_file(const FlipBipFile file_type, const char* file_name, const bool remove) {
     bool ret = false;
     bool ret = false;
     const char* path;
     const char* path;
+    char path_buf[FILE_MAX_PATH_LEN] = {0};
     if(file_type == FlipBipFileKey) {
     if(file_type == FlipBipFileKey) {
         path = FLIPBIP_KEY_PATH;
         path = FLIPBIP_KEY_PATH;
     } else if(file_type == FlipBipFileDat) {
     } else if(file_type == FlipBipFileDat) {
         path = FLIPBIP_DAT_PATH;
         path = FLIPBIP_DAT_PATH;
     } else {
     } else {
-        char path_buf[FILE_MAX_PATH_LEN] = {0};
         strcpy(path_buf, FLIPBIP_APP_BASE_FOLDER); // 22
         strcpy(path_buf, FLIPBIP_APP_BASE_FOLDER); // 22
         strcpy(path_buf + strlen(path_buf), "/");
         strcpy(path_buf + strlen(path_buf), "/");
         strcpy(path_buf + strlen(path_buf), file_name);
         strcpy(path_buf + strlen(path_buf), file_name);
@@ -127,6 +127,7 @@ bool flipbip_save_file(
     bool ret = false;
     bool ret = false;
     const char* path;
     const char* path;
     const char* path_bak;
     const char* path_bak;
+    char path_buf[FILE_MAX_PATH_LEN] = {0};
     if(file_type == FlipBipFileKey) {
     if(file_type == FlipBipFileKey) {
         path = FLIPBIP_KEY_PATH;
         path = FLIPBIP_KEY_PATH;
         path_bak = FLIPBIP_KEY_PATH_BAK;
         path_bak = FLIPBIP_KEY_PATH_BAK;
@@ -134,7 +135,6 @@ bool flipbip_save_file(
         path = FLIPBIP_DAT_PATH;
         path = FLIPBIP_DAT_PATH;
         path_bak = FLIPBIP_DAT_PATH_BAK;
         path_bak = FLIPBIP_DAT_PATH_BAK;
     } else {
     } else {
-        char path_buf[FILE_MAX_PATH_LEN] = {0};
         strcpy(path_buf, FLIPBIP_APP_BASE_FOLDER); // 22
         strcpy(path_buf, FLIPBIP_APP_BASE_FOLDER); // 22
         strcpy(path_buf + strlen(path_buf), "/");
         strcpy(path_buf + strlen(path_buf), "/");
         strcpy(path_buf + strlen(path_buf), file_name);
         strcpy(path_buf + strlen(path_buf), file_name);

+ 1 - 1
lib/crypto/base32.c

@@ -51,7 +51,7 @@ char* base32_encode(
         int ret = base32_encode_character(out[i], alphabet);
         int ret = base32_encode_character(out[i], alphabet);
 
 
         if(ret == -1) {
         if(ret == -1) {
-            return false;
+            return NULL;
         } else {
         } else {
             out[i] = ret;
             out[i] = ret;
         }
         }