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"] [submodule "3rd/QtSsh"]
path = 3rd/QtSsh path = 3rd/QtSsh
url = https://github.com/amnezia-vpn/QtSsh.git 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 targetSdkVersion = qtTargetSdkVersion
} }
// externalNativeBuild { externalNativeBuild {
// cmake { cmake {
// path 'tunnel/CMakeLists.txt' path 'wireguard/CMakeLists.txt'
// } }
// } }
} }

View file

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

View file

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

View file

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