[Tool] Samloader (SamFirm / Frija replacement)

Search This thread

raakaysh

Senior Member
Jan 15, 2009
398
448
Nowhere in India
Hi OP, I installed Python and PIP3 but when I try 'samloader checkupdate SM-G980F BTU', I get this:

The term 'samloader' is not recognized as the name of a cmdlet...

How to fix it?
 
Last edited:

ianmacd

Senior Member
Jan 5, 2016
2,331
3,723
Amsterdam
localhost
Hi OP, I installed Python and PIP3 but when I try 'samloader checkupdate SM-G980F BTU', I get this:

PS C:\Users\Rakesh Shukla\Desktop\samloader-master> samloader checkupdate SM-G980F BTU
samloader : The term 'samloader' is not recognized as the name of a cmdlet, function, script file, or operable
program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ samloader checkupdate SM-G980F BTU
+ ~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (samloader:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

How to fix it?

Add it to your command search path.
 

RKSTN

New member
Dec 2, 2020
4
0
When I tried to check for update I am getting not a recognized message in cmd. I have already installed Python and Pip. Help?
 

Sprotznock

New member
Mar 25, 2017
2
0
Thanks for this tool. Downloading worked well, but unfortunately decryption fails for me.

It looks that samloader sends a bad request to get the decryption key (http response code is 400). I added debug output of the response XML file and got this:

% python3 -m samloader -m SM-G975F -r DBT decrypt -v G973FXXU9DTJA/G973FOXM9DTJB/G973FXXU9DTJA/G973FXXU9DTJA -V 4 -i SM-G973F_1_20201028155733_c2t0wwhgfn_fac.zip.enc4 -o SM-G973F_1_20201028155733_c2t0wwhgfn_fac.zip

<?xml version="1.0" encoding="utf-8" ?>
<FUSMsg>
<FUSHdr>
<ProtoVer>1.0</ProtoVer>
<SessionID></SessionID>
<MsgID>1</MsgID>
</FUSHdr>
<FUSBody>
<Results>
<CmdRef>2</CmdRef>
<Status>400</Status>
</Results>
</FUSBody>
</FUSMsg>

Traceback (most recent call last):
File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/joern/.local/lib/python3.6/site-packages/samloader/__main__.py", line 6, in <module>
main()
File "/home/joern/.local/lib/python3.6/site-packages/samloader/main.py", line 58, in main
key = getkey(args.fw_ver, args.dev_model, args.dev_region)
File "/home/joern/.local/lib/python3.6/site-packages/samloader/crypt.py", line 23, in getv4key
fwver = root.find("./FUSBody/Results/LATEST_FW_VERSION/Data").text
AttributeError: 'NoneType' object has no attribute 'text'


Any idea what I can do here?

Thanks!
 

RKSTN

New member
Dec 2, 2020
4
0
Also works with Termux!

How to:
First enable the storage permission for Termux in "Settings > Apps > Termux > Permissions > Storage".
Now set up Termux to install Samloader with commands below.
Code:
pkg upgrade
pkg install git
pkg install python
pip install --upgrade pip
Now you can install Samloader
Code:
pip3 install git+https://github.com/nlscc/samloader.git
To update Samloader
Code:
pip3 install --upgrade git+https://github.com/nlscc/samloader.git

Example:
Check update
Code:
samloader -m SM-G975F -r NZC checkupdate
Download
Code:
samloader -m SM-G975F -r NZC download -v G975FXXS9DTI8/G975FOXM9DTI8/G975FXXS9DTI8/G975FXXS9DTI8 -O /storage/emulated/0/Download/
Decrypt
Code:
samloader -m SM-G975F -r NZC decrypt -v G975FXXS9DTI8/G975FOXM9DTI8/G975FXXS9DTI8/G975FXXS9DTI8 -V 4 -i /storage/emulated/0/Download/SM-G975F_1_20200921075534_uii8oafhih_fac.zip.enc4 -o /storage/emulated/0/Download/SM-G975F_1_20200921075534_uii8oafhih_fac.zip

Great info! I tried these steps but was getting a problem installing Python in Termux. Just found a tutorial and fixed the issue.


Thanks a lot for these instructions. :)
 

RKSTN

New member
Dec 2, 2020
4
0
Thanks for this tool. Downloading worked well, but unfortunately decryption fails for me.

It looks that samloader sends a bad request to get the decryption key (http response code is 400). I added debug output of the response XML file and got this:

% python3 -m samloader -m SM-G975F -r DBT decrypt -v G973FXXU9DTJA/G973FOXM9DTJB/G973FXXU9DTJA/G973FXXU9DTJA -V 4 -i SM-G973F_1_20201028155733_c2t0wwhgfn_fac.zip.enc4 -o SM-G973F_1_20201028155733_c2t0wwhgfn_fac.zip

<?xml version="1.0" encoding="utf-8" ?>
<FUSMsg>
<FUSHdr>
<ProtoVer>1.0</ProtoVer>
<SessionID></SessionID>
<MsgID>1</MsgID>
</FUSHdr>
<FUSBody>
<Results>
<CmdRef>2</CmdRef>
<Status>400</Status>
</Results>
</FUSBody>
</FUSMsg>

Traceback (most recent call last):
File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/joern/.local/lib/python3.6/site-packages/samloader/__main__.py", line 6, in <module>
main()
File "/home/joern/.local/lib/python3.6/site-packages/samloader/main.py", line 58, in main
key = getkey(args.fw_ver, args.dev_model, args.dev_region)
File "/home/joern/.local/lib/python3.6/site-packages/samloader/crypt.py", line 23, in getv4key
fwver = root.find("./FUSBody/Results/LATEST_FW_VERSION/Data").text
AttributeError: 'NoneType' object has no attribute 'text'


Any idea what I can do here?

Thanks!
Was the firmware download interrupted? This might be because the file is broken.
 

Sprotznock

New member
Mar 25, 2017
2
0
Was the firmware download interrupted? This might be because the file is broken.

I am pretty sure this doesn't matter since it doesn't come to any decryption attempt.

samloader fails downloading the decryption key from the API server with a HTTP status of 400.
 
Jan 22, 2020
5
1
FKN AWESOMEEEEE :cool: :cool: :cool: working on mint GENIUS WORK!!!!!
Captura de pantalla de 2021-02-09 19-59-26.png
 
  • Like
Reactions: vanquish28

vanquish28

Member
Sep 26, 2019
5
0
Working, but you have to change the decript version flag in the py command from 2 to 4, also for the model use XX-XXXX characters instead of XX-XXXX. I opened the issue at https://github.com/nlscc/samloader/issues/43.


/usr/bin/python3.8 /home/vanquish/.local/bin/samloader -m SM-T970 -r XAR checkupdate
T970XXU1BUAA/T970OXM1BUAA/T970XXU1BUAA/T970XXU1BUAA

/usr/bin/python3.8 /home/vanquish/.local/bin/samloader -m SM-T970 -r XAR download -v T970XXU1BUAA/T970OXM1BUAA/T970XXU1BUAA/T970XXU1BUAA -O .

downloading SM-T970_1_20210121210134_84ml313a23_fac.zip.enc4
[################################] 109073/109073 - 00:10:04



/usr/bin/python3.8 /home/vanquish/.local/bin/samloader -m SM-T970 -r XAR decrypt -v T970XXU1BUAA/T970OXM1BUAA/T970XXU1BUAA/T970XXU1BUAA -V 4 -i SM-T970_1_20210121210134_84ml313a23_fac.zip.enc4 -o SM-T970_1_20210121210134_84ml313a23_fac.zip

[################################] 1745162/1745162 - 00:00:27


unzip SM-T970_1_20210121210134_84ml313a23_fac.zip
Archive: SM-T970_1_20210121210134_84ml313a23_fac.zip
inflating: BL_T970XXU1BUAA_CL20748183_QB37638525_REV00_user_low_ship_MULTI_CERT.tar.md5
inflating: AP_T970XXU1BUAA_CL20748183_QB37638525_REV00_user_low_ship_MULTI_CERT_meta_OS11.tar.md5
inflating: HOME_CSC_OMC_OXM_T970OXM1BUAA_CL20748183_QB37638525_REV00_user_low_ship_MULTI_CERT.tar.md5
inflating: CSC_OMC_OXM_T970OXM1BUAA_CL20748183_QB37638525_REV00_user_low_ship_MULTI_CERT.tar.md5
 

geronimoge

Senior Member
Aug 4, 2016
500
117
I tried installing with the command found in the readme file
Code:
pip3 install git+https://github.com/nlscc/samloader.git
But when I type
Code:
$ samloader --help
It says "samloader: command not found"
Problems with "samloader: command not found" and Linux?
Try
$ python3 -m samloader
instead of using
$ samloader
as written here.
For me it helped.
So for example
$ python3 -m samloader --help
 

Top Liked Posts

  • There are no posts matching your filters.
  • 16
    Hello,
    I recently wanted to download some firmware for my Samsung device, but I realized that there is no 100% open source program to do so. In fact, all the tools that claim to do so require a library that is packed by Themida (so it is difficult to check what this might be doing), in order to authenticate to the server. This is a native DLL, meaning that it is only compatible with Windows x86. Additionally, many of these tools are actually using stolen decompiled code from SamFirm, which, apart from being possibly illegal, means they would be difficult to maintain and run slowly.
    So, I decided to reverse engineer Smart Switch to figure out exactly how the download is taking place, and wrote a cross-platform tool that does this without using the Windows DLL that the other tools have, making it compatible with Linux and MacOS. I also realized that the newer versions are actually using a new version of the authentication algorithm, meaning possibly at some point the old tools might stop working as Samsung drops support for it.
    You can find it at:
    Code:
    https://github.com/nlscc/samloader
    To install, go to the downloaded repository and run:
    Code:
    pip3 install .
    See the README or look at the code for usage. You might want to know that my old github account, nm111, was unfortunately deleted, and I lost access to my old XDA account. You can see the verified email is the same however.
    Feel free to use the algorithms I figured out in your own code, so long as you don't use it in proprietary programs. It is licensed under GNU GPLv3 or later.
    This works for all phones, not just S10+, but I couldn't find a better forum and this is where Frija posted.
    2
    I made a bash script to use with Termux which automates everything directly on your device.

    It even offers to install samloader and its dependencies if they are not already installed.

    You can check it out here:
    https://github.com/lekron42/samloader_termux
    2
    Also works with Termux!

    How to:
    First enable the storage permission for Termux in "Settings > Apps > Termux > Permissions > Storage".
    Now set up Termux to install Samloader with commands below.
    Code:
    pkg upgrade
    pkg install git
    pkg install python
    pip install --upgrade pip
    Now you can install Samloader
    Code:
    pip3 install git+https://github.com/nlscc/samloader.git
    To update Samloader
    Code:
    pip3 install --upgrade git+https://github.com/nlscc/samloader.git

    Example:
    Check update
    Code:
    samloader -m SM-G975F -r NZC checkupdate
    Download
    Code:
    samloader -m SM-G975F -r NZC download -v G975FXXS9DTI8/G975FOXM9DTI8/G975FXXS9DTI8/G975FXXS9DTI8 -O /storage/emulated/0/Download/
    Decrypt
    Code:
    samloader -m SM-G975F -r NZC decrypt -v G975FXXS9DTI8/G975FOXM9DTI8/G975FXXS9DTI8/G975FXXS9DTI8 -V 4 -i /storage/emulated/0/Download/SM-G975F_1_20200921075534_uii8oafhih_fac.zip.enc4 -o /storage/emulated/0/Download/SM-G975F_1_20200921075534_uii8oafhih_fac.zip
    1
    Thank you. This is pretty cool. I downloaded it now and will check it out later tonight.
    1
    FKN AWESOMEEEEE :cool: :cool: :cool: working on mint GENIUS WORK!!!!!
    Captura de pantalla de 2021-02-09 19-59-26.png
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone