Skip to content

Commit

Permalink
Fix backwards compatibility with MenuAppList 0
Browse files Browse the repository at this point in the history
  • Loading branch information
Willy-JL committed Mar 10, 2024
1 parent 1f49d82 commit 5b15568
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions applications/main/momentum_app/momentum_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,11 +242,21 @@ MomentumApp* momentum_app_alloc() {
CharList_init(app->mainmenu_app_exes);
Stream* stream = file_stream_alloc(storage);
FuriString* line = furi_string_alloc();
if(file_stream_open(stream, MAINMENU_APPS_PATH, FSAM_READ, FSOM_OPEN_EXISTING)) {
stream_read_line(stream, line);
uint32_t version;
if(file_stream_open(stream, MAINMENU_APPS_PATH, FSAM_READ, FSOM_OPEN_EXISTING) &&
stream_read_line(stream, line) &&
sscanf(furi_string_get_cstr(line), "MenuAppList Version %lu", &version) == 1 &&
version <= 1) {
while(stream_read_line(stream, line)) {
furi_string_replace_all(line, "\r", "");
furi_string_replace_all(line, "\n", "");
if(version == 0) {
if(!furi_string_cmp(line, "RFID")) {
furi_string_set(line, "125 kHz RFID");
} else if(!furi_string_cmp(line, "SubGHz")) {
furi_string_set(line, "Sub-GHz");
}
}
CharList_push_back(app->mainmenu_app_exes, strdup(furi_string_get_cstr(line)));
flipper_application_load_name_and_icon(line, storage, NULL, line);
if(!furi_string_cmp(line, "Momentum")) {
Expand Down

0 comments on commit 5b15568

Please sign in to comment.