Skip to content

Commit

Permalink
acknowledgements
Browse files Browse the repository at this point in the history
  • Loading branch information
bettse committed May 29, 2024
1 parent 0d682ee commit e81e67e
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 1 deletion.
2 changes: 2 additions & 0 deletions acknowledgements.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
const char* acknowledgements_text =
"The developers of Picopass would like to humbly acknowledge the work of those who came before and made this possible.\nWe stand on the shoulders of giants.\nFlavio D. Garcia, Gerhard de Koning Gans, Roel Verdult and Milosch Meriac for their research on iClass. Martin HS (holiman) for their work on the loclass library. Iceman and the Proxmark3 community.";
47 changes: 47 additions & 0 deletions scenes/picopass_scene_acknowledgements.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#include "../picopass_i.h"
#include <dolphin/dolphin.h>
#include "../acknowledgements.h"

void picopass_scene_acknowledgements_widget_callback(
GuiButtonType result,
InputType type,
void* context) {
Picopass* picopass = context;
if(type == InputTypeShort) {
view_dispatcher_send_custom_event(picopass->view_dispatcher, result);
}
}

void picopass_scene_acknowledgements_on_enter(void* context) {
Picopass* picopass = context;

furi_string_reset(picopass->text_box_store);

FuriString* str = picopass->text_box_store;
furi_string_cat_printf(str, "%s\n", acknowledgements_text);

text_box_set_font(picopass->text_box, TextBoxFontText);
text_box_set_text(picopass->text_box, furi_string_get_cstr(picopass->text_box_store));
view_dispatcher_switch_to_view(picopass->view_dispatcher, PicopassViewTextBox);
}

bool picopass_scene_acknowledgements_on_event(void* context, SceneManagerEvent event) {
Picopass* picopass = context;
bool consumed = false;

if(event.type == SceneManagerEventTypeCustom) {
if(event.event == GuiButtonTypeLeft) {
consumed = scene_manager_previous_scene(picopass->scene_manager);
}
} else if(event.type == SceneManagerEventTypeBack) {
consumed = scene_manager_previous_scene(picopass->scene_manager);
}
return consumed;
}

void picopass_scene_acknowledgements_on_exit(void* context) {
Picopass* picopass = context;

// Clear views
text_box_reset(picopass->text_box);
}
1 change: 1 addition & 0 deletions scenes/picopass_scene_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ ADD_SCENE(picopass, key_input, KeyInput)
ADD_SCENE(picopass, nr_mac_saved, NrMacSaved)
ADD_SCENE(picopass, more_info, MoreInfo)
ADD_SCENE(picopass, formats, Formats)
ADD_SCENE(picopass, acknowledgements, Acknowledgements)
13 changes: 12 additions & 1 deletion scenes/picopass_scene_start.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ enum SubmenuIndex {
SubmenuIndexRead,
SubmenuIndexSaved,
SubmenuIndexLoclass,
SubmenuIndexAcknowledgements,
};

void picopass_scene_start_submenu_callback(void* context, uint32_t index) {
Expand All @@ -17,9 +18,14 @@ void picopass_scene_start_on_enter(void* context) {
submenu, "Read Card", SubmenuIndexRead, picopass_scene_start_submenu_callback, picopass);
submenu_add_item(
submenu, "Saved", SubmenuIndexSaved, picopass_scene_start_submenu_callback, picopass);

submenu_add_item(
submenu, "Loclass", SubmenuIndexLoclass, picopass_scene_start_submenu_callback, picopass);
submenu_add_item(
submenu,
"Acknowledgements",
SubmenuIndexAcknowledgements,
picopass_scene_start_submenu_callback,
picopass);

submenu_set_selected_item(
submenu, scene_manager_get_scene_state(picopass->scene_manager, PicopassSceneStart));
Expand Down Expand Up @@ -49,6 +55,11 @@ bool picopass_scene_start_on_event(void* context, SceneManagerEvent event) {
picopass->scene_manager, PicopassSceneStart, PicopassSceneLoclass);
scene_manager_next_scene(picopass->scene_manager, PicopassSceneLoclass);
consumed = true;
} else if(event.event == SubmenuIndexAcknowledgements) {
scene_manager_set_scene_state(
picopass->scene_manager, PicopassSceneStart, PicopassSceneAcknowledgements);
scene_manager_next_scene(picopass->scene_manager, PicopassSceneAcknowledgements);
consumed = true;
}
}

Expand Down

0 comments on commit e81e67e

Please sign in to comment.