2018-02-15 04:22:41 +01:00
|
|
|
// Copyright 2018 yuzu emulator team
|
|
|
|
// Licensed under GPLv2 or any later version
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
2018-10-29 21:20:10 +01:00
|
|
|
#include "common/logging/log.h"
|
2021-04-15 01:07:40 +02:00
|
|
|
#include "common/settings.h"
|
2020-11-18 13:53:10 +01:00
|
|
|
#include "core/core.h"
|
2018-10-29 21:20:10 +01:00
|
|
|
#include "core/file_sys/control_metadata.h"
|
|
|
|
#include "core/file_sys/patch_manager.h"
|
2020-08-23 20:20:37 +02:00
|
|
|
#include "core/file_sys/vfs.h"
|
2018-08-01 23:23:10 +02:00
|
|
|
#include "core/hle/ipc_helpers.h"
|
|
|
|
#include "core/hle/kernel/hle_ipc.h"
|
2019-05-23 09:55:56 +02:00
|
|
|
#include "core/hle/service/ns/errors.h"
|
2019-05-23 10:28:27 +02:00
|
|
|
#include "core/hle/service/ns/language.h"
|
2019-05-23 10:39:22 +02:00
|
|
|
#include "core/hle/service/ns/ns.h"
|
2018-02-15 04:22:41 +01:00
|
|
|
#include "core/hle/service/ns/pl_u.h"
|
2019-05-23 10:28:27 +02:00
|
|
|
#include "core/hle/service/set/set.h"
|
2018-02-15 04:22:41 +01:00
|
|
|
|
2018-04-20 03:41:44 +02:00
|
|
|
namespace Service::NS {
|
2018-02-15 04:22:41 +01:00
|
|
|
|
2020-11-26 21:19:08 +01:00
|
|
|
IAccountProxyInterface::IAccountProxyInterface(Core::System& system_)
|
|
|
|
: ServiceFramework{system_, "IAccountProxyInterface"} {
|
2019-05-23 09:55:56 +02:00
|
|
|
// clang-format off
|
|
|
|
static const FunctionInfo functions[] = {
|
|
|
|
{0, nullptr, "CreateUserAccount"},
|
|
|
|
};
|
|
|
|
// clang-format on
|
|
|
|
|
|
|
|
RegisterHandlers(functions);
|
|
|
|
}
|
|
|
|
|
2019-05-23 10:28:27 +02:00
|
|
|
IAccountProxyInterface::~IAccountProxyInterface() = default;
|
|
|
|
|
2020-11-18 13:53:10 +01:00
|
|
|
IApplicationManagerInterface::IApplicationManagerInterface(Core::System& system_)
|
2020-11-26 21:19:08 +01:00
|
|
|
: ServiceFramework{system_, "IApplicationManagerInterface"} {
|
2019-05-23 09:55:56 +02:00
|
|
|
// clang-format off
|
|
|
|
static const FunctionInfo functions[] = {
|
|
|
|
{0, nullptr, "ListApplicationRecord"},
|
|
|
|
{1, nullptr, "GenerateApplicationRecordCount"},
|
|
|
|
{2, nullptr, "GetApplicationRecordUpdateSystemEvent"},
|
|
|
|
{3, nullptr, "GetApplicationViewDeprecated"},
|
|
|
|
{4, nullptr, "DeleteApplicationEntity"},
|
|
|
|
{5, nullptr, "DeleteApplicationCompletely"},
|
|
|
|
{6, nullptr, "IsAnyApplicationEntityRedundant"},
|
|
|
|
{7, nullptr, "DeleteRedundantApplicationEntity"},
|
|
|
|
{8, nullptr, "IsApplicationEntityMovable"},
|
|
|
|
{9, nullptr, "MoveApplicationEntity"},
|
|
|
|
{11, nullptr, "CalculateApplicationOccupiedSize"},
|
|
|
|
{16, nullptr, "PushApplicationRecord"},
|
|
|
|
{17, nullptr, "ListApplicationRecordContentMeta"},
|
|
|
|
{19, nullptr, "LaunchApplicationOld"},
|
|
|
|
{21, nullptr, "GetApplicationContentPath"},
|
|
|
|
{22, nullptr, "TerminateApplication"},
|
|
|
|
{23, nullptr, "ResolveApplicationContentPath"},
|
|
|
|
{26, nullptr, "BeginInstallApplication"},
|
|
|
|
{27, nullptr, "DeleteApplicationRecord"},
|
|
|
|
{30, nullptr, "RequestApplicationUpdateInfo"},
|
2021-04-07 17:41:52 +02:00
|
|
|
{31, nullptr, "Unknown31"},
|
2019-05-23 09:55:56 +02:00
|
|
|
{32, nullptr, "CancelApplicationDownload"},
|
|
|
|
{33, nullptr, "ResumeApplicationDownload"},
|
|
|
|
{35, nullptr, "UpdateVersionList"},
|
|
|
|
{36, nullptr, "PushLaunchVersion"},
|
|
|
|
{37, nullptr, "ListRequiredVersion"},
|
|
|
|
{38, nullptr, "CheckApplicationLaunchVersion"},
|
|
|
|
{39, nullptr, "CheckApplicationLaunchRights"},
|
|
|
|
{40, nullptr, "GetApplicationLogoData"},
|
|
|
|
{41, nullptr, "CalculateApplicationDownloadRequiredSize"},
|
|
|
|
{42, nullptr, "CleanupSdCard"},
|
|
|
|
{43, nullptr, "CheckSdCardMountStatus"},
|
|
|
|
{44, nullptr, "GetSdCardMountStatusChangedEvent"},
|
|
|
|
{45, nullptr, "GetGameCardAttachmentEvent"},
|
|
|
|
{46, nullptr, "GetGameCardAttachmentInfo"},
|
|
|
|
{47, nullptr, "GetTotalSpaceSize"},
|
|
|
|
{48, nullptr, "GetFreeSpaceSize"},
|
|
|
|
{49, nullptr, "GetSdCardRemovedEvent"},
|
|
|
|
{52, nullptr, "GetGameCardUpdateDetectionEvent"},
|
|
|
|
{53, nullptr, "DisableApplicationAutoDelete"},
|
|
|
|
{54, nullptr, "EnableApplicationAutoDelete"},
|
|
|
|
{55, &IApplicationManagerInterface::GetApplicationDesiredLanguage, "GetApplicationDesiredLanguage"},
|
|
|
|
{56, nullptr, "SetApplicationTerminateResult"},
|
|
|
|
{57, nullptr, "ClearApplicationTerminateResult"},
|
|
|
|
{58, nullptr, "GetLastSdCardMountUnexpectedResult"},
|
|
|
|
{59, &IApplicationManagerInterface::ConvertApplicationLanguageToLanguageCode, "ConvertApplicationLanguageToLanguageCode"},
|
|
|
|
{60, nullptr, "ConvertLanguageCodeToApplicationLanguage"},
|
|
|
|
{61, nullptr, "GetBackgroundDownloadStressTaskInfo"},
|
|
|
|
{62, nullptr, "GetGameCardStopper"},
|
|
|
|
{63, nullptr, "IsSystemProgramInstalled"},
|
|
|
|
{64, nullptr, "StartApplyDeltaTask"},
|
|
|
|
{65, nullptr, "GetRequestServerStopper"},
|
|
|
|
{66, nullptr, "GetBackgroundApplyDeltaStressTaskInfo"},
|
|
|
|
{67, nullptr, "CancelApplicationApplyDelta"},
|
|
|
|
{68, nullptr, "ResumeApplicationApplyDelta"},
|
|
|
|
{69, nullptr, "CalculateApplicationApplyDeltaRequiredSize"},
|
|
|
|
{70, nullptr, "ResumeAll"},
|
|
|
|
{71, nullptr, "GetStorageSize"},
|
|
|
|
{80, nullptr, "RequestDownloadApplication"},
|
|
|
|
{81, nullptr, "RequestDownloadAddOnContent"},
|
|
|
|
{82, nullptr, "DownloadApplication"},
|
|
|
|
{83, nullptr, "CheckApplicationResumeRights"},
|
|
|
|
{84, nullptr, "GetDynamicCommitEvent"},
|
|
|
|
{85, nullptr, "RequestUpdateApplication2"},
|
|
|
|
{86, nullptr, "EnableApplicationCrashReport"},
|
|
|
|
{87, nullptr, "IsApplicationCrashReportEnabled"},
|
|
|
|
{90, nullptr, "BoostSystemMemoryResourceLimit"},
|
|
|
|
{91, nullptr, "DeprecatedLaunchApplication"},
|
|
|
|
{92, nullptr, "GetRunningApplicationProgramId"},
|
|
|
|
{93, nullptr, "GetMainApplicationProgramIndex"},
|
|
|
|
{94, nullptr, "LaunchApplication"},
|
|
|
|
{95, nullptr, "GetApplicationLaunchInfo"},
|
|
|
|
{96, nullptr, "AcquireApplicationLaunchInfo"},
|
2020-06-29 04:01:34 +02:00
|
|
|
{97, nullptr, "GetMainApplicationProgramIndexByApplicationLaunchInfo"},
|
2019-05-23 09:55:56 +02:00
|
|
|
{98, nullptr, "EnableApplicationAllThreadDumpOnCrash"},
|
2019-11-12 14:54:58 +01:00
|
|
|
{99, nullptr, "LaunchDevMenu"},
|
2019-05-23 09:55:56 +02:00
|
|
|
{100, nullptr, "ResetToFactorySettings"},
|
|
|
|
{101, nullptr, "ResetToFactorySettingsWithoutUserSaveData"},
|
|
|
|
{102, nullptr, "ResetToFactorySettingsForRefurbishment"},
|
2020-04-20 21:18:23 +02:00
|
|
|
{103, nullptr, "ResetToFactorySettingsWithPlatformRegion"},
|
|
|
|
{104, nullptr, "ResetToFactorySettingsWithPlatformRegionAuthentication"},
|
|
|
|
{105, nullptr, "RequestResetToFactorySettingsSecurely"},
|
|
|
|
{106, nullptr, "RequestResetToFactorySettingsWithPlatformRegionAuthenticationSecurely"},
|
2019-05-23 09:55:56 +02:00
|
|
|
{200, nullptr, "CalculateUserSaveDataStatistics"},
|
|
|
|
{201, nullptr, "DeleteUserSaveDataAll"},
|
|
|
|
{210, nullptr, "DeleteUserSystemSaveData"},
|
|
|
|
{211, nullptr, "DeleteSaveData"},
|
|
|
|
{220, nullptr, "UnregisterNetworkServiceAccount"},
|
|
|
|
{221, nullptr, "UnregisterNetworkServiceAccountWithUserSaveDataDeletion"},
|
|
|
|
{300, nullptr, "GetApplicationShellEvent"},
|
|
|
|
{301, nullptr, "PopApplicationShellEventInfo"},
|
|
|
|
{302, nullptr, "LaunchLibraryApplet"},
|
|
|
|
{303, nullptr, "TerminateLibraryApplet"},
|
|
|
|
{304, nullptr, "LaunchSystemApplet"},
|
|
|
|
{305, nullptr, "TerminateSystemApplet"},
|
|
|
|
{306, nullptr, "LaunchOverlayApplet"},
|
|
|
|
{307, nullptr, "TerminateOverlayApplet"},
|
|
|
|
{400, &IApplicationManagerInterface::GetApplicationControlData, "GetApplicationControlData"},
|
|
|
|
{401, nullptr, "InvalidateAllApplicationControlCache"},
|
|
|
|
{402, nullptr, "RequestDownloadApplicationControlData"},
|
|
|
|
{403, nullptr, "GetMaxApplicationControlCacheCount"},
|
|
|
|
{404, nullptr, "InvalidateApplicationControlCache"},
|
|
|
|
{405, nullptr, "ListApplicationControlCacheEntryInfo"},
|
|
|
|
{406, nullptr, "GetApplicationControlProperty"},
|
2019-11-12 14:54:58 +01:00
|
|
|
{407, nullptr, "ListApplicationTitle"},
|
|
|
|
{408, nullptr, "ListApplicationIcon"},
|
2019-05-23 09:55:56 +02:00
|
|
|
{502, nullptr, "RequestCheckGameCardRegistration"},
|
|
|
|
{503, nullptr, "RequestGameCardRegistrationGoldPoint"},
|
|
|
|
{504, nullptr, "RequestRegisterGameCard"},
|
|
|
|
{505, nullptr, "GetGameCardMountFailureEvent"},
|
|
|
|
{506, nullptr, "IsGameCardInserted"},
|
|
|
|
{507, nullptr, "EnsureGameCardAccess"},
|
|
|
|
{508, nullptr, "GetLastGameCardMountFailureResult"},
|
|
|
|
{509, nullptr, "ListApplicationIdOnGameCard"},
|
2019-11-12 14:54:58 +01:00
|
|
|
{510, nullptr, "GetGameCardPlatformRegion"},
|
2019-05-23 09:55:56 +02:00
|
|
|
{600, nullptr, "CountApplicationContentMeta"},
|
|
|
|
{601, nullptr, "ListApplicationContentMetaStatus"},
|
|
|
|
{602, nullptr, "ListAvailableAddOnContent"},
|
|
|
|
{603, nullptr, "GetOwnedApplicationContentMetaStatus"},
|
|
|
|
{604, nullptr, "RegisterContentsExternalKey"},
|
|
|
|
{605, nullptr, "ListApplicationContentMetaStatusWithRightsCheck"},
|
|
|
|
{606, nullptr, "GetContentMetaStorage"},
|
|
|
|
{607, nullptr, "ListAvailableAddOnContent"},
|
|
|
|
{700, nullptr, "PushDownloadTaskList"},
|
|
|
|
{701, nullptr, "ClearTaskStatusList"},
|
|
|
|
{702, nullptr, "RequestDownloadTaskList"},
|
|
|
|
{703, nullptr, "RequestEnsureDownloadTask"},
|
|
|
|
{704, nullptr, "ListDownloadTaskStatus"},
|
|
|
|
{705, nullptr, "RequestDownloadTaskListData"},
|
|
|
|
{800, nullptr, "RequestVersionList"},
|
|
|
|
{801, nullptr, "ListVersionList"},
|
|
|
|
{802, nullptr, "RequestVersionListData"},
|
|
|
|
{900, nullptr, "GetApplicationRecord"},
|
|
|
|
{901, nullptr, "GetApplicationRecordProperty"},
|
|
|
|
{902, nullptr, "EnableApplicationAutoUpdate"},
|
|
|
|
{903, nullptr, "DisableApplicationAutoUpdate"},
|
|
|
|
{904, nullptr, "TouchApplication"},
|
|
|
|
{905, nullptr, "RequestApplicationUpdate"},
|
|
|
|
{906, nullptr, "IsApplicationUpdateRequested"},
|
|
|
|
{907, nullptr, "WithdrawApplicationUpdateRequest"},
|
|
|
|
{908, nullptr, "ListApplicationRecordInstalledContentMeta"},
|
|
|
|
{909, nullptr, "WithdrawCleanupAddOnContentsWithNoRightsRecommendation"},
|
|
|
|
{910, nullptr, "HasApplicationRecord"},
|
|
|
|
{911, nullptr, "SetPreInstalledApplication"},
|
|
|
|
{912, nullptr, "ClearPreInstalledApplicationFlag"},
|
2019-11-12 14:54:58 +01:00
|
|
|
{913, nullptr, "ListAllApplicationRecord"},
|
|
|
|
{914, nullptr, "HideApplicationRecord"},
|
|
|
|
{915, nullptr, "ShowApplicationRecord"},
|
2021-04-07 17:41:52 +02:00
|
|
|
{916, nullptr, "IsApplicationAutoDeleteDisabled"},
|
2019-05-23 09:55:56 +02:00
|
|
|
{1000, nullptr, "RequestVerifyApplicationDeprecated"},
|
|
|
|
{1001, nullptr, "CorruptApplicationForDebug"},
|
|
|
|
{1002, nullptr, "RequestVerifyAddOnContentsRights"},
|
|
|
|
{1003, nullptr, "RequestVerifyApplication"},
|
|
|
|
{1004, nullptr, "CorruptContentForDebug"},
|
|
|
|
{1200, nullptr, "NeedsUpdateVulnerability"},
|
|
|
|
{1300, nullptr, "IsAnyApplicationEntityInstalled"},
|
|
|
|
{1301, nullptr, "DeleteApplicationContentEntities"},
|
|
|
|
{1302, nullptr, "CleanupUnrecordedApplicationEntity"},
|
|
|
|
{1303, nullptr, "CleanupAddOnContentsWithNoRights"},
|
|
|
|
{1304, nullptr, "DeleteApplicationContentEntity"},
|
|
|
|
{1305, nullptr, "TryDeleteRunningApplicationEntity"},
|
|
|
|
{1306, nullptr, "TryDeleteRunningApplicationCompletely"},
|
|
|
|
{1307, nullptr, "TryDeleteRunningApplicationContentEntities"},
|
|
|
|
{1308, nullptr, "DeleteApplicationCompletelyForDebug"},
|
|
|
|
{1309, nullptr, "CleanupUnavailableAddOnContents"},
|
2020-04-20 21:18:23 +02:00
|
|
|
{1310, nullptr, "RequestMoveApplicationEntity"},
|
|
|
|
{1311, nullptr, "EstimateSizeToMove"},
|
|
|
|
{1312, nullptr, "HasMovableEntity"},
|
2021-04-07 17:41:52 +02:00
|
|
|
{1313, nullptr, "CleanupOrphanContents"},
|
|
|
|
{1314, nullptr, "CheckPreconditionSatisfiedToMove"},
|
2019-05-23 09:55:56 +02:00
|
|
|
{1400, nullptr, "PrepareShutdown"},
|
|
|
|
{1500, nullptr, "FormatSdCard"},
|
|
|
|
{1501, nullptr, "NeedsSystemUpdateToFormatSdCard"},
|
|
|
|
{1502, nullptr, "GetLastSdCardFormatUnexpectedResult"},
|
|
|
|
{1504, nullptr, "InsertSdCard"},
|
|
|
|
{1505, nullptr, "RemoveSdCard"},
|
2019-11-12 14:54:58 +01:00
|
|
|
{1506, nullptr, "GetSdCardStartupStatus"},
|
2019-05-23 09:55:56 +02:00
|
|
|
{1600, nullptr, "GetSystemSeedForPseudoDeviceId"},
|
|
|
|
{1601, nullptr, "ResetSystemSeedForPseudoDeviceId"},
|
|
|
|
{1700, nullptr, "ListApplicationDownloadingContentMeta"},
|
|
|
|
{1701, nullptr, "GetApplicationView"},
|
|
|
|
{1702, nullptr, "GetApplicationDownloadTaskStatus"},
|
|
|
|
{1703, nullptr, "GetApplicationViewDownloadErrorContext"},
|
2019-11-12 14:54:58 +01:00
|
|
|
{1704, nullptr, "GetApplicationViewWithPromotionInfo"},
|
2021-04-07 17:41:52 +02:00
|
|
|
{1705, nullptr, "IsPatchAutoDeletableApplication"},
|
2019-05-23 09:55:56 +02:00
|
|
|
{1800, nullptr, "IsNotificationSetupCompleted"},
|
|
|
|
{1801, nullptr, "GetLastNotificationInfoCount"},
|
|
|
|
{1802, nullptr, "ListLastNotificationInfo"},
|
|
|
|
{1803, nullptr, "ListNotificationTask"},
|
|
|
|
{1900, nullptr, "IsActiveAccount"},
|
|
|
|
{1901, nullptr, "RequestDownloadApplicationPrepurchasedRights"},
|
|
|
|
{1902, nullptr, "GetApplicationTicketInfo"},
|
|
|
|
{2000, nullptr, "GetSystemDeliveryInfo"},
|
|
|
|
{2001, nullptr, "SelectLatestSystemDeliveryInfo"},
|
|
|
|
{2002, nullptr, "VerifyDeliveryProtocolVersion"},
|
|
|
|
{2003, nullptr, "GetApplicationDeliveryInfo"},
|
|
|
|
{2004, nullptr, "HasAllContentsToDeliver"},
|
|
|
|
{2005, nullptr, "CompareApplicationDeliveryInfo"},
|
|
|
|
{2006, nullptr, "CanDeliverApplication"},
|
|
|
|
{2007, nullptr, "ListContentMetaKeyToDeliverApplication"},
|
|
|
|
{2008, nullptr, "NeedsSystemUpdateToDeliverApplication"},
|
|
|
|
{2009, nullptr, "EstimateRequiredSize"},
|
|
|
|
{2010, nullptr, "RequestReceiveApplication"},
|
|
|
|
{2011, nullptr, "CommitReceiveApplication"},
|
|
|
|
{2012, nullptr, "GetReceiveApplicationProgress"},
|
|
|
|
{2013, nullptr, "RequestSendApplication"},
|
|
|
|
{2014, nullptr, "GetSendApplicationProgress"},
|
|
|
|
{2015, nullptr, "CompareSystemDeliveryInfo"},
|
|
|
|
{2016, nullptr, "ListNotCommittedContentMeta"},
|
|
|
|
{2017, nullptr, "CreateDownloadTask"},
|
|
|
|
{2018, nullptr, "GetApplicationDeliveryInfoHash"},
|
|
|
|
{2050, nullptr, "GetApplicationRightsOnClient"},
|
2019-11-12 14:54:58 +01:00
|
|
|
{2051, nullptr, "InvalidateRightsIdCache"},
|
2019-05-23 09:55:56 +02:00
|
|
|
{2100, nullptr, "GetApplicationTerminateResult"},
|
|
|
|
{2101, nullptr, "GetRawApplicationTerminateResult"},
|
|
|
|
{2150, nullptr, "CreateRightsEnvironment"},
|
|
|
|
{2151, nullptr, "DestroyRightsEnvironment"},
|
|
|
|
{2152, nullptr, "ActivateRightsEnvironment"},
|
|
|
|
{2153, nullptr, "DeactivateRightsEnvironment"},
|
|
|
|
{2154, nullptr, "ForceActivateRightsContextForExit"},
|
2019-11-12 14:54:58 +01:00
|
|
|
{2155, nullptr, "UpdateRightsEnvironmentStatus"},
|
2020-04-20 21:18:23 +02:00
|
|
|
{2156, nullptr, "CreateRightsEnvironmentForMicroApplication"},
|
2019-05-23 09:55:56 +02:00
|
|
|
{2160, nullptr, "AddTargetApplicationToRightsEnvironment"},
|
|
|
|
{2161, nullptr, "SetUsersToRightsEnvironment"},
|
|
|
|
{2170, nullptr, "GetRightsEnvironmentStatus"},
|
|
|
|
{2171, nullptr, "GetRightsEnvironmentStatusChangedEvent"},
|
|
|
|
{2180, nullptr, "RequestExtendRightsInRightsEnvironment"},
|
2020-06-29 04:01:34 +02:00
|
|
|
{2181, nullptr, "GetResultOfExtendRightsInRightsEnvironment"},
|
2019-05-23 09:55:56 +02:00
|
|
|
{2182, nullptr, "SetActiveRightsContextUsingStateToRightsEnvironment"},
|
|
|
|
{2190, nullptr, "GetRightsEnvironmentHandleForApplication"},
|
|
|
|
{2199, nullptr, "GetRightsEnvironmentCountForDebug"},
|
|
|
|
{2200, nullptr, "GetGameCardApplicationCopyIdentifier"},
|
|
|
|
{2201, nullptr, "GetInstalledApplicationCopyIdentifier"},
|
|
|
|
{2250, nullptr, "RequestReportActiveELicence"},
|
|
|
|
{2300, nullptr, "ListEventLog"},
|
2019-11-12 14:54:58 +01:00
|
|
|
{2350, nullptr, "PerformAutoUpdateByApplicationId"},
|
|
|
|
{2351, nullptr, "RequestNoDownloadRightsErrorResolution"},
|
|
|
|
{2352, nullptr, "RequestResolveNoDownloadRightsError"},
|
2020-04-20 21:18:23 +02:00
|
|
|
{2353, nullptr, "GetApplicationDownloadTaskInfo"},
|
2021-04-07 17:41:52 +02:00
|
|
|
{2354, nullptr, "PrioritizeApplicationBackgroundTask"},
|
|
|
|
{2355, nullptr, "Unknown2355"},
|
|
|
|
{2356, nullptr, "Unknown2356"},
|
2019-11-12 14:54:58 +01:00
|
|
|
{2400, nullptr, "GetPromotionInfo"},
|
|
|
|
{2401, nullptr, "CountPromotionInfo"},
|
|
|
|
{2402, nullptr, "ListPromotionInfo"},
|
|
|
|
{2403, nullptr, "ImportPromotionJsonForDebug"},
|
|
|
|
{2404, nullptr, "ClearPromotionInfoForDebug"},
|
|
|
|
{2500, nullptr, "ConfirmAvailableTime"},
|
|
|
|
{2510, nullptr, "CreateApplicationResource"},
|
|
|
|
{2511, nullptr, "GetApplicationResource"},
|
2020-04-20 21:18:23 +02:00
|
|
|
{2513, nullptr, "LaunchMicroApplication"},
|
2019-11-12 14:54:58 +01:00
|
|
|
{2514, nullptr, "ClearTaskOfAsyncTaskManager"},
|
2020-04-20 21:18:23 +02:00
|
|
|
{2515, nullptr, "CleanupAllPlaceHolderAndFragmentsIfNoTask"},
|
|
|
|
{2516, nullptr, "EnsureApplicationCertificate"},
|
2019-11-12 14:54:58 +01:00
|
|
|
{2800, nullptr, "GetApplicationIdOfPreomia"},
|
2021-04-07 17:41:52 +02:00
|
|
|
{3000, nullptr, "RegisterDeviceLockKey"},
|
|
|
|
{3001, nullptr, "UnregisterDeviceLockKey"},
|
|
|
|
{3002, nullptr, "VerifyDeviceLockKey"},
|
|
|
|
{3003, nullptr, "HideApplicationIcon"},
|
|
|
|
{3004, nullptr, "ShowApplicationIcon"},
|
|
|
|
{3005, nullptr, "HideApplicationTitle"},
|
|
|
|
{3006, nullptr, "ShowApplicationTitle"},
|
|
|
|
{3007, nullptr, "EnableGameCard"},
|
|
|
|
{3008, nullptr, "DisableGameCard"},
|
|
|
|
{3009, nullptr, "EnableLocalContentShare"},
|
|
|
|
{3010, nullptr, "DisableLocalContentShare"},
|
|
|
|
{3011, nullptr, "IsApplicationIconHidden"},
|
|
|
|
{3012, nullptr, "IsApplicationTitleHidden"},
|
|
|
|
{3013, nullptr, "IsGameCardEnabled"},
|
|
|
|
{3014, nullptr, "IsLocalContentShareEnabled"},
|
2020-04-20 21:18:23 +02:00
|
|
|
{9999, nullptr, "GetApplicationCertificate"},
|
2019-05-23 09:55:56 +02:00
|
|
|
};
|
|
|
|
// clang-format on
|
|
|
|
|
|
|
|
RegisterHandlers(functions);
|
|
|
|
}
|
|
|
|
|
2019-05-23 10:28:27 +02:00
|
|
|
IApplicationManagerInterface::~IApplicationManagerInterface() = default;
|
|
|
|
|
2019-05-23 09:55:56 +02:00
|
|
|
void IApplicationManagerInterface::GetApplicationControlData(Kernel::HLERequestContext& ctx) {
|
|
|
|
IPC::RequestParser rp{ctx};
|
|
|
|
const auto flag = rp.PopRaw<u64>();
|
|
|
|
LOG_DEBUG(Service_NS, "called with flag={:016X}", flag);
|
|
|
|
|
|
|
|
const auto title_id = rp.PopRaw<u64>();
|
|
|
|
|
|
|
|
const auto size = ctx.GetWriteBufferSize();
|
|
|
|
|
2020-11-18 13:53:10 +01:00
|
|
|
const FileSys::PatchManager pm{title_id, system.GetFileSystemController(),
|
|
|
|
system.GetContentProvider()};
|
2019-05-23 09:55:56 +02:00
|
|
|
const auto control = pm.GetControlMetadata();
|
|
|
|
|
|
|
|
std::vector<u8> out;
|
|
|
|
|
|
|
|
if (control.first != nullptr) {
|
|
|
|
if (size < 0x4000) {
|
|
|
|
LOG_ERROR(Service_NS,
|
|
|
|
"output buffer is too small! (actual={:016X}, expected_min=0x4000)", size);
|
|
|
|
IPC::ResponseBuilder rb{ctx, 2};
|
|
|
|
// TODO(DarkLordZach): Find a better error code for this.
|
2019-11-12 11:38:12 +01:00
|
|
|
rb.Push(RESULT_UNKNOWN);
|
2019-05-23 09:55:56 +02:00
|
|
|
return;
|
|
|
|
}
|
2018-08-01 23:23:10 +02:00
|
|
|
|
2019-05-23 09:55:56 +02:00
|
|
|
out.resize(0x4000);
|
|
|
|
const auto bytes = control.first->GetRawBytes();
|
|
|
|
std::memcpy(out.data(), bytes.data(), bytes.size());
|
|
|
|
} else {
|
|
|
|
LOG_WARNING(Service_NS, "missing NACP data for title_id={:016X}, defaulting to zeros.",
|
|
|
|
title_id);
|
|
|
|
out.resize(std::min<u64>(0x4000, size));
|
2018-08-01 23:23:10 +02:00
|
|
|
}
|
|
|
|
|
2019-05-23 09:55:56 +02:00
|
|
|
if (control.second != nullptr) {
|
|
|
|
if (size < 0x4000 + control.second->GetSize()) {
|
|
|
|
LOG_ERROR(Service_NS,
|
|
|
|
"output buffer is too small! (actual={:016X}, expected_min={:016X})", size,
|
|
|
|
0x4000 + control.second->GetSize());
|
|
|
|
IPC::ResponseBuilder rb{ctx, 2};
|
|
|
|
// TODO(DarkLordZach): Find a better error code for this.
|
2019-11-12 11:38:12 +01:00
|
|
|
rb.Push(RESULT_UNKNOWN);
|
2019-05-23 09:55:56 +02:00
|
|
|
return;
|
|
|
|
}
|
2018-08-01 23:23:10 +02:00
|
|
|
|
2019-05-23 09:55:56 +02:00
|
|
|
out.resize(0x4000 + control.second->GetSize());
|
|
|
|
control.second->Read(out.data() + 0x4000, control.second->GetSize());
|
|
|
|
} else {
|
|
|
|
LOG_WARNING(Service_NS, "missing icon data for title_id={:016X}, defaulting to zeros.",
|
|
|
|
title_id);
|
2018-08-01 23:23:10 +02:00
|
|
|
}
|
2018-10-29 21:20:10 +01:00
|
|
|
|
2019-05-23 09:55:56 +02:00
|
|
|
ctx.WriteBuffer(out);
|
2018-10-29 21:20:10 +01:00
|
|
|
|
2019-05-23 09:55:56 +02:00
|
|
|
IPC::ResponseBuilder rb{ctx, 3};
|
2021-05-21 07:05:04 +02:00
|
|
|
rb.Push(ResultSuccess);
|
2019-05-23 09:55:56 +02:00
|
|
|
rb.Push<u32>(static_cast<u32>(out.size()));
|
|
|
|
}
|
2018-10-29 21:20:10 +01:00
|
|
|
|
2019-05-23 09:55:56 +02:00
|
|
|
void IApplicationManagerInterface::GetApplicationDesiredLanguage(Kernel::HLERequestContext& ctx) {
|
|
|
|
IPC::RequestParser rp{ctx};
|
|
|
|
const auto supported_languages = rp.Pop<u32>();
|
2018-10-29 21:20:10 +01:00
|
|
|
|
2019-05-23 09:55:56 +02:00
|
|
|
const auto res = GetApplicationDesiredLanguage(supported_languages);
|
|
|
|
if (res.Succeeded()) {
|
2018-10-29 21:20:10 +01:00
|
|
|
IPC::ResponseBuilder rb{ctx, 3};
|
2021-05-21 07:05:04 +02:00
|
|
|
rb.Push(ResultSuccess);
|
2019-05-23 09:55:56 +02:00
|
|
|
rb.Push<u32>(*res);
|
|
|
|
} else {
|
|
|
|
IPC::ResponseBuilder rb{ctx, 2};
|
|
|
|
rb.Push(res.Code());
|
2018-10-29 21:20:10 +01:00
|
|
|
}
|
2019-05-23 09:55:56 +02:00
|
|
|
}
|
2018-08-01 23:23:10 +02:00
|
|
|
|
2019-05-23 09:55:56 +02:00
|
|
|
ResultVal<u8> IApplicationManagerInterface::GetApplicationDesiredLanguage(
|
|
|
|
const u32 supported_languages) {
|
|
|
|
LOG_DEBUG(Service_NS, "called with supported_languages={:08X}", supported_languages);
|
2018-08-01 23:23:10 +02:00
|
|
|
|
2019-05-23 09:55:56 +02:00
|
|
|
// Get language code from settings
|
configuration: implement per-game configurations (#4098)
* Switch game settings to use a pointer
In order to add full per-game settings, we need to be able to tell yuzu to switch
to using either the global or game configuration. Using a pointer makes it easier
to switch.
* configuration: add new UI without changing existing funcitonality
The new UI also adds General, System, Graphics, Advanced Graphics,
and Audio tabs, but as yet they do nothing. This commit keeps yuzu
to the same functionality as originally branched.
* configuration: Rename files
These weren't included in the last commit. Now they are.
* configuration: setup global configuration checkbox
Global config checkbox now enables/disables the appropriate tabs in the game
properties dialog. The use global configuration setting is now saved to the
config, defaulting to true. This also addresses some changes requested in the PR.
* configuration: swap to per-game config memory for properties dialog
Does not set memory going in-game. Swaps to game values when opening the
properties dialog, then swaps back when closing it. Uses a `memcpy` to swap.
Also implements saving config files, limited to certain groups of configurations
so as to not risk setting unsafe configurations.
* configuration: change config interfaces to use config-specific pointers
When a game is booted, we need to be able to open the configuration dialogs
without changing the settings pointer in the game's emualtion. A new pointer
specific to just the configuration dialogs can be used to separate changes
to just those config dialogs without affecting the emulation.
* configuration: boot a game using per-game settings
Swaps values where needed to boot a game.
* configuration: user correct config during emulation
Creates a new pointer specifically for modifying the configuration while
emulation is in progress. Both the regular configuration dialog and the game
properties dialog now use the pointer Settings::config_values to focus edits to
the correct struct.
* settings: split Settings::values into two different structs
By splitting the settings into two mutually exclusive structs, it becomes easier,
as a developer, to determine how to use the Settings structs after per-game
configurations is merged. Other benefits include only duplicating the required
settings in memory.
* settings: move use_docked_mode to Controls group
`use_docked_mode` is set in the input settings and cannot be accessed from the
system settings. Grouping it with system settings causes it to be saved with
per-game settings, which may make transferring configs more difficult later on,
especially since docked mode cannot be set from within the game properties
dialog.
* configuration: Fix the other yuzu executables and a regression
In main.cpp, we have to get the title ID before the ROM is loaded, else the
renderer will reflect only the global settings and now the user's game specific
settings.
* settings: use a template to duplicate memory for each setting
Replaces the type of each variable in the Settings::Values struct with a new
class that allows basic data reading and writing. The new struct
Settings::Setting duplicates the data in memory and can manage global overrides
per each setting.
* configuration: correct add-ons config and swap settings when apropriate
Any add-ons interaction happens directly through the global values struct.
Swapping bewteen structs now also includes copying the necessary global configs
that cannot be changed nor saved in per-game settings. General and System config
menus now update based on whether it is viewing the global or per-game settings.
* settings: restore old values struct
No longer needed with the Settings::Setting class template.
* configuration: implement hierarchical game properties dialog
This sets the apropriate global or local data in each setting.
* clang format
* clang format take 2
can the docker container save this?
* address comments and style issues
* config: read and write settings with global awareness
Adds new functions to read and write settings while keeping the global state in
focus. Files now generated per-game are much smaller since often they only need
address the global state.
* settings: restore global state when necessary
Upon closing a game or the game properties dialog, we need to restore all global
settings to the original global state so that we can properly open the
configuration dialog or boot a different game.
* configuration: guard setting values incorrectly
This disables setting values while a game is running if the setting is
overwritten by a per game setting.
* config: don't write local settings in the global config
Simple guards to prevent writing the wrong settings in the wrong files.
* configuration: add comments, assume less, and clang format
No longer assumes that a disabled UI element means the global state is turned
off, instead opting to directly answer that question. Still however assumes a
game is running if it is in that state.
* configuration: fix a logic error
Should not be negated
* restore settings' global state regardless of accept/cancel
Fixes loading a properties dialog and causing the global config dialog to show
local settings.
* fix more logic errors
Fixed the frame limit would set the global setting from the game properties
dialog. Also strengthened the Settings::Setting member variables and simplified
the logic in config reading (ReadSettingGlobal).
* fix another logic error
In my efforts to guard RestoreGlobalState, I accidentally negated the IsPowered
condition.
* configure_audio: set toggle_stretched_audio to tristate
* fixed custom rtc and rng seed overwriting the global value
* clang format
* rebased
* clang format take 4
* address my own review
Basically revert unintended changes
* settings: literal instead of casting
"No need to cast, use 1U instead"
Thanks, Morph!
Co-authored-by: Morph <39850852+Morph1984@users.noreply.github.com>
* Revert "settings: literal instead of casting
"
This reverts commit 95e992a87c898f3e882ffdb415bb0ef9f80f613f.
* main: fix status buttons reporting wrong settings after stop emulation
* settings: Log UseDockedMode in the Controls group
This should have happened when use_docked_mode was moved over to the controls group
internally. This just reflects this in the log.
* main: load settings if the file has a title id
In other words, don't exit if the loader has trouble getting a title id.
* use a zero
* settings: initalize resolution factor with constructor instead of casting
* Revert "settings: initalize resolution factor with constructor instead of casting"
This reverts commit 54c35ecb46a29953842614620f9b7de1aa9d5dc8.
* configure_graphics: guard device selector when Vulkan is global
Prevents the user from editing the device selector if Vulkan is the global
renderer backend. Also resets the vulkan_device variable when the users
switches back-and-forth between global and Vulkan.
* address reviewer concerns
Changes function variables to const wherever they don't need to be changed. Sets Settings::Setting to final as it should not be inherited from. Sets ConfigurationShared::use_global_text to static.
Co-Authored-By: VolcaEM <volcaem@users.noreply.github.com>
* main: load per-game settings after LoadROM
This prevents `Restart Emulation` from restoring the global settings *after* the per-game settings were applied. Thanks to BSoDGamingYT for finding this bug.
* Revert "main: load per-game settings after LoadROM"
This reverts commit 9d0d48c52d2dcf3bfb1806cc8fa7d5a271a8a804.
* main: only restore global settings when necessary
Loading the per-game settings cannot happen after the ROM is loaded, so we have to specify when to restore the global state. Again thanks to BSoD for finding the bug.
* configuration_shared: address reviewer concerns except operator overrides
Dropping operator override usage in next commit.
Co-Authored-By: LC <lioncash@users.noreply.github.com>
* settings: Drop operator overrides from Setting template
Requires using GetValue and SetValue explicitly. Also reverts a change that broke title ID formatting in the game properties dialog.
* complete rebase
* configuration_shared: translate "Use global configuration"
Uses ConfigurePerGame to do so, since its usage, at least as of now, corresponds with ConfigurationShared.
* configure_per_game: address reviewer concern
As far as I understand, it prevents the program from unnecessarily copying strings.
Co-Authored-By: LC <lioncash@users.noreply.github.com>
Co-authored-by: Morph <39850852+Morph1984@users.noreply.github.com>
Co-authored-by: VolcaEM <volcaem@users.noreply.github.com>
Co-authored-by: LC <lioncash@users.noreply.github.com>
2020-07-10 04:42:09 +02:00
|
|
|
const auto language_code =
|
2020-10-21 04:07:39 +02:00
|
|
|
Set::GetLanguageCodeFromIndex(Settings::values.language_index.GetValue());
|
2018-08-01 23:23:10 +02:00
|
|
|
|
2019-05-23 09:55:56 +02:00
|
|
|
// Convert to application language, get priority list
|
|
|
|
const auto application_language = ConvertToApplicationLanguage(language_code);
|
|
|
|
if (application_language == std::nullopt) {
|
2020-04-29 03:15:21 +02:00
|
|
|
LOG_ERROR(Service_NS, "Could not convert application language! language_code={}",
|
|
|
|
language_code);
|
2019-05-23 09:55:56 +02:00
|
|
|
return ERR_APPLICATION_LANGUAGE_NOT_FOUND;
|
2018-08-01 23:23:10 +02:00
|
|
|
}
|
2019-05-23 09:55:56 +02:00
|
|
|
const auto priority_list = GetApplicationLanguagePriorityList(*application_language);
|
|
|
|
if (!priority_list) {
|
2020-04-29 03:15:21 +02:00
|
|
|
LOG_ERROR(Service_NS,
|
|
|
|
"Could not find application language priorities! application_language={}",
|
|
|
|
*application_language);
|
2019-05-23 09:55:56 +02:00
|
|
|
return ERR_APPLICATION_LANGUAGE_NOT_FOUND;
|
2018-08-01 23:23:10 +02:00
|
|
|
}
|
|
|
|
|
2019-05-23 09:55:56 +02:00
|
|
|
// Try to find a valid language.
|
|
|
|
for (const auto lang : *priority_list) {
|
|
|
|
const auto supported_flag = GetSupportedLanguageFlag(lang);
|
2019-05-23 11:37:13 +02:00
|
|
|
if (supported_languages == 0 || (supported_languages & supported_flag) == supported_flag) {
|
2019-05-23 10:28:27 +02:00
|
|
|
return MakeResult(static_cast<u8>(lang));
|
2019-05-23 09:55:56 +02:00
|
|
|
}
|
2018-08-01 23:23:10 +02:00
|
|
|
}
|
|
|
|
|
2020-04-29 03:15:21 +02:00
|
|
|
LOG_ERROR(Service_NS, "Could not find a valid language! supported_languages={:08X}",
|
|
|
|
supported_languages);
|
2019-05-23 09:55:56 +02:00
|
|
|
return ERR_APPLICATION_LANGUAGE_NOT_FOUND;
|
|
|
|
}
|
2018-08-01 23:23:10 +02:00
|
|
|
|
2019-05-23 09:55:56 +02:00
|
|
|
void IApplicationManagerInterface::ConvertApplicationLanguageToLanguageCode(
|
|
|
|
Kernel::HLERequestContext& ctx) {
|
|
|
|
IPC::RequestParser rp{ctx};
|
|
|
|
const auto application_language = rp.Pop<u8>();
|
|
|
|
|
|
|
|
const auto res = ConvertApplicationLanguageToLanguageCode(application_language);
|
|
|
|
if (res.Succeeded()) {
|
|
|
|
IPC::ResponseBuilder rb{ctx, 4};
|
2021-05-21 07:05:04 +02:00
|
|
|
rb.Push(ResultSuccess);
|
2019-05-23 09:55:56 +02:00
|
|
|
rb.Push(*res);
|
|
|
|
} else {
|
|
|
|
IPC::ResponseBuilder rb{ctx, 2};
|
|
|
|
rb.Push(res.Code());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ResultVal<u64> IApplicationManagerInterface::ConvertApplicationLanguageToLanguageCode(
|
|
|
|
u8 application_language) {
|
|
|
|
const auto language_code =
|
|
|
|
ConvertToLanguageCode(static_cast<ApplicationLanguage>(application_language));
|
|
|
|
if (language_code == std::nullopt) {
|
2020-04-29 03:15:21 +02:00
|
|
|
LOG_ERROR(Service_NS, "Language not found! application_language={}", application_language);
|
2019-05-23 09:55:56 +02:00
|
|
|
return ERR_APPLICATION_LANGUAGE_NOT_FOUND;
|
2018-08-01 23:23:10 +02:00
|
|
|
}
|
|
|
|
|
2019-05-23 10:28:27 +02:00
|
|
|
return MakeResult(static_cast<u64>(*language_code));
|
2019-05-23 09:55:56 +02:00
|
|
|
}
|
|
|
|
|
2020-11-26 21:19:08 +01:00
|
|
|
IApplicationVersionInterface::IApplicationVersionInterface(Core::System& system_)
|
|
|
|
: ServiceFramework{system_, "IApplicationVersionInterface"} {
|
2019-05-23 09:55:56 +02:00
|
|
|
// clang-format off
|
|
|
|
static const FunctionInfo functions[] = {
|
|
|
|
{0, nullptr, "GetLaunchRequiredVersion"},
|
|
|
|
{1, nullptr, "UpgradeLaunchRequiredVersion"},
|
|
|
|
{35, nullptr, "UpdateVersionList"},
|
|
|
|
{36, nullptr, "PushLaunchVersion"},
|
|
|
|
{37, nullptr, "ListRequiredVersion"},
|
|
|
|
{800, nullptr, "RequestVersionList"},
|
|
|
|
{801, nullptr, "ListVersionList"},
|
|
|
|
{802, nullptr, "RequestVersionListData"},
|
2021-04-07 17:41:52 +02:00
|
|
|
{900, nullptr, "ImportAutoUpdatePolicyJsonForDebug"},
|
|
|
|
{901, nullptr, "ListDefaultAutoUpdatePolicy"},
|
|
|
|
{902, nullptr, "ListAutoUpdatePolicyForSpecificApplication"},
|
2019-05-23 09:55:56 +02:00
|
|
|
{1000, nullptr, "PerformAutoUpdate"},
|
2021-04-07 17:41:52 +02:00
|
|
|
{1001, nullptr, "ListAutoUpdateSchedule"},
|
2019-05-23 09:55:56 +02:00
|
|
|
};
|
|
|
|
// clang-format on
|
|
|
|
|
|
|
|
RegisterHandlers(functions);
|
|
|
|
}
|
|
|
|
|
2019-05-23 10:28:27 +02:00
|
|
|
IApplicationVersionInterface::~IApplicationVersionInterface() = default;
|
|
|
|
|
2020-11-26 21:19:08 +01:00
|
|
|
IContentManagementInterface::IContentManagementInterface(Core::System& system_)
|
|
|
|
: ServiceFramework{system_, "IContentManagementInterface"} {
|
2019-05-23 09:55:56 +02:00
|
|
|
// clang-format off
|
|
|
|
static const FunctionInfo functions[] = {
|
|
|
|
{11, nullptr, "CalculateApplicationOccupiedSize"},
|
|
|
|
{43, nullptr, "CheckSdCardMountStatus"},
|
|
|
|
{47, nullptr, "GetTotalSpaceSize"},
|
|
|
|
{48, nullptr, "GetFreeSpaceSize"},
|
|
|
|
{600, nullptr, "CountApplicationContentMeta"},
|
|
|
|
{601, nullptr, "ListApplicationContentMetaStatus"},
|
|
|
|
{605, nullptr, "ListApplicationContentMetaStatusWithRightsCheck"},
|
|
|
|
{607, nullptr, "IsAnyApplicationRunning"},
|
|
|
|
};
|
|
|
|
// clang-format on
|
|
|
|
|
|
|
|
RegisterHandlers(functions);
|
|
|
|
}
|
|
|
|
|
2020-06-29 04:01:34 +02:00
|
|
|
IContentManagementInterface::~IContentManagementInterface() = default;
|
2019-05-23 10:28:27 +02:00
|
|
|
|
2020-11-26 21:19:08 +01:00
|
|
|
IDocumentInterface::IDocumentInterface(Core::System& system_)
|
|
|
|
: ServiceFramework{system_, "IDocumentInterface"} {
|
2019-05-23 09:55:56 +02:00
|
|
|
// clang-format off
|
|
|
|
static const FunctionInfo functions[] = {
|
|
|
|
{21, nullptr, "GetApplicationContentPath"},
|
|
|
|
{23, nullptr, "ResolveApplicationContentPath"},
|
|
|
|
{93, nullptr, "GetRunningApplicationProgramId"},
|
|
|
|
};
|
|
|
|
// clang-format on
|
|
|
|
|
|
|
|
RegisterHandlers(functions);
|
|
|
|
}
|
|
|
|
|
2019-05-23 10:28:27 +02:00
|
|
|
IDocumentInterface::~IDocumentInterface() = default;
|
|
|
|
|
2020-11-26 21:19:08 +01:00
|
|
|
IDownloadTaskInterface::IDownloadTaskInterface(Core::System& system_)
|
|
|
|
: ServiceFramework{system_, "IDownloadTaskInterface"} {
|
2019-05-23 09:55:56 +02:00
|
|
|
// clang-format off
|
|
|
|
static const FunctionInfo functions[] = {
|
|
|
|
{701, nullptr, "ClearTaskStatusList"},
|
|
|
|
{702, nullptr, "RequestDownloadTaskList"},
|
|
|
|
{703, nullptr, "RequestEnsureDownloadTask"},
|
|
|
|
{704, nullptr, "ListDownloadTaskStatus"},
|
|
|
|
{705, nullptr, "RequestDownloadTaskListData"},
|
|
|
|
{706, nullptr, "TryCommitCurrentApplicationDownloadTask"},
|
|
|
|
{707, nullptr, "EnableAutoCommit"},
|
|
|
|
{708, nullptr, "DisableAutoCommit"},
|
|
|
|
{709, nullptr, "TriggerDynamicCommitEvent"},
|
|
|
|
};
|
|
|
|
// clang-format on
|
|
|
|
|
|
|
|
RegisterHandlers(functions);
|
|
|
|
}
|
|
|
|
|
2019-05-23 10:28:27 +02:00
|
|
|
IDownloadTaskInterface::~IDownloadTaskInterface() = default;
|
|
|
|
|
2020-11-26 21:19:08 +01:00
|
|
|
IECommerceInterface::IECommerceInterface(Core::System& system_)
|
|
|
|
: ServiceFramework{system_, "IECommerceInterface"} {
|
2019-05-23 09:55:56 +02:00
|
|
|
// clang-format off
|
|
|
|
static const FunctionInfo functions[] = {
|
|
|
|
{0, nullptr, "RequestLinkDevice"},
|
|
|
|
{1, nullptr, "RequestCleanupAllPreInstalledApplications"},
|
|
|
|
{2, nullptr, "RequestCleanupPreInstalledApplication"},
|
|
|
|
{3, nullptr, "RequestSyncRights"},
|
|
|
|
{4, nullptr, "RequestUnlinkDevice"},
|
|
|
|
{5, nullptr, "RequestRevokeAllELicense"},
|
2019-11-12 14:54:58 +01:00
|
|
|
{6, nullptr, "RequestSyncRightsBasedOnAssignedELicenses"},
|
2019-05-23 09:55:56 +02:00
|
|
|
};
|
|
|
|
// clang-format on
|
|
|
|
|
|
|
|
RegisterHandlers(functions);
|
|
|
|
}
|
|
|
|
|
2019-05-23 10:28:27 +02:00
|
|
|
IECommerceInterface::~IECommerceInterface() = default;
|
|
|
|
|
2020-11-26 21:19:08 +01:00
|
|
|
IFactoryResetInterface::IFactoryResetInterface(Core::System& system_)
|
|
|
|
: ServiceFramework{system_, "IFactoryResetInterface"} {
|
2019-05-23 09:55:56 +02:00
|
|
|
// clang-format off
|
2018-08-01 23:23:10 +02:00
|
|
|
static const FunctionInfo functions[] = {
|
|
|
|
{100, nullptr, "ResetToFactorySettings"},
|
|
|
|
{101, nullptr, "ResetToFactorySettingsWithoutUserSaveData"},
|
2019-01-30 04:40:59 +01:00
|
|
|
{102, nullptr, "ResetToFactorySettingsForRefurbishment"},
|
2020-04-20 21:18:23 +02:00
|
|
|
{103, nullptr, "ResetToFactorySettingsWithPlatformRegion"},
|
|
|
|
{104, nullptr, "ResetToFactorySettingsWithPlatformRegionAuthentication"},
|
|
|
|
{105, nullptr, "RequestResetToFactorySettingsSecurely"},
|
|
|
|
{106, nullptr, "RequestResetToFactorySettingsWithPlatformRegionAuthenticationSecurely"},
|
2018-08-01 23:23:10 +02:00
|
|
|
};
|
2019-05-23 09:55:56 +02:00
|
|
|
// clang-format on
|
|
|
|
|
|
|
|
RegisterHandlers(functions);
|
|
|
|
}
|
|
|
|
|
2019-05-23 10:28:27 +02:00
|
|
|
IFactoryResetInterface::~IFactoryResetInterface() = default;
|
|
|
|
|
2020-11-26 21:19:08 +01:00
|
|
|
NS::NS(const char* name, Core::System& system_) : ServiceFramework{system_, name} {
|
2019-05-23 09:55:56 +02:00
|
|
|
// clang-format off
|
|
|
|
static const FunctionInfo functions[] = {
|
2021-04-07 17:41:52 +02:00
|
|
|
{7988, nullptr, "GetDynamicRightsInterface"},
|
|
|
|
{7989, nullptr, "GetReadOnlyApplicationControlDataInterface"},
|
|
|
|
{7991, nullptr, "GetReadOnlyApplicationRecordInterface"},
|
2019-05-23 09:55:56 +02:00
|
|
|
{7992, &NS::PushInterface<IECommerceInterface>, "GetECommerceInterface"},
|
|
|
|
{7993, &NS::PushInterface<IApplicationVersionInterface>, "GetApplicationVersionInterface"},
|
|
|
|
{7994, &NS::PushInterface<IFactoryResetInterface>, "GetFactoryResetInterface"},
|
|
|
|
{7995, &NS::PushInterface<IAccountProxyInterface>, "GetAccountProxyInterface"},
|
2020-11-18 13:53:10 +01:00
|
|
|
{7996, &NS::PushIApplicationManagerInterface, "GetApplicationManagerInterface"},
|
2019-05-23 09:55:56 +02:00
|
|
|
{7997, &NS::PushInterface<IDownloadTaskInterface>, "GetDownloadTaskInterface"},
|
2020-06-29 04:01:34 +02:00
|
|
|
{7998, &NS::PushInterface<IContentManagementInterface>, "GetContentManagementInterface"},
|
2019-05-23 09:55:56 +02:00
|
|
|
{7999, &NS::PushInterface<IDocumentInterface>, "GetDocumentInterface"},
|
|
|
|
};
|
|
|
|
// clang-format on
|
|
|
|
|
|
|
|
RegisterHandlers(functions);
|
|
|
|
}
|
|
|
|
|
2019-05-23 10:28:27 +02:00
|
|
|
NS::~NS() = default;
|
|
|
|
|
|
|
|
std::shared_ptr<IApplicationManagerInterface> NS::GetApplicationManagerInterface() const {
|
2020-11-18 13:53:10 +01:00
|
|
|
return GetInterface<IApplicationManagerInterface>(system);
|
2019-05-23 09:55:56 +02:00
|
|
|
}
|
2018-08-01 23:23:10 +02:00
|
|
|
|
|
|
|
class NS_DEV final : public ServiceFramework<NS_DEV> {
|
|
|
|
public:
|
2020-11-26 21:19:08 +01:00
|
|
|
explicit NS_DEV(Core::System& system_) : ServiceFramework{system_, "ns:dev"} {
|
2018-08-01 23:23:10 +02:00
|
|
|
// clang-format off
|
|
|
|
static const FunctionInfo functions[] = {
|
|
|
|
{0, nullptr, "LaunchProgram"},
|
|
|
|
{1, nullptr, "TerminateProcess"},
|
|
|
|
{2, nullptr, "TerminateProgram"},
|
2021-04-07 17:41:52 +02:00
|
|
|
{4, nullptr, "GetShellEvent"},
|
2018-10-19 09:41:35 +02:00
|
|
|
{5, nullptr, "GetShellEventInfo"},
|
|
|
|
{6, nullptr, "TerminateApplication"},
|
|
|
|
{7, nullptr, "PrepareLaunchProgramFromHost"},
|
2021-04-07 17:41:52 +02:00
|
|
|
{8, nullptr, "LaunchApplicationFromHost"},
|
2020-06-29 04:01:34 +02:00
|
|
|
{9, nullptr, "LaunchApplicationWithStorageIdForDevelop"},
|
|
|
|
{10, nullptr, "IsSystemMemoryResourceLimitBoosted"},
|
|
|
|
{11, nullptr, "GetRunningApplicationProcessIdForDevelop"},
|
2021-04-07 17:41:52 +02:00
|
|
|
{12, nullptr, "SetCurrentApplicationRightsEnvironmentCanBeActiveForDevelop"},
|
2020-04-20 21:18:23 +02:00
|
|
|
{13, nullptr, "CreateApplicationResourceForDevelop"},
|
|
|
|
{14, nullptr, "IsPreomiaForDevelop"},
|
|
|
|
{15, nullptr, "GetApplicationProgramIdFromHost"},
|
2021-04-07 17:41:52 +02:00
|
|
|
{16, nullptr, "RefreshCachedDebugValues"},
|
|
|
|
{17, nullptr, "PrepareLaunchApplicationFromHost"},
|
|
|
|
{18, nullptr, "GetLaunchEvent"},
|
|
|
|
{19, nullptr, "GetLaunchResult"},
|
2018-08-01 23:23:10 +02:00
|
|
|
};
|
|
|
|
// clang-format on
|
|
|
|
|
|
|
|
RegisterHandlers(functions);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
class ISystemUpdateControl final : public ServiceFramework<ISystemUpdateControl> {
|
|
|
|
public:
|
2020-11-26 21:19:08 +01:00
|
|
|
explicit ISystemUpdateControl(Core::System& system_)
|
|
|
|
: ServiceFramework{system_, "ISystemUpdateControl"} {
|
2018-08-01 23:23:10 +02:00
|
|
|
// clang-format off
|
|
|
|
static const FunctionInfo functions[] = {
|
|
|
|
{0, nullptr, "HasDownloaded"},
|
|
|
|
{1, nullptr, "RequestCheckLatestUpdate"},
|
|
|
|
{2, nullptr, "RequestDownloadLatestUpdate"},
|
|
|
|
{3, nullptr, "GetDownloadProgress"},
|
|
|
|
{4, nullptr, "ApplyDownloadedUpdate"},
|
|
|
|
{5, nullptr, "RequestPrepareCardUpdate"},
|
|
|
|
{6, nullptr, "GetPrepareCardUpdateProgress"},
|
|
|
|
{7, nullptr, "HasPreparedCardUpdate"},
|
|
|
|
{8, nullptr, "ApplyCardUpdate"},
|
|
|
|
{9, nullptr, "GetDownloadedEulaDataSize"},
|
|
|
|
{10, nullptr, "GetDownloadedEulaData"},
|
|
|
|
{11, nullptr, "SetupCardUpdate"},
|
|
|
|
{12, nullptr, "GetPreparedCardUpdateEulaDataSize"},
|
|
|
|
{13, nullptr, "GetPreparedCardUpdateEulaData"},
|
|
|
|
{14, nullptr, "SetupCardUpdateViaSystemUpdater"},
|
|
|
|
{15, nullptr, "HasReceived"},
|
|
|
|
{16, nullptr, "RequestReceiveSystemUpdate"},
|
|
|
|
{17, nullptr, "GetReceiveProgress"},
|
|
|
|
{18, nullptr, "ApplyReceivedUpdate"},
|
|
|
|
{19, nullptr, "GetReceivedEulaDataSize"},
|
|
|
|
{20, nullptr, "GetReceivedEulaData"},
|
|
|
|
{21, nullptr, "SetupToReceiveSystemUpdate"},
|
2018-10-19 09:41:35 +02:00
|
|
|
{22, nullptr, "RequestCheckLatestUpdateIncludesRebootlessUpdate"},
|
2018-08-01 23:23:10 +02:00
|
|
|
};
|
|
|
|
// clang-format on
|
|
|
|
|
|
|
|
RegisterHandlers(functions);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
class NS_SU final : public ServiceFramework<NS_SU> {
|
|
|
|
public:
|
2020-11-26 21:19:08 +01:00
|
|
|
explicit NS_SU(Core::System& system_) : ServiceFramework{system_, "ns:su"} {
|
2018-08-01 23:23:10 +02:00
|
|
|
// clang-format off
|
|
|
|
static const FunctionInfo functions[] = {
|
|
|
|
{0, nullptr, "GetBackgroundNetworkUpdateState"},
|
|
|
|
{1, &NS_SU::OpenSystemUpdateControl, "OpenSystemUpdateControl"},
|
|
|
|
{2, nullptr, "NotifyExFatDriverRequired"},
|
|
|
|
{3, nullptr, "ClearExFatDriverStatusForDebug"},
|
|
|
|
{4, nullptr, "RequestBackgroundNetworkUpdate"},
|
|
|
|
{5, nullptr, "NotifyBackgroundNetworkUpdate"},
|
|
|
|
{6, nullptr, "NotifyExFatDriverDownloadedForDebug"},
|
|
|
|
{9, nullptr, "GetSystemUpdateNotificationEventForContentDelivery"},
|
|
|
|
{10, nullptr, "NotifySystemUpdateForContentDelivery"},
|
|
|
|
{11, nullptr, "PrepareShutdown"},
|
2020-06-29 04:01:34 +02:00
|
|
|
{12, nullptr, "Unknown12"},
|
|
|
|
{13, nullptr, "Unknown13"},
|
|
|
|
{14, nullptr, "Unknown14"},
|
|
|
|
{15, nullptr, "Unknown15"},
|
2018-08-01 23:23:10 +02:00
|
|
|
{16, nullptr, "DestroySystemUpdateTask"},
|
|
|
|
{17, nullptr, "RequestSendSystemUpdate"},
|
|
|
|
{18, nullptr, "GetSendSystemUpdateProgress"},
|
|
|
|
};
|
|
|
|
// clang-format on
|
|
|
|
|
|
|
|
RegisterHandlers(functions);
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
void OpenSystemUpdateControl(Kernel::HLERequestContext& ctx) {
|
2018-11-26 07:06:13 +01:00
|
|
|
LOG_DEBUG(Service_NS, "called");
|
|
|
|
|
2018-08-01 23:23:10 +02:00
|
|
|
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
2021-05-21 07:05:04 +02:00
|
|
|
rb.Push(ResultSuccess);
|
2020-11-26 21:19:08 +01:00
|
|
|
rb.PushIpcInterface<ISystemUpdateControl>(system);
|
2018-08-01 23:23:10 +02:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
class NS_VM final : public ServiceFramework<NS_VM> {
|
|
|
|
public:
|
2020-11-26 21:19:08 +01:00
|
|
|
explicit NS_VM(Core::System& system_) : ServiceFramework{system_, "ns:vm"} {
|
2018-08-01 23:23:10 +02:00
|
|
|
// clang-format off
|
|
|
|
static const FunctionInfo functions[] = {
|
2020-11-29 09:47:10 +01:00
|
|
|
{1200, &NS_VM::NeedsUpdateVulnerability, "NeedsUpdateVulnerability"},
|
2018-08-01 23:23:10 +02:00
|
|
|
{1201, nullptr, "UpdateSafeSystemVersionForDebug"},
|
|
|
|
{1202, nullptr, "GetSafeSystemVersion"},
|
|
|
|
};
|
|
|
|
// clang-format on
|
|
|
|
|
|
|
|
RegisterHandlers(functions);
|
|
|
|
}
|
2020-11-29 09:47:10 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
void NeedsUpdateVulnerability(Kernel::HLERequestContext& ctx) {
|
|
|
|
LOG_WARNING(Service_NS, "(STUBBED) called");
|
|
|
|
|
|
|
|
IPC::ResponseBuilder rb{ctx, 3};
|
2021-05-21 07:05:04 +02:00
|
|
|
rb.Push(ResultSuccess);
|
2020-11-29 09:47:10 +01:00
|
|
|
rb.Push(false);
|
|
|
|
}
|
2018-08-01 23:23:10 +02:00
|
|
|
};
|
|
|
|
|
2019-09-22 08:40:58 +02:00
|
|
|
void InstallInterfaces(SM::ServiceManager& service_manager, Core::System& system) {
|
2019-09-22 08:35:43 +02:00
|
|
|
|
2020-11-18 13:53:10 +01:00
|
|
|
std::make_shared<NS>("ns:am2", system)->InstallAsService(service_manager);
|
|
|
|
std::make_shared<NS>("ns:ec", system)->InstallAsService(service_manager);
|
|
|
|
std::make_shared<NS>("ns:rid", system)->InstallAsService(service_manager);
|
|
|
|
std::make_shared<NS>("ns:rt", system)->InstallAsService(service_manager);
|
|
|
|
std::make_shared<NS>("ns:web", system)->InstallAsService(service_manager);
|
2021-04-07 17:41:52 +02:00
|
|
|
std::make_shared<NS>("ns:ro", system)->InstallAsService(service_manager);
|
2018-08-01 23:23:10 +02:00
|
|
|
|
2020-11-26 21:19:08 +01:00
|
|
|
std::make_shared<NS_DEV>(system)->InstallAsService(service_manager);
|
|
|
|
std::make_shared<NS_SU>(system)->InstallAsService(service_manager);
|
|
|
|
std::make_shared<NS_VM>(system)->InstallAsService(service_manager);
|
2018-08-01 23:23:10 +02:00
|
|
|
|
2019-09-22 08:40:58 +02:00
|
|
|
std::make_shared<PL_U>(system)->InstallAsService(service_manager);
|
2018-02-15 04:22:41 +01:00
|
|
|
}
|
|
|
|
|
2018-04-20 03:41:44 +02:00
|
|
|
} // namespace Service::NS
|