3DS:Cleaninty

cleaninty is a PC tool used to communicate with Nintendo's SOAP servers. For a 3DS, these servers deal with managing eShop accounts, downloading eShop titles, and system transfers. It is also the tool used for what is informally known as a "SOAP Transfer".

Overview
There are two pieces of data a 3DS that give it a unique ID to Nintendo's eShop servers: its serial number and its. If these are copied out of the console and used somewhere else, they can be used to imitate the console - meaning Nintendo's servers can act on commands without the console doing anything on its end. However, the files cannot communicate on their own, and a connection to Nintendo's servers that acts identically to a console is still needed. This part is where cleaninty comes in.

The reason this allows for changing eShop regions easily, and at infinite range, are as follows:
 * Ease of Use: Tickets for both system software & purchased apps are stored on Nintendo's servers, and some of these tickets are 'sticky' - they refuse to be deleted when trying to delete the console's eShop account. (The most common sticky tickets are from preinstalled games and the Mii Plaza 3.x update.) The only way to remove these tickets is to transfer them to another console, and cleaninty is able to move only the tickets with a single command.
 * Infinite Range: System transfers are effectively divided into two parts: the content transfer (done entirely on consoles), and the NNID/title transfer (done entirely on servers). On an actual console, these two must be done at the same time - but if cleaninty sends the commands for a server transfer, it doesn't start a content transfer and thus the consoles do not have to be next to each other. (Technically, this also means a Manual Movable Transfer is the exact opposite of a SOAP transfer.)

Features
When the required constants have been supplied through  and you have the unique data (  and either   or the serial number) of a console, cleaninty can act as that console and do the following:


 * : Compiles the console's data into a single JSON file. This JSON is required for all other commands except.
 * : Obtains the console's eShop status, eShop region, and any titles attached to its eShop account, then updates the JSON file if any differences in the data are found.
 * : Moves the eShop titles of the source console to the target console. This is the secondary part of what is known informally as a "SOAP Transfer".
 * A successful use of this command triggers a 7-day cooldown on system transfers for both consoles, the same as a full system transfer.
 * : (Still experimental. Use with caution.) Moves only the NNIDs of the source console to the target console. This is not affected by system transfer cooldowns and does not trigger one.
 * : Provides the date&time of the given console's last system transfer, the number of transfers it has ever done, and the time at which the current transfer cooldown will expire if there is one active.
 * : Downloads the console's  from the SOAP servers, if the servers have a stored copy.
 * : Uploads the chosen JSON's stored  to the SOAP servers. This will overwrite the current stored movable.
 * : Tries to recover a console's  from only its raw   and eShop region data.
 * : Deletes the target console's eShop account.
 * : Attempts to delete and then recreate the target console's eShop account for the entered region. This is the main part of a "SOAP Transfer", but after a successful SysTransfer the console will do this automatically when it next connects to the eShop.
 * / / : Lists all owned eShop tickets / downloads all tickets / downloads the titles attached to all tickets, respectively, from the given console's eShop account.

Installation
Instructions for installation & setup are, but the installation instructions may need to be interpreted for your OS.

Regardless of your OS, you will need a 3DS with both custom firmware and GodMode9 installed to dump the vast majority of the files required to do  using ExtractSystemElements.gm9. A guide to legally deriving the only constant not dumped via this method, theAES Constant "C", can be found on this page.

Windows
Don't bother trying to install cleaninty on Windows directly. Windows has OpenSSL disabled in its, but cleaninty requires OpenSSL to function. Working around this issue manually is obnoxious and not worth the time spent.

Instead, there are two options:
 * 1) Install a Linux distro through WSL and then install cleaninty inside the WSL instance using the macOS/Linux instructions. (This is the simpler path, and WSL is useful for many other things. If you choose this instead of msys2, it is recommended that you also install the .)
 * 2) Install msys2 and then install cleaninty inside the msys2 instance using the below instructions.

To install cleaninty inside msys2, open the terminal  that is inside the msys2 installation folder, then run the following two commands one at a time:

Once this is completed, from here on out you will need to open the msys2  terminal to use cleaninty.

macOS and Linux
First, ensure you have Python 3.7 or newer. You can check if your Python version is new enough by opening a terminal and running the command. If you do not, install a compatible version from either your package manager or the Python website.

Then, either install cleaninty directly from  or clone its repo via the command   and then run the   script.

Usage
There is no graphical interface for cleaninty. All commands are ran through the command line.

Manual command line
The commands are the same on all operating systems. Run  for information on an individual command's syntax.

As an example, the minimum list of commands needed to set up two consoles' data and perform a SOAP transfer between them would be as follows:
 * 1) * The CheckReg commands are not necessary if you are already certain the donor and target have the same region.
 * 2) * If this succeeds, stop here. The next command is only needed if this one fails.
 * 1) * The CheckReg commands are not necessary if you are already certain the donor and target have the same region.
 * 2) * If this succeeds, stop here. The next command is only needed if this one fails.
 * 1) * The CheckReg commands are not necessary if you are already certain the donor and target have the same region.
 * 2) * If this succeeds, stop here. The next command is only needed if this one fails.
 * 1) * If this succeeds, stop here. The next command is only needed if this one fails.

Autosoap script
If you are inexperienced with the command line or just don't want to type the commands manually every time, there is a made by StarlitSkies that heavily simplifies the process. The only downside is that if cleaninty has a nonstandard error, the script will be unable to tell you the exact text of the error - meaning you will need to revert back to manual commands anyway in order to debug.

Read the instructions on its page for setup and usage.