Difference between revisions of "Profile Selector"

From Nintendo Switch Brew
Jump to navigation Jump to search
Line 24: Line 24:
 
| 0x0 || 0x4 || [[#UiMode]]
 
| 0x0 || 0x4 || [[#UiMode]]
 
|-
 
|-
| 0x4 || 0x4 ||  
+
| 0x4 || 0x4 || Padding.
 
|-
 
|-
 
| 0x8 || 0x80 || u128 invalidUidList[8]. This is copied from [[#UserSelectionSettings]].
 
| 0x8 || 0x80 || u128 invalidUidList[8]. This is copied from [[#UserSelectionSettings]].
Line 36: Line 36:
 
| 0x92 || 0x1 || Set to 0x1 by ShowUserSelectorForSystem/ShowUserSelectorForLauncher.
 
| 0x92 || 0x1 || Set to 0x1 by ShowUserSelectorForSystem/ShowUserSelectorForLauncher.
 
|-
 
|-
| 0x93 || 0x1 || u8 isPermitted. ShowUserSelector* sets this to the output bool from [[Account_services#IsUserRegistrationRequestPermitted|IsUserRegistrationRequestPermitted]].
+
| 0x93 || 0x1 || u8 isPermitted. ShowUserSelector* sets this to the output bool from [[Account_services#IsUserRegistrationRequestPermitted|IsUserRegistrationRequestPermitted]]. With [[#UiMode|UserSelector]] this enables the option to create a new user. When not set, a dialog will be displayed when the user attempts to create an user.
 
|-
 
|-
 
| 0x94 || 0x1 || u8 showSkipButton. This is copied from [[#UserSelectionSettings]].
 
| 0x94 || 0x1 || u8 showSkipButton. This is copied from [[#UserSelectionSettings]].
Line 100: Line 100:
 
| 0x80 || 0x1 || u8 isSkipEnabled
 
| 0x80 || 0x1 || u8 isSkipEnabled
 
|-
 
|-
| 0x81 || 0x1 || u8 isNetworkServiceAccountRequired
+
| 0x81 || 0x1 || u8 isNetworkServiceAccountRequired. Whether the user needs to be linked to a Nintendo account.
 
|-
 
|-
| 0x82 || 0x1 || u8 showSkipButton
+
| 0x82 || 0x1 || u8 showSkipButton. Enables the option to skip user selection with a button.
 
|-
 
|-
 
| 0x83 || 0x1 || u8 additionalSelect
 
| 0x83 || 0x1 || u8 additionalSelect
Line 118: Line 118:
 
| 0x0 || 0x4 || [[#UserSelectionPurpose]]
 
| 0x0 || 0x4 || [[#UserSelectionPurpose]]
 
|-
 
|-
| 0x4 || 0x1 ||  
+
| 0x4 || 0x1 || Enables the user-creation button when set. Whether user-creation when pressing the button is actually allowed is controlled by [[#UiSettings]] isPermitted.
 
|-
 
|-
 
| 0x5 || 0x3 || u8 padding[3]
 
| 0x5 || 0x3 || u8 padding[3]
Line 130: Line 130:
 
! Offset || Size || Description
 
! Offset || Size || Description
 
|-
 
|-
| 0x0 || 0x8 || Result (0 = Success, 2 = Failure)
+
| 0x0 || 0x8 || Result
 
|-
 
|-
| 0x8 || 0x10 || UUID of selected user
+
| 0x8 || 0x10 || Uid of selected user.
 
|}
 
|}
  

Revision as of 05:57, 3 December 2019

This is the applet presented when launching a game that allows the user to select a user.

See AM_services#Library_Applets. The profile selector expects a two IStorage inputs and a single IStorage output.

Library Applet Versions

System Version Value
[1.0.0+] 0x1
[2.0.0+] 0x10000
[6.0.0+] 0x20000

UiSettings

This is "nn::account::UiSettings".

Offset Size Description
0x0 0x4 #UiMode
0x4 0x4 Padding.
0x8 0x80 u128 invalidUidList[8]. This is copied from #UserSelectionSettings.
0x88 0x8 ApplicationId with ShowUserSelectorForLauncher.
0x90 0x1 u8 isNetworkServiceAccountRequired. This is copied from #UserSelectionSettings.
0x91 0x1 u8 isSkipEnabled. This is copied from #UserSelectionSettings.
0x92 0x1 Set to 0x1 by ShowUserSelectorForSystem/ShowUserSelectorForLauncher.
0x93 0x1 u8 isPermitted. ShowUserSelector* sets this to the output bool from IsUserRegistrationRequestPermitted. With UserSelector this enables the option to create a new user. When not set, a dialog will be displayed when the user attempts to create an user.
0x94 0x1 u8 showSkipButton. This is copied from #UserSelectionSettings.
0x95 0x1 u8 additionalSelect. This is copied from #UserSelectionSettings.
0x96 0x1 [2.0.0+] This is copied from #UserSelectionSettingsForSystemService+0x4. ShowUserSelectorForLauncher/ShowUserSelector sets this to value 1.
0x97 0x1 [6.0.0+] Set to #UserSelectionSettings isUnqualifiedUserSelectable ^ 1.
0x98 0x4 [2.0.0+] This is copied from the 4-bytes at #UserSelectionSettingsForSystemService+0x0.
0x9C 0x4

This has size 0xA0 (0x98 with [1.0.0]) and seems to only affect the UI display. Typical value is all zero with byte 0x96 equal to 0x01. Setting the first byte to 1 will make the applet display in order to create a new user. "starter" sets the first byte to 5 in order to display initial user setup.

UiMode

This is "nn::account::UiMode".

Value Description
0 UserSelector
1 UserCreator
2 EnsureNetworkServiceAccountAvailable
3 UserIconEditor
4 UserNicknameEditor
5 UserCreatorForStarter
6 NintendoAccountAuthorizationRequestContext
7 IntroduceExternalNetworkServiceAccount
8 [6.0.0+] IntroduceExternalNetworkServiceAccountForRegistration
9 [6.0.0+] NintendoAccountNnidLinker
10 [6.0.0+] LicenseRequirementsForNetworkService
11 [7.0.0+] LicenseRequirementsForNetworkServiceWithUserContextImpl
12 [7.0.0+] UserCreatorForImmediateNaLoginTest

UserSelectionSettings

This is "nn::account::UserSelectionSettings ".

Offset Size Description
0x0 0x80 u128 invalidUidList[8]
0x80 0x1 u8 isSkipEnabled
0x81 0x1 u8 isNetworkServiceAccountRequired. Whether the user needs to be linked to a Nintendo account.
0x82 0x1 u8 showSkipButton. Enables the option to skip user selection with a button.
0x83 0x1 u8 additionalSelect
0x84 0x1 [6.0.0+] u8 isUnqualifiedUserSelectable

UserSelectionSettingsForSystemService

This is "nn::account::UserSelectionSettingsForSystemService". This was added as an additional input param with sdknso [2.0.0+].

Offset Size Description
0x0 0x4 #UserSelectionPurpose
0x4 0x1 Enables the user-creation button when set. Whether user-creation when pressing the button is actually allowed is controlled by #UiSettings isPermitted.
0x5 0x3 u8 padding[3]

UiReturnArg

This is "nn::account::UiReturnArg".

Offset Size Description
0x0 0x8 Result
0x8 0x10 Uid of selected user.

NintendoAccountStartupDialogType

This is "nn::account::NintendoAccountStartupDialogType".

Value Description
0 LoginAndCreate
1 Login
2 Create

UserSelectionPurpose

This is "nn::account::UserSelectionPurpose".

Value Description
0 General
1 GameCardRegistration
2 EShopLaunch
3 EShopItemShow
4 PicturePost
5 NintendoAccountLinkage
6 SettingsUpdate
7 SaveDataDeletion
8 UserMigration
9 SaveDataTransfer(?)

Usage

User-processes should push a common arguments struct and the typical UserSelectionConfig struct as well. After pushing in the data and calling start, user-processes should wait upon the PopOutDataEvent and then pop a single IStorage to obtain the result structure described above.