Temporarily backport app updates from apps repo

This commit is contained in:
Willy-JL
2023-11-12 11:06:02 +00:00
parent 79e7f491fe
commit e309fa8a88
1498 changed files with 1325977 additions and 20227 deletions

View File

@@ -0,0 +1,42 @@
#include <flipper_application/flipper_application.h>
#include <storage/storage.h>
#include <toolbox/stream/stream.h>
#include <toolbox/stream/file_stream.h>
#include "../../cli_helpers.h"
#include "../../cli_plugin_interface.h"
static void handle(PluginState* plugin_state, FuriString* args, Cli* cli) {
UNUSED(args);
UNUSED(cli);
UNUSED(plugin_state);
Storage* storage = furi_record_open(RECORD_STORAGE);
Stream* stream = file_stream_alloc(storage);
if(file_stream_open(
stream, EXT_PATH("apps_assets/totp/cli/cli_help.txt"), FSAM_READ, FSOM_OPEN_EXISTING)) {
uint8_t buffer[32U];
size_t bytes_read;
while((bytes_read = stream_read(stream, &buffer[0], sizeof(buffer))) > 0) {
cli_write(cli, &buffer[0], bytes_read);
}
}
file_stream_close(stream);
stream_free(stream);
furi_record_close(RECORD_STORAGE);
}
static const CliPlugin plugin = {.name = "TOTP CLI Plugin: Help", .handle = &handle};
static const FlipperAppPluginDescriptor plugin_descriptor = {
.appid = PLUGIN_APP_ID,
.ep_api_version = PLUGIN_API_VERSION,
.entry_point = &plugin,
};
const FlipperAppPluginDescriptor* totp_cli_help_plugin_ep() {
return &plugin_descriptor;
}

View File

@@ -0,0 +1,6 @@
#pragma once
#define TOTP_CLI_COMMAND_HELP "help"
#define TOTP_CLI_COMMAND_HELP_ALT "h"
#define TOTP_CLI_COMMAND_HELP_ALT2 "?"
#define TOTP_CLI_PLUGIN_HELP_FILE_NAME "totp_cli_help_plugin"