This commit is contained in:
Willy-JL
2023-06-25 21:45:21 +01:00
parent 1a0f51bd25
commit ab8295848e
20 changed files with 30 additions and 57 deletions

View File

@@ -3,7 +3,6 @@ App(
name="Basic applications for main menu", name="Basic applications for main menu",
apptype=FlipperAppType.METAPACKAGE, apptype=FlipperAppType.METAPACKAGE,
provides=[ provides=[
"fap_loader",
"subghz", "subghz",
"lfrfid", "lfrfid",
"nfc", "nfc",

View File

@@ -23,7 +23,7 @@ const char* archive_get_flipper_app_name(ArchiveFileTypeEnum file_type) {
return "RFID"; return "RFID";
case ArchiveFileTypeInfrared: case ArchiveFileTypeInfrared:
return "Infrared"; return "Infrared";
case ArchiveFileTypeBadUsb: case ArchiveFileTypeBadKb:
return "Bad KB"; return "Bad KB";
case ArchiveFileTypeU2f: case ArchiveFileTypeU2f:
return "U2F"; return "U2F";
@@ -65,6 +65,7 @@ static void
} }
} else { } else {
loader_start_with_gui_error(loader, furi_string_get_cstr(selected->path), NULL); loader_start_with_gui_error(loader, furi_string_get_cstr(selected->path), NULL);
UNUSED(favorites);
// const char* str = furi_string_get_cstr(selected->path); // const char* str = furi_string_get_cstr(selected->path);
// if(favorites) { // if(favorites) {
// char arg[strlen(str) + 4]; // char arg[strlen(str) + 4];
@@ -75,10 +76,6 @@ static void
// } // }
} }
if(status != LoaderStatusOk) {
FURI_LOG_E(TAG, "loader_start failed: %d", status);
}
furi_record_close(RECORD_LOADER); furi_record_close(RECORD_LOADER);
} }

View File

@@ -1,7 +1,7 @@
App( App(
appid="bad_kb", appid="bad_kb",
name="Bad KB", name="Bad KB",
apptype=FlipperAppType.EXTMAINAPP, apptype=FlipperAppType.APP,
entry_point="bad_kb_app", entry_point="bad_kb_app",
cdefines=["APP_BAD_KB"], cdefines=["APP_BAD_KB"],
requires=[ requires=[

View File

@@ -1,7 +1,7 @@
App( App(
appid="gpio", appid="gpio",
name="GPIO", name="GPIO",
apptype=FlipperAppType.EXTMAINAPP, apptype=FlipperAppType.APP,
entry_point="gpio_app", entry_point="gpio_app",
cdefines=["APP_GPIO"], cdefines=["APP_GPIO"],
requires=["gui"], requires=["gui"],

View File

@@ -1,7 +1,7 @@
App( App(
appid="ibutton", appid="ibutton",
name="iButton", name="iButton",
apptype=FlipperAppType.EXTMAINAPP, apptype=FlipperAppType.APP,
targets=["f7"], targets=["f7"],
entry_point="ibutton_app", entry_point="ibutton_app",
cdefines=["APP_IBUTTON"], cdefines=["APP_IBUTTON"],

View File

@@ -1,7 +1,7 @@
App( App(
appid="infrared", appid="infrared",
name="Infrared", name="Infrared",
apptype=FlipperAppType.EXTMAINAPP, apptype=FlipperAppType.APP,
entry_point="infrared_app", entry_point="infrared_app",
targets=["f7"], targets=["f7"],
cdefines=["APP_INFRARED"], cdefines=["APP_INFRARED"],

View File

@@ -1,7 +1,7 @@
App( App(
appid="lfrfid", appid="lfrfid",
name="RFID", name="RFID",
apptype=FlipperAppType.EXTMAINAPP, apptype=FlipperAppType.APP,
targets=["f7"], targets=["f7"],
entry_point="lfrfid_app", entry_point="lfrfid_app",
cdefines=["APP_LF_RFID"], cdefines=["APP_LF_RFID"],

View File

@@ -1,7 +1,7 @@
App( App(
appid="xtreme_app", appid="xtreme_app",
name="Xtreme", name="Xtreme",
apptype=FlipperAppType.EXTMAINAPP, apptype=FlipperAppType.APP,
entry_point="xtreme_app", entry_point="xtreme_app",
cdefines=["APP_XTREME"], cdefines=["APP_XTREME"],
requires=[ requires=[

View File

@@ -11,7 +11,7 @@ static bool xtreme_app_scene_interface_mainmenu_add_file_browser_callback(
FuriString* item_name) { FuriString* item_name) {
UNUSED(context); UNUSED(context);
Storage* storage = furi_record_open(RECORD_STORAGE); Storage* storage = furi_record_open(RECORD_STORAGE);
bool success = fap_loader_load_name_and_icon(file_path, storage, icon_ptr, item_name); bool success = flipper_application_load_name_and_icon(file_path, storage, icon_ptr, item_name);
furi_record_close(RECORD_STORAGE); furi_record_close(RECORD_STORAGE);
return success; return success;
} }
@@ -32,7 +32,7 @@ void xtreme_app_scene_interface_mainmenu_add_on_enter(void* context) {
if(dialog_file_browser_show(app->dialogs, string, string, &browser_options)) { if(dialog_file_browser_show(app->dialogs, string, string, &browser_options)) {
CharList_push_back(app->mainmenu_app_paths, strdup(furi_string_get_cstr(string))); CharList_push_back(app->mainmenu_app_paths, strdup(furi_string_get_cstr(string)));
Storage* storage = furi_record_open(RECORD_STORAGE); Storage* storage = furi_record_open(RECORD_STORAGE);
fap_loader_load_name_and_icon(string, storage, NULL, string); flipper_application_load_name_and_icon(string, storage, NULL, string);
furi_record_close(RECORD_STORAGE); furi_record_close(RECORD_STORAGE);
CharList_push_back(app->mainmenu_app_names, strdup(furi_string_get_cstr(string))); CharList_push_back(app->mainmenu_app_names, strdup(furi_string_get_cstr(string)));
app->save_mainmenu_apps = true; app->save_mainmenu_apps = true;

View File

@@ -229,7 +229,7 @@ XtremeApp* xtreme_app_alloc() {
furi_string_replace_all(line, "\r", ""); furi_string_replace_all(line, "\r", "");
furi_string_replace_all(line, "\n", ""); furi_string_replace_all(line, "\n", "");
CharList_push_back(app->mainmenu_app_paths, strdup(furi_string_get_cstr(line))); CharList_push_back(app->mainmenu_app_paths, strdup(furi_string_get_cstr(line)));
fap_loader_load_name_and_icon(line, storage, NULL, line); flipper_application_load_name_and_icon(line, storage, NULL, line);
CharList_push_back(app->mainmenu_app_names, strdup(furi_string_get_cstr(line))); CharList_push_back(app->mainmenu_app_names, strdup(furi_string_get_cstr(line)));
} }
} }

View File

@@ -18,7 +18,7 @@
#include "dolphin/dolphin_i.h" #include "dolphin/dolphin_i.h"
#include <lib/flipper_format/flipper_format.h> #include <lib/flipper_format/flipper_format.h>
#include <lib/subghz/subghz_setting.h> #include <lib/subghz/subghz_setting.h>
#include <applications/main/fap_loader/fap_loader_app.h> #include <flipper_application/flipper_application.h>
#include <notification/notification_app.h> #include <notification/notification_app.h>
#include <rgb_backlight.h> #include <rgb_backlight.h>
#include <m-array.h> #include <m-array.h>

View File

@@ -136,7 +136,7 @@ static bool bubble_animation_input_callback(InputEvent* event, void* context) {
} }
} else if(event->type == InputTypeLong) { } else if(event->type == InputTypeLong) {
Loader* loader = furi_record_open(RECORD_LOADER); Loader* loader = furi_record_open(RECORD_LOADER);
loader_start(loader, "Power", "about_battery"); loader_start(loader, "Power", "about_battery", NULL);
furi_record_close(RECORD_LOADER); furi_record_close(RECORD_LOADER);
} }
} }

View File

@@ -73,7 +73,7 @@ static bool one_shot_view_input(InputEvent* event, void* context) {
} }
} else if(event->type == InputTypeLong) { } else if(event->type == InputTypeLong) {
Loader* loader = furi_record_open(RECORD_LOADER); Loader* loader = furi_record_open(RECORD_LOADER);
loader_start(loader, "Power", "about_battery"); loader_start(loader, "Power", "about_battery", NULL);
furi_record_close(RECORD_LOADER); furi_record_close(RECORD_LOADER);
} }
} }

View File

@@ -80,8 +80,8 @@ bool desktop_scene_lock_menu_on_event(void* context, SceneManagerEvent event) {
switch(event.event) { switch(event.event) {
case DesktopLockMenuEventSettings: case DesktopLockMenuEventSettings:
desktop_scene_lock_menu_save_settings(desktop); desktop_scene_lock_menu_save_settings(desktop);
loader_show_settings(furi_record_open(RECORD_LOADER)); // loader_show_settings(furi_record_open(RECORD_LOADER));
furi_record_close(RECORD_LOADER); // furi_record_close(RECORD_LOADER);
consumed = true; consumed = true;
break; break;
case DesktopLockMenuEventLock: case DesktopLockMenuEventLock:
@@ -95,7 +95,7 @@ bool desktop_scene_lock_menu_on_event(void* context, SceneManagerEvent event) {
desktop_lock(desktop, true); desktop_lock(desktop, true);
} else { } else {
LoaderStatus status = LoaderStatus status =
loader_start(desktop->loader, "Desktop", DESKTOP_SETTINGS_RUN_PIN_SETUP_ARG); loader_start(desktop->loader, "Desktop", DESKTOP_SETTINGS_RUN_PIN_SETUP_ARG, NULL);
if(status == LoaderStatusOk) { if(status == LoaderStatusOk) {
scene_manager_set_scene_state(desktop->scene_manager, DesktopSceneLockMenu, 1); scene_manager_set_scene_state(desktop->scene_manager, DesktopSceneLockMenu, 1);
} else { } else {
@@ -114,7 +114,7 @@ bool desktop_scene_lock_menu_on_event(void* context, SceneManagerEvent event) {
furi_record_close(RECORD_POWER); furi_record_close(RECORD_POWER);
} else { } else {
LoaderStatus status = LoaderStatus status =
loader_start(desktop->loader, "Desktop", DESKTOP_SETTINGS_RUN_PIN_SETUP_ARG); loader_start(desktop->loader, "Desktop", DESKTOP_SETTINGS_RUN_PIN_SETUP_ARG, NULL);
if(status == LoaderStatusOk) { if(status == LoaderStatusOk) {
scene_manager_set_scene_state(desktop->scene_manager, DesktopSceneLockMenu, 2); scene_manager_set_scene_state(desktop->scene_manager, DesktopSceneLockMenu, 2);
} else { } else {
@@ -125,7 +125,7 @@ bool desktop_scene_lock_menu_on_event(void* context, SceneManagerEvent event) {
break; break;
case DesktopLockMenuEventXtreme: case DesktopLockMenuEventXtreme:
desktop_scene_lock_menu_save_settings(desktop); desktop_scene_lock_menu_save_settings(desktop);
loader_start(desktop->loader, "Xtreme", NULL); loader_start_with_gui_error(desktop->loader, "Xtreme", NULL);
consumed = true; consumed = true;
break; break;
case DesktopLockMenuEventStealthModeOn: case DesktopLockMenuEventStealthModeOn:

View File

@@ -86,10 +86,7 @@ bool desktop_scene_locked_on_event(void* context, SceneManagerEvent event) {
if(event.type == SceneManagerEventTypeCustom) { if(event.type == SceneManagerEventTypeCustom) {
switch(event.event) { switch(event.event) {
case DesktopLockedEventOpenPowerOff: { case DesktopLockedEventOpenPowerOff: {
LoaderStatus status = loader_start(desktop->loader, "Power", "off"); loader_start(desktop->loader, "Power", "off", NULL);
if(status != LoaderStatusOk) {
FURI_LOG_E(TAG, "loader_start failed: %d", status);
}
consumed = true; consumed = true;
break; break;
} }

View File

@@ -64,14 +64,6 @@ static void
static void desktop_scene_main_start_favorite(Desktop* desktop, FavoriteApp* application) { static void desktop_scene_main_start_favorite(Desktop* desktop, FavoriteApp* application) {
if(strlen(application->name_or_path) > 0) { if(strlen(application->name_or_path) > 0) {
loader_start_with_gui_error(desktop->loader, application->name_or_path, NULL); loader_start_with_gui_error(desktop->loader, application->name_or_path, NULL);
} else {
// No favourite app is set! So we skipping this part
return;
//status = loader_start(desktop->loader, FAP_LOADER_APP_NAME, NULL);
}
if(status != LoaderStatusOk) {
FURI_LOG_E(TAG, "loader_start failed: %d", status);
} }
} }
@@ -167,11 +159,8 @@ bool desktop_scene_main_on_event(void* context, SceneManagerEvent event) {
break; break;
} }
case DesktopMainEventOpenClock: { case DesktopMainEventOpenClock: {
LoaderStatus status = loader_start( loader_start_with_gui_error(
desktop->loader, FAP_LOADER_APP_NAME, EXT_PATH("apps/Misc/Nightstand.fap")); desktop->loader, EXT_PATH("apps/Misc/Nightstand.fap"), NULL);
if(status != LoaderStatusOk) {
FURI_LOG_E(TAG, "loader_start failed: %d", status);
}
break; break;
} }
case DesktopLockedEventUpdate: case DesktopLockedEventUpdate:

View File

@@ -6,7 +6,7 @@ extern "C" {
#endif #endif
#define RECORD_LOADER "loader" #define RECORD_LOADER "loader"
#define LOADER_APPLICATIONS_NAME "Applications" #define LOADER_APPLICATIONS_NAME "Apps"
typedef struct Loader Loader; typedef struct Loader Loader;
@@ -81,4 +81,4 @@ FuriPubSub* loader_get_pubsub(Loader* instance);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@@ -3,6 +3,7 @@
#include "desktop_settings_scene.h" #include "desktop_settings_scene.h"
#include <storage/storage.h> #include <storage/storage.h>
#include <dialogs/dialogs.h> #include <dialogs/dialogs.h>
#include <flipper_application/flipper_application.h>
static bool favorite_fap_selector_item_callback( static bool favorite_fap_selector_item_callback(
FuriString* file_path, FuriString* file_path,
@@ -10,16 +11,9 @@ static bool favorite_fap_selector_item_callback(
uint8_t** icon_ptr, uint8_t** icon_ptr,
FuriString* item_name) { FuriString* item_name) {
UNUSED(context); UNUSED(context);
#ifdef APP_FAP_LOADER
Storage* storage = furi_record_open(RECORD_STORAGE); Storage* storage = furi_record_open(RECORD_STORAGE);
bool success = fap_loader_load_name_and_icon(file_path, storage, icon_ptr, item_name); bool success = flipper_application_load_name_and_icon(file_path, storage, icon_ptr, item_name);
furi_record_close(RECORD_STORAGE); furi_record_close(RECORD_STORAGE);
#else
UNUSED(file_path);
UNUSED(icon_ptr);
UNUSED(item_name);
bool success = false;
#endif
return success; return success;
} }
@@ -54,13 +48,13 @@ void desktop_settings_scene_favorite_on_enter(void* context) {
if(primary_favorite) { // Select favorite item in submenu if(primary_favorite) { // Select favorite item in submenu
if((app->settings.favorite_primary.is_external && if((app->settings.favorite_primary.is_external &&
!strcmp(FLIPPER_APPS[i].name, FAP_LOADER_APP_NAME)) || !strcmp(FLIPPER_APPS[i].name, LOADER_APPLICATIONS_NAME)) ||
(!strcmp(FLIPPER_APPS[i].name, app->settings.favorite_primary.name_or_path))) { (!strcmp(FLIPPER_APPS[i].name, app->settings.favorite_primary.name_or_path))) {
pre_select_item = i; pre_select_item = i;
} }
} else { } else {
if((app->settings.favorite_secondary.is_external && if((app->settings.favorite_secondary.is_external &&
!strcmp(FLIPPER_APPS[i].name, FAP_LOADER_APP_NAME)) || !strcmp(FLIPPER_APPS[i].name, LOADER_APPLICATIONS_NAME)) ||
(!strcmp(FLIPPER_APPS[i].name, app->settings.favorite_secondary.name_or_path))) { (!strcmp(FLIPPER_APPS[i].name, app->settings.favorite_secondary.name_or_path))) {
pre_select_item = i; pre_select_item = i;
} }
@@ -83,7 +77,7 @@ bool desktop_settings_scene_favorite_on_event(void* context, SceneManagerEvent e
scene_manager_get_scene_state(app->scene_manager, DesktopSettingsAppSceneFavorite); scene_manager_get_scene_state(app->scene_manager, DesktopSettingsAppSceneFavorite);
if(event.type == SceneManagerEventTypeCustom) { if(event.type == SceneManagerEventTypeCustom) {
if(strcmp(FLIPPER_APPS[event.event].name, FAP_LOADER_APP_NAME) != 0) { if(strcmp(FLIPPER_APPS[event.event].name, LOADER_APPLICATIONS_NAME) != 0) {
if(primary_favorite) { if(primary_favorite) {
app->settings.favorite_primary.is_external = false; app->settings.favorite_primary.is_external = false;
strncpy( strncpy(

View File

@@ -1,7 +1,6 @@
entry,status,name,type,params entry,status,name,type,params
Version,+,31.0,, Version,+,31.0,,
Header,+,applications/main/archive/helpers/favorite_timeout.h,, Header,+,applications/main/archive/helpers/favorite_timeout.h,,
Header,+,applications/main/fap_loader/fap_loader_app.h,,
Header,+,applications/main/subghz/helpers/subghz_txrx.h,, Header,+,applications/main/subghz/helpers/subghz_txrx.h,,
Header,+,applications/services/bt/bt_service/bt.h,, Header,+,applications/services/bt/bt_service/bt.h,,
Header,+,applications/services/cli/cli.h,, Header,+,applications/services/cli/cli.h,,
@@ -878,7 +877,6 @@ Function,-,expm1l,long double,long double
Function,-,fabs,double,double Function,-,fabs,double,double
Function,-,fabsf,float,float Function,-,fabsf,float,float
Function,-,fabsl,long double,long double Function,-,fabsl,long double,long double
Function,+,fap_loader_load_name_and_icon,_Bool,"FuriString*, Storage*, uint8_t**, FuriString*"
Function,+,favorite_timeout_callback,void,void* Function,+,favorite_timeout_callback,void,void*
Function,+,favorite_timeout_run,void,"ViewDispatcher*, SceneManager*" Function,+,favorite_timeout_run,void,"ViewDispatcher*, SceneManager*"
Function,-,fclose,int,FILE* Function,-,fclose,int,FILE*
@@ -1920,7 +1918,6 @@ Function,+,loader_get_pubsub,FuriPubSub*,Loader*
Function,+,loader_is_locked,_Bool,Loader* Function,+,loader_is_locked,_Bool,Loader*
Function,+,loader_lock,_Bool,Loader* Function,+,loader_lock,_Bool,Loader*
Function,+,loader_show_menu,void,Loader* Function,+,loader_show_menu,void,Loader*
Function,+,loader_show_settings,void,Loader*
Function,+,loader_start,LoaderStatus,"Loader*, const char*, const char*, FuriString*" Function,+,loader_start,LoaderStatus,"Loader*, const char*, const char*, FuriString*"
Function,+,loader_start_with_gui_error,LoaderStatus,"Loader*, const char*, const char*" Function,+,loader_start_with_gui_error,LoaderStatus,"Loader*, const char*, const char*"
Function,+,loader_unlock,void,Loader* Function,+,loader_unlock,void,Loader*
1 entry status name type params
2 Version + 31.0
3 Header + applications/main/archive/helpers/favorite_timeout.h
Header + applications/main/fap_loader/fap_loader_app.h
4 Header + applications/main/subghz/helpers/subghz_txrx.h
5 Header + applications/services/bt/bt_service/bt.h
6 Header + applications/services/cli/cli.h
877 Function - fabs double double
878 Function - fabsf float float
879 Function - fabsl long double long double
Function + fap_loader_load_name_and_icon _Bool FuriString*, Storage*, uint8_t**, FuriString*
880 Function + favorite_timeout_callback void void*
881 Function + favorite_timeout_run void ViewDispatcher*, SceneManager*
882 Function - fclose int FILE*
1918 Function + loader_is_locked _Bool Loader*
1919 Function + loader_lock _Bool Loader*
1920 Function + loader_show_menu void Loader*
Function + loader_show_settings void Loader*
1921 Function + loader_start LoaderStatus Loader*, const char*, const char*, FuriString*
1922 Function + loader_start_with_gui_error LoaderStatus Loader*, const char*, const char*
1923 Function + loader_unlock void Loader*

View File

@@ -74,7 +74,7 @@ void flipper_migrate_files() {
furi_record_close(RECORD_STORAGE); furi_record_close(RECORD_STORAGE);
} }
void flipper_start_service(const FlipperApplication* service) { void flipper_start_service(const FlipperInternalApplication* service) {
FURI_LOG_D(TAG, "Starting service %s", service->name); FURI_LOG_D(TAG, "Starting service %s", service->name);
FuriThread* thread = FuriThread* thread =