From 6c08905ab9c228395341478d21af2bf2c4903585 Mon Sep 17 00:00:00 2001 From: Struan Date: Sun, 19 May 2024 23:09:25 -0600 Subject: [PATCH 1/2] feat: fixes from Momentum --- .github/workflows/build.yml | 2 +- .github/workflows/release.yml | 2 +- .github/workflows/ufbt_build.yml | 4 ++-- README.md | 5 ++--- flipbip.c | 6 +++--- flipbip.h | 4 +--- helpers/flipbip_file.c | 6 +++--- lib/crypto/base32.c | 2 +- 8 files changed, 14 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bfbdf498a3a..084f6278fe8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,7 +7,7 @@ on: - develop env: - firmware_version: '0.88.0' + firmware_version: '0.101.2' jobs: build: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8e9d151870d..1c31b9fc90c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,7 +6,7 @@ on: - 'v[0-9]+.[0-9]+.[0-9]+' env: - firmware_version: '0.88.0' + firmware_version: '0.101.2' jobs: build: diff --git a/.github/workflows/ufbt_build.yml b/.github/workflows/ufbt_build.yml index 411cbffc421..202b525f8fe 100644 --- a/.github/workflows/ufbt_build.yml +++ b/.github/workflows/ufbt_build.yml @@ -1,4 +1,4 @@ -name: "FAP: Build for multiple SDK sources" +name: "uFBT Build" on: push: branches: @@ -32,4 +32,4 @@ jobs: uses: actions/upload-artifact@v3 with: name: ${{ github.event.repository.name }}-${{ steps.build-app.outputs.suffix }} - path: ${{ steps.build-app.outputs.fap-artifacts }} + path: ${{ steps.build-app.outputs.fap-artifacts }} \ No newline at end of file diff --git a/README.md b/README.md index 8dc5b0518fe..0421111ccf3 100644 --- a/README.md +++ b/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) ## 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 -- 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! ### 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 - 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 - - 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 - Broke out crypto functionality into its own library using `fap_private_libs` feature diff --git a/flipbip.c b/flipbip.c index 46904592da4..90abfb51342 100644 --- a/flipbip.c +++ b/flipbip.c @@ -102,8 +102,7 @@ static void flipbip_scene_renew_dialog_callback(DialogExResult result, void* con static void flipbip_wallet_create(void* context) { FlipBip* app = context; 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); } @@ -171,7 +170,8 @@ FlipBip* flipbip_app_alloc() { dialog_ex_set_context(app->renew_dialog, app); dialog_ex_set_left_button_text(app->renew_dialog, "No"); 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( app->view_dispatcher, FlipBipViewRenewConfirm, dialog_ex_get_view(app->renew_dialog)); diff --git a/flipbip.h b/flipbip.h index 573ef05888f..12d9104970a 100644 --- a/flipbip.h +++ b/flipbip.h @@ -24,8 +24,6 @@ #define TEXT_BUFFER_SIZE 256 - - typedef struct { Gui* gui; // NotificationApp* notification; @@ -50,7 +48,7 @@ typedef struct { char import_mnemonic_text[TEXT_BUFFER_SIZE]; char input_text[TEXT_BUFFER_SIZE]; - void (* wallet_create)(void* context); + void (*wallet_create)(void* context); } FlipBip; typedef enum { diff --git a/helpers/flipbip_file.c b/helpers/flipbip_file.c index f3f0ab59050..9e1e57536c5 100644 --- a/helpers/flipbip_file.c +++ b/helpers/flipbip_file.c @@ -39,12 +39,12 @@ bool flipbip_load_file( const char* file_name) { bool ret = false; const char* path; + char path_buf[FILE_MAX_PATH_LEN] = {0}; if(file_type == FlipBipFileKey) { path = FLIPBIP_KEY_PATH; } else if(file_type == FlipBipFileDat) { path = FLIPBIP_DAT_PATH; } else { - char path_buf[FILE_MAX_PATH_LEN] = {0}; strcpy(path_buf, FLIPBIP_APP_BASE_FOLDER); // 22 strcpy(path_buf + strlen(path_buf), "/"); 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 ret = false; const char* path; + char path_buf[FILE_MAX_PATH_LEN] = {0}; if(file_type == FlipBipFileKey) { path = FLIPBIP_KEY_PATH; } else if(file_type == FlipBipFileDat) { path = FLIPBIP_DAT_PATH; } else { - char path_buf[FILE_MAX_PATH_LEN] = {0}; strcpy(path_buf, FLIPBIP_APP_BASE_FOLDER); // 22 strcpy(path_buf + strlen(path_buf), "/"); strcpy(path_buf + strlen(path_buf), file_name); @@ -127,6 +127,7 @@ bool flipbip_save_file( bool ret = false; const char* path; const char* path_bak; + char path_buf[FILE_MAX_PATH_LEN] = {0}; if(file_type == FlipBipFileKey) { path = FLIPBIP_KEY_PATH; path_bak = FLIPBIP_KEY_PATH_BAK; @@ -134,7 +135,6 @@ bool flipbip_save_file( path = FLIPBIP_DAT_PATH; path_bak = FLIPBIP_DAT_PATH_BAK; } else { - char path_buf[FILE_MAX_PATH_LEN] = {0}; strcpy(path_buf, FLIPBIP_APP_BASE_FOLDER); // 22 strcpy(path_buf + strlen(path_buf), "/"); strcpy(path_buf + strlen(path_buf), file_name); diff --git a/lib/crypto/base32.c b/lib/crypto/base32.c index e211bb308f0..4053c34b3c4 100644 --- a/lib/crypto/base32.c +++ b/lib/crypto/base32.c @@ -51,7 +51,7 @@ char* base32_encode( int ret = base32_encode_character(out[i], alphabet); if(ret == -1) { - return false; + return NULL; } else { out[i] = ret; } From a9b4eadaa2ad775ead09cec8eb0987704640acc2 Mon Sep 17 00:00:00 2001 From: Struan Date: Sun, 19 May 2024 23:14:05 -0600 Subject: [PATCH 2/2] chore: bump version --- application.fam | 2 +- flipbip.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/application.fam b/application.fam index c7d67e3f927..f2da63744d1 100644 --- a/application.fam +++ b/application.fam @@ -17,6 +17,6 @@ App( fap_category="Tools", fap_author="Struan Clark (xtruan)", fap_weburl="https://github.com/xtruan/FlipBIP", - fap_version=(1, 14), + fap_version=(1, 15), fap_description="Crypto wallet for Flipper", ) diff --git a/flipbip.h b/flipbip.h index 12d9104970a..4107f4bc33a 100644 --- a/flipbip.h +++ b/flipbip.h @@ -15,7 +15,7 @@ #include "scenes/flipbip_scene.h" #include "views/flipbip_scene_1.h" -#define FLIPBIP_VERSION "v1.14" +#define FLIPBIP_VERSION "v1.15" #define COIN_BTC 0 #define COIN_DOGE 3