Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

3DS:Troubleshooting/Finalizing Setup (Manual) and 3DS:Cleaninty: Difference between pages

From Hacks Guide Wiki
(Difference between pages)
m update fbi link o7
 
Shinobijolteon (talk | contribs)
No edit summary
 
Line 1: Line 1:
==Required Reading==
{{lowercase title}}{{Infobox homebrew
| title = cleaninty
| developers = luigoalma
| version = 0.1.3
| releasedate = 2023-03-18
| github = luigoalma/cleaninty
| githubtag = v0.1.3
| forwindows = 1
| formac = 1
| forlinux = 1
}}
'''cleaninty''' is a PC tool used to communicate with Nintendo's [[wikipedia:SOAP|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 [[3DS:System files|<code>otp.bin</code>]]. 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.<br>
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.


This is a manual version of the [[3dsguide:finalizing-setup|Finalizing Setup]] section of the guide, for when all other options have been exhausted and the script does not work.
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 region-locked - meaning their presence blocks the console from registering to any other eShop region. (The most common of these tickets are from preinstalled games and the [[3dbrew:StreetPass Mii Plaza|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).<br>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 [[3DS:MMM|Manual Movable Moveover]] is the exact opposite of a SOAP transfer.)


==What You Need==


*The latest release of {{GitHub|lifehackerhansol/FBI/releases/latest|FBI}} (Both <code>FBI.3dsx</code> and <code>FBI.cia</code>)
== Features ==
*The latest release of {{GitHub|astronautlevel2/Anemone3DS/releases/latest/download/Anemone3DS.cia|Anemone3DS}} (direct download)
*The latest release of {{GitHub|mtheall/ftpd/releases/latest/download/ftpd.cia|FTPD}} (direct download)
*The v3.7.4 release of {{GitHub|BernardoGiordano/Checkpoint/releases/download/v3.7.4/Checkpoint.cia|Checkpoint}} (direct download)
*The latest release of {{GitHub|PabloMK7/homebrew_launcher_dummy/releases/latest/download/Homebrew_Launcher.cia|HBL Launcher Wrapper}} (direct download)
*The latest release of {{GitHub|Universal-Team/Universal-Updater/releases/latest/download/Universal-Updater.cia|Universal-Updater}} (direct download)
*The latest release of {{GitHub|d0k3/GodMode9/releases/download/v2.1.1/GodMode9-v2.1.1-20220322194259.zip|GodMode9}} (direct download)


==Instructions==
When the required constants have been supplied through <code>SetupConstants</code> and you have the unique data (<code>otp.bin</code> and either <code>SecureInfo.bin</code> or the serial number) of a console, cleaninty can act as that console and do the following:


===Section I - Prep Work===
* <code>GenJson</code>: Compiles the console's data into a single JSON file. This JSON is required for all other commands except <code>RecoverIVS</code>.
* <code>CheckReg</code>: 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.
* <code>SysTransfer</code>: Moves the eShop titles of the source console to the target console. This is the only part of a SOAP transfer if the console has region-locked tickets, as it will do an <code>EShopDelete</code> as part of the 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.
* <code>NNIDTransfer</code>: <u>(Still experimental. Use with caution.)</u> 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. 
* <code>LastTransfer</code>: 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.
* <code>GetIVS</code>: Downloads the console's <code>movable.sed</code> from the SOAP servers, if the servers have a stored copy.
* <code>SetIVS</code>: Uploads the chosen JSON's stored <code>movable.sed</code> to the SOAP servers. This will overwrite the current stored movable.
* <code>RecoverIVS</code>: Tries to recover a console's <code>movable.sed</code> from only its raw <code>otp.bin</code> and eShop region data.
* <code>EShopDelete</code>: Deletes the target console's eShop account. This is the secondary part of a SOAP transfer, as the console will then automatically register an account in the correct region when it next accesses the eShop.
* <code>EShopRegionChange</code>: 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 if the console has no region-locked tickets, but an <code>EShopDelete</code> should still be done afterward.
* <code>ETickets</code>/<code>ETicketDownload</code>/<code>ETikTitleDownload</code>: Lists all owned eShop tickets / downloads all tickets / downloads the titles attached to all tickets, respectively, from the given console's eShop account.


# Power off your device
# Insert your SD card into your computer
# Create the folder <code>sd:/3ds</code>
#* You may already have this from a earlier section in the guide.
# Place <code>FBI.3dsx</code> into <code>sd:/3ds/</code>
# Create the folder <code>sd:/cias/</code>
# Place <code>FBI.cia</code>, <code>Universal-Updater.cia</code>, <code>Anemone3DS.cia</code>, <code>ftpd.cia</code>, <code>hblauncher_loader.cia</code>, and <code>Checkpoint.cia</code> into <code>sd:/cias</code>
# Create the folder <code>sd:/luma/payloads/</code>
# Copy <code>GodMode9.firm</code> from the GodMode9 zip file into <code>sd:/luma/payloads/</code>
# Copy the <code>gm9</code> folder from the GodMode9 zip file to the root of your sd card
# Eject the SD card from your computer, then remove it
# Reinsert the SD card into your console


===Section II - CFW Check===
== Installation ==


# Hold {{B|SELECT}}, and while holding {{B|SELECT}}, power on the console
Instructions for installation & setup are {{GitHub|luigoalma/cleaninty#Installing|on the GitHub page}}, but the installation instructions may need to be interpreted for your OS.
#* If the check was successful, your console should have booted into the Luma3DS configuration menu
# Press {{B|START}} to save and reboot
# Power off your console
{{critical|text=If you do NOT boot into the Luma3DS configuration menu, custom firmware was not installed on your console. Join [https://discord.gg/C29hYvh the Nintendo Homebrew Discord] and ask, in English, for help}}


=== Section III - Updating the System===


# Update your console by going to System Settings, then “Other Settings”, then going all the way to the right and using “System Update”
Regardless of your OS, you will need a 3DS with both custom firmware and [[3DS:GodMode9|GodMode9]] installed to dump the vast majority of the files required to do <code>SetupConstants</code> using [https://raw.githubusercontent.com/luigoalma/cleaninty/master/gm9scripts/ExtractSystemElements.gm9 ExtractSystemElements.gm9]. A guide to legally deriving the only constant ''not'' dumped via this method, the [[wikipedia:Advanced_Encryption_Standard|AES]] Constant "C", can be found [https://3ds.goombi.fr/convertMii/0x31.html on this page].
#* Updates while using B9S + Luma (what you have) are safe
{{critical|The AES Constant, along with all other constants used by cleaninty, are copyrighted data. Obtaining them from your own console(s) is fine, but '''do not''' share the constants with anyone else.}}
#* The updater may display a message saying “Your system is up to date” instead of updating. This is normal if you are already up to date; continue to the next section
=== Windows ===
#* If this gives you an error, set both your DNS settings and Proxy settings to “Auto”
#* If this still gives you an error, follow [[3dsguide:troubleshooting#finalizing-setup|this troubleshooting guide]]


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


=== Section IV - RTC and DSP setup ===
Instead, there are two options:
# Install a Linux distro through [https://learn.microsoft.com/en-us/windows/wsl/install 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 {{GitHub|microsoft/terminal|Windows Terminal}}.)
# Install [https://www.msys2.org/ msys2] and then install cleaninty inside the msys2 instance using the below instructions.


# Close '''System Settings'''
To install cleaninty inside msys2, open the terminal <code>mingw64.exe</code> that is inside the msys2 installation folder, then run the following two commands one at a time:
# Press {{B|L|Down|SELECT}} at the same time to open the Rosalina menu
* <code>pacman -Syu mingw-w64-x86_64-python mingw-w64-x86_64-python-defusedxml mingw-w64-x86_64-python-cryptography mingw-w64-x86_64-python-pycurl</code>
#* If one of these buttons is broken, download this [[3dsguide:assets/config.ini|config.ini]] and put it in <code>sd:/luma</code>, replacing the existing one. This will change the Rosalina menu key combination to {{B|X|Y}}
* <code>python -m pip install cleaninty</code>
# Select “Miscellaneous options”
# Select “Dump DSP firmware”
# Press {{B|B}} to continue
# Select “Nullify user time offset”
# Press {{B|B}} to continue
# Press {{B|B}} to return to the Rosalina main menu
# Press {{B|B}} to exit the Rosalina menu


=== Section V - CIA Installation ===
Once this is completed, from here on out you will need to open the msys2 <code>mingw64.exe</code> terminal to use cleaninty.


# Open the '''Activity Log'''
{{info|Be aware that when using cleaninty through msys2, the place it will look in to find <code>boot9.bin</code>, <code>SSLCertificates</code>, and <code>ctr_constants.json</code> is a folder named <code>3ds</code> inside your msys2 <code>home</code> folder.}}
# Press {{B|L|Down|SELECT}} at the same time to open the Rosalina menu
# Select “Miscellaneous options”
# Select “Switch the hb title to the current app”
# Press {{B|B}} to continue
# Press {{B|B}} twice to return to the Rosalina main menu
# Press {{B|B}} to exit the Rosalina menu
# Close '''Activity Log'''
# Reopen '''Activity Log'''
#* This should open the '''Homebrew Launcher'''
# Open '''FBI''' from the list of homebrew
# Select <code>SD</code>, then click <code>cias</code>
# Select the <code>Current directory</code> option, then choose to <code>Install and delete all CIAs</code>
# Close '''FBI'''
#* Six new applications should be on the home menu.


=== Section VI - NAND Backup and CTRNAND Luma/GM9 ===
=== macOS and Linux ===


# Power off your console
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 <code>python3 --version</code>. If you do not, install a compatible version from either your package manager or [https://www.python.org/downloads/ the Python website].
# Press and hold {{B|Start}}, and while holding {{B|Start}}, power on your console. This will launch GodMode9
#* If you do not boot into GodMode9, ensure that you copied <code>GodMode9.firm</code> into <code>sd:/luma/payloads/</code> and that the folders are not misnamed (e.g. luna, lumas, playloads, payload.)
#* If you are prompted to create an essential files backup, press {{B|A}} to do so, then press {{B|A}} to continue once it has completed.
#* If you are prompted to fix the RTC date&time, press {{B|A}} to do so, then set the date and time, then press {{B|A}} to continue.
# Press {{B|Home}} to bring up the action menu
# Select <code>Scripts…</code>
# Select '''GM9Megascript'''
# Select <code>Backup Options</code>
# Select <code>SysNAND Backup</code>
# Press {{B|A}} to confirm
#* The NAND backup process may take up to 20 minutes.
# Press {{B|B}} to exit to the main menu of '''GM9Megascript'''
# Select <code>Scripts from Plailect’s Guide</code>
# Select <code>Setup Luma3DS to CTRNAND</code>
# When prompted, press {{B|A}} to proceed
# Press {{B|A}} to unlock writing to SysNAND (lvl1), then input the key combo given
# Press {{B|A}} to continue
# Press {{B|B}} twice to exit '''GM9Megascript'''
# Hold {{B|R}} and press {{B|START}} to power off your console
# Insert your SD card into your computer
# Copy the contents of <code>sd:/gm9/out/</code> to a safe location on your computer
#* These files are critical backups and should be backed up to multiple locations (i.e. cloud storage)  if possible
#* The two SysNAND files are your NAND backup and can be used to revert your console to a working state if it is bricked by a software issue
#* The <code>essentials.exefs</code> file contains your console’s system-unique files and can be used to recover your data in the event of a hardware failure
# If you still have them, delete the two SysNAND files from <code>sd:/gm9/out/</code> from your SD card
#* The <code>essential.exefs</code> file is small and may be kept on your SD card for ease of access


----
Then, either install cleaninty directly from <code>pip</code> or clone its repo via the command <code>git clone https://github.com/luigoalma/cleaninty.git</code> and then run the <code>setup.py</code> script.


{{success|text=You’re done! Custom firmware is now fully configured on your console.}}


{{info|text=
== Usage ==
<b>Information and Notes</b>
{{critical|Make sure the files for all consoles you compile into a json are accurate before using them in cleaninty, or else the commands may affect a different console than they "should be".
Here are some key combos that you should know:


*Holding {{B|SELECT}} on boot will launch the Luma3DS configuration menu.
The easiest way to do this is by checking the serial sticker(s) on the console against the copy of the serial in [[3dbrew:Nandrw/sys/SecureInfo_A|SecureInfo_A]].<br>
*Holding {{B|START}} on boot will launch GodMode9, or if you have multiple payloads in <code>sd:/luma/payloads/</code>, the Luma3DS chainloader.
If none of the stickers agree with the SecureInfo, also check against the copy in [[3dbrew:Twln/sys/log/inspect.log|inspect.log]] and make sure its listed MAC Address matches the one in '''System Settings -> Internet Settings -> Other Information -> Confirm MAC Address.'''}}
*By default, pressing {{B|L|Down|SELECT}} while in 3DS mode will open the Rosalina menu, where you can check system information, take screenshots, enable cheats, and more. This can be changed from the Rosalina menu.
 
**If you have a modified Luma config, this key combination may be {{B|X|Y}} instead.
There is no graphical interface for cleaninty. All commands are ran through the command line.
*Holding {{B|START|SELECT|X}} on boot will make the notification LED show a color for debug purposes. See [[3DS:Boot9strap#LED_Status_Codes|here]] for what each color means.
 
}}
=== Manual command line ===
{{info|text=See [[3DS:Things to do|here]] for some suggestions on things to do with custom firmware.}}
 
The commands are the same on all operating systems. Run <code>cleaninty ctr (command) --help</code> 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:
# <code>cleaninty ctr GenJson --otp otp.bin --secureinfo secinfo.bin --out soap_donor.json</code>
# <code>cleaninty ctr GenJson --otp otp1.bin --secureinfo secinfo1.bin --out soap_target.json</code>
# <code>cleaninty ctr CheckReg -C soap_donor.json</code>
# <code>cleaninty ctr CheckReg -C soap_target.json</code>
#* The CheckReg commands are not necessary if you are already certain the donor and target have the same region.
# <code>cleaninty ctr EShopRegionChange -C soap_target.json -r (eShop region) -c  (eShop country - not required if region is JPN/KOR/CHN)</code>
#* You can use any region/country for this command other than the one listed in the <code>soap_target.json</code>'s <code>CheckReg</code>.
# Depending on whether the EShopRegionChange was successful or not, only do '''one''' of the following commands.
<tabber>
|-|Succeeded=
<ol>
<li value="7"><code>cleaninty EShopDelete -C soap_target.json</code></li>
</ol>
 
|-|Failed=
<ol>
<li value="7"><code>cleaninty ctr SysTransfer -s soap_target.json -t soap_donor.json</code></li>
</ol>
</tabber>
 
 
=== 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 {{GitHub|StarlitSkies/autosoap|SOAP bash script}} made by StarlitSkies that heavily simplifies the process.
 
Read the instructions on its page for setup and usage.


{{info|text=For information on using GodMode9’s various features, check out the [[3DS:GodMode9/Usage|GodMode9 Usage]] and [[3DS:Dump titles and game cartridges|Dumping Titles and Game Cartridges]] pages.}}
[[Category:Nintendo 3DS guides]]

Revision as of 23:00, 15 July 2024

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 otp.bin. 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 region-locked - meaning their presence blocks the console from registering to any other eShop region. (The most common of these 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 Moveover is the exact opposite of a SOAP transfer.)


Features

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

  • GenJson: Compiles the console's data into a single JSON file. This JSON is required for all other commands except RecoverIVS.
  • CheckReg: 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.
  • SysTransfer: Moves the eShop titles of the source console to the target console. This is the only part of a SOAP transfer if the console has region-locked tickets, as it will do an EShopDelete as part of the 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.
  • NNIDTransfer: (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.
  • LastTransfer: 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.
  • GetIVS: Downloads the console's movable.sed from the SOAP servers, if the servers have a stored copy.
  • SetIVS: Uploads the chosen JSON's stored movable.sed to the SOAP servers. This will overwrite the current stored movable.
  • RecoverIVS: Tries to recover a console's movable.sed from only its raw otp.bin and eShop region data.
  • EShopDelete: Deletes the target console's eShop account. This is the secondary part of a SOAP transfer, as the console will then automatically register an account in the correct region when it next accesses the eShop.
  • EShopRegionChange: 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 if the console has no region-locked tickets, but an EShopDelete should still be done afterward.
  • ETickets/ETicketDownload/ETikTitleDownload: 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 on the GitHub page, 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 SetupConstants using ExtractSystemElements.gm9. A guide to legally deriving the only constant not dumped via this method, the AES Constant "C", can be found on this page.

Critical icon The AES Constant, along with all other constants used by cleaninty, are copyrighted data. Obtaining them from your own console(s) is fine, but do not share the constants with anyone else.

Windows

Don't bother trying to install cleaninty on Windows directly. Windows has OpenSSL disabled in its curl.exe, 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 Windows Terminal.)
  2. Install msys2 and then install cleaninty inside the msys2 instance using the below instructions.

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

  • pacman -Syu mingw-w64-x86_64-python mingw-w64-x86_64-python-defusedxml mingw-w64-x86_64-python-cryptography mingw-w64-x86_64-python-pycurl
  • python -m pip install cleaninty

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

Info icon Be aware that when using cleaninty through msys2, the place it will look in to find boot9.bin, SSLCertificates, and ctr_constants.json is a folder named 3ds inside your msys2 home folder.

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 python3 --version. If you do not, install a compatible version from either your package manager or the Python website.

Then, either install cleaninty directly from pip or clone its repo via the command git clone https://github.com/luigoalma/cleaninty.git and then run the setup.py script.


Usage

Critical icon Make sure the files for all consoles you compile into a json are accurate before using them in cleaninty, or else the commands may affect a different console than they "should be".

The easiest way to do this is by checking the serial sticker(s) on the console against the copy of the serial in SecureInfo_A.

If none of the stickers agree with the SecureInfo, also check against the copy in inspect.log and make sure its listed MAC Address matches the one in System Settings -> Internet Settings -> Other Information -> Confirm MAC Address.

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 cleaninty ctr (command) --help 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. cleaninty ctr GenJson --otp otp.bin --secureinfo secinfo.bin --out soap_donor.json
  2. cleaninty ctr GenJson --otp otp1.bin --secureinfo secinfo1.bin --out soap_target.json
  3. cleaninty ctr CheckReg -C soap_donor.json
  4. cleaninty ctr CheckReg -C soap_target.json
    • The CheckReg commands are not necessary if you are already certain the donor and target have the same region.
  5. cleaninty ctr EShopRegionChange -C soap_target.json -r (eShop region) -c (eShop country - not required if region is JPN/KOR/CHN)
    • You can use any region/country for this command other than the one listed in the soap_target.json's CheckReg.
  6. Depending on whether the EShopRegionChange was successful or not, only do one of the following commands.

  1. cleaninty EShopDelete -C soap_target.json

  1. cleaninty ctr SysTransfer -s soap_target.json -t soap_donor.json


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 SOAP bash script made by StarlitSkies that heavily simplifies the process.

Read the instructions on its page for setup and usage.