Some fixes for Qt6 Android

This commit is contained in:
pokamest 2022-08-31 15:18:33 +03:00
parent 33ec69d33a
commit ac74510d47
7 changed files with 59 additions and 28 deletions

View file

@ -37,13 +37,27 @@ linux-g++ {
}
android {
for (abi, ANDROID_ABIS): {
equals(ANDROID_TARGET_ARCH,$$abi) {
INCLUDEPATH += $$PWD/android/$${abi}
HEADERS += $$PWD/android/$${abi}/botan_all.h
SOURCES += $$PWD/android/$${abi}/botan_all.cpp
}
}
versionAtLeast(QT_VERSION, 6.0.0) {
# We need to include qtprivate api's
# As QAndroidBinder is not yet implemented with a public api
QT+=core-private
ANDROID_ABIS=ANDROID_TARGET_ARCH
INCLUDEPATH += $$PWD/android/$${ANDROID_TARGET_ARCH}
HEADERS += $$PWD/android/$${ANDROID_TARGET_ARCH}/botan_all.h
SOURCES += $$PWD/android/$${ANDROID_TARGET_ARCH}/botan_all.cpp
}
else {
QT += androidextras
for (abi, ANDROID_ABIS): {
equals(ANDROID_TARGET_ARCH,$$abi) {
INCLUDEPATH += $$PWD/android/$${abi}
HEADERS += $$PWD/android/$${abi}/botan_all.h
SOURCES += $$PWD/android/$${abi}/botan_all.cpp
}
}
}
}
ios: {

View file

@ -231,7 +231,18 @@ win32|macx|linux:!android {
}
android {
QT += androidextras
message(Platform: android)
message("$$ANDROID_TARGET_ARCH")
versionAtLeast(QT_VERSION, 6.0.0) {
# We need to include qtprivate api's
# As QAndroidBinder is not yet implemented with a public api
QT+=core-private
ANDROID_ABIS=ANDROID_TARGET_ARCH
}
else {
QT += androidextras
}
DEFINES += MVPN_ANDROID
INCLUDEPATH += platforms/android

View file

@ -1,9 +1,9 @@
#include <QAndroidBinder>
#include <QAndroidIntent>
#include <QAndroidJniEnvironment>
#include <QAndroidJniObject>
#include <QAndroidParcel>
#include <QAndroidServiceConnection>
//#include <QAndroidBinder>
//#include <QAndroidIntent>
//#include <QAndroidJniEnvironment>
//#include <QAndroidJniObject>
//#include <QAndroidParcel>
//#include <QAndroidServiceConnection>
#include <QDebug>
#include <QHostAddress>
#include <QJsonArray>
@ -12,7 +12,10 @@
#include <QRandomGenerator>
#include <QTextCodec>
#include <QTimer>
#include <QtAndroid>
//#include <QtAndroid>
#include <QtCore/private/qandroidextras_p.h>
#include "android_controller.h"
#include "core/errorstrings.h"

View file

@ -1,8 +1,9 @@
#ifndef ANDROID_CONTROLLER_H
#define ANDROID_CONTROLLER_H
#include <QAndroidBinder>
#include <QAndroidServiceConnection>
//#include <QAndroidBinder>
//#include <QAndroidServiceConnection>
#include <QtCore/private/qandroidextras_p.h>
#include "protocols/vpnprotocol.h"
using namespace amnezia;

View file

@ -1,9 +1,9 @@
#include <QAndroidBinder>
#include <QAndroidIntent>
#include <QAndroidJniEnvironment>
#include <QAndroidJniObject>
#include <QAndroidParcel>
#include <QAndroidServiceConnection>
//#include <QAndroidBinder>
//#include <QAndroidIntent>
//#include <QAndroidJniEnvironment>
//#include <QAndroidJniObject>
//#include <QAndroidParcel>
//#include <QAndroidServiceConnection>
#include <QDebug>
#include <QHostAddress>
#include <QJsonArray>
@ -12,7 +12,9 @@
#include <QRandomGenerator>
#include <QTextCodec>
#include <QTimer>
#include <QtAndroid>
//#include <QtAndroid>
#include <QtCore/private/qandroidextras_p.h>
#include "android_vpnprotocol.h"
#include "core/errorstrings.h"

View file

@ -123,9 +123,9 @@ void Autostart::setAutostart(bool autostart) {
if (file.open(QIODevice::ReadWrite)) {
QTextStream stream(&file);
stream << "[Desktop Entry]" << endl;
stream << "Exec=" << appPath() << endl;
stream << "Type=Application" << endl;
stream << "[Desktop Entry]" << Qt::endl;
stream << "Exec=" << appPath() << Qt::endl;
stream << "Type=Application" << Qt::endl;
}
}
}

View file

@ -18,7 +18,7 @@
#include <QTimer>
#include <QRegularExpression>
#include <QQmlFile>
#include <QStandardPaths>
#include "configurators/cloak_configurator.h"
#include "configurators/vpn_configurator.h"
#include "configurators/openvpn_configurator.h"