|
|
|
@ -5,6 +5,7 @@
|
|
|
|
#include <QProcess>
|
|
|
|
#include <QProcess>
|
|
|
|
|
|
|
|
|
|
|
|
#include "adbprocess.h"
|
|
|
|
#include "adbprocess.h"
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
|
|
|
|
QString AdbProcess::s_adbPath = "";
|
|
|
|
QString AdbProcess::s_adbPath = "";
|
|
|
|
|
|
|
|
|
|
|
|
@ -25,9 +26,14 @@ const QString &AdbProcess::getAdbPath()
|
|
|
|
if (s_adbPath.isEmpty()) {
|
|
|
|
if (s_adbPath.isEmpty()) {
|
|
|
|
s_adbPath = QString::fromLocal8Bit(qgetenv("QTSCRCPY_ADB_PATH"));
|
|
|
|
s_adbPath = QString::fromLocal8Bit(qgetenv("QTSCRCPY_ADB_PATH"));
|
|
|
|
QFileInfo fileInfo(s_adbPath);
|
|
|
|
QFileInfo fileInfo(s_adbPath);
|
|
|
|
|
|
|
|
if (s_adbPath.isEmpty() || !fileInfo.isFile()) {
|
|
|
|
|
|
|
|
s_adbPath = Config::getInstance().getAdbPath();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
fileInfo = s_adbPath;
|
|
|
|
if (s_adbPath.isEmpty() || !fileInfo.isFile()) {
|
|
|
|
if (s_adbPath.isEmpty() || !fileInfo.isFile()) {
|
|
|
|
s_adbPath = QCoreApplication::applicationDirPath() + "/adb";
|
|
|
|
s_adbPath = QCoreApplication::applicationDirPath() + "/adb";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
qInfo("adb path: %s", QDir(s_adbPath).absolutePath().toUtf8().data());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return s_adbPath;
|
|
|
|
return s_adbPath;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|