mirror of
https://github.com/flipperdevices/flipperzero-firmware.git
synced 2025-12-12 12:51:22 +04:00
NFC: Add support for Gallagher access control (MIFARE Classic only) (#3306)
* Merge remote-tracking branch 'origin/dev' into dev * Add basic API interface (inspired by advanced plugins example), modify NfcSupportedCardsLoadContext to contain a pointer to a resolver * WIP: API resolver implemented / passed to plugin via context, still having resolution issues * Attempt to add constants to the nfc_app_api_table list * WIP: We're defining the constants directly in nfc_app_api.c to see if this fixes our woes, which it does not. * WIP: Remove furi_assert(false) (lmao) * Working implementation of Gallagher decoding via exposed plugin API * lib: api_hashtable: change log level for symbol not found message * nfc app: alloc composite resolver along with supported cards * nfc app: rework nfc api structure * nfc app: fix memory leakage in supported cards Co-authored-by: gornekich <n.gorbadey@gmail.com>
This commit is contained in:
27
applications/main/nfc/api/nfc_app_api_table.cpp
Normal file
27
applications/main/nfc/api/nfc_app_api_table.cpp
Normal file
@@ -0,0 +1,27 @@
|
||||
#include <flipper_application/api_hashtable/api_hashtable.h>
|
||||
#include <flipper_application/api_hashtable/compilesort.hpp>
|
||||
|
||||
/*
|
||||
* This file contains an implementation of a symbol table
|
||||
* with private app's symbols. It is used by composite API resolver
|
||||
* to load plugins that use internal application's APIs.
|
||||
*/
|
||||
#include "nfc_app_api_table_i.h"
|
||||
|
||||
static_assert(!has_hash_collisions(nfc_app_api_table), "Detected API method hash collision!");
|
||||
|
||||
constexpr HashtableApiInterface nfc_application_hashtable_api_interface{
|
||||
{
|
||||
.api_version_major = 0,
|
||||
.api_version_minor = 0,
|
||||
/* generic resolver using pre-sorted array */
|
||||
.resolver_callback = &elf_resolve_from_hashtable,
|
||||
},
|
||||
/* pointers to application's API table boundaries */
|
||||
.table_cbegin = nfc_app_api_table.cbegin(),
|
||||
.table_cend = nfc_app_api_table.cend(),
|
||||
};
|
||||
|
||||
/* Casting to generic resolver to use in Composite API resolver */
|
||||
extern "C" const ElfApiInterface* const nfc_application_api_interface =
|
||||
&nfc_application_hashtable_api_interface;
|
||||
Reference in New Issue
Block a user