2016-01-15 14:57:40 +01:00
|
|
|
/****************************************************************************
|
2012-04-24 15:49:09 +02:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 BogDan Vatra <bog_dan_ro@yahoo.com>
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2012-04-24 15:49:09 +02:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2012-04-24 15:49:09 +02:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
2016-01-15 14:57:40 +01:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
2012-04-24 15:49:09 +02:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** GNU General Public License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
2012-04-24 15:49:09 +02:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2012-04-24 15:49:09 +02:00
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2012-04-24 15:49:09 +02:00
|
|
|
|
2014-06-25 15:42:11 +02:00
|
|
|
#include "android_global.h"
|
2012-04-24 15:49:09 +02:00
|
|
|
|
2013-08-28 15:48:02 +02:00
|
|
|
#include <QPair>
|
2012-04-24 15:49:09 +02:00
|
|
|
#include <QObject>
|
|
|
|
|
|
2014-06-25 15:42:11 +02:00
|
|
|
namespace ProjectExplorer {
|
|
|
|
|
class Kit;
|
|
|
|
|
class Target;
|
|
|
|
|
}
|
2012-04-24 15:49:09 +02:00
|
|
|
|
2015-03-05 11:56:15 +01:00
|
|
|
namespace Utils { class FileName; }
|
|
|
|
|
|
2012-04-24 15:49:09 +02:00
|
|
|
namespace Android {
|
2014-06-25 15:42:11 +02:00
|
|
|
|
2014-06-24 16:47:38 +02:00
|
|
|
class AndroidQtSupport;
|
2012-04-24 15:49:09 +02:00
|
|
|
|
2014-06-25 15:42:11 +02:00
|
|
|
class ANDROID_EXPORT AndroidManager : public QObject
|
2012-04-24 15:49:09 +02:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
static QString packageName(ProjectExplorer::Target *target);
|
2014-10-24 17:53:05 +02:00
|
|
|
static QString packageName(const Utils::FileName &manifestFile);
|
2012-04-24 15:49:09 +02:00
|
|
|
|
|
|
|
|
static QString intentName(ProjectExplorer::Target *target);
|
|
|
|
|
static QString activityName(ProjectExplorer::Target *target);
|
|
|
|
|
|
2013-04-19 12:27:58 +02:00
|
|
|
static bool bundleQt(ProjectExplorer::Target *target);
|
2013-09-17 18:24:57 +02:00
|
|
|
static QString deviceSerialNumber(ProjectExplorer::Target *target);
|
2014-06-25 15:42:11 +02:00
|
|
|
static void setDeviceSerialNumber(ProjectExplorer::Target *target, const QString &deviceSerialNumber);
|
2013-03-07 13:22:21 +01:00
|
|
|
|
2018-03-17 09:31:56 +02:00
|
|
|
static int deviceApiLevel(ProjectExplorer::Target *target);
|
|
|
|
|
static void setDeviceApiLevel(ProjectExplorer::Target *target, int level);
|
|
|
|
|
|
2013-08-28 15:20:54 +02:00
|
|
|
static QString buildTargetSDK(ProjectExplorer::Target *target);
|
2014-06-25 15:42:11 +02:00
|
|
|
|
|
|
|
|
static bool signPackage(ProjectExplorer::Target *target);
|
|
|
|
|
|
2013-08-28 15:23:04 +02:00
|
|
|
static int minimumSDK(ProjectExplorer::Target *target);
|
2016-08-17 18:46:12 +02:00
|
|
|
static int minimumSDK(const ProjectExplorer::Kit *kit);
|
2012-04-24 15:49:09 +02:00
|
|
|
|
2013-05-03 15:10:21 +02:00
|
|
|
static QString targetArch(ProjectExplorer::Target *target);
|
|
|
|
|
|
2012-04-24 15:49:09 +02:00
|
|
|
static Utils::FileName dirPath(ProjectExplorer::Target *target);
|
|
|
|
|
static Utils::FileName manifestPath(ProjectExplorer::Target *target);
|
2015-01-27 18:46:40 +01:00
|
|
|
static Utils::FileName manifestSourcePath(ProjectExplorer::Target *target);
|
2012-04-24 15:49:09 +02:00
|
|
|
static Utils::FileName defaultPropertiesPath(ProjectExplorer::Target *target);
|
|
|
|
|
|
2014-05-07 15:03:43 +03:00
|
|
|
static QPair<int, int> apiLevelRange();
|
2013-08-14 13:39:45 +02:00
|
|
|
static QString androidNameForApiLevel(int x);
|
|
|
|
|
|
2013-09-17 18:24:57 +02:00
|
|
|
static void cleanLibsOnDevice(ProjectExplorer::Target *target);
|
|
|
|
|
static void installQASIPackage(ProjectExplorer::Target *target, const QString &packagePath);
|
|
|
|
|
|
|
|
|
|
static bool checkKeystorePassword(const QString &keystorePath, const QString &keystorePasswd);
|
|
|
|
|
static bool checkCertificatePassword(const QString &keystorePath, const QString &keystorePasswd, const QString &alias, const QString &certificatePasswd);
|
2017-01-10 16:33:56 +01:00
|
|
|
static bool checkCertificateExists(const QString &keystorePath, const QString &keystorePasswd,
|
|
|
|
|
const QString &alias);
|
2014-06-24 16:47:10 +02:00
|
|
|
static bool checkForQt51Files(Utils::FileName fileName);
|
2014-06-24 16:47:38 +02:00
|
|
|
static AndroidQtSupport *androidQtSupport(ProjectExplorer::Target *target);
|
2014-09-22 16:20:51 +03:00
|
|
|
static bool updateGradleProperties(ProjectExplorer::Target *target);
|
2017-03-30 14:43:13 +02:00
|
|
|
static int findApiLevel(const Utils::FileName &platformPath);
|
2018-07-03 11:51:28 +02:00
|
|
|
|
|
|
|
|
static void runAdbCommandDetached(const QStringList &args);
|
|
|
|
|
static bool runAdbCommand(const QStringList &args, QString *output = nullptr);
|
2012-04-24 15:49:09 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace Android
|