From 0e8806c6c6cdf85a4efcd92098e62994a0d6f475 Mon Sep 17 00:00:00 2001 From: Zachary Weiss Date: Mon, 29 Apr 2024 22:35:19 -0400 Subject: [PATCH] Archive: Favorite .mag files (#110) * Impl mag file favoriting, add icon * Revert API ver * No weird formatting --------- Co-authored-by: Willy-JL <49810075+Willy-JL@users.noreply.github.com> --- .../main/archive/helpers/archive_browser.h | 3 +++ .../main/archive/helpers/archive_files.h | 1 + .../main/archive/scenes/archive_scene_browser.c | 2 ++ .../main/archive/views/archive_browser_view.c | 1 + assets/icons/Archive/mag_card_10px.png | Bin 0 -> 2401 bytes targets/f7/api_symbols.csv | 1 + 6 files changed, 8 insertions(+) create mode 100644 assets/icons/Archive/mag_card_10px.png diff --git a/applications/main/archive/helpers/archive_browser.h b/applications/main/archive/helpers/archive_browser.h index be5c6a4d0e..71f3a320bb 100644 --- a/applications/main/archive/helpers/archive_browser.h +++ b/applications/main/archive/helpers/archive_browser.h @@ -24,6 +24,7 @@ static const char* tab_default_paths[] = { }; static const char* known_ext[] = { + // clang-format off [ArchiveFileTypeIButton] = ".ibtn", [ArchiveFileTypeNFC] = ".nfc", [ArchiveFileTypeSubGhz] = ".sub", @@ -34,6 +35,7 @@ static const char* known_ext[] = { [ArchiveFileTypeInfraredRemote] = ".txt", [ArchiveFileTypeBadKb] = ".txt", [ArchiveFileTypeWAV] = ".wav", + [ArchiveFileTypeMag] = ".mag", [ArchiveFileTypeU2f] = "?", [ArchiveFileTypeApplication] = ".fap", [ArchiveFileTypeJS] = ".js", @@ -43,6 +45,7 @@ static const char* known_ext[] = { [ArchiveFileTypeFolder] = "?", [ArchiveFileTypeUnknown] = "*", [ArchiveFileTypeAppOrJs] = ".fap|.js", + // clang-format on }; static const ArchiveFileTypeEnum known_type[] = { diff --git a/applications/main/archive/helpers/archive_files.h b/applications/main/archive/helpers/archive_files.h index 2872105ef7..60e45a829a 100644 --- a/applications/main/archive/helpers/archive_files.h +++ b/applications/main/archive/helpers/archive_files.h @@ -20,6 +20,7 @@ typedef enum { ArchiveFileTypeInfraredRemote, ArchiveFileTypeBadKb, ArchiveFileTypeWAV, + ArchiveFileTypeMag, ArchiveFileTypeU2f, ArchiveFileTypeApplication, ArchiveFileTypeJS, diff --git a/applications/main/archive/scenes/archive_scene_browser.c b/applications/main/archive/scenes/archive_scene_browser.c index 6942144aa4..70c4bc2944 100644 --- a/applications/main/archive/scenes/archive_scene_browser.c +++ b/applications/main/archive/scenes/archive_scene_browser.c @@ -34,6 +34,8 @@ const char* archive_get_flipper_app_name(ArchiveFileTypeEnum file_type) { return "Bad KB"; case ArchiveFileTypeWAV: return EXT_PATH("apps/Media/wav_player.fap"); + case ArchiveFileTypeMag: + return EXT_PATH("apps/GPIO/magspoof.fap"); case ArchiveFileTypeU2f: return "U2F"; case ArchiveFileTypeUpdateManifest: diff --git a/applications/main/archive/views/archive_browser_view.c b/applications/main/archive/views/archive_browser_view.c index 8894496e89..2af02de903 100644 --- a/applications/main/archive/views/archive_browser_view.c +++ b/applications/main/archive/views/archive_browser_view.c @@ -35,6 +35,7 @@ static const Icon* ArchiveItemIcons[] = { [ArchiveFileTypeInfraredRemote] = &I_ir_scope_10px, [ArchiveFileTypeBadKb] = &I_badkb_10px, [ArchiveFileTypeWAV] = &I_music_10px, + [ArchiveFileTypeMag] = &I_mag_card_10px, [ArchiveFileTypeU2f] = &I_u2f_10px, [ArchiveFileTypeApplication] = &I_Apps_10px, [ArchiveFileTypeJS] = &I_js_script_10px, diff --git a/assets/icons/Archive/mag_card_10px.png b/assets/icons/Archive/mag_card_10px.png new file mode 100644 index 0000000000000000000000000000000000000000..28d683d8214d5ff3628701355c12b1ab00998717 GIT binary patch literal 2401 zcmV-n37+ zaB^>EX>4U6ba`-PAZ2)IW&i+q+U;3cmh7kw{MRaa3Cx1!FrL#pc+2k)*sh$Ml|y~L zbXPmC6N?~1NCK$;@83cH;Ny~YX@$X>hG2n_UOi3A&R>pgX`jXN!qB(PyG2Cqs4(S zleBi(1@IHLLG44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ols.csv b/targets/f7/api_symbols.csv index 76c9e282cc..7b62b08a00 100644 --- a/targets/f7/api_symbols.csv +++ b/targets/f7/api_symbols.csv @@ -3940,6 +3940,7 @@ Variable,+,I_ir_scope_10px,Icon, Variable,+,I_js_script_10px,Icon, Variable,+,I_keyboard_10px,Icon, Variable,+,I_loading_10px,Icon, +Variable,+,I_mag_card_10px,Icon, Variable,+,I_max_24x23,Icon, Variable,+,I_max_hover_24x23,Icon, Variable,+,I_menu_text_20x5,Icon,