mirror of
https://github.com/wh201906/Proxmark3GUI.git
synced 2026-07-14 22:55:32 +08:00
Some changes
Refactor execCMDWithOutput Add UI for advanced settings Add stop button(reconnect) Update translations
This commit is contained in:
+88
-6
@@ -92,6 +92,9 @@ void MainWindow::on_PM3_connectButton_clicked()
|
||||
saveClientPath(ui->PM3_pathEdit->text());
|
||||
emit connectPM3(ui->PM3_pathEdit->text(), port);
|
||||
}
|
||||
QProcess proc;
|
||||
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
|
||||
//env.insert();
|
||||
}
|
||||
|
||||
void MainWindow::onPM3StateChanged(bool st, const QString& info)
|
||||
@@ -112,11 +115,8 @@ void MainWindow::onPM3StateChanged(bool st, const QString& info)
|
||||
|
||||
void MainWindow::on_PM3_disconnectButton_clicked()
|
||||
{
|
||||
pm3state = false;
|
||||
setState(false);
|
||||
emit killPM3();
|
||||
emit setSerialListener("", false);
|
||||
setStatusBar(connectStatusBar, tr("Not Connected"));
|
||||
}
|
||||
|
||||
void MainWindow::refreshOutput(const QString& output)
|
||||
@@ -128,7 +128,19 @@ void MainWindow::refreshOutput(const QString& output)
|
||||
|
||||
void MainWindow::on_stopButton_clicked()
|
||||
{
|
||||
|
||||
if(!pm3state)
|
||||
on_PM3_disconnectButton_clicked();
|
||||
else
|
||||
{
|
||||
on_PM3_disconnectButton_clicked();
|
||||
for(int i = 0; i < 10; i++)
|
||||
{
|
||||
util->delay(200);
|
||||
if(!pm3state)
|
||||
break;
|
||||
}
|
||||
on_PM3_connectButton_clicked();
|
||||
}
|
||||
}
|
||||
// *********************************************************
|
||||
|
||||
@@ -866,7 +878,6 @@ void MainWindow::uiInit()
|
||||
ui->MF_dataWidget->setHorizontalHeaderItem(0, new QTableWidgetItem(tr("Sec")));
|
||||
ui->MF_dataWidget->setHorizontalHeaderItem(1, new QTableWidgetItem(tr("Blk")));
|
||||
ui->MF_dataWidget->setHorizontalHeaderItem(2, new QTableWidgetItem(tr("Data")));
|
||||
ui->MF_dataWidget->verticalHeader()->setVisible(false);
|
||||
ui->MF_dataWidget->setColumnWidth(0, 55);
|
||||
ui->MF_dataWidget->setColumnWidth(1, 55);
|
||||
ui->MF_dataWidget->setColumnWidth(2, 450);
|
||||
@@ -875,7 +886,6 @@ void MainWindow::uiInit()
|
||||
ui->MF_keyWidget->setHorizontalHeaderItem(0, new QTableWidgetItem(tr("Sec")));
|
||||
ui->MF_keyWidget->setHorizontalHeaderItem(1, new QTableWidgetItem(tr("KeyA")));
|
||||
ui->MF_keyWidget->setHorizontalHeaderItem(2, new QTableWidgetItem(tr("KeyB")));
|
||||
ui->MF_keyWidget->verticalHeader()->setVisible(false);
|
||||
ui->MF_keyWidget->setColumnWidth(0, 35);
|
||||
ui->MF_keyWidget->setColumnWidth(1, 125);
|
||||
ui->MF_keyWidget->setColumnWidth(2, 125);
|
||||
@@ -917,11 +927,21 @@ void MainWindow::uiInit()
|
||||
ui->PM3_pathEdit->setText(settings->value("path", "proxmark3").toString());
|
||||
settings->endGroup();
|
||||
|
||||
settings->beginGroup("Client_Args");
|
||||
ui->Set_Client_startArgsEdit->setText(settings->value("args", "<port> -f").toString());
|
||||
settings->endGroup();
|
||||
|
||||
settings->beginGroup("Client_forceButtonsEnabled");
|
||||
ui->Set_Client_forceEnabledBox->setChecked(settings->value("state", false).toBool());
|
||||
settings->endGroup();
|
||||
|
||||
ui->MF_RW_keyTypeBox->addItem("A", Mifare::KEY_A);
|
||||
ui->MF_RW_keyTypeBox->addItem("B", Mifare::KEY_B);
|
||||
|
||||
on_Raw_CMDHistoryBox_stateChanged(Qt::Unchecked);
|
||||
on_PM3_refreshPortButton_clicked();
|
||||
|
||||
loadClientPreloadEnv();
|
||||
}
|
||||
|
||||
void MainWindow::signalInit()
|
||||
@@ -1059,3 +1079,65 @@ void MainWindow::on_MF_Attack_darksideButton_clicked()
|
||||
mifare->darkside();
|
||||
setState(true);
|
||||
}
|
||||
|
||||
void MainWindow::on_Set_Client_envDeleteButton_clicked()
|
||||
{
|
||||
ui->Set_Client_envTable->removeRow(ui->Set_Client_envTable->currentRow());
|
||||
}
|
||||
|
||||
void MainWindow::on_Set_Client_envAddButton_clicked()
|
||||
{
|
||||
ui->Set_Client_envTable->insertRow(ui->Set_Client_envTable->rowCount());
|
||||
}
|
||||
|
||||
void MainWindow::on_Set_Client_envClearButton_clicked()
|
||||
{
|
||||
ui->Set_Client_envTable->clearContents();
|
||||
ui->Set_Client_envTable->setRowCount(0);
|
||||
}
|
||||
|
||||
void MainWindow::on_Set_Client_envSaveButton_clicked()
|
||||
{
|
||||
settings->beginGroup("Client_Env");
|
||||
for(int i = 0; i < ui->Set_Client_envTable->rowCount(); i++)
|
||||
{
|
||||
QTableWidgetItem* key = ui->Set_Client_envTable->item(i, 0);
|
||||
QTableWidgetItem* val = ui->Set_Client_envTable->item(i, 1);
|
||||
if(key == nullptr || val == nullptr || key->text().isEmpty() || val->text().isEmpty())
|
||||
continue;
|
||||
settings->setValue(key->text(), val->text());
|
||||
qDebug() << "Env saved: " << i << key->text() << val->text();
|
||||
}
|
||||
settings->endGroup();
|
||||
}
|
||||
|
||||
void MainWindow::loadClientPreloadEnv()
|
||||
{
|
||||
ui->Set_Client_envTable->clearContents();
|
||||
settings->beginGroup("Client_Env");
|
||||
QStringList keyList = settings->allKeys();
|
||||
ui->Set_Client_envTable->setRowCount(keyList.size());
|
||||
for(int i = 0; i < keyList.size(); i++)
|
||||
{
|
||||
ui->Set_Client_envTable->setItem(i, 0, new QTableWidgetItem(keyList[i]));
|
||||
ui->Set_Client_envTable->setItem(i, 1, new QTableWidgetItem(settings->value(keyList[i]).toString()));
|
||||
}
|
||||
settings->endGroup();
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::on_Set_Client_startArgsEdit_editingFinished()
|
||||
{
|
||||
settings->beginGroup("Client_Args");
|
||||
settings->setValue("args", ui->Set_Client_startArgsEdit->text());
|
||||
settings->endGroup();
|
||||
}
|
||||
|
||||
void MainWindow::on_Set_Client_forceEnabledBox_stateChanged(int arg1)
|
||||
{
|
||||
settings->beginGroup("Client_forceButtonsEnabled");
|
||||
settings->setValue("state", arg1 == Qt::Checked);
|
||||
settings->endGroup();
|
||||
}
|
||||
|
||||
|
||||
|
||||
+15
-1
@@ -20,6 +20,7 @@
|
||||
#include <QSizePolicy>
|
||||
#include <QSettings>
|
||||
#include <QPushButton>
|
||||
#include <QProcessEnvironment>
|
||||
|
||||
#include "common/myeventfilter.h"
|
||||
#include "common/pm3process.h"
|
||||
@@ -90,7 +91,6 @@ private slots:
|
||||
|
||||
void on_MF_RW_writeSelectedButton_clicked();
|
||||
|
||||
|
||||
void on_MF_RW_dumpButton_clicked();
|
||||
|
||||
void on_MF_RW_restoreButton_clicked();
|
||||
@@ -156,6 +156,20 @@ private slots:
|
||||
|
||||
void on_MF_Attack_darksideButton_clicked();
|
||||
|
||||
void on_Set_Client_envDeleteButton_clicked();
|
||||
|
||||
void on_Set_Client_envAddButton_clicked();
|
||||
|
||||
void on_Set_Client_envSaveButton_clicked();
|
||||
|
||||
void loadClientPreloadEnv();
|
||||
|
||||
void on_Set_Client_startArgsEdit_editingFinished();
|
||||
|
||||
void on_Set_Client_forceEnabledBox_stateChanged(int arg1);
|
||||
|
||||
void on_Set_Client_envClearButton_clicked();
|
||||
|
||||
private:
|
||||
Ui::MainWindow* ui;
|
||||
QButtonGroup* typeBtnGroup;
|
||||
|
||||
+264
-2
@@ -6,7 +6,7 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>970</width>
|
||||
<width>1029</width>
|
||||
<height>770</height>
|
||||
</rect>
|
||||
</property>
|
||||
@@ -120,7 +120,7 @@
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
<number>4</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="mifareTab">
|
||||
<attribute name="title">
|
||||
@@ -170,6 +170,12 @@
|
||||
<property name="selectionMode">
|
||||
<enum>QAbstractItemView::SingleSelection</enum>
|
||||
</property>
|
||||
<attribute name="horizontalHeaderStretchLastSection">
|
||||
<bool>true</bool>
|
||||
</attribute>
|
||||
<attribute name="verticalHeaderVisible">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<attribute name="verticalHeaderMinimumSectionSize">
|
||||
<number>20</number>
|
||||
</attribute>
|
||||
@@ -329,6 +335,9 @@
|
||||
<property name="selectionMode">
|
||||
<enum>QAbstractItemView::SingleSelection</enum>
|
||||
</property>
|
||||
<attribute name="verticalHeaderVisible">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<attribute name="verticalHeaderMinimumSectionSize">
|
||||
<number>20</number>
|
||||
</attribute>
|
||||
@@ -1515,6 +1524,259 @@
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="settingsTab">
|
||||
<attribute name="title">
|
||||
<string>Settings</string>
|
||||
</attribute>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_18">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_12">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="Set_clientGroupBox">
|
||||
<property name="title">
|
||||
<string>Client</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_10">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_11">
|
||||
<property name="text">
|
||||
<string>Preload environment variables</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_15">
|
||||
<item>
|
||||
<widget class="QTableWidget" name="Set_Client_envTable">
|
||||
<property name="selectionBehavior">
|
||||
<enum>QAbstractItemView::SelectRows</enum>
|
||||
</property>
|
||||
<attribute name="horizontalHeaderStretchLastSection">
|
||||
<bool>true</bool>
|
||||
</attribute>
|
||||
<attribute name="verticalHeaderVisible">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Key</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Value</string>
|
||||
</property>
|
||||
</column>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_8">
|
||||
<item>
|
||||
<widget class="QPushButton" name="Set_Client_envAddButton">
|
||||
<property name="text">
|
||||
<string>Add</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="Set_Client_envDeleteButton">
|
||||
<property name="text">
|
||||
<string>Delete</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="Set_Client_envClearButton">
|
||||
<property name="text">
|
||||
<string>Clear</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="Set_Client_envSaveButton">
|
||||
<property name="text">
|
||||
<string>Save</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_4">
|
||||
<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>
|
||||
<widget class="QLabel" name="label_13">
|
||||
<property name="text">
|
||||
<string>Note:
|
||||
If the variable name already exists, this app will add the new value to the head of the existing one, so these new values have higher priority when calling Proxmark3 client.
|
||||
The environment variables added here won't affect other apps.</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_12">
|
||||
<property name="text">
|
||||
<string>Start arguments</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="Set_Client_startArgsEdit">
|
||||
<property name="text">
|
||||
<string><port> -f</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_14">
|
||||
<property name="text">
|
||||
<string>Note:
|
||||
-f is necessary because the GUI need to handle the output in time
|
||||
In some cases the arguments should be set to "-p /dev/<port> -f"
|
||||
or "-p <port> -f"</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_16">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="Set_Client_forceEnabledBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_15">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Keep buttons enabled even the client is running or disconnected</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_2">
|
||||
<property name="title">
|
||||
<string>GUI</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_11">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_16">
|
||||
<property name="text">
|
||||
<string>Language</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_17">
|
||||
<item>
|
||||
<widget class="QComboBox" name="Set_GUI_languageBox"/>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_9">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_5">
|
||||
<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>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_10">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
|
||||
Reference in New Issue
Block a user