bkerler / edl

Inofficial Qualcomm Firehose / Sahara / Streaming / Diag Tools :)
GNU General Public License v3.0
1.67k stars 388 forks source link

AttributeError: 'NoneType' object has no attribute 'generatetoken' #237

Open ikeboy opened 2 years ago

ikeboy commented 2 years ago

Trying to erase boot partition on a Oneplus 9 Pro, and get

edl e boot_b --lun=4

program,read,nop,patch,configure,setbootablestoragedrive,erase,power,firmwarewrite,getstorageinfo,benchmark,emmc,ufs,fixgpt,getsha256digest,demacia,setprojmodel,SetNetType
firehose - 
Erasing from physical partition 4, sector 538267, sectors 49152
Traceback (most recent call last):
  File "/usr/local/bin/edl", line 4, in <module>
    __import__('pkg_resources').run_script('edlclient==3.60', 'edl')
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 651, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 1448, in run_script
    exec(code, namespace, namespace)
  File "/usr/local/lib/python3.9/dist-packages/edlclient-3.60-py3.9.egg/EGG-INFO/scripts/edl", line 380, in <module>
    base.run()
  File "/usr/local/lib/python3.9/dist-packages/edlclient-3.60-py3.9.egg/EGG-INFO/scripts/edl", line 376, in run
    fh.handle_firehose(cmd, options)
  File "/usr/local/lib/python3.9/dist-packages/edlclient-3.60-py3.9.egg/edlclient/Library/firehose_client.py", line 798, in handle_firehose
    self.firehose.cmd_erase(lun, partition.sector, partition.sectors)
  File "/usr/local/lib/python3.9/dist-packages/edlclient-3.60-py3.9.egg/edlclient/Library/firehose.py", line 566, in cmd_erase
    data += self.modules.addprogram()
  File "/usr/local/lib/python3.9/dist-packages/edlclient-3.60-py3.9.egg/edlclient/Library/Modules/init.py", line 66, in addprogram
    return self.ops.addprogram()
  File "/usr/local/lib/python3.9/dist-packages/edlclient-3.60-py3.9.egg/edlclient/Library/Modules/oneplus.py", line 239, in addprogram
    pk, token = self.ops.generatetoken(True)
AttributeError: 'NoneType' object has no attribute 'generatetoken'

Trying to fix a bricked phone, just writing the boot partitions isn't helping so trying to erase and reflash them.

rkorn86 commented 2 years ago

I have the same problem on my OnePlus 8 Pro. Do you need some more information to fix this issue?

mewzik86 commented 2 years ago

I have a Oneplus 9 TMO (LE2117). Also came across this bug. Tracked it down to: if projid == "": res = self.fh.detect_partition(arguments=args, partitionname="param") lines 140. 141 in oneplus.py. It seems like this method returns false and the projid is blank when self.ops = self.convert_projid(fh, projid, serial) is called on line 161. So the that method returns None.

This only seem to occur for me when truing to "wl" on any lun other than lun0. (is it because the partitionname="param" only exixts on lun0?)