The Custom Droid

Android Tutorials, Tips and Tricks

Samloader Tool – Cross-Platform Samsung Firmware Downloader

Samloader Tool - Cross-platform Samsung Stock Firmware Update Downloader

Samloader is a cross-platform replacement for firmware downloading tools like SamFirm and Frija. In this guide, we will show you how to download and use the Samloader Tool to download stock firmware updates for your Samsung Galaxy device.

Advertisement

Downloading Samsung Stock Firmware

Unlike many other Android device manufacturers, Samsung doesn’t make stock firmware packages for their Galaxy smartphones and tablets available for the end-users. Thus they do not officially provide the device-owners the ability to flash the software on their phones/tablets in any manner. The stock firmware file could be extremely helpful when dealing with/fixing software issues, for manually upgrading the Android software, and also for restoring the stock firmware to unroot and unbrick the device.

For a long time now, stock firmware update packages for Samsung devices have been made available unofficially through online databases such as SamMobile, Samfrew, Updato, etc. Since the firmware packages are quite large in size (2-6 GB) and online storage is an expensive resource (to say the least), these databases limit the download speeds for free downloads (which we think is fair).

Advertisement

This certainly made it difficult for users to quickly download the stock firmware for their Samsung Galaxy devices in moments of need. This issue was resolved with the release of the SamFirm tool, and the Frija tool after that. The said tools allow users to download Samsung stock firmware updates directly from Samsung’s official servers without any data speed caps.

About Samloader Tool

Enter “Samloader“, a cross-platform Samsung firmware downloader tool based on Python, developed by software engineer nlscc.

So how is Samloader different from SamFirm & Frija? There’s nothing wrong with these tools, they both still work fine and do their job well. However, there’s one particular limitation that comes to one’s mind when using these tools.

Both SamFirm or Frija tools WORK ONLY ON WINDOWS computers and are NOT OPEN-SOURCE. They use a particular library from Samsung’s Smart Switch software to authenticate with the Samsung Firmware Update Servers. The said library is protected by an advanced Windows software protector (Themida), which makes it extremely difficult to port these tools to other operating systems.

The developer (nlscc) reverse-engineered the download protocol used by Smart Switch and wrote a cross-platform tool known as “Samloader”. This means you can use Samloader to download stock firmware from Samsung servers on any computer with Windows, macOS, and Linux. Moreover, since it’s possible to use Python on Android as well, the tool could also be used on any Android device. We are already testing to see if it works and will update this page with more info regarding the matter.

The only little downside of using Samloader is the absence of a user-friendly GUI, something that’s offered by SamFirm and Frija tools. However, you might consider this as more of a learning curve than an actual downside. It will give you the basic idea of using Python-based tools, not just Samloader, but other useful tools as well, such as Payload Dumper.

Notes:

  • Certain carriers like Verizon and AT&T do not provide updates through the official Samsung servers, and thus cannot be downloaded using Samloader, or any other firmware downloader for that matter.
  • Also, firmware files for beta updates and Galaxy smartwatches (citation) are not published on the Samsung OTA servers, and thus cannot be downloaded.

Usage

Since its initial release, the tool’s syntax has been updated and is now comparatively easier to understand. If you are currently using a previous version, make sure to download the latest version of Samloader from Github and configure it again.

Below is a reference for the syntax used by Samloader to communicate with Samsung servers to download the stock firmware for your Galaxy device. (Source: Github README)

  1. Check the latest firmware version for your device model and region:
    samloader -m <model> -r <region> checkupdate
  2. Download the specified firmware version for a given phone and region to a specified file or directory:
    samloader -m <model> -r <region> download -v <version> -O <output-dir>
  3. Decrypt enc2 and enc4 encrypted firmware:
    samloader -m <model> -r <region> decrypt -v <version> -V <enc-version> -i <input-file> -o <output-file>

Update: Samloader with GUI

Samsung Firmware Download Tool GUI (based on Samloader)

XDA Recognized Developer Zacharee1 has built a new tool based on Samloader that offers a Graphical User Interface (GUI) for users who are not comfortable with using Command-line Interface (CLI).

This new tool is called – “Samsung Firmware Downloader“. It was released by the developer over the XDA-Developers forum and has already started receiving due attention and appreciation from the forum members.

But don’t we have GUI-based firmware downloading tools like Frija and SamFirm already? Yes. But they are not open-source, and more importantly, they only work on Windows. On the other hand, the new “Samsung Firmware Downloader” tool works across different platforms like Windows, Linux, macOS, and even Android.

Yes, you read that right, it supports Android as an app. Since Python can be installed, and Samloader is a Python-based program, it was already possible to use it on Android. But now, it gets even better as you don’t have to mess around with CLI commands and enjoy a user-friendly interface.

Of course, you have to download the tool depending on the platform you’re going to use it on – Windows, Linux/macOS, or Android. If you’re a developer who’d like to contribute to the project, then you can view the source code on GitHub.

This is an initial release, so you might face some issues. If you encounter bugs, please report them over at the GitHub Issues section.

How to Use Samloader to Download Firmware Updates for your Samsung Galaxy Device

Samloader tool works for all Samsung Galaxy smartphones and tablets, from the newer ones such as Galaxy S20 and Note 20 series, all the way back to the older devices.

Since the tool is Python-based, not everybody would know how to use it out-of-the-box. So, we have laid down step-by-step instructions below for an average user, to guide you from setting up Python on your computer to downloading and using the Samloader tool.

Without any further ado, let’s begin.

Step 1: Install and set up Python on your computer

Since the tool is written in Python, you’d first need to install and set up Python on your Windows, macOS, or Linux computer. To do this:

  • On Windows: Download the latest Python executable installer from this page and launch the installer by double-clicking the executable (.exe) file. Select ‘Add Python to the PATH’ option and click ‘Install Now’.
    Installing Python on Windows
  • On macOS: Download the macOS 64-bit installer from here and launch the downloaded package (.pkg) file. Follow the on-screen instructions shown in the installer window.
  • On Linux: You could install Python by compiling it from the source. We suggest you take a look at the instructions in this guide (credits: OpenSource.com)

Once you have installed Python, restart your computer to ensure that Python is added to the PATH variable.

Step 2: Download Samloader Tool from Github

The second step is to download the latest version of the Samloader tool to your PC. This can be done in the following two ways.

  1. You can either download the codebase from the official Github repository or using this direct link. Then extract the contents of the downloaded ZIP file to your computer.
    • For easy access, we would suggest that you move the ‘samloader-master’ folder to the root of the C:\ drive on a Windows PC and to the Desktop/Documents directory on a macOS/Linux PC.
      Extract Samloader ZIP file on the PC
  2. If you’re experienced with using Git, you can also clone the repo to your local machine using the following command:
    git clone https://github.com/nlscc/samloader

Step 3: Launch the Command-line Window

Now, you must open the command-line window on your PC inside the folder where the tool and its required files are present. Depending upon your PC’s operating system, follow the provided instructions.

  • Launching PowerShell in Windows: Open the “samloader-master” folder, hold the SHIFT key of your keyboard, and right-click on any empty space inside the folder. Then select “Open PowerShell window here”.
    Launch Windows PowerShell inside Samloader folder
  • Launching Terminal in macOS/Linux: Launch the Terminal and change its directory to the “samloader-master” folder using the cd command. For example, if the folder is located in the ‘Documents’ directory of your computer, the command should look like the following.
    cd Documents/samloader-master

At this point, everything on your computer is ready and you can now use the tool.

Step 4: Use Samloader Tool to download Samsung stock firmware

The fourth and final step of this guide is to use the Samloader Tool for downloading the stock firmware updates for your Samsung Galaxy device. To do this,

  1. First, install Samloader using the following command:
    pip3 install .

    Install Samloader using pip3 command

  2. Now, check for the latest firmware update for your Samsung Galaxy device using:
    samloader -m <model> -r <region> checkupdate
    • For example: If I want to check the latest update for the Galaxy S20 (SM-G980F) in the United Kingdom (BTU), then the command should look like:
      samloader -m SM-G980F -r BTU checkupdate
    • The command should output the firmware version, like so:
      G980FXXU5CTKG/G980FOXM5CTKF/G980FXXU5CTKF/G980FXXU5CTKG

      Check latest firmware update version using Samloader Checkupdate command

    • Copy the complete firmware version as displayed. You’d be needing it in the next command.
  3. Next, download the latest firmware update for your Samsung Galaxy device using:
    samloader -m <model> -r <region> download -v <version> -O <output-dir>
    • For example: If I want to download the latest firmware as outputted above for the SM-G980F in the ‘BTU’ region, in the same directory where the Samloader tool is. Then command should be:
      samloader -m SM-G980F -r BTU download -v G980FXXU5CTKG/G980FOXM5CTKF/G980FXXU5CTKF/G980FXXU5CTKG -O .
    • Samloader will now begin downloading the specified firmware version and the progress for the same will be shown in the command-line window.
      Download latest firmware for your Galaxy device using Samloader Download command
    • The firmware update file downloaded from the Samsung servers is decrypted in .enc2 format (for older devices) or .enc4 format (for newer devices). So, you must decrypt the firmware file into a regular (Odin flashable) .zip format.
  4. To decrypt the download enc2/enc4 firmware file, use the following command:
    samloader -m <model> -r <region> decrypt -v <version> -V <enc-version> -i <input-file> -o <output-file>
    • For example: If I want to decrypt the firmware file (SM-G980F_1_20201123140233_s5keav0epx_fac.zip.enc4) for my Galaxy S20 (SM-G980F) in the BTU region, the command should be:
      samloader -m SM-G980F -r BTU decrypt -v G980FXXU5CTKG/G980FOXM5CTKF/G980FXXU5CTKF/G980FXXU5CTKG -V 4 -i SM-G980F_1_20201123140233_s5keav0epx_fac.zip.enc4 -o SM-G980F_1_20201123140233_s5keav0epx_fac.zip

      Decrypt downloaded enc2/enc4 firmware using Samloader Decrypt command

Once done, you can extract the decrypted firmware update (.zip) to get the individual firmware files (AP, CP, CSC, BL, etc). From here on, you can download Odin and use it to flash the stock firmware update to your Galaxy device.

Extract decrypted firmware and flash it to your Galaxy device using Odin Flash Tool

Wrapping Up

Downloading the stock firmware files for Samsung smartphones and tablets is often confusing because the manufacturer doesn’t officially publish them online for end-users. Moreover, it is also troublesome, given that users ultimately had to rely on third-party online firmware databases, which offer slow download speeds. And that’s where firmware downloading utilities prove to be indespensible.

Samloader is indeed a great tool, for one it is open source, and two that it works across multiple platforms (Windows, macOS, Linux, and more). These things make it a better alternative to tools such as Frija and SamFirm. We would like to thank nlsccc and everybody else associated with the development of this tool.

If you’re a developer and wish to contribute to the project, you can create a pull request on the official Github repo. If you face any bugs/issues while using the tool, you can report them to the developer here. We already came around a minor bug and reported it, and the developer was extremely quick in fixing the issue and pushing it to Github.

Also, if you have questions regarding the tool’s usage, you can post a comment below or consult with the developer directly on the official XDA forum thread.

Via: XDA / Source: Github

About the Author

Founder and Editor-in-Chief

Dhananjay has more than 11 years of experience in Android software customization and development, and has spent the past 10 years writing about it. He spends most of his prime time reading, learning and writing about Android and other open-source projects. He is also a community-taught web developer. Apart from that, he loves mountain biking and playing video games on his PlayStation.

Leave a Reply

Comments are moderated, and published only if they are relevant to the topic and add value in a constructive way. If you disagree with something, please be polite and respectful. We suggest you read our comment policy before commenting.