bkerler / Loaders

EDL Loaders
298 stars 90 forks source link

getstorageinfo:: AttributeError: 'dict' object has no attribute 'split' #61

Closed quickdraw6906 closed 1 year ago

quickdraw6906 commented 1 year ago

Partial output including error:

-----------------
program,read,nop,patch,configure,setbootablestoragedrive,erase,power,firmwarewrite,getstorageinfo,benchmark,emmc,ufs,fixgpt,getsha256digest,gethwversion,getrfversion,getprjversion,setprojmodel,demacia,sha256init,sha256final,eraseuserdata
oneplus - Oneplus protection with prjid 18821 detected
firehose - GetStorageInfo:
--------------------

Traceback (most recent call last):
  File "/Users/sean/OnePlus 7 Pro/root/edl/./edl", line 391, in <module>
    base.run()
  File "/Users/sean/OnePlus 7 Pro/root/edl/./edl", line 386, in run
    fh.handle_firehose(cmd, options)
  File "/Users/sean/OnePlus 7 Pro/root/edl/edlclient/Library/firehose_client.py", line 647, in handle_firehose
    return self.firehose.cmd_getstorageinfo_string()
  File "/Users/sean/OnePlus 7 Pro/root/edl/edlclient/Library/firehose.py", line 1308, in cmd_getstorageinfo_string
    data = self.xml.getlog(val.data)
  File "/Users/sean/OnePlus 7 Pro/root/edl/edlclient/Library/xmlparser.py", line 29, in getlog
    lines = input.split(b"<?xml")
AttributeError: 'dict' object has no attribute 'split'

The issue is getstorageinfo is returnin JSON:

{'value': 'ACK', 'rawmode': 'false'}

Changing getlog() to this:

  def getlog(self, input):
        data = []
        try:
          lines = input.split(b"<?xml")
        except Exception:
            data.append(input)
            return data
   snip...
quickdraw6906 commented 1 year ago

Sorry. Wrong repo