mirror of
https://github.com/wh201906/Proxmark3GUI.git
synced 2026-09-09 22:55:24 +08:00
Compare commits
2 Commits
master
..
38c7916715
| Author | SHA1 | Date | |
|---|---|---|---|
| 38c7916715 | |||
| 687c27672f |
@@ -82,8 +82,6 @@ open Proxmark3GUI.app
|
||||
|
||||
> In order for the GUI to connect to the device in macOS, you'd need to tweak the settings a little bit
|
||||
|
||||
Client Path must be path to pm3 console client like "/usr/local/bin/pm3/"
|
||||
|
||||

|
||||
|
||||
***
|
||||
|
||||
+23
-17
@@ -22,7 +22,6 @@ void PM3Process::connectPM3(const QString& path, const QStringList args)
|
||||
QString result;
|
||||
Util::ClientType clientType;
|
||||
setRequiringOutput(true);
|
||||
QRegularExpression osPattern("(os:\\s+|OS\\.+\\s+)");
|
||||
|
||||
// stash for reconnect
|
||||
currPath = path;
|
||||
@@ -36,35 +35,30 @@ void PM3Process::connectPM3(const QString& path, const QStringList args)
|
||||
waitForReadyRead(10000);
|
||||
setRequiringOutput(false);
|
||||
result = *requiredOutput;
|
||||
// Workaround for wayland system, e.g. Ubuntu 22.04
|
||||
// The issue is that the warning is read and nothing else, hence the process is killed.
|
||||
if(result.contains("Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway."))
|
||||
{
|
||||
setRequiringOutput(true);
|
||||
readWaitForConnection(&result);
|
||||
}
|
||||
if(result.contains("[=]"))
|
||||
{
|
||||
clientType = Util::CLIENTTYPE_ICEMAN;
|
||||
setRequiringOutput(true);
|
||||
write("hw version\n");
|
||||
for(int i = 0; i < 50; i++)
|
||||
{
|
||||
waitForReadyRead(200);
|
||||
result += *requiredOutput;
|
||||
// if(result.contains("os: "))
|
||||
if(osPattern.match(result).hasMatch())
|
||||
break;
|
||||
}
|
||||
setRequiringOutput(false);
|
||||
readWaitForConnection(&result);
|
||||
}
|
||||
else
|
||||
{
|
||||
clientType = Util::CLIENTTYPE_OFFICIAL;
|
||||
}
|
||||
// if(result.contains("os: ")) // make sure the PM3 is connected
|
||||
if(osPattern.match(result).hasMatch())
|
||||
if(result.contains("os: ")) // make sure the PM3 is connected
|
||||
{
|
||||
emit changeClientType(clientType);
|
||||
// result = result.mid(result.indexOf("os: "));
|
||||
QRegularExpressionMatch osMatch = osPattern.match(result);
|
||||
result = result.mid(osMatch.capturedStart());
|
||||
result = result.mid(result.indexOf("os: "));
|
||||
result = result.left(result.indexOf("\n"));
|
||||
// result = result.mid(4, result.indexOf(" ", 4) - 4);
|
||||
result = result.mid(osMatch.capturedLength(), result.indexOf(" ", osMatch.capturedLength()) - osMatch.capturedLength());
|
||||
result = result.mid(4, result.indexOf(" ", 4) - 4);
|
||||
emit PM3StatedChanged(true, result);
|
||||
}
|
||||
else
|
||||
@@ -78,6 +72,18 @@ void PM3Process::connectPM3(const QString& path, const QStringList args)
|
||||
setRequiringOutput(false);
|
||||
}
|
||||
|
||||
void PM3Process::readWaitForConnection(QString *result)
|
||||
{
|
||||
for(int i = 0; i < 50; i++)
|
||||
{
|
||||
waitForReadyRead(200);
|
||||
(*result) += *requiredOutput;
|
||||
if(result->contains("os: "))
|
||||
break;
|
||||
}
|
||||
setRequiringOutput(false);
|
||||
}
|
||||
|
||||
void PM3Process::reconnectPM3()
|
||||
{
|
||||
connectPM3(currPath, currArgs);
|
||||
|
||||
@@ -38,6 +38,7 @@ private:
|
||||
bool isRequiringOutput;
|
||||
QString* requiredOutput; // It only works in this class now
|
||||
void setRequiringOutput(bool st);// It only works in this class now
|
||||
void readWaitForConnection(QString *result);
|
||||
QTimer* serialListener;
|
||||
QSerialPortInfo* portInfo;
|
||||
QString currPath;
|
||||
|
||||
Reference in New Issue
Block a user