unleashed-firmware/lib/flipper_application/application_manifest.c
あく 1c0276a0be
Various Fixes and Improvements (#3059)
* FuriHal: lower MGG display contrast by 4 points
* FuriHal: unify external gpio resources initialization
* Infrared: parse raw in universal TV file, cleanup it with new ifrared script. Other minor changes.
* Gui: fix elements_multiline_text_aligned eating symbols
* Lib: human readable errors in flipper application package
* Special request from marketing team
2023-09-11 16:23:00 +10:00

39 lines
1.3 KiB
C

#include "application_manifest.h"
#include <furi_hal_version.h>
bool flipper_application_manifest_is_valid(const FlipperApplicationManifest* manifest) {
if((manifest->base.manifest_magic != FAP_MANIFEST_MAGIC) ||
(manifest->base.manifest_version != FAP_MANIFEST_SUPPORTED_VERSION)) {
return false;
}
return true;
}
bool flipper_application_manifest_is_too_old(
const FlipperApplicationManifest* manifest,
const ElfApiInterface* api_interface) {
if(manifest->base.api_version.major < api_interface->api_version_major /* ||
manifest->base.api_version.minor > app->api_interface->api_version_minor */) {
return false;
}
return true;
}
bool flipper_application_manifest_is_too_new(
const FlipperApplicationManifest* manifest,
const ElfApiInterface* api_interface) {
if(manifest->base.api_version.major > api_interface->api_version_major /* ||
manifest->base.api_version.minor > app->api_interface->api_version_minor */) {
return false;
}
return true;
}
bool flipper_application_manifest_is_target_compatible(const FlipperApplicationManifest* manifest) {
const Version* version = furi_hal_version_get_firmware_version();
return version_get_target(version) == manifest->base.hardware_target_id;
}