diff --git a/common/defaults/loader.ini b/common/defaults/loader.ini index d488f21b4..69cdde456 100644 --- a/common/defaults/loader.ini +++ b/common/defaults/loader.ini @@ -1,5 +1,6 @@ [hbl_config] title_id=010000000000100D +override_any_app=false path=atmosphere/hbl.nsp override_key=!R diff --git a/stratosphere/ams_mitm/source/utils.cpp b/stratosphere/ams_mitm/source/utils.cpp index 1d5142fc2..4c3d2d916 100644 --- a/stratosphere/ams_mitm/source/utils.cpp +++ b/stratosphere/ams_mitm/source/utils.cpp @@ -380,7 +380,7 @@ Result Utils::SaveSdFileForAtmosphere(u64 title_id, const char *fn, void *data, } bool Utils::IsHblTid(u64 tid) { - return (g_hbl_override_config.override_any_app && IsApplicationTid(tid)) || (!g_hbl_override_config.override_any_app && tid == g_hbl_override_config.title_id); + return (g_hbl_override_config.override_any_app && IsApplicationTid(tid)) || (tid == g_hbl_override_config.title_id); } bool Utils::HasTitleFlag(u64 tid, const char *flag) { @@ -541,7 +541,9 @@ static int FsMitmIniHandler(void *user, const char *section, const char *name, c if (strcasecmp(section, "hbl_config") == 0) { if (strcasecmp(name, "title_id") == 0) { if (strcasecmp(value, "app") == 0) { + /* DEPRECATED */ g_hbl_override_config.override_any_app = true; + g_hbl_override_config.title_id = 0; } else { u64 override_tid = strtoul(value, NULL, 16); @@ -551,6 +553,14 @@ static int FsMitmIniHandler(void *user, const char *section, const char *name, c } } else if (strcasecmp(name, "override_key") == 0) { g_hbl_override_config.override_key = ParseOverrideKey(value); + } else if (strcasecmp(name, "override_any_app") == 0) { + if (strcasecmp(value, "true") == 0 || strcasecmp(value, "1") == 0) { + g_hbl_override_config.override_any_app = true; + } else if (strcasecmp(value, "false") == 0 || strcasecmp(value, "0") == 0) { + g_hbl_override_config.override_any_app = false; + } else { + /* I guess we default to not changing the value? */ + } } } else if (strcasecmp(section, "default_config") == 0) { if (strcasecmp(name, "override_key") == 0) { diff --git a/stratosphere/loader/source/ldr_content_management.cpp b/stratosphere/loader/source/ldr_content_management.cpp index 702e4dc0e..ae014b143 100644 --- a/stratosphere/loader/source/ldr_content_management.cpp +++ b/stratosphere/loader/source/ldr_content_management.cpp @@ -306,9 +306,10 @@ static int LoaderIniHandler(void *user, const char *section, const char *name, c if (strcasecmp(section, "hbl_config") == 0) { if (strcasecmp(name, "title_id") == 0) { if (strcasecmp(value, "app") == 0) { + /* DEPRECATED */ g_hbl_override_config.override_any_app = true; - } - else { + g_hbl_override_config.title_id = 0; + } else { u64 override_tid = strtoul(value, NULL, 16); if (override_tid != 0) { g_hbl_override_config.title_id = override_tid; @@ -322,6 +323,14 @@ static int LoaderIniHandler(void *user, const char *section, const char *name, c g_hbl_sd_path[FS_MAX_PATH] = 0; } else if (strcasecmp(name, "override_key") == 0) { g_hbl_override_config.override_key = ParseOverrideKey(value); + } else if (strcasecmp(name, "override_any_app") == 0) { + if (strcasecmp(value, "true") == 0 || strcasecmp(value, "1") == 0) { + g_hbl_override_config.override_any_app = true; + } else if (strcasecmp(value, "false") == 0 || strcasecmp(value, "0") == 0) { + g_hbl_override_config.override_any_app = false; + } else { + /* I guess we default to not changing the value? */ + } } } else if (strcasecmp(section, "default_config") == 0) { if (strcasecmp(name, "override_key") == 0) { @@ -380,7 +389,7 @@ void ContentManagement::TryMountSdCard() { } static bool IsHBLTitleId(u64 tid) { - return ((g_hbl_override_config.override_any_app && IsApplicationTid(tid)) || (!g_hbl_override_config.override_any_app && tid == g_hbl_override_config.title_id)); + return ((g_hbl_override_config.override_any_app && IsApplicationTid(tid)) || (tid == g_hbl_override_config.title_id)); } OverrideKey ContentManagement::GetTitleOverrideKey(u64 tid) {