From 647cb07dc8279166a5e3d6def40eba3d6f907977 Mon Sep 17 00:00:00 2001 From: MK73DS <10391562+MK73DS@users.noreply.github.com> Date: Wed, 9 Mar 2022 10:40:55 +0100 Subject: [PATCH] Stub functions in IAccountServiceForApplication: - GetUserCount - InitializeApplicationInfo - IsUserAccountSwitchLocked --- .../account/IAccountServiceForApplication.cpp | 14 +++++++++++++ .../account/IAccountServiceForApplication.h | 21 ++++++++++++++++++- 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/app/src/main/cpp/skyline/services/account/IAccountServiceForApplication.cpp b/app/src/main/cpp/skyline/services/account/IAccountServiceForApplication.cpp index 22635440..0e21da9f 100644 --- a/app/src/main/cpp/skyline/services/account/IAccountServiceForApplication.cpp +++ b/app/src/main/cpp/skyline/services/account/IAccountServiceForApplication.cpp @@ -8,6 +8,11 @@ namespace skyline::service::account { IAccountServiceForApplication::IAccountServiceForApplication(const DeviceState &state, ServiceManager &manager) : BaseService(state, manager) {} + Result IAccountServiceForApplication::GetUserCount(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) { + response.Push(1); // We only support one user currently + return {}; + } + Result IAccountServiceForApplication::GetUserExistence(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) { auto id{request.Pop()}; @@ -76,4 +81,13 @@ namespace skyline::service::account { manager.RegisterService(SRVREG(IManagerForApplication), session, response); return {}; } + + Result IAccountServiceForApplication::InitializeApplicationInfo(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) { + return {}; + } + + Result IAccountServiceForApplication::IsUserAccountSwitchLocked(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) { + response.Push(0); // We don't want to lock the user + return {}; + } } diff --git a/app/src/main/cpp/skyline/services/account/IAccountServiceForApplication.h b/app/src/main/cpp/skyline/services/account/IAccountServiceForApplication.h index 088c75bd..7a728c70 100644 --- a/app/src/main/cpp/skyline/services/account/IAccountServiceForApplication.h +++ b/app/src/main/cpp/skyline/services/account/IAccountServiceForApplication.h @@ -40,6 +40,11 @@ namespace skyline { public: IAccountServiceForApplication(const DeviceState &state, ServiceManager &manager); + /** + * @brief Returns the amount of user accounts on the console + */ + Result GetUserCount(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response); + /** * @brief Checks if the given user ID exists */ @@ -76,14 +81,28 @@ namespace skyline { */ Result GetBaasAccountManagerForApplication(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response); + /** + * @brief Returns if the user's account is locked or unlocked + */ + Result IsUserAccountSwitchLocked(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response); + + /** + * @brief Provides information about the running application for account services to use + * @url https://switchbrew.org/wiki/Account_services#InitializeApplicationInfo + */ + Result InitializeApplicationInfo(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response); + SERVICE_DECL( + SFUNC(0x0, IAccountServiceForApplication, GetUserCount), SFUNC(0x1, IAccountServiceForApplication, GetUserExistence), SFUNC(0x2, IAccountServiceForApplication, ListAllUsers), SFUNC(0x3, IAccountServiceForApplication, ListOpenUsers), SFUNC(0x4, IAccountServiceForApplication, GetLastOpenedUser), SFUNC(0x5, IAccountServiceForApplication, GetProfile), SFUNC(0x64, IAccountServiceForApplication, InitializeApplicationInfoV0), - SFUNC(0x65, IAccountServiceForApplication, GetBaasAccountManagerForApplication) + SFUNC(0x65, IAccountServiceForApplication, GetBaasAccountManagerForApplication), + SFUNC(0x8C, IAccountServiceForApplication, InitializeApplicationInfo), + SFUNC(0x96, IAccountServiceForApplication, IsUserAccountSwitchLocked) ) }; }