From e8e087497d795c4b2233b87f85191c03de27c171 Mon Sep 17 00:00:00 2001 From: zinongli <131403964+zinongli@users.noreply.github.com> Date: Thu, 2 Oct 2025 14:42:54 +0400 Subject: [PATCH] use firmware version num --- metroflip_i.h | 1 + scenes/plugins/bip.c | 2 +- scenes/plugins/charliecard.c | 2 +- scenes/plugins/clipper.c | 2 +- scenes/plugins/gocard.c | 2 +- scenes/plugins/itso.c | 2 +- scenes/plugins/metromoney.c | 2 +- scenes/plugins/myki.c | 2 +- scenes/plugins/opal.c | 2 +- scenes/plugins/renfe_regular.c | 6 +++--- scenes/plugins/renfe_sum10.c | 6 +++--- scenes/plugins/smartrider.c | 2 +- scenes/plugins/troika.c | 2 +- 13 files changed, 17 insertions(+), 16 deletions(-) diff --git a/metroflip_i.h b/metroflip_i.h index eb0b797..08ff6e9 100644 --- a/metroflip_i.h +++ b/metroflip_i.h @@ -45,6 +45,7 @@ #include #include #include +#include #include "scenes/metroflip_scene.h" diff --git a/scenes/plugins/bip.c b/scenes/plugins/bip.c index 31e98db..36724b0 100644 --- a/scenes/plugins/bip.c +++ b/scenes/plugins/bip.c @@ -344,7 +344,7 @@ static void bip_on_enter(Metroflip* app) { FlipperFormat* ff = flipper_format_file_alloc(storage); if(flipper_format_file_open_existing(ff, app->file_path)) { MfClassicData* mfc_data = mf_classic_alloc(); - mf_classic_load(mfc_data, ff, 2); + mf_classic_load(mfc_data, ff, NFC_CURRENT_FORMAT_VERSION); FuriString* parsed_data = furi_string_alloc(); Widget* widget = app->widget; diff --git a/scenes/plugins/charliecard.c b/scenes/plugins/charliecard.c index e3189a0..a57ddf1 100644 --- a/scenes/plugins/charliecard.c +++ b/scenes/plugins/charliecard.c @@ -1260,7 +1260,7 @@ static void charliecard_on_enter(Metroflip* app) { FlipperFormat* ff = flipper_format_file_alloc(storage); if(flipper_format_file_open_existing(ff, app->file_path)) { MfClassicData* mfc_data = mf_classic_alloc(); - mf_classic_load(mfc_data, ff, 2); + mf_classic_load(mfc_data, ff, NFC_CURRENT_FORMAT_VERSION); FuriString* parsed_data = furi_string_alloc(); Widget* widget = app->widget; diff --git a/scenes/plugins/clipper.c b/scenes/plugins/clipper.c index b70db31..335aecb 100644 --- a/scenes/plugins/clipper.c +++ b/scenes/plugins/clipper.c @@ -610,7 +610,7 @@ static void clipper_on_enter(Metroflip* app) { FlipperFormat* ff = flipper_format_file_alloc(storage); if(flipper_format_file_open_existing(ff, app->file_path)) { MfDesfireData* data = mf_desfire_alloc(); - mf_desfire_load(data, ff, 2); + mf_desfire_load(data, ff, NFC_CURRENT_FORMAT_VERSION); FuriString* parsed_data = furi_string_alloc(); Widget* widget = app->widget; diff --git a/scenes/plugins/gocard.c b/scenes/plugins/gocard.c index 14edf6c..3b258e3 100644 --- a/scenes/plugins/gocard.c +++ b/scenes/plugins/gocard.c @@ -200,7 +200,7 @@ static void gocard_on_enter(Metroflip* app) { FlipperFormat* ff = flipper_format_file_alloc(storage); if(flipper_format_file_open_existing(ff, app->file_path)) { MfClassicData* mfc_data = mf_classic_alloc(); - mf_classic_load(mfc_data, ff, 2); + mf_classic_load(mfc_data, ff, NFC_CURRENT_FORMAT_VERSION); FuriString* parsed_data = furi_string_alloc(); Widget* widget = app->widget; diff --git a/scenes/plugins/itso.c b/scenes/plugins/itso.c index 6528273..f808806 100644 --- a/scenes/plugins/itso.c +++ b/scenes/plugins/itso.c @@ -156,7 +156,7 @@ static void itso_on_enter(Metroflip* app) { FlipperFormat* ff = flipper_format_file_alloc(storage); if(flipper_format_file_open_existing(ff, app->file_path)) { MfDesfireData* data = mf_desfire_alloc(); - mf_desfire_load(data, ff, 2); + mf_desfire_load(data, ff, NFC_CURRENT_FORMAT_VERSION); FuriString* parsed_data = furi_string_alloc(); Widget* widget = app->widget; diff --git a/scenes/plugins/metromoney.c b/scenes/plugins/metromoney.c index 6001f6a..0203aae 100644 --- a/scenes/plugins/metromoney.c +++ b/scenes/plugins/metromoney.c @@ -150,7 +150,7 @@ static void metromoney_on_enter(Metroflip* app) { FlipperFormat* ff = flipper_format_file_alloc(storage); if(flipper_format_file_open_existing(ff, app->file_path)) { MfClassicData* mfc_data = mf_classic_alloc(); - mf_classic_load(mfc_data, ff, 2); + mf_classic_load(mfc_data, ff, NFC_CURRENT_FORMAT_VERSION); FuriString* parsed_data = furi_string_alloc(); Widget* widget = app->widget; diff --git a/scenes/plugins/myki.c b/scenes/plugins/myki.c index a34d6cb..cbfa083 100644 --- a/scenes/plugins/myki.c +++ b/scenes/plugins/myki.c @@ -139,7 +139,7 @@ static void myki_on_enter(Metroflip* app) { FlipperFormat* ff = flipper_format_file_alloc(storage); if(flipper_format_file_open_existing(ff, app->file_path)) { MfDesfireData* data = mf_desfire_alloc(); - mf_desfire_load(data, ff, 2); + mf_desfire_load(data, ff, NFC_CURRENT_FORMAT_VERSION); FuriString* parsed_data = furi_string_alloc(); Widget* widget = app->widget; diff --git a/scenes/plugins/opal.c b/scenes/plugins/opal.c index 40573fb..dad768f 100644 --- a/scenes/plugins/opal.c +++ b/scenes/plugins/opal.c @@ -258,7 +258,7 @@ static void opal_on_enter(Metroflip* app) { Storage* storage = furi_record_open(RECORD_STORAGE); FlipperFormat* ff = flipper_format_file_alloc(storage); if(flipper_format_file_open_existing(ff, app->file_path)) { - mf_desfire_load(app->mfdes_data, ff, 2); + mf_desfire_load(app->mfdes_data, ff, NFC_CURRENT_FORMAT_VERSION); FuriString* parsed_data = furi_string_alloc(); Widget* widget = app->widget; diff --git a/scenes/plugins/renfe_regular.c b/scenes/plugins/renfe_regular.c index 13b0038..84c5a6f 100644 --- a/scenes/plugins/renfe_regular.c +++ b/scenes/plugins/renfe_regular.c @@ -1145,7 +1145,7 @@ static void renfe_regular_on_enter(Metroflip* app) { FlipperFormat* ff = flipper_format_file_alloc(storage); if(flipper_format_file_open_existing(ff, app->file_path)) { mfc_data = mf_classic_alloc(); - mf_classic_load(mfc_data, ff, 2); + mf_classic_load(mfc_data, ff, NFC_CURRENT_FORMAT_VERSION); should_free_mfc_data = true; } flipper_format_free(ff); @@ -1252,7 +1252,7 @@ static bool renfe_regular_on_event(Metroflip* app, SceneManagerEvent event) { FlipperFormat* ff = flipper_format_file_alloc(storage); if(flipper_format_file_open_existing(ff, app->file_path)) { mfc_data = mf_classic_alloc(); - mf_classic_load(mfc_data, ff, 2); + mf_classic_load(mfc_data, ff, NFC_CURRENT_FORMAT_VERSION); should_free_mfc_data = true; } flipper_format_free(ff); @@ -1291,7 +1291,7 @@ static bool renfe_regular_on_event(Metroflip* app, SceneManagerEvent event) { FlipperFormat* ff = flipper_format_file_alloc(storage); if(flipper_format_file_open_existing(ff, app->file_path)) { mfc_data = mf_classic_alloc(); - mf_classic_load(mfc_data, ff, 2); + mf_classic_load(mfc_data, ff, NFC_CURRENT_FORMAT_VERSION); should_free_mfc_data = true; } flipper_format_free(ff); diff --git a/scenes/plugins/renfe_sum10.c b/scenes/plugins/renfe_sum10.c index c4d61ea..0a5ead7 100644 --- a/scenes/plugins/renfe_sum10.c +++ b/scenes/plugins/renfe_sum10.c @@ -1430,7 +1430,7 @@ static void renfe_sum10_on_enter(Metroflip* app) { FlipperFormat* ff = flipper_format_file_alloc(storage); if(flipper_format_file_open_existing(ff, app->file_path)) { mfc_data = mf_classic_alloc(); - mf_classic_load(mfc_data, ff, 2); + mf_classic_load(mfc_data, ff, NFC_CURRENT_FORMAT_VERSION); should_free_mfc_data = true; } flipper_format_free(ff); @@ -1549,7 +1549,7 @@ static bool renfe_sum10_on_event(Metroflip* app, SceneManagerEvent event) { FlipperFormat* ff = flipper_format_file_alloc(storage); if(flipper_format_file_open_existing(ff, app->file_path)) { mfc_data = mf_classic_alloc(); - mf_classic_load(mfc_data, ff, 2); + mf_classic_load(mfc_data, ff, NFC_CURRENT_FORMAT_VERSION); should_free_mfc_data = true; } flipper_format_free(ff); @@ -1611,7 +1611,7 @@ static bool renfe_sum10_on_event(Metroflip* app, SceneManagerEvent event) { FlipperFormat* ff = flipper_format_file_alloc(storage); if(flipper_format_file_open_existing(ff, app->file_path)) { mfc_data = mf_classic_alloc(); - mf_classic_load(mfc_data, ff, 2); + mf_classic_load(mfc_data, ff, NFC_CURRENT_FORMAT_VERSION); should_free_mfc_data = true; } flipper_format_free(ff); diff --git a/scenes/plugins/smartrider.c b/scenes/plugins/smartrider.c index c49d5f0..90b0326 100644 --- a/scenes/plugins/smartrider.c +++ b/scenes/plugins/smartrider.c @@ -342,7 +342,7 @@ static void smartrider_on_enter(Metroflip* app) { FlipperFormat* ff = flipper_format_file_alloc(storage); if(flipper_format_file_open_existing(ff, app->file_path)) { MfClassicData* mfc_data = mf_classic_alloc(); - mf_classic_load(mfc_data, ff, 2); + mf_classic_load(mfc_data, ff, NFC_CURRENT_FORMAT_VERSION); FuriString* parsed_data = furi_string_alloc(); Widget* widget = app->widget; diff --git a/scenes/plugins/troika.c b/scenes/plugins/troika.c index 1f6d081..f622409 100644 --- a/scenes/plugins/troika.c +++ b/scenes/plugins/troika.c @@ -1562,7 +1562,7 @@ static void troika_on_enter(Metroflip* app) { FlipperFormat* ff = flipper_format_file_alloc(storage); if(flipper_format_file_open_existing(ff, app->file_path)) { MfClassicData* mfc_data = mf_classic_alloc(); - mf_classic_load(mfc_data, ff, 2); + mf_classic_load(mfc_data, ff, NFC_CURRENT_FORMAT_VERSION); FuriString* parsed_data = furi_string_alloc(); Widget* widget = app->widget;