1
0
Fork 0
mirror of https://github.com/nicoboss/nsz.git synced 2026-07-11 03:17:49 +00:00
NSZ - Homebrew compatible NSP/XCI compressor/decompressor
  • Python 85.8%
  • Shell 5.9%
  • Batchfile 3.8%
  • kvlang 2.1%
  • Dockerfile 1.1%
  • Other 1.3%
Find a file
Nico Bosshard 6c0d6e06e7
Merge pull request #234 from Clearmist/master
More build options and bug fixes
2026-07-03 00:47:31 +02:00
.devcontainer I fixed a filename bug where the windows cmd files had characters in their filenames that are not okay on macOS. 2026-06-22 20:49:49 -06:00
.github/workflows I removed CLI/GUI for macos-x64 because GitHub retired the required image. I removed GUI windows-arm because Kivy does not support windows ARM. 2026-06-22 21:52:58 -06:00
.vscode I fixed a filename bug where the windows cmd files had characters in their filenames that are not okay on macOS. 2026-06-22 20:49:49 -06:00
container Updated with latest master in order to resolve merge conflicts 2026-05-10 11:40:48 +02:00
dev Refactor the --machine-readable output to be much more useful. 2026-06-20 23:41:45 -06:00
docs I greatly decreased the size of the readme file by putting larger sections into dedicated documents. 2026-06-22 17:26:02 -06:00
nsz Formatting one remaining file with ruff and removing the remaining explicit actions in log lines. 2026-06-22 22:49:02 -06:00
scripts I added builds for 3 more os/cpu combos! 2026-06-22 21:44:48 -06:00
.gitignore Development: added devcontainer, build tasks, and a GitHub Actions build workflow. The CLI and GUI binaries now build on Linux, macOS, and Windows. Reduced binary build size by up to 50% by enabling debug symbol stripping. Moved versioning to nsz/version.py for easier updating. Changed behavior so the CLI will print help if there are no arguments. 2026-06-20 17:30:49 -06:00
azure-pipelines.yml I removed the decommissioned -p parameter from azure pipelines. 2026-06-21 10:45:16 -06:00
CONTRIBUTING.md I greatly decreased the size of the readme file by putting larger sections into dedicated documents. 2026-06-22 17:26:02 -06:00
LICENSE.md I greatly decreased the size of the readme file by putting larger sections into dedicated documents. 2026-06-22 17:26:02 -06:00
MANIFEST.in Added fonts to MANIFEST.in and __init__.spec 2020-08-31 22:41:48 +02:00
nsz.py Fixed the progress bar positions, calculations, and strings. Fixed an uncaught exception. Filtered out a module notification. 2026-06-20 22:02:03 -06:00
nsz.pyproj Because NszDecompressor decompresses all three major compressed file extensions: I renamed it to simply "Decompressor". 2026-06-21 10:45:57 -06:00
nsz.sln Implemented --undupe-rename 2020-12-17 09:23:25 +01:00
README.md I greatly decreased the size of the readme file by putting larger sections into dedicated documents. 2026-06-22 17:26:02 -06:00
requirements-gui.txt Revert "Require zstandard to be of version 0.15.2 to stay compatible with popular title installers. See #120 for more information. This makes nsz hard to install on Python 1.10 and later as there is no pre-built zstandard v0.15.2 wheel for those Python versions." 2022-12-08 22:17:50 +01:00
requirements.txt Revert "Require zstandard to be of version 0.15.2 to stay compatible with popular title installers. See #120 for more information. This makes nsz hard to install on Python 1.10 and later as there is no pre-built zstandard v0.15.2 wheel for those Python versions." 2022-12-08 22:17:50 +01:00
setup.py Formatting one remaining file with ruff and removing the remaining explicit actions in log lines. 2026-06-22 22:49:02 -06:00

Build Release Binaries

NSZ

A compression/decompresson script (with optional GUI) that compresses or decompresses Nintendo Switch dumps losslessly thanks to the zstd compression algorithm. The compressed file can be installed with supported NSW Homebrew Title Installers.

  • This project does NOT incorporate any copyrighted material such as cryptographic keys. All keys must be provided by the user.
  • This project does NOT circumvent any technological protection measures. The NSZ file format purposely keeps all technological protection measures in place.
  • This project shall only be used for legally purchased games or homebrew applications.
  • This project is MIT licensed. Check LICENSE for more information.

Requirements

You need to have a hactool compatible keys file in a suitable directory to use this tool.

You must legally obtain your keys!

The keys file must be named either prod.keys or keys.txt. It must be located either in the directory in which you are running this software or:

OS Location
linux $HOME/.switch/, $XDG_CONFIG_HOME/nsz/, $HOME/.config/nsz/
macOS $HOME/.switch/
windows %USERPROFILE%/.switch/

You can also provide a custom keys path at runtime using the --keys /path/to/prod.keys parameter. This may be a direct path to the file or a directory containing prod.keys or keys.txt.

Running this tool

There are several ways to run this tool. Choose from one of the methods below.

Linux, Windows, and macOS binaries

You can find the binaries in the release page.

On most Linux systems you will need to right-click the file, open the properties, and choose to "Allow executing file as program".

Mac systems are much more strict about which software is allowed to be ran on the system. You must make the file executable from the terminal with chmod +x nsz-cli-macos or chmod +x nsz-gui-macos. After trying to run the program you will be stopped by security. Go to System Settings > Privacy & Security then scroll down and choose to allow running the program.

Running from source

Requires Python 3.6+.

This tool can be run from the source code.

  1. Run pip3 install -r requirements.txt to install the requirements or pip3 install -r requirements-gui.txt to install the requirements for the GUI.
  2. Run python3 nsz.py to start the program.

PIP Package

Requires Python 3.6+.

Use the following command to install the console-only version:

pip3 install --upgrade nsz

Use the following command to install the GUI version:

pip3 install --upgrade nsz[gui]

Android

  1. Install "Pydroid 3" and the "Pydroid repository plugin" from the Play Store
  2. Open "Pydroid 3" and navigate to "Pip"
  3. Enter "nsz" and unselect "use prebuild" then press install
  4. Navigate to "Terminal" to use the "nsz" command
  5. The first time it will tell you where to copy your prod.keys which you should do using the "cp" command
  6. Use any command line arguments you want like "nsz -D file.nsz" to decompress your application

Docker Container

NSZ is available as a Docker container with multi-architecture support for easy deployment and usage without needing to install Python.

The container provides:

  • Multi-architecture support: linux/amd64, linux/arm64, linux/arm/v7, linux/ppc64le
  • Optimized size: ~88MB Alpine-based image
  • Easy Nintendo Switch keys mounting
  • Shell-like command usage

For complete Docker setup, build instructions, and usage examples see container/README.md.

Quick example:

# Build for local testing
make -C container build-single-arch

# Use with your Nintendo Switch keys
docker run --rm -v "$(pwd)":/data -v "$HOME/.switch/prod.keys":/root/.switch/prod.keys nsz-tool:latest application.nsp

Usage

Comprehensive lists of command line parameters and usage examples are in the dedicated usage documentation.

To view all possible flags and their descriptions check the Usage section.

Automated bulk file operation examples are in scripts.

File Format Details

Explanations of the file formats introduced by NSZ are found in the formats documentation.

Contributing

If you are interested in reporting/fixing issues and contributing directly to the code base, please see CONTRIBUTING.md for more information on how to get started.

Mirrors

The Switzerland mirror will be the new home in case GitHub ever takes down this repository. Please bookmark it.

References

NSZ pip package: https://pypi.org/project/nsz/

Forum thread: https://gbatemp.net/threads/nsz-homebrew-compatible-nsp-xci-compressor-decompressor.550556/

License

Licensed under the MIT license.