From 881263d3527b3934ada45a166cf120cf47e1f544 Mon Sep 17 00:00:00 2001 From: Eric Betts Date: Sun, 25 Aug 2024 16:05:10 -0700 Subject: [PATCH] Get rid of laod_path when dealing with non-seader save --- seader_credential.c | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/seader_credential.c b/seader_credential.c index 3fb899dd427..2c358bbdf39 100644 --- a/seader_credential.c +++ b/seader_credential.c @@ -198,7 +198,6 @@ bool seader_credential_save_mfc(SeaderCredential* cred, const char* name) { uint8_t empty_block[16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; uint8_t pacs_block[16] = {0x02, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - bool use_load_path = true; bool saved = false; FlipperFormat* file = flipper_format_file_alloc(cred->storage); FuriString* temp_str; @@ -209,15 +208,8 @@ bool seader_credential_save_mfc(SeaderCredential* cred, const char* name) { memcpy(pacs_block + 8, &swapped, sizeof(swapped)); do { - if(use_load_path && !furi_string_empty(cred->load_path)) { - // Get directory name - path_extract_dirname(furi_string_get_cstr(cred->load_path), temp_str); - // Make path to file to save - furi_string_cat_printf(temp_str, "/%s%s", name, SEADER_APP_MFC_EXTENSION); - } else { - furi_string_printf( - temp_str, "%s/%s%s", SEADER_APP_MFC_FOLDER, name, SEADER_APP_MFC_EXTENSION); - } + furi_string_printf( + temp_str, "%s/%s%s", SEADER_APP_MFC_FOLDER, name, SEADER_APP_MFC_EXTENSION); FURI_LOG_D(TAG, "Save as MFC [%s]", furi_string_get_cstr(temp_str)); @@ -395,7 +387,6 @@ bool seader_credential_save_picopass(SeaderCredential* cred, const char* name) { uint8_t aia[PICOPASS_BLOCK_LEN] = {0xFF, 0xff, 0xff, 0xff, 0xFF, 0xFf, 0xff, 0xFF}; uint8_t pacs_cfg[PICOPASS_BLOCK_LEN] = {0x03, 0x03, 0x03, 0x03, 0x00, 0x03, 0xe0, 0x14}; - bool use_load_path = true; bool saved = false; bool withSIO = cred->save_format == SeaderCredentialSaveFormatSR; if(withSIO) { @@ -406,14 +397,7 @@ bool seader_credential_save_picopass(SeaderCredential* cred, const char* name) { FuriString* temp_str = furi_string_alloc(); storage_simply_mkdir(cred->storage, EXT_PATH("apps_data/picopass")); - if(use_load_path && !furi_string_empty(cred->load_path)) { - // Get directory name - path_extract_dirname(furi_string_get_cstr(cred->load_path), temp_str); - // Make path to file to save - furi_string_cat_printf(temp_str, "/%s%s", name, ".picopass"); - } else { - furi_string_printf(temp_str, "%s/%s%s", EXT_PATH("apps_data/picopass"), name, ".picopass"); - } + furi_string_printf(temp_str, "%s/%s%s", EXT_PATH("apps_data/picopass"), name, ".picopass"); FURI_LOG_D(TAG, "Save as Picopass [%s]", furi_string_get_cstr(temp_str)); uint64_t sentinel = 1ULL << cred->bit_length;