mirror of
https://github.com/bkerler/mtkclient.git
synced 2024-11-15 03:35:00 -05:00
Improve gui
This commit is contained in:
parent
535e2c2ee2
commit
eb07ebdc6b
4 changed files with 683 additions and 137 deletions
175
mtk_gui
175
mtk_gui
|
@ -20,6 +20,7 @@ from mtkclient.gui.readFlashPartitions import *
|
|||
from mtkclient.gui.toolsMenu import *
|
||||
from mtkclient.gui.toolkit import *
|
||||
from mtkclient.config.payloads import pathconfig
|
||||
from mtkclient.gui.main_gui import *
|
||||
# TO do Move all GUI modifications to signals!
|
||||
|
||||
class guiLogger:
|
||||
|
@ -95,28 +96,28 @@ def getDevInfo(self, parameters):
|
|||
|
||||
def sendToLog(info):
|
||||
t = time.localtime()
|
||||
logBox.appendPlainText(time.strftime("[%H:%M:%S", t) + "]: " + info)
|
||||
logBox.verticalScrollBar().setValue(logBox.verticalScrollBar().maximum())
|
||||
mainwindow.logBox.appendPlainText(time.strftime("[%H:%M:%S", t) + "]: " + info)
|
||||
mainwindow.logBox.verticalScrollBar().setValue(mainwindow.logBox.verticalScrollBar().maximum())
|
||||
|
||||
|
||||
def updateGui():
|
||||
global phoneInfo
|
||||
phoneInfoTextbox.setText("Phone detected:\n" + phoneInfo['chipset'] + "\n" + phoneInfo['bootMode'])
|
||||
status.setText("Device detected, please wait.\nThis can take a while...")
|
||||
mainwindow.phoneInfoTextbox.setText("Phone detected:\n" + phoneInfo['chipset'] + "\n" + phoneInfo['bootMode'])
|
||||
mainwindow.status.setText("Device detected, please wait.\nThis can take a while...")
|
||||
if phoneInfo['daInit']:
|
||||
status.setText("Device connected :)")
|
||||
menuBar.setEnabled(True)
|
||||
mainwindow.status.setText("Device connected :)")
|
||||
mainwindow.menubar.setEnabled(True)
|
||||
pixmap = QPixmap(path.get_images_path("phone_connected.png")).scaled(128, 128,
|
||||
Qt.KeepAspectRatio, Qt.SmoothTransformation)
|
||||
pixmap.setDevicePixelRatio(2.0)
|
||||
pic.setPixmap(pixmap)
|
||||
mainwindow.pic.setPixmap(pixmap)
|
||||
spinnerAnim.stop()
|
||||
spinner_pic.setHidden(True)
|
||||
mainwindow.spinner_pic.setHidden(True)
|
||||
else:
|
||||
if not phoneInfo['cdcInit']:
|
||||
status.setText("Error initialising. Did you install the drivers?")
|
||||
mainwindow.status.setText("Error initialising. Did you install the drivers?")
|
||||
spinnerAnim.start()
|
||||
spinner_pic.setHidden(False)
|
||||
mainwindow.spinner_pic.setHidden(False)
|
||||
|
||||
|
||||
def openReadflashWindow(q):
|
||||
|
@ -136,6 +137,8 @@ if __name__ == '__main__':
|
|||
# Init the app window
|
||||
app = QApplication(sys.argv)
|
||||
win = QMainWindow()
|
||||
mainwindow=Ui_MainWindow()
|
||||
mainwindow.setupUi(win)
|
||||
icon = QIcon()
|
||||
icon.addFile(path.get_images_path('logo_32.png'), QSize(32, 32))
|
||||
icon.addFile(path.get_images_path('logo_64.png'), QSize(64, 64))
|
||||
|
@ -153,83 +156,34 @@ if __name__ == '__main__':
|
|||
addTopMargin = 20
|
||||
if sys.platform.startswith('darwin'): # MacOS has the toolbar in the top bar insted of in the app...
|
||||
addTopMargin = 0
|
||||
win.setFixedSize(600, 400 + addTopMargin)
|
||||
#win.setFixedSize(600, 400 + addTopMargin)
|
||||
w = QWidget(win)
|
||||
w.move(0,addTopMargin)
|
||||
|
||||
w.setFixedSize(600, 400)
|
||||
win.setWindowTitle("MTKClient - Version 2.0 beta")
|
||||
# lay = QVBoxLayout(self)
|
||||
|
||||
# Menubar
|
||||
menuBar = QMenuBar()
|
||||
menuBar.setEnabled(False)
|
||||
win.setMenuBar(menuBar)
|
||||
readFlashMenu = menuBar.addMenu("&Read Flash")
|
||||
readFlashMenu.addAction("Read partition(s)")
|
||||
# readPartitions = QAction("Read partition(s)", w)
|
||||
# readFlashMenu.addAction(readPartitions)
|
||||
readFlashMenu.triggered[QAction].connect(openReadflashWindow)
|
||||
readFlashMenu.addAction("Read full flash")
|
||||
readFlashMenu.addAction("Read offset")
|
||||
|
||||
writeFlashMenu = menuBar.addMenu("&Write Flash")
|
||||
writeFlashMenu.addAction("Write partition(s)")
|
||||
writeFlashMenu.addAction("Write full flash")
|
||||
writeFlashMenu.addAction("Write offset")
|
||||
|
||||
eraseFlashMenu = menuBar.addMenu("&Erase Flash")
|
||||
eraseFlashMenu.addAction("Erase partition(s)")
|
||||
eraseFlashMenu.addAction("Erase bootsectors")
|
||||
|
||||
toolsFlashMenu = menuBar.addMenu("&Tools")
|
||||
toolsFlashMenu.addAction("Read RPMB")
|
||||
toolsFlashMenu.triggered[QAction].connect(openToolsMenu)
|
||||
toolsFlashMenu.addAction("Generate RPMB keys")
|
||||
menuBar.show()
|
||||
|
||||
# titles
|
||||
title = QLabel(w)
|
||||
title.setText("MTKClient v2.0")
|
||||
title.setGeometry(10, 0, 480, 40)
|
||||
title.setStyleSheet("font-size: 17px")
|
||||
title.show()
|
||||
|
||||
# status info
|
||||
status = QLabel(w)
|
||||
status.setAlignment(Qt.AlignLeft | Qt.AlignTop)
|
||||
status.setText("Please connect a Mediatek phone to continue.\n\nHint: Power off the phone before connecting.\n" + \
|
||||
"For brom mode, press and hold vol up, vol dwn, or all hw buttons " + \
|
||||
"and connect usb.\n" +
|
||||
"For preloader mode, don't press any hw button and connect usb.")
|
||||
status.setGeometry(10, 30, 465, 256)
|
||||
status.setWordWrap(True)
|
||||
status.setStyleSheet("font-size: 12px vertical-align: top")
|
||||
status.show()
|
||||
|
||||
# Device info
|
||||
# phone icon
|
||||
pic = QLabel(w)
|
||||
pixmap = QPixmap(path.get_images_path('phone_notfound.png')).scaled(128, 128, Qt.AspectRatioMode.KeepAspectRatio,
|
||||
Qt.TransformationMode.SmoothTransformation)
|
||||
pixmap.setDevicePixelRatio(2.0)
|
||||
pic.setPixmap(pixmap)
|
||||
pic.resize(pixmap.width() // 2, pixmap.height() // 2)
|
||||
pic.move(545, 10)
|
||||
pic.show()
|
||||
mainwindow.readFlashMenu.triggered[QAction].connect(openReadflashWindow)
|
||||
mainwindow.toolsFlashMenu.triggered[QAction].connect(openToolsMenu)
|
||||
|
||||
# phone spinner
|
||||
spinner_pic = QLabel(w)
|
||||
pixmap = QPixmap(path.get_images_path("phone_loading.png")).scaled(64, 64, Qt.AspectRatioMode.KeepAspectRatio,
|
||||
Qt.TransformationMode.SmoothTransformation)
|
||||
pixmap.setDevicePixelRatio(2.0)
|
||||
# trans = QTransform()
|
||||
# trans.rotate(90)
|
||||
spinner_pic.setPixmap(pixmap)
|
||||
spinner_pic.resize(pixmap.width() // 2, pixmap.height() // 2)
|
||||
spinner_pic.move(551, 25)
|
||||
spinner_pic.show()
|
||||
mainwindow.spinner_pic.setPixmap(pixmap)
|
||||
mainwindow.spinner_pic.resize(pixmap.width() // 2, pixmap.height() // 2)
|
||||
#mainwindow.spinner_pic.move(551, 25)
|
||||
mainwindow.spinner_pic.show()
|
||||
|
||||
nfpixmap = QPixmap(path.get_images_path("phone_notfound.png")).scaled(128, 128,
|
||||
Qt.KeepAspectRatio, Qt.SmoothTransformation)
|
||||
mainwindow.pic.setPixmap(nfpixmap)
|
||||
|
||||
logo = QPixmap(path.get_images_path("logo_256.png")).scaled(128, 128,
|
||||
Qt.KeepAspectRatio, Qt.SmoothTransformation)
|
||||
mainwindow.logoPic.setPixmap(logo)
|
||||
mainwindow.logBox.setHidden(True)
|
||||
|
||||
def spinnerAnimRot(angle):
|
||||
# print(angle)
|
||||
|
@ -242,7 +196,7 @@ if __name__ == '__main__':
|
|||
xoffset = (newPixmap.width() - pixmap.width()) // 2
|
||||
yoffset = (newPixmap.height() - pixmap.height()) // 2
|
||||
rotated = newPixmap.copy(ax=xoffset, ay=yoffset, awidth=pixmap.width(), aheight=pixmap.height())
|
||||
spinner_pic.setPixmap(rotated)
|
||||
mainwindow.spinner_pic.setPixmap(rotated)
|
||||
|
||||
|
||||
spinnerAnim = QVariantAnimation()
|
||||
|
@ -251,73 +205,20 @@ if __name__ == '__main__':
|
|||
spinnerAnim.setEndValue(360)
|
||||
spinnerAnim.setLoopCount(-1)
|
||||
spinnerAnim.valueChanged.connect(spinnerAnimRot)
|
||||
spinner_pic.setHidden(True)
|
||||
|
||||
# phone info
|
||||
phoneInfoTextbox = QLabel(w)
|
||||
phoneInfoTextbox.setText("No phone found")
|
||||
phoneInfoTextbox.setGeometry(10, 10, 520, 100)
|
||||
phoneInfoTextbox.setAlignment(Qt.AlignRight | Qt.AlignTop)
|
||||
phoneInfoTextbox.setStyleSheet("font-size: 12px")
|
||||
phoneInfoTextbox.show()
|
||||
|
||||
# Line
|
||||
line = QFrame(w)
|
||||
line.setGeometry(10, 108, 580, 20)
|
||||
line.setFrameShape(QFrame.HLine)
|
||||
line.setFrameShadow(QFrame.Sunken)
|
||||
|
||||
# logo
|
||||
logoPic = QLabel(w)
|
||||
logoPixmap = QPixmap(path.get_images_path("logo_512.png")).scaled(int(128 * dpiMultiplier), int(128 * dpiMultiplier),
|
||||
Qt.AspectRatioMode.KeepAspectRatio,
|
||||
Qt.TransformationMode.SmoothTransformation)
|
||||
logoPixmap.setDevicePixelRatio(dpiMultiplier)
|
||||
logoPic.setPixmap(logoPixmap)
|
||||
logoPic.resize(logoPixmap.width() // dpiMultiplier, logoPixmap.height() // dpiMultiplier)
|
||||
logoPic.move(10, 130)
|
||||
logoPic.show()
|
||||
|
||||
# Copyright info
|
||||
copyrightInfo = QLabel(w)
|
||||
copyrightInfo.setAlignment(Qt.AlignLeft | Qt.AlignTop)
|
||||
copyrightInfo.setText("Made by: Bjoern Kerler\n" + \
|
||||
"Gui by: Geert-Jan Kreileman\n\n" + \
|
||||
"Credits: \n" + \
|
||||
"kamakiri [xyzz]\n" +
|
||||
"linecode exploit [chimera]\n" +
|
||||
"Chaosmaster\n" +
|
||||
"and all contributers")
|
||||
copyrightInfo.setGeometry(150,135,405,256)
|
||||
copyrightInfo.setWordWrap(True)
|
||||
copyrightInfo.setStyleSheet("font-size: 12px color: #333 vertical-align: top")
|
||||
copyrightInfo.show()
|
||||
|
||||
mainwindow.spinner_pic.setHidden(True)
|
||||
|
||||
def showDebugInfo():
|
||||
logBox.show()
|
||||
if w.frameGeometry().height() < 500:
|
||||
win.setFixedSize(600, 700 + addTopMargin)
|
||||
w.setFixedSize(600, 700)
|
||||
debugBtn.setText("Hide debug info")
|
||||
if mainwindow.logBox.isHidden():
|
||||
mainwindow.logBox.setHidden(False)
|
||||
mainwindow.debugBtn.setText("Hide debug info")
|
||||
else:
|
||||
w.setFixedSize(600, 400)
|
||||
win.setFixedSize(600, 400 + addTopMargin)
|
||||
debugBtn.setText("Show debug info")
|
||||
|
||||
|
||||
# debug
|
||||
debugBtn = QPushButton(w)
|
||||
debugBtn.setText("Show debug info")
|
||||
debugBtn.clicked.connect(showDebugInfo)
|
||||
debugBtn.setGeometry((600 - 150 - 10), (400 - 30 - 10), 150, 30)
|
||||
debugBtn.show()
|
||||
|
||||
logBox = QPlainTextEdit(w)
|
||||
logBox.setGeometry(11, (700 - 280 - 10), 578, 280)
|
||||
logBox.setWordWrapMode(QTextOption.NoWrap)
|
||||
logBox.setReadOnly(True)
|
||||
mainwindow.logBox.setHidden(True)
|
||||
mainwindow.debugBtn.setText("Show debug info")
|
||||
|
||||
mainwindow.debugBtn.clicked.connect(showDebugInfo)
|
||||
mainwindow.logBox.setWordWrapMode(QTextOption.NoWrap)
|
||||
mainwindow.menubar.setEnabled(False)
|
||||
win.show()
|
||||
|
||||
# Get the device info
|
||||
|
|
2
mtkclient/gui/create_gui.sh
Executable file
2
mtkclient/gui/create_gui.sh
Executable file
|
@ -0,0 +1,2 @@
|
|||
#!/bin/sh
|
||||
pyside2-uic main_gui.ui > main_gui.py
|
259
mtkclient/gui/main_gui.py
Normal file
259
mtkclient/gui/main_gui.py
Normal file
|
@ -0,0 +1,259 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
################################################################################
|
||||
## Form generated from reading UI file 'main_gui.ui'
|
||||
##
|
||||
## Created by: Qt User Interface Compiler version 5.15.2
|
||||
##
|
||||
## WARNING! All changes made in this file will be lost when recompiling UI file!
|
||||
################################################################################
|
||||
|
||||
from PySide2.QtCore import *
|
||||
from PySide2.QtGui import *
|
||||
from PySide2.QtWidgets import *
|
||||
|
||||
|
||||
class Ui_MainWindow(object):
|
||||
def setupUi(self, MainWindow):
|
||||
if not MainWindow.objectName():
|
||||
MainWindow.setObjectName(u"MainWindow")
|
||||
MainWindow.resize(689, 648)
|
||||
self.actionRead_partition_s = QAction(MainWindow)
|
||||
self.actionRead_partition_s.setObjectName(u"actionRead_partition_s")
|
||||
self.actionRead_full_flash = QAction(MainWindow)
|
||||
self.actionRead_full_flash.setObjectName(u"actionRead_full_flash")
|
||||
self.actionRead_offset = QAction(MainWindow)
|
||||
self.actionRead_offset.setObjectName(u"actionRead_offset")
|
||||
self.actionWrite_partition_s = QAction(MainWindow)
|
||||
self.actionWrite_partition_s.setObjectName(u"actionWrite_partition_s")
|
||||
self.actionWrite_full_flash = QAction(MainWindow)
|
||||
self.actionWrite_full_flash.setObjectName(u"actionWrite_full_flash")
|
||||
self.actionWrite_at_offset = QAction(MainWindow)
|
||||
self.actionWrite_at_offset.setObjectName(u"actionWrite_at_offset")
|
||||
self.actionErase_partitions_s = QAction(MainWindow)
|
||||
self.actionErase_partitions_s.setObjectName(u"actionErase_partitions_s")
|
||||
self.actionErase_at_offset = QAction(MainWindow)
|
||||
self.actionErase_at_offset.setObjectName(u"actionErase_at_offset")
|
||||
self.actionRead_RPMB = QAction(MainWindow)
|
||||
self.actionRead_RPMB.setObjectName(u"actionRead_RPMB")
|
||||
self.actionWrite_RPMB = QAction(MainWindow)
|
||||
self.actionWrite_RPMB.setObjectName(u"actionWrite_RPMB")
|
||||
self.actionRead_preloader = QAction(MainWindow)
|
||||
self.actionRead_preloader.setObjectName(u"actionRead_preloader")
|
||||
self.actionGenerate_RPMB_Keys = QAction(MainWindow)
|
||||
self.actionGenerate_RPMB_Keys.setObjectName(u"actionGenerate_RPMB_Keys")
|
||||
self.centralwidget = QWidget(MainWindow)
|
||||
self.centralwidget.setObjectName(u"centralwidget")
|
||||
self.formLayout = QFormLayout(self.centralwidget)
|
||||
self.formLayout.setObjectName(u"formLayout")
|
||||
self.horizontalLayout_3 = QHBoxLayout()
|
||||
self.horizontalLayout_3.setObjectName(u"horizontalLayout_3")
|
||||
self.verticalLayout_2 = QVBoxLayout()
|
||||
self.verticalLayout_2.setObjectName(u"verticalLayout_2")
|
||||
self.title = QLabel(self.centralwidget)
|
||||
self.title.setObjectName(u"title")
|
||||
font = QFont()
|
||||
font.setPointSize(17)
|
||||
font.setBold(True)
|
||||
font.setWeight(75)
|
||||
self.title.setFont(font)
|
||||
|
||||
self.verticalLayout_2.addWidget(self.title)
|
||||
|
||||
self.status = QLabel(self.centralwidget)
|
||||
self.status.setObjectName(u"status")
|
||||
sizePolicy = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.status.sizePolicy().hasHeightForWidth())
|
||||
self.status.setSizePolicy(sizePolicy)
|
||||
|
||||
self.verticalLayout_2.addWidget(self.status)
|
||||
|
||||
|
||||
self.horizontalLayout_3.addLayout(self.verticalLayout_2)
|
||||
|
||||
self.verticalLayout = QVBoxLayout()
|
||||
self.verticalLayout.setObjectName(u"verticalLayout")
|
||||
self.horizontalLayout = QHBoxLayout()
|
||||
self.horizontalLayout.setObjectName(u"horizontalLayout")
|
||||
self.horizontalSpacer_2 = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)
|
||||
|
||||
self.horizontalLayout.addItem(self.horizontalSpacer_2)
|
||||
|
||||
self.frame = QFrame(self.centralwidget)
|
||||
self.frame.setObjectName(u"frame")
|
||||
sizePolicy1 = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred)
|
||||
sizePolicy1.setHorizontalStretch(0)
|
||||
sizePolicy1.setVerticalStretch(0)
|
||||
sizePolicy1.setHeightForWidth(self.frame.sizePolicy().hasHeightForWidth())
|
||||
self.frame.setSizePolicy(sizePolicy1)
|
||||
self.frame.setMinimumSize(QSize(100, 128))
|
||||
self.frame.setFrameShape(QFrame.NoFrame)
|
||||
self.frame.setFrameShadow(QFrame.Sunken)
|
||||
self.pic = QLabel(self.frame)
|
||||
self.pic.setObjectName(u"pic")
|
||||
self.pic.setGeometry(QRect(0, 0, 90, 128))
|
||||
sizePolicy.setHeightForWidth(self.pic.sizePolicy().hasHeightForWidth())
|
||||
self.pic.setSizePolicy(sizePolicy)
|
||||
self.pic.setMaximumSize(QSize(16777215, 16777215))
|
||||
self.pic.setPixmap(QPixmap(u"images/phone_notfound.png"))
|
||||
self.pic.setScaledContents(True)
|
||||
self.pic.setAlignment(Qt.AlignCenter)
|
||||
self.pic.setWordWrap(False)
|
||||
self.spinner_pic = QLabel(self.frame)
|
||||
self.spinner_pic.setObjectName(u"spinner_pic")
|
||||
self.spinner_pic.setGeometry(QRect(25, 40, 41, 41))
|
||||
self.spinner_pic.setPixmap(QPixmap(u"images/phone_loading.png"))
|
||||
self.spinner_pic.setScaledContents(True)
|
||||
|
||||
self.horizontalLayout.addWidget(self.frame)
|
||||
|
||||
|
||||
self.verticalLayout.addLayout(self.horizontalLayout)
|
||||
|
||||
self.phoneInfoTextbox = QLabel(self.centralwidget)
|
||||
self.phoneInfoTextbox.setObjectName(u"phoneInfoTextbox")
|
||||
sizePolicy.setHeightForWidth(self.phoneInfoTextbox.sizePolicy().hasHeightForWidth())
|
||||
self.phoneInfoTextbox.setSizePolicy(sizePolicy)
|
||||
self.phoneInfoTextbox.setAlignment(Qt.AlignRight|Qt.AlignTop|Qt.AlignTrailing)
|
||||
self.phoneInfoTextbox.setWordWrap(True)
|
||||
|
||||
self.verticalLayout.addWidget(self.phoneInfoTextbox)
|
||||
|
||||
|
||||
self.horizontalLayout_3.addLayout(self.verticalLayout)
|
||||
|
||||
|
||||
self.formLayout.setLayout(0, QFormLayout.SpanningRole, self.horizontalLayout_3)
|
||||
|
||||
self.line = QFrame(self.centralwidget)
|
||||
self.line.setObjectName(u"line")
|
||||
self.line.setFrameShape(QFrame.HLine)
|
||||
self.line.setFrameShadow(QFrame.Sunken)
|
||||
|
||||
self.formLayout.setWidget(1, QFormLayout.SpanningRole, self.line)
|
||||
|
||||
self.horizontalLayout_2 = QHBoxLayout()
|
||||
self.horizontalLayout_2.setObjectName(u"horizontalLayout_2")
|
||||
self.logoPic = QLabel(self.centralwidget)
|
||||
self.logoPic.setObjectName(u"logoPic")
|
||||
sizePolicy1.setHeightForWidth(self.logoPic.sizePolicy().hasHeightForWidth())
|
||||
self.logoPic.setSizePolicy(sizePolicy1)
|
||||
self.logoPic.setMaximumSize(QSize(100, 100))
|
||||
self.logoPic.setPixmap(QPixmap(u"images/logo_256.png"))
|
||||
self.logoPic.setScaledContents(True)
|
||||
self.logoPic.setAlignment(Qt.AlignLeading|Qt.AlignLeft|Qt.AlignTop)
|
||||
|
||||
self.horizontalLayout_2.addWidget(self.logoPic)
|
||||
|
||||
self.copyrightInfo = QLabel(self.centralwidget)
|
||||
self.copyrightInfo.setObjectName(u"copyrightInfo")
|
||||
|
||||
self.horizontalLayout_2.addWidget(self.copyrightInfo)
|
||||
|
||||
|
||||
self.formLayout.setLayout(3, QFormLayout.LabelRole, self.horizontalLayout_2)
|
||||
|
||||
self.horizontalLayout_4 = QHBoxLayout()
|
||||
self.horizontalLayout_4.setObjectName(u"horizontalLayout_4")
|
||||
self.horizontalSpacer = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)
|
||||
|
||||
self.horizontalLayout_4.addItem(self.horizontalSpacer)
|
||||
|
||||
self.verticalLayout_3 = QVBoxLayout()
|
||||
self.verticalLayout_3.setObjectName(u"verticalLayout_3")
|
||||
self.debugBtn = QPushButton(self.centralwidget)
|
||||
self.debugBtn.setObjectName(u"debugBtn")
|
||||
sizePolicy2 = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
|
||||
sizePolicy2.setHorizontalStretch(0)
|
||||
sizePolicy2.setVerticalStretch(0)
|
||||
sizePolicy2.setHeightForWidth(self.debugBtn.sizePolicy().hasHeightForWidth())
|
||||
self.debugBtn.setSizePolicy(sizePolicy2)
|
||||
|
||||
self.verticalLayout_3.addWidget(self.debugBtn)
|
||||
|
||||
self.verticalSpacer_2 = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding)
|
||||
|
||||
self.verticalLayout_3.addItem(self.verticalSpacer_2)
|
||||
|
||||
|
||||
self.horizontalLayout_4.addLayout(self.verticalLayout_3)
|
||||
|
||||
|
||||
self.formLayout.setLayout(3, QFormLayout.FieldRole, self.horizontalLayout_4)
|
||||
|
||||
self.logBox = QPlainTextEdit(self.centralwidget)
|
||||
self.logBox.setObjectName(u"logBox")
|
||||
self.logBox.setReadOnly(True)
|
||||
|
||||
self.formLayout.setWidget(2, QFormLayout.SpanningRole, self.logBox)
|
||||
|
||||
MainWindow.setCentralWidget(self.centralwidget)
|
||||
self.menubar = QMenuBar(MainWindow)
|
||||
self.menubar.setObjectName(u"menubar")
|
||||
self.menubar.setGeometry(QRect(0, 0, 689, 22))
|
||||
self.readFlashMenu = QMenu(self.menubar)
|
||||
self.readFlashMenu.setObjectName(u"readFlashMenu")
|
||||
self.writeFlashMenu = QMenu(self.menubar)
|
||||
self.writeFlashMenu.setObjectName(u"writeFlashMenu")
|
||||
self.eraseFlashMenu = QMenu(self.menubar)
|
||||
self.eraseFlashMenu.setObjectName(u"eraseFlashMenu")
|
||||
self.toolsFlashMenu = QMenu(self.menubar)
|
||||
self.toolsFlashMenu.setObjectName(u"toolsFlashMenu")
|
||||
MainWindow.setMenuBar(self.menubar)
|
||||
self.statusbar = QStatusBar(MainWindow)
|
||||
self.statusbar.setObjectName(u"statusbar")
|
||||
MainWindow.setStatusBar(self.statusbar)
|
||||
|
||||
self.menubar.addAction(self.readFlashMenu.menuAction())
|
||||
self.menubar.addAction(self.writeFlashMenu.menuAction())
|
||||
self.menubar.addAction(self.eraseFlashMenu.menuAction())
|
||||
self.menubar.addAction(self.toolsFlashMenu.menuAction())
|
||||
self.readFlashMenu.addAction(self.actionRead_partition_s)
|
||||
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_full_flash)
|
||||
self.writeFlashMenu.addAction(self.actionWrite_at_offset)
|
||||
self.eraseFlashMenu.addAction(self.actionErase_partitions_s)
|
||||
self.eraseFlashMenu.addAction(self.actionErase_at_offset)
|
||||
self.toolsFlashMenu.addAction(self.actionRead_RPMB)
|
||||
self.toolsFlashMenu.addAction(self.actionWrite_RPMB)
|
||||
self.toolsFlashMenu.addAction(self.actionRead_preloader)
|
||||
self.toolsFlashMenu.addSeparator()
|
||||
self.toolsFlashMenu.addAction(self.actionGenerate_RPMB_Keys)
|
||||
|
||||
self.retranslateUi(MainWindow)
|
||||
|
||||
QMetaObject.connectSlotsByName(MainWindow)
|
||||
# setupUi
|
||||
|
||||
def retranslateUi(self, MainWindow):
|
||||
MainWindow.setWindowTitle(QCoreApplication.translate("MainWindow", u"MTKClient v2.0", None))
|
||||
self.actionRead_partition_s.setText(QCoreApplication.translate("MainWindow", u"Read partition(s)", None))
|
||||
self.actionRead_full_flash.setText(QCoreApplication.translate("MainWindow", u"Read full flash", None))
|
||||
self.actionRead_offset.setText(QCoreApplication.translate("MainWindow", u"Read at offset", None))
|
||||
self.actionWrite_partition_s.setText(QCoreApplication.translate("MainWindow", u"Write partition(s)", None))
|
||||
self.actionWrite_full_flash.setText(QCoreApplication.translate("MainWindow", u"Write full flash", None))
|
||||
self.actionWrite_at_offset.setText(QCoreApplication.translate("MainWindow", u"Write at offset", None))
|
||||
self.actionErase_partitions_s.setText(QCoreApplication.translate("MainWindow", u"Erase partitions(s)", None))
|
||||
self.actionErase_at_offset.setText(QCoreApplication.translate("MainWindow", u"Erase at offset", None))
|
||||
self.actionRead_RPMB.setText(QCoreApplication.translate("MainWindow", u"Read RPMB", None))
|
||||
self.actionWrite_RPMB.setText(QCoreApplication.translate("MainWindow", u"Write RPMB", None))
|
||||
self.actionRead_preloader.setText(QCoreApplication.translate("MainWindow", u"Read preloader", None))
|
||||
self.actionGenerate_RPMB_Keys.setText(QCoreApplication.translate("MainWindow", u"Generate RPMB Keys", None))
|
||||
self.title.setText(QCoreApplication.translate("MainWindow", u"MTKClient v2.0", None))
|
||||
self.status.setText(QCoreApplication.translate("MainWindow", u"<html><head/><body><p>Please connect a Mediatek phone to continue.</p><p><br/></p><p>Hint: Power off the phone before connecting.</p><p><br/></p><p>For brom mode:</p><p>Press and hold vol up, vol dwn, or all hw buttons and connect usb.</p><p><br/></p><p>For preloader mode:</p><p>Don't press any hw button and connect usb.</p></body></html>", None))
|
||||
self.pic.setText("")
|
||||
self.spinner_pic.setText("")
|
||||
self.phoneInfoTextbox.setText(QCoreApplication.translate("MainWindow", u"No phone detected.", None))
|
||||
self.logoPic.setText("")
|
||||
self.copyrightInfo.setText(QCoreApplication.translate("MainWindow", u"<html><head/><body><p><span style=\" font-size:12pt;\">Made by: Bjoern Kerler<br/>Gui by: Geert-Jan Kreileman<br/></span></p><p><span style=\" font-size:12pt;\">Credits:<br/> kamakiri [xyzz]<br/> linecode exploit [chimera]<br/> Chaosmaster<br/> and all contributers</span></p></body></html>", None))
|
||||
self.debugBtn.setText(QCoreApplication.translate("MainWindow", u"Show debug log", None))
|
||||
self.readFlashMenu.setTitle(QCoreApplication.translate("MainWindow", u"&Read Flash", None))
|
||||
self.writeFlashMenu.setTitle(QCoreApplication.translate("MainWindow", u"&Write Flash", None))
|
||||
self.eraseFlashMenu.setTitle(QCoreApplication.translate("MainWindow", u"&Erase Flash", None))
|
||||
self.toolsFlashMenu.setTitle(QCoreApplication.translate("MainWindow", u"&Tools", None))
|
||||
# retranslateUi
|
||||
|
384
mtkclient/gui/main_gui.ui
Normal file
384
mtkclient/gui/main_gui.ui
Normal file
|
@ -0,0 +1,384 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>MainWindow</class>
|
||||
<widget class="QMainWindow" name="MainWindow">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>689</width>
|
||||
<height>648</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>MTKClient v2.0</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<layout class="QFormLayout" name="formLayout">
|
||||
<item row="0" column="0" colspan="2">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="title">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>17</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>MTKClient v2.0</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="status">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><html><head/><body><p>Please connect a Mediatek phone to continue.</p><p><br/></p><p>Hint: Power off the phone before connecting.</p><p><br/></p><p>For brom mode:</p><p>Press and hold vol up, vol dwn, or all hw buttons and connect usb.</p><p><br/></p><p>For preloader mode:</p><p>Don't press any hw button and connect usb.</p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QFrame" name="frame">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>128</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Sunken</enum>
|
||||
</property>
|
||||
<widget class="QLabel" name="pic">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>90</width>
|
||||
<height>128</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap>images/phone_notfound.png</pixmap>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="spinner_pic">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>25</x>
|
||||
<y>40</y>
|
||||
<width>41</width>
|
||||
<height>41</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap>images/phone_loading.png</pixmap>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="phoneInfoTextbox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>No phone detected.</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing</set>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="2">
|
||||
<widget class="Line" name="line">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="logoPic">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>100</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap>images/logo_256.png</pixmap>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="copyrightInfo">
|
||||
<property name="text">
|
||||
<string><html><head/><body><p><span style=" font-size:12pt;">Made by: Bjoern Kerler<br/>Gui by: Geert-Jan Kreileman<br/></span></p><p><span style=" font-size:12pt;">Credits:<br/> kamakiri [xyzz]<br/> linecode exploit [chimera]<br/> Chaosmaster<br/> and all contributers</span></p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<widget class="QPushButton" name="debugBtn">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Show debug log</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="2">
|
||||
<widget class="QPlainTextEdit" name="logBox">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QMenuBar" name="menubar">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>689</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QMenu" name="readFlashMenu">
|
||||
<property name="title">
|
||||
<string>&Read Flash</string>
|
||||
</property>
|
||||
<addaction name="actionRead_partition_s"/>
|
||||
<addaction name="actionRead_full_flash"/>
|
||||
<addaction name="actionRead_offset"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="writeFlashMenu">
|
||||
<property name="title">
|
||||
<string>&Write Flash</string>
|
||||
</property>
|
||||
<addaction name="actionWrite_partition_s"/>
|
||||
<addaction name="actionWrite_full_flash"/>
|
||||
<addaction name="actionWrite_at_offset"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="eraseFlashMenu">
|
||||
<property name="title">
|
||||
<string>&Erase Flash</string>
|
||||
</property>
|
||||
<addaction name="actionErase_partitions_s"/>
|
||||
<addaction name="actionErase_at_offset"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="toolsFlashMenu">
|
||||
<property name="title">
|
||||
<string>&Tools</string>
|
||||
</property>
|
||||
<addaction name="actionRead_RPMB"/>
|
||||
<addaction name="actionWrite_RPMB"/>
|
||||
<addaction name="actionRead_preloader"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionGenerate_RPMB_Keys"/>
|
||||
</widget>
|
||||
<addaction name="readFlashMenu"/>
|
||||
<addaction name="writeFlashMenu"/>
|
||||
<addaction name="eraseFlashMenu"/>
|
||||
<addaction name="toolsFlashMenu"/>
|
||||
</widget>
|
||||
<widget class="QStatusBar" name="statusbar"/>
|
||||
<action name="actionRead_partition_s">
|
||||
<property name="text">
|
||||
<string>Read partition(s)</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionRead_full_flash">
|
||||
<property name="text">
|
||||
<string>Read full flash</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionRead_offset">
|
||||
<property name="text">
|
||||
<string>Read at offset</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionWrite_partition_s">
|
||||
<property name="text">
|
||||
<string>Write partition(s)</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionWrite_full_flash">
|
||||
<property name="text">
|
||||
<string>Write full flash</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionWrite_at_offset">
|
||||
<property name="text">
|
||||
<string>Write at offset</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionErase_partitions_s">
|
||||
<property name="text">
|
||||
<string>Erase partitions(s)</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionErase_at_offset">
|
||||
<property name="text">
|
||||
<string>Erase at offset</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionRead_RPMB">
|
||||
<property name="text">
|
||||
<string>Read RPMB</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionWrite_RPMB">
|
||||
<property name="text">
|
||||
<string>Write RPMB</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionRead_preloader">
|
||||
<property name="text">
|
||||
<string>Read preloader</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionGenerate_RPMB_Keys">
|
||||
<property name="text">
|
||||
<string>Generate RPMB Keys</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
Loading…
Reference in a new issue