Auto unlock rpc for u2f

This commit is contained in:
Willy-JL
2023-06-08 15:53:24 +01:00
parent b9f7008017
commit 5c2e7f9e08
3 changed files with 5 additions and 35 deletions

View File

@@ -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.");
widget_add_button_element(
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 File

@@ -49,16 +49,12 @@ U2fApp* u2f_app_alloc() {
view_dispatcher_add_view(
app->view_dispatcher, U2fAppViewMain, u2f_view_get_view(app->u2f_view));
if(furi_hal_usb_is_locked()) {
app->error = U2fAppErrorCloseRpc;
scene_manager_next_scene(app->scene_manager, U2fSceneError);
furi_hal_usb_unlock();
if(u2f_data_check(true)) {
scene_manager_next_scene(app->scene_manager, U2fSceneMain);
} else {
if(u2f_data_check(true)) {
scene_manager_next_scene(app->scene_manager, U2fSceneMain);
} else {
app->error = U2fAppErrorNoFiles;
scene_manager_next_scene(app->scene_manager, U2fSceneError);
}
app->error = U2fAppErrorNoFiles;
scene_manager_next_scene(app->scene_manager, U2fSceneError);
}
return app;

View File

@@ -18,7 +18,6 @@
typedef enum {
U2fAppErrorNoFiles,
U2fAppErrorCloseRpc,
} U2fAppError;
typedef enum {