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",
apptype=FlipperAppType.METAPACKAGE,
provides=[
"fap_loader",
"subghz",
"lfrfid",
"nfc",

View File

@@ -23,7 +23,7 @@ const char* archive_get_flipper_app_name(ArchiveFileTypeEnum file_type) {
return "RFID";
case ArchiveFileTypeInfrared:
return "Infrared";
case ArchiveFileTypeBadUsb:
case ArchiveFileTypeBadKb:
return "Bad KB";
case ArchiveFileTypeU2f:
return "U2F";
@@ -65,6 +65,7 @@ static void
}
} else {
loader_start_with_gui_error(loader, furi_string_get_cstr(selected->path), NULL);
UNUSED(favorites);
// const char* str = furi_string_get_cstr(selected->path);
// if(favorites) {
// 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);
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -11,7 +11,7 @@ static bool xtreme_app_scene_interface_mainmenu_add_file_browser_callback(
FuriString* item_name) {
UNUSED(context);
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);
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)) {
CharList_push_back(app->mainmenu_app_paths, strdup(furi_string_get_cstr(string)));
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);
CharList_push_back(app->mainmenu_app_names, strdup(furi_string_get_cstr(string)));
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, "\n", "");
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)));
}
}

View File

@@ -18,7 +18,7 @@
#include "dolphin/dolphin_i.h"
#include <lib/flipper_format/flipper_format.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 <rgb_backlight.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) {
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);
}
}

View File

@@ -73,7 +73,7 @@ static bool one_shot_view_input(InputEvent* event, void* context) {
}
} else if(event->type == InputTypeLong) {
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);
}
}

View File

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

View File

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

View File

@@ -64,14 +64,6 @@ static void
static void desktop_scene_main_start_favorite(Desktop* desktop, FavoriteApp* application) {
if(strlen(application->name_or_path) > 0) {
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;
}
case DesktopMainEventOpenClock: {
LoaderStatus status = loader_start(
desktop->loader, FAP_LOADER_APP_NAME, EXT_PATH("apps/Misc/Nightstand.fap"));
if(status != LoaderStatusOk) {
FURI_LOG_E(TAG, "loader_start failed: %d", status);
}
loader_start_with_gui_error(
desktop->loader, EXT_PATH("apps/Misc/Nightstand.fap"), NULL);
break;
}
case DesktopLockedEventUpdate:

View File

@@ -6,7 +6,7 @@ extern "C" {
#endif
#define RECORD_LOADER "loader"
#define LOADER_APPLICATIONS_NAME "Applications"
#define LOADER_APPLICATIONS_NAME "Apps"
typedef struct Loader Loader;

View File

@@ -3,6 +3,7 @@
#include "desktop_settings_scene.h"
#include <storage/storage.h>
#include <dialogs/dialogs.h>
#include <flipper_application/flipper_application.h>
static bool favorite_fap_selector_item_callback(
FuriString* file_path,
@@ -10,16 +11,9 @@ static bool favorite_fap_selector_item_callback(
uint8_t** icon_ptr,
FuriString* item_name) {
UNUSED(context);
#ifdef APP_FAP_LOADER
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);
#else
UNUSED(file_path);
UNUSED(icon_ptr);
UNUSED(item_name);
bool success = false;
#endif
return success;
}
@@ -54,13 +48,13 @@ void desktop_settings_scene_favorite_on_enter(void* context) {
if(primary_favorite) { // Select favorite item in submenu
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))) {
pre_select_item = i;
}
} else {
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))) {
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);
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) {
app->settings.favorite_primary.is_external = false;
strncpy(

View File

@@ -1,7 +1,6 @@
entry,status,name,type,params
Version,+,31.0,,
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/services/bt/bt_service/bt.h,,
Header,+,applications/services/cli/cli.h,,
@@ -878,7 +877,6 @@ Function,-,expm1l,long double,long double
Function,-,fabs,double,double
Function,-,fabsf,float,float
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_run,void,"ViewDispatcher*, SceneManager*"
Function,-,fclose,int,FILE*
@@ -1920,7 +1918,6 @@ Function,+,loader_get_pubsub,FuriPubSub*,Loader*
Function,+,loader_is_locked,_Bool,Loader*
Function,+,loader_lock,_Bool,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_with_gui_error,LoaderStatus,"Loader*, const char*, const char*"
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);
}
void flipper_start_service(const FlipperApplication* service) {
void flipper_start_service(const FlipperInternalApplication* service) {
FURI_LOG_D(TAG, "Starting service %s", service->name);
FuriThread* thread =