mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-04-24 03:29:57 -07:00
Auto unlock rpc for u2f
This commit is contained in:
@@ -25,31 +25,6 @@ void u2f_scene_error_on_enter(void* context) {
|
|||||||
"No SD card or\napp data found.\nThis app will not\nwork without\nrequired files.");
|
"No SD card or\napp data found.\nThis app will not\nwork without\nrequired files.");
|
||||||
widget_add_button_element(
|
widget_add_button_element(
|
||||||
app->widget, GuiButtonTypeLeft, "Back", u2f_scene_error_event_callback, app);
|
app->widget, GuiButtonTypeLeft, "Back", u2f_scene_error_event_callback, app);
|
||||||
} else if(app->error == U2fAppErrorCloseRpc) {
|
|
||||||
widget_add_icon_element(app->widget, 78, 0, &I_ActiveConnection_50x64);
|
|
||||||
if(XTREME_SETTINGS()->is_nsfw) {
|
|
||||||
widget_add_string_multiline_element(
|
|
||||||
app->widget, 3, 2, AlignLeft, AlignTop, FontPrimary, "I am not\na whore!");
|
|
||||||
widget_add_string_multiline_element(
|
|
||||||
app->widget,
|
|
||||||
3,
|
|
||||||
30,
|
|
||||||
AlignLeft,
|
|
||||||
AlignTop,
|
|
||||||
FontSecondary,
|
|
||||||
"Pull out from\nPC or phone to\nuse me like this.");
|
|
||||||
} else {
|
|
||||||
widget_add_string_multiline_element(
|
|
||||||
app->widget, 3, 2, AlignLeft, AlignTop, FontPrimary, "Connection\nis active!");
|
|
||||||
widget_add_string_multiline_element(
|
|
||||||
app->widget,
|
|
||||||
3,
|
|
||||||
30,
|
|
||||||
AlignLeft,
|
|
||||||
AlignTop,
|
|
||||||
FontSecondary,
|
|
||||||
"Disconnect from\nPC or phone to\nuse this function.");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
view_dispatcher_switch_to_view(app->view_dispatcher, U2fAppViewError);
|
view_dispatcher_switch_to_view(app->view_dispatcher, U2fAppViewError);
|
||||||
|
|||||||
@@ -49,16 +49,12 @@ U2fApp* u2f_app_alloc() {
|
|||||||
view_dispatcher_add_view(
|
view_dispatcher_add_view(
|
||||||
app->view_dispatcher, U2fAppViewMain, u2f_view_get_view(app->u2f_view));
|
app->view_dispatcher, U2fAppViewMain, u2f_view_get_view(app->u2f_view));
|
||||||
|
|
||||||
if(furi_hal_usb_is_locked()) {
|
furi_hal_usb_unlock();
|
||||||
app->error = U2fAppErrorCloseRpc;
|
if(u2f_data_check(true)) {
|
||||||
scene_manager_next_scene(app->scene_manager, U2fSceneError);
|
scene_manager_next_scene(app->scene_manager, U2fSceneMain);
|
||||||
} else {
|
} else {
|
||||||
if(u2f_data_check(true)) {
|
app->error = U2fAppErrorNoFiles;
|
||||||
scene_manager_next_scene(app->scene_manager, U2fSceneMain);
|
scene_manager_next_scene(app->scene_manager, U2fSceneError);
|
||||||
} else {
|
|
||||||
app->error = U2fAppErrorNoFiles;
|
|
||||||
scene_manager_next_scene(app->scene_manager, U2fSceneError);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return app;
|
return app;
|
||||||
|
|||||||
@@ -18,7 +18,6 @@
|
|||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
U2fAppErrorNoFiles,
|
U2fAppErrorNoFiles,
|
||||||
U2fAppErrorCloseRpc,
|
|
||||||
} U2fAppError;
|
} U2fAppError;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
|
|||||||
Reference in New Issue
Block a user