from PyQt5.
QtCore import Qt,
QSizefrom PyQt5 import QtGui
import sys
def __init__(self):
super().__init__()
self.initUI()
def initUI(self):
hbox.setSpacing(10)
vBoxMain.setSpacing(35) #space between widgets
vBoxContext.setSpacing(35) #space between widgets
self.loadMainMenu(vBoxMain)
self.loadContextMenu(vBoxContext)
hbox.addLayout(vBoxMain)
hbox.addLayout(vBoxContext)
#self.setLayout(hbox)
#self.move(300,200)
self.setWindowTitle('AnForA')
self.
setWindowIcon(QIcon('upoSmallLogo.png'))
self.show()
def loadContextMenu(self, vBox):
vbox.setSpacing(10)
hbox.setSpacing(10)
#Add edit text
insertFile.setText("Select apk file here")
hbox.addWidget(insertFile)
#Add browse button
#apkbtn.resize(apkbtn.sizeHint())
hbox.addWidget(browsebtn)
#apkbtn.move(250, 250)
vBox.addLayout(hbox)
def loadMainMenu(self, vBox):
#Add logo UPO image
pixmap2 = pixmap.scaledToWidth(300)
labelImg.setPixmap(pixmap2)
labelImg.setAlignment(Qt.AlignCenter)
vBox.addWidget(labelImg)
labelDesc.setText('AnForA\nAndroid Forensic Automator')
labelDesc.setAlignment(Qt.AlignCenter)
labelDesc.
setFont(QtGui.
QFont("Times",
12, QtGui.
QFont.
Bold)) vBox.addWidget(labelDesc)
#Add Install APK button
apkbtn
= QPushButton('Install APK into Android Device', self
) #apkbtn.resize(apkbtn.sizeHint())
vBox.addWidget(apkbtn)
#apkbtn.move(250, 250)
#Add Install APK button
#apkbtn.resize(apkbtn.sizeHint())
vBox.addWidget(rcdbtn)
#apkbtn.move(250, 250)
#Add Install APK button
#apkbtn.resize(apkbtn.sizeHint())
vBox.addWidget(forbtn)
#apkbtn.move(250, 250)
#Add quit button
#qbtn.resize(qbtn.sizeHint())
#qbtn.move(250, 300)
vBox.addWidget(qbtn)
"""
#Add Label main menu
labelMainMenu = QtGui.QLabel('AnForA\nAndroid Forensic Automator',cWidget)
labelMainMenu.setFont(QtGui.QFont("Times", 16, QtGui.QFont.Bold))
labelMainMenu.setFixedWidth(400)
vBox.addWidget(labelMainMenu)
cWidget.setLayout(vBox)
self.setCentralWidget(cWidget)
"""
if __name__ == '__main__':
main = MainWindow()
sys.exit(app.exec_())
from PyQt5.QtCore import Qt, QSize
from PyQt5.QtWidgets import (QWidget, QHBoxLayout, QVBoxLayout,
QLabel, QApplication, QPushButton, QLineEdit)
from PyQt5 import QtGui
from PyQt5.QtGui import QPixmap, QIcon, QFont
import sys
class MainWindow(QWidget):
def __init__(self):
super().__init__()
self.initUI()
def initUI(self):
hbox = QHBoxLayout(self)
hbox.setSpacing(10)
vBoxMain = QVBoxLayout(self) #Vertical box
vBoxMain.setSpacing(35) #space between widgets
vBoxContext = QVBoxLayout(self) #Vertical box
vBoxContext.setSpacing(35) #space between widgets
self.loadMainMenu(vBoxMain)
self.loadContextMenu(vBoxContext)
hbox.addLayout(vBoxMain)
hbox.addLayout(vBoxContext)
#self.setLayout(hbox)
#self.move(300,200)
self.setWindowTitle('AnForA')
self.setWindowIcon(QIcon('upoSmallLogo.png'))
self.show()
def loadContextMenu(self, vBox):
vbox = QVBoxLayout(self)
vbox.setSpacing(10)
hbox = QHBoxLayout(self)
hbox.setSpacing(10)
#Add edit text
insertFile = QLineEdit(self)
insertFile.setText("Select apk file here")
hbox.addWidget(insertFile)
#Add browse button
browsebtn = QPushButton('Browse', self)
browsebtn.clicked.connect(QApplication.instance().quit)
#apkbtn.resize(apkbtn.sizeHint())
hbox.addWidget(browsebtn)
#apkbtn.move(250, 250)
vBox.addLayout(hbox)
def loadMainMenu(self, vBox):
#Add logo UPO image
pixmap = QPixmap("logoUPO.png")
labelImg = QLabel(self)
pixmap2 = pixmap.scaledToWidth(300)
labelImg.setPixmap(pixmap2)
labelImg.setAlignment(Qt.AlignCenter)
vBox.addWidget(labelImg)
labelDesc = QLabel(self)
labelDesc.setText('AnForA\nAndroid Forensic Automator')
labelDesc.setAlignment(Qt.AlignCenter)
labelDesc.setFont(QtGui.QFont("Times", 12, QtGui.QFont.Bold))
vBox.addWidget(labelDesc)
#Add Install APK button
apkbtn = QPushButton('Install APK into Android Device', self)
apkbtn.clicked.connect(QApplication.instance().quit)
#apkbtn.resize(apkbtn.sizeHint())
vBox.addWidget(apkbtn)
#apkbtn.move(250, 250)
#Add Install APK button
rcdbtn = QPushButton('Record user session', self)
rcdbtn.clicked.connect(QApplication.instance().quit)
#apkbtn.resize(apkbtn.sizeHint())
vBox.addWidget(rcdbtn)
#apkbtn.move(250, 250)
#Add Install APK button
forbtn = QPushButton('Start forensic analysis', self)
forbtn.clicked.connect(QApplication.instance().quit)
#apkbtn.resize(apkbtn.sizeHint())
vBox.addWidget(forbtn)
#apkbtn.move(250, 250)
#Add quit button
qbtn = QPushButton('Quit', self)
qbtn.clicked.connect(QApplication.instance().quit)
#qbtn.resize(qbtn.sizeHint())
#qbtn.move(250, 300)
vBox.addWidget(qbtn)
"""
#Add Label main menu
labelMainMenu = QtGui.QLabel('AnForA\nAndroid Forensic Automator',cWidget)
labelMainMenu.setFont(QtGui.QFont("Times", 16, QtGui.QFont.Bold))
labelMainMenu.setFixedWidth(400)
vBox.addWidget(labelMainMenu)
cWidget.setLayout(vBox)
self.setCentralWidget(cWidget)
"""
if __name__ == '__main__':
app = QApplication(sys.argv)
main = MainWindow()
sys.exit(app.exec_())
To copy to clipboard, switch view to plain text mode
Bookmarks