Skip to content

Commit b8bd0b9

Browse files
committed
better message for api mismatch
by Willy-JL
1 parent e403860 commit b8bd0b9

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

applications/services/loader/loader.c

+17-9
Original file line numberDiff line numberDiff line change
@@ -460,17 +460,25 @@ static LoaderMessageLoaderStatusResult loader_start_external_app(
460460
(preload_res == FlipperApplicationPreloadStatusApiTooNew)) {
461461
if(!ignore_api_mismatch) {
462462
DialogsApp* dialogs = furi_record_open(RECORD_DIALOGS);
463+
// Successful map, but found api mismatch -> warn user
464+
const FlipperApplicationManifest* manifest =
465+
flipper_application_get_manifest(loader->app.fap);
466+
467+
bool app_newer = preload_res == FlipperApplicationPreloadStatusApiTooNew;
468+
const char* header = app_newer ? "App Too New" : "App Too Old";
469+
char text[63];
470+
snprintf(
471+
text,
472+
sizeof(text),
473+
"APP:%i %c FW:%i\nThis app might not work\nContinue anyways?",
474+
manifest->base.api_version.major,
475+
app_newer ? '>' : '<',
476+
firmware_api_interface->api_version_major);
477+
463478
DialogMessage* message = dialog_message_alloc();
464-
dialog_message_set_header(
465-
message, "API Mismatch", 64, 0, AlignCenter, AlignTop);
479+
dialog_message_set_header(message, header, 64, 0, AlignCenter, AlignTop);
466480
dialog_message_set_buttons(message, NULL, NULL, "Continue");
467-
dialog_message_set_text(
468-
message,
469-
"This app might not\nwork correctly\nContinue anyways?",
470-
64,
471-
32,
472-
AlignCenter,
473-
AlignCenter);
481+
dialog_message_set_text(message, text, 64, 32, AlignCenter, AlignCenter);
474482
if(dialog_message_show(dialogs, message) == DialogMessageButtonRight) {
475483
result.value = loader_make_status_error(
476484
LoaderStatusErrorApiMismatch, error_message, "API Mismatch");

0 commit comments

Comments
 (0)