add picopass emulation

This commit is contained in:
Tiernan Messmer
2022-12-22 09:37:37 +10:00
parent 4900e8b7a2
commit 78119a519a
21 changed files with 1054 additions and 9 deletions

View File

@@ -22,6 +22,7 @@
#include "scenes/picopass_scene.h"
#include "views/dict_attack.h"
#include "views/loclass.h"
#include <storage/storage.h>
#include <lib/toolbox/path.h>
@@ -29,6 +30,10 @@
#define PICOPASS_TEXT_STORE_SIZE 128
#define LOCLASS_NUM_CSNS 9
// Collect 2 MACs per CSN to account for keyroll modes
#define LOCLASS_MACS_TO_COLLECT (LOCLASS_NUM_CSNS * 2)
enum PicopassCustomEvent {
// Reserve first 100 events for button types and indexes, starting from 0
PicopassCustomEventReserved = 100,
@@ -63,6 +68,7 @@ struct Picopass {
TextInput* text_input;
Widget* widget;
DictAttack* dict_attack;
Loclass* loclass;
};
typedef enum {
@@ -72,6 +78,7 @@ typedef enum {
PicopassViewTextInput,
PicopassViewWidget,
PicopassViewDictAttack,
PicopassViewLoclass,
} PicopassView;
Picopass* picopass_alloc();
@@ -82,6 +89,8 @@ void picopass_text_store_clear(Picopass* picopass);
void picopass_blink_start(Picopass* picopass);
void picopass_blink_emulate_start(Picopass* picopass);
void picopass_blink_stop(Picopass* picopass);
void picopass_show_loading_popup(void* context, bool show);