Changes

Jump to navigation Jump to search
9,311 bytes added ,  00:29, 18 May 2019
Line 83: Line 83:  
|-
 
|-
 
| LobbyApplet
 
| LobbyApplet
| Related to online-multiplayer lobbies
+
| "Nintendo Switch Online Lounge"
 
| Just displays an error-code.
 
| Just displays an error-code.
 
| Yes
 
| Yes
Line 139: Line 139:     
===ShareApplet===
 
===ShareApplet===
The initial page loaded by this applet depends on a flag. <nowiki>non-val1: "https://web-lp1.share.srv.nintendo.net/" val1: "https://web-lp1.share.srv.nintendo.net/settings/"</nowiki>
+
The initial page loaded by this applet is controlled by the [[#ShareStartPage]] TLV.
   −
The server will return a HTTP 302 redirect to <nowiki>"https://nintendo.com/"</nowiki> when the specified User-Agent isn't the one for ShareApplet.
+
The "web-lp1.share.srv.nintendo.net" site will return a HTTP 302 redirect to <nowiki>"https://nintendo.com/"</nowiki> when the specified User-Agent isn't the one for ShareApplet.
    
===LobbyApplet===
 
===LobbyApplet===
Support for Lobby was added with [2.0.0+].
+
Support for Lobby was added with [2.0.0+]. This applet is for "Nintendo Switch Online Lounge"
    
The initial page loaded by this applet is: <nowiki>"https://web-lp1.znc.srv.nintendo.net/lobby/"</nowiki>.
 
The initial page loaded by this applet is: <nowiki>"https://web-lp1.znc.srv.nintendo.net/lobby/"</nowiki>.
Line 205: Line 205:     
== Applet Launching ==
 
== Applet Launching ==
The web-applets are launched using a storage containing the input arg data, on exit the output storage contains the "*ReturnValue" reply data struct. The output struct is specific to each applet.
+
The web-applets are launched using a storage containing the input arg data, on exit the output storage contains the "*ReturnValue" reply data.
 +
 
 +
Input/output storage size for TLV data is 0x2000-bytes.
    
=== Library Applet Versions ===
 
=== Library Applet Versions ===
Line 217: Line 219:  
|-
 
|-
 
| [5.0.0+] || 0x50000
 
| [5.0.0+] || 0x50000
 +
|-
 +
| [6.0.0+] || 0x60000
 +
|-
 +
| [8.0.0+] || 0x80000
 
|}
 
|}
   Line 230: Line 236:  
!  Value
 
!  Value
 
!  Name
 
!  Name
 +
|-
 +
| 1
 +
| Shop
 
|-
 
|-
 
| 2
 
| 2
 
| Login
 
| Login
 +
|-
 +
| 3
 +
| Offline
 
|-
 
|-
 
| 4
 
| 4
Line 245: Line 257:  
| 7
 
| 7
 
| Lobby
 
| Lobby
 +
|}
 +
 +
=== WebSession ===
 +
With [5.0.0+] sdk-nso added <code>nn::web::Session::</code>. With [6.0.0+] this was removed, however it was reintroduced with [7.0.0+] as <code>nn::web::*WebSession</code> (for ShimKind Offline and Web).
 +
 +
This is for sending/receiving [[#SessionMessage]]s via applet Interactive storage.
 +
 +
During state init, max_messages is set to 0xA and max_size is set to 0x5000, with message_count=0 and cur_size=0.
 +
 +
When sending messages, there has to be an available message slot available (<code>max_messages!=message_count</code>), and there has to be enough space avilable (<code>msghdr_contentsize+0x10 + cur_size <= max_size</code>). After pushing the storage, message_count is incremented and cur_size is increased by <code>msghdr_contentsize+0x10</code>.
 +
 +
When receiving messages, it will repeatedly pop Interactive output storage until no more are available. If the ID is not 0x1000/0x0, the message is ignored. Otherwise:
 +
* Ack: Verifies that message_count is not already 0, then decrements it. Then cur_size is decreased by the u32 loaded from msgcontent+0.
 +
* 0x0: Does some validation. Copies the first 8-bytes from the header to the user [[#SessionMessage]]. Reads the message content into the user [[#SessionMessage]], when contentsize is non-zero. Then sends an Ack with the storage size.
 +
 +
==== SessionMessage ====
 +
{| class="wikitable" border="1"
 +
|-
 +
!  Offset
 +
!  Size
 +
!  Description
 +
|-
 +
| 0x0
 +
| 0x10
 +
| [[#SessionMessageHeader]]
 +
|-
 +
| 0x10
 +
| Size from header
 +
| Message content
 +
|}
 +
 +
==== SessionMessageHeader ====
 +
{| class="wikitable" border="1"
 +
|-
 +
!  Offset
 +
!  Size
 +
!  Description
 +
|-
 +
| 0x0
 +
| 0x4
 +
| Message ID
 +
|-
 +
| 0x4
 +
| 0x4
 +
| Content size following the header.
 +
|-
 +
| 0x8
 +
| 0x8
 +
| Unused
 +
|}
 +
 +
==== IDs ====
 +
{| class="wikitable" border="1"
 +
|-
 +
!  ID
 +
!  Content size
 +
!  Description
 +
|-
 +
| 0x0
 +
| Arbitrary
 +
| Arbitrary content.
 +
|-
 +
| 0x1000
 +
| 0x8
 +
| Ack. Content: first u32 is the entire storage size of the message being acked, while the second u32 is 0.
 
|}
 
|}
   Line 260: Line 337:  
| 0x104 || 0x400 || Initial URL navigated to by the applet.
 
| 0x104 || 0x400 || Initial URL navigated to by the applet.
 
|-
 
|-
| 0x504 || 0x10 || Account userID, 0 for common.
+
| 0x504 || 0x10 || NIFM Network UUID. Can be value zero. Only used by the applet when conntest_url is set.
 
|-
 
|-
| 0x514 || 0x4 || Unknown, this can be 0.
+
| 0x514 || 0x4 || Input value for nifm cmd SetRequirementByRevision. Can be value zero. Only used by the applet when conntest_url is set.
 
|}
 
|}
    
This is the input struct for WifiWebAuthApplet. This is a total of 0x518-bytes.
 
This is the input struct for WifiWebAuthApplet. This is a total of 0x518-bytes.
 +
 +
When the conntest_url is empty, the applet will test the connection with nifm and throw an error on failure.
    
=== WebWifiReturnValue ===
 
=== WebWifiReturnValue ===
Line 297: Line 376:  
|}
 
|}
   −
This is the 0x1010-byte output storage used by all non-WebWifi applets - except for Share which returns a TLV storage (on [3.0.0+] at least?).
+
This is the 0x1010-byte output storage used by all non-WebWifi applets - except for Share which returns a TLV storage on [3.0.0+], and Web on [8.0.0+].
    
=== WebArgHeader ===
 
=== WebArgHeader ===
Line 331: Line 410:  
Web TLV used in the input web Arg storage, after [[#WebArgHeader]]. This is a total of 0x8-bytes.
 
Web TLV used in the input web Arg storage, after [[#WebArgHeader]]. This is a total of 0x8-bytes.
    +
=== WebBootFooterButtonEntry ===
 +
{| class="wikitable" border="1"
 +
|-
 +
!  Offset
 +
!  Size
 +
!  Description
 +
|-
 +
| 0x0 || 0x4 || [[#FooterButtonId]]
 +
|-
 +
| 0x4 || 0x1 || u8 bool visible flag
 +
|-
 +
| 0x5 || 0x2 || ?
 +
|-
 +
| 0x7 || 0x1 || ?
 +
|}
    
=== TLVs ===
 
=== TLVs ===
Line 365: Line 459:  
| string
 
| string
 
| CallbackableUrl
 
| CallbackableUrl
 +
|-
 +
| [1.0.0+]
 +
| Offline
 +
| 0x5
 +
| 0x8
 +
| u64 titleID
 +
| ApplicationId, for DocumentKind_OfflineHtmlPage/DocumentKind_ApplicationLegalInformation. Should be zero for DocumentKind_OfflineHtmlPage since it's ignored.
 +
|-
 +
| [1.0.0+]
 +
| Offline
 +
| 0x6
 +
| 0xC00
 +
| string
 +
| DocumentPath
 +
|-
 +
| [1.0.0+]
 +
| Offline
 +
| 0x7
 +
| 0x4
 +
| u32 enum OfflineDocumentKind
 +
| [[#DocumentKind]]
 +
|-
 +
| [1.0.0+]
 +
| Offline
 +
| 0x8
 +
| 0x8
 +
| u64 titleID
 +
| SystemDataId, for DocumentKind_SystemDataPage.
 
|-
 
|-
 
|  
 
|  
Line 370: Line 492:  
| 0x9
 
| 0x9
 
| 0x4
 
| 0x4
| u32 enum ShareStartPage
+
| u32 enum [[#ShareStartPage]]
 
| ShareStartPage
 
| ShareStartPage
 
|-
 
|-
Line 378: Line 500:  
| 0x1000
 
| 0x1000
 
| string
 
| string
| Whitelist
+
| Whitelist. If not formatted properly, the applet will exit briefly after the applet is launched. Each line is a regex for each whitelisted URL.
 
|-
 
|-
 
| [1.0.0+]
 
| [1.0.0+]
Line 399: Line 521:  
| 0x20
 
| 0x20
 
| [[Capture_services|AlbumEntry]]
 
| [[Capture_services|AlbumEntry]]
| AlbumEntry
+
| AlbumEntry0
 
|-
 
|-
 
| [1.0.0+]
 
| [1.0.0+]
Line 406: Line 528:  
| 0x1
 
| 0x1
 
| u8 bool
 
| u8 bool
| ScreenShotEnabled
+
| ScreenShotEnabled. Controls whether screen-shot capture is allowed.
 
|-
 
|-
 
| [1.0.0+]
 
| [1.0.0+]
Line 447: Line 569:  
| 0x17
 
| 0x17
 
| 0x4
 
| 0x4
| u32 enum WebBootDisplayKind
+
| u32 enum [[#BootDisplayKind]]
 
| BootDisplayKind
 
| BootDisplayKind
 
|-
 
|-
Line 454: Line 576:  
| 0x18
 
| 0x18
 
| 0x4
 
| 0x4
| u32 enum *BackgroundKind
+
| u32 enum [[#BackgroundKind]]
 
| BackgroundKind
 
| BackgroundKind
 
|-
 
|-
Line 462: Line 584:  
| 0x1
 
| 0x1
 
| u8 bool
 
| u8 bool
| FooterEnabled
+
| FooterEnabled. Controls whether the UI footer is enabled.
 
|-
 
|-
 
| [1.0.0+]
 
| [1.0.0+]
Line 475: Line 597:  
| 0x1B
 
| 0x1B
 
| 0x4
 
| 0x4
| u32 enum *LeftStickMode
+
| u32 enum [[#LeftStickMode]]
 
| LeftStickMode
 
| LeftStickMode
 
|-
 
|-
Line 525: Line 647:  
| 0x1
 
| 0x1
 
| u8 bool
 
| u8 bool
| MediaPlayerUserGestureRestrictionEnabled
+
| [6.0.0+] MediaAutoPlayEnabled ([2.0.0-5.1.0] MediaPlayerUserGestureRestrictionEnabled)
 
|-
 
|-
 
| [2.0.0+]
 
| [2.0.0+]
Line 574: Line 696:  
| 0x10
 
| 0x10
 
| u8 array
 
| u8 array
| AdditionalMediaData (If the user-input size is less than 0x10, the remaining tmp data used for the TLV is cleared)
+
| AdditionalMediaData0 (If the user-input size is less than 0x10, the remaining tmp data used for the TLV is cleared)
 
|-
 
|-
 
| [4.0.0+]
 
| [4.0.0+]
Line 645: Line 767:  
| u8 bool
 
| u8 bool
 
| PageScrollIndicatorEnabled
 
| PageScrollIndicatorEnabled
 +
|-
 +
| [6.0.0+]
 +
|
 +
| 0x37
 +
| 0x1
 +
| u8 bool
 +
| MediaPlayerSpeedControlEnabled
 +
|-
 +
| [6.0.0+]
 +
| Share
 +
| 0x38
 +
| 0x20
 +
| [[Capture_services|AlbumEntry]]
 +
| AlbumEntry1
 +
|-
 +
| [6.0.0+]
 +
| Share
 +
| 0x39
 +
| 0x20
 +
| [[Capture_services|AlbumEntry]]
 +
| AlbumEntry2
 +
|-
 +
| [6.0.0+]
 +
| Share
 +
| 0x3A
 +
| 0x20
 +
| [[Capture_services|AlbumEntry]]
 +
| AlbumEntry3
 +
|-
 +
| [6.0.0+]
 +
| Share
 +
| 0x3B
 +
| 0x10
 +
| u8 array
 +
| AdditionalMediaData1
 +
|-
 +
| [6.0.0+]
 +
| Share
 +
| 0x3C
 +
| 0x10
 +
| u8 array
 +
| AdditionalMediaData2
 +
|-
 +
| [6.0.0+]
 +
| Share
 +
| 0x3D
 +
| 0x10
 +
| u8 array
 +
| AdditionalMediaData3
 +
|-
 +
| [6.0.0+]
 +
| BootFooterButton
 +
| 0x3E
 +
| 0x80
 +
| Array of [[#WebBootFooterButtonEntry]] with 0x10 entries.
 +
| BootFooterButton
 +
|-
 +
| [6.0.0+]
 +
|
 +
| 0x3F
 +
| 0x4
 +
| float
 +
| OverrideWebAudioVolume
 +
|-
 +
| [6.0.0+]
 +
|
 +
| 0x40
 +
| 0x4
 +
| float
 +
| OverrideMediaAudioVolume
 +
|-
 +
| [7.0.0+]
 +
|
 +
| 0x41
 +
| 0x4
 +
| u32 enum [[#WebSessionBootMode]]
 +
| BootMode
 +
|-
 +
| [7.0.0+]
 +
|
 +
| 0x42
 +
| 0x1
 +
| u8 bool
 +
| Enables using [[#WebSession]] when set.
 +
|-
 +
| [8.0.0+]
 +
| Offline
 +
| 0x43
 +
| 0x1
 +
| u8 bool
 +
| MediaPlayerUiEnabled
 
|}
 
|}
 +
 +
Offline: title to load the content from is controlled by ApplicationId/SystemDataId. With DocumentKind_OfflineHtmlPage, it will ignore this and only load from the user-process title.
 +
 +
Offline DocumentPath: Initial document path in RomFS, without the leading '/'. For DocumentKind_OfflineHtmlPage, this is relative to "html-document/" in RomFS. For the other DocumentKind values, this is relative to "/" in RomFS. This path must contain ".htdocs/".
 +
 +
Share/Lobby: if a non-zero userID isn't set, the applet will launch the profile-selector applet to select an account.
 +
 +
Share: An error will be displayed if neither AlbumEntry or ApplicationAlbumEntry are set, with [[#ShareStartPage|ShareStartPage_Default]].
 +
 +
[6.0.0+] <code>AddAlbumEntryAndMediaData</code> was added:
 +
* Looks for AlbumEntry{N} TLVs, when a TLV is not found it is written, then the associated AdditionalMediaData{N} TLV is written the same way as AdditionalMediaData0. If all AlbumEntry{N} TLVs already exist, this returns without writing anything.
    
==== Output TLVs ====
 
==== Output TLVs ====
Line 651: Line 875:  
|-
 
|-
 
!  System Version
 
!  System Version
 +
!  Applets
 
!  Type
 
!  Type
 
!  Size
 
!  Size
Line 656: Line 881:  
!  Description
 
!  Description
 
|-
 
|-
| [3.0.0+] ?
+
| [3.0.0+]
 +
| Share, Web
 
| 0x1
 
| 0x1
 
| 0x4
 
| 0x4
Line 662: Line 888:  
| ShareExitReason
 
| ShareExitReason
 
|-
 
|-
| [3.0.0+] ?
+
| [3.0.0+]
 +
| Share, Web
 
| 0x2
 
| 0x2
 
|  
 
|  
Line 668: Line 895:  
| LastUrl
 
| LastUrl
 
|-
 
|-
| [3.0.0+] ?
+
| [3.0.0+]
 +
| Share, Web
 
| 0x3
 
| 0x3
 
| 0x8
 
| 0x8
Line 674: Line 902:  
| LastUrlSize
 
| LastUrlSize
 
|-
 
|-
| [3.0.0+] ?
+
| [3.0.0+]
 +
| Share
 
| 0x4
 
| 0x4
 
| 0x4
 
| 0x4
Line 680: Line 909:  
| SharePostResult
 
| SharePostResult
 
|-
 
|-
| [3.0.0+] ?
+
| [3.0.0+]
 +
| Share
 
| 0x5
 
| 0x5
 
|  
 
|  
Line 686: Line 916:  
| PostServiceName
 
| PostServiceName
 
|-
 
|-
| [3.0.0+] ?
+
| [3.0.0+]
 +
| Share
 
| 0x6
 
| 0x6
 
| 0x8
 
| 0x8
Line 692: Line 923:  
| PostServiceNameSize
 
| PostServiceNameSize
 
|-
 
|-
| [3.0.0+] ?
+
| [3.0.0+]
 +
| Share
 
| 0x7
 
| 0x7
 
|  
 
|  
Line 698: Line 930:  
| PostId
 
| PostId
 
|-
 
|-
| [3.0.0+] ?
+
| [3.0.0+]
 +
| Share
 
| 0x8
 
| 0x8
 
| 0x8
 
| 0x8
 
| u64
 
| u64
 
| PostIdSize
 
| PostIdSize
 +
|-
 +
| [8.0.0+]
 +
| Web
 +
| 0x9
 +
| 0x1
 +
| u8 bool
 +
| MediaPlayerAutoClosedByCompletion
 +
|}
 +
 +
These are used for Share-applet on [3.0.0+], and with Web on [8.0.0+]. Official user-processes doesn't check the TLV size for any of these.
 +
 +
==== DocumentKind ====
 +
{| class="wikitable" border="1"
 +
|-
 +
!  Value
 +
!  Name
 +
!  Description
 +
|-
 +
| 0x1
 +
| DocumentKind_OfflineHtmlPage
 +
| Use the HtmlDocument NCA content from the application.
 +
|-
 +
| 0x2
 +
| DocumentKind_ApplicationLegalInformation
 +
| Use the LegalInformation NCA content from the application.
 +
|-
 +
| 0x3
 +
| DocumentKind_SystemDataPage
 +
| Use the Data NCA content from the specified title, see also: [[Title_list#System_Data_Archives]]
 +
|}
 +
 +
This controls the kind of content to mount with Offline-applet.
 +
 +
==== ShareStartPage ====
 +
{| class="wikitable" border="1"
 +
|-
 +
!  Value
 +
!  Name
 +
!  URL
 +
|-
 +
| 0
 +
| ShareStartPage_Default
 +
| [[Network|"https://web-%.share.srv.nintendo.net/"]]
 +
|-
 +
| 1
 +
| ShareStartPage_Settings
 +
| [[Network|"https://web-%.share.srv.nintendo.net/settings/"]]
 
|}
 
|}
   −
These are used for Share-applet.
+
This enum controls the initial page for ShareApplet.
 +
 
 +
==== BootDisplayKind ====
 +
{| class="wikitable" border="1"
 +
|-
 +
!  Value
 +
!  Name
 +
!  Description
 +
|-
 +
| 0
 +
| BootDisplayKind_White
 +
| Default white background.
 +
|-
 +
| 1
 +
|
 +
| Unknown. Used by Offline default Arg initialization for DocumentKind_ApplicationLegalInformation/DocumentKind_SystemDataPage.
 +
|-
 +
| 2
 +
| BootDisplayKind_Black
 +
| Black background.
 +
|-
 +
| 3
 +
|
 +
| Unknown. Used by Share default Arg initialization.
 +
|-
 +
| 4
 +
|
 +
| Unknown. Used by Lobby default default Arg initialization.
 +
|}
 +
 
 +
Kind values for BootDisplayKind. Controls the background color while displaying the loading screen during applet boot. Also controls the BackgroundKind when value is non-zero.
 +
 
 +
The applet converts this to internal values.
 +
* BootDisplayKind 0:
 +
** If launched by an Application:
 +
*** If [[#BackgroundKind]] is 2..1, return 3..2. When 0, run the below, otherwise assert.
 +
** return TLV value from BootAsMediaPlayer
 +
* BootDisplayKind 1..4: return 0..3.
 +
 
 +
==== BackgroundKind ====
 +
{| class="wikitable" border="1"
 +
|-
 +
!  Value
 +
!  Name
 +
!  Description
 +
|-
 +
| 0
 +
|
 +
| Unknown. Used by Offline default Arg initialization for DocumentKind_ApplicationLegalInformation/DocumentKind_SystemDataPage.
 +
|-
 +
| 1
 +
|
 +
| Same as [[#BootDisplayKind]] value 3.
 +
|-
 +
| 2
 +
|
 +
| Same as [[#BootDisplayKind]] value 4. Used by Lobby default Arg initialization.
 +
|}
 +
 
 +
Kind values for BackgroundKind. Only used when [[#BootDisplayKind]] is 0.
 +
 
 +
==== LeftStickMode ====
 +
{| class="wikitable" border="1"
 +
|-
 +
!  Value
 +
!  Name
 +
!  Description
 +
|-
 +
| 0
 +
| LeftStickMode_Pointer
 +
| The user can directly control the pointer via the left-stick.
 +
|-
 +
| 1
 +
| LeftStickMode_Cursor
 +
| The user can only select elements on the page via the left-stick.
 +
|}
 +
 
 +
Controls the initial mode, this can be toggled by the user via the pressing the left-stick button. If the Pointer flag is set to false, only LeftStickMode_Cursor will be used and mode toggle by the user is disabled (input value ignored).
 +
 
 +
==== FooterButtonId ====
 +
{| class="wikitable" border="1"
 +
|-
 +
!  Value
 +
!  Name
 +
!  Description
 +
|-
 +
| 0
 +
| None
 +
| None, for empty [[#WebBootFooterButtonEntry]]. Invalid for use as an input Id.
 +
|-
 +
| 1
 +
|
 +
|
 +
|-
 +
| 2
 +
|
 +
|
 +
|-
 +
| 3
 +
|
 +
|
 +
|-
 +
| 4
 +
|
 +
|
 +
|-
 +
| 5
 +
|
 +
|
 +
|-
 +
| 6
 +
|
 +
|
 +
|-
 +
| 7
 +
|
 +
| Values starting with this are invalid.
 +
|-
 +
|}
 +
 
 +
==== WebSessionBootMode ====
 +
{| class="wikitable" border="1"
 +
|-
 +
!  Value
 +
!  Name
 +
!  Description
 +
|-
 +
| 0
 +
|
 +
| Normal (AllForeground)
 +
|-
 +
| 1
 +
|
 +
| AllForegroundInitiallyHidden
 +
|}
 +
 
 +
This controls which [[Applet_Manager_services|LibraryAppletMode]] the applet will be launched with, by the user-process. The TLV for this seems to be ignored by the applet.
 +
 
 +
==== LastUrl ====
 +
When the applet loads a page where the beginning of the URL matches the URL from CallbackUrl, the applet will exit and set LastUrl to that URL (exit doesn't occur when CallbackableUrl is set). With Offline-applet for CallbackUrl handling, it compares the domain with "localhost" instead of using the CallbackUrl TLV.
    
== Versions ==
 
== Versions ==

Navigation menu