Android service wireguard build

This commit is contained in:
pokamest 2021-09-30 18:16:41 +03:00
parent 133a3e67d2
commit bac7b3ab37
6 changed files with 24 additions and 8 deletions

3
.gitmodules vendored
View file

@ -1,3 +1,6 @@
[submodule "3rd/QtSsh"]
path = 3rd/QtSsh
url = https://github.com/amnezia-vpn/QtSsh.git
[submodule "client/3rd/wireguard-tools"]
path = client/3rd/wireguard-tools
url = https://github.com/WireGuard/wireguard-tools/

@ -0,0 +1 @@
Subproject commit 7a321ce808ef9cec1f45cce92befcc9e170d3aa9

View file

@ -104,9 +104,9 @@ android {
targetSdkVersion = qtTargetSdkVersion
}
// externalNativeBuild {
// cmake {
// path 'tunnel/CMakeLists.txt'
// }
// }
externalNativeBuild {
cmake {
path 'wireguard/CMakeLists.txt'
}
}
}

View file

@ -34,7 +34,6 @@ HEADERS += \
debug.h \
defines.h \
managementserver.h \
protocols/android_vpnprotocol.h \
protocols/openvpnovercloakprotocol.h \
protocols/protocols_defs.h \
protocols/shadowsocksvpnprotocol.h \
@ -88,7 +87,6 @@ SOURCES += \
debug.cpp \
main.cpp \
managementserver.cpp \
protocols/android_vpnprotocol.cpp \
protocols/openvpnovercloakprotocol.cpp \
protocols/protocols_defs.cpp \
protocols/shadowsocksvpnprotocol.cpp \
@ -181,6 +179,12 @@ android {
INCLUDEPATH += platforms/android
HEADERS += protocols/android_vpnprotocol.h \
SOURCES += protocols/android_vpnprotocol.cpp \
DISTFILES += \
android/AndroidManifest.xml \
android/build.gradle \

View file

@ -74,7 +74,7 @@ void OtherProtocolsLogic::onPushButtonSftpMountDriveClicked()
set_pushButtonSftpMountEnabled(false);
QProcess *p = new QProcess;
m_sftpMpuntProcesses.append(p);
m_sftpMountProcesses.append(p);
p->setProcessChannelMode(QProcess::MergedChannels);
connect(p, &QProcess::readyRead, this, [this, p, letter](){

View file

@ -10,6 +10,10 @@
#include <core/servercontroller.h>
#include <protocols/wireguardprotocol.h>
#ifdef Q_OS_ANDROID
#include <protocols/android_vpnprotocol.h>
#endif
#include "ipc.h"
#include "core/ipcclient.h"
#include "protocols/openvpnprotocol.h"
@ -316,7 +320,11 @@ ErrorCode VpnConnection::connectToVpn(int serverIndex,
return e;
}
#ifdef Q_OS_ANDROID
m_vpnProtocol.reset(new AndroidVpnProtocol(Protocol::WireGuard, m_vpnConfiguration));
#else
m_vpnProtocol.reset(new WireguardProtocol(m_vpnConfiguration));
#endif
}
connect(m_vpnProtocol.data(), &VpnProtocol::protocolError, this, &VpnConnection::vpnProtocolError);