Line 45: |
Line 45: |
| |- | | |- |
| | 200 || [13.1.0+] SetRequiredAddOnContentsOnContentsAvailabilityTransition | | | 200 || [13.1.0+] SetRequiredAddOnContentsOnContentsAvailabilityTransition |
| + | |- |
| + | | 300 || [16.0.0+] SetupHostAddOnContent |
| + | |- |
| + | | 301 || [16.0.0+] GetRegisteredAddOnContentPath |
| + | |- |
| + | | 302 || [16.0.0+] UpdateCachedList |
| |} | | |} |
| | | |
Line 74: |
Line 80: |
| ! Cmd || Name | | ! Cmd || Name |
| |- | | |- |
− | | 0 || [[#RequestContentsAuthorizationToken]] | + | | 0 || [16.0.0+] RequestContentsAuthorizationTokenDeprecated ([12.0.0-15.0.1] [[#RequestContentsAuthorizationToken]]) |
| + | |- |
| + | | 1 || [16.0.0+] RequestContentsAuthorizationToken |
| |} | | |} |
| | | |
Line 766: |
Line 774: |
| | 603 || GetOwnedApplicationContentMetaStatus | | | 603 || GetOwnedApplicationContentMetaStatus |
| |- | | |- |
− | | 604 || RegisterContentsExternalKey | + | | 604 || [1.0.0-15.0.1] RegisterContentsExternalKey |
| |- | | |- |
| | 605 || ListApplicationContentMetaStatusWithRightsCheck | | | 605 || ListApplicationContentMetaStatusWithRightsCheck |
Line 777: |
Line 785: |
| |- | | |- |
| | 610 || [14.0.0+] GetInstalledContentMetaStorage | | | 610 || [14.0.0+] GetInstalledContentMetaStorage |
| + | |- |
| + | | 611 || [16.0.0+] PrepareAddOnContent |
| |- | | |- |
| | 700 || PushDownloadTaskList | | | 700 || PushDownloadTaskList |
Line 1,121: |
Line 1,131: |
| The data that can be read from the [[#IAsyncValue]] is [[#ApplicationUpdateInfo]]. | | The data that can be read from the [[#IAsyncValue]] is [[#ApplicationUpdateInfo]]. |
| | | |
− | Before using the cmd, official sw uses [[Network_Interface_services#IsAnyInternetRequestAccepted|IsAnyInternetRequestAccepted]] with the output from [[#Network_Interface_services#GetClientId|GetClientId]], throwing an error when the returned bool is false. | + | Before using the cmd, official sw uses [[Network_Interface_services#IsAnyInternetRequestAccepted|IsAnyInternetRequestAccepted]] with the output from [[Network_Interface_services#GetClientId|GetClientId]], throwing an error when the returned bool is false. |
| | | |
| ==== CancelApplicationDownload ==== | | ==== CancelApplicationDownload ==== |
Line 1,233: |
Line 1,243: |
| No input, returns an output u64. | | No input, returns an output u64. |
| | | |
− | A state flag must be zero, otherwise an error is thrown. When a state field is value 1, a hard-coded ProgramId for MaintenanceMenu is used. Otherwise, the ProgramId is loaded from [[System_Settings|system-setting]] <code>ns.applet!system_applet_id</code>. | + | A state flag must be non-zero, otherwise an error is thrown. When a state field is value 1, a hard-coded ProgramId for MaintenanceMenu is used. Otherwise, the ProgramId is loaded from [[System_Settings|system-setting]] <code>ns.applet!system_applet_id</code>. |
| | | |
| The SystemApplet is launched with StorageId=BuiltInSystem via [[Process_Manager_services|pmshell]] LaunchProgram ([10.0.0+] [[PGL_services#LaunchProgram|pgl]] with pgl_launch_flags=0). [[Process_Manager_services#LaunchFlags|LaunchFlags]] value 0x9 is used here. The output u64 from here is written to the output for this cmd, on success. | | The SystemApplet is launched with StorageId=BuiltInSystem via [[Process_Manager_services|pmshell]] LaunchProgram ([10.0.0+] [[PGL_services#LaunchProgram|pgl]] with pgl_launch_flags=0). [[Process_Manager_services#LaunchFlags|LaunchFlags]] value 0x9 is used here. The output u64 from here is written to the output for this cmd, on success. |
Line 1,242: |
Line 1,252: |
| No input, returns an output u64. | | No input, returns an output u64. |
| | | |
− | A state flag must be zero, otherwise an error is thrown. The ProgramId is loaded from [[System_Settings|system-setting]] <code>ns.applet!overlay_applet_id</code>. | + | A state flag must be non-zero, otherwise an error is thrown. The ProgramId is loaded from [[System_Settings|system-setting]] <code>ns.applet!overlay_applet_id</code>. |
| | | |
| The OverlayApplet is launched with StorageId=BuiltInSystem via [[Process_Manager_services|pmshell]] LaunchProgram ([10.0.0+] [[PGL_services#LaunchProgram|pgl]] with pgl_launch_flags=0). [[Process_Manager_services#LaunchFlags|LaunchFlags]] value 0x9 is used here. The output u64 from here is written to the output for this cmd, on success. | | The OverlayApplet is launched with StorageId=BuiltInSystem via [[Process_Manager_services|pmshell]] LaunchProgram ([10.0.0+] [[PGL_services#LaunchProgram|pgl]] with pgl_launch_flags=0). [[Process_Manager_services#LaunchFlags|LaunchFlags]] value 0x9 is used here. The output u64 from here is written to the output for this cmd, on success. |
Line 1,564: |
Line 1,574: |
| | | |
| ==== CreateApplicationResource ==== | | ==== CreateApplicationResource ==== |
− | Returns an [[#IApplicationResource]]. | + | Takes an input [[#ApplicationResourceType]]. Returns an [[#IApplicationResource]]. |
| | | |
| ==== GetApplicationResource ==== | | ==== GetApplicationResource ==== |
− | Returns an [[#IApplicationResource]]. | + | Takes an input u64 ProcessId and an input [[#ApplicationResourceType]]. Returns an [[#IApplicationResource]]. |
| | | |
| ==== RegisterDeviceLockKey ==== | | ==== RegisterDeviceLockKey ==== |
Line 1,895: |
Line 1,905: |
| | 13 || [8.0.0+] [[#GetRunningApplicationStatus]] | | | 13 || [8.0.0+] [[#GetRunningApplicationStatus]] |
| |- | | |- |
− | | 14 || [10.0.0+] SelectApplicationLicense | + | | 14 || [10.0.0-15.0.1] SelectApplicationLicense |
| |- | | |- |
| | 15 || [12.0.0+] [[#RequestContentsAuthorizationToken]] | | | 15 || [12.0.0+] [[#RequestContentsAuthorizationToken]] |
Line 2,736: |
Line 2,746: |
| |- | | |- |
| | 902 || [13.0.0+] ListUsersUnqualifiedForDebug || | | | 902 || [13.0.0+] ListUsersUnqualifiedForDebug || |
| + | |- |
| + | | 910 || [16.0.0+] RefreshFirmwareSettingsForDebug || |
| |- | | |- |
| | 997 || [3.0.0+] DebugInvalidateTokenCacheForUser || | | | 997 || [3.0.0+] DebugInvalidateTokenCacheForUser || |
Line 2,802: |
Line 2,814: |
| |- | | |- |
| | 150 || CreateAuthorizationRequest || Returns an [[#IAuthorizationRequest]]. | | | 150 || CreateAuthorizationRequest || Returns an [[#IAuthorizationRequest]]. |
| + | |- |
| + | | 160 || [15.0.0+] RequiresUpdateNetworkServiceAccountIdTokenCache || |
| + | |- |
| + | | 161 || [16.0.0+] RequireReauthenticationOfNetworkServiceAccount || |
| |} | | |} |
| | | |
Line 2,888: |
Line 2,904: |
| |- | | |- |
| | 150 || CreateAuthorizationRequest || Returns an [[#IAuthorizationRequest]]. | | | 150 || CreateAuthorizationRequest || Returns an [[#IAuthorizationRequest]]. |
| + | |- |
| + | | 160 || [15.0.0+] RequiresUpdateNetworkServiceAccountIdTokenCache || |
| + | |- |
| + | | 161 || [16.0.0+] RequireReauthenticationOfNetworkServiceAccount || |
| |- | | |- |
| | 200 || IsRegistered || | | | 200 || IsRegistered || |
Line 3,026: |
Line 3,046: |
| |- | | |- |
| | 199 || [2.0.0-5.1.0] GetUrlForIntroductionOfExtraMembership || | | | 199 || [2.0.0-5.1.0] GetUrlForIntroductionOfExtraMembership || |
| + | |- |
| + | | 200 || [16.0.0+] ApplyAsyncWithAuthorizedToken || |
| |} | | |} |
| | | |
Line 3,392: |
Line 3,414: |
| | | |
| = ApplicationUpdateInfo = | | = ApplicationUpdateInfo = |
− | This is "nn::ns::ApplicationUpdateInfo". | + | This is "nn::ns::ApplicationUpdateInfo". This is an u8. |
| + | |
| + | {| class="wikitable" border="1" |
| + | |- |
| + | ! Value |
| + | ! Description |
| + | |- |
| + | | 0 || UpToDate |
| + | |- |
| + | | 1 || Updatable |
| + | |} |
| | | |
− | This is an u8. [[qlaunch]] just checks whether this is 0.
| + | [[qlaunch]] just checks whether this is 0. |
| | | |
| = ApplicationOccupiedSize = | | = ApplicationOccupiedSize = |
| This is "nn::ns::ApplicationOccupiedSize". This is a 0x80-byte struct. | | This is "nn::ns::ApplicationOccupiedSize". This is a 0x80-byte struct. |
| | | |
− | = ProgressForDeleteUserSaveDataAll = | + | {| class="wikitable" border="1" |
− | This is "nn::ns::detail::ProgressForDeleteUserSaveDataAll". This is a 0x28-byte struct.
| + | |- |
− | | + | ! Offset |
− | = ApplicationViewDeprecated =
| + | ! Size |
− | This is "nn::ns::ApplicationViewDeprecated". This is a 0x40-byte struct.
| + | ! Description |
| + | |- |
| + | | 0x0 || 0x20 * 4 || Array of [[#ApplicationOccupiedSizeEntity]] |
| + | |} |
| | | |
− | This is converted from [[#ApplicationView]] by [[#GetApplicationViewDeprecated]] on newer system-versions as follows: | + | = ApplicationOccupiedSizeEntity = |
| + | This is "nn::ns::ApplicationOccupiedSizeEntity". This is a 0x20-byte struct. |
| | | |
| {| class="wikitable" border="1" | | {| class="wikitable" border="1" |
Line 3,413: |
Line 3,449: |
| ! Description | | ! Description |
| |- | | |- |
− | | 0x0 || 0x20 || Same as [[#ApplicationView]] +0x0. | + | | 0x0 || 0x1 || [[NCM_services#StorageId|StorageId]] |
− | |-
| |
− | | 0x20 || 0x4 || Same as [[#ApplicationView]] +0x20.
| |
| |- | | |- |
− | | 0x24 || 0x2 || Same as [[#ApplicationView]] +0x24. | + | | 0x1 || 0x7 || Reserved |
| |- | | |- |
− | | 0x26 || 0x2 || Cleared to 0. | + | | 0x8 || 0x8 || AppSize |
| |- | | |- |
− | | 0x28 || 0x10 || Same as [[#ApplicationView]] +0x30. | + | | 0x10 || 0x8 || PatchSize |
| |- | | |- |
− | | 0x38 || 0x4 || Same as [[#ApplicationView]] +0x40. | + | | 0x18 || 0x8 || AocSize |
− | |-
| + | |} |
− | | 0x3C || 0x1 || Same as [[#ApplicationView]] +0x44.
| + | |
− | |-
| + | = ProgressForDeleteUserSaveDataAll = |
− | | 0x3D || 0x2 || Cleared to 0.
| + | This is "nn::ns::detail::ProgressForDeleteUserSaveDataAll". This is a 0x28-byte struct. |
− | |-
| |
− | | 0x3F || 0x1 || Cleared to 0.
| |
− | |} | |
− | | |
− | = ApplicationView = | |
− | This is "nn::ns::ApplicationView". This is a 0x50-byte struct. | |
| | | |
| {| class="wikitable" border="1" | | {| class="wikitable" border="1" |
Line 3,441: |
Line 3,469: |
| ! Description | | ! Description |
| |- | | |- |
− | | 0x0 || 0x8 || [[NCM_services#ApplicationId|ApplicationId]] | + | | 0x0 || 0x8 || StartedAt |
| + | |- |
| + | | 0x8 || 0x4 || Count |
| + | |- |
| + | | 0xC || 0x4 || Reserved |
| + | |- |
| + | | 0x10 || 0x8 || SizeInBytes |
| |- | | |- |
− | | 0x8 || 0x4 || ? | + | | 0x18 || 0x1 || IsSystem |
| |- | | |- |
− | | 0xC || 0x4 || Flags | + | | 0x19 || 0x7 || Reserved |
| |- | | |- |
− | | 0x10 || 0x40 || ? | + | | 0x20 || 0x8 || ApplicationId |
| |} | | |} |
| | | |
− | = ApplicationViewWithPromotionInfo = | + | = ApplicationViewDeprecated = |
− | This is a 0x70-byte struct. | + | This is "nn::ns::ApplicationViewDeprecated". This is a 0x40-byte struct. |
| | | |
| {| class="wikitable" border="1" | | {| class="wikitable" border="1" |
Line 3,459: |
Line 3,493: |
| ! Description | | ! Description |
| |- | | |- |
− | | 0x0 || 0x50 || [[#ApplicationView]] | + | | 0x0 || 0x8 || [[NCM_services#ApplicationId|ApplicationId]] |
| + | |- |
| + | | 0x8 || 0x4 || Version |
| + | |- |
| + | | 0xC || 0x4 || [[#ApplicationViewFlag|Flag]] |
| + | |- |
| + | | 0x10 || 0x18 || [[#ApplicationDownloadProgress|Progress]] |
| |- | | |- |
− | | 0x50 || 0x20 || [[#PromotionInfo]] | + | | 0x28 || 0x18 || [[#ApplicationApplyDeltaProgress|ApplyProgress]] |
| |} | | |} |
| | | |
− | = PromotionInfo =
| + | This is converted from [[#ApplicationView]] by [[#GetApplicationViewDeprecated]] on newer system-versions as follows: |
− | This is a 0x20-byte struct. | |
| | | |
| {| class="wikitable" border="1" | | {| class="wikitable" border="1" |
Line 3,473: |
Line 3,512: |
| ! Description | | ! Description |
| |- | | |- |
− | | 0x0 || 0x8 || PosixTime start_timestamp. | + | | 0x0 || 0x20 || Same as [[#ApplicationView]] +0x0. |
| |- | | |- |
− | | 0x8 || 0x8 || PosixTime end_timestamp. | + | | 0x20 || 0x4 || Same as [[#ApplicationView]] +0x20. |
| |- | | |- |
− | | 0x10 || 0x8 || Remaining time until the promotion ends, in nanoseconds ({end_timestamp - current_time} converted to nanoseconds). | + | | 0x24 || 0x2 || Same as [[#ApplicationView]] +0x24. |
| |- | | |- |
− | | 0x18 || 0x4 || Not set, left at zero. | + | | 0x26 || 0x2 || Cleared to 0. |
| + | |- |
| + | | 0x28 || 0x10 || Same as [[#ApplicationView]] +0x30. |
| + | |- |
| + | | 0x38 || 0x4 || Same as [[#ApplicationView]] +0x40. |
| + | |- |
| + | | 0x3C || 0x1 || Same as [[#ApplicationView]] +0x44. |
| |- | | |- |
− | | 0x1C || 0x1 || Flags. Bit0: whether the PromotionInfo is valid (including bit1). Bit1 clear: u64 +0x10 is set. | + | | 0x3D || 0x2 || Cleared to 0. |
| |- | | |- |
− | | 0x1D || 0x3 || Padding | + | | 0x3F || 0x1 || Cleared to 0. |
| |} | | |} |
| | | |
− | = NoDownloadRightsErrorResolution = | + | = ApplicationViewFlag = |
− | This is "nn::ns::NoDownloadRightsErrorResolution". | + | This is "nn::ns::ApplicationViewFlag". This is a 32-bit flag. |
| | | |
− | = BackgroundNetworkUpdateState =
| |
| {| class="wikitable" border="1" | | {| class="wikitable" border="1" |
| |- | | |- |
− | ! Value | + | ! Bit |
− | ! Description | + | ! Description |
| + | |- |
| + | | 0 |
| + | | |
| + | |- |
| + | | 1 |
| + | | |
| + | |- |
| + | | 2 |
| + | | |
| + | |- |
| + | | 3 |
| + | | |
| + | |- |
| + | | 4 |
| + | | |
| + | |- |
| + | | 5 |
| + | | |
| + | |- |
| + | | 6 |
| + | | |
| + | |- |
| + | | 7 |
| + | | |
| + | |- |
| + | | 8 |
| + | | |
| + | |- |
| + | | 9 |
| + | | |
| + | |- |
| + | | 10 |
| + | | |
| + | |- |
| + | | 11 |
| + | | |
| + | |- |
| + | | 12 |
| + | | |
| + | |- |
| + | | 13 |
| + | | |
| + | |- |
| + | | 14 |
| + | | |
| |- | | |- |
− | | 0 || No sysupdate task exists. | + | | 15 |
| + | | |
| |- | | |- |
− | | 1 || Sysupdate download in progress. | + | | 16 |
| + | | |
| |- | | |- |
− | | 2 || Sysupdate ready, pending install. | + | | 17 |
| + | | |
| |} | | |} |
| | | |
− | This is "nn::ns::BackgroundNetworkUpdateState". This is an u8. | + | = ApplicationDownloadProgress = |
− | | + | This is "nn::ns::ApplicationDownloadProgress". This is a 0x18-byte struct. |
− | Similar to [[#HasDownloaded]], [[#GetBackgroundNetworkUpdateState]] uses [[NIM_services|nim]] ListSystemUpdateTask and [[NIM_services|nim]] GetSystemUpdateTaskInfo. When ListSystemUpdateTask successfully returns a task and GetSystemUpdateTaskInfo is successful, the output value is set to: <code>1 + *((u8*)(taskinfo+0) == 0x3</code>. Otherwise, value=0.
| |
− | | |
− | [[#GetBackgroundNetworkUpdateState]] always returns Result 0, however this will assert if GetSystemUpdateTaskInfo fails with ret!=0x3C89.
| |
| | | |
− | = SystemUpdateProgress =
| |
| {| class="wikitable" border="1" | | {| class="wikitable" border="1" |
| |- | | |- |
Line 3,515: |
Line 3,603: |
| ! Description | | ! Description |
| |- | | |- |
− | | 0x0 || 0x8 || s64 Current size. This value can be larger than total_size when the async operation is finishing. When total_size is <=0, this current_size field may contain a progress value for when the total_size is not yet determined. | + | | 0x0 || 0x8 || Downloaded |
| |- | | |- |
− | | 0x8 || 0x8 || s64 Total size, this field is only valid when >0. | + | | 0x8 || 0x8 || Total |
| + | |- |
| + | | 0x10 || 0x4 || LastResult |
| + | |- |
| + | | 0x14 || 0x1 || [[#ApplicationDownloadState|State]] |
| + | |- |
| + | | 0x15 || 0x3 || Reserved |
| |} | | |} |
| | | |
− | This is "nn::ns::SystemUpdateProgress". This is a 0x10-byte struct. | + | = ApplicationApplyDeltaProgress = |
| + | This is "nn::ns::ApplicationApplyDeltaProgress". This is a 0x18-byte struct. |
| | | |
− | Commands which have this as output will return 0 with the output cleared, when no task is available.
| |
− |
| |
− | = EulaDataPath =
| |
− | This is "nn::ns::detail::EulaDataPath". This is a 0x100-byte struct.
| |
− |
| |
− | This contains a file path.
| |
− |
| |
− | = SystemDeliveryInfo =
| |
| {| class="wikitable" border="1" | | {| class="wikitable" border="1" |
| |- | | |- |
Line 3,536: |
Line 3,623: |
| ! Description | | ! Description |
| |- | | |- |
− | | 0x0 || 0x4 || SystemDeliveryProtocolVersion. Must be <= to and match [[System_Settings|system-setting]] <code>contents_delivery!system_delivery_protocol_version</code>. | + | | 0x0 || 0x8 || Applied |
| |- | | |- |
− | | 0x4 || 0x4 || ApplicationDeliveryProtocolVersion. Loaded from [[System_Settings|system-setting]] <code>contents_delivery!application_delivery_protocol_version</code>. Unused by [[#RequestSendSystemUpdate]]/[[#RequestReceiveSystemUpdate]], besides HMAC validation. | + | | 0x8 || 0x8 || Total |
| |- | | |- |
− | | 0x8 || 0x1 || HasExFat. Unused by [[#RequestSendSystemUpdate]]/[[#RequestReceiveSystemUpdate]], besides HMAC validation. | + | | 0x10 || 0x4 || LastResult |
| |- | | |- |
− | | 0x9 || 0x3 || Reserved. | + | | 0x14 || 0x1 || [[#ApplicationApplyDeltaState|State]] |
| |- | | |- |
− | | 0xC || 0x4 || SystemUpdateMetaVersion. | + | | 0x15 || 0x3 || Reserved |
| + | |} |
| + | |
| + | = ApplicationDownloadState = |
| + | This is "nn::ns::ApplicationDownloadState". This is an u8. |
| + | |
| + | {| class="wikitable" border="1" |
| |- | | |- |
− | | 0x10 || 0x8 || SystemUpdateMetaId.
| + | ! Value |
| + | ! Description |
| |- | | |- |
− | | 0x18 || 0x1 || FirmwareVariationId. Used by [[#RequestSendSystemUpdate]]. | + | | 0 || Runnable |
| |- | | |- |
− | | 0x19 || 0x1 || UpdatableFirmwareGroupId. Unused by [[#RequestSendSystemUpdate]]/[[#RequestReceiveSystemUpdate]], besides HMAC validation. | + | | 1 || Suspended |
| |- | | |- |
− | | 0x1A || 0x1 || PlatformRegion (0x00 = Unknown, 0x01 = Global, 0x02 = China). | + | | 2 || NotEnoughSpace |
| |- | | |- |
− | | 0x1B || 0xC5 || Unused by [[#RequestSendSystemUpdate]]/[[#RequestReceiveSystemUpdate]], besides HMAC validation. | + | | 3 || Fatal |
| |- | | |- |
− | | 0xE0 || 0x20 || HMAC-SHA256 over the previous 0xE0-bytes. | + | | 4 || Finished |
| |} | | |} |
| | | |
− | This is "nn::ns::SystemDeliveryInfo". This is a 0x100-byte struct. | + | = ApplicationApplyDeltaState = |
| + | This is "nn::ns::ApplicationApplyDeltaState". This is an u8. |
| | | |
− | = ApplicationDeliveryInfo =
| |
| {| class="wikitable" border="1" | | {| class="wikitable" border="1" |
| |- | | |- |
− | ! Offset | + | ! Value |
− | ! Size
| |
| ! Description | | ! Description |
| |- | | |- |
− | | 0x0 || 0x8 || ? | + | | 0 || Applying |
| |- | | |- |
− | | 0x8 || 0x8 || ApplicationId. | + | | 1 || Suspended |
| |- | | |- |
− | | 0x10 || 0x4 || ApplicationVersion. | + | | 2 || NotEnoughSpace |
− | |-
| |
− | | 0x14 || 0x4 || ?
| |
| |- | | |- |
− | | 0x18 || 0x4 || RequiredSystemVersion. | + | | 3 || Fatal |
| |- | | |- |
− | | 0x1C || 0x4 || ? | + | | 4 || NoTask |
| |- | | |- |
− | | 0x20 || 0xC0 || ? | + | | 5 || WaitApply |
| |- | | |- |
− | | 0xE0 || 0x20 || HMAC-SHA256 over the previous 0xE0-bytes. Uses a different key than [[#SystemDeliveryInfo]]. | + | | 6 || Applied |
| |} | | |} |
| | | |
− | This is "nn::ns::ApplicationDeliveryInfo". This is a 0x100-byte struct. | + | = ApplicationView = |
− | | + | This is "nn::ns::ApplicationView". This is a 0x50-byte struct. |
− | = LatestSystemUpdate = | + | |
− | {| class="wikitable" border="1" | + | {| class="wikitable" border="1" |
− | |- | + | |- |
− | ! Value | + | ! Offset |
− | ! Description | + | ! Size |
− | |- | + | ! Description |
− | | 1 || Unknown. | + | |- |
− | |- | + | | 0x0 || 0x8 || [[NCM_services#ApplicationId|ApplicationId]] |
− | | 2 || Unknown. | + | |- |
− | |- | + | | 0x8 || 0x4 || ? |
− | | Other values || Unknown. | + | |- |
− | |} | + | | 0xC || 0x4 || Flags |
− | | + | |- |
− | This is "nn::ns::LatestSystemUpdate". This is an u8. | + | | 0x10 || 0x40 || ? |
− | | + | |} |
− | = ReceiveApplicationProgress = | + | |
− | This is "nn::ns::ReceiveApplicationProgress". This is a 0x10-byte struct. | + | = ApplicationViewWithPromotionInfo = |
− | | + | This is a 0x70-byte struct. |
− | = SendApplicationProgress = | + | |
− | This is "nn::ns::SendApplicationProgress". This is a 0x10-byte struct. | + | {| class="wikitable" border="1" |
− | | + | |- |
− | = ApplicationRightsOnClient = | + | ! Offset |
− | This is a 0x20-byte struct. | + | ! Size |
− | | + | ! Description |
− | [[qlaunch]] only uses +0x18/+0x19 in this struct. | + | |- |
− | | + | | 0x0 || 0x50 || [[#ApplicationView]] |
− | {| class="wikitable" border="1" | + | |- |
− | |- | + | | 0x50 || 0x20 || [[#PromotionInfo]] |
− | ! Offset | + | |} |
− | ! Size | + | |
− | ! Description | + | = PromotionInfo = |
| + | This is a 0x20-byte struct. |
| + | |
| + | {| class="wikitable" border="1" |
| + | |- |
| + | ! Offset |
| + | ! Size |
| + | ! Description |
| + | |- |
| + | | 0x0 || 0x8 || PosixTime start_timestamp. |
| + | |- |
| + | | 0x8 || 0x8 || PosixTime end_timestamp. |
| + | |- |
| + | | 0x10 || 0x8 || Remaining time until the promotion ends, in nanoseconds ({end_timestamp - current_time} converted to nanoseconds). |
| + | |- |
| + | | 0x18 || 0x4 || Not set, left at zero. |
| + | |- |
| + | | 0x1C || 0x1 || Flags. Bit0: whether the PromotionInfo is valid (including bit1). Bit1 clear: u64 +0x10 is set. |
| + | |- |
| + | | 0x1D || 0x3 || Padding |
| + | |} |
| + | |
| + | = ApplicationResourceType = |
| + | This is "nn::ns::ApplicationResourceType". This is an u8. |
| + | |
| + | {| class="wikitable" border="1" |
| + | |- |
| + | ! Value |
| + | ! Description |
| + | |- |
| + | | 0 || ApplicationResource |
| + | |- |
| + | | 1 || MicroApplicationResource |
| + | |} |
| + | |
| + | = ApplicationErrorCodeCategory = |
| + | This is "nn::ns::ApplicationErrorCodeCategory". This is an u64. |
| + | |
| + | = NoDownloadRightsErrorResolution = |
| + | This is "nn::ns::NoDownloadRightsErrorResolution". |
| + | |
| + | = BackgroundNetworkUpdateState = |
| + | This is "nn::ns::BackgroundNetworkUpdateState". This is an u8. |
| + | |
| + | {| class="wikitable" border="1" |
| + | |- |
| + | ! Value |
| + | ! Description |
| + | |- |
| + | | 0 || None |
| + | |- |
| + | | 1 || InProgress |
| + | |- |
| + | | 2 || Ready |
| + | |} |
| + | |
| + | Similar to [[#HasDownloaded]], [[#GetBackgroundNetworkUpdateState]] uses [[NIM_services|nim]] ListSystemUpdateTask and [[NIM_services|nim]] GetSystemUpdateTaskInfo. When ListSystemUpdateTask successfully returns a task and GetSystemUpdateTaskInfo is successful, the output value is set to: <code>1 + *((u8*)(taskinfo+0) == 0x3</code>. Otherwise, value=0. |
| + | |
| + | [[#GetBackgroundNetworkUpdateState]] always returns Result 0, however this will assert if GetSystemUpdateTaskInfo fails with ret!=0x3C89. |
| + | |
| + | = SystemUpdateProgress = |
| + | This is "nn::ns::SystemUpdateProgress". This is a 0x10-byte struct. |
| + | |
| + | {| class="wikitable" border="1" |
| + | |- |
| + | ! Offset |
| + | ! Size |
| + | ! Description |
| + | |- |
| + | | 0x0 || 0x8 || Loaded (this value can be larger than total_size when the async operation is finishing and when total_size is <=0, this current_size field may contain a progress value for when the total_size is not yet determined) |
| + | |- |
| + | | 0x8 || 0x8 || Total (this field is only valid when >0) |
| + | |} |
| + | |
| + | Commands which have this as output will return 0 with the output cleared, when no task is available. |
| + | |
| + | = EulaDataPath = |
| + | This is "nn::ns::detail::EulaDataPath". This is a 0x100-byte struct. |
| + | |
| + | This contains a file path. |
| + | |
| + | = SystemDeliveryInfo = |
| + | This is "nn::ns::SystemDeliveryInfo". This is a 0x100-byte struct. |
| + | |
| + | {| class="wikitable" border="1" |
| + | |- |
| + | ! Offset |
| + | ! Size |
| + | ! Description |
| + | |- |
| + | | 0x0 || 0x4 || SystemDeliveryProtocolVersion. Must be <= to and match [[System_Settings|system-setting]] <code>contents_delivery!system_delivery_protocol_version</code>. |
| + | |- |
| + | | 0x4 || 0x4 || ApplicationDeliveryProtocolVersion. Loaded from [[System_Settings|system-setting]] <code>contents_delivery!application_delivery_protocol_version</code>. Unused by [[#RequestSendSystemUpdate]]/[[#RequestReceiveSystemUpdate]], besides HMAC validation. |
| + | |- |
| + | | 0x8 || 0x1 || HasExFat. Unused by [[#RequestSendSystemUpdate]]/[[#RequestReceiveSystemUpdate]], besides HMAC validation. |
| + | |- |
| + | | 0x9 || 0x3 || Reserved. |
| + | |- |
| + | | 0xC || 0x4 || SystemUpdateMetaVersion. |
| + | |- |
| + | | 0x10 || 0x8 || SystemUpdateMetaId. |
| + | |- |
| + | | 0x18 || 0x1 || FirmwareVariationId. Used by [[#RequestSendSystemUpdate]]. |
| + | |- |
| + | | 0x19 || 0x1 || UpdatableFirmwareGroupId. Unused by [[#RequestSendSystemUpdate]]/[[#RequestReceiveSystemUpdate]], besides HMAC validation. |
| + | |- |
| + | | 0x1A || 0x1 || PlatformRegion (0x00 = Unknown, 0x01 = Global, 0x02 = China). |
| + | |- |
| + | | 0x1B || 0xC5 || Unused by [[#RequestSendSystemUpdate]]/[[#RequestReceiveSystemUpdate]], besides HMAC validation. |
| + | |- |
| + | | 0xE0 || 0x20 || HMAC-SHA256 over the previous 0xE0-bytes. |
| + | |} |
| + | |
| + | = ApplicationDeliveryInfo = |
| + | This is "nn::ns::ApplicationDeliveryInfo". This is a 0x100-byte struct. |
| + | |
| + | {| class="wikitable" border="1" |
| + | |- |
| + | ! Offset |
| + | ! Size |
| + | ! Description |
| + | |- |
| + | | 0x0 || 0x8 || ? |
| + | |- |
| + | | 0x8 || 0x8 || ApplicationId. |
| + | |- |
| + | | 0x10 || 0x4 || ApplicationVersion. |
| + | |- |
| + | | 0x14 || 0x4 || ? |
| + | |- |
| + | | 0x18 || 0x4 || RequiredSystemVersion. |
| + | |- |
| + | | 0x1C || 0x4 || ? |
| + | |- |
| + | | 0x20 || 0xC0 || ? |
| + | |- |
| + | | 0xE0 || 0x20 || HMAC-SHA256 over the previous 0xE0-bytes. Uses a different key than [[#SystemDeliveryInfo]]. |
| + | |} |
| + | |
| + | = LatestSystemUpdate = |
| + | This is "nn::ns::LatestSystemUpdate". This is an u8. |
| + | |
| + | {| class="wikitable" border="1" |
| + | |- |
| + | ! Value |
| + | ! Description |
| + | |- |
| + | | 0 || UpToDate |
| + | |- |
| + | | 1 || Downloaded |
| + | |- |
| + | | 2 || NeedsDownload |
| + | |} |
| + | |
| + | = ReceiveApplicationProgress = |
| + | This is "nn::ns::ReceiveApplicationProgress". This is a 0x10-byte struct. |
| + | |
| + | = SendApplicationProgress = |
| + | This is "nn::ns::SendApplicationProgress". This is a 0x10-byte struct. |
| + | |
| + | = ApplicationRightsOnClient = |
| + | This is a 0x20-byte struct. |
| + | |
| + | {| class="wikitable" border="1" |
| + | |- |
| + | ! Offset |
| + | ! Size |
| + | ! Description |
| + | |- |
| + | | 0x0 || 0x8 || [[NCM_services#ApplicationId|ApplicationId]] |
| + | |- |
| + | | 0x8 || 0x10 || [[Account_services#Uid|Uid]] |
| + | |- |
| + | | 0x18 || 0x1 || Flags, [[qlaunch]] only uses bit0-bit4 and bit7. |
| + | |- |
| + | | 0x19 || 0x1 || Flags, [[qlaunch]] only uses bit0. |
| + | |- |
| + | | 0x1A || 0x6 || Unknown |
| + | |} |
| + | |
| + | [[qlaunch]] only uses +0x18/+0x19 in this struct. |
| + | |
| + | = DownloadTaskStatus = |
| + | This is "nn::ns::DownloadTaskStatus". This is a 0x20-byte struct. |
| + | |
| + | {| class="wikitable" border="1" |
| + | |- |
| + | ! Offset |
| + | ! Size |
| + | ! Description |
| + | |- |
| + | | 0x0 || 0x10 || Uuid |
| + | |- |
| + | | 0x10 || 0x8 || [[NCM_services#ApplicationId|ApplicationId]] |
| + | |- |
| + | | 0x18 || 0x1 || [[#DownloadTaskStatusDetail|Detail]] |
| + | |- |
| + | | 0x19 || 0x1 || NeedsCleanup |
| + | |- |
| + | | 0x1A || 0x2 || Reserved |
| + | |- |
| + | | 0x1C || 0x4 || Result |
| + | |} |
| + | |
| + | = DownloadTaskStatusDetail = |
| + | This is "nn::ns::DownloadTaskStatusDetail". This is an u8. |
| + | |
| + | {| class="wikitable" border="1" |
| + | |- |
| + | ! Value |
| + | ! Description |
| + | |- |
| + | | 0 || Created |
| + | |- |
| + | | 1 || Added |
| + | |- |
| + | | 2 || AlreadyExists |
| |- | | |- |
− | | 0x0 || 0x8 || [[NCM_services#ApplicationId|ApplicationId]] | + | | 3 || Failed |
− | |-
| |
− | | 0x8 || 0x10 || [[Account_services#Uid|Uid]]
| |
− | |-
| |
− | | 0x18 || 0x1 || Flags, [[qlaunch]] only uses bit0-bit4 and bit7.
| |
− | |-
| |
− | | 0x19 || 0x1 || Flags, [[qlaunch]] only uses bit0.
| |
− | |-
| |
− | | 0x1A || 0x6 || Unknown
| |
| |} | | |} |
− |
| |
− | = DownloadTaskStatus =
| |
− | This is "nn::ns::DownloadTaskStatus". This is a 0x20-byte struct.
| |
| | | |
| = ApplicationLaunchInfo = | | = ApplicationLaunchInfo = |
Line 3,656: |
Line 3,952: |
| | | |
| = UserData = | | = UserData = |
| + | This is a 0x80-byte struct. |
| + | |
| {| class="wikitable" border="1" | | {| class="wikitable" border="1" |
| |- | | |- |
Line 3,673: |
Line 3,971: |
| |} | | |} |
| | | |
− | This is a 0x80-byte struct. | + | = ProfileBase = |
| + | This is a 0x38-byte struct. |
| | | |
− | = ProfileBase =
| |
| {| class="wikitable" border="1" | | {| class="wikitable" border="1" |
| |- | | |- |
Line 3,685: |
Line 3,983: |
| |- | | |- |
| | 0x18 || 0x20 || UTF-8 Nickname. Official sw uses strncpy to copy this into another struct (<code>nn::account::Nickname</code>), with a NUL-byte written after the copied data. | | | 0x18 || 0x20 || UTF-8 Nickname. Official sw uses strncpy to copy this into another struct (<code>nn::account::Nickname</code>), with a NUL-byte written after the copied data. |
− | |-
| |
| |} | | |} |
− |
| |
− | This is a 0x38-byte struct.
| |
| | | |
| = Uid = | | = Uid = |
Line 3,696: |
Line 3,991: |
| [[Process_Manager_services|pm:bm]] GetBootMode is used to determine whether aoc:u is available (see above). This value is also passed to thread "nn.ns.DelayedInitialization", which calls various funcs depending on the BootMode in various cases. | | [[Process_Manager_services|pm:bm]] GetBootMode is used to determine whether aoc:u is available (see above). This value is also passed to thread "nn.ns.DelayedInitialization", which calls various funcs depending on the BootMode in various cases. |
| | | |
− | The output of GetBootMode is also written into state. This same func later enters a code block when BootMode is Maintenance/SafeMode: various [[NCM_services|ncm]] cmds are used with input StorageId=BuiltInUser (VerifyContentMetaDatabase, VerifyContentStorage, ActivateContentMetaDatabase, ActivateContentStorage, InactivateContentMetaDatabase, InactivateContentStorage) and state fields are written. Then if the BootMode is Maintenance the savedata for [[Flash_Filesystem|ns_rightsid]] (0x800000000000004A) is deleted. Then 0 is returned. | + | The "nn.ns.DelayedInitialization" thread uses BootMode as follows (this also handles various other initialization): |
| + | * Initializes [[NPNS_services|npns:s]] only for BootMode Normal/Maintenance. |
| + | * Initializes the hosted acc:* services and service [[Account_services|acc:su]] only for BootMode Normal/Maintenance. |
| + | * Calls a func only for BootMode Normal. |
| + | * Initializes [[ETicket_services|es]] and [[Shared_Database_services|avm]] only for BootMode Normal/Maintenance. |
| + | |
| + | The output of GetBootMode is also written into state. This same func later enters a code block when BootMode is Maintenance/SafeMode: various [[NCM_services|ncm]] cmds are used with input StorageId=BuiltInUser (VerifyContentMetaDatabase, VerifyContentStorage, ActivateContentMetaDatabase, ActivateContentStorage, InactivateContentMetaDatabase, InactivateContentStorage) and state fields are written. Then if the BootMode is Maintenance the savedata for [[Flash_Filesystem|ns_rightsid]] (0x800000000000004A) is deleted. Then 0 is returned. Otherwise for BootMode Normal it continues with various initialization, including gamecard handling which handles launching the gamecard title in certain conditions (this is the only time ns launches anything with pgl outside of service cmds). |
| | | |
| In the above block, InactivateContentMetaDatabase/InactivateContentStorage are only used if using ActivateContentMetaDatabase/ActivateContentStorage failed (error is only checked after using both cmds). If any of the ncm cmds prior to this fail, it will skip using the rest of the ncm cmds. | | In the above block, InactivateContentMetaDatabase/InactivateContentStorage are only used if using ActivateContentMetaDatabase/ActivateContentStorage failed (error is only checked after using both cmds). If any of the ncm cmds prior to this fail, it will skip using the rest of the ncm cmds. |
| | | |
| [[Category:Services]] | | [[Category:Services]] |