Xfw app fix crash on load own fap manifest

This commit is contained in:
Willy-JL
2023-03-28 02:33:44 +01:00
parent a25bfddcfd
commit cb58ec1896
3 changed files with 4 additions and 1 deletions

View File

@@ -9,7 +9,8 @@ static bool xtreme_app_scene_interface_mainmenu_add_file_browser_callback(
void* context, void* context,
uint8_t** icon_ptr, uint8_t** icon_ptr,
FuriString* item_name) { FuriString* item_name) {
UNUSED(context); XtremeApp* app = context;
if(furi_string_end_with(file_path, app->fap_name)) return false;
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 = fap_loader_load_name_and_icon(file_path, storage, icon_ptr, item_name);
furi_record_close(RECORD_STORAGE); furi_record_close(RECORD_STORAGE);

View File

@@ -315,6 +315,7 @@ void xtreme_app_free(XtremeApp* app) {
extern int32_t xtreme_app(void* p) { extern int32_t xtreme_app(void* p) {
UNUSED(p); UNUSED(p);
XtremeApp* app = xtreme_app_alloc(); XtremeApp* app = xtreme_app_alloc();
snprintf(app->fap_name, 32, "%s.fap", furi_thread_get_appid(furi_thread_get_current_id()));
scene_manager_next_scene(app->scene_manager, XtremeAppSceneStart); scene_manager_next_scene(app->scene_manager, XtremeAppSceneStart);
view_dispatcher_run(app->view_dispatcher); view_dispatcher_run(app->view_dispatcher);
xtreme_app_free(app); xtreme_app_free(app);

View File

@@ -31,6 +31,7 @@
ARRAY_DEF(CharList, char*) ARRAY_DEF(CharList, char*)
typedef struct { typedef struct {
char fap_name[32];
Gui* gui; Gui* gui;
DialogsApp* dialogs; DialogsApp* dialogs;
NotificationApp* notification; NotificationApp* notification;