forked from qt-creator/qt-creator
Merge "Merge remote-tracking branch 'origin/4.10' into 4.11" into 4.11
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
**
|
**
|
||||||
** Copyright (C) 2018 The Qt Company Ltd.
|
** Copyright (C) 2019 The Qt Company Ltd.
|
||||||
** Contact: https://www.qt.io/licensing/
|
** Contact: https://www.qt.io/licensing/
|
||||||
**
|
**
|
||||||
** This file is part of the Qt Creator documentation.
|
** This file is part of the Qt Creator documentation.
|
||||||
@@ -64,7 +64,7 @@
|
|||||||
|
|
||||||
\row
|
\row
|
||||||
\li Find free Qt-based applications
|
\li Find free Qt-based applications
|
||||||
\li \l{http://qt-apps.org/}{Qt Apps}
|
\li \l{https://github.com/topics/qt}{Qt Apps on GitHub}
|
||||||
|
|
||||||
\row
|
\row
|
||||||
\li Develop with a commercial Qt license and support -
|
\li Develop with a commercial Qt license and support -
|
||||||
|
@@ -143,7 +143,7 @@ class PlainDumper:
|
|||||||
d.putValue(d.hexencode(val), 'utf8:1:0')
|
d.putValue(d.hexencode(val), 'utf8:1:0')
|
||||||
elif sys.version_info[0] <= 2 and isinstance(val, unicode):
|
elif sys.version_info[0] <= 2 and isinstance(val, unicode):
|
||||||
d.putValue(val)
|
d.putValue(val)
|
||||||
else: # Assuming LazyString
|
elif val is not None: # Assuming LazyString
|
||||||
d.putCharArrayValue(val.address, val.length,
|
d.putCharArrayValue(val.address, val.length,
|
||||||
val.type.target().sizeof)
|
val.type.target().sizeof)
|
||||||
|
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"version": 1,
|
"version": 1,
|
||||||
"supportedProjectTypes": [ "Qt4ProjectManager.Qt4Project" ],
|
"supportedProjectTypes": [ "PythonProject" ],
|
||||||
"id": "U.QtForPythonApplicationWindow",
|
"id": "U.QtForPythonApplicationWindow",
|
||||||
"category": "F.Application",
|
"category": "F.Application",
|
||||||
"trDescription": "Creates a Qt for Python application that contains an empty window.",
|
"trDescription": "Creates a Qt for Python application that contains an empty window.",
|
||||||
|
@@ -181,7 +181,8 @@ QList<TestTreeItem *> TestTreeModel::testItemsByName(TestTreeItem *root, const Q
|
|||||||
}
|
}
|
||||||
TestTreeItem *testCase = node->findFirstLevelChild([&testName](TestTreeItem *it) {
|
TestTreeItem *testCase = node->findFirstLevelChild([&testName](TestTreeItem *it) {
|
||||||
QTC_ASSERT(it, return false);
|
QTC_ASSERT(it, return false);
|
||||||
return it->type() == TestTreeItem::TestFunction && it->name() == testName;
|
return (it->type() == TestTreeItem::TestCase
|
||||||
|
|| it->type() == TestTreeItem::TestFunction) && it->name() == testName;
|
||||||
}); // collect only actual tests, not special functions like init, cleanup etc.
|
}); // collect only actual tests, not special functions like init, cleanup etc.
|
||||||
if (testCase)
|
if (testCase)
|
||||||
result << testCase;
|
result << testCase;
|
||||||
|
@@ -327,7 +327,7 @@ DeploymentData CMakeBuildConfiguration::deploymentData() const
|
|||||||
for (const CMakeBuildTarget &ct : m_buildTargets) {
|
for (const CMakeBuildTarget &ct : m_buildTargets) {
|
||||||
if (ct.targetType == ExecutableType || ct.targetType == DynamicLibraryType) {
|
if (ct.targetType == ExecutableType || ct.targetType == DynamicLibraryType) {
|
||||||
if (!ct.executable.isEmpty()
|
if (!ct.executable.isEmpty()
|
||||||
&& !result.deployableForLocalFile(ct.executable).isValid()) {
|
&& result.deployableForLocalFile(ct.executable).localFilePath() != ct.executable) {
|
||||||
result.addFile(ct.executable.toString(),
|
result.addFile(ct.executable.toString(),
|
||||||
deploymentPrefix + buildDir.relativeFilePath(ct.executable.toFileInfo().dir().path()),
|
deploymentPrefix + buildDir.relativeFilePath(ct.executable.toFileInfo().dir().path()),
|
||||||
DeployableFile::TypeExecutable);
|
DeployableFile::TypeExecutable);
|
||||||
|
@@ -567,6 +567,7 @@ void LogWindow::doOutput()
|
|||||||
if (m_queuedOutput.isEmpty())
|
if (m_queuedOutput.isEmpty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (theGlobalLog)
|
||||||
theGlobalLog->doOutput(m_queuedOutput);
|
theGlobalLog->doOutput(m_queuedOutput);
|
||||||
|
|
||||||
QTextCursor cursor = m_combinedText->textCursor();
|
QTextCursor cursor = m_combinedText->textCursor();
|
||||||
@@ -706,6 +707,7 @@ GlobalLogWindow::GlobalLogWindow()
|
|||||||
|
|
||||||
GlobalLogWindow::~GlobalLogWindow()
|
GlobalLogWindow::~GlobalLogWindow()
|
||||||
{
|
{
|
||||||
|
theGlobalLog = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GlobalLogWindow::doOutput(const QString &output)
|
void GlobalLogWindow::doOutput(const QString &output)
|
||||||
|
@@ -188,7 +188,10 @@ void AbiWidget::setAbis(const Abis &abiList, const Abi ¤tAbi)
|
|||||||
|
|
||||||
setCustomAbiComboBoxes(defaultAbi);
|
setCustomAbiComboBoxes(defaultAbi);
|
||||||
}
|
}
|
||||||
emitAbiChanged(defaultAbi);
|
|
||||||
|
// Update disabled state according to new automatically selected item in main ABI combobox.
|
||||||
|
// This will call emitAbiChanged with the actual selected ABI.
|
||||||
|
mainComboBoxChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
Abis AbiWidget::supportedAbis() const
|
Abis AbiWidget::supportedAbis() const
|
||||||
|
@@ -57,8 +57,15 @@ void DeploymentData::addFile(const QString &localFilePath, const QString &remote
|
|||||||
|
|
||||||
DeployableFile DeploymentData::deployableForLocalFile(const Utils::FilePath &localFilePath) const
|
DeployableFile DeploymentData::deployableForLocalFile(const Utils::FilePath &localFilePath) const
|
||||||
{
|
{
|
||||||
return Utils::findOrDefault(m_files,
|
const DeployableFile f = Utils::findOrDefault(m_files,
|
||||||
Utils::equal(&DeployableFile::localFilePath, localFilePath));
|
Utils::equal(&DeployableFile::localFilePath,
|
||||||
|
localFilePath));
|
||||||
|
if (f.isValid())
|
||||||
|
return f;
|
||||||
|
const QString localFileName = localFilePath.fileName();
|
||||||
|
return Utils::findOrDefault(m_files, [&localFileName](const DeployableFile &d) {
|
||||||
|
return d.localFilePath().fileName() == localFileName;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DeploymentData::operator==(const DeploymentData &other) const
|
bool DeploymentData::operator==(const DeploymentData &other) const
|
||||||
|
@@ -776,6 +776,8 @@ void MsvcToolChain::updateEnvironmentModifications(Utils::EnvironmentItems modif
|
|||||||
|
|
||||||
void MsvcToolChain::detectInstalledAbis()
|
void MsvcToolChain::detectInstalledAbis()
|
||||||
{
|
{
|
||||||
|
if (!m_supportedAbis.isEmpty()) // Build Tools 2015
|
||||||
|
return;
|
||||||
static QMap<QString, Abis> abiCache;
|
static QMap<QString, Abis> abiCache;
|
||||||
const QString vcVarsBase
|
const QString vcVarsBase
|
||||||
= QDir::fromNativeSeparators(m_vcvarsBat).left(m_vcvarsBat.lastIndexOf('/'));
|
= QDir::fromNativeSeparators(m_vcvarsBat).left(m_vcvarsBat.lastIndexOf('/'));
|
||||||
@@ -1251,6 +1253,13 @@ void MsvcToolChain::resetVarsBat()
|
|||||||
m_varsBatArg.clear();
|
m_varsBatArg.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MsvcToolChain::setSupportedAbi(const Abi &abi)
|
||||||
|
{
|
||||||
|
// Hack for Build Tools 2015 only.
|
||||||
|
QTC_CHECK(m_supportedAbis.isEmpty());
|
||||||
|
m_supportedAbis = { abi };
|
||||||
|
}
|
||||||
|
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
// MsvcBasedToolChainConfigWidget: Creates a simple GUI without error label
|
// MsvcBasedToolChainConfigWidget: Creates a simple GUI without error label
|
||||||
// to display name and varsBat. Derived classes should add the error label and
|
// to display name and varsBat. Derived classes should add the error label and
|
||||||
@@ -1855,6 +1864,7 @@ static void detectCppBuildTools2015(QList<ToolChain *> *list)
|
|||||||
tc->setDisplayName(name + QLatin1String(e.postFix));
|
tc->setDisplayName(name + QLatin1String(e.postFix));
|
||||||
tc->setDetection(ToolChain::AutoDetection);
|
tc->setDetection(ToolChain::AutoDetection);
|
||||||
tc->setLanguage(language);
|
tc->setLanguage(language);
|
||||||
|
tc->setSupportedAbi(abi);
|
||||||
list->append(tc);
|
list->append(tc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -95,6 +95,8 @@ public:
|
|||||||
void setupVarsBat(const Abi &abi, const QString &varsBat, const QString &varsBatArg);
|
void setupVarsBat(const Abi &abi, const QString &varsBat, const QString &varsBatArg);
|
||||||
void resetVarsBat();
|
void resetVarsBat();
|
||||||
|
|
||||||
|
void setSupportedAbi(const Abi &abi);
|
||||||
|
|
||||||
bool operator==(const ToolChain &) const override;
|
bool operator==(const ToolChain &) const override;
|
||||||
|
|
||||||
bool isJobCountSupported() const override { return false; }
|
bool isJobCountSupported() const override { return false; }
|
||||||
|
@@ -359,6 +359,7 @@ void Target::setDeploymentData(const DeploymentData &deploymentData)
|
|||||||
if (d->m_deploymentData != deploymentData) {
|
if (d->m_deploymentData != deploymentData) {
|
||||||
d->m_deploymentData = deploymentData;
|
d->m_deploymentData = deploymentData;
|
||||||
emit deploymentDataChanged();
|
emit deploymentDataChanged();
|
||||||
|
emit applicationTargetsChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -27,6 +27,7 @@
|
|||||||
|
|
||||||
#include "qbsbuildconfiguration.h"
|
#include "qbsbuildconfiguration.h"
|
||||||
#include "qbsbuildstep.h"
|
#include "qbsbuildstep.h"
|
||||||
|
#include "qbsinstallstep.h"
|
||||||
#include "qbslogsink.h"
|
#include "qbslogsink.h"
|
||||||
#include "qbspmlogging.h"
|
#include "qbspmlogging.h"
|
||||||
#include "qbsprojectimporter.h"
|
#include "qbsprojectimporter.h"
|
||||||
@@ -52,6 +53,7 @@
|
|||||||
#include <projectexplorer/buildinfo.h>
|
#include <projectexplorer/buildinfo.h>
|
||||||
#include <projectexplorer/buildmanager.h>
|
#include <projectexplorer/buildmanager.h>
|
||||||
#include <projectexplorer/buildtargetinfo.h>
|
#include <projectexplorer/buildtargetinfo.h>
|
||||||
|
#include <projectexplorer/deployconfiguration.h>
|
||||||
#include <projectexplorer/deploymentdata.h>
|
#include <projectexplorer/deploymentdata.h>
|
||||||
#include <projectexplorer/headerpath.h>
|
#include <projectexplorer/headerpath.h>
|
||||||
#include <projectexplorer/kit.h>
|
#include <projectexplorer/kit.h>
|
||||||
@@ -464,6 +466,14 @@ FilePath QbsProject::installRoot()
|
|||||||
{
|
{
|
||||||
if (!activeTarget())
|
if (!activeTarget())
|
||||||
return FilePath();
|
return FilePath();
|
||||||
|
const auto dc = activeTarget()->activeDeployConfiguration();
|
||||||
|
if (dc) {
|
||||||
|
const QList<QbsInstallStep *> qbsInstallSteps = dc->stepList()->allOfType<QbsInstallStep>();
|
||||||
|
for (QbsInstallStep * const step : qbsInstallSteps) {
|
||||||
|
if (step->enabled())
|
||||||
|
return FilePath::fromString(step->installRoot());
|
||||||
|
}
|
||||||
|
}
|
||||||
const auto * const bc
|
const auto * const bc
|
||||||
= qobject_cast<QbsBuildConfiguration *>(activeTarget()->activeBuildConfiguration());
|
= qobject_cast<QbsBuildConfiguration *>(activeTarget()->activeBuildConfiguration());
|
||||||
if (!bc)
|
if (!bc)
|
||||||
|
@@ -84,6 +84,7 @@ enum ADNCI_MSG {
|
|||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
typedef unsigned int ServiceSocket; // match_port_t (i.e. natural_t) or socket (on windows, i.e sock_t)
|
typedef unsigned int ServiceSocket; // match_port_t (i.e. natural_t) or socket (on windows, i.e sock_t)
|
||||||
|
typedef unsigned int *ServiceConnRef;
|
||||||
typedef unsigned int am_res_t; // mach_error_t
|
typedef unsigned int am_res_t; // mach_error_t
|
||||||
|
|
||||||
#ifndef MOBILE_DEV_DIRECT_LINK
|
#ifndef MOBILE_DEV_DIRECT_LINK
|
||||||
@@ -132,7 +133,6 @@ typedef am_res_t (MDEV_API *AMDeviceStopSessionPtr)(AMDeviceRef);
|
|||||||
typedef am_res_t (MDEV_API *AMDeviceDisconnectPtr)(AMDeviceRef);
|
typedef am_res_t (MDEV_API *AMDeviceDisconnectPtr)(AMDeviceRef);
|
||||||
typedef am_res_t (MDEV_API *AMDeviceMountImagePtr)(AMDeviceRef, CFStringRef, CFDictionaryRef,
|
typedef am_res_t (MDEV_API *AMDeviceMountImagePtr)(AMDeviceRef, CFStringRef, CFDictionaryRef,
|
||||||
AMDeviceMountImageCallback, void *);
|
AMDeviceMountImageCallback, void *);
|
||||||
typedef am_res_t (MDEV_API *AMDeviceStartServicePtr)(AMDeviceRef, CFStringRef, ServiceSocket *, void *);
|
|
||||||
typedef am_res_t (MDEV_API *AMDeviceUninstallApplicationPtr)(ServiceSocket, CFStringRef, CFDictionaryRef,
|
typedef am_res_t (MDEV_API *AMDeviceUninstallApplicationPtr)(ServiceSocket, CFStringRef, CFDictionaryRef,
|
||||||
AMDeviceInstallApplicationCallback,
|
AMDeviceInstallApplicationCallback,
|
||||||
void*);
|
void*);
|
||||||
@@ -141,9 +141,10 @@ typedef char * (MDEV_API *AMDErrorStringPtr)(am_res_t);
|
|||||||
typedef CFStringRef (MDEV_API *MISCopyErrorStringForErrorCodePtr)(am_res_t);
|
typedef CFStringRef (MDEV_API *MISCopyErrorStringForErrorCodePtr)(am_res_t);
|
||||||
typedef am_res_t (MDEV_API *USBMuxConnectByPortPtr)(unsigned int, int, ServiceSocket*);
|
typedef am_res_t (MDEV_API *USBMuxConnectByPortPtr)(unsigned int, int, ServiceSocket*);
|
||||||
// secure Api's
|
// secure Api's
|
||||||
typedef am_res_t (MDEV_API *AMDeviceSecureStartServicePtr)(AMDeviceRef, CFStringRef, void *, ServiceSocket *);
|
typedef am_res_t (MDEV_API *AMDeviceSecureStartServicePtr)(AMDeviceRef, CFStringRef, unsigned int *, ServiceConnRef *);
|
||||||
typedef int (MDEV_API *AMDeviceSecureTransferPathPtr)(int, AMDeviceRef, CFURLRef, CFDictionaryRef, AMDeviceSecureInstallApplicationCallback, int);
|
typedef int (MDEV_API *AMDeviceSecureTransferPathPtr)(int, AMDeviceRef, CFURLRef, CFDictionaryRef, AMDeviceSecureInstallApplicationCallback, int);
|
||||||
typedef int (MDEV_API *AMDeviceSecureInstallApplicationPtr)(int, AMDeviceRef, CFURLRef, CFDictionaryRef, AMDeviceSecureInstallApplicationCallback, int);
|
typedef int (MDEV_API *AMDeviceSecureInstallApplicationPtr)(int, AMDeviceRef, CFURLRef, CFDictionaryRef, AMDeviceSecureInstallApplicationCallback, int);
|
||||||
|
typedef int (MDEV_API *AMDServiceConnectionGetSocketPtr)(ServiceConnRef);
|
||||||
|
|
||||||
|
|
||||||
} // extern C
|
} // extern C
|
||||||
@@ -182,7 +183,6 @@ public :
|
|||||||
am_res_t deviceDisconnect(AMDeviceRef);
|
am_res_t deviceDisconnect(AMDeviceRef);
|
||||||
am_res_t deviceMountImage(AMDeviceRef, CFStringRef, CFDictionaryRef,
|
am_res_t deviceMountImage(AMDeviceRef, CFStringRef, CFDictionaryRef,
|
||||||
AMDeviceMountImageCallback, void *);
|
AMDeviceMountImageCallback, void *);
|
||||||
am_res_t deviceStartService(AMDeviceRef, CFStringRef, ServiceSocket *, void *);
|
|
||||||
am_res_t deviceUninstallApplication(int, CFStringRef, CFDictionaryRef,
|
am_res_t deviceUninstallApplication(int, CFStringRef, CFDictionaryRef,
|
||||||
AMDeviceInstallApplicationCallback,
|
AMDeviceInstallApplicationCallback,
|
||||||
void*);
|
void*);
|
||||||
@@ -195,7 +195,8 @@ public :
|
|||||||
void addError(const char *msg);
|
void addError(const char *msg);
|
||||||
|
|
||||||
// Secure API's
|
// Secure API's
|
||||||
am_res_t deviceSecureStartService(AMDeviceRef, CFStringRef, void *, ServiceSocket *);
|
am_res_t deviceSecureStartService(AMDeviceRef, CFStringRef, ServiceConnRef *);
|
||||||
|
int deviceConnectionGetSocket(ServiceConnRef);
|
||||||
int deviceSecureTransferApplicationPath(int, AMDeviceRef, CFURLRef,
|
int deviceSecureTransferApplicationPath(int, AMDeviceRef, CFURLRef,
|
||||||
CFDictionaryRef, AMDeviceSecureInstallApplicationCallback callback, int);
|
CFDictionaryRef, AMDeviceSecureInstallApplicationCallback callback, int);
|
||||||
int deviceSecureInstallApplication(int zero, AMDeviceRef device, CFURLRef url,
|
int deviceSecureInstallApplication(int zero, AMDeviceRef device, CFURLRef url,
|
||||||
@@ -220,10 +221,10 @@ private:
|
|||||||
AMDeviceStopSessionPtr m_AMDeviceStopSession;
|
AMDeviceStopSessionPtr m_AMDeviceStopSession;
|
||||||
AMDeviceDisconnectPtr m_AMDeviceDisconnect;
|
AMDeviceDisconnectPtr m_AMDeviceDisconnect;
|
||||||
AMDeviceMountImagePtr m_AMDeviceMountImage;
|
AMDeviceMountImagePtr m_AMDeviceMountImage;
|
||||||
AMDeviceStartServicePtr m_AMDeviceStartService;
|
|
||||||
AMDeviceSecureStartServicePtr m_AMDeviceSecureStartService;
|
AMDeviceSecureStartServicePtr m_AMDeviceSecureStartService;
|
||||||
AMDeviceSecureTransferPathPtr m_AMDeviceSecureTransferPath;
|
AMDeviceSecureTransferPathPtr m_AMDeviceSecureTransferPath;
|
||||||
AMDeviceSecureInstallApplicationPtr m_AMDeviceSecureInstallApplication;
|
AMDeviceSecureInstallApplicationPtr m_AMDeviceSecureInstallApplication;
|
||||||
|
AMDServiceConnectionGetSocketPtr m_AMDServiceConnectionGetSocket;
|
||||||
AMDeviceUninstallApplicationPtr m_AMDeviceUninstallApplication;
|
AMDeviceUninstallApplicationPtr m_AMDeviceUninstallApplication;
|
||||||
AMDeviceLookupApplicationsPtr m_AMDeviceLookupApplications;
|
AMDeviceLookupApplicationsPtr m_AMDeviceLookupApplications;
|
||||||
AMDErrorStringPtr m_AMDErrorString;
|
AMDErrorStringPtr m_AMDErrorString;
|
||||||
@@ -382,7 +383,6 @@ public:
|
|||||||
|
|
||||||
bool connectDevice();
|
bool connectDevice();
|
||||||
bool disconnectDevice();
|
bool disconnectDevice();
|
||||||
bool startService(const QString &service, ServiceSocket &fd);
|
|
||||||
void stopService(ServiceSocket fd);
|
void stopService(ServiceSocket fd);
|
||||||
void startDeviceLookup(int timeout);
|
void startDeviceLookup(int timeout);
|
||||||
bool connectToPort(quint16 port, ServiceSocket *fd) override;
|
bool connectToPort(quint16 port, ServiceSocket *fd) override;
|
||||||
@@ -978,43 +978,21 @@ bool CommandSession::disconnectDevice()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CommandSession::startService(const QString &serviceName, ServiceSocket &fd)
|
|
||||||
{
|
|
||||||
bool success = true;
|
|
||||||
|
|
||||||
// Connect device. AMDeviceConnect + AMDeviceIsPaired + AMDeviceValidatePairing + AMDeviceStartSession
|
|
||||||
if (connectDevice()) {
|
|
||||||
fd = 0;
|
|
||||||
CFStringRef cfsService = serviceName.toCFString();
|
|
||||||
if (am_res_t error = lib()->deviceStartService(device, cfsService, &fd, 0)) {
|
|
||||||
addError(QString::fromLatin1("Starting service \"%1\" on device %2 failed, AMDeviceStartService returned %3 (0x%4)")
|
|
||||||
.arg(serviceName).arg(deviceId).arg(mobileDeviceErrorString(lib(), error)).arg(QString::number(error, 16)));
|
|
||||||
success = false;
|
|
||||||
fd = -1;
|
|
||||||
}
|
|
||||||
disconnectDevice();
|
|
||||||
CFRelease(cfsService);
|
|
||||||
} else {
|
|
||||||
addError(QString::fromLatin1("Starting service \"%1\" on device %2 failed. Cannot connect to device.")
|
|
||||||
.arg(serviceName).arg(deviceId));
|
|
||||||
success = false;
|
|
||||||
}
|
|
||||||
return success;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool CommandSession::startServiceSecure(const QString &serviceName, ServiceSocket &fd)
|
bool CommandSession::startServiceSecure(const QString &serviceName, ServiceSocket &fd)
|
||||||
{
|
{
|
||||||
bool success = true;
|
bool success = true;
|
||||||
|
|
||||||
// Connect device. AMDeviceConnect + AMDeviceIsPaired + AMDeviceValidatePairing + AMDeviceStartSession
|
// Connect device. AMDeviceConnect + AMDeviceIsPaired + AMDeviceValidatePairing + AMDeviceStartSession
|
||||||
if (connectDevice()) {
|
if (connectDevice()) {
|
||||||
fd = 0;
|
|
||||||
CFStringRef cfsService = serviceName.toCFString();
|
CFStringRef cfsService = serviceName.toCFString();
|
||||||
if (am_res_t error = lib()->deviceSecureStartService(device, cfsService, &fd, 0)) {
|
ServiceConnRef ref;
|
||||||
|
if (am_res_t error = lib()->deviceSecureStartService(device, cfsService, &ref)) {
|
||||||
addError(QString::fromLatin1("Starting(Secure) service \"%1\" on device %2 failed, AMDeviceStartSecureService returned %3 (0x%4)")
|
addError(QString::fromLatin1("Starting(Secure) service \"%1\" on device %2 failed, AMDeviceStartSecureService returned %3 (0x%4)")
|
||||||
.arg(serviceName).arg(deviceId).arg(mobileDeviceErrorString(lib(), error)).arg(QString::number(error, 16)));
|
.arg(serviceName).arg(deviceId).arg(mobileDeviceErrorString(lib(), error)).arg(QString::number(error, 16)));
|
||||||
success = false;
|
success = false;
|
||||||
fd = -1;
|
fd = 0;
|
||||||
|
} else {
|
||||||
|
fd = lib()->deviceConnectionGetSocket(ref);
|
||||||
}
|
}
|
||||||
disconnectDevice();
|
disconnectDevice();
|
||||||
CFRelease(cfsService);
|
CFRelease(cfsService);
|
||||||
@@ -1481,8 +1459,8 @@ bool AppOpSession::runApp()
|
|||||||
addError(QString::fromLatin1("Running app \"%1\" failed. Mount developer disk failed.").arg(bundlePath));
|
addError(QString::fromLatin1("Running app \"%1\" failed. Mount developer disk failed.").arg(bundlePath));
|
||||||
failure = true;
|
failure = true;
|
||||||
}
|
}
|
||||||
if (!failure && !startService(QLatin1String("com.apple.debugserver"), gdbFd))
|
if (!failure && !startServiceSecure(QLatin1String("com.apple.debugserver"), gdbFd))
|
||||||
gdbFd = -1;
|
gdbFd = 0;
|
||||||
|
|
||||||
if (gdbFd > 0) {
|
if (gdbFd > 0) {
|
||||||
// gdbServer protocol, see http://sourceware.org/gdb/onlinedocs/gdb/Remote-Protocol.html#Remote-Protocol
|
// gdbServer protocol, see http://sourceware.org/gdb/onlinedocs/gdb/Remote-Protocol.html#Remote-Protocol
|
||||||
@@ -1771,9 +1749,6 @@ bool MobileDeviceLib::load()
|
|||||||
m_AMDeviceMountImage = reinterpret_cast<AMDeviceMountImagePtr>(lib.resolve("AMDeviceMountImage"));
|
m_AMDeviceMountImage = reinterpret_cast<AMDeviceMountImagePtr>(lib.resolve("AMDeviceMountImage"));
|
||||||
if (m_AMDeviceMountImage == 0)
|
if (m_AMDeviceMountImage == 0)
|
||||||
addError("MobileDeviceLib does not define AMDeviceMountImage");
|
addError("MobileDeviceLib does not define AMDeviceMountImage");
|
||||||
m_AMDeviceStartService = reinterpret_cast<AMDeviceStartServicePtr>(lib.resolve("AMDeviceStartService"));
|
|
||||||
if (m_AMDeviceStartService == 0)
|
|
||||||
addError("MobileDeviceLib does not define AMDeviceStartService");
|
|
||||||
m_AMDeviceSecureStartService = reinterpret_cast<AMDeviceSecureStartServicePtr>(lib.resolve("AMDeviceSecureStartService"));
|
m_AMDeviceSecureStartService = reinterpret_cast<AMDeviceSecureStartServicePtr>(lib.resolve("AMDeviceSecureStartService"));
|
||||||
if (m_AMDeviceSecureStartService == 0)
|
if (m_AMDeviceSecureStartService == 0)
|
||||||
addError("MobileDeviceLib does not define AMDeviceSecureStartService");
|
addError("MobileDeviceLib does not define AMDeviceSecureStartService");
|
||||||
@@ -1783,6 +1758,9 @@ bool MobileDeviceLib::load()
|
|||||||
m_AMDeviceSecureInstallApplication = reinterpret_cast<AMDeviceSecureInstallApplicationPtr>(lib.resolve("AMDeviceSecureInstallApplication"));
|
m_AMDeviceSecureInstallApplication = reinterpret_cast<AMDeviceSecureInstallApplicationPtr>(lib.resolve("AMDeviceSecureInstallApplication"));
|
||||||
if (m_AMDeviceSecureInstallApplication == 0)
|
if (m_AMDeviceSecureInstallApplication == 0)
|
||||||
addError("MobileDeviceLib does not define AMDeviceSecureInstallApplication");
|
addError("MobileDeviceLib does not define AMDeviceSecureInstallApplication");
|
||||||
|
m_AMDServiceConnectionGetSocket = reinterpret_cast<AMDServiceConnectionGetSocketPtr>(lib.resolve("AMDServiceConnectionGetSocket"));
|
||||||
|
if (m_AMDServiceConnectionGetSocket == nullptr)
|
||||||
|
addError("MobileDeviceLib does not define AMDServiceConnectionGetSocket");
|
||||||
m_AMDeviceUninstallApplication = reinterpret_cast<AMDeviceUninstallApplicationPtr>(lib.resolve("AMDeviceUninstallApplication"));
|
m_AMDeviceUninstallApplication = reinterpret_cast<AMDeviceUninstallApplicationPtr>(lib.resolve("AMDeviceUninstallApplication"));
|
||||||
if (m_AMDeviceUninstallApplication == 0)
|
if (m_AMDeviceUninstallApplication == 0)
|
||||||
addError("MobileDeviceLib does not define AMDeviceUninstallApplication");
|
addError("MobileDeviceLib does not define AMDeviceUninstallApplication");
|
||||||
@@ -1921,15 +1899,6 @@ am_res_t MobileDeviceLib::deviceMountImage(AMDeviceRef device, CFStringRef image
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
am_res_t MobileDeviceLib::deviceStartService(AMDeviceRef device, CFStringRef serviceName,
|
|
||||||
ServiceSocket *fdRef, void *extra)
|
|
||||||
{
|
|
||||||
if (m_AMDeviceStartService)
|
|
||||||
return m_AMDeviceStartService(device, serviceName, fdRef, extra);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
am_res_t MobileDeviceLib::deviceUninstallApplication(int serviceFd, CFStringRef bundleId,
|
am_res_t MobileDeviceLib::deviceUninstallApplication(int serviceFd, CFStringRef bundleId,
|
||||||
CFDictionaryRef options,
|
CFDictionaryRef options,
|
||||||
AMDeviceInstallApplicationCallback callback,
|
AMDeviceInstallApplicationCallback callback,
|
||||||
@@ -1980,12 +1949,11 @@ void MobileDeviceLib::addError(const char *msg)
|
|||||||
addError(QLatin1String(msg));
|
addError(QLatin1String(msg));
|
||||||
}
|
}
|
||||||
|
|
||||||
am_res_t MobileDeviceLib::deviceSecureStartService(AMDeviceRef device, CFStringRef serviceName, void *extra, ServiceSocket *fdRef)
|
am_res_t MobileDeviceLib::deviceSecureStartService(AMDeviceRef device, CFStringRef serviceName, ServiceConnRef *fdRef)
|
||||||
{
|
{
|
||||||
int returnCode = -1;
|
|
||||||
if (m_AMDeviceSecureStartService)
|
if (m_AMDeviceSecureStartService)
|
||||||
returnCode = m_AMDeviceSecureStartService(device, serviceName, extra, fdRef);
|
return m_AMDeviceSecureStartService(device, serviceName, nullptr, fdRef);
|
||||||
return returnCode;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int MobileDeviceLib::deviceSecureTransferApplicationPath(int zero, AMDeviceRef device, CFURLRef url, CFDictionaryRef dict, AMDeviceSecureInstallApplicationCallback callback, int args)
|
int MobileDeviceLib::deviceSecureTransferApplicationPath(int zero, AMDeviceRef device, CFURLRef url, CFDictionaryRef dict, AMDeviceSecureInstallApplicationCallback callback, int args)
|
||||||
@@ -2005,6 +1973,13 @@ int MobileDeviceLib::deviceSecureInstallApplication(int zero, AMDeviceRef device
|
|||||||
return returnCode;
|
return returnCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int MobileDeviceLib::deviceConnectionGetSocket(ServiceConnRef ref) {
|
||||||
|
int fd = 0;
|
||||||
|
if (m_AMDServiceConnectionGetSocket)
|
||||||
|
fd = m_AMDServiceConnectionGetSocket(ref);
|
||||||
|
return fd;
|
||||||
|
}
|
||||||
|
|
||||||
void CommandSession::internalDeviceAvailableCallback(QString deviceId, AMDeviceRef device)
|
void CommandSession::internalDeviceAvailableCallback(QString deviceId, AMDeviceRef device)
|
||||||
{
|
{
|
||||||
if (deviceId != this->deviceId && !this->deviceId.isEmpty())
|
if (deviceId != this->deviceId && !this->deviceId.isEmpty())
|
||||||
|
Reference in New Issue
Block a user