mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-07-03 14:07:39 +02:00
Compare commits
6 Commits
dev-netadapters
...
2.0.5
| Author | SHA1 | Date | |
|---|---|---|---|
| 343e6a50df | |||
| 5aa47d35e7 | |||
| 313ceed1d0 | |||
| ac07d62344 | |||
| 2db1bbae4b | |||
| 4eef127744 |
@@ -38,13 +38,9 @@ apply plugin: 'kotlinx-serialization'
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
|
||||
implementation 'androidx.core:core-ktx:1.1.0'
|
||||
implementation 'com.android.installreferrer:installreferrer:2.2'
|
||||
implementation 'com.android.billingclient:billing-ktx:4.0.0'
|
||||
implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.4.0-alpha02"
|
||||
implementation "androidx.security:security-crypto:1.1.0-alpha03"
|
||||
implementation "androidx.security:security-identity-credential:1.0.0-alpha02"
|
||||
implementation 'com.adjust.sdk:adjust-android:4.28.2'
|
||||
implementation 'com.google.android.gms:play-services-ads-identifier:17.0.1'
|
||||
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.2.2"
|
||||
coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:1.0.10"
|
||||
}
|
||||
@@ -106,8 +102,8 @@ android {
|
||||
resConfig "en"
|
||||
minSdkVersion = 24
|
||||
targetSdkVersion = 30
|
||||
versionCode 2 // Change to a higher number
|
||||
versionName "2.0.1" // Change to a higher number
|
||||
versionCode 5 // Change to a higher number
|
||||
versionName "2.0.5" // Change to a higher number
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
|
||||
+2
-2
@@ -4,7 +4,7 @@
|
||||
#define APPLICATION_NAME "AmneziaVPN"
|
||||
#define SERVICE_NAME "AmneziaVPN-service"
|
||||
#define ORGANIZATION_NAME "AmneziaVPN.ORG"
|
||||
#define APP_MAJOR_VERSION "2.0.1"
|
||||
#define APP_VERSION "2.0.1.0"
|
||||
#define APP_MAJOR_VERSION "2.0.5"
|
||||
#define APP_VERSION "2.0.5.0"
|
||||
|
||||
#endif // DEFINES_H
|
||||
|
||||
@@ -17,9 +17,9 @@ iptables -A FORWARD -i wg0 -j ACCEPT
|
||||
iptables -A OUTPUT -o wg0 -j ACCEPT
|
||||
|
||||
# Allow forwarding traffic only from the VPN.
|
||||
iptables -A FORWARD -i wg0 -o eth0 -s $WIREGUARD_SUBNET_IP/$WIREGUARD_SUBNET_MASK_CIDR -j ACCEPT
|
||||
iptables -A FORWARD -i wg0 -o eth0 -s $WIREGUARD_SUBNET_IP/$WIREGUARD_SUBNET_CIDR -j ACCEPT
|
||||
iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
|
||||
|
||||
iptables -t nat -A POSTROUTING -s $WIREGUARD_SUBNET_IP/$OPENVPN_SUBNET_CIDR -o eth0 -j MASQUERADE
|
||||
iptables -t nat -A POSTROUTING -s $WIREGUARD_SUBNET_IP/$WIREGUARD_SUBNET_CIDR -o eth0 -j MASQUERADE
|
||||
|
||||
tail -f /dev/null
|
||||
|
||||
@@ -167,6 +167,7 @@ void StartPageLogic::onPushButtonImport()
|
||||
m_settings.addServer(o);
|
||||
m_settings.setDefaultServer(m_settings.serversCount() - 1);
|
||||
|
||||
emit uiLogic()->goToPage(Page::Vpn);
|
||||
emit uiLogic()->setStartPage(Page::Vpn);
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include "vpnconnection.h"
|
||||
#include <functional>
|
||||
#include "../uilogic.h"
|
||||
#include "defines.h"
|
||||
|
||||
|
||||
VpnLogic::VpnLogic(UiLogic *logic, QObject *parent):
|
||||
@@ -13,7 +14,6 @@ VpnLogic::VpnLogic(UiLogic *logic, QObject *parent):
|
||||
m_radioButtonVpnModeAllSitesChecked{true},
|
||||
m_radioButtonVpnModeForwardSitesChecked{false},
|
||||
m_radioButtonVpnModeExceptSitesChecked{false},
|
||||
m_pushButtonVpnAddSiteEnabled{true},
|
||||
|
||||
m_labelSpeedReceivedText{tr("0 Mbps")},
|
||||
m_labelSpeedSentText{tr("0 Mbps")},
|
||||
@@ -42,7 +42,6 @@ void VpnLogic::onUpdatePage()
|
||||
set_radioButtonVpnModeAllSitesChecked(mode == Settings::VpnAllSites);
|
||||
set_radioButtonVpnModeForwardSitesChecked(mode == Settings::VpnOnlyForwardSites);
|
||||
set_radioButtonVpnModeExceptSitesChecked(mode == Settings::VpnAllExceptSites);
|
||||
set_pushButtonVpnAddSiteEnabled(mode != Settings::VpnAllSites);
|
||||
|
||||
const QJsonObject &server = uiLogic()->m_settings.defaultServer();
|
||||
QString serverString = QString("%2 (%3)")
|
||||
@@ -53,22 +52,35 @@ void VpnLogic::onUpdatePage()
|
||||
DockerContainer selectedContainer = m_settings.defaultContainer(m_settings.defaultServerIndex());
|
||||
QString selectedContainerName = ContainerProps::containerHumanNames().value(selectedContainer);
|
||||
set_labelCurrentService(selectedContainerName);
|
||||
|
||||
set_isContainerWorkingOnPlatform(ContainerProps::isWorkingOnPlatform(selectedContainer));
|
||||
if (!isContainerWorkingOnPlatform()) {
|
||||
set_labelErrorText(tr("AmneziaVPN not supporting selected protocol on this device. Select another protocol."));
|
||||
}
|
||||
else {
|
||||
set_labelErrorText("");
|
||||
}
|
||||
QString ver = QString("v. %2").arg(QString(APP_MAJOR_VERSION));
|
||||
set_labelVersionText(ver);
|
||||
}
|
||||
|
||||
|
||||
void VpnLogic::onRadioButtonVpnModeAllSitesClicked()
|
||||
{
|
||||
m_settings.setRouteMode(Settings::VpnAllSites);
|
||||
onUpdatePage();
|
||||
}
|
||||
|
||||
void VpnLogic::onRadioButtonVpnModeForwardSitesClicked()
|
||||
{
|
||||
m_settings.setRouteMode(Settings::VpnOnlyForwardSites);
|
||||
onUpdatePage();
|
||||
}
|
||||
|
||||
void VpnLogic::onRadioButtonVpnModeExceptSitesClicked()
|
||||
{
|
||||
m_settings.setRouteMode(Settings::VpnAllExceptSites);
|
||||
onUpdatePage();
|
||||
}
|
||||
|
||||
void VpnLogic::onBytesChanged(quint64 receivedData, quint64 sentData)
|
||||
|
||||
@@ -19,8 +19,10 @@ class VpnLogic : public PageLogicBase
|
||||
AUTO_PROPERTY(bool, pushButtonConnectEnabled)
|
||||
AUTO_PROPERTY(bool, pushButtonConnectVisible)
|
||||
AUTO_PROPERTY(bool, widgetVpnModeEnabled)
|
||||
AUTO_PROPERTY(bool, isContainerWorkingOnPlatform)
|
||||
|
||||
AUTO_PROPERTY(QString, labelErrorText)
|
||||
AUTO_PROPERTY(bool, pushButtonVpnAddSiteEnabled)
|
||||
AUTO_PROPERTY(QString, labelVersionText)
|
||||
|
||||
AUTO_PROPERTY(bool, radioButtonVpnModeAllSitesChecked)
|
||||
AUTO_PROPERTY(bool, radioButtonVpnModeForwardSitesChecked)
|
||||
|
||||
@@ -20,6 +20,16 @@ PageBase {
|
||||
source: "qrc:/images/background_connected.png"
|
||||
}
|
||||
|
||||
LabelType {
|
||||
x: 10
|
||||
y: 5
|
||||
width: 100
|
||||
height: 21
|
||||
text: VpnLogic.labelVersionText
|
||||
color: "#dddddd"
|
||||
font.pixelSize: 12
|
||||
}
|
||||
|
||||
ImageButtonType {
|
||||
x: parent.width - 40
|
||||
y: 10
|
||||
@@ -61,7 +71,7 @@ PageBase {
|
||||
}
|
||||
contentItem: Item {}
|
||||
antialiasing: true
|
||||
enabled: VpnLogic.pushButtonConnectEnabled
|
||||
enabled: VpnLogic.pushButtonConnectEnabled && VpnLogic.isContainerWorkingOnPlatform
|
||||
opacity: VpnLogic.pushButtonConnectVisible ? 1 : 0
|
||||
|
||||
// transitions: Transition {
|
||||
@@ -141,11 +151,14 @@ PageBase {
|
||||
id: error_text
|
||||
anchors.top: layout2.bottom
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
width: parent.width
|
||||
anchors.topMargin: 20
|
||||
width: parent.width - 20
|
||||
|
||||
height: 21
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
wrapMode: Text.Wrap
|
||||
text: VpnLogic.labelErrorText
|
||||
color: "red"
|
||||
}
|
||||
|
||||
Item {
|
||||
@@ -273,7 +286,7 @@ PageBase {
|
||||
width: parent.width - 40
|
||||
height: GC.isMobile() ? 0: 40
|
||||
text: qsTr("+ Add site")
|
||||
enabled: VpnLogic.pushButtonVpnAddSiteEnabled
|
||||
enabled: ! VpnLogic.radioButtonVpnModeAllSitesChecked
|
||||
background: Rectangle {
|
||||
anchors.fill: parent
|
||||
radius: 4
|
||||
|
||||
@@ -36,7 +36,7 @@ PageShareProtocolBase {
|
||||
ColumnLayout {
|
||||
id: content
|
||||
enabled: logic.pageEnabled
|
||||
anchors.top: parent.bottom
|
||||
anchors.top: parent.top
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
|
||||
|
||||
@@ -47,6 +47,7 @@ void VpnConnection::onConnectionStateChanged(VpnProtocol::VpnConnectionState sta
|
||||
{
|
||||
if (IpcClient::Interface()) {
|
||||
if (state == VpnProtocol::Connected){
|
||||
IpcClient::Interface()->resetIpStack();
|
||||
IpcClient::Interface()->flushDns();
|
||||
|
||||
if (m_settings.routeMode() != Settings::VpnAllSites) {
|
||||
|
||||
@@ -11,6 +11,7 @@ class IpcInterface
|
||||
SLOT( bool clearSavedRoutes() );
|
||||
SLOT( bool routeDeleteList(const QString &gw, const QStringList &ip) );
|
||||
SLOT( void flushDns() );
|
||||
SLOT( void resetIpStack() );
|
||||
|
||||
SLOT( bool checkAndInstallDriver() );
|
||||
SLOT( QStringList getTapList() );
|
||||
|
||||
@@ -83,6 +83,11 @@ void IpcServer::flushDns()
|
||||
return Router::flushDns();
|
||||
}
|
||||
|
||||
void IpcServer::resetIpStack()
|
||||
{
|
||||
Router::resetIpStack();
|
||||
}
|
||||
|
||||
bool IpcServer::checkAndInstallDriver()
|
||||
{
|
||||
#ifdef Q_OS_WIN
|
||||
|
||||
@@ -20,6 +20,7 @@ public:
|
||||
virtual bool clearSavedRoutes() override;
|
||||
virtual bool routeDeleteList(const QString &gw, const QStringList &ips) override;
|
||||
virtual void flushDns() override;
|
||||
virtual void resetIpStack() override;
|
||||
virtual bool checkAndInstallDriver() override;
|
||||
virtual QStringList getTapList() override;
|
||||
|
||||
|
||||
@@ -53,3 +53,14 @@ void Router::flushDns()
|
||||
#endif
|
||||
}
|
||||
|
||||
void Router::resetIpStack()
|
||||
{
|
||||
#ifdef Q_OS_WIN
|
||||
RouterWin::Instance().resetIpStack();
|
||||
#elif defined (Q_OS_MAC)
|
||||
// todo fixme
|
||||
#elif defined Q_OS_LINUX
|
||||
// todo fixme
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ public:
|
||||
static bool clearSavedRoutes();
|
||||
static int routeDeleteList(const QString &gw, const QStringList &ips);
|
||||
static void flushDns();
|
||||
static void resetIpStack();
|
||||
};
|
||||
|
||||
#endif // ROUTER_H
|
||||
|
||||
@@ -289,6 +289,27 @@ void RouterWin::flushDns()
|
||||
//qDebug().noquote() << "OUTPUT ipconfig /flushdns: " + p.readAll();
|
||||
}
|
||||
|
||||
void RouterWin::resetIpStack()
|
||||
{
|
||||
// {
|
||||
// QProcess p;
|
||||
// QString command = QString("ipconfig /release");
|
||||
// p.start(command);
|
||||
// }
|
||||
{
|
||||
QProcess p;
|
||||
QString command = QString("netsh int ip reset");
|
||||
p.start(command);
|
||||
p.waitForFinished();
|
||||
}
|
||||
{
|
||||
QProcess p;
|
||||
QString command = QString("netsh winsock reset");
|
||||
p.start(command);
|
||||
p.waitForFinished();
|
||||
}
|
||||
}
|
||||
|
||||
void RouterWin::suspendWcmSvc(bool suspend)
|
||||
{
|
||||
if (suspend == m_suspended) return;
|
||||
|
||||
@@ -39,6 +39,7 @@ public:
|
||||
bool clearSavedRoutes();
|
||||
int routeDeleteList(const QString &gw, const QStringList &ips);
|
||||
void flushDns();
|
||||
void resetIpStack();
|
||||
|
||||
void suspendWcmSvc(bool suspend);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user