martinetd / samloader

Download Samsung firmware from official servers
GNU General Public License v3.0
29 stars 7 forks source link

Exception: getlogiccheck() input too short #8

Closed dbedrenko closed 10 months ago

dbedrenko commented 10 months ago

Description

Using the latest samloader version I get an exception when trying to download firmware for my tablet.

Reproduction Steps

$ mkdir fw
$  samloader  -m SM-T835 -r BTU  -i INSERT_YOUR_IMEI_HERE download -v T835XXU5CVG2 -O fw

Output

Traceback (most recent call last):
  File "/usr/bin/samloader", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/lib/python3.11/site-packages/samloader/main.py", line 43, in main
    path, filename, size = getbinaryfile(client, args.fw_ver, args.dev_model, args.dev_imei, args.dev_region)
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/samloader/main.py", line 99, in getbinaryfile
    req = request.binaryinform(fw, model, region, imei, client.nonce)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/samloader/request.py", line 44, in binaryinform
    "LOGIC_CHECK": getlogiccheck(fwv, nonce)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/samloader/request.py", line 11, in getlogiccheck
    raise Exception("getlogiccheck() input too short")
Exception: getlogiccheck() input too short

Environment

ArchLinux, using this package. Python v3.11.6

martinetd commented 10 months ago

Will have a look later but:

INSERT_YOUR_IMEI_HERE ^ make this impossible to reproduce

You can either strip the last few digits of your imei to get a randomized serial or use a site like https://www.imei.info/samsung_imei_generator/ to get a "more random" one that has a chance of passing the samsung check -- please give me a command I can actually run

martinetd commented 10 months ago

Ah in this case it's probably just that your version is too short btw

running checkupdate with the same model/zone gets me T835XXU5CVG2/T835OXM5CVG2/T835XXU5CVG1/T835XXU5CVG2 and using that as -v option fails the imei check

dbedrenko commented 10 months ago

Ah yes, you're right. I thought it needed just 1 model, but it needs all variants and then it works. Thank you

martinetd commented 10 months ago

I'll improve the message a bit when time allows