namespace sts -> namespace ams

namespace sts::ams -> ams::exosphere, ams::.

This is to facilitate future use of ams:: namespace code in
mesosphere, as we'll want to include ams::util, ams::result, ams::svc...
This commit is contained in:
Michael Scire
2019-10-24 02:30:10 -07:00
committed by SciresM
parent 4059dc6187
commit 8cb77ac136
397 changed files with 968 additions and 926 deletions

View File

@@ -46,7 +46,7 @@ extern "C" {
void __libstratosphere_exception_handler(AtmosphereFatalErrorContext *ctx);
}
sts::ncm::TitleId __stratosphere_title_id = sts::ncm::TitleId::AtmosphereMitm;
ams::ncm::TitleId __stratosphere_title_id = ams::ncm::TitleId::AtmosphereMitm;
void __libnx_exception_handler(ThreadExceptionDump *ctx) {
StratosphereCrashHandler(ctx);
@@ -93,7 +93,7 @@ void __appExit(void) {
int main(int argc, char **argv)
{
consoleDebugInit(debugDevice_SVC);
sts::os::Thread initializer_thread;
ams::os::Thread initializer_thread;
LaunchAllMitmModules();

View File

@@ -27,7 +27,7 @@
#include "ns_mitm/nsmitm_main.hpp"
#include "hid_mitm/hidmitm_main.hpp"
static sts::os::Thread g_module_threads[MitmModuleId_Count];
static ams::os::Thread g_module_threads[MitmModuleId_Count];
static const struct {
ThreadFunc main;

View File

@@ -27,17 +27,17 @@ class BpcMitmService : public IMitmServiceObject {
RebootSystem = 1,
};
public:
BpcMitmService(std::shared_ptr<Service> s, u64 pid, sts::ncm::TitleId tid) : IMitmServiceObject(s, pid, tid) {
BpcMitmService(std::shared_ptr<Service> s, u64 pid, ams::ncm::TitleId tid) : IMitmServiceObject(s, pid, tid) {
/* ... */
}
static bool ShouldMitm(u64 pid, sts::ncm::TitleId tid) {
static bool ShouldMitm(u64 pid, ams::ncm::TitleId tid) {
/* We will mitm:
* - am, to intercept the Reboot/Power buttons in the overlay menu.
* - fatal, to simplify payload reboot logic significantly
* - applications, to allow homebrew to take advantage of the feature.
*/
return tid == sts::ncm::TitleId::Am || tid == sts::ncm::TitleId::Fatal || sts::ncm::IsApplicationTitleId(tid) || Utils::IsHblTid(static_cast<u64>(tid));
return tid == ams::ncm::TitleId::Am || tid == ams::ncm::TitleId::Fatal || ams::ncm::IsApplicationTitleId(tid) || Utils::IsHblTid(static_cast<u64>(tid));
}
static void PostProcess(IMitmServiceObject *obj, IpcResponseContext *ctx);

View File

@@ -32,7 +32,7 @@ Result FsDirUtils::CopyFile(IFileSystem *dst_fs, IFileSystem *src_fs, const FsPa
{
FsPath dst_path;
/* TODO: Error code? N aborts here. */
STS_ASSERT(static_cast<size_t>(snprintf(dst_path.str, sizeof(dst_path.str), "%s%s", dst_parent_path.str, dir_ent->name)) < sizeof(dst_path));
AMS_ASSERT(static_cast<size_t>(snprintf(dst_path.str, sizeof(dst_path.str), "%s%s", dst_parent_path.str, dir_ent->name)) < sizeof(dst_path));
R_TRY(dst_fs->CreateFile(dst_path, file_size));
R_TRY(dst_fs->OpenFile(dst_file, dst_path, OpenMode_Write));

View File

@@ -30,14 +30,14 @@ static char *GetNormalizedDirectory(const char *dir_prefix) {
/* Ensure terminating '/' */
if (normal_path[normal_path_len-1] != '/') {
STS_ASSERT(normal_path_len + 2 <= sizeof(normal_path));
AMS_ASSERT(normal_path_len + 2 <= sizeof(normal_path));
strncat(normal_path, "/", 2);
normal_path[sizeof(normal_path)-1] = 0;
normal_path_len++;
}
char *output = static_cast<char *>(std::malloc(normal_path_len + 1));
STS_ASSERT(output != nullptr);
AMS_ASSERT(output != nullptr);
std::strncpy(output, normal_path, normal_path_len + 1);
output[normal_path_len] = 0;

View File

@@ -119,7 +119,7 @@ Result DirectorySaveDataFileSystem::AllocateWorkBuffer(void **out_buf, size_t *o
/* Divide size by two. */
try_size >>= 1;
STS_ASSERT(try_size > 0x200);
AMS_ASSERT(try_size > 0x200);
}
/* TODO: Return a result here? Nintendo does not, but they have other allocation failed results. */

View File

@@ -37,7 +37,7 @@ class DirectorySaveDataFileSystem : public IFileSystem {
std::unique_ptr<IFileSystem> unique_fs;
std::unique_ptr<IFileSystem> proxy_save_fs;
IFileSystem *fs;
sts::os::Mutex lock;
ams::os::Mutex lock;
size_t open_writable_files = 0;
public:

View File

@@ -261,7 +261,7 @@ Result FsPathUtils::Normalize(char *out, size_t max_out_size, const char *src, s
/* Assert normalized. */
bool normalized = false;
R_ASSERT(FsPathUtils::IsNormalized(&normalized, out));
STS_ASSERT(normalized);
AMS_ASSERT(normalized);
return ResultSuccess();
}

View File

@@ -34,7 +34,7 @@ Result SubDirectoryFileSystem::Initialize(const char *bp) {
/* Ensure terminating '/' */
if (normal_path[normal_path_len-1] != '/') {
STS_ASSERT(normal_path_len + 2 <= sizeof(normal_path));
AMS_ASSERT(normal_path_len + 2 <= sizeof(normal_path));
strncat(normal_path, "/", 2);
normal_path[sizeof(normal_path)-1] = 0;

View File

@@ -20,7 +20,7 @@
#include "fsmitm_boot0storage.hpp"
static sts::os::Mutex g_boot0_mutex;
static ams::os::Mutex g_boot0_mutex;
static u8 g_boot0_bct_buffer[Boot0Storage::BctEndOffset];
bool Boot0Storage::CanModifyBctPubks() {
@@ -28,11 +28,11 @@ bool Boot0Storage::CanModifyBctPubks() {
/* RCM bug patched. */
/* Only allow NS to update the BCT pubks. */
/* AutoRCM on a patched unit will cause a brick, so homebrew should NOT be allowed to write. */
return this->title_id == sts::ncm::TitleId::Ns;
return this->title_id == ams::ncm::TitleId::Ns;
} else {
/* RCM bug unpatched. */
/* Allow homebrew but not NS to update the BCT pubks. */
return this->title_id != sts::ncm::TitleId::Ns;
return this->title_id != ams::ncm::TitleId::Ns;
}
}

View File

@@ -131,12 +131,12 @@ class Boot0Storage : public SectoredProxyStorage<0x200> {
static constexpr u64 EksSize = 0x4000;
static constexpr u64 EksEnd = EksStart + EksSize;
private:
sts::ncm::TitleId title_id;
ams::ncm::TitleId title_id;
private:
bool CanModifyBctPubks();
public:
Boot0Storage(FsStorage *s, sts::ncm::TitleId t) : Base(s), title_id(t) { }
Boot0Storage(FsStorage s, sts::ncm::TitleId t) : Base(s), title_id(t) { }
Boot0Storage(FsStorage *s, ams::ncm::TitleId t) : Base(s), title_id(t) { }
Boot0Storage(FsStorage s, ams::ncm::TitleId t) : Base(s), title_id(t) { }
public:
virtual Result Read(void *_buffer, size_t size, u64 offset) override;
virtual Result Write(void *_buffer, size_t size, u64 offset) override;

View File

@@ -93,7 +93,7 @@ Result LayeredRomFS::Read(void *buffer, size_t size, u64 offset) {
R_ASSERT(Utils::OpenSdFileForAtmosphere(this->title_id, ROMFS_METADATA_FILE_PATH, FS_OPEN_READ, &file));
size_t out_read;
R_ASSERT(fsFileRead(&file, (offset - cur_source->virtual_offset), (void *)((uintptr_t)buffer + read_so_far), cur_read_size, FS_READOPTION_NONE, &out_read));
STS_ASSERT(out_read == cur_read_size);
AMS_ASSERT(out_read == cur_read_size);
fsFileClose(&file);
}
break;
@@ -103,7 +103,7 @@ Result LayeredRomFS::Read(void *buffer, size_t size, u64 offset) {
R_ASSERT(Utils::OpenRomFSSdFile(this->title_id, cur_source->loose_source_info.path, FS_OPEN_READ, &file));
size_t out_read;
R_ASSERT(fsFileRead(&file, (offset - cur_source->virtual_offset), (void *)((uintptr_t)buffer + read_so_far), cur_read_size, FS_READOPTION_NONE, &out_read));
STS_ASSERT(out_read == cur_read_size);
AMS_ASSERT(out_read == cur_read_size);
fsFileClose(&file);
}
break;
@@ -122,7 +122,7 @@ Result LayeredRomFS::Read(void *buffer, size_t size, u64 offset) {
R_ASSERT(this->file_romfs->Read((void *)((uintptr_t)buffer + read_so_far), cur_read_size, cur_source->base_source_info.offset + (offset - cur_source->virtual_offset)));
}
break;
STS_UNREACHABLE_DEFAULT_CASE();
AMS_UNREACHABLE_DEFAULT_CASE();
}
read_so_far += cur_read_size;
offset += cur_read_size;

View File

@@ -39,7 +39,7 @@ void RomFSBuildContext::VisitDirectory(FsFileSystem *filesys, RomFSBuildDirector
break;
}
STS_ASSERT(this->dir_entry.type == ENTRYTYPE_DIR || this->dir_entry.type == ENTRYTYPE_FILE);
AMS_ASSERT(this->dir_entry.type == ENTRYTYPE_DIR || this->dir_entry.type == ENTRYTYPE_FILE);
if (this->dir_entry.type == ENTRYTYPE_DIR) {
RomFSBuildDirectoryContext *child = new RomFSBuildDirectoryContext({0});
/* Set child's path. */
@@ -179,7 +179,7 @@ void RomFSBuildContext::VisitDirectory(RomFSBuildDirectoryContext *parent, u32 p
void RomFSBuildContext::MergeRomStorage(IROStorage *storage, RomFSDataSource source) {
RomFSHeader header;
R_ASSERT(storage->Read(&header, sizeof(header), 0));
STS_ASSERT(header.header_size == sizeof(header));
AMS_ASSERT(header.header_size == sizeof(header));
/* Read tables. */
auto dir_table = std::make_unique<u8[]>(header.dir_table_size);

View File

@@ -36,10 +36,10 @@
#include "../debug.hpp"
static sts::os::Mutex g_StorageCacheLock;
static ams::os::Mutex g_StorageCacheLock;
static std::unordered_map<u64, std::weak_ptr<IStorageInterface>> g_StorageCache;
static bool StorageCacheGetEntry(sts::ncm::TitleId title_id, std::shared_ptr<IStorageInterface> *out) {
static bool StorageCacheGetEntry(ams::ncm::TitleId title_id, std::shared_ptr<IStorageInterface> *out) {
std::scoped_lock lock(g_StorageCacheLock);
if (g_StorageCache.find(static_cast<u64>(title_id)) == g_StorageCache.end()) {
return false;
@@ -53,7 +53,7 @@ static bool StorageCacheGetEntry(sts::ncm::TitleId title_id, std::shared_ptr<ISt
return false;
}
static void StorageCacheSetEntry(sts::ncm::TitleId title_id, std::shared_ptr<IStorageInterface> *ptr) {
static void StorageCacheSetEntry(ams::ncm::TitleId title_id, std::shared_ptr<IStorageInterface> *ptr) {
std::scoped_lock lock(g_StorageCacheLock);
/* Ensure we always use the cached copy if present. */
@@ -145,7 +145,7 @@ Result FsMitmService::OpenFileSystemWithId(Out<std::shared_ptr<IFileSystemInterf
Result FsMitmService::OpenSdCardFileSystem(Out<std::shared_ptr<IFileSystemInterface>> out_fs) {
/* We only care about redirecting this for NS/Emummc. */
if (this->title_id != sts::ncm::TitleId::Ns) {
if (this->title_id != ams::ncm::TitleId::Ns) {
return ResultAtmosphereMitmShouldForwardToSession;
}
if (!IsEmummc()) {
@@ -234,7 +234,7 @@ Result FsMitmService::OpenBisStorage(Out<std::shared_ptr<IStorageInterface>> out
FsStorage bis_storage;
R_TRY(fsOpenBisStorageFwd(this->forward_service.get(), &bis_storage, bis_partition_id));
const bool is_sysmodule = sts::ncm::IsSystemTitleId(this->title_id);
const bool is_sysmodule = ams::ncm::IsSystemTitleId(this->title_id);
const bool has_bis_write_flag = Utils::HasFlag(static_cast<u64>(this->title_id), "bis_write");
const bool has_cal0_read_flag = Utils::HasFlag(static_cast<u64>(this->title_id), "cal_read");
@@ -345,7 +345,7 @@ Result FsMitmService::OpenDataStorageByDataId(Out<std::shared_ptr<IStorageInterf
/* Try to get from the cache. */
{
std::shared_ptr<IStorageInterface> cached_storage = nullptr;
bool has_cache = StorageCacheGetEntry(sts::ncm::TitleId{data_id}, &cached_storage);
bool has_cache = StorageCacheGetEntry(ams::ncm::TitleId{data_id}, &cached_storage);
if (has_cache) {
if (out_storage.IsDomain()) {
@@ -374,7 +374,7 @@ Result FsMitmService::OpenDataStorageByDataId(Out<std::shared_ptr<IStorageInterf
storage_to_cache = std::make_shared<IStorageInterface>(new LayeredRomFS(std::make_shared<ReadOnlyStorageAdapter>(new ProxyStorage(data_storage)), nullptr, data_id));
}
StorageCacheSetEntry(sts::ncm::TitleId{data_id}, &storage_to_cache);
StorageCacheSetEntry(ams::ncm::TitleId{data_id}, &storage_to_cache);
out_storage.SetValue(std::move(storage_to_cache));
if (out_storage.IsDomain()) {

View File

@@ -44,15 +44,15 @@ class FsMitmService : public IMitmServiceObject {
bool has_initialized = false;
bool should_override_contents;
public:
FsMitmService(std::shared_ptr<Service> s, u64 pid, sts::ncm::TitleId tid) : IMitmServiceObject(s, pid, tid) {
FsMitmService(std::shared_ptr<Service> s, u64 pid, ams::ncm::TitleId tid) : IMitmServiceObject(s, pid, tid) {
if (Utils::HasSdDisableMitMFlag(static_cast<u64>(this->title_id))) {
this->should_override_contents = false;
} else {
this->should_override_contents = (this->title_id >= sts::ncm::TitleId::ApplicationStart || Utils::HasSdMitMFlag(static_cast<u64>(this->title_id))) && Utils::HasOverrideButton(static_cast<u64>(this->title_id));
this->should_override_contents = (this->title_id >= ams::ncm::TitleId::ApplicationStart || Utils::HasSdMitMFlag(static_cast<u64>(this->title_id))) && Utils::HasOverrideButton(static_cast<u64>(this->title_id));
}
}
static bool ShouldMitm(u64 pid, sts::ncm::TitleId tid) {
static bool ShouldMitm(u64 pid, ams::ncm::TitleId tid) {
/* Don't Mitm KIPs */
if (pid < 0x50) {
return false;
@@ -62,11 +62,11 @@ class FsMitmService : public IMitmServiceObject {
/* TODO: intercepting everything seems to cause issues with sleep mode, for some reason. */
/* Figure out why, and address it. */
if (tid == sts::ncm::TitleId::AppletQlaunch || tid == sts::ncm::TitleId::AppletMaintenanceMenu) {
if (tid == ams::ncm::TitleId::AppletQlaunch || tid == ams::ncm::TitleId::AppletMaintenanceMenu) {
has_launched_qlaunch = true;
}
return has_launched_qlaunch || tid == sts::ncm::TitleId::Ns || tid >= sts::ncm::TitleId::ApplicationStart || Utils::HasSdMitMFlag(static_cast<u64>(tid));
return has_launched_qlaunch || tid == ams::ncm::TitleId::Ns || tid >= ams::ncm::TitleId::ApplicationStart || Utils::HasSdMitMFlag(static_cast<u64>(tid));
}
static void PostProcess(IMitmServiceObject *obj, IpcResponseContext *ctx);

View File

@@ -28,13 +28,13 @@ class HidMitmService : public IMitmServiceObject {
private:
bool should_set_system_ext = false;
public:
HidMitmService(std::shared_ptr<Service> s, u64 pid, sts::ncm::TitleId tid) : IMitmServiceObject(s, pid, tid) {
HidMitmService(std::shared_ptr<Service> s, u64 pid, ams::ncm::TitleId tid) : IMitmServiceObject(s, pid, tid) {
/* ... */
}
~HidMitmService();
static bool ShouldMitm(u64 pid, sts::ncm::TitleId tid) {
static bool ShouldMitm(u64 pid, ams::ncm::TitleId tid) {
/* TODO: Consider removing in Atmosphere 0.10.0/1.0.0. */
/* We will mitm:
* - hbl, to help homebrew not need to be recompiled.

View File

@@ -28,11 +28,11 @@ class NsAmMitmService : public IMitmServiceObject {
GetRunningApplicationProgramId = 92,
};
public:
NsAmMitmService(std::shared_ptr<Service> s, u64 pid, sts::ncm::TitleId tid) : IMitmServiceObject(s, pid, tid) {
NsAmMitmService(std::shared_ptr<Service> s, u64 pid, ams::ncm::TitleId tid) : IMitmServiceObject(s, pid, tid) {
/* ... */
}
static bool ShouldMitm(u64 pid, sts::ncm::TitleId tid) {
static bool ShouldMitm(u64 pid, ams::ncm::TitleId tid) {
/* We will mitm:
* - web applets, to facilitate hbl web browser launching.
*/

View File

@@ -67,11 +67,11 @@ class NsWebMitmService : public IMitmServiceObject {
GetDocumentInterface = 7999,
};
public:
NsWebMitmService(std::shared_ptr<Service> s, u64 pid, sts::ncm::TitleId tid) : IMitmServiceObject(s, pid, tid) {
NsWebMitmService(std::shared_ptr<Service> s, u64 pid, ams::ncm::TitleId tid) : IMitmServiceObject(s, pid, tid) {
/* ... */
}
static bool ShouldMitm(u64 pid, sts::ncm::TitleId tid) {
static bool ShouldMitm(u64 pid, ams::ncm::TitleId tid) {
/* We will mitm:
* - web applets, to facilitate hbl web browser launching.
*/

View File

@@ -43,7 +43,7 @@ bool SetMitmService::IsValidLanguageCode(u64 lang_code) {
LanguageCode_SimplifiedChinese,
LanguageCode_TraditionalChinese,
};
size_t num_language_codes = sts::util::size(s_valid_language_codes);
size_t num_language_codes = ams::util::size(s_valid_language_codes);
if (GetRuntimeFirmwareVersion() < FirmwareVersion_400) {
/* 4.0.0 added simplified and traditional chinese. */
num_language_codes -= 2;
@@ -67,7 +67,7 @@ Result SetMitmService::EnsureLocale() {
if (!this->got_locale) {
std::memset(&this->locale, 0xCC, sizeof(this->locale));
if (this->title_id == sts::ncm::TitleId::Ns) {
if (this->title_id == ams::ncm::TitleId::Ns) {
u64 app_pid = 0;
u64 app_tid = 0;
R_TRY(pmdmntGetApplicationPid(&app_pid));

View File

@@ -27,17 +27,17 @@ class SetMitmService : public IMitmServiceObject {
GetRegionCode = 4,
};
private:
sts::os::Mutex lock;
ams::os::Mutex lock;
OverrideLocale locale;
bool got_locale;
public:
SetMitmService(std::shared_ptr<Service> s, u64 pid, sts::ncm::TitleId tid) : IMitmServiceObject(s, pid, tid) {
SetMitmService(std::shared_ptr<Service> s, u64 pid, ams::ncm::TitleId tid) : IMitmServiceObject(s, pid, tid) {
this->got_locale = false;
}
static bool ShouldMitm(u64 pid, sts::ncm::TitleId tid) {
static bool ShouldMitm(u64 pid, ams::ncm::TitleId tid) {
/* Mitm all applications. */
return tid == sts::ncm::TitleId::Ns || sts::ncm::IsApplicationTitleId(tid);
return tid == ams::ncm::TitleId::Ns || ams::ncm::IsApplicationTitleId(tid);
}
static void PostProcess(IMitmServiceObject *obj, IpcResponseContext *ctx);

View File

@@ -19,7 +19,7 @@
#include "setsys_firmware_version.hpp"
static sts::os::Mutex g_version_mutex;
static ams::os::Mutex g_version_mutex;
static bool g_got_version = false;
static SetSysFirmwareVersion g_ams_fw_version = {0};
static SetSysFirmwareVersion g_fw_version = {0};
@@ -32,7 +32,7 @@ void VersionManager::Initialize() {
}
/* Mount firmware version data archive. */
R_ASSERT(romfsMountFromDataArchive(static_cast<u64>(sts::ncm::TitleId::ArchiveSystemVersion), FsStorageId_NandSystem, "sysver"));
R_ASSERT(romfsMountFromDataArchive(static_cast<u64>(ams::ncm::TitleId::ArchiveSystemVersion), FsStorageId_NandSystem, "sysver"));
{
ON_SCOPE_EXIT { romfsUnmount("sysver"); };
@@ -40,11 +40,11 @@ void VersionManager::Initialize() {
/* Firmware version file must exist. */
FILE *f = fopen("sysver:/file", "rb");
STS_ASSERT(f != NULL);
AMS_ASSERT(f != NULL);
ON_SCOPE_EXIT { fclose(f); };
/* Must be possible to read firmware version from file. */
STS_ASSERT(fread(&fw_ver, sizeof(fw_ver), 1, f) == 1);
AMS_ASSERT(fread(&fw_ver, sizeof(fw_ver), 1, f) == 1);
g_fw_version = fw_ver;
g_ams_fw_version = fw_ver;
@@ -65,11 +65,11 @@ void VersionManager::Initialize() {
g_got_version = true;
}
Result VersionManager::GetFirmwareVersion(sts::ncm::TitleId title_id, SetSysFirmwareVersion *out) {
Result VersionManager::GetFirmwareVersion(ams::ncm::TitleId title_id, SetSysFirmwareVersion *out) {
VersionManager::Initialize();
/* Report atmosphere string to qlaunch, maintenance and nothing else. */
if (title_id == sts::ncm::TitleId::AppletQlaunch || title_id == sts::ncm::TitleId::AppletMaintenanceMenu) {
if (title_id == ams::ncm::TitleId::AppletQlaunch || title_id == ams::ncm::TitleId::AppletMaintenanceMenu) {
*out = g_ams_fw_version;
} else {
*out = g_fw_version;

View File

@@ -21,5 +21,5 @@
class VersionManager {
public:
static void Initialize();
static Result GetFirmwareVersion(sts::ncm::TitleId title_id, SetSysFirmwareVersion *out);
static Result GetFirmwareVersion(ams::ncm::TitleId title_id, SetSysFirmwareVersion *out);
};

View File

@@ -29,11 +29,11 @@ class SetSysMitmService : public IMitmServiceObject {
GetSettingsItemValue = 38,
};
public:
SetSysMitmService(std::shared_ptr<Service> s, u64 pid, sts::ncm::TitleId tid) : IMitmServiceObject(s, pid, tid) {
SetSysMitmService(std::shared_ptr<Service> s, u64 pid, ams::ncm::TitleId tid) : IMitmServiceObject(s, pid, tid) {
/* ... */
}
static bool ShouldMitm(u64 pid, sts::ncm::TitleId tid) {
static bool ShouldMitm(u64 pid, ams::ncm::TitleId tid) {
/* Mitm everything. */
return true;
}

View File

@@ -35,7 +35,7 @@ struct SettingsItemValue {
std::map<std::string, SettingsItemValue> g_settings_items;
static bool g_threw_fatal = false;
static sts::os::Thread g_fatal_thread;
static ams::os::Thread g_fatal_thread;
static void FatalThreadFunc(void *arg) {
svcSleepThread(5000000000ULL);

View File

@@ -31,7 +31,7 @@
static FsFileSystem g_sd_filesystem = {0};
/* Non-autoclear events for SD/HID init. */
static sts::os::Event g_sd_event(false), g_hid_event(false);
static ams::os::Event g_sd_event(false), g_hid_event(false);
static std::vector<u64> g_mitm_flagged_tids;
static std::vector<u64> g_disable_mitm_flagged_tids;
@@ -55,7 +55,7 @@ static HblOverrideConfig g_hbl_override_config = {
.key_combination = KEY_R,
.override_by_default = false
},
.title_id = static_cast<u64>(sts::ncm::TitleId::AppletPhotoViewer),
.title_id = static_cast<u64>(ams::ncm::TitleId::AppletPhotoViewer),
.override_any_app = true
};
@@ -88,7 +88,7 @@ void Utils::InitializeThreadFunc(void *args) {
DoWithSmSession([&]() {
Handle tmp_hnd = 0;
static const char * const required_active_services[] = {"pcv", "gpio", "pinmux", "psc:m"};
for (unsigned int i = 0; i < sts::util::size(required_active_services); i++) {
for (unsigned int i = 0; i < ams::util::size(required_active_services); i++) {
R_ASSERT(smGetServiceOriginal(&tmp_hnd, smEncodeName(required_active_services[i])));
svcCloseHandle(tmp_hnd);
}
@@ -186,7 +186,7 @@ void Utils::InitializeThreadFunc(void *args) {
0x34, 0xC1, 0xA0, 0xC4, 0x82, 0x58, 0xF8, 0xB4, 0xFA, 0x9E, 0x5E, 0x6A, 0xDA, 0xFC, 0x7E, 0x4F,
};
const u32 option = (partition == 3 && sts::spl::IsRecoveryBoot()) ? 0x4 : 0x1;
const u32 option = (partition == 3 && ams::spl::IsRecoveryBoot()) ? 0x4 : 0x1;
u8 access_key[0x10];
R_ASSERT(splCryptoGenerateAesKek(BisKekSource, key_generation, option, access_key));
@@ -455,13 +455,13 @@ Result Utils::SaveSdFileForAtmosphere(u64 title_id, const char *fn, void *data,
}
bool Utils::IsHblTid(u64 _tid) {
const sts::ncm::TitleId tid{_tid};
return (g_hbl_override_config.override_any_app && sts::ncm::IsApplicationTitleId(tid)) || (_tid == g_hbl_override_config.title_id);
const ams::ncm::TitleId tid{_tid};
return (g_hbl_override_config.override_any_app && ams::ncm::IsApplicationTitleId(tid)) || (_tid == g_hbl_override_config.title_id);
}
bool Utils::IsWebAppletTid(u64 _tid) {
const sts::ncm::TitleId tid{_tid};
return tid == sts::ncm::TitleId::AppletWeb || tid == sts::ncm::TitleId::AppletOfflineWeb || tid == sts::ncm::TitleId::AppletLoginShare || tid == sts::ncm::TitleId::AppletWifiWebAuth;
const ams::ncm::TitleId tid{_tid};
return tid == ams::ncm::TitleId::AppletWeb || tid == ams::ncm::TitleId::AppletOfflineWeb || tid == ams::ncm::TitleId::AppletLoginShare || tid == ams::ncm::TitleId::AppletWifiWebAuth;
}
bool Utils::HasTitleFlag(u64 tid, const char *flag) {
@@ -550,7 +550,7 @@ static bool HasOverrideKey(OverrideKey *cfg) {
bool Utils::HasOverrideButton(u64 tid) {
if ((!sts::ncm::IsApplicationTitleId(sts::ncm::TitleId{tid})) || (!IsSdInitialized())) {
if ((!ams::ncm::IsApplicationTitleId(ams::ncm::TitleId{tid})) || (!IsSdInitialized())) {
/* Disable button override disable for non-applications. */
return true;
}