diff options
author | gornekich <n.gorbadey@gmail.com> | 2021-07-16 00:39:21 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-16 00:39:21 +0300 |
commit | a837bc5d008c4333df4aded72880fb5689a8a000 (patch) | |
tree | 9395a34feaa6035acad2e8cf7b07b66920757e3c /applications/ibutton | |
parent | 851a44dc59ea614a767ea4e031752e9537a1f9ca (diff) |
[FL-1537] NFC launch from archive (#580)
* archive: pass full file path as App argument
* nfc: add starting emulation from Archive
* nfc, ibutton: rework setting key name with path lib
* archive: revert launching app with full file path
Co-authored-by: あく <alleteam@gmail.com>
Diffstat (limited to 'applications/ibutton')
-rw-r--r-- | applications/ibutton/ibutton-app.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/applications/ibutton/ibutton-app.cpp b/applications/ibutton/ibutton-app.cpp index cf29d884..a154b762 100644 --- a/applications/ibutton/ibutton-app.cpp +++ b/applications/ibutton/ibutton-app.cpp @@ -3,6 +3,7 @@ #include <callback-connector.h> #include <m-string.h> #include <file-worker-cpp.h> +#include <path.h> const char* iButtonApp::app_folder = "ibutton"; const char* iButtonApp::app_extension = ".ibtn"; @@ -325,17 +326,10 @@ bool iButtonApp::load_key(const char* key_name) { string_t key_path; string_init_set_str(key_path, key_name); - if(!string_start_with_str_p(key_path, app_folder) || - !string_end_with_str_p(key_path, app_extension)) { - string_clear(key_path); - return false; - } result = load_key_data(key_path); if(result) { - uint8_t folder_end = strlen(app_folder) + 1; - uint8_t extension_start = string_size(key_path) - strlen(app_extension); - string_mid(key_path, folder_end, extension_start - folder_end); + path_extract_filename_no_ext(key_name, key_path); get_key()->set_name(string_get_cstr(key_path)); } string_clear(key_path); |