Merge branch 'dev' into feature/killswitch
This commit is contained in:
commit
65a04799ef
294 changed files with 9840 additions and 85333 deletions
|
|
@ -1,39 +1,21 @@
|
|||
#include <QDebug>
|
||||
#include <QHostAddress>
|
||||
#include <QJsonArray>
|
||||
#include <QJsonDocument>
|
||||
#include <QJsonObject>
|
||||
#include <QRandomGenerator>
|
||||
#include <QTextCodec>
|
||||
#include <QTimer>
|
||||
|
||||
#include "android_vpnprotocol.h"
|
||||
|
||||
#include "platforms/android/android_controller.h"
|
||||
|
||||
|
||||
AndroidVpnProtocol::AndroidVpnProtocol(Proto protocol, const QJsonObject &configuration, QObject* parent)
|
||||
: VpnProtocol(configuration, parent),
|
||||
m_protocol(protocol)
|
||||
AndroidVpnProtocol::AndroidVpnProtocol(const QJsonObject &configuration, QObject* parent)
|
||||
: VpnProtocol(configuration, parent)
|
||||
{ }
|
||||
|
||||
ErrorCode AndroidVpnProtocol::start()
|
||||
{
|
||||
AndroidController::instance()->setVpnConfig(m_rawConfig);
|
||||
return AndroidController::instance()->start();
|
||||
qDebug() << "AndroidVpnProtocol::start()";
|
||||
return AndroidController::instance()->start(m_rawConfig);
|
||||
}
|
||||
|
||||
void AndroidVpnProtocol::stop()
|
||||
{
|
||||
qDebug() << "AndroidVpnProtocol::stop()";
|
||||
setConnectionState(Vpn::ConnectionState::Disconnecting);
|
||||
AndroidController::instance()->stop();
|
||||
}
|
||||
|
||||
void AndroidVpnProtocol::connectionDataUpdated(QString totalRx, QString totalTx, QString endpoint, QString deviceIPv4)
|
||||
{
|
||||
quint64 rxBytes = totalRx.toLongLong();
|
||||
quint64 txBytes = totalTx.toLongLong();
|
||||
|
||||
setBytesChanged(rxBytes, txBytes);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
#define ANDROID_VPNPROTOCOL_H
|
||||
|
||||
#include "vpnprotocol.h"
|
||||
#include "protocols/protocols_defs.h"
|
||||
|
||||
using namespace amnezia;
|
||||
|
||||
|
|
@ -11,25 +10,11 @@ class AndroidVpnProtocol : public VpnProtocol
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit AndroidVpnProtocol(Proto protocol, const QJsonObject& configuration, QObject* parent = nullptr);
|
||||
virtual ~AndroidVpnProtocol() override = default;
|
||||
explicit AndroidVpnProtocol(const QJsonObject& configuration, QObject* parent = nullptr);
|
||||
~AndroidVpnProtocol() override = default;
|
||||
|
||||
ErrorCode start() override;
|
||||
void stop() override;
|
||||
|
||||
signals:
|
||||
|
||||
|
||||
public slots:
|
||||
void connectionDataUpdated(QString totalRx, QString totalTx, QString endpoint, QString deviceIPv4);
|
||||
|
||||
protected slots:
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
private:
|
||||
Proto m_protocol;
|
||||
};
|
||||
|
||||
#endif // ANDROID_VPNPROTOCOL_H
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ namespace amnezia
|
|||
constexpr char dns2[] = "dns2";
|
||||
|
||||
constexpr char description[] = "description";
|
||||
constexpr char name[] = "name";
|
||||
constexpr char cert[] = "cert";
|
||||
constexpr char config[] = "config";
|
||||
|
||||
|
|
@ -79,6 +80,8 @@ namespace amnezia
|
|||
constexpr char sftp[] = "sftp";
|
||||
constexpr char awg[] = "awg";
|
||||
|
||||
constexpr char configVersion[] = "config_version";
|
||||
|
||||
constexpr char splitTunnelSites[] = "splitTunnelSites";
|
||||
constexpr char splitTunnelType[] = "splitTunnelType";
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue