All Projects → ZekeSnider → Nintendoswitchrestapi

ZekeSnider / Nintendoswitchrestapi

Licence: mit
Reverse engineered REST API used in the Nintendo Switch app for iOS. Includes documentation on Splatoon 2's API.

Projects that are alternatives of or similar to Nintendoswitchrestapi

Botw
Decompilation of The Legend of Zelda: Breath of the Wild (Switch 1.5.0)
Stars: ✭ 241 (-45.1%)
Mutual labels:  nintendo-switch, reverse-engineering
Ghidra Switch Loader
Nintendo Switch loader for Ghidra
Stars: ✭ 146 (-66.74%)
Mutual labels:  nintendo-switch, reverse-engineering
Botw Re Notes
Reverse engineering notes and tools for The Legend of Zelda: Breath of the Wild
Stars: ✭ 78 (-82.23%)
Mutual labels:  nintendo-switch, reverse-engineering
Opensteamcontroller
Steam Controller reverse engineering and customization project.
Stars: ✭ 253 (-42.37%)
Mutual labels:  nintendo-switch, reverse-engineering
Headless Wp Starter
🔪 WordPress + React Starter Kit: Spin up a WordPress-powered React app in one step
Stars: ✭ 4,144 (+843.96%)
Mutual labels:  rest-api
Nxloader
My first Android app: Launch Fusée Gelée payloads from stock Android (CVE-2018-6242)
Stars: ✭ 417 (-5.01%)
Mutual labels:  nintendo-switch
Drf Spectacular
Sane and flexible OpenAPI 3 schema generation for Django REST framework.
Stars: ✭ 414 (-5.69%)
Mutual labels:  rest-api
Ios Apm Secrets
㊙️ WIP 深度揭秘各大 APM 厂商 iOS SDK 背后的核心技术和实现细节 更新中……
Stars: ✭ 414 (-5.69%)
Mutual labels:  reverse-engineering
Pixd
🔍 Colourful visualization tool for binary files
Stars: ✭ 438 (-0.23%)
Mutual labels:  reverse-engineering
Laravel Api Response Builder
Builds nice, normalized and easy to consume Laravel REST API JSON responses.
Stars: ✭ 433 (-1.37%)
Mutual labels:  rest-api
Dji Firmware Tools
Tools for handling firmwares of DJI products, with focus on quadcopters.
Stars: ✭ 424 (-3.42%)
Mutual labels:  reverse-engineering
Domain generation algorithms
Some results of my DGA reversing efforts
Stars: ✭ 417 (-5.01%)
Mutual labels:  reverse-engineering
Redriver2
Driver 2 Playstation game reverse engineering effort
Stars: ✭ 426 (-2.96%)
Mutual labels:  reverse-engineering
Pwndra
A collection of pwn/CTF related utilities for Ghidra
Stars: ✭ 417 (-5.01%)
Mutual labels:  reverse-engineering
Switchthemeinjector
Create custom themes for the nintendo switch !
Stars: ✭ 436 (-0.68%)
Mutual labels:  nintendo-switch
Amoco
yet another tool for analysing binaries
Stars: ✭ 413 (-5.92%)
Mutual labels:  reverse-engineering
Wp Vue
A simple Vue blog template that displays posts from any WordPress REST API endpoint.
Stars: ✭ 423 (-3.64%)
Mutual labels:  rest-api
Nodejs Interview Questions
Frequently Asked Node.js Interview Questions
Stars: ✭ 433 (-1.37%)
Mutual labels:  rest-api
Security Notes
📓 Some security related notes
Stars: ✭ 422 (-3.87%)
Mutual labels:  reverse-engineering
Debundle
🗃 A javascript debundler. Takes a Browserify or Webpack bundle and recreates the initial, pre-bundled source.
Stars: ✭ 420 (-4.33%)
Mutual labels:  reverse-engineering

Reverse Engineered Nintendo Switch App REST API

Introduction

This is documentation of the REST APIs used for the Nintendo Switch app, and embedded Splatoon 2 web app.

All testing was done on an iPhone 7 running iOS 10.3.3 using version 1.0.4 of the Nintendo Switch app on 07/30/17. I reverse-engineered using mitmproxy. It was quite easy as the app does not use cert-pinning at all. I have not tested using the Android app at all, but I would assume that everything is identical (besides obvious user-agent differences). I am using a US account with the language set to English. There may be small differences for other regions.

A Paw project is included for macOS users which should help tinkering with the API. I highly recommend trying this out first to figure out how the API works. Take a look at the environment variables to see what you need to fill in. Once you fill in Client ID, Login Page Token Code, Login Page Token Code Verifier, and Birthday you can execute the auth requests in order and you should be good to go.

Note: I recommend setting the User-Agent on all requests to the Splatoon 2 API to the following string to blend in. There doesn't appear to be any checking for this but better safe than sorry. Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_3 like Mac OS X) AppleWebKit/603.3.8 (KHTML, like Gecko) Mobile/14G60

Blueprints

Open Source Components

If you are curious about the open source components used in the app, I have compiled them here.

Authentication Steps

  1. Visit authorization link in browser

This page is an HTML page which loads the auth flow which you would normally see first when logging into the app. Follow through the flow by logging in with an account.

https://accounts.nintendo.com/connect/1.0.0/authorize?state=[state here]&redirect_uri=[... continues]

I currently have no idea how this URL is generated. I recommend signing out of the Switch app, then sign back in and open the sign flow link in Safari. You can then open it on your computer and follow from there.

Once you sign in, you will be redirected to a page like npf71b963c1b7b6d119://auth#session_state=[SessionStateReturnedHere]&session_token_code=[codehere]&state=[StateReturnedHere]

  1. Get a session token

Extract the session_state and state from that url, and request from POST /connect/1.0.0/api/session_token

  1. Get a service access token

Make a request to POST /connect/1.0.0/api/token using session_token from 2.

  1. Login to account

Make a request to POST /v1/Account/Login. Use id_token from 3.

  1. Get game list

Use your access token to retrieve the game list from GET /v1/Game/ListWebServices. Use webApiServerCredential["accesstoken"] from 4.

  1. Get access token for Splatoon

Make a request to GET /v1/Game/GetWebServiceToken. Use the ID of Splatoon 2 from 5 and webApiServerCredential["accesstoken"] from 4.

  1. Get cookie to use for splatoon requests

Make a request to GET /. Use the accessToken from 6.

  1. Play with the Splatoon 2 API

You can now make any request from the Splatoon 2 API using the cookie retrieved from 7. Have fun!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].