forked from qt-creator/qt-creator
Fix broken debugging on Android 5.0
Security permissions prevent access to files not owned by the current process. This patch replaces the file based handshake protocol with a local server based implementation. The server waits for QTC to connect to it and sends back the current process ID. This new mechanism works on pre 5.0 devices as well. The existing file based handshake remains and can be activiated via the env variable QTC_ANDROID_USE_FILE_HANDSHAKE. Task-number: QTCREATORBUG-13418 Change-Id: Ie40ec801f265a9e13c3220f300798c27abd97ae2 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com> Reviewed-by: hjk <hjk121@nokiamail.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com> Reviewed-by: BogDan Vatra <bogdan@kde.org>
This commit is contained in:
@@ -37,6 +37,7 @@
|
||||
|
||||
#include <QObject>
|
||||
#include <QTimer>
|
||||
#include <QTcpSocket>
|
||||
#include <QThread>
|
||||
#include <QProcess>
|
||||
#include <QMutex>
|
||||
@@ -50,6 +51,11 @@ class AndroidRunner : public QThread
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
enum DebugHandShakeType {
|
||||
PingPongFiles,
|
||||
SocketHandShake
|
||||
};
|
||||
|
||||
public:
|
||||
AndroidRunner(QObject *parent, AndroidRunConfiguration *runConfig,
|
||||
ProjectExplorer::RunMode runMode);
|
||||
@@ -114,6 +120,9 @@ private:
|
||||
bool m_isBusyBox;
|
||||
QStringList m_selector;
|
||||
QMutex m_mutex;
|
||||
DebugHandShakeType m_handShakeMethod;
|
||||
QTcpSocket *m_socket;
|
||||
bool m_customPort;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
Reference in New Issue
Block a user