Skip to content

Commit 5026eb0

Browse files
authored
Merge pull request #21 from xtruan/dev/reduce-fap-size
Reduce FAP size
2 parents 927f45d + b426b69 commit 5026eb0

35 files changed

+102
-452
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
- develop
88

99
env:
10-
firmware_version: '0.86.1'
10+
firmware_version: '0.88.0'
1111

1212
jobs:
1313
build:

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- 'v[0-9]+.[0-9]+.[0-9]+'
77

88
env:
9-
firmware_version: '0.86.1'
9+
firmware_version: '0.88.0'
1010

1111
jobs:
1212
build:

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[![Build](https://github.com/xtruan/FlipBIP/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/xtruan/FlipBIP/actions/workflows/build.yml)
44

55
## Crypto toolkit for Flipper Zero
6-
- Last built against `0.86.1` Flipper Zero firmware release
6+
- Last built against `0.88.0` Flipper Zero firmware release
77
- Using Trezor crypto libs from `core/v2.5.3` release
88
- Included in [RogueMaster Custom Firmware](https://github.com/RogueMaster/flipperzero-firmware-wPlugins)
99
- NOTE: This app uses very close to the maximum Flipper Zero RAM. If you get `furi_check failed` on launch, try running again!
@@ -43,7 +43,7 @@ The application will be compiled and copied onto your device
4343
- Generation of offline `m/44'/0'/0'/0` BTC wallet
4444
- Generation of offline `m/44'/60'/0'/0` ETH wallet (coded from the $SPORK Castle of ETHDenver 2023!)
4545
- Generation of offline `m/44'/3'/0'/0` DOGE wallet
46-
- Generation of offline `m/44'/133'/0'/0` ZEC transparent address wallet
46+
- Generation of offline `m/44'/133'/0'/0` ZEC transparent address wallet (by @wh00hw)
4747
- Similar features to: https://iancoleman.io/bip39/
4848
- Saving wallets to SD card
4949
- Wallets are saved to SD card upon creation in `apps_data/flipbip`

application.fam

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ App(
99
stack_size=3 * 1024,
1010
order=10,
1111
fap_icon="flipbip_10px.png",
12-
fap_icon_assets="icons",
13-
fap_icon_assets_symbol="flipbip",
1412
fap_private_libs=[
1513
Lib(
1614
name="crypto",
@@ -19,6 +17,6 @@ App(
1917
fap_category="Tools",
2018
fap_author="Struan Clark (xtruan)",
2119
fap_weburl="https://github.com/xtruan/FlipBIP",
22-
fap_version=(1, 12),
23-
fap_description="Crypto wallet tools for Flipper",
20+
fap_version=(1, 13),
21+
fap_description="Crypto wallet for Flipper",
2422
)

flipbip.c

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
#include "flipbip.h"
22
#include "helpers/flipbip_file.h"
3-
#include "helpers/flipbip_haptic.h"
43
// From: lib/crypto
54
#include <memzero.h>
65
#include <bip39.h>
76

7+
#define MNEMONIC_MENU_DEFAULT "Import mnemonic seed"
8+
#define MNEMONIC_MENU_SUCCESS "Import seed (success)"
9+
#define MNEMONIC_MENU_FAILURE "Import seed (failed!)"
10+
811
bool flipbip_custom_event_callback(void* context, uint32_t event) {
912
furi_assert(context);
1013
FlipBip* app = context;
@@ -40,6 +43,7 @@ static void text_input_callback(void* context) {
4043
// reset input state
4144
app->input_state = FlipBipTextInputDefault;
4245
handled = true;
46+
// switch back to settings view
4347
view_dispatcher_switch_to_view(app->view_dispatcher, FlipBipViewIdSettings);
4448
} else if(app->input_state == FlipBipTextInputMnemonic) {
4549
if(app->import_from_mnemonic == 1) {
@@ -54,11 +58,13 @@ static void text_input_callback(void* context) {
5458
status = FlipBipStatusSaveError; // 12 = save error
5559

5660
if(status == FlipBipStatusSuccess) {
61+
app->mnemonic_menu_text = MNEMONIC_MENU_SUCCESS;
5762
//notification_message(app->notification, &sequence_blink_cyan_100);
58-
flipbip_play_happy_bump(app);
63+
//flipbip_play_happy_bump(app);
5964
} else {
65+
app->mnemonic_menu_text = MNEMONIC_MENU_FAILURE;
6066
//notification_message(app->notification, &sequence_blink_red_100);
61-
flipbip_play_long_bump(app);
67+
//flipbip_play_long_bump(app);
6268
}
6369

6470
memzero(app->import_mnemonic_text, TEXT_BUFFER_SIZE);
@@ -68,7 +74,9 @@ static void text_input_callback(void* context) {
6874
// reset input state
6975
app->input_state = FlipBipTextInputDefault;
7076
handled = true;
71-
view_dispatcher_switch_to_view(app->view_dispatcher, FlipBipViewIdMenu);
77+
// exit scene 1 instance that's being used for text input and go back to menu
78+
scene_manager_previous_scene(app->scene_manager);
79+
//view_dispatcher_switch_to_view(app->view_dispatcher, FlipBipViewIdMenu);
7280
}
7381
}
7482

@@ -77,19 +85,20 @@ static void text_input_callback(void* context) {
7785
memzero(app->input_text, TEXT_BUFFER_SIZE);
7886
// reset input state
7987
app->input_state = FlipBipTextInputDefault;
88+
// something went wrong, switch to menu view
8089
view_dispatcher_switch_to_view(app->view_dispatcher, FlipBipViewIdMenu);
8190
}
8291
}
8392

8493
FlipBip* flipbip_app_alloc() {
8594
FlipBip* app = malloc(sizeof(FlipBip));
8695
app->gui = furi_record_open(RECORD_GUI);
87-
app->notification = furi_record_open(RECORD_NOTIFICATION);
96+
//app->notification = furi_record_open(RECORD_NOTIFICATION);
8897

89-
//Turn backlight on, believe me this makes testing your app easier
90-
notification_message(app->notification, &sequence_display_backlight_on);
98+
// Turn backlight on, believe me this makes testing your app easier
99+
//notification_message(app->notification, &sequence_display_backlight_on);
91100

92-
//Scene additions
101+
// Scene additions
93102
app->view_dispatcher = view_dispatcher_alloc();
94103
view_dispatcher_enable_queue(app->view_dispatcher);
95104

@@ -103,26 +112,20 @@ FlipBip* flipbip_app_alloc() {
103112
app->submenu = submenu_alloc();
104113

105114
// Settings
106-
app->haptic = FlipBipHapticOn;
107-
app->led = FlipBipLedOn;
108115
app->bip39_strength = FlipBipStrength256; // 256 bits (24 words)
109116
app->passphrase = FlipBipPassphraseOff;
110117

111118
// Main menu
112119
app->bip44_coin = FlipBipCoinBTC0; // 0 (BTC)
113120
app->overwrite_saved_seed = 0;
114121
app->import_from_mnemonic = 0;
122+
app->mnemonic_menu_text = MNEMONIC_MENU_DEFAULT;
115123

116124
// Text input
117125
app->input_state = FlipBipTextInputDefault;
118126

119127
view_dispatcher_add_view(
120128
app->view_dispatcher, FlipBipViewIdMenu, submenu_get_view(app->submenu));
121-
app->flipbip_startscreen = flipbip_startscreen_alloc();
122-
view_dispatcher_add_view(
123-
app->view_dispatcher,
124-
FlipBipViewIdStartscreen,
125-
flipbip_startscreen_get_view(app->flipbip_startscreen));
126129
app->flipbip_scene_1 = flipbip_scene_1_alloc();
127130
view_dispatcher_add_view(
128131
app->view_dispatcher, FlipBipViewIdScene1, flipbip_scene_1_get_view(app->flipbip_scene_1));
@@ -139,13 +142,13 @@ FlipBip* flipbip_app_alloc() {
139142
(void*)app,
140143
app->input_text,
141144
TEXT_BUFFER_SIZE,
142-
//clear default text
145+
// clear default text
143146
true);
144-
text_input_set_header_text(app->text_input, "Input");
147+
//text_input_set_header_text(app->text_input, "Input");
145148
view_dispatcher_add_view(
146149
app->view_dispatcher, FlipBipViewIdTextInput, text_input_get_view(app->text_input));
147150

148-
//End Scene Additions
151+
// End Scene Additions
149152

150153
return app;
151154
}
@@ -169,7 +172,7 @@ void flipbip_app_free(FlipBip* app) {
169172
furi_record_close(RECORD_GUI);
170173

171174
app->gui = NULL;
172-
app->notification = NULL;
175+
//app->notification = NULL;
173176

174177
//Remove whatever is left
175178
memzero(app, sizeof(FlipBip));
@@ -188,9 +191,7 @@ int32_t flipbip_app(void* p) {
188191

189192
view_dispatcher_attach_to_gui(app->view_dispatcher, app->gui, ViewDispatcherTypeFullscreen);
190193

191-
scene_manager_next_scene(
192-
app->scene_manager, FlipBipSceneStartscreen); //Start with start screen
193-
//scene_manager_next_scene(app->scene_manager, FlipBipSceneMenu); //if you want to directly start with Menu
194+
scene_manager_next_scene(app->scene_manager, FlipBipSceneMenu); //Start with menu
194195

195196
furi_hal_power_suppress_charge_enter();
196197

flipbip.h

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,16 @@
55
#include <gui/gui.h>
66
#include <input/input.h>
77
#include <stdlib.h>
8-
#include <notification/notification_messages.h>
8+
//#include <notification/notification_messages.h>
99
#include <gui/view_dispatcher.h>
1010
#include <gui/modules/submenu.h>
1111
#include <gui/scene_manager.h>
1212
#include <gui/modules/variable_item_list.h>
1313
#include <gui/modules/text_input.h>
1414
#include "scenes/flipbip_scene.h"
15-
#include "views/flipbip_startscreen.h"
1615
#include "views/flipbip_scene_1.h"
1716

18-
#define FLIPBIP_VERSION "v1.12.0"
17+
#define FLIPBIP_VERSION "v1.13"
1918

2019
#define COIN_BTC 0
2120
#define COIN_DOGE 3
@@ -26,17 +25,15 @@
2625

2726
typedef struct {
2827
Gui* gui;
29-
NotificationApp* notification;
28+
// NotificationApp* notification;
3029
ViewDispatcher* view_dispatcher;
3130
Submenu* submenu;
3231
SceneManager* scene_manager;
3332
VariableItemList* variable_item_list;
3433
TextInput* text_input;
35-
FlipBipStartscreen* flipbip_startscreen;
3634
FlipBipScene1* flipbip_scene_1;
35+
char* mnemonic_menu_text;
3736
// Settings options
38-
int haptic;
39-
int led;
4037
int bip39_strength;
4138
int passphrase;
4239
// Main menu options
@@ -58,16 +55,6 @@ typedef enum {
5855
FlipBipViewIdTextInput,
5956
} FlipBipViewId;
6057

61-
typedef enum {
62-
FlipBipHapticOff,
63-
FlipBipHapticOn,
64-
} FlipBipHapticState;
65-
66-
typedef enum {
67-
FlipBipLedOff,
68-
FlipBipLedOn,
69-
} FlipBipLedState;
70-
7158
typedef enum {
7259
FlipBipStrength128,
7360
FlipBipStrength192,

helpers/flipbip_custom_event.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
#pragma once
22

33
typedef enum {
4-
FlipBipCustomEventStartscreenUp,
5-
FlipBipCustomEventStartscreenDown,
6-
FlipBipCustomEventStartscreenLeft,
7-
FlipBipCustomEventStartscreenRight,
8-
FlipBipCustomEventStartscreenOk,
9-
FlipBipCustomEventStartscreenBack,
104
FlipBipCustomEventScene1Up,
115
FlipBipCustomEventScene1Down,
126
FlipBipCustomEventScene1Left,

helpers/flipbip_haptic.c

Lines changed: 0 additions & 35 deletions
This file was deleted.

helpers/flipbip_haptic.h

Lines changed: 0 additions & 7 deletions
This file was deleted.

helpers/flipbip_led.c

Lines changed: 0 additions & 39 deletions
This file was deleted.

0 commit comments

Comments
 (0)