Revert "Merge pull request #381 from ESurge/420"

This reverts commit 1c1e87c9dc, reversing
changes made to ffbb11999d.
This commit is contained in:
RogueMaster
2022-10-26 18:10:16 -04:00
parent 7dffb2097b
commit 3b6a011456
2 changed files with 5 additions and 50 deletions
@@ -45,31 +45,10 @@ static void archive_run_in_app(ArchiveBrowserView* browser, ArchiveFile_t* selec
if(param != NULL) {
param++;
}
if(strcmp(flipper_app_name[selected->type], "U2F") == 0) {
char* tmpType = "/ext/apps/Main/U2F.fap¯";
char* result =
malloc(strlen(tmpType) + strlen(furi_string_get_cstr(selected->path)) + 1);
strcpy(result, tmpType);
strcat(result, furi_string_get_cstr(selected->path));
status = loader_start(loader, "Applications", result);
} else {
status = loader_start(loader, flipper_app_name[selected->type], param);
}
status = loader_start(loader, flipper_app_name[selected->type], param);
} else {
if(strcmp(flipper_app_name[selected->type], "iButton") == 0) {
char* tmpType = "/ext/apps/Main/ibutton.fap¯";
char* result =
malloc(strlen(tmpType) + strlen(furi_string_get_cstr(selected->path)) + 1);
strcpy(result, tmpType);
strcat(result, furi_string_get_cstr(selected->path));
status = loader_start(loader, "Applications", result);
} else {
status = loader_start(
loader, flipper_app_name[selected->type], furi_string_get_cstr(selected->path));
}
status = loader_start(
loader, flipper_app_name[selected->type], furi_string_get_cstr(selected->path));
}
if(status != LoaderStatusOk) {
+2 -26
View File
@@ -16,7 +16,6 @@ struct FapLoader {
DialogsApp* dialogs;
Gui* gui;
FuriString* fap_path;
FuriString* fap_args;
ViewDispatcher* view_dispatcher;
Loading* loading;
};
@@ -104,9 +103,7 @@ static bool fap_loader_run_selected_app(FapLoader* loader) {
FURI_LOG_I(TAG, "Loaded in %ums", (size_t)(furi_get_tick() - start));
FURI_LOG_I(TAG, "FAP Loader is starting app");
FURI_LOG_I(TAG, "loader->fap_args: %s", furi_string_get_cstr(loader->fap_args));
FuriThread* thread =
flipper_application_spawn(loader->app, (void*)furi_string_get_cstr(loader->fap_args));
FuriThread* thread = flipper_application_spawn(loader->app, NULL);
furi_thread_start(thread);
furi_thread_join(thread);
@@ -158,27 +155,7 @@ static bool fap_loader_select_app(FapLoader* loader) {
static FapLoader* fap_loader_alloc(const char* path) {
FapLoader* loader = malloc(sizeof(FapLoader));
char* tmp = malloc(strlen(path) + 1);
strcpy(tmp, path);
char* new_path;
new_path = strtok(tmp, "¯");
if(new_path) {
loader->fap_path = furi_string_alloc_set(new_path);
} else {
loader->fap_path = furi_string_alloc_set(path);
}
new_path = strtok(NULL, "¯");
if(new_path) {
loader->fap_args = furi_string_alloc_set(new_path);
} else {
loader->fap_args = NULL;
}
loader->fap_path = furi_string_alloc_set(path);
loader->storage = furi_record_open(RECORD_STORAGE);
loader->dialogs = furi_record_open(RECORD_DIALOGS);
loader->gui = furi_record_open(RECORD_GUI);
@@ -195,7 +172,6 @@ static void fap_loader_free(FapLoader* loader) {
loading_free(loader->loading);
view_dispatcher_free(loader->view_dispatcher);
furi_string_free(loader->fap_path);
furi_string_free(loader->fap_args);
furi_record_close(RECORD_GUI);
furi_record_close(RECORD_DIALOGS);
furi_record_close(RECORD_STORAGE);