Compare commits

...

37 Commits

Author SHA1 Message Date
Cyril Anisimov 3e391a0535 Make XRay port changable 2024-08-18 15:28:02 +02:00
pokamest 8fefae0325 Merge pull request #974 from amnezia-vpn/bugfix/service-is-running
temporarily disabled the running service check
2024-08-14 16:57:45 +01:00
vladimir.kuznetsov ede633ea03 temporarily disabled the running service check 2024-08-14 19:46:20 +04:00
pokamest b4469064a2 Merge pull request #967 from amnezia-vpn/refactoring/awg-additional-parameters
update default values of additional awg parameters
2024-08-14 10:07:45 +01:00
pokamest 393e289784 Merge pull request #968 from amnezia-vpn/feature/xray-custom-port
feature/xray custom port
2024-08-12 08:34:13 +01:00
Cyril Anisimov d18423ee8c Feature/xray custom port (#965)
* add variable port to scripts for xray

* update naming
2024-08-12 08:27:52 +01:00
vladimir.kuznetsov 3fc9edd346 update default values of additional awg parameters 2024-08-12 09:56:00 +04:00
pokamest 1a1f75d873 Merge pull request #920 from sobolevn/patch-1 2024-08-08 16:16:23 +01:00
pokamest df02e0bf78 Merge pull request #950 from amnezia-vpn/bugfix/awg-page-settings-translations 2024-08-08 16:14:38 +01:00
Garegin Harutyunyan 264d77463d Refactoring/service logging functional (#793) 2024-08-08 16:13:49 +01:00
vladimir.kuznetsov 0a37ffd5e3 added qsTr() for PageProtocolAwgSettings 2024-08-08 09:57:51 +04:00
pokamest 1343d10aa7 Merge pull request #919 from amnezia-vpn/fix/android-clipboard
Fix calling paste from clipboard when launching app on android
2024-08-06 12:42:11 +01:00
pokamest 6f96ebd8bf Merge pull request #942 from amnezia-vpn/version-bump
Bump version to 4.6.1.0
2024-08-06 10:53:38 +01:00
albexk cb531dacb3 Bump version to 4.6.1.0 2024-08-06 12:51:23 +03:00
albexk dfd0b4d0e5 Fix Android bugs (#941)
* Add an explicit value for the hasFragileUserData parameter

* Fix app crashes when canceling file opening

* Fix requestNetwork bug for Android 11

* Fix activity onStop method
2024-08-06 10:44:51 +01:00
albexk f978f55e7f Android TV (#933)
* Disable touchscreen requirement

* Add Android TV feature

* Add Android TV draft banner

* Add Android TV check method
2024-08-06 10:41:44 +01:00
sobolevn dc85a99e08 Fix Android section rendering in the README 2024-08-03 13:19:17 +03:00
albexk ef06fcb4f4 Fix calling paste from clipboard when launching app on android 2024-08-03 13:02:34 +03:00
pokamest ffe2314d47 Merge pull request #912 from amnezia-vpn/bugfix/qt6.7-ui-fix
Fixed ui bug on qt6.7
2024-07-29 12:03:37 +01:00
pokamest 4e970322d0 Merge pull request #901 from amnezia-vpn/update-translation
update the Arabic translation
2024-07-27 18:45:05 +01:00
Nikita Titov 8dee0d27cf Rename Shadowsocks (#891) 2024-07-27 18:42:11 +01:00
Mykola Baibuz c520f9a2a4 Update OpenVPN to last version (#837)
* Update OpenVPN to least version

* Fix iOS build

* Fix client config for new OpenVPN3

* Update iOS submodule

* Resolve 3rd-prebuilt merge conflict
2024-07-27 18:38:55 +01:00
Garegin866 003c3a23c4 Fixed ui bug on qt6.7 2024-07-26 22:26:15 +04:00
pokamest 1754a82f67 iOS build fix 2024-07-22 15:29:48 +03:00
pokamest 3384008277 Merge pull request #899 from amnezia-vpn/bugfix/udp-for-ios
bugfix for udp for ios
2024-07-22 14:40:24 +03:00
pokamest af22115706 Merge pull request #896 from amnezia-vpn/bugfix/dns-for-xray-ios
dns fix for xray(ios)
2024-07-22 14:39:44 +03:00
Nikita Titov 4b114fd3b6 Fix imgs and list in README (#900)
* Fix imgs and list in README

* Reorder download badges in README
2024-07-22 02:42:56 +03:00
Shehab Ahmed 9d531f5d74 update the Arabic translation 2024-07-19 21:24:28 +03:00
Boris Verbitskii a5564148f5 bugfix for udp for ios 2024-07-19 11:23:00 +07:00
KsZnak 196f7778fc Im gs for readme (#898)
Update README.md
2024-07-16 12:56:52 +01:00
Boris Verbitskii de20add857 dns fix for xray(ios) 2024-07-16 16:39:39 +07:00
pokamest c59216b58a Merge pull request #880 from StrikerRUS/translation
add artifact with translations and update Russian translation
2024-07-11 02:59:14 -07:00
Nethius acf7fa261a fixed qml warnings and hindi language warnings (#805) 2024-07-11 10:36:24 +01:00
pokamest c3eddc92bd Merge pull request #889 from amnezia-vpn/feature/shadow-socks-by-xray-for-ios
ssXray support for ios
2024-07-11 02:34:04 -07:00
Boris Verbitskii 18c74f4b02 add ssXray for ios 2024-07-09 14:56:39 +07:00
StrikerRUS 5de4b8eeb8 add artifact with translations and update Russian translation 2024-07-04 19:32:50 +03:00
StrikerRUS aae420e469 create translations artifact 2024-07-04 14:27:30 +03:00
88 changed files with 7688 additions and 4302 deletions
+7
View File
@@ -65,6 +65,13 @@ jobs:
path: deploy/AppDir path: deploy/AppDir
retention-days: 7 retention-days: 7
- name: 'Upload translations artifact'
uses: actions/upload-artifact@v4
with:
name: AmneziaVPN_translations
path: client/translations
retention-days: 7
# ------------------------------------------------------ # ------------------------------------------------------
Build-Windows: Build-Windows:
+2 -2
View File
@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.25.0 FATAL_ERROR)
set(PROJECT AmneziaVPN) set(PROJECT AmneziaVPN)
project(${PROJECT} VERSION 4.6.0.3 project(${PROJECT} VERSION 4.6.1.0
DESCRIPTION "AmneziaVPN" DESCRIPTION "AmneziaVPN"
HOMEPAGE_URL "https://amnezia.org/" HOMEPAGE_URL "https://amnezia.org/"
) )
@@ -11,7 +11,7 @@ string(TIMESTAMP CURRENT_DATE "%Y-%m-%d")
set(RELEASE_DATE "${CURRENT_DATE}") set(RELEASE_DATE "${CURRENT_DATE}")
set(APP_MAJOR_VERSION ${CMAKE_PROJECT_VERSION_MAJOR}.${CMAKE_PROJECT_VERSION_MINOR}.${CMAKE_PROJECT_VERSION_PATCH}) set(APP_MAJOR_VERSION ${CMAKE_PROJECT_VERSION_MAJOR}.${CMAKE_PROJECT_VERSION_MINOR}.${CMAKE_PROJECT_VERSION_PATCH})
set(APP_ANDROID_VERSION_CODE 55) set(APP_ANDROID_VERSION_CODE 56)
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
set(MZ_PLATFORM_NAME "linux") set(MZ_PLATFORM_NAME "linux")
+47 -11
View File
@@ -6,6 +6,26 @@
Amnezia is an open-source VPN client, with a key feature that enables you to deploy your own VPN server on your server. Amnezia is an open-source VPN client, with a key feature that enables you to deploy your own VPN server on your server.
![Image](https://github.com/amnezia-vpn/amnezia-client/blob/dev/metadata/img-readme/uipic4.png)
<br>
<a href="https://github.com/amnezia-vpn/amnezia-client/releases/download/4.6.0.3/AmneziaVPN_4.6.0.3_x64.exe"><img src="https://github.com/amnezia-vpn/amnezia-client/blob/dev/metadata/img-readme/win.png" width="150" style="max-width: 100%;"></a>
<a href="https://github.com/amnezia-vpn/amnezia-client/releases/download/4.6.0.3/AmneziaVPN_4.6.0.3.dmg"><img src="https://github.com/amnezia-vpn/amnezia-client/blob/dev/metadata/img-readme/mac.png" width="150" style="max-width: 100%;"></a>
<a href="https://github.com/amnezia-vpn/amnezia-client/releases/download/4.6.0.3/AmneziaVPN_Linux_4.6.0.3.tar.zip"><img src="https://github.com/amnezia-vpn/amnezia-client/blob/dev/metadata/img-readme/lin.png" width="150" style="max-width: 100%;"></a>
<a href="https://github.com/amnezia-vpn/amnezia-client/releases/tag/4.6.0.3"><img src="https://github.com/amnezia-vpn/amnezia-client/blob/dev/metadata/img-readme/andr.png" width="150" style="max-width: 100%;"></a>
<br>
<a href="https://play.google.com/store/search?q=amnezia+vpn&c=apps"><img src="https://github.com/amnezia-vpn/amnezia-client/blob/dev/metadata/img-readme/play.png" width="150" style="max-width: 100%;"></a>
<a href="https://apps.apple.com/us/app/amneziavpn/id1600529900"><img src="https://github.com/amnezia-vpn/amnezia-client/blob/dev/metadata/img-readme/apl.png" width="150" style="max-width: 100%;"></a>
[All releases](https://github.com/amnezia-vpn/amnezia-client/releases)
<br>
## Features ## Features
- Very easy to use - enter your IP address, SSH login, and password, and Amnezia will automatically install VPN docker containers to your server and connect to the VPN. - Very easy to use - enter your IP address, SSH login, and password, and Amnezia will automatically install VPN docker containers to your server and connect to the VPN.
@@ -16,12 +36,12 @@ Amnezia is an open-source VPN client, with a key feature that enables you to dep
## Links ## Links
[https://amnezia.org](https://amnezia.org) - project website - [https://amnezia.org](https://amnezia.org) - project website
[https://www.reddit.com/r/AmneziaVPN](https://www.reddit.com/r/AmneziaVPN) - Reddit - [https://www.reddit.com/r/AmneziaVPN](https://www.reddit.com/r/AmneziaVPN) - Reddit
[https://t.me/amnezia_vpn_en](https://t.me/amnezia_vpn_en) - Telegram support channel (English) - [https://t.me/amnezia_vpn_en](https://t.me/amnezia_vpn_en) - Telegram support channel (English)
[https://t.me/amnezia_vpn_ir](https://t.me/amnezia_vpn_ir) - Telegram support channel (Farsi) - [https://t.me/amnezia_vpn_ir](https://t.me/amnezia_vpn_ir) - Telegram support channel (Farsi)
[https://t.me/amnezia_vpn_mm](https://t.me/amnezia_vpn_mm) - Telegram support channel (Myanmar) - [https://t.me/amnezia_vpn_mm](https://t.me/amnezia_vpn_mm) - Telegram support channel (Myanmar)
[https://t.me/amnezia_vpn](https://t.me/amnezia_vpn) - Telegram support channel (Russian) - [https://t.me/amnezia_vpn](https://t.me/amnezia_vpn) - Telegram support channel (Russian)
## Tech ## Tech
@@ -46,6 +66,19 @@ git submodule update --init --recursive
Want to contribute? Welcome! Want to contribute? Welcome!
### Help with translations
Download the most actual translation files.
Go to ["Actions" tab](https://github.com/amnezia-vpn/amnezia-client/actions?query=is%3Asuccess+branch%3Adev), click on the first line.
Then scroll down to the "Artifacts" section and download "AmneziaVPN_translations".
Unzip this file.
Each *.ts file contains strings for one corresponding language.
Translate or correct some strings in one or multiple *.ts files and commit them back to this repository into the ``client/translations`` folder.
You can do it via a web-interface or any other method you're familiar with.
### Building sources and deployment ### Building sources and deployment
Check deploy folder for build scripts. Check deploy folder for build scripts.
@@ -121,9 +154,11 @@ The Android app has the following requirements:
* Android platform SDK 33 * Android platform SDK 33
* CMake 3.25.0 * CMake 3.25.0
After you have installed QT, QT Creator, and Android Studio, you need to configure QT Creator correctly. Click in the top menu bar on `QT Creator` -> `Preferences` -> `Devices` and select the tab `Android`. After you have installed QT, QT Creator, and Android Studio, you need to configure QT Creator correctly.
* set path to JDK 11
* set path to Android SDK ($ANDROID_HOME) - Click in the top menu bar on `QT Creator` -> `Preferences` -> `Devices` and select the tab `Android`.
- Set path to JDK 11
- Set path to Android SDK (`$ANDROID_HOME`)
In case you get errors regarding missing SDK or 'SDK manager not running', you cannot fix them by correcting the paths. If you have some spare GBs on your disk, you can let QT Creator install all requirements by choosing an empty folder for `Android SDK location` and clicking on `Set Up SDK`. Be aware: This will install a second Android SDK and NDK on your machine!  In case you get errors regarding missing SDK or 'SDK manager not running', you cannot fix them by correcting the paths. If you have some spare GBs on your disk, you can let QT Creator install all requirements by choosing an empty folder for `Android SDK location` and clicking on `Set Up SDK`. Be aware: This will install a second Android SDK and NDK on your machine! 
Double-check that the right CMake version is configured:  Click on `QT Creator` -> `Preferences` and click on the side menu on `Kits`. Under the center content view's `Kits` tab, you'll find an entry for `CMake Tool`. If the default selected CMake version is lower than 3.25.0, install on your system CMake >= 3.25.0 and choose `System CMake at <path>` from the drop-down list. If this entry is missing, you either have not installed CMake yet or QT Creator hasn't found the path to it. In that case, click in the preferences window on the side menu item `CMake`, then on the tab `Tools` in the center content view, and finally on the button `Add` to set the path to your installed CMake.  Double-check that the right CMake version is configured:  Click on `QT Creator` -> `Preferences` and click on the side menu on `Kits`. Under the center content view's `Kits` tab, you'll find an entry for `CMake Tool`. If the default selected CMake version is lower than 3.25.0, install on your system CMake >= 3.25.0 and choose `System CMake at <path>` from the drop-down list. If this entry is missing, you either have not installed CMake yet or QT Creator hasn't found the path to it. In that case, click in the preferences window on the side menu item `CMake`, then on the tab `Tools` in the center content view, and finally on the button `Add` to set the path to your installed CMake. 
@@ -145,8 +180,9 @@ GPL v3.0
## Donate ## Donate
Patreon: [https://www.patreon.com/amneziavpn](https://www.patreon.com/amneziavpn) Patreon: [https://www.patreon.com/amneziavpn](https://www.patreon.com/amneziavpn)
USDT BEP20: 0x6abD576765a826f87D1D95183438f9408C901bE4
USDT TRC20: TELAitazF1MZGmiNjTcnxDjEiH5oe7LC9d USDT BEP20: 0x6abD576765a826f87D1D95183438f9408C901bE4 <br>
USDT TRC20: TELAitazF1MZGmiNjTcnxDjEiH5oe7LC9d <br>
XMR: 48spms39jt1L2L5vyw2RQW6CXD6odUd4jFu19GZcDyKKQV9U88wsJVjSbL4CfRys37jVMdoaWVPSvezCQPhHXUW5UKLqUp3 XMR: 48spms39jt1L2L5vyw2RQW6CXD6odUd4jFu19GZcDyKKQV9U88wsJVjSbL4CfRys37jVMdoaWVPSvezCQPhHXUW5UKLqUp3
## Acknowledgments ## Acknowledgments
+3 -1
View File
@@ -161,13 +161,15 @@ void AmneziaApplication::init()
m_engine->load(url); m_engine->load(url);
m_systemController->setQmlRoot(m_engine->rootObjects().value(0)); m_systemController->setQmlRoot(m_engine->rootObjects().value(0));
bool enabled = m_settings->isSaveLogs();
#ifndef Q_OS_ANDROID #ifndef Q_OS_ANDROID
if (m_settings->isSaveLogs()) { if (enabled) {
if (!Logger::init()) { if (!Logger::init()) {
qWarning() << "Initialization of debug subsystem failed"; qWarning() << "Initialization of debug subsystem failed";
} }
} }
#endif #endif
Logger::setServiceLogsEnabled(enabled);
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
if (m_parser.isSet("a")) if (m_parser.isSet("a"))
+6
View File
@@ -11,6 +11,9 @@
<uses-feature android:name="android.hardware.camera" android:required="false" /> <uses-feature android:name="android.hardware.camera" android:required="false" />
<uses-feature android:name="android.hardware.camera.any" android:required="false" /> <uses-feature android:name="android.hardware.camera.any" android:required="false" />
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false" /> <uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />
<!-- for TV -->
<uses-feature android:name="android.software.leanback" android:required="false" />
<uses-feature android:name="android.hardware.touchscreen" android:required="false" />
<!-- The following comment will be replaced upon deployment with default features based on the dependencies <!-- The following comment will be replaced upon deployment with default features based on the dependencies
of the application. Remove the comment if you do not require these default features. --> of the application. Remove the comment if you do not require these default features. -->
@@ -31,9 +34,11 @@
android:label="-- %%INSERT_APP_NAME%% --" android:label="-- %%INSERT_APP_NAME%% --"
android:icon="@mipmap/icon" android:icon="@mipmap/icon"
android:roundIcon="@mipmap/icon_round" android:roundIcon="@mipmap/icon_round"
android:banner="@mipmap/ic_banner"
android:theme="@style/NoActionBar" android:theme="@style/NoActionBar"
android:fullBackupContent="@xml/backup_content" android:fullBackupContent="@xml/backup_content"
android:dataExtractionRules="@xml/data_extraction_rules" android:dataExtractionRules="@xml/data_extraction_rules"
android:hasFragileUserData="false"
tools:targetApi="s"> tools:targetApi="s">
<activity <activity
@@ -47,6 +52,7 @@
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
</intent-filter> </intent-filter>
<intent-filter> <intent-filter>
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_banner_background"/>
<foreground android:drawable="@mipmap/ic_banner_foreground"/>
</adaptive-icon>
Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_banner_background">#1E1E1F</color>
</resources>
@@ -1,6 +1,7 @@
package org.amnezia.vpn package org.amnezia.vpn
import android.Manifest import android.Manifest
import android.annotation.SuppressLint
import android.app.AlertDialog import android.app.AlertDialog
import android.app.NotificationManager import android.app.NotificationManager
import android.content.BroadcastReceiver import android.content.BroadcastReceiver
@@ -230,7 +231,10 @@ class AmneziaActivity : QtActivity() {
override fun onStop() { override fun onStop() {
Log.d(TAG, "Stop Amnezia activity") Log.d(TAG, "Stop Amnezia activity")
doUnbindService() doUnbindService()
mainScope.launch {
qtInitialized.await()
QtAndroidController.onServiceDisconnected() QtAndroidController.onServiceDisconnected()
}
super.onStop() super.onStop()
} }
@@ -542,7 +546,7 @@ class AmneziaActivity : QtActivity() {
} }
}.also { }.also {
startActivityForResult(it, OPEN_FILE_ACTION_CODE, ActivityResultHandler( startActivityForResult(it, OPEN_FILE_ACTION_CODE, ActivityResultHandler(
onSuccess = { onAny = {
val uri = it?.data?.toString() ?: "" val uri = it?.data?.toString() ?: ""
Log.d(TAG, "Open file: $uri") Log.d(TAG, "Open file: $uri")
mainScope.launch { mainScope.launch {
@@ -556,8 +560,12 @@ class AmneziaActivity : QtActivity() {
} }
@Suppress("unused") @Suppress("unused")
@SuppressLint("UnsupportedChromeOsCameraSystemFeature")
fun isCameraPresent(): Boolean = applicationContext.packageManager.hasSystemFeature(PackageManager.FEATURE_CAMERA) fun isCameraPresent(): Boolean = applicationContext.packageManager.hasSystemFeature(PackageManager.FEATURE_CAMERA)
@Suppress("unused")
fun isOnTv(): Boolean = applicationContext.packageManager.hasSystemFeature(PackageManager.FEATURE_LEANBACK)
@Suppress("unused") @Suppress("unused")
fun startQrCodeReader() { fun startQrCodeReader() {
Log.v(TAG, "Start camera") Log.v(TAG, "Start camera")
@@ -88,18 +88,26 @@ class NetworkState(
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
connectivityManager.registerBestMatchingNetworkCallback(networkRequest, networkCallback, handler) connectivityManager.registerBestMatchingNetworkCallback(networkRequest, networkCallback, handler)
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
val numberAttempts = 3
var attemptCount = 0
while(true) {
try { try {
connectivityManager.requestNetwork(networkRequest, networkCallback, handler) connectivityManager.requestNetwork(networkRequest, networkCallback, handler)
break
} catch (e: SecurityException) { } catch (e: SecurityException) {
Log.e(TAG, "Failed to bind network listener: $e") Log.e(TAG, "Failed to bind network listener: $e")
// Android 11 bug: https://issuetracker.google.com/issues/175055271 // Android 11 bug: https://issuetracker.google.com/issues/175055271
if (e.message?.startsWith("Package android does not belong to") == true) { if (e.message?.startsWith("Package android does not belong to") == true) {
if (++attemptCount > numberAttempts) {
throw e
}
delay(1000) delay(1000)
connectivityManager.requestNetwork(networkRequest, networkCallback, handler) continue
} else { } else {
throw e throw e
} }
} }
}
} else { } else {
connectivityManager.requestNetwork(networkRequest, networkCallback) connectivityManager.requestNetwork(networkRequest, networkCallback)
} }
@@ -119,18 +119,21 @@ QString OpenVpnConfigurator::processConfigWithLocalSettings(const QPair<QString,
if (!m_settings->isSitesSplitTunnelingEnabled()) { if (!m_settings->isSitesSplitTunnelingEnabled()) {
config.append("\nredirect-gateway def1 ipv6 bypass-dhcp\n"); config.append("\nredirect-gateway def1 ipv6 bypass-dhcp\n");
#if !defined(Q_OS_ANDROID) && !defined(Q_OS_IOS)
// Prevent ipv6 leak // Prevent ipv6 leak
config.append("ifconfig-ipv6 fd15:53b6:dead::2/64 fd15:53b6:dead::1\n"); config.append("ifconfig-ipv6 fd15:53b6:dead::2/64 fd15:53b6:dead::1\n");
#endif
config.append("block-ipv6\n"); config.append("block-ipv6\n");
} else if (m_settings->routeMode() == Settings::VpnOnlyForwardSites) { } else if (m_settings->routeMode() == Settings::VpnOnlyForwardSites) {
// no redirect-gateway // no redirect-gateway
} else if (m_settings->routeMode() == Settings::VpnAllExceptSites) { } else if (m_settings->routeMode() == Settings::VpnAllExceptSites) {
#ifndef Q_OS_ANDROID #if !defined(Q_OS_ANDROID) && !defined(Q_OS_IOS)
config.append("\nredirect-gateway ipv6 !ipv4 bypass-dhcp\n"); config.append("\nredirect-gateway ipv6 !ipv4 bypass-dhcp\n");
#endif
// Prevent ipv6 leak // Prevent ipv6 leak
config.append("ifconfig-ipv6 fd15:53b6:dead::2/64 fd15:53b6:dead::1\n"); config.append("ifconfig-ipv6 fd15:53b6:dead::2/64 fd15:53b6:dead::1\n");
#endif
config.append("block-ipv6\n"); config.append("block-ipv6\n");
} }
} }
+3 -3
View File
@@ -96,7 +96,7 @@ QMap<DockerContainer, QString> ContainerProps::containerHumanNames()
{ DockerContainer::Awg, "AmneziaWG" }, { DockerContainer::Awg, "AmneziaWG" },
{ DockerContainer::Xray, "XRay" }, { DockerContainer::Xray, "XRay" },
{ DockerContainer::Ipsec, QObject::tr("IPsec") }, { DockerContainer::Ipsec, QObject::tr("IPsec") },
{ DockerContainer::SSXray, "ShadowSocks"}, { DockerContainer::SSXray, "Shadowsocks"},
{ DockerContainer::TorWebSite, QObject::tr("Website in Tor network") }, { DockerContainer::TorWebSite, QObject::tr("Website in Tor network") },
{ DockerContainer::Dns, QObject::tr("AmneziaDNS") }, { DockerContainer::Dns, QObject::tr("AmneziaDNS") },
@@ -286,8 +286,8 @@ bool ContainerProps::isSupportedByCurrentPlatform(DockerContainer c)
case DockerContainer::OpenVpn: return true; case DockerContainer::OpenVpn: return true;
case DockerContainer::Awg: return true; case DockerContainer::Awg: return true;
case DockerContainer::Xray: return true; case DockerContainer::Xray: return true;
case DockerContainer::Cloak: case DockerContainer::Cloak: return true;
return true; case DockerContainer::SSXray: return true;
// case DockerContainer::ShadowSocks: return true; // case DockerContainer::ShadowSocks: return true;
default: return false; default: return false;
} }
@@ -569,6 +569,7 @@ ServerController::Vars ServerController::genVarsForScript(const ServerCredential
// Xray vars // Xray vars
vars.append({ { "$XRAY_SITE_NAME", xrayConfig.value(config_key::site).toString(protocols::xray::defaultSite) } }); vars.append({ { "$XRAY_SITE_NAME", xrayConfig.value(config_key::site).toString(protocols::xray::defaultSite) } });
vars.append({ { "$XRAY_SERVER_PORT", xrayConfig.value(config_key::port).toString(protocols::xray::defaultPort) } });
// Wireguard vars // Wireguard vars
vars.append({ { "$WIREGUARD_SUBNET_IP", vars.append({ { "$WIREGUARD_SUBNET_IP",
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -91,6 +91,7 @@ target_sources(networkextension PRIVATE
${CLIENT_ROOT_DIR}/platforms/ios/PacketTunnelProvider+OpenVPN.swift ${CLIENT_ROOT_DIR}/platforms/ios/PacketTunnelProvider+OpenVPN.swift
${CLIENT_ROOT_DIR}/platforms/ios/PacketTunnelProvider+Xray.swift ${CLIENT_ROOT_DIR}/platforms/ios/PacketTunnelProvider+Xray.swift
${CLIENT_ROOT_DIR}/platforms/ios/WGConfig.swift ${CLIENT_ROOT_DIR}/platforms/ios/WGConfig.swift
${CLIENT_ROOT_DIR}/platforms/ios/XrayConfig.swift
${CLIENT_ROOT_DIR}/platforms/ios/iosglue.mm ${CLIENT_ROOT_DIR}/platforms/ios/iosglue.mm
) )
+30 -2
View File
@@ -33,6 +33,10 @@ void debugMessageHandler(QtMsgType type, const QMessageLogContext& context, cons
} }
// Skip annoying messages from Qt // Skip annoying messages from Qt
if (msg.contains("OpenType support missing for")) {
return;
}
if (msg.startsWith("Unknown property") || msg.startsWith("Could not create pixmap") || msg.startsWith("Populating font") || msg.startsWith("stale focus object")) { if (msg.startsWith("Unknown property") || msg.startsWith("Could not create pixmap") || msg.startsWith("Populating font") || msg.startsWith("stale focus object")) {
return; return;
} }
@@ -95,6 +99,29 @@ void Logger::deInit()
m_file.close(); m_file.close();
} }
bool Logger::setServiceLogsEnabled(bool enabled) {
#ifdef AMNEZIA_DESKTOP
IpcClient *m_IpcClient = new IpcClient;
if (!m_IpcClient->isSocketConnected()) {
if (!IpcClient::init(m_IpcClient)) {
qWarning() << "Error occurred when init IPC client";
return false;
}
}
if (m_IpcClient->Interface()) {
m_IpcClient->Interface()->setLogsEnabled(enabled);
}
else {
qWarning() << "Error occurred setting up service logs";
return false;
}
#endif
return true;
}
QString Logger::userLogsDir() QString Logger::userLogsDir()
{ {
return QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/log"; return QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/log";
@@ -137,7 +164,9 @@ bool Logger::openLogsFolder()
bool Logger::openServiceLogsFolder() bool Logger::openServiceLogsFolder()
{ {
QString path = Utils::systemLogPath(); QString path = Utils::systemLogPath();
#ifdef Q_OS_WIN
path = "file:///" + path; path = "file:///" + path;
#endif
QDesktopServices::openUrl(QUrl::fromLocalFile(path)); QDesktopServices::openUrl(QUrl::fromLocalFile(path));
return true; return true;
} }
@@ -180,8 +209,7 @@ void Logger::clearServiceLogs()
} }
if (m_IpcClient->Interface()) { if (m_IpcClient->Interface()) {
m_IpcClient->Interface()->setLogsEnabled(false); m_IpcClient->Interface()->clearLogs();
m_IpcClient->Interface()->cleanUp();
} }
else { else {
qWarning() << "Error occurred cleaning up service logs"; qWarning() << "Error occurred cleaning up service logs";
+1
View File
@@ -26,6 +26,7 @@ public:
static bool init(); static bool init();
static void deInit(); static void deInit();
static bool setServiceLogsEnabled(bool enabled);
static bool openLogsFolder(); static bool openLogsFolder();
static bool openServiceLogsFolder(); static bool openServiceLogsFolder();
static QString appLogFileNamePath(); static QString appLogFileNamePath();
@@ -179,6 +179,11 @@ bool AndroidController::isCameraPresent()
return callActivityMethod<jboolean>("isCameraPresent", "()Z"); return callActivityMethod<jboolean>("isCameraPresent", "()Z");
} }
bool AndroidController::isOnTv()
{
return callActivityMethod<jboolean>("isOnTv", "()Z");
}
void AndroidController::startQrReaderActivity() void AndroidController::startQrReaderActivity()
{ {
callActivityMethod("startQrCodeReader", "()V"); callActivityMethod("startQrCodeReader", "()V");
@@ -35,6 +35,7 @@ public:
void saveFile(const QString &fileName, const QString &data); void saveFile(const QString &fileName, const QString &data);
QString openFile(const QString &filter); QString openFile(const QString &filter);
bool isCameraPresent(); bool isCameraPresent();
bool isOnTv();
void startQrReaderActivity(); void startQrReaderActivity();
void setSaveLogs(bool enabled); void setSaveLogs(bool enabled);
void exportLogsFile(const QString &fileName); void exportLogsFile(const QString &fileName);
@@ -4,6 +4,7 @@ import WireGuardKitGo
enum XrayErrors: Error { enum XrayErrors: Error {
case noXrayConfig case noXrayConfig
case xrayConfigIsWrong
case cantSaveXrayConfig case cantSaveXrayConfig
case cantParseListenAndPort case cantParseListenAndPort
case cantSaveHevSocksConfig case cantSaveHevSocksConfig
@@ -26,14 +27,14 @@ extension PacketTunnelProvider {
// Xray configuration // Xray configuration
guard let protocolConfiguration = self.protocolConfiguration as? NETunnelProviderProtocol, guard let protocolConfiguration = self.protocolConfiguration as? NETunnelProviderProtocol,
let providerConfiguration = protocolConfiguration.providerConfiguration, let providerConfiguration = protocolConfiguration.providerConfiguration,
let xrayConfigData = providerConfiguration[Constants.xrayConfigKey] as? Data else { let configData = providerConfiguration[Constants.xrayConfigKey] as? Data else {
xrayLog(.error, message: "Can't get xray configuration") xrayLog(.error, message: "Can't get xray configuration")
completionHandler(XrayErrors.noXrayConfig) completionHandler(XrayErrors.noXrayConfig)
return return
} }
// Tunnel settings // Tunnel settings
let ipv6Enabled = true let ipv6Enabled = false
let hideVPNIcon = false let hideVPNIcon = false
let settings = NEPacketTunnelNetworkSettings(tunnelRemoteAddress: "254.1.1.1") let settings = NEPacketTunnelNetworkSettings(tunnelRemoteAddress: "254.1.1.1")
@@ -57,12 +58,29 @@ extension PacketTunnelProvider {
return settings return settings
}() }()
let dns = ["8.8.4.4","1.1.1.1"]
settings.dnsSettings = NEDNSSettings(servers: dns)
do { do {
let port = 10808 let xrayConfig = try JSONDecoder().decode(XrayConfig.self,
let address = "::1" from: configData)
var dnsArray = [String]()
if let dns1 = xrayConfig.dns1 {
dnsArray.append(dns1)
}
if let dns2 = xrayConfig.dns2 {
dnsArray.append(dns2)
}
settings.dnsSettings = !dnsArray.isEmpty
? NEDNSSettings(servers: dnsArray)
: NEDNSSettings(servers: ["1.1.1.1"])
let xrayConfigData = xrayConfig.config.data(using: .utf8)
guard let xrayConfigData else {
xrayLog(.error, message: "Can't encode config to data")
completionHandler(XrayErrors.xrayConfigIsWrong)
return
}
let jsonDict = try JSONSerialization.jsonObject(with: xrayConfigData, let jsonDict = try JSONSerialization.jsonObject(with: xrayConfigData,
options: []) as? [String: Any] options: []) as? [String: Any]
@@ -73,6 +91,9 @@ extension PacketTunnelProvider {
return return
} }
let port = 10808
let address = "::1"
if var inboundsArray = jsonDict["inbounds"] as? [[String: Any]], !inboundsArray.isEmpty { if var inboundsArray = jsonDict["inbounds"] as? [[String: Any]], !inboundsArray.isEmpty {
inboundsArray[0]["port"] = port inboundsArray[0]["port"] = port
inboundsArray[0]["listen"] = address inboundsArray[0]["listen"] = address
+7
View File
@@ -0,0 +1,7 @@
import Foundation
struct XrayConfig: Decodable {
let dns1: String?
let dns2: String?
let config: String
}
+1
View File
@@ -73,6 +73,7 @@ private:
bool setupWireGuard(); bool setupWireGuard();
bool setupAwg(); bool setupAwg();
bool setupXray(); bool setupXray();
bool setupSSXray();
bool startOpenVPN(const QString &config); bool startOpenVPN(const QString &config);
bool startWireGuard(const QString &jsonConfig); bool startWireGuard(const QString &jsonConfig);
+31 -1
View File
@@ -219,6 +219,9 @@ bool IosController::connectVpn(amnezia::Proto proto, const QJsonObject& configur
if (proto == amnezia::Proto::Xray) { if (proto == amnezia::Proto::Xray) {
return setupXray(); return setupXray();
} }
if (proto == amnezia::Proto::SSXray) {
return setupSSXray();
}
return false; return false;
} }
@@ -508,9 +511,36 @@ bool IosController::setupXray()
{ {
QJsonObject config = m_rawConfig[ProtocolProps::key_proto_config_data(amnezia::Proto::Xray)].toObject(); QJsonObject config = m_rawConfig[ProtocolProps::key_proto_config_data(amnezia::Proto::Xray)].toObject();
QJsonDocument xrayConfigDoc(config); QJsonDocument xrayConfigDoc(config);
QString xrayConfigStr(xrayConfigDoc.toJson(QJsonDocument::Compact)); QString xrayConfigStr(xrayConfigDoc.toJson(QJsonDocument::Compact));
return startXray(xrayConfigStr); QJsonObject finalConfig;
finalConfig.insert(config_key::dns1, m_rawConfig[config_key::dns1].toString());
finalConfig.insert(config_key::dns2, m_rawConfig[config_key::dns2].toString());
finalConfig.insert(config_key::config, xrayConfigStr);
QJsonDocument finalConfigDoc(finalConfig);
QString finalConfigStr(finalConfigDoc.toJson(QJsonDocument::Compact));
return startXray(finalConfigStr);
}
bool IosController::setupSSXray()
{
QJsonObject config = m_rawConfig[ProtocolProps::key_proto_config_data(amnezia::Proto::SSXray)].toObject();
QJsonDocument ssXrayConfigDoc(config);
QString ssXrayConfigStr(ssXrayConfigDoc.toJson(QJsonDocument::Compact));
QJsonObject finalConfig;
finalConfig.insert(config_key::dns1, m_rawConfig[config_key::dns1]);
finalConfig.insert(config_key::dns2, m_rawConfig[config_key::dns2]);
finalConfig.insert(config_key::config, ssXrayConfigStr);
QJsonDocument finalConfigDoc(finalConfig);
QString finalConfigStr(finalConfigDoc.toJson(QJsonDocument::Compact));
return startXray(finalConfigStr);
} }
bool IosController::setupAwg() bool IosController::setupAwg()
+3 -2
View File
@@ -65,14 +65,14 @@ QString ProtocolProps::transportProtoToString(TransportProto proto, Proto p)
QMap<amnezia::Proto, QString> ProtocolProps::protocolHumanNames() QMap<amnezia::Proto, QString> ProtocolProps::protocolHumanNames()
{ {
return { { Proto::OpenVpn, "OpenVPN" }, return { { Proto::OpenVpn, "OpenVPN" },
{ Proto::ShadowSocks, "ShadowSocks" }, { Proto::ShadowSocks, "Shadowsocks" },
{ Proto::Cloak, "Cloak" }, { Proto::Cloak, "Cloak" },
{ Proto::WireGuard, "WireGuard" }, { Proto::WireGuard, "WireGuard" },
{ Proto::Awg, "AmneziaWG" }, { Proto::Awg, "AmneziaWG" },
{ Proto::Ikev2, "IKEv2" }, { Proto::Ikev2, "IKEv2" },
{ Proto::L2tp, "L2TP" }, { Proto::L2tp, "L2TP" },
{ Proto::Xray, "XRay" }, { Proto::Xray, "XRay" },
{ Proto::SSXray, "ShadowSocks"}, { Proto::SSXray, "Shadowsocks"},
{ Proto::TorWebSite, "Website in Tor network" }, { Proto::TorWebSite, "Website in Tor network" },
@@ -159,6 +159,7 @@ bool ProtocolProps::defaultPortChangeable(Proto p)
case Proto::Dns: return false; case Proto::Dns: return false;
case Proto::Sftp: return true; case Proto::Sftp: return true;
case Proto::Socks5Proxy: return true; case Proto::Socks5Proxy: return true;
case Proto::Xray: return true;
default: return false; default: return false;
} }
} }
+1 -11
View File
@@ -11,16 +11,6 @@
<file>images/tray/default.png</file> <file>images/tray/default.png</file>
<file>images/tray/error.png</file> <file>images/tray/error.png</file>
<file>images/arrow_left.png</file> <file>images/arrow_left.png</file>
<file>fonts/Lato-Black.ttf</file>
<file>fonts/Lato-BlackItalic.ttf</file>
<file>fonts/Lato-Bold.ttf</file>
<file>fonts/Lato-BoldItalic.ttf</file>
<file>fonts/Lato-Italic.ttf</file>
<file>fonts/Lato-Light.ttf</file>
<file>fonts/Lato-LightItalic.ttf</file>
<file>fonts/Lato-Regular.ttf</file>
<file>fonts/Lato-Thin.ttf</file>
<file>fonts/Lato-ThinItalic.ttf</file>
<file>images/AmneziaVPN.png</file> <file>images/AmneziaVPN.png</file>
<file>images/share.png</file> <file>images/share.png</file>
<file>server_scripts/remove_container.sh</file> <file>server_scripts/remove_container.sh</file>
@@ -95,7 +85,6 @@
<file>server_scripts/check_user_in_sudo.sh</file> <file>server_scripts/check_user_in_sudo.sh</file>
<file>ui/qml/Controls2/BasicButtonType.qml</file> <file>ui/qml/Controls2/BasicButtonType.qml</file>
<file>ui/qml/Controls2/TextFieldWithHeaderType.qml</file> <file>ui/qml/Controls2/TextFieldWithHeaderType.qml</file>
<file>fonts/pt-root-ui_vf.ttf</file>
<file>ui/qml/Controls2/LabelWithButtonType.qml</file> <file>ui/qml/Controls2/LabelWithButtonType.qml</file>
<file>images/controls/arrow-right.svg</file> <file>images/controls/arrow-right.svg</file>
<file>images/controls/chevron-right.svg</file> <file>images/controls/chevron-right.svg</file>
@@ -239,6 +228,7 @@
<file>images/controls/alert-circle.svg</file> <file>images/controls/alert-circle.svg</file>
<file>images/controls/file-check-2.svg</file> <file>images/controls/file-check-2.svg</file>
<file>ui/qml/Controls2/WarningType.qml</file> <file>ui/qml/Controls2/WarningType.qml</file>
<file>fonts/pt-root-ui_vf.ttf</file>
<file>ui/qml/Modules/Style/qmldir</file> <file>ui/qml/Modules/Style/qmldir</file>
<file>ui/qml/Modules/Style/AmneziaStyle.qml</file> <file>ui/qml/Modules/Style/AmneziaStyle.qml</file>
<file>ui/qml/Pages2/PageServiceSocksProxySettings.qml</file> <file>ui/qml/Pages2/PageServiceSocksProxySettings.qml</file>
@@ -29,7 +29,7 @@ cat > /opt/amnezia/xray/server.json <<EOF
}, },
"inbounds": [ "inbounds": [
{ {
"port": 443, "port": "$XRAY_SERVER_PORT",
"protocol": "vless", "protocol": "vless",
"settings": { "settings": {
"clients": [ "clients": [
@@ -44,7 +44,7 @@ cat > /opt/amnezia/xray/server.json <<EOF
"network": "tcp", "network": "tcp",
"security": "reality", "security": "reality",
"realitySettings": { "realitySettings": {
"dest": "$XRAY_SITE_NAME:443", "dest": "$XRAY_SITE_NAME:$XRAY_SERVER_PORT",
"serverNames": [ "serverNames": [
"$XRAY_SITE_NAME" "$XRAY_SITE_NAME"
], ],
+1 -1
View File
@@ -4,7 +4,7 @@ sudo docker run -d \
--log-driver none \ --log-driver none \
--restart always \ --restart always \
--cap-add=NET_ADMIN \ --cap-add=NET_ADMIN \
-p 443:443/tcp \ -p $XRAY_SERVER_PORT:$XRAY_SERVER_PORT/tcp \
--name $CONTAINER_NAME $CONTAINER_NAME --name $CONTAINER_NAME $CONTAINER_NAME
sudo docker network connect amnezia-dns-net $CONTAINER_NAME sudo docker network connect amnezia-dns-net $CONTAINER_NAME
+1 -1
View File
@@ -19,7 +19,7 @@
"vnext": [ "vnext": [
{ {
"address": "$SERVER_IP_ADDRESS", "address": "$SERVER_IP_ADDRESS",
"port": 443, "port": "$XRAY_SERVER_PORT",
"users": [ "users": [
{ {
"id": "$XRAY_CLIENT_ID", "id": "$XRAY_CLIENT_ID",
+2
View File
@@ -226,6 +226,8 @@ void Settings::setSaveLogs(bool enabled)
} }
} }
#endif #endif
Logger::setServiceLogsEnabled(enabled);
if (enabled) { if (enabled) {
setLogEnableDate(QDateTime::currentDateTime()); setLogEnableDate(QDateTime::currentDateTime());
} }
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -36,13 +36,13 @@ ConnectionController::ConnectionController(const QSharedPointer<ServersModel> &s
void ConnectionController::openConnection() void ConnectionController::openConnection()
{ {
#if !defined(Q_OS_ANDROID) && !defined(Q_OS_IOS) // #if !defined(Q_OS_ANDROID) && !defined(Q_OS_IOS)
if (!Utils::processIsRunning(Utils::executable(SERVICE_NAME, false), true)) // if (!Utils::processIsRunning(Utils::executable(SERVICE_NAME, false), true))
{ // {
emit connectionErrorOccurred(ErrorCode::AmneziaServiceNotRunning); // emit connectionErrorOccurred(ErrorCode::AmneziaServiceNotRunning);
return; // return;
} // }
#endif // #endif
int serverIndex = m_serversModel->getDefaultServerIndex(); int serverIndex = m_serversModel->getDefaultServerIndex();
QJsonObject serverConfig = m_serversModel->getServerConfig(serverIndex); QJsonObject serverConfig = m_serversModel->getServerConfig(serverIndex);
+3 -3
View File
@@ -240,9 +240,9 @@ void ImportController::processNativeWireGuardConfig()
auto containerConfig = container.value(ContainerProps::containerTypeToString(DockerContainer::WireGuard)).toObject(); auto containerConfig = container.value(ContainerProps::containerTypeToString(DockerContainer::WireGuard)).toObject();
auto protocolConfig = QJsonDocument::fromJson(containerConfig.value(config_key::last_config).toString().toUtf8()).object(); auto protocolConfig = QJsonDocument::fromJson(containerConfig.value(config_key::last_config).toString().toUtf8()).object();
QString junkPacketCount = QString::number(QRandomGenerator::global()->bounded(3, 10)); QString junkPacketCount = QString::number(QRandomGenerator::global()->bounded(2, 5));
QString junkPacketMinSize = QString::number(50); QString junkPacketMinSize = QString::number(10);
QString junkPacketMaxSize = QString::number(1000); QString junkPacketMaxSize = QString::number(50);
protocolConfig[config_key::junkPacketCount] = junkPacketCount; protocolConfig[config_key::junkPacketCount] = junkPacketCount;
protocolConfig[config_key::junkPacketMinSize] = junkPacketMinSize; protocolConfig[config_key::junkPacketMinSize] = junkPacketMinSize;
protocolConfig[config_key::junkPacketMaxSize] = junkPacketMaxSize; protocolConfig[config_key::junkPacketMaxSize] = junkPacketMaxSize;
+3 -3
View File
@@ -85,9 +85,9 @@ void InstallController::install(DockerContainer container, int port, TransportPr
containerConfig.insert(config_key::transport_proto, ProtocolProps::transportProtoToString(transportProto, protocol)); containerConfig.insert(config_key::transport_proto, ProtocolProps::transportProtoToString(transportProto, protocol));
if (container == DockerContainer::Awg) { if (container == DockerContainer::Awg) {
QString junkPacketCount = QString::number(QRandomGenerator::global()->bounded(3, 10)); QString junkPacketCount = QString::number(QRandomGenerator::global()->bounded(2, 5));
QString junkPacketMinSize = QString::number(50); QString junkPacketMinSize = QString::number(10);
QString junkPacketMaxSize = QString::number(1000); QString junkPacketMaxSize = QString::number(50);
int s1 = QRandomGenerator::global()->bounded(15, 150); int s1 = QRandomGenerator::global()->bounded(15, 150);
int s2 = QRandomGenerator::global()->bounded(15, 150); int s2 = QRandomGenerator::global()->bounded(15, 150);
+3 -3
View File
@@ -92,9 +92,9 @@ int LanguageModel::getCurrentLanguageIndex()
int LanguageModel::getLineHeightAppend() int LanguageModel::getLineHeightAppend()
{ {
int langIndex = getCurrentLanguageIndex(); auto language = static_cast<LanguageSettings::AvailableLanguageEnum>(getCurrentLanguageIndex());
switch (langIndex) { switch (language) {
case 5: return 10; break; // Burmese case LanguageSettings::AvailableLanguageEnum::Burmese: return 10; break;
default: return 0; break; default: return 0; break;
} }
} }
@@ -14,7 +14,7 @@ DrawerType2 {
property bool isAppSplitTinnelingEnabled: Qt.platform.os === "windows" || Qt.platform.os === "android" property bool isAppSplitTinnelingEnabled: Qt.platform.os === "windows" || Qt.platform.os === "android"
anchors.fill: parent anchors.fill: parent
expandedHeight: parent.height * 0.7 expandedHeight: parent.height * 0.9
expandedContent: ColumnLayout { expandedContent: ColumnLayout {
id: content id: content
@@ -93,20 +93,11 @@ ListView {
PageController.goToPage(PageEnum.PageProtocolRaw) PageController.goToPage(PageEnum.PageProtocolRaw)
break break
} }
case ContainerEnum.Sftp: {
SftpConfigModel.updateModel(config)
PageController.goToPage(PageEnum.PageServiceSftpSettings)
break
}
case ContainerEnum.TorWebSite: {
PageController.goToPage(PageEnum.PageServiceTorWebsiteSettings)
break
}
case ContainerEnum.Dns: { case ContainerEnum.Dns: {
PageController.goToPage(PageEnum.PageServiceDnsSettings) PageController.goToPage(PageEnum.PageServiceDnsSettings)
break break
} }
default: { // go to the settings page of the container with multiple protocols default: {
ProtocolsModel.updateModel(config) ProtocolsModel.updateModel(config)
PageController.goToPage(PageEnum.PageSettingsServerProtocol) PageController.goToPage(PageEnum.PageSettingsServerProtocol)
} }
@@ -32,6 +32,8 @@ Button {
property var clickedFunc property var clickedFunc
property alias buttonTextLabel: buttonText
implicitHeight: 56 implicitHeight: 56
hoverEnabled: true hoverEnabled: true
@@ -140,6 +142,8 @@ Button {
} }
ButtonTextType { ButtonTextType {
id: buttonText
color: textColor color: textColor
text: root.text text: root.text
visible: root.text === "" ? false : true visible: root.text === "" ? false : true
+2 -1
View File
@@ -20,7 +20,8 @@ Menu {
MenuItem { MenuItem {
text: qsTr("&Paste") text: qsTr("&Paste")
shortcut: StandardKey.Paste shortcut: StandardKey.Paste
enabled: textObj.canPaste // Fix calling paste from clipboard when launching app on android
enabled: Qt.platform.os === "android" ? true : textObj.canPaste
onTriggered: textObj.paste() onTriggered: textObj.paste()
} }
+2 -1
View File
@@ -102,7 +102,8 @@ Switch {
contentItem: ColumnLayout { contentItem: ColumnLayout {
id: content id: content
anchors.verticalCenter: parent.verticalCenter anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.left: parent.left anchors.left: parent.left
ListItemTitleType { ListItemTitleType {
@@ -7,10 +7,10 @@ Text {
lineHeightMode: Text.FixedHeight lineHeightMode: Text.FixedHeight
color: AmneziaStyle.color.white color: AmneziaStyle.color.white
font.pixelSize: 36 font.pixelSize: 32
font.weight: 700 font.weight: 700
font.family: "PT Root UI VF" font.family: "PT Root UI VF"
font.letterSpacing: -1.08 font.letterSpacing: -1.0
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
} }
+5
View File
@@ -85,6 +85,7 @@ PageType {
BasicButtonType { BasicButtonType {
id: splitTunnelingButton id: splitTunnelingButton
Layout.alignment: Qt.AlignHCenter | Qt.AlignBottom Layout.alignment: Qt.AlignHCenter | Qt.AlignBottom
Layout.bottomMargin: 34 Layout.bottomMargin: 34
leftPadding: 16 leftPadding: 16
@@ -100,6 +101,10 @@ PageType {
leftImageColor: AmneziaStyle.color.transparent leftImageColor: AmneziaStyle.color.transparent
borderWidth: 0 borderWidth: 0
buttonTextLabel.lineHeight: 20
buttonTextLabel.font.pixelSize: 14
buttonTextLabel.font.weight: 500
property bool isSplitTunnelingEnabled: SitesModel.isTunnelingEnabled || AppSplitTunnelingModel.isTunnelingEnabled || property bool isSplitTunnelingEnabled: SitesModel.isTunnelingEnabled || AppSplitTunnelingModel.isTunnelingEnabled ||
(ServersModel.isDefaultServerDefaultContainerHasSplitTunneling && ServersModel.getDefaultServerData("isServerFromApi")) (ServersModel.isDefaultServerDefaultContainerHasSplitTunneling && ServersModel.getDefaultServerData("isServerFromApi"))
@@ -143,7 +143,7 @@ PageType {
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 16 Layout.topMargin: 16
headerText: "Jc - Junk packet count" headerText: qsTr("Jc - Junk packet count")
textFieldText: junkPacketCount textFieldText: junkPacketCount
textField.validator: IntValidator { bottom: 0 } textField.validator: IntValidator { bottom: 0 }
parentFlickable: fl parentFlickable: fl
@@ -168,7 +168,7 @@ PageType {
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 16 Layout.topMargin: 16
headerText: "Jmin - Junk packet minimum size" headerText: qsTr("Jmin - Junk packet minimum size")
textFieldText: junkPacketMinSize textFieldText: junkPacketMinSize
textField.validator: IntValidator { bottom: 0 } textField.validator: IntValidator { bottom: 0 }
parentFlickable: fl parentFlickable: fl
@@ -189,7 +189,7 @@ PageType {
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 16 Layout.topMargin: 16
headerText: "Jmax - Junk packet maximum size" headerText: qsTr("Jmax - Junk packet maximum size")
textFieldText: junkPacketMaxSize textFieldText: junkPacketMaxSize
textField.validator: IntValidator { bottom: 0 } textField.validator: IntValidator { bottom: 0 }
parentFlickable: fl parentFlickable: fl
@@ -210,7 +210,7 @@ PageType {
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 16 Layout.topMargin: 16
headerText: "S1 - Init packet junk size" headerText: qsTr("S1 - Init packet junk size")
textFieldText: initPacketJunkSize textFieldText: initPacketJunkSize
textField.validator: IntValidator { bottom: 0 } textField.validator: IntValidator { bottom: 0 }
parentFlickable: fl parentFlickable: fl
@@ -231,7 +231,7 @@ PageType {
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 16 Layout.topMargin: 16
headerText: "S2 - Response packet junk size" headerText: qsTr("S2 - Response packet junk size")
textFieldText: responsePacketJunkSize textFieldText: responsePacketJunkSize
textField.validator: IntValidator { bottom: 0 } textField.validator: IntValidator { bottom: 0 }
parentFlickable: fl parentFlickable: fl
@@ -252,7 +252,7 @@ PageType {
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 16 Layout.topMargin: 16
headerText: "H1 - Init packet magic header" headerText: qsTr("H1 - Init packet magic header")
textFieldText: initPacketMagicHeader textFieldText: initPacketMagicHeader
textField.validator: IntValidator { bottom: 0 } textField.validator: IntValidator { bottom: 0 }
parentFlickable: fl parentFlickable: fl
@@ -273,7 +273,7 @@ PageType {
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 16 Layout.topMargin: 16
headerText: "H2 - Response packet magic header" headerText: qsTr("H2 - Response packet magic header")
textFieldText: responsePacketMagicHeader textFieldText: responsePacketMagicHeader
textField.validator: IntValidator { bottom: 0 } textField.validator: IntValidator { bottom: 0 }
parentFlickable: fl parentFlickable: fl
@@ -294,7 +294,7 @@ PageType {
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 16 Layout.topMargin: 16
headerText: "H4 - Transport packet magic header" headerText: qsTr("H4 - Transport packet magic header")
textFieldText: transportPacketMagicHeader textFieldText: transportPacketMagicHeader
textField.validator: IntValidator { bottom: 0 } textField.validator: IntValidator { bottom: 0 }
parentFlickable: fl parentFlickable: fl
@@ -316,7 +316,7 @@ PageType {
Layout.topMargin: 16 Layout.topMargin: 16
parentFlickable: fl parentFlickable: fl
headerText: "H3 - Underload packet magic header" headerText: qsTr("H3 - Underload packet magic header")
textFieldText: underloadPacketMagicHeader textFieldText: underloadPacketMagicHeader
textField.validator: IntValidator { bottom: 0 } textField.validator: IntValidator { bottom: 0 }
@@ -104,8 +104,6 @@ PageType {
enabled: false enabled: false
} }
} }
DividerType {}
} }
} }
} }
@@ -74,7 +74,7 @@ PageType {
onFocusChanged: { onFocusChanged: {
if (focus) { if (focus) {
listview.currentItem.focusItem.forceActiveFocus() listview.currentItem.listViewFocusItem.forceActiveFocus()
} }
} }
@@ -82,7 +82,7 @@ PageType {
implicitWidth: listview.width implicitWidth: listview.width
implicitHeight: col.implicitHeight implicitHeight: col.implicitHeight
property alias focusItem: hostLabel.rightButton property alias listViewFocusItem: hostLabel.rightButton
ColumnLayout { ColumnLayout {
id: col id: col
@@ -290,48 +290,12 @@ PageType {
text: qsTr("Detailed instructions") text: qsTr("Detailed instructions")
parentFlickable: fl parentFlickable: fl
KeyNavigation.tab: removeButton Keys.onTabPressed: lastItemTabClicked(focusItem)
clickedFunc: function() { clickedFunc: function() {
// Qt.openUrlExternally("https://github.com/amnezia-vpn/desktop-client/releases/latest") // Qt.openUrlExternally("https://github.com/amnezia-vpn/desktop-client/releases/latest")
} }
} }
BasicButtonType {
id: removeButton
Layout.topMargin: 24
Layout.bottomMargin: 16
Layout.leftMargin: 8
implicitHeight: 32
defaultColor: AmneziaStyle.color.transparent
hoveredColor: AmneziaStyle.color.blackHovered
pressedColor: AmneziaStyle.color.blackPressed
textColor: AmneziaStyle.color.red
parentFlickable: fl
Keys.onTabPressed: lastItemTabClicked()
text: qsTr("Remove SFTP and all data stored there")
clickedFunc: function() {
var headerText = qsTr("Remove SFTP and all data stored there?")
var yesButtonText = qsTr("Continue")
var noButtonText = qsTr("Cancel")
var yesButtonFunction = function() {
PageController.goToPage(PageEnum.PageDeinstalling)
InstallController.removeProcessedContainer()
}
var noButtonFunction = function() {
if (!GC.isMobile()) {
removeButton.forceActiveFocus()
}
}
showQuestionDrawer(headerText, "", yesButtonText, noButtonText, yesButtonFunction, noButtonFunction)
}
}
} }
} }
} }
@@ -88,7 +88,7 @@ PageType {
rightImageSource: "qrc:/images/controls/copy.svg" rightImageSource: "qrc:/images/controls/copy.svg"
rightImageColor: AmneziaStyle.color.white rightImageColor: AmneziaStyle.color.white
KeyNavigation.tab: removeButton Keys.onTabPressed: lastItemTabClicked(focusItem)
clickedFunction: function() { clickedFunction: function() {
GC.copyToClipBoard(descriptionText) GC.copyToClipBoard(descriptionText)
@@ -127,41 +127,6 @@ PageType {
text: qsTr("When configuring WordPress set the this onion address as domain.") text: qsTr("When configuring WordPress set the this onion address as domain.")
} }
BasicButtonType {
id: removeButton
Layout.topMargin: 24
Layout.bottomMargin: 16
Layout.leftMargin: 8
implicitHeight: 32
defaultColor: AmneziaStyle.color.transparent
hoveredColor: AmneziaStyle.color.blackHovered
pressedColor: AmneziaStyle.color.blackPressed
textColor: AmneziaStyle.color.red
text: qsTr("Remove website")
Keys.onTabPressed: lastItemTabClicked(focusItem)
clickedFunc: function() {
var headerText = qsTr("The site with all data will be removed from the tor network.")
var yesButtonText = qsTr("Continue")
var noButtonText = qsTr("Cancel")
var yesButtonFunction = function() {
PageController.goToPage(PageEnum.PageDeinstalling)
InstallController.removeProcessedContainer()
}
var noButtonFunction = function() {
if (!GC.isMobile()) {
removeButton.forceActiveFocus()
}
}
showQuestionDrawer(headerText, "", yesButtonText, noButtonText, yesButtonFunction, noButtonFunction)
}
}
} }
} }
} }
@@ -276,7 +276,7 @@ PageType {
if (Qt.platform.os === "windows") { if (Qt.platform.os === "windows") {
var fileName = SystemController.getFileName(qsTr("Open executable file"), var fileName = SystemController.getFileName(qsTr("Open executable file"),
qsTr("Executable file (*.*)")) qsTr("Executable files (*.*)"))
if (fileName !== "") { if (fileName !== "") {
AppSplitTunnelingController.addApp(fileName) AppSplitTunnelingController.addApp(fileName)
} }
@@ -51,6 +51,8 @@ PageType {
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
spacing: 0
HeaderType { HeaderType {
Layout.fillWidth: true Layout.fillWidth: true
Layout.leftMargin: 16 Layout.leftMargin: 16
@@ -105,6 +105,7 @@ PageType {
case ProtocolEnum.WireGuard: WireGuardConfigModel.updateModel(ProtocolsModel.getConfig()); break; case ProtocolEnum.WireGuard: WireGuardConfigModel.updateModel(ProtocolsModel.getConfig()); break;
case ProtocolEnum.Awg: AwgConfigModel.updateModel(ProtocolsModel.getConfig()); break; case ProtocolEnum.Awg: AwgConfigModel.updateModel(ProtocolsModel.getConfig()); break;
case ProtocolEnum.Xray: XrayConfigModel.updateModel(ProtocolsModel.getConfig()); break; case ProtocolEnum.Xray: XrayConfigModel.updateModel(ProtocolsModel.getConfig()); break;
case ProtocolEnum.Sftp: SftpConfigModel.updateModel(ProtocolsModel.getConfig()); break;
case ProtocolEnum.Ipsec: Ikev2ConfigModel.updateModel(ProtocolsModel.getConfig()); break; case ProtocolEnum.Ipsec: Ikev2ConfigModel.updateModel(ProtocolsModel.getConfig()); break;
case ProtocolEnum.Socks5Proxy: Socks5ProxyConfigModel.updateModel(ProtocolsModel.getConfig()); break; case ProtocolEnum.Socks5Proxy: Socks5ProxyConfigModel.updateModel(ProtocolsModel.getConfig()); break;
} }
+6 -1
View File
@@ -202,7 +202,7 @@ PageType {
parent: root parent: root
anchors.fill: parent anchors.fill: parent
expandedHeight: root.height * 0.45 expandedHeight: root.height
onClosed: { onClosed: {
if (!GC.isMobile()) { if (!GC.isMobile()) {
clientNameTextField.textField.forceActiveFocus() clientNameTextField.textField.forceActiveFocus()
@@ -210,6 +210,7 @@ PageType {
} }
expandedContent: ColumnLayout { expandedContent: ColumnLayout {
id: shareFullAccessDrawerContent
anchors.top: parent.top anchors.top: parent.top
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
@@ -217,6 +218,10 @@ PageType {
spacing: 0 spacing: 0
onImplicitHeightChanged: {
shareFullAccessDrawer.expandedHeight = shareFullAccessDrawerContent.implicitHeight + 32
}
Connections { Connections {
target: shareFullAccessDrawer target: shareFullAccessDrawer
enabled: !GC.isMobile() enabled: !GC.isMobile()
+2 -2
View File
@@ -214,8 +214,8 @@ PageType {
startY: 0 startY: 0
PathLine { x: width; y: 0 } PathLine { x: width; y: 0 }
PathLine { x: width; y: height - 1 } PathLine { x: width; y: tabBar.height - 1 }
PathLine { x: 0; y: height - 1 } PathLine { x: 0; y: tabBar.height - 1 }
PathLine { x: 0; y: 0 } PathLine { x: 0; y: 0 }
strokeWidth: 1 strokeWidth: 1
+1
View File
@@ -21,6 +21,7 @@ class IpcInterface
SLOT( void cleanUp() ); SLOT( void cleanUp() );
SLOT( void setLogsEnabled(bool enabled) ); SLOT( void setLogsEnabled(bool enabled) );
SLOT( void clearLogs() );
SLOT( bool createTun(const QString &dev, const QString &subnet) ); SLOT( bool createTun(const QString &dev, const QString &subnet) );
SLOT( bool deleteTun(const QString &dev) ); SLOT( bool deleteTun(const QString &dev) );
+4
View File
@@ -162,6 +162,10 @@ void IpcServer::cleanUp()
Logger::cleanUp(); Logger::cleanUp();
} }
void IpcServer::clearLogs() {
Logger::clearLogs();
}
bool IpcServer::createTun(const QString &dev, const QString &subnet) bool IpcServer::createTun(const QString &dev, const QString &subnet)
{ {
return Router::createTun(dev, subnet); return Router::createTun(dev, subnet);
+1
View File
@@ -26,6 +26,7 @@ public:
virtual bool checkAndInstallDriver() override; virtual bool checkAndInstallDriver() override;
virtual QStringList getTapList() override; virtual QStringList getTapList() override;
virtual void cleanUp() override; virtual void cleanUp() override;
virtual void clearLogs() override;
virtual void setLogsEnabled(bool enabled) override; virtual void setLogsEnabled(bool enabled) override;
virtual bool createTun(const QString &dev, const QString &subnet) override; virtual bool createTun(const QString &dev, const QString &subnet) override;
virtual bool deleteTun(const QString &dev) override; virtual bool deleteTun(const QString &dev) override;
Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 339 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

-2
View File
@@ -46,8 +46,6 @@ int main(int argc, char **argv)
{ {
Utils::initializePath(Utils::systemLogPath()); Utils::initializePath(Utils::systemLogPath());
Logger::init();
if (argc >= 2) { if (argc >= 2) {
qInfo() << "Started as console application"; qInfo() << "Started as console application";
return runApplication(argc, argv); return runApplication(argc, argv);