Skip to content

Conversation

@am97
Copy link

@am97 am97 commented Jul 12, 2023

The firts commit updates pyusb to version 1.2.1 in order to support newer Python versions (tested with Python 3.10)

The second commit fixes a regression from #1 for Cat B35. KaiOS Nokias / Alcatel Cingular Flip should still work by toggling '-non-standard-responses'

For the record, this is what I get with the first commit and without the second:

am@Host-002:~/github/edl$ python edl.py -loader 0x000940e100000000.mbn -printgpt

Qualcomm Sahara / Firehose Client (c) B.Kerler 2018-2019.


Using loader 0x000940e100000000.mbn ...
Waiting for the device
Device detected :)
Mode detected: Firehose
TargetName=MSM8909
MemoryName=eMMC
Version=1

Reading from physical partition 0, sector 0, sectors 32
Progress: |██████████████████████████████████████████████████| 100.0% Complete
Invalid or unknown GPT magic.

GPT Table:
-------------
Traceback (most recent call last):
  File "/home/am/github/edl/edl.py", line 419, in <module>
    main()
  File "/home/am/github/edl/edl.py", line 205, in main
    guid_gpt.print()
  File "/home/am/github/edl/Library/gpt.py", line 184, in print
    for partition in self.partentries:
AttributeError: 'gpt' object has no attribute 'partentries'. Did you mean: 'num_part_entries'?

am97 added 2 commits July 12, 2023 17:18
pyusb 1.1.0 does not work on newer Python versions.

For example, with Python 3.10 and Cat B35, I got the following:

am@Host-002:~/github/edl$ python edl.py -loader 0x000940e100000000.mbn -printgpt

Qualcomm Sahara / Firehose Client (c) B.Kerler 2018-2019.

Using loader 0x000940e100000000.mbn ...
Waiting for the device
Device detected :)
Mode detected: Sahara

------------------------
HWID:              0x000940e100000000 (MSM_ID:0x000940e1,OEM_ID:0x0000,MODEL_ID:0x0000)
PK_HASH:           0xcc3153a80293939b90d02d3bf8b23e0292e452fef662c74998421adad42a380f
Serial:            0x0fd85d74
SBL Version:       0x00000000

Successfully uploaded programmer :)
Traceback (most recent call last):
  File "/home/am/.local/lib/python3.10/site-packages/usb/_interop.py", line 94, in as_array
    return array.array('B', data)
TypeError: cannot use a str to initialize an array with typecode 'B'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/am/github/edl/edl.py", line 419, in <module>
    main()
  File "/home/am/github/edl/edl.py", line 191, in main
    info=fh.connect(0)
  File "/home/am/github/edl/Library/firehose.py", line 340, in connect
    rsp=self.xmlsend(data)
  File "/home/am/github/edl/Library/firehose.py", line 66, in xmlsend
    self.cdc.write(data,self.cfg.MaxXMLSizeInBytes)
  File "/home/am/github/edl/Library/usb.py", line 61, in write
    self.device.write(self.EP_OUT,command[pos:pos+pktsize])
  File "/home/am/.local/lib/python3.10/site-packages/usb/core.py", line 981, in write
    _interop.as_array(data),
  File "/home/am/.local/lib/python3.10/site-packages/usb/_interop.py", line 99, in as_array
    a.fromstring(data) # deprecated since 3.2
AttributeError: 'array.array' object has no attribute 'fromstring'
Since the merge of plugnburn#1 this project no longer works on Cat B35. This commit adds a '-non-standard-responses' option, false by default (restores the behavior before the PR). KaiOS Nokias / Alcatel Cingular Flip should still work by toggling '-non-standard-responses'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant