Difference between revisions of "BCAT services"

From Nintendo Switch Brew
Jump to navigation Jump to search
m
 
(36 intermediate revisions by 5 users not shown)
Line 2: Line 2:
  
 
= bcat:a, bcat:m, bcat:u, bcat:s =
 
= bcat:a, bcat:m, bcat:u, bcat:s =
These are "nn::bcat::detail::ipc::IServiceCreator".
+
These are "nn::bcat::ipc::IServiceCreator".
  
 
These were added with [2.0.0+].
 
These were added with [2.0.0+].
Line 8: Line 8:
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
! Cmd || Name || Notes
+
! Cmd || Name
 
|-
 
|-
| 0 || CreateBcatService || Takes an input u64 ProcessId, returns an [[#IBcatService]]
+
| 0 || [[#CreateBcatService]]
 
|-
 
|-
| 1 || CreateDeliveryCacheStorageService || Takes an input u64 ProcessId, returns an [[#IDeliveryCacheStorageService]]
+
| 1 || [[#CreateDeliveryCacheStorageService]]
 
|-
 
|-
| 2 || CreateDeliveryCacheStorageServiceWithApplicationId || Takes an input u64 TitleId, returns an [[#IDeliveryCacheStorageService]]
+
| 2 || [[#CreateDeliveryCacheStorageServiceWithApplicationId]]
 
|-
 
|-
| [2.0.0-2.3.0] 3 || CreateDeliveryCacheProgressService || Takes an input u64 ProcessId, returns an [[#IDeliveryCacheProgressService]]
+
| 3 || [2.0.0-2.3.0] [[#CreateDeliveryCacheProgressService]]
 
|-
 
|-
| [2.0.0-2.3.0] 4 || CreateDeliveryCacheProgressServiceWithApplicationId || Takes an input u64 TitleId, returns an [[#IDeliveryCacheProgressService]]
+
| 4 || [2.0.0-2.3.0] [[#CreateDeliveryCacheProgressServiceWithApplicationId]]
 
|}
 
|}
  
 
Equivalent to 3DS BOSS(SpotPass). See [[BCAT_Content_Container|here]] for BCAT-content-container.
 
Equivalent to 3DS BOSS(SpotPass). See [[BCAT_Content_Container|here]] for BCAT-content-container.
 +
 +
== CreateBcatService ==
 +
Takes an input u64 ProcessId. Returns an [[#IBcatService]].
 +
 +
== CreateDeliveryCacheStorageService ==
 +
Takes an input u64 ProcessId. Returns an [[#IDeliveryCacheStorageService]].
 +
 +
== CreateDeliveryCacheStorageServiceWithApplicationId  ==
 +
Takes an input u64 <code>nn::ApplicationId</code>. Returns an [[#IDeliveryCacheStorageService]].
 +
 +
== CreateDeliveryCacheProgressService  ==
 +
Takes an input u64 ProcessId. Returns an [[#IDeliveryCacheProgressService]].
 +
 +
== CreateDeliveryCacheProgressServiceWithApplicationId  ==
 +
Takes an input u64 <code>nn::ApplicationId</code>. returns an [[#IDeliveryCacheProgressService]].
  
 
== IBcatService ==
 
== IBcatService ==
This is "nn::bcat::detail::ipc::IBcatService".
+
This is "nn::bcat::ipc::IBcatService".
  
 
This was added with [2.0.0+].
 
This was added with [2.0.0+].
Line 46: Line 61:
 
| 20301 || [8.0.0+] [[#RequestSuspendDeliveryTask]]
 
| 20301 || [8.0.0+] [[#RequestSuspendDeliveryTask]]
 
|-
 
|-
| 30100 || SetPassphrase
+
| 20400 || [9.0.0+] [[#RegisterSystemApplicationDeliveryTask]]
 +
|-
 +
| 20401 || [9.0.0+] [[#UnregisterSystemApplicationDeliveryTask]]
 +
|-
 +
| 20410 || [9.1.0+] SetSystemApplicationDeliveryTaskTimer
 +
|-
 +
| 30100 || [[#SetPassphrase]]
 
|-
 
|-
| [2.0.0-2.3.0] 30101 ||
+
| 30101 || [2.0.0-2.3.0]  
 
|-
 
|-
| [2.0.0-2.3.0] 30102 ||
+
| 30102 || [2.0.0-2.3.0]  
 
|-
 
|-
 
| 30200 || [3.0.0+] RegisterDeliveryTask
 
| 30200 || [3.0.0+] RegisterDeliveryTask
Line 59: Line 80:
 
|-
 
|-
 
| 30203 || [3.0.0+] UnblockDeliveryTask
 
| 30203 || [3.0.0+] UnblockDeliveryTask
 +
|-
 +
| 30210 || [9.1.0+] SetDeliveryTaskTimer
 
|-
 
|-
 
| 30300 || [8.0.0+] RegisterSystemApplicationDeliveryTasks
 
| 30300 || [8.0.0+] RegisterSystemApplicationDeliveryTasks
 
|-
 
|-
 
| 90100 || GetDeliveryTaskList
 
| 90100 || GetDeliveryTaskList
 +
|-
 +
| 90101 || [11.0.0+] GetDeliveryTaskListForSystem
 
|-
 
|-
 
| 90200 || [[#GetDeliveryList]]
 
| 90200 || [[#GetDeliveryList]]
Line 71: Line 96:
 
|-
 
|-
 
| 90300 || [3.0.0+] GetPushNotificationLog
 
| 90300 || [3.0.0+] GetPushNotificationLog
 +
|-
 +
| 90301 || [11.0.0+] GetDeliveryCacheStorageUsage
 
|}
 
|}
  
Line 79: Line 106:
  
 
=== RequestSyncDeliveryCacheWithApplicationId ===
 
=== RequestSyncDeliveryCacheWithApplicationId ===
Takes a total of 8-bytes of input, no output.
+
Takes an input u64 <code>nn::ApplicationId</code>. No output.
  
 
[3.0.0+] Now takes an additional 8-bytes of input, and returns an [[#IDeliveryCacheProgressService]].
 
[3.0.0+] Now takes an additional 8-bytes of input, and returns an [[#IDeliveryCacheProgressService]].
  
 
=== GetDeliveryCacheStorageUpdateNotifier ===
 
=== GetDeliveryCacheStorageUpdateNotifier ===
Takes a total of 8-bytes of input, returns an [[#INotifierService]].
+
Takes an input u64 <code>nn::ApplicationId</code>. Returns an [[#INotifierService]].
  
 
=== RequestSuspendDeliveryTask ===
 
=== RequestSuspendDeliveryTask ===
Takes a total of 8-bytes of input, returns an [[#IDeliveryTaskSuspensionService]].
+
Takes an input u64 <code>nn::ApplicationId</code>. Returns an [[#IDeliveryTaskSuspensionService]].
 +
 
 +
=== RegisterSystemApplicationDeliveryTask ===
 +
Takes an input u64 <code>nn::ApplicationId</code>. No output.
 +
 
 +
=== UnregisterSystemApplicationDeliveryTask ===
 +
Takes an input u64 <code>nn::ApplicationId</code>. No output.
 +
 
 +
=== SetPassphrase ===
 +
Takes an input u64 <code>nn::ApplicationId</code> and a type-0x9 input buffer. No output.
  
 
=== GetDeliveryList ===
 
=== GetDeliveryList ===
Takes a type-0x6 output buffer, returns a total of 4-bytes of output.
+
Takes a type-0x6 output buffer. Returns a total of 4-bytes of output.
  
 
[3.0.0+] Now takes a total of 8-bytes of input, and returns an additional 4-bytes of output.
 
[3.0.0+] Now takes a total of 8-bytes of input, and returns an additional 4-bytes of output.
  
 
=== IDeliveryCacheProgressService ===
 
=== IDeliveryCacheProgressService ===
This is "nn::bcat::detail::ipc::IDeliveryCacheProgressService".
+
This is "nn::bcat::ipc::IDeliveryCacheProgressService".
  
 
This was added with [2.0.0+].
 
This was added with [2.0.0+].
Line 109: Line 145:
  
 
== IDeliveryCacheStorageService ==
 
== IDeliveryCacheStorageService ==
This is "nn::bcat::detail::ipc::IDeliveryCacheStorageService".
+
This is "nn::bcat::ipc::IDeliveryCacheStorageService".
  
 
This was added with [2.0.0+].
 
This was added with [2.0.0+].
Line 125: Line 161:
  
 
=== IDeliveryCacheFileService ===
 
=== IDeliveryCacheFileService ===
This is "nn::bcat::detail::ipc::IDeliveryCacheFileService".
+
This is "nn::bcat::ipc::IDeliveryCacheFileService".
  
 
This was added with [2.0.0+].
 
This was added with [2.0.0+].
Line 143: Line 179:
  
 
=== IDeliveryCacheDirectoryService ===
 
=== IDeliveryCacheDirectoryService ===
This is "nn::bcat::detail::ipc::IDeliveryCacheDirectoryService".
+
This is "nn::bcat::ipc::IDeliveryCacheDirectoryService".
  
 
This was added with [2.0.0+].
 
This was added with [2.0.0+].
Line 159: Line 195:
  
 
=== INotifierService ===
 
=== INotifierService ===
This is "nn::bcat::detail::ipc::INotifierService".
+
This is "nn::bcat::ipc::INotifierService".
  
 
Added with [8.0.0+].
 
Added with [8.0.0+].
Line 171: Line 207:
  
 
=== IDeliveryTaskSuspensionService ===
 
=== IDeliveryTaskSuspensionService ===
This is "nn::bcat::detail::ipc::IDeliveryTaskSuspensionService".
+
This is "nn::bcat::ipc::IDeliveryTaskSuspensionService".
  
 
Added with [8.0.0+].
 
Added with [8.0.0+].
Line 177: Line 213:
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
! Cmd || Name || Notes
+
! Cmd || Name
 
|-
 
|-
| 0 || GetEvent ||
+
| 0 || GetEvent
 
|}
 
|}
  
Line 187: Line 223:
 
On [1.0.0] these are <nowiki>"nn::news::detail::ipc::INewsService"</nowiki>, see [[#INewsService]].
 
On [1.0.0] these are <nowiki>"nn::news::detail::ipc::INewsService"</nowiki>, see [[#INewsService]].
  
 +
News entries are fetched from CDN[https://switchbrew.org/wiki/Network#Others].
 +
Metadata for each entry is stored and queried from an internal SQLite database.
 +
Official software uses sqlite[https://www.sqlite.org/download.html] for processing.
 +
 +
All sessions have 32 sessions.
 +
Permission masks are:
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
! Cmd || Name || Notes
+
! Name || Mask
 +
|-
 +
| <nowiki>news:a</nowiki> || 0xffffffff
 +
|-
 +
| <nowiki>news:p</nowiki> || 0x1
 +
|-
 +
| <nowiki>news:c</nowiki> || 0x2
 +
|-
 +
| <nowiki>news:v</nowiki> || 0x4
 +
|-
 +
| <nowiki>news:m</nowiki> || 0xd
 +
|}
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Cmd || Name
 
|-
 
|-
| 0 || || No input, returns an [[#INewsService]].
+
| 0 || [[#CreateNewsService|CreateNewsService]]
 
|-
 
|-
| 1 || || No input, returns an [[#INewlyArrivedEventHolder]].
+
| 1 || [[#CreateNewlyArrivedEventHolder|CreateNewlyArrivedEventHolder]]
 
|-
 
|-
| 2 || || No input, returns an [[#INewsDataService]].
+
| 2 || [[#CreateNewsDataService|CreateNewsDataService]]
 
|-
 
|-
| 3 || || No input, returns an [[#INewsDatabaseService]].
+
| 3 || [[#CreateNewsDatabaseService|CreateNewsDatabaseService]]
 
|-
 
|-
| 4 || || No input, returns an [[#IOverwriteEventHolder]].
+
| 4 || [[#CreateOverwriteEventHolder|CreateOverwriteEventHolder]]
 
|}
 
|}
 +
 +
== CreateNewsService ==
 +
No input. Returns an [[#INewsService]].
 +
 +
== CreateNewlyArrivedEventHolder ==
 +
No input. Returns an [[#INewlyArrivedEventHolder]].
 +
 +
== CreateNewsDataService ==
 +
No input. Returns an [[#INewsDataService]].
 +
 +
Requires permission bit 2.
 +
 +
== CreateNewsDatabaseService ==
 +
No input. Returns an [[#INewsDatabaseService]].
 +
 +
Requires permission bit 2.
 +
 +
== CreateOverwriteEventHolder ==
 +
No input. Returns an [[#IOverwriteEventHolder]].
  
 
== INewsService ==
 
== INewsService ==
Line 207: Line 283:
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
! Cmd || Name
+
! Cmd || Name || Required Permission Bits
 +
|-
 +
| 10100 || [[#PostLocalNews]] || 0
 
|-
 
|-
| 10100 ||  
+
| 20100 || SetPassphrase || 1
 
|-
 
|-
| 20100 ||  
+
| 30100 || GetSubscriptionStatus || 1 or 2
 
|-
 
|-
| 30100 ||  
+
| 30101 || [3.0.0+] GetTopicList || 2
 
|-
 
|-
| 30101 || [3.0.0+]
+
| 30110 || [6.0.0+] || 2
 
|-
 
|-
| 30110 || [6.0.0+]
+
| 30200 || [[#IsSystemUpdateRequired]] || 2
 
|-
 
|-
| 30200 ||  
+
| 30201 || [8.0.0+] || 2
 
|-
 
|-
| 30201 || [8.0.0+]
+
| 30210 || [10.0.0+] || 2
 
|-
 
|-
| 30300 ||  
+
| 30300 || RequestImmediateReception || 2
 
|-
 
|-
| 30400 || [3.0.0+]
+
| 30400 || [3.0.0-18.1.0] DecodeArchiveFile || 2
 
|-
 
|-
| 30500 || [8.0.0+] ? (Takes a total of 8-bytes of input, a handle, and a type-0x9 input buffer, returns an [[#IUnknown2]])
+
| 30500 || [8.0.0+] ? || 2
 
|-
 
|-
| [1.0.0] 30900 || (No input, returns an [[#INewlyArrivedEventHolder]])
+
| 30900 || [1.0.0] (No input, returns an [[#INewlyArrivedEventHolder]]) || 2
 
|-
 
|-
| [1.0.0] 30901 || (No input, returns an [[#INewsDataService]])
+
| 30901 || [1.0.0] (No input, returns an [[#INewsDataService]]) || 2
 
|-
 
|-
| [1.0.0] 30902 || (No input, returns an [[#INewsDatabaseService]])
+
| 30902 || [1.0.0] (No input, returns an [[#INewsDatabaseService]]) || 2
 
|-
 
|-
| 40100 ||  
+
| 40100 || SetSubscriptionStatus || 1 or 3
 
|-
 
|-
| 40101 || [3.0.0+]
+
| 40101 || [3.0.0+] RequestAutoSubscription || 3
 
|-
 
|-
| 40200 ||  
+
| 40200 || ClearStorage || 3
 
|-
 
|-
| 40201 ||  
+
| 40201 || ClearSubscriptionStatusAll || 1 or 3
 
|-
 
|-
| 90100 ||  
+
| 90100 || [[#GetNewsDatabaseDump]] || 4
 
|}
 
|}
 +
 +
=== PostLocalNews ===
 +
Takes an input buffer msgpack.
 +
 +
=== 30110 ===
 +
Returns two u64s. Current usage and total size of the news-mounted savedata 0x8000000000000090.
 +
 +
=== IsSystemUpdateRequired ===
 +
Matches the version in news-sys:/sup.version against the result from system setting news!system_version.
 +
 +
=== 30210 ===
 +
Returns the Database version retrieved from system setting news!db_version
 +
 +
=== 30500 ===
 +
Takes a type-0x9 input buffer URL, the size of the transfer memory and a handle for the latter, returns an [[#IDownloadContext]].
 +
Downloaded files need to be encrypted [https://switchbrew.org/wiki/BCAT_Content_Container BCAT Content Container] (Crypto type 1-3).
 +
Files will be decrypted before being stored in the transfer memory.
 +
 +
=== GetNewsDatabaseDump ===
 +
Dumps internal SQLite file.
  
 
== INewlyArrivedEventHolder ==
 
== INewlyArrivedEventHolder ==
 
This is <nowiki>"nn::news::detail::ipc::INewlyArrivedEventHolder"</nowiki>.
 
This is <nowiki>"nn::news::detail::ipc::INewlyArrivedEventHolder"</nowiki>.
 +
 +
[19.0.0+] This is now <nowiki>"nn::news::detail::ipc::INewArrivalEventHolder"</nowiki>.
  
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
Line 253: Line 353:
 
! Cmd || Name
 
! Cmd || Name
 
|-
 
|-
| 0 ||  
+
| 0 || [[#Get]]
 
|}
 
|}
 +
 +
=== Get ===
 +
Returns readable event.
 +
Event is signaled on PostLocalNews or on fetch from CDN if the file doesn't exist.
  
 
== INewsDataService ==
 
== INewsDataService ==
Line 263: Line 367:
 
! Cmd || Name
 
! Cmd || Name
 
|-
 
|-
| 0 ||  
+
| 0 || [[#Open]]
 +
|-
 +
| 1 || [[#OpenWithNewsRecordV1]]
 
|-
 
|-
| 1 ||  
+
| 2 || [[#Read]]
 
|-
 
|-
| 2 ||  
+
| 3 || [[#GetSize]]
 
|-
 
|-
| 3 ||  
+
| 1001 || [6.0.0+] [[#OpenWithNewsRecord]]
 
|-
 
|-
| 1001 || [6.0.0+]
+
| 1100 || [19.0.0+]
 
|}
 
|}
 +
 +
=== Open ===
 +
Takes an input string. Opens file with the output of snprintf from <nowiki>"news:/data/%s"</nowiki> with input.
 +
 +
=== OpenWithNewsRecordV1 ===
 +
Takes an input [[#NewsRecordV1]]. Opens file with the output of snprintf of <nowiki>"news:/data/D00000000000000000000_%s.msgpack"</nowiki> with news_id if user_id is empty or else of <nowiki>"news:/data/U%s_%s.msgpack"</nowiki> with user_id and news_id of input.
 +
 +
=== Read ===
 +
Read from file opened with [[#Open]], [[#OpenWithNewsRecordV1]] or [[#OpenWithNewsRecord]].
 +
 +
=== GetSize ===
 +
Get size of file opened with [[#Open]], [[#OpenWithNewsRecordV1]] or [[#OpenWithNewsRecord]].
 +
 +
=== OpenWithNewsRecord===
 +
Takes an input [[#NewsRecord]]. Same behavior as [[#OpenWithNewsRecordV1]].
  
 
== INewsDatabaseService ==
 
== INewsDatabaseService ==
 
This is <nowiki>"nn::news::detail::ipc::INewsDatabaseService"</nowiki>.
 
This is <nowiki>"nn::news::detail::ipc::INewsDatabaseService"</nowiki>.
 +
 +
[19.0.0+] This is now <nowiki>"nn::news::detail::ipc::IDeviceNewsDatabaseService"</nowiki>.
  
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
Line 281: Line 404:
 
! Cmd || Name
 
! Cmd || Name
 
|-
 
|-
| 0 ||  
+
| 0 || GetListV1
 
|-
 
|-
| 1 ||  
+
| 1 || Count
 
|-
 
|-
| 2 ||  
+
| 2 || CountWithKey
 
|-
 
|-
| 3 ||  
+
| 3 || UpdateIntegerValue
 
|-
 
|-
| 4 ||  
+
| 4 || UpdateIntegerValueWithAddition
 
|-
 
|-
| 5 ||  
+
| 5 || UpdateStringValue
 
|-
 
|-
| 1000 || [6.0.0+]
+
| 1000 || [6.0.0+] GetList
 
|}
 
|}
  
Line 303: Line 426:
 
! Cmd || Name
 
! Cmd || Name
 
|-
 
|-
| 0 ||  
+
| 0 || [[#Get]]
 
|}
 
|}
  
== IUnknown2 ==
+
=== Get ===
 +
Returns readable event.
 +
Event is signaled on fetch from CDN if the file already exists.
 +
 
 +
== IDownloadContext ==
 +
This is <nowiki>"nn::news::detail::ipc::IDownloadContext"</nowiki>.
 +
 
 
This was added with [8.0.0+].
 
This was added with [8.0.0+].
 +
 +
On creation this object is enqueued and an event is signaled prompting a download from another thread (nn.news.Downloader).
  
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
Line 313: Line 444:
 
! Cmd || Name
 
! Cmd || Name
 
|-
 
|-
| 0 ||  
+
| 0 || [[#Get]]
 +
|-
 +
| 1 || [[#Cancel]]
 +
|-
 +
| 2 || [[#GetResult]]
 +
|-
 +
| 3 || [[#GetSize]]
 +
|}
 +
 
 +
=== Get ===
 +
Unofficial name.
 +
 
 +
Return event handle. Signaled on download finish.
 +
 
 +
=== Cancel ===
 +
Unofficial name.
 +
 
 +
Cancels Download.
 +
 
 +
=== GetResult ===
 +
Unofficial name.
 +
 
 +
Returns last result.
 +
 
 +
=== GetSize ===
 +
Unofficial name.
 +
 
 +
Returns final decoded size. 0 if the result of [[#GetResult]] is not 0 or Download isn't finished/was canceled.
 +
 
 +
== NewsDatabase ==
 +
Internal SQLite database. Has a second version since 6.0.0.
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Name
 +
! Type
 +
! Exists
 +
|-
 +
| news_id || TEXT || All
 +
|-
 +
| user_id || TEXT || All
 +
|-
 +
| topic_id || TEXT || All
 +
|-
 +
| application_ids || TEXT || All
 +
|-
 +
| received_at || INTEGER || All
 +
|-
 +
| published_at || INTEGER || All
 +
|-
 +
| expire_at || INTEGER || All
 +
|-
 +
| pickup_limit || INTEGER || All
 +
|-
 +
| essential_pickup_limit || INTEGER || Only V2
 +
|-
 +
| priority || INTEGER || All
 +
|-
 +
| deletion_priority || INTEGER || All
 +
|-
 +
| age_limit || INTEGER || All
 +
|-
 +
| surprise || INTEGER || All
 +
|-
 +
| bashotorya || INTEGER || Only V1
 +
|-
 +
| decoration_type || INTEGER || Only V2
 +
|-
 +
| point || INTEGER || All
 +
|-
 +
| read || INTEGER || All
 +
|-
 +
| newly || INTEGER || All
 +
|-
 +
| displayed || INTEGER || All
 +
|-
 +
| opted_in || INTEGER || All
 +
|-
 +
| point_status || INTEGER || All
 +
|-
 +
| feedback || INTEGER || Only V2
 +
|-
 +
| extra_1 || INTEGER || All
 +
|-
 +
| extra_2 || INTEGER || All
 +
|-
 +
|}
 +
 
 +
== NewsRecordV1 ==
 +
{| class="wikitable" border="1"
 +
|-
 +
! Offset
 +
! Size
 +
! SQLite association
 +
|-
 +
| 0x0 || 0x18 || TEXT news_id
 +
|-
 +
| 0x18 || 0x18 || TEXT user_id
 +
|-
 +
| 0x30 || 0x8 || INTEGER received_id
 +
|-
 +
| 0x38 || 0x4 || INTEGER news
 +
|-
 +
| 0x3c || 0x4 || INTEGER newly
 +
|-
 +
| 0x40 || 0x4 || INTEGER displayed
 +
|-
 +
| 0x44 || 0x4 || none
 +
|-
 +
|}
 +
 
 +
== NewsRecord ==
 +
{| class="wikitable" border="1"
 +
|-
 +
! Offset
 +
! Size
 +
! SQLite association
 +
|-
 +
| 0x0 || 0x18 || TEXT news_id
 +
|-
 +
| 0x18 || 0x18 || TEXT user_id
 +
|-
 +
| 0x30 || 0x20 || TEXT topic_id
 +
|-
 +
| 0x50 || 0x8 || INTEGER received_id
 +
|-
 +
| 0x58 || 0x8 || none
 +
|-
 +
| 0x60 || 0x4 || INTEGER decoration_type
 +
|-
 +
| 0x64 || 0x4 || INTEGER read
 +
|-
 +
| 0x68 || 0x4 || INTEGER newly
 +
|-
 +
| 0x6c || 0x4 || INTEGER displayed
 +
|-
 +
| 0x70 || 0x4 || INTEGER feedback
 +
|-
 +
| 0x74 || 0x4 || none
 
|-
 
|-
| 1 ||  
+
| 0x78 || 0x4 || INTEGER extra_1
 
|-
 
|-
| 2 ||  
+
| 0x7c || 0x4 || INTEGER extra_2
 
|-
 
|-
| 3 ||
 
 
|}
 
|}
  
Line 333: Line 601:
 
| 10101 || SaveReportWithUserOld ([1.0.0-5.1.0] SaveReportWithUser)
 
| 10101 || SaveReportWithUserOld ([1.0.0-5.1.0] SaveReportWithUser)
 
|-
 
|-
| 10102 || [6.0.0+] SaveReport
+
| 10102 || [6.0.0+] SaveReportOld2 ([1.0.0-9.2.0] SaveReport)
 
|-
 
|-
| 10103 || [6.0.0+] SaveReportWithUser
+
| 10103 || [6.0.0+] SaveReportWithUserOld2 ([1.0.0-9.2.0] SaveReportWithUser)
 +
|-
 +
| 10104 || [10.0.0+] SaveReport
 +
|-
 +
| 10105 || [10.0.0+] SaveReportWithUser
 
|-
 
|-
 
| 10200 || RequestImmediateTransmission
 
| 10200 || RequestImmediateTransmission
 
|-
 
|-
 
| 10300 || GetTransmissionStatus
 
| 10300 || GetTransmissionStatus
 +
|-
 +
| 10400 || [9.0.0+] GetSystemSessionId
 +
|-
 +
| 10500 || [15.0.0+] SendReportWithUser
 
|-
 
|-
 
| 20100 || SaveSystemReport
 
| 20100 || SaveSystemReport
Line 358: Line 634:
 
|-
 
|-
 
| 30500 || [6.0.0+] GetLastUploadError
 
| 30500 || [6.0.0+] GetLastUploadError
 +
|-
 +
| 30600 || [10.0.0+] GetApplicationUploadSummary
 
|-
 
|-
 
| 40100 || [2.0.0+] IsUserAgreementCheckEnabled
 
| 40100 || [2.0.0+] IsUserAgreementCheckEnabled
 
|-
 
|-
 
| 40101 || [2.0.0+] SetUserAgreementCheckEnabled
 
| 40101 || [2.0.0+] SetUserAgreementCheckEnabled
 +
|-
 +
| 50100 || [10.0.0+] ReadAllApplicationReportFiles
 
|-
 
|-
 
| 90100 || [6.0.0+] ReadAllReportFiles ([1.0.0-5.1.0] GetStorageUsage)
 
| 90100 || [6.0.0+] ReadAllReportFiles ([1.0.0-5.1.0] GetStorageUsage)
 
|-
 
|-
| [1.0.0] 90101 ||  
+
| 90101 || [1.0.0]
 +
|-
 +
| 90102 || [1.0.0]
 +
|-
 +
| 90200 || [5.0.0-5.1.0] GetStatistics
 +
|-
 +
| 90201 || [5.0.0-5.1.0] GetThroughputHistory
 
|-
 
|-
| [1.0.0] 90102 ||  
+
| 90300 || [5.0.0-5.1.0] GetLastUploadError
 +
|}
 +
 
 +
= mnpp:app =
 +
This is "nn::mnpp::detail::ipc::IServiceForApplication".
 +
 
 +
This was added with [13.0.0+].
 +
 
 +
{| class="wikitable" border="1"
 
|-
 
|-
| [5.0.0-5.1.0] 90200 || GetStatistics
+
! Cmd || Name
 
|-
 
|-
| [5.0.0-5.1.0] 90201 || GetThroughputHistory
+
| 0 || [[#Initialize]]
 
|-
 
|-
| [5.0.0-5.1.0] 90300 || GetLastUploadError
+
| 1 || [[#SubmitEvent]]
 
|}
 
|}
  
== Data reporting ==
+
== Initialize ==
 +
Unofficial name.
 +
 
 +
Takes a PID-descriptor and a reserved input u64. No output.
 +
 
 +
Uses [[Glue_services#arp:r|arp:r]] commands [[Glue_services#GetApplicationInstanceId|GetApplicationInstanceId]] and [[Glue_services#GetApplicationLaunchProperty|GetApplicationLaunchProperty]] to get and store the application's [[NCM_services#ProgramId|ProgramId]].
 +
 
 +
== SubmitEvent ==
 +
Unofficial name.
 +
 
 +
Takes an input [[Account_services#Uid|Uid]] and a type-0x5 input buffer. No output.
 +
 
 +
Uses the input buffer's contents to create a "mission event" which is later uploaded to "fw-api.%.nso.nintendo.net/v1/events".
 +
 
 +
= mnpp:sys =
 +
This is "nn::mnpp::detail::ipc::IServiceForSystem".
 +
 
 +
This was added with [13.0.0+].
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Cmd || Name
 +
|-
 +
| 0 ||
 +
|-
 +
| 100 ||
 +
|-
 +
| 200 || [13.1.0-13.2.1]
 +
|-
 +
| 300 || [13.1.0-14.1.2]
 +
|-
 +
| 400 || [14.0.0-14.1.2]
 +
|}
 +
 
 +
= mnpp:web =
 +
This is "nn::mnpp::detail::ipc::IServiceForWebBrowser".
 +
 
 +
This was added with [13.0.0+].
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Cmd || Name
 +
|-
 +
| 0 ||
 +
|-
 +
| 1 || [14.0.0+]
 +
|-
 +
| 10 || [14.0.0+]
 +
|-
 +
| 20 || [14.0.0+]
 +
|-
 +
| 100 || [16.1.0+]
 +
|}
 +
 
 +
= Data reporting =
 
The "Play Report" (prepo) service uploads system and user information to a cloud server.
 
The "Play Report" (prepo) service uploads system and user information to a cloud server.
 
This includes the following fields:
 
This includes the following fields:
Line 397: Line 745:
 
It also checks the validity of the device's authentication token using the following URL:<br>
 
It also checks the validity of the device's authentication token using the following URL:<br>
 
* <nowiki>https://dauth-%.ndas.srv.nintendo.net/v1/device_auth_token</nowiki>
 
* <nowiki>https://dauth-%.ndas.srv.nintendo.net/v1/device_auth_token</nowiki>
 
Test
 
  
 
[[Category:Services]]
 
[[Category:Services]]

Latest revision as of 19:05, 8 October 2024

BCAT (Background Content Asymmetric synchronized delivery and Transmission) encompasses a set of content download/upload related services.

bcat:a, bcat:m, bcat:u, bcat:s

These are "nn::bcat::ipc::IServiceCreator".

These were added with [2.0.0+].

Cmd Name
0 #CreateBcatService
1 #CreateDeliveryCacheStorageService
2 #CreateDeliveryCacheStorageServiceWithApplicationId
3 [2.0.0-2.3.0] #CreateDeliveryCacheProgressService
4 [2.0.0-2.3.0] #CreateDeliveryCacheProgressServiceWithApplicationId

Equivalent to 3DS BOSS(SpotPass). See here for BCAT-content-container.

CreateBcatService

Takes an input u64 ProcessId. Returns an #IBcatService.

CreateDeliveryCacheStorageService

Takes an input u64 ProcessId. Returns an #IDeliveryCacheStorageService.

CreateDeliveryCacheStorageServiceWithApplicationId

Takes an input u64 nn::ApplicationId. Returns an #IDeliveryCacheStorageService.

CreateDeliveryCacheProgressService

Takes an input u64 ProcessId. Returns an #IDeliveryCacheProgressService.

CreateDeliveryCacheProgressServiceWithApplicationId

Takes an input u64 nn::ApplicationId. returns an #IDeliveryCacheProgressService.

IBcatService

This is "nn::bcat::ipc::IBcatService".

This was added with [2.0.0+].

Cmd Name
10100 #RequestSyncDeliveryCache
10101 [5.0.0+] RequestSyncDeliveryCacheWithDirectoryName
10200 [5.0.0+] CancelSyncDeliveryCacheRequest
20100 #RequestSyncDeliveryCacheWithApplicationId
20101 [5.0.0+] RequestSyncDeliveryCacheWithApplicationIdAndDirectoryName
20300 [8.0.0+] #GetDeliveryCacheStorageUpdateNotifier
20301 [8.0.0+] #RequestSuspendDeliveryTask
20400 [9.0.0+] #RegisterSystemApplicationDeliveryTask
20401 [9.0.0+] #UnregisterSystemApplicationDeliveryTask
20410 [9.1.0+] SetSystemApplicationDeliveryTaskTimer
30100 #SetPassphrase
30101 [2.0.0-2.3.0]
30102 [2.0.0-2.3.0]
30200 [3.0.0+] RegisterDeliveryTask
30201 [3.0.0+] UnregisterDeliveryTask
30202 [3.0.0+] BlockDeliveryTask
30203 [3.0.0+] UnblockDeliveryTask
30210 [9.1.0+] SetDeliveryTaskTimer
30300 [8.0.0+] RegisterSystemApplicationDeliveryTasks
90100 GetDeliveryTaskList
90101 [11.0.0+] GetDeliveryTaskListForSystem
90200 #GetDeliveryList
90201 [3.0.0+] ClearDeliveryCacheStorage
90202 [8.0.0+] ClearDeliveryTaskSubscriptionStatus
90300 [3.0.0+] GetPushNotificationLog
90301 [11.0.0+] GetDeliveryCacheStorageUsage

RequestSyncDeliveryCache

No input/output.

[3.0.0+] Now returns an #IDeliveryCacheProgressService.

RequestSyncDeliveryCacheWithApplicationId

Takes an input u64 nn::ApplicationId. No output.

[3.0.0+] Now takes an additional 8-bytes of input, and returns an #IDeliveryCacheProgressService.

GetDeliveryCacheStorageUpdateNotifier

Takes an input u64 nn::ApplicationId. Returns an #INotifierService.

RequestSuspendDeliveryTask

Takes an input u64 nn::ApplicationId. Returns an #IDeliveryTaskSuspensionService.

RegisterSystemApplicationDeliveryTask

Takes an input u64 nn::ApplicationId. No output.

UnregisterSystemApplicationDeliveryTask

Takes an input u64 nn::ApplicationId. No output.

SetPassphrase

Takes an input u64 nn::ApplicationId and a type-0x9 input buffer. No output.

GetDeliveryList

Takes a type-0x6 output buffer. Returns a total of 4-bytes of output.

[3.0.0+] Now takes a total of 8-bytes of input, and returns an additional 4-bytes of output.

IDeliveryCacheProgressService

This is "nn::bcat::ipc::IDeliveryCacheProgressService".

This was added with [2.0.0+].

Cmd Name
0 GetEvent
1 GetImpl

IDeliveryCacheStorageService

This is "nn::bcat::ipc::IDeliveryCacheStorageService".

This was added with [2.0.0+].

Cmd Name
0 CreateFileService
1 CreateDirectoryService
10 EnumerateDeliveryCacheDirectory

IDeliveryCacheFileService

This is "nn::bcat::ipc::IDeliveryCacheFileService".

This was added with [2.0.0+].

Cmd Name
0 Open
1 Read
2 GetSize
3 GetDigest

IDeliveryCacheDirectoryService

This is "nn::bcat::ipc::IDeliveryCacheDirectoryService".

This was added with [2.0.0+].

Cmd Name
0 Open
1 Read
2 GetCount

INotifierService

This is "nn::bcat::ipc::INotifierService".

Added with [8.0.0+].

Cmd Name Notes
0 GetEvent

IDeliveryTaskSuspensionService

This is "nn::bcat::ipc::IDeliveryTaskSuspensionService".

Added with [8.0.0+].

Cmd Name
0 GetEvent

news:a, news:c, news:m, news:p, news:v

These are "nn::news::detail::ipc::IServiceCreator".

On [1.0.0] these are "nn::news::detail::ipc::INewsService", see #INewsService.

News entries are fetched from CDN[1]. Metadata for each entry is stored and queried from an internal SQLite database. Official software uses sqlite[2] for processing.

All sessions have 32 sessions. Permission masks are:

Name Mask
news:a 0xffffffff
news:p 0x1
news:c 0x2
news:v 0x4
news:m 0xd
Cmd Name
0 CreateNewsService
1 CreateNewlyArrivedEventHolder
2 CreateNewsDataService
3 CreateNewsDatabaseService
4 CreateOverwriteEventHolder

CreateNewsService

No input. Returns an #INewsService.

CreateNewlyArrivedEventHolder

No input. Returns an #INewlyArrivedEventHolder.

CreateNewsDataService

No input. Returns an #INewsDataService.

Requires permission bit 2.

CreateNewsDatabaseService

No input. Returns an #INewsDatabaseService.

Requires permission bit 2.

CreateOverwriteEventHolder

No input. Returns an #IOverwriteEventHolder.

INewsService

This is "nn::news::detail::ipc::INewsService".

Cmd Name Required Permission Bits
10100 #PostLocalNews 0
20100 SetPassphrase 1
30100 GetSubscriptionStatus 1 or 2
30101 [3.0.0+] GetTopicList 2
30110 [6.0.0+] 2
30200 #IsSystemUpdateRequired 2
30201 [8.0.0+] 2
30210 [10.0.0+] 2
30300 RequestImmediateReception 2
30400 [3.0.0-18.1.0] DecodeArchiveFile 2
30500 [8.0.0+] ? 2
30900 [1.0.0] (No input, returns an #INewlyArrivedEventHolder) 2
30901 [1.0.0] (No input, returns an #INewsDataService) 2
30902 [1.0.0] (No input, returns an #INewsDatabaseService) 2
40100 SetSubscriptionStatus 1 or 3
40101 [3.0.0+] RequestAutoSubscription 3
40200 ClearStorage 3
40201 ClearSubscriptionStatusAll 1 or 3
90100 #GetNewsDatabaseDump 4

PostLocalNews

Takes an input buffer msgpack.

30110

Returns two u64s. Current usage and total size of the news-mounted savedata 0x8000000000000090.

IsSystemUpdateRequired

Matches the version in news-sys:/sup.version against the result from system setting news!system_version.

30210

Returns the Database version retrieved from system setting news!db_version

30500

Takes a type-0x9 input buffer URL, the size of the transfer memory and a handle for the latter, returns an #IDownloadContext. Downloaded files need to be encrypted BCAT Content Container (Crypto type 1-3). Files will be decrypted before being stored in the transfer memory.

GetNewsDatabaseDump

Dumps internal SQLite file.

INewlyArrivedEventHolder

This is "nn::news::detail::ipc::INewlyArrivedEventHolder".

[19.0.0+] This is now "nn::news::detail::ipc::INewArrivalEventHolder".

Cmd Name
0 #Get

Get

Returns readable event. Event is signaled on PostLocalNews or on fetch from CDN if the file doesn't exist.

INewsDataService

This is "nn::news::detail::ipc::INewsDataService".

Cmd Name
0 #Open
1 #OpenWithNewsRecordV1
2 #Read
3 #GetSize
1001 [6.0.0+] #OpenWithNewsRecord
1100 [19.0.0+]

Open

Takes an input string. Opens file with the output of snprintf from "news:/data/%s" with input.

OpenWithNewsRecordV1

Takes an input #NewsRecordV1. Opens file with the output of snprintf of "news:/data/D00000000000000000000_%s.msgpack" with news_id if user_id is empty or else of "news:/data/U%s_%s.msgpack" with user_id and news_id of input.

Read

Read from file opened with #Open, #OpenWithNewsRecordV1 or #OpenWithNewsRecord.

GetSize

Get size of file opened with #Open, #OpenWithNewsRecordV1 or #OpenWithNewsRecord.

OpenWithNewsRecord

Takes an input #NewsRecord. Same behavior as #OpenWithNewsRecordV1.

INewsDatabaseService

This is "nn::news::detail::ipc::INewsDatabaseService".

[19.0.0+] This is now "nn::news::detail::ipc::IDeviceNewsDatabaseService".

Cmd Name
0 GetListV1
1 Count
2 CountWithKey
3 UpdateIntegerValue
4 UpdateIntegerValueWithAddition
5 UpdateStringValue
1000 [6.0.0+] GetList

IOverwriteEventHolder

This is "nn::news::detail::ipc::IOverwriteEventHolder".

Cmd Name
0 #Get

Get

Returns readable event. Event is signaled on fetch from CDN if the file already exists.

IDownloadContext

This is "nn::news::detail::ipc::IDownloadContext".

This was added with [8.0.0+].

On creation this object is enqueued and an event is signaled prompting a download from another thread (nn.news.Downloader).

Cmd Name
0 #Get
1 #Cancel
2 #GetResult
3 #GetSize

Get

Unofficial name.

Return event handle. Signaled on download finish.

Cancel

Unofficial name.

Cancels Download.

GetResult

Unofficial name.

Returns last result.

GetSize

Unofficial name.

Returns final decoded size. 0 if the result of #GetResult is not 0 or Download isn't finished/was canceled.

NewsDatabase

Internal SQLite database. Has a second version since 6.0.0.

Name Type Exists
news_id TEXT All
user_id TEXT All
topic_id TEXT All
application_ids TEXT All
received_at INTEGER All
published_at INTEGER All
expire_at INTEGER All
pickup_limit INTEGER All
essential_pickup_limit INTEGER Only V2
priority INTEGER All
deletion_priority INTEGER All
age_limit INTEGER All
surprise INTEGER All
bashotorya INTEGER Only V1
decoration_type INTEGER Only V2
point INTEGER All
read INTEGER All
newly INTEGER All
displayed INTEGER All
opted_in INTEGER All
point_status INTEGER All
feedback INTEGER Only V2
extra_1 INTEGER All
extra_2 INTEGER All

NewsRecordV1

Offset Size SQLite association
0x0 0x18 TEXT news_id
0x18 0x18 TEXT user_id
0x30 0x8 INTEGER received_id
0x38 0x4 INTEGER news
0x3c 0x4 INTEGER newly
0x40 0x4 INTEGER displayed
0x44 0x4 none

NewsRecord

Offset Size SQLite association
0x0 0x18 TEXT news_id
0x18 0x18 TEXT user_id
0x30 0x20 TEXT topic_id
0x50 0x8 INTEGER received_id
0x58 0x8 none
0x60 0x4 INTEGER decoration_type
0x64 0x4 INTEGER read
0x68 0x4 INTEGER newly
0x6c 0x4 INTEGER displayed
0x70 0x4 INTEGER feedback
0x74 0x4 none
0x78 0x4 INTEGER extra_1
0x7c 0x4 INTEGER extra_2

prepo:a, prepo:a2, prepo:m, prepo:u, prepo:s

These are "nn::prepo::detail::ipc::IPrepoService".

Cmd Name
10100 SaveReportOld ([1.0.0-5.1.0] SaveReport)
10101 SaveReportWithUserOld ([1.0.0-5.1.0] SaveReportWithUser)
10102 [6.0.0+] SaveReportOld2 ([1.0.0-9.2.0] SaveReport)
10103 [6.0.0+] SaveReportWithUserOld2 ([1.0.0-9.2.0] SaveReportWithUser)
10104 [10.0.0+] SaveReport
10105 [10.0.0+] SaveReportWithUser
10200 RequestImmediateTransmission
10300 GetTransmissionStatus
10400 [9.0.0+] GetSystemSessionId
10500 [15.0.0+] SendReportWithUser
20100 SaveSystemReport
20101 SaveSystemReportWithUser
20200 [4.0.0+] SetOperationMode
30100 ClearStorage
30200 [6.0.0+] ClearStatistics
30300 [6.0.0+] GetStorageUsage
30400 [6.0.0+] GetStatistics
30401 [6.0.0+] GetThroughputHistory
30500 [6.0.0+] GetLastUploadError
30600 [10.0.0+] GetApplicationUploadSummary
40100 [2.0.0+] IsUserAgreementCheckEnabled
40101 [2.0.0+] SetUserAgreementCheckEnabled
50100 [10.0.0+] ReadAllApplicationReportFiles
90100 [6.0.0+] ReadAllReportFiles ([1.0.0-5.1.0] GetStorageUsage)
90101 [1.0.0]
90102 [1.0.0]
90200 [5.0.0-5.1.0] GetStatistics
90201 [5.0.0-5.1.0] GetThroughputHistory
90300 [5.0.0-5.1.0] GetLastUploadError

mnpp:app

This is "nn::mnpp::detail::ipc::IServiceForApplication".

This was added with [13.0.0+].

Cmd Name
0 #Initialize
1 #SubmitEvent

Initialize

Unofficial name.

Takes a PID-descriptor and a reserved input u64. No output.

Uses arp:r commands GetApplicationInstanceId and GetApplicationLaunchProperty to get and store the application's ProgramId.

SubmitEvent

Unofficial name.

Takes an input Uid and a type-0x5 input buffer. No output.

Uses the input buffer's contents to create a "mission event" which is later uploaded to "fw-api.%.nso.nintendo.net/v1/events".

mnpp:sys

This is "nn::mnpp::detail::ipc::IServiceForSystem".

This was added with [13.0.0+].

Cmd Name
0
100
200 [13.1.0-13.2.1]
300 [13.1.0-14.1.2]
400 [14.0.0-14.1.2]

mnpp:web

This is "nn::mnpp::detail::ipc::IServiceForWebBrowser".

This was added with [13.0.0+].

Cmd Name
0
1 [14.0.0+]
10 [14.0.0+]
20 [14.0.0+]
100 [16.1.0+]

Data reporting

The "Play Report" (prepo) service uploads system and user information to a cloud server. This includes the following fields:

sys_info
data
application_id
event_id
operation_mode
lc_recorded_at (followed by a timestamp)
nc_recorded_at (followed by a timestamp)
nsa_id
os_version

And the contents of the following file:

is_user_agreement_check_enabled.bin

All the information is periodically uploaded to the following URL:

  • https://receive-%.dg.srv.nintendo.net/post

It also checks the validity of the device's authentication token using the following URL:

  • https://dauth-%.ndas.srv.nintendo.net/v1/device_auth_token