mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-13 20:08:36 -07:00
feat: 1.14 update
This commit is contained in:
@@ -7,6 +7,7 @@ App(
|
|||||||
"gui",
|
"gui",
|
||||||
],
|
],
|
||||||
stack_size=3 * 1024,
|
stack_size=3 * 1024,
|
||||||
|
order=10,
|
||||||
fap_icon="flipbip_10px.png",
|
fap_icon="flipbip_10px.png",
|
||||||
fap_private_libs=[
|
fap_private_libs=[
|
||||||
Lib(
|
Lib(
|
||||||
@@ -16,6 +17,6 @@ App(
|
|||||||
fap_category="Tools",
|
fap_category="Tools",
|
||||||
fap_author="Struan Clark (xtruan)",
|
fap_author="Struan Clark (xtruan)",
|
||||||
fap_weburl="https://github.com/xtruan/FlipBIP",
|
fap_weburl="https://github.com/xtruan/FlipBIP",
|
||||||
fap_version=(1, 13),
|
fap_version=(1, 14),
|
||||||
fap_description="Crypto wallet for Flipper",
|
fap_description="Crypto wallet for Flipper",
|
||||||
)
|
)
|
||||||
|
|||||||
30
applications/external/flipbip/flipbip.c
vendored
30
applications/external/flipbip/flipbip.c
vendored
@@ -90,6 +90,23 @@ static void text_input_callback(void* context) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void flipbip_scene_renew_dialog_callback(DialogExResult result, void* context) {
|
||||||
|
FlipBip* app = context;
|
||||||
|
if(result == DialogExResultRight) {
|
||||||
|
app->wallet_create(app);
|
||||||
|
} else {
|
||||||
|
view_dispatcher_switch_to_view(app->view_dispatcher, FlipBipViewIdMenu);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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_next_scene(app->scene_manager, FlipBipSceneScene_1);
|
||||||
|
}
|
||||||
|
|
||||||
FlipBip* flipbip_app_alloc() {
|
FlipBip* flipbip_app_alloc() {
|
||||||
FlipBip* app = malloc(sizeof(FlipBip));
|
FlipBip* app = malloc(sizeof(FlipBip));
|
||||||
app->gui = furi_record_open(RECORD_GUI);
|
app->gui = furi_record_open(RECORD_GUI);
|
||||||
@@ -148,6 +165,16 @@ FlipBip* flipbip_app_alloc() {
|
|||||||
view_dispatcher_add_view(
|
view_dispatcher_add_view(
|
||||||
app->view_dispatcher, FlipBipViewIdTextInput, text_input_get_view(app->text_input));
|
app->view_dispatcher, FlipBipViewIdTextInput, text_input_get_view(app->text_input));
|
||||||
|
|
||||||
|
app->wallet_create = flipbip_wallet_create;
|
||||||
|
app->renew_dialog = dialog_ex_alloc();
|
||||||
|
dialog_ex_set_result_callback(app->renew_dialog, flipbip_scene_renew_dialog_callback);
|
||||||
|
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);
|
||||||
|
view_dispatcher_add_view(
|
||||||
|
app->view_dispatcher, FlipBipViewRenewConfirm, dialog_ex_get_view(app->renew_dialog));
|
||||||
|
|
||||||
// End Scene Additions
|
// End Scene Additions
|
||||||
|
|
||||||
return app;
|
return app;
|
||||||
@@ -168,6 +195,9 @@ void flipbip_app_free(FlipBip* app) {
|
|||||||
view_dispatcher_remove_view(app->view_dispatcher, FlipBipViewIdTextInput);
|
view_dispatcher_remove_view(app->view_dispatcher, FlipBipViewIdTextInput);
|
||||||
submenu_free(app->submenu);
|
submenu_free(app->submenu);
|
||||||
|
|
||||||
|
view_dispatcher_remove_view(app->view_dispatcher, FlipBipViewRenewConfirm);
|
||||||
|
dialog_ex_free(app->renew_dialog);
|
||||||
|
|
||||||
view_dispatcher_free(app->view_dispatcher);
|
view_dispatcher_free(app->view_dispatcher);
|
||||||
furi_record_close(RECORD_GUI);
|
furi_record_close(RECORD_GUI);
|
||||||
|
|
||||||
|
|||||||
21
applications/external/flipbip/flipbip.h
vendored
21
applications/external/flipbip/flipbip.h
vendored
@@ -9,12 +9,13 @@
|
|||||||
#include <gui/view_dispatcher.h>
|
#include <gui/view_dispatcher.h>
|
||||||
#include <gui/modules/submenu.h>
|
#include <gui/modules/submenu.h>
|
||||||
#include <gui/scene_manager.h>
|
#include <gui/scene_manager.h>
|
||||||
|
#include <gui/modules/dialog_ex.h>
|
||||||
#include <gui/modules/variable_item_list.h>
|
#include <gui/modules/variable_item_list.h>
|
||||||
#include <gui/modules/text_input.h>
|
#include <gui/modules/text_input.h>
|
||||||
#include "scenes/flipbip_scene.h"
|
#include "scenes/flipbip_scene.h"
|
||||||
#include "views/flipbip_scene_1.h"
|
#include "views/flipbip_scene_1.h"
|
||||||
|
|
||||||
#define FLIPBIP_VERSION "v1.13"
|
#define FLIPBIP_VERSION "v1.14"
|
||||||
|
|
||||||
#define COIN_BTC 0
|
#define COIN_BTC 0
|
||||||
#define COIN_DOGE 3
|
#define COIN_DOGE 3
|
||||||
@@ -23,6 +24,8 @@
|
|||||||
|
|
||||||
#define TEXT_BUFFER_SIZE 256
|
#define TEXT_BUFFER_SIZE 256
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
Gui* gui;
|
Gui* gui;
|
||||||
// NotificationApp* notification;
|
// NotificationApp* notification;
|
||||||
@@ -31,6 +34,7 @@ typedef struct {
|
|||||||
SceneManager* scene_manager;
|
SceneManager* scene_manager;
|
||||||
VariableItemList* variable_item_list;
|
VariableItemList* variable_item_list;
|
||||||
TextInput* text_input;
|
TextInput* text_input;
|
||||||
|
DialogEx* renew_dialog;
|
||||||
FlipBipScene1* flipbip_scene_1;
|
FlipBipScene1* flipbip_scene_1;
|
||||||
char* mnemonic_menu_text;
|
char* mnemonic_menu_text;
|
||||||
// Settings options
|
// Settings options
|
||||||
@@ -45,6 +49,8 @@ typedef struct {
|
|||||||
char passphrase_text[TEXT_BUFFER_SIZE];
|
char passphrase_text[TEXT_BUFFER_SIZE];
|
||||||
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);
|
||||||
} FlipBip;
|
} FlipBip;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
@@ -53,6 +59,7 @@ typedef enum {
|
|||||||
FlipBipViewIdScene1,
|
FlipBipViewIdScene1,
|
||||||
FlipBipViewIdSettings,
|
FlipBipViewIdSettings,
|
||||||
FlipBipViewIdTextInput,
|
FlipBipViewIdTextInput,
|
||||||
|
FlipBipViewRenewConfirm,
|
||||||
} FlipBipViewId;
|
} FlipBipViewId;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
@@ -86,3 +93,15 @@ typedef enum {
|
|||||||
FlipBipStatusSaveError = 12,
|
FlipBipStatusSaveError = 12,
|
||||||
FlipBipStatusMnemonicCheckError = 13,
|
FlipBipStatusMnemonicCheckError = 13,
|
||||||
} FlipBipStatus;
|
} FlipBipStatus;
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
SubmenuIndexScene1BTC = 10,
|
||||||
|
SubmenuIndexScene1ETH,
|
||||||
|
SubmenuIndexScene1DOGE,
|
||||||
|
SubmenuIndexScene1ZEC,
|
||||||
|
SubmenuIndexScene1New,
|
||||||
|
SubmenuIndexScene1Renew,
|
||||||
|
SubmenuIndexScene1Import,
|
||||||
|
SubmenuIndexSettings,
|
||||||
|
SubmenuIndexNOP,
|
||||||
|
} SubmenuIndex;
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 6.1 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 6.1 KiB |
@@ -3,18 +3,8 @@
|
|||||||
|
|
||||||
#define FLIPBIP_SUBMENU_TEXT "** FlipBIP wallet " FLIPBIP_VERSION " **"
|
#define FLIPBIP_SUBMENU_TEXT "** FlipBIP wallet " FLIPBIP_VERSION " **"
|
||||||
|
|
||||||
enum SubmenuIndex {
|
|
||||||
SubmenuIndexScene1BTC = 10,
|
|
||||||
SubmenuIndexScene1ETH,
|
|
||||||
SubmenuIndexScene1DOGE,
|
|
||||||
SubmenuIndexScene1ZEC,
|
|
||||||
SubmenuIndexScene1New,
|
|
||||||
SubmenuIndexScene1Import,
|
|
||||||
SubmenuIndexSettings,
|
|
||||||
SubmenuIndexNOP,
|
|
||||||
};
|
|
||||||
|
|
||||||
void flipbip_scene_menu_submenu_callback(void* context, uint32_t index) {
|
void flipbip_scene_menu_submenu_callback(void* context, uint32_t index) {
|
||||||
|
furi_assert(context);
|
||||||
FlipBip* app = context;
|
FlipBip* app = context;
|
||||||
view_dispatcher_send_custom_event(app->view_dispatcher, index);
|
view_dispatcher_send_custom_event(app->view_dispatcher, index);
|
||||||
}
|
}
|
||||||
@@ -59,7 +49,7 @@ void flipbip_scene_menu_on_enter(void* context) {
|
|||||||
submenu_add_item(
|
submenu_add_item(
|
||||||
app->submenu,
|
app->submenu,
|
||||||
"Regenerate wallet",
|
"Regenerate wallet",
|
||||||
SubmenuIndexScene1New,
|
SubmenuIndexScene1Renew,
|
||||||
flipbip_scene_menu_submenu_callback,
|
flipbip_scene_menu_submenu_callback,
|
||||||
app);
|
app);
|
||||||
} else {
|
} else {
|
||||||
@@ -130,9 +120,12 @@ bool flipbip_scene_menu_on_event(void* context, SceneManagerEvent event) {
|
|||||||
} else if(event.event == SubmenuIndexScene1New) {
|
} else if(event.event == SubmenuIndexScene1New) {
|
||||||
app->overwrite_saved_seed = 1;
|
app->overwrite_saved_seed = 1;
|
||||||
app->import_from_mnemonic = 0;
|
app->import_from_mnemonic = 0;
|
||||||
scene_manager_set_scene_state(
|
app->wallet_create(app);
|
||||||
app->scene_manager, FlipBipSceneMenu, SubmenuIndexScene1New);
|
return true;
|
||||||
scene_manager_next_scene(app->scene_manager, FlipBipSceneScene_1);
|
} else if(event.event == SubmenuIndexScene1Renew) {
|
||||||
|
app->overwrite_saved_seed = 1;
|
||||||
|
app->import_from_mnemonic = 0;
|
||||||
|
view_dispatcher_switch_to_view(app->view_dispatcher, FlipBipViewRenewConfirm);
|
||||||
return true;
|
return true;
|
||||||
} else if(event.event == SubmenuIndexScene1Import) {
|
} else if(event.event == SubmenuIndexScene1Import) {
|
||||||
app->import_from_mnemonic = 1;
|
app->import_from_mnemonic = 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user