Skip to content

Commit

Permalink
Few tweaks for OFW catalog (#161)
Browse files Browse the repository at this point in the history
* Few tweaks for OFW catalog

* Updated firmware submodules

* Dropped some legacy stuff
  • Loading branch information
akopachov authored Jul 5, 2023
1 parent 5627bc9 commit ab7bbb9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 26 deletions.
3 changes: 2 additions & 1 deletion application.fam
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ App(
],
stack_size=2 * 1024,
order=20,
fap_version="2.23",
fap_author="Alexander Kopachov (@akopachov)",
fap_description="Software-based TOTP authenticator for Flipper Zero device",
fap_weburl="https://github.com/akopachov/flipper-zero_authenticator",
fap_category="Misc",
fap_category="Tools",
fap_icon_assets="images",
fap_icon="totp_10px.png",
fap_private_libs=[
Expand Down
5 changes: 3 additions & 2 deletions features_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@
#endif
// End of FlipC.org definition checks

// If target firmware is not yet set, default it to Xtreme\Unleashed as I'm using it, and it is cool :)
// If target firmware is not yet set, default it to OFW because there is no chance to force Flipper Devices to update their build pipelines :angry:.
// I'm still using Xtreme firmware, it is still the best one and I highly recommend it to everybody.
#ifndef TOTP_TARGET_FIRMWARE
#define TOTP_TARGET_FIRMWARE TOTP_FIRMWARE_XTREME_UL
#define TOTP_TARGET_FIRMWARE TOTP_FIRMWARE_OFFICIAL_STABLE
#endif

// List of available font for TOTP code
Expand Down
23 changes: 0 additions & 23 deletions services/config/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
#define CONFIG_FILE_PATH CONFIG_FILE_DIRECTORY_PATH "/totp.conf"
#define CONFIG_FILE_BACKUP_DIR CONFIG_FILE_DIRECTORY_PATH "/backups"
#define CONFIG_FILE_BACKUP_BASE_PATH CONFIG_FILE_BACKUP_DIR "/totp.conf"
#define CONFIG_FILE_TEMP_PATH CONFIG_FILE_PATH ".tmp"
#define CONFIG_FILE_ORIG_PATH CONFIG_FILE_PATH ".orig"
#define CONFIG_FILE_PATH_PREVIOUS EXT_PATH("apps/Misc") "/totp.conf"

struct ConfigFileContext {
/**
Expand Down Expand Up @@ -120,26 +117,6 @@ static bool totp_open_config_file(Storage* storage, FlipperFormat** file) {
totp_close_config_file(fff_data_file);
return false;
}
} else if(storage_common_stat(storage, CONFIG_FILE_PATH_PREVIOUS, NULL) == FSE_OK) {
FURI_LOG_D(LOGGING_TAG, "Old config file %s found", CONFIG_FILE_PATH_PREVIOUS);
if(storage_common_stat(storage, CONFIG_FILE_DIRECTORY_PATH, NULL) == FSE_NOT_EXIST) {
FURI_LOG_D(
LOGGING_TAG,
"Directory %s doesn't exist. Will create new.",
CONFIG_FILE_DIRECTORY_PATH);
if(!storage_simply_mkdir(storage, CONFIG_FILE_DIRECTORY_PATH)) {
FURI_LOG_E(LOGGING_TAG, "Error creating directory %s", CONFIG_FILE_DIRECTORY_PATH);
totp_close_config_file(fff_data_file);
return false;
}
}
if(storage_common_rename(storage, CONFIG_FILE_PATH_PREVIOUS, CONFIG_FILE_PATH) != FSE_OK) {
FURI_LOG_E(LOGGING_TAG, "Error moving config to %s", CONFIG_FILE_PATH);
totp_close_config_file(fff_data_file);
return false;
}
FURI_LOG_I(LOGGING_TAG, "Applied config file path migration");
return totp_open_config_file(storage, file);
} else {
FURI_LOG_D(LOGGING_TAG, "Config file %s is not found. Will create new.", CONFIG_FILE_PATH);
if(storage_common_stat(storage, CONFIG_FILE_DIRECTORY_PATH, NULL) == FSE_NOT_EXIST) {
Expand Down

0 comments on commit ab7bbb9

Please sign in to comment.