mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2024-11-18 01:46:47 +00:00
loader: begin needed support for HBL to use web browser commands
This commit is contained in:
parent
7ddaad615b
commit
48e4688c13
3 changed files with 36 additions and 3 deletions
|
@ -211,6 +211,31 @@ Result ContentManagement::RedirectContentPathForTidSid(const char *path, Registr
|
||||||
return RedirectContentPath(path, tid_sid->title_id, tid_sid->storage_id);
|
return RedirectContentPath(path, tid_sid->title_id, tid_sid->storage_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ContentManagement::RedirectHtmlDocumentPathForHbl(u64 tid, FsStorageId sid) {
|
||||||
|
LrLocationResolver lr;
|
||||||
|
char path[FS_MAX_PATH] = {0};
|
||||||
|
|
||||||
|
/* Open resolver. */
|
||||||
|
if (R_FAILED(lrOpenLocationResolver(sid, &lr))) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Ensure close on exit. */
|
||||||
|
ON_SCOPE_EXIT { serviceClose(&lr.s); };
|
||||||
|
|
||||||
|
/* Only redirect the HTML document path if there is not one already. */
|
||||||
|
if (R_SUCCEEDED(lrLrResolveApplicationHtmlDocumentPath(&lr, tid, path))) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* We just need to set this to any valid NCA path. Let's use the executable path. */
|
||||||
|
if (R_FAILED(lrLrResolveProgramPath(&lr, tid, path))) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
lrLrRedirectApplicationHtmlDocumentPath(&lr, tid, path);
|
||||||
|
}
|
||||||
|
|
||||||
bool ContentManagement::HasCreatedTitle(u64 tid) {
|
bool ContentManagement::HasCreatedTitle(u64 tid) {
|
||||||
return std::find(g_created_titles.begin(), g_created_titles.end(), tid) != g_created_titles.end();
|
return std::find(g_created_titles.begin(), g_created_titles.end(), tid) != g_created_titles.end();
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,6 +37,8 @@ class ContentManagement {
|
||||||
static Result ResolveContentPathForTidSid(char *out_path, Registration::TidSid *tid_sid);
|
static Result ResolveContentPathForTidSid(char *out_path, Registration::TidSid *tid_sid);
|
||||||
static Result RedirectContentPathForTidSid(const char *path, Registration::TidSid *tid_sid);
|
static Result RedirectContentPathForTidSid(const char *path, Registration::TidSid *tid_sid);
|
||||||
|
|
||||||
|
static void RedirectHtmlDocumentPathForHbl(u64 tid, FsStorageId sid);
|
||||||
|
|
||||||
static bool HasCreatedTitle(u64 tid);
|
static bool HasCreatedTitle(u64 tid);
|
||||||
static void SetCreatedTitle(u64 tid);
|
static void SetCreatedTitle(u64 tid);
|
||||||
static void RefreshConfigurationData();
|
static void RefreshConfigurationData();
|
||||||
|
|
|
@ -223,8 +223,14 @@ Result ProcessCreation::CreateProcess(Handle *out_process_h, u64 index, char *nc
|
||||||
|
|
||||||
rc = 0;
|
rc = 0;
|
||||||
|
|
||||||
|
/* If HBL, override HTML document path. */
|
||||||
|
if (ContentManagement::ShouldOverrideContentsWithHBL(target_process->tid_sid.title_id)) {
|
||||||
|
ContentManagement::RedirectHtmlDocumentPathForHbl(target_process->tid_sid.title_id, target_process->tid_sid.storage_id);
|
||||||
|
}
|
||||||
|
|
||||||
/* ECS is a one-shot operation, but we don't clear on failure. */
|
/* ECS is a one-shot operation, but we don't clear on failure. */
|
||||||
ContentManagement::ClearExternalContentSource(target_process->tid_sid.title_id);
|
ContentManagement::ClearExternalContentSource(target_process->tid_sid.title_id);
|
||||||
|
|
||||||
if (mounted_code) {
|
if (mounted_code) {
|
||||||
if (R_SUCCEEDED(rc) && target_process->tid_sid.storage_id != FsStorageId_None) {
|
if (R_SUCCEEDED(rc) && target_process->tid_sid.storage_id != FsStorageId_None) {
|
||||||
rc = ContentManagement::UnmountCode();
|
rc = ContentManagement::UnmountCode();
|
||||||
|
|
Loading…
Reference in a new issue