| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123 |
- #pragma once
- #include <notification/notification.h>
- #include <gui/gui.h>
- #include <dialogs/dialogs.h>
- #include "../features_config.h"
- #include "../ui/totp_scenes_enum.h"
- #include "../services/config/config_file_context.h"
- #include "../services/idle_timeout/idle_timeout.h"
- #include "notification_method.h"
- #include "automation_method.h"
- #include "automation_kb_layout.h"
- #ifdef TOTP_BADBT_TYPE_ENABLED
- #include "../workers/bt_type_code/bt_type_code.h"
- #endif
- #include "../services/crypto/constants.h"
- /**
- * @brief Application state structure
- */
- typedef struct {
- /**
- * @brief Application current scene
- */
- Scene current_scene;
- /**
- * @brief Application current scene state
- */
- void* current_scene_state;
- /**
- * @brief Reference to the firmware dialogs subsystem
- */
- DialogsApp* dialogs_app;
- /**
- * @brief Reference to the firmware GUI subsystem
- */
- Gui* gui;
- /**
- * @brief Timezone UTC offset in hours
- */
- float timezone_offset;
- /**
- * @brief Config file context
- */
- ConfigFileContext* config_file_context;
- /**
- * @brief Encrypted well-known data
- */
- uint8_t* crypto_verify_data;
- /**
- * @brief Encrypted well-known data length
- */
- size_t crypto_verify_data_length;
- /**
- * @brief Whether PIN is set by user or not
- */
- bool pin_set;
- /**
- * @brief Initialization vector (IV) to be used for encryption\decryption
- */
- uint8_t iv[CRYPTO_IV_LENGTH];
- /**
- * @brief Basic randomly-generated initialization vector (IV)
- */
- uint8_t base_iv[CRYPTO_IV_LENGTH];
- /**
- * @brief Notification method
- */
- NotificationMethod notification_method;
- /**
- * @brief Automation method
- */
- AutomationMethod automation_method;
- /**
- * @brief Automation keyboard layout to be used
- */
- AutomationKeyboardLayout automation_kb_layout;
- #ifdef TOTP_BADBT_TYPE_ENABLED
- /**
- * @brief Bad-Bluetooth worker context
- */
- TotpBtTypeCodeWorkerContext* bt_type_code_worker_context;
- #endif
- /**
- * @brief IDLE timeout context
- */
- IdleTimeoutContext* idle_timeout_context;
- /**
- * @brief Font index to be used to draw TOTP token
- */
- uint8_t active_font_index;
- /**
- * @brief Crypto key slot to be used
- */
- uint8_t crypto_key_slot;
- /**
- * @brief Crypto algorithms version to be used
- */
- uint8_t crypto_version;
- /**
- * @brief Application even queue
- */
- FuriMessageQueue* event_queue;
- } PluginState;
|