mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-12-28 21:53:07 +00:00
b9397693a2
opensource != selling plugin builds / do you agree? If you don't agree - and you think I did a bad thing here by allowing users to select fonts without payment, let me know Why I did that? - cuz I'm not making private "donation only" builds myself, while having no main job, and living only on donations, so I don't like stuff like that in opensource projects You should support author if you like this plugin here: https://github.com/akopachov/flipper-zero_authenticator
97 lines
No EOL
3.1 KiB
C
97 lines
No EOL
3.1 KiB
C
#pragma once
|
|
|
|
#include "../../types/plugin_state.h"
|
|
#include "../../types/token_info.h"
|
|
#include "config_file_context.h"
|
|
#include "constants.h"
|
|
#include "token_info_iterator.h"
|
|
|
|
typedef uint8_t TotpConfigFileOpenResult;
|
|
typedef uint8_t TotpConfigFileUpdateResult;
|
|
|
|
/**
|
|
* @brief Tries to take a config file backup
|
|
* @param plugin_state application state
|
|
* @return backup path if backup successfully taken; \c NULL otherwise
|
|
*/
|
|
char* totp_config_file_backup(const PluginState* plugin_state);
|
|
|
|
/**
|
|
* @brief Loads basic information from an application config file into application state without loading all the tokens
|
|
* @param plugin_state application state
|
|
* @return Config file open result
|
|
*/
|
|
bool totp_config_file_load(PluginState* const plugin_state);
|
|
|
|
/**
|
|
* @brief Updates timezone offset in an application config file
|
|
* @param plugin_state application state
|
|
* @return Config file update result
|
|
*/
|
|
bool totp_config_file_update_timezone_offset(const PluginState* plugin_state);
|
|
|
|
/**
|
|
* @brief Updates notification method in an application config file
|
|
* @param plugin_state application state
|
|
* @return Config file update result
|
|
*/
|
|
bool totp_config_file_update_notification_method(const PluginState* plugin_state);
|
|
|
|
/**
|
|
* @brief Updates automation method in an application config file
|
|
* @param plugin_state application state
|
|
* @return Config file update result
|
|
*/
|
|
bool totp_config_file_update_automation_method(const PluginState* plugin_state);
|
|
|
|
/**
|
|
* @brief Updates selected font in an application config file
|
|
* @param plugin_state application state
|
|
* @return Config file update result
|
|
*/
|
|
bool totp_config_file_update_selected_font(const PluginState* plugin_state);
|
|
|
|
/**
|
|
* @brief Updates application user settings
|
|
* @param plugin_state application state
|
|
* @return Config file update result
|
|
*/
|
|
bool totp_config_file_update_user_settings(const PluginState* plugin_state);
|
|
|
|
/**
|
|
* @brief Updates crypto signatures information
|
|
* @param plugin_state application state
|
|
* @return Config file update result
|
|
*/
|
|
bool totp_config_file_update_crypto_signatures(const PluginState* plugin_state);
|
|
|
|
/**
|
|
* @brief Reset all the settings to default
|
|
* @param plugin_state application state
|
|
*/
|
|
void totp_config_file_reset(PluginState* const plugin_state);
|
|
|
|
/**
|
|
* @brief Closes config file and releases all the resources
|
|
* @param plugin_state application state
|
|
*/
|
|
void totp_config_file_close(PluginState* const plugin_state);
|
|
|
|
/**
|
|
* @brief Updates config file encryption by re-encrypting it using new user's PIN and new randomly generated IV
|
|
* @param plugin_state application state
|
|
* @param new_pin new user's PIN
|
|
* @param new_pin_length new user's PIN length
|
|
* @return \c true if config file encryption successfully updated; \c false otherwise
|
|
*/
|
|
bool totp_config_file_update_encryption(
|
|
PluginState* plugin_state,
|
|
const uint8_t* new_pin,
|
|
uint8_t new_pin_length);
|
|
|
|
/**
|
|
* @brief Gets token info iterator context
|
|
* @param plugin_state application state
|
|
* @return token info iterator context
|
|
*/
|
|
TokenInfoIteratorContext* totp_config_get_token_iterator_context(const PluginState* plugin_state); |