mirror of
https://github.com/bkerler/mtkclient.git
synced 2025-03-02 00:14:09 -05:00
Giving better info while connecting to phone.
This commit is contained in:
parent
b10ac235bf
commit
3a143f3c46
4 changed files with 16 additions and 9 deletions
|
@ -118,7 +118,7 @@ sudo reboot
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
### Using MTKTools via the graphical user interface:
|
### Using MTKTools via the graphical user interface:
|
||||||
For the 'basics' you can use the GUI interface. This supports dumping partitions for now. Run the following command:
|
For the 'basics' you can use the GUI interface. This supports dumping partitions or the full flash for now. Run the following command:
|
||||||
```
|
```
|
||||||
python mtk_gui
|
python mtk_gui
|
||||||
```
|
```
|
||||||
|
|
13
mtk_gui
13
mtk_gui
|
@ -62,10 +62,13 @@ def getDevInfo(self, parameters):
|
||||||
|
|
||||||
mtkClass = devhandler.mtkClass
|
mtkClass = devhandler.mtkClass
|
||||||
da_handler = devhandler.da_handler
|
da_handler = devhandler.da_handler
|
||||||
|
try:
|
||||||
if mtkClass.port.cdc.connect() == False:
|
if mtkClass.port.cdc.connect() == False:
|
||||||
mtkClass.preloader.init()
|
mtkClass.preloader.init()
|
||||||
else:
|
else:
|
||||||
phoneInfo['cdcInit'] = True;
|
phoneInfo['cdcInit'] = True
|
||||||
|
except:
|
||||||
|
phoneInfo['cantConnect'] = True
|
||||||
phoneInfo['chipset'] = str(mtkClass.config.chipconfig.name) + \
|
phoneInfo['chipset'] = str(mtkClass.config.chipconfig.name) + \
|
||||||
" (" + str(mtkClass.config.chipconfig.description) + ")"
|
" (" + str(mtkClass.config.chipconfig.description) + ")"
|
||||||
self.sendUpdateSignal.emit()
|
self.sendUpdateSignal.emit()
|
||||||
|
@ -81,6 +84,9 @@ def getDevInfo(self, parameters):
|
||||||
else:
|
else:
|
||||||
phoneInfo['bootMode'] = "Preloader mode"
|
phoneInfo['bootMode'] = "Preloader mode"
|
||||||
self.sendUpdateSignal.emit()
|
self.sendUpdateSignal.emit()
|
||||||
|
else:
|
||||||
|
phoneInfo['cantConnect'] = True
|
||||||
|
self.sendUpdateSignal.emit()
|
||||||
# try:
|
# try:
|
||||||
# print(mtkClass.daloader.get_partition_data(parttype="user"))
|
# print(mtkClass.daloader.get_partition_data(parttype="user"))
|
||||||
# except Exception:
|
# except Exception:
|
||||||
|
@ -96,6 +102,9 @@ def sendToLog(info):
|
||||||
|
|
||||||
def updateGui():
|
def updateGui():
|
||||||
global phoneInfo
|
global phoneInfo
|
||||||
|
if (phoneInfo['cdcInit'] and phoneInfo['bootMode'] == "" ):
|
||||||
|
mainwindow.phoneInfoTextbox.setText("Phone detected:\nReading model info...")
|
||||||
|
else:
|
||||||
mainwindow.phoneInfoTextbox.setText("Phone detected:\n" + phoneInfo['chipset'] + "\n" + phoneInfo['bootMode'])
|
mainwindow.phoneInfoTextbox.setText("Phone detected:\n" + phoneInfo['chipset'] + "\n" + phoneInfo['bootMode'])
|
||||||
mainwindow.status.setText("Device detected, please wait.\nThis can take a while...")
|
mainwindow.status.setText("Device detected, please wait.\nThis can take a while...")
|
||||||
if phoneInfo['daInit']:
|
if phoneInfo['daInit']:
|
||||||
|
@ -106,7 +115,7 @@ def updateGui():
|
||||||
spinnerAnim.stop()
|
spinnerAnim.stop()
|
||||||
mainwindow.spinner_pic.setHidden(True)
|
mainwindow.spinner_pic.setHidden(True)
|
||||||
else:
|
else:
|
||||||
if not phoneInfo['cdcInit']:
|
if 'cantConnect' in phoneInfo:
|
||||||
mainwindow.status.setText("Error initialising. Did you install the drivers?")
|
mainwindow.status.setText("Error initialising. Did you install the drivers?")
|
||||||
spinnerAnim.start()
|
spinnerAnim.start()
|
||||||
mainwindow.spinner_pic.setHidden(False)
|
mainwindow.spinner_pic.setHidden(False)
|
||||||
|
|
|
@ -198,7 +198,6 @@ class Ui_MainWindow(object):
|
||||||
self.menubar.addAction(self.toolsFlashMenu.menuAction())
|
self.menubar.addAction(self.toolsFlashMenu.menuAction())
|
||||||
self.readFlashMenu.addAction(self.actionRead_partition_s)
|
self.readFlashMenu.addAction(self.actionRead_partition_s)
|
||||||
self.readFlashMenu.addAction(self.actionRead_full_flash)
|
self.readFlashMenu.addAction(self.actionRead_full_flash)
|
||||||
self.readFlashMenu.addAction(self.actionRead_offset)
|
|
||||||
self.writeFlashMenu.addAction(self.actionWrite_partition_s)
|
self.writeFlashMenu.addAction(self.actionWrite_partition_s)
|
||||||
self.writeFlashMenu.addAction(self.actionWrite_full_flash)
|
self.writeFlashMenu.addAction(self.actionWrite_full_flash)
|
||||||
self.writeFlashMenu.addAction(self.actionWrite_at_offset)
|
self.writeFlashMenu.addAction(self.actionWrite_at_offset)
|
||||||
|
|
|
@ -413,7 +413,6 @@
|
||||||
</property>
|
</property>
|
||||||
<addaction name="actionRead_partition_s"/>
|
<addaction name="actionRead_partition_s"/>
|
||||||
<addaction name="actionRead_full_flash"/>
|
<addaction name="actionRead_full_flash"/>
|
||||||
<addaction name="actionRead_offset"/>
|
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QMenu" name="writeFlashMenu">
|
<widget class="QMenu" name="writeFlashMenu">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
|
|
Loading…
Reference in a new issue