diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 63bda344..d9138516 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -10,12 +10,13 @@ env: jobs: Build-Linux-Ubuntu: - name: 'Build-Linux-Ubuntu' runs-on: ubuntu-20.04 env: QT_VERSION: 6.6.2 QIF_VERSION: 4.7 + PROD_AGW_PUBLIC_KEY: ${{ secrets.PROD_AGW_PUBLIC_KEY }} + DEV_AGW_PUBLIC_KEY: ${{ secrets.DEV_AGW_PUBLIC_KEY }} steps: - name: 'Install Qt' @@ -75,13 +76,14 @@ jobs: # ------------------------------------------------------ Build-Windows: - name: Build-Windows runs-on: windows-latest env: QT_VERSION: 6.6.2 QIF_VERSION: 4.7 BUILD_ARCH: 64 + PROD_AGW_PUBLIC_KEY: ${{ secrets.PROD_AGW_PUBLIC_KEY }} + DEV_AGW_PUBLIC_KEY: ${{ secrets.DEV_AGW_PUBLIC_KEY }} steps: - name: 'Get sources' @@ -137,13 +139,14 @@ jobs: # ------------------------------------------------------ Build-iOS: - name: 'Build-iOS' runs-on: macos-13 env: QT_VERSION: 6.6.2 CC: cc CXX: c++ + PROD_AGW_PUBLIC_KEY: ${{ secrets.PROD_AGW_PUBLIC_KEY }} + DEV_AGW_PUBLIC_KEY: ${{ secrets.DEV_AGW_PUBLIC_KEY }} steps: - name: 'Setup xcode' @@ -178,7 +181,7 @@ jobs: - name: 'Install go' uses: actions/setup-go@v5 with: - go-version: '1.20' + go-version: '1.22.1' cache: false - name: 'Setup gomobile' @@ -228,13 +231,14 @@ jobs: # ------------------------------------------------------ Build-MacOS: - name: 'Build-MacOS' runs-on: macos-latest env: # Keep compat with MacOS 10.15 aka Catalina by Qt 6.4 QT_VERSION: 6.4.3 QIF_VERSION: 4.6 + PROD_AGW_PUBLIC_KEY: ${{ secrets.PROD_AGW_PUBLIC_KEY }} + DEV_AGW_PUBLIC_KEY: ${{ secrets.DEV_AGW_PUBLIC_KEY }} steps: - name: 'Setup xcode' @@ -293,28 +297,29 @@ jobs: # ------------------------------------------------------ Build-Android: - name: 'Build-Android' runs-on: ubuntu-latest env: ANDROID_BUILD_PLATFORM: android-34 - QT_VERSION: 6.6.2 + QT_VERSION: 6.7.2 QT_MODULES: 'qtremoteobjects qt5compat qtimageformats qtshadertools' + PROD_AGW_PUBLIC_KEY: ${{ secrets.PROD_AGW_PUBLIC_KEY }} + DEV_AGW_PUBLIC_KEY: ${{ secrets.DEV_AGW_PUBLIC_KEY }} steps: - name: 'Install desktop Qt' - uses: jurplel/install-qt-action@v3 + uses: jurplel/install-qt-action@v4 with: version: ${{ env.QT_VERSION }} host: 'linux' target: 'desktop' - arch: 'gcc_64' + arch: 'linux_gcc_64' modules: ${{ env.QT_MODULES }} dir: ${{ runner.temp }} extra: '--external 7z --base ${{ env.QT_MIRROR }}' - name: 'Install android_x86_64 Qt' - uses: jurplel/install-qt-action@v3 + uses: jurplel/install-qt-action@v4 with: version: ${{ env.QT_VERSION }} host: 'linux' @@ -325,7 +330,7 @@ jobs: extra: '--external 7z --base ${{ env.QT_MIRROR }}' - name: 'Install android_x86 Qt' - uses: jurplel/install-qt-action@v3 + uses: jurplel/install-qt-action@v4 with: version: ${{ env.QT_VERSION }} host: 'linux' @@ -336,7 +341,7 @@ jobs: extra: '--external 7z --base ${{ env.QT_MIRROR }}' - name: 'Install android_armv7 Qt' - uses: jurplel/install-qt-action@v3 + uses: jurplel/install-qt-action@v4 with: version: ${{ env.QT_VERSION }} host: 'linux' @@ -347,7 +352,7 @@ jobs: extra: '--external 7z --base ${{ env.QT_MIRROR }}' - name: 'Install android_arm64_v8a Qt' - uses: jurplel/install-qt-action@v3 + uses: jurplel/install-qt-action@v4 with: version: ${{ env.QT_VERSION }} host: 'linux' @@ -439,3 +444,21 @@ jobs: path: deploy/build/AmneziaVPN-release.aab compression-level: 0 retention-days: 7 + + Extra: + runs-on: ubuntu-latest + steps: + - name: Search a corresponding PR + uses: octokit/request-action@v2.x + id: pull_request + with: + route: GET /repos/${{ github.repository }}/pulls + head: ${{ github.repository_owner }}:${{ github.ref_name }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Add PR link to build summary + if: ${{ fromJSON(steps.pull_request.outputs.data)[0].number != '' }} + run: | + echo "Pull request:" >> $GITHUB_STEP_SUMMARY + echo "[[#${{ fromJSON(steps.pull_request.outputs.data)[0].number }}] ${{ fromJSON(steps.pull_request.outputs.data)[0].title }}](${{ fromJSON(steps.pull_request.outputs.data)[0].html_url }})" >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/tag-deploy.yml b/.github/workflows/tag-deploy.yml index b88390f4..dffb3ab1 100644 --- a/.github/workflows/tag-deploy.yml +++ b/.github/workflows/tag-deploy.yml @@ -15,6 +15,8 @@ jobs: env: QT_VERSION: 6.4.1 QIF_VERSION: 4.5 + PROD_AGW_PUBLIC_KEY: ${{ secrets.PROD_AGW_PUBLIC_KEY }} + DEV_AGW_PUBLIC_KEY: ${{ secrets.DEV_AGW_PUBLIC_KEY }} steps: - name: 'Install desktop Qt' diff --git a/.gitmodules b/.gitmodules index 78d45e25..3ceaa56e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -13,3 +13,6 @@ [submodule "client/3rd/amneziawg-apple"] path = client/3rd/amneziawg-apple url = https://github.com/amnezia-vpn/amneziawg-apple +[submodule "client/3rd/QSimpleCrypto"] + path = client/3rd/QSimpleCrypto + url = https://github.com/amnezia-vpn/QSimpleCrypto.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 51ca8edc..fba4183c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.25.0 FATAL_ERROR) set(PROJECT AmneziaVPN) -project(${PROJECT} VERSION 4.6.1.0 +project(${PROJECT} VERSION 4.8.1.9 DESCRIPTION "AmneziaVPN" HOMEPAGE_URL "https://amnezia.org/" ) @@ -11,7 +11,7 @@ string(TIMESTAMP CURRENT_DATE "%Y-%m-%d") set(RELEASE_DATE "${CURRENT_DATE}") set(APP_MAJOR_VERSION ${CMAKE_PROJECT_VERSION_MAJOR}.${CMAKE_PROJECT_VERSION_MINOR}.${CMAKE_PROJECT_VERSION_PATCH}) -set(APP_ANDROID_VERSION_CODE 56) +set(APP_ANDROID_VERSION_CODE 65) if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") set(MZ_PLATFORM_NAME "linux") diff --git a/README.md b/README.md index 64fe5e0c..e4a6bf0c 100644 --- a/README.md +++ b/README.md @@ -10,10 +10,10 @@ Amnezia is an open-source VPN client, with a key feature that enables you to dep
- - - - + + + +
@@ -28,11 +28,12 @@ Amnezia is an open-source VPN client, with a key feature that enables you to dep ## 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. -- OpenVPN, Shadowsocks, WireGuard, and IKEv2 protocols support. -- Masking VPN with OpenVPN over Cloak plugin -- Split tunneling support - add any sites to the client to enable VPN only for them (only for desktops) +- Very easy to use - enter your IP address, SSH login, password and Amnezia will automatically install VPN docker containers to your server and connect to the VPN. +- Classic VPN-protocols: OpenVPN, WireGuard and IKEv2 protocols. +- Protocols with traffic Masking (Obfuscation): OpenVPN over [Cloak](https://github.com/cbeuw/Cloak) plugin, Shadowsocks (OpenVPN over Shadowsocks), [AmneziaWG](https://docs.amnezia.org/documentation/amnezia-wg/) and XRay. +- Split tunneling support - add any sites to the client to enable VPN only for them or add Apps (only for Android and Desktop). - Windows, MacOS, Linux, Android, iOS releases. +- Support for AmneziaWG protocol configuration on [Keenetic beta firmware](https://docs.keenetic.com/ua/air/kn-1611/en/6319-latest-development-release.html#UUID-186c4108-5afd-c10b-f38a-cdff6c17fab3_section-idm33192196168192-improved). ## Links @@ -41,7 +42,8 @@ Amnezia is an open-source VPN client, with a key feature that enables you to dep - [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_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) +- [https://vpnpay.io/en/amnezia-premium/](https://vpnpay.io/en/amnezia-premium/) - Amnezia Premium ## Tech @@ -181,6 +183,7 @@ GPL v3.0 Patreon: [https://www.patreon.com/amneziavpn](https://www.patreon.com/amneziavpn) +Bitcoin: bc1q26eevjcg9j0wuyywd2e3uc9cs2w58lpkpjxq6p
USDT BEP20: 0x6abD576765a826f87D1D95183438f9408C901bE4
USDT TRC20: TELAitazF1MZGmiNjTcnxDjEiH5oe7LC9d
XMR: 48spms39jt1L2L5vyw2RQW6CXD6odUd4jFu19GZcDyKKQV9U88wsJVjSbL4CfRys37jVMdoaWVPSvezCQPhHXUW5UKLqUp3 diff --git a/client/3rd-prebuilt b/client/3rd-prebuilt index c38a587f..ba580dc5 160000 --- a/client/3rd-prebuilt +++ b/client/3rd-prebuilt @@ -1 +1 @@ -Subproject commit c38a587fcda89bab4009560d36239fa8de74705e +Subproject commit ba580dc5bd7784f7b1e110ff0365f3286e549a61 diff --git a/client/3rd/OpenVPNAdapter b/client/3rd/OpenVPNAdapter index dea60409..7c821a8d 160000 --- a/client/3rd/OpenVPNAdapter +++ b/client/3rd/OpenVPNAdapter @@ -1 +1 @@ -Subproject commit dea6040996298e947d63fb172709e6abfec2ba93 +Subproject commit 7c821a8d5c1ad5ad94e0763b4f25a875b5a6fe1b diff --git a/client/3rd/QSimpleCrypto b/client/3rd/QSimpleCrypto new file mode 160000 index 00000000..c99b33f0 --- /dev/null +++ b/client/3rd/QSimpleCrypto @@ -0,0 +1 @@ +Subproject commit c99b33f0e08b7206116ddff85c22d3b97ce1e79d diff --git a/client/3rd/QSimpleCrypto/QSimpleCrypto.cmake b/client/3rd/QSimpleCrypto/QSimpleCrypto.cmake deleted file mode 100644 index 7ec5498a..00000000 --- a/client/3rd/QSimpleCrypto/QSimpleCrypto.cmake +++ /dev/null @@ -1,20 +0,0 @@ -include_directories(${CMAKE_CURRENT_LIST_DIR}) - -set(HEADERS ${HEADERS} - ${CMAKE_CURRENT_LIST_DIR}/include/QAead.h - ${CMAKE_CURRENT_LIST_DIR}/include/QBlockCipher.h - ${CMAKE_CURRENT_LIST_DIR}/include/QCryptoError.h - ${CMAKE_CURRENT_LIST_DIR}/include/QRsa.h - ${CMAKE_CURRENT_LIST_DIR}/include/QSimpleCrypto_global.h - ${CMAKE_CURRENT_LIST_DIR}/include/QX509.h - ${CMAKE_CURRENT_LIST_DIR}/include/QX509Store.h -) - -set(SOURCES ${SOURCES} - ${CMAKE_CURRENT_LIST_DIR}/sources/QAead.cpp - ${CMAKE_CURRENT_LIST_DIR}/sources/QBlockCipher.cpp - ${CMAKE_CURRENT_LIST_DIR}/sources/QCryptoError.cpp - ${CMAKE_CURRENT_LIST_DIR}/sources/QRsa.cpp - ${CMAKE_CURRENT_LIST_DIR}/sources/QX509.cpp - ${CMAKE_CURRENT_LIST_DIR}/sources/QX509Store.cpp -) diff --git a/client/3rd/QSimpleCrypto/QSimpleCrypto.pri b/client/3rd/QSimpleCrypto/QSimpleCrypto.pri deleted file mode 100644 index 99a1c129..00000000 --- a/client/3rd/QSimpleCrypto/QSimpleCrypto.pri +++ /dev/null @@ -1,18 +0,0 @@ -INCLUDEPATH += $$PWD - -HEADERS += \ - $$PWD/include/QAead.h \ - $$PWD/include/QBlockCipher.h \ - $$PWD/include/QCryptoError.h \ - $$PWD/include/QRsa.h \ - $$PWD/include/QSimpleCrypto_global.h \ - $$PWD/include/QX509.h \ - $$PWD/include/QX509Store.h - -SOURCES += \ - $$PWD/sources/QAead.cpp \ - $$PWD/sources/QBlockCipher.cpp \ - $$PWD/sources/QCryptoError.cpp \ - $$PWD/sources/QRsa.cpp \ - $$PWD/sources/QX509.cpp \ - $$PWD/sources/QX509Store.cpp diff --git a/client/3rd/QSimpleCrypto/include/QAead.h b/client/3rd/QSimpleCrypto/include/QAead.h deleted file mode 100644 index 11f60b31..00000000 --- a/client/3rd/QSimpleCrypto/include/QAead.h +++ /dev/null @@ -1,87 +0,0 @@ -/** - * Copyright 2021 BrutalWizard (https://github.com/bru74lw1z4rd). All Rights Reserved. - * - * Licensed under the Apache License 2.0 (the "License"). You may not use - * this file except in compliance with the License. You can obtain a copy - * in the file LICENSE in the source distribution -**/ - -#ifndef QAEAD_H -#define QAEAD_H - -#include "QSimpleCrypto_global.h" - -#include - -#include - -#include -#include -#include -#include - -#include "QCryptoError.h" - -// clang-format off -namespace QSimpleCrypto -{ - class QSIMPLECRYPTO_EXPORT QAead { - public: - QAead(); - - /// - /// \brief encryptAesGcm - Function encrypts data with Gcm algorithm. - /// \param data - Data that will be encrypted. - /// \param key - AES key. - /// \param iv - Initialization vector. - /// \param tag - Authorization tag. - /// \param aad - Additional authenticated data. Must be nullptr, if not used. - /// \param cipher - Can be used with OpenSSL EVP_CIPHER (gcm) - 128, 192, 256. Example: EVP_aes_256_gcm(). - /// \return Returns encrypted data or "", if error happened. - /// - QByteArray encryptAesGcm(QByteArray data, QByteArray key, QByteArray iv, QByteArray* tag, QByteArray aad = "", const EVP_CIPHER* cipher = EVP_aes_256_gcm()); - - /// - /// \brief decryptAesGcm - Function decrypts data with Gcm algorithm. - /// \param data - Data that will be decrypted - /// \param key - AES key - /// \param iv - Initialization vector - /// \param tag - Authorization tag - /// \param aad - Additional authenticated data. Must be nullptr, if not used - /// \param cipher - Can be used with OpenSSL EVP_CIPHER (gcm) - 128, 192, 256. Example: EVP_aes_256_gcm() - /// \return Returns decrypted data or "", if error happened. - /// - QByteArray decryptAesGcm(QByteArray data, QByteArray key, QByteArray iv, QByteArray* tag, QByteArray aad = "", const EVP_CIPHER* cipher = EVP_aes_256_gcm()); - - /// - /// \brief encryptAesCcm - Function encrypts data with Ccm algorithm. - /// \param data - Data that will be encrypted. - /// \param key - AES key. - /// \param iv - Initialization vector. - /// \param tag - Authorization tag. - /// \param aad - Additional authenticated data. Must be nullptr, if not used. - /// \param cipher - Can be used with OpenSSL EVP_CIPHER (ccm) - 128, 192, 256. Example: EVP_aes_256_ccm(). - /// \return Returns encrypted data or "", if error happened. - /// - QByteArray encryptAesCcm(QByteArray data, QByteArray key, QByteArray iv, QByteArray* tag, QByteArray aad = "", const EVP_CIPHER* cipher = EVP_aes_256_ccm()); - - /// - /// \brief decryptAesCcm - Function decrypts data with Ccm algorithm. - /// \param data - Data that will be decrypted. - /// \param key - AES key. - /// \param iv - Initialization vector. - /// \param tag - Authorization tag. - /// \param aad - Additional authenticated data. Must be nullptr, if not used. - /// \param cipher - Can be used with OpenSSL EVP_CIPHER (ccm) - 128, 192, 256. Example: EVP_aes_256_ccm(). - /// \return Returns decrypted data or "", if error happened. - /// - QByteArray decryptAesCcm(QByteArray data, QByteArray key, QByteArray iv, QByteArray* tag, QByteArray aad = "", const EVP_CIPHER* cipher = EVP_aes_256_ccm()); - - /// - /// \brief error - Error handler class. - /// - QCryptoError error; - }; -} // namespace QSimpleCrypto - -#endif // QAEAD_H diff --git a/client/3rd/QSimpleCrypto/include/QBlockCipher.h b/client/3rd/QSimpleCrypto/include/QBlockCipher.h deleted file mode 100644 index e7b83a88..00000000 --- a/client/3rd/QSimpleCrypto/include/QBlockCipher.h +++ /dev/null @@ -1,84 +0,0 @@ -/** - * Copyright 2021 BrutalWizard (https://github.com/bru74lw1z4rd). All Rights Reserved. - * - * Licensed under the Apache License 2.0 (the "License"). You may not use - * this file except in compliance with the License. You can obtain a copy - * in the file LICENSE in the source distribution -**/ - -#ifndef QBLOCKCIPHER_H -#define QBLOCKCIPHER_H - -#include "QSimpleCrypto_global.h" - -#include - -#include - -#include -#include -#include -#include - -#include "QCryptoError.h" - -// clang-format off -namespace QSimpleCrypto -{ - class QSIMPLECRYPTO_EXPORT QBlockCipher { - - #define Aes128Rounds 10 - #define Aes192Rounds 12 - #define Aes256Rounds 14 - - public: - QBlockCipher(); - - /// - /// \brief generateRandomBytes - Function generates random bytes by size. - /// \param size - Size of generated bytes. - /// \return Returns random bytes. - /// - QByteArray generateRandomBytes(const int& size); - QByteArray generateSecureRandomBytes(const int& size); - - /// - /// \brief encryptAesBlockCipher - Function encrypts data with Aes Block Cipher algorithm. - /// \param data - Data that will be encrypted. - /// \param key - AES key. - /// \param iv - Initialization vector. - /// \param password - Encryption password. - /// \param salt - Random delta. - /// \param rounds - Transformation rounds. - /// \param chiper - Can be used with OpenSSL EVP_CIPHER (ecb, cbc, cfb, ofb, ctr) - 128, 192, 256. Example: EVP_aes_256_cbc(). - /// \param md - Hash algroitm (OpenSSL EVP_MD). Example: EVP_sha512(). - /// \return Returns decrypted data or "", if error happened. - /// - QByteArray encryptAesBlockCipher(QByteArray data, QByteArray key, - QByteArray iv = "", const int& rounds = Aes256Rounds, - const EVP_CIPHER* cipher = EVP_aes_256_cbc(), const EVP_MD* md = EVP_sha512()); - - /// - /// \brief decryptAesBlockCipher - Function decrypts data with Aes Block Cipher algorithm. - /// \param data - Data that will be decrypted. - /// \param key - AES key. - /// \param iv - Initialization vector. - /// \param password - Decryption password. - /// \param salt - Random delta. - /// \param rounds - Transformation rounds. - /// \param chiper - Can be used with OpenSSL EVP_CIPHER (ecb, cbc, cfb, ofb, ctr) - 128, 192, 256. Example: EVP_aes_256_cbc(). - /// \param md - Hash algroitm (OpenSSL EVP_MD). Example: EVP_sha512(). - /// \return Returns decrypted data or "", if error happened. - /// - QByteArray decryptAesBlockCipher(QByteArray data, QByteArray key, - QByteArray iv = "", const int& rounds = Aes256Rounds, - const EVP_CIPHER* cipher = EVP_aes_256_cbc(), const EVP_MD* md = EVP_sha512()); - - /// - /// \brief error - Error handler class. - /// - QCryptoError error; - }; -} // namespace QSimpleCrypto - -#endif // QBLOCKCIPHER_H diff --git a/client/3rd/QSimpleCrypto/include/QCryptoError.h b/client/3rd/QSimpleCrypto/include/QCryptoError.h deleted file mode 100644 index fc059654..00000000 --- a/client/3rd/QSimpleCrypto/include/QCryptoError.h +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef QCRYPTOERROR_H -#define QCRYPTOERROR_H - -#include - -#include "QSimpleCrypto_global.h" - -/// TODO: Add Special error code for each error. - -// clang-format off -namespace QSimpleCrypto -{ - class QSIMPLECRYPTO_EXPORT QCryptoError : public QObject { - Q_OBJECT - - public: - explicit QCryptoError(QObject* parent = nullptr); - - /// - /// \brief setError - Sets error information - /// \param errorCode - Error code. - /// \param errorSummary - Error summary. - /// - inline void setError(const quint8 errorCode, const QString& errorSummary) - { - m_currentErrorCode = errorCode; - m_errorSummary = errorSummary; - } - - /// - /// \brief lastError - Returns last error. - /// \return Returns eror ID and error Text. - /// - inline QPair lastError() const - { - return QPair(m_currentErrorCode, m_errorSummary); - } - - private: - quint8 m_currentErrorCode; - QString m_errorSummary; - }; -} - -#endif // QCRYPTOERROR_H diff --git a/client/3rd/QSimpleCrypto/include/QRsa.h b/client/3rd/QSimpleCrypto/include/QRsa.h deleted file mode 100644 index 45eb3169..00000000 --- a/client/3rd/QSimpleCrypto/include/QRsa.h +++ /dev/null @@ -1,104 +0,0 @@ -/** - * Copyright 2021 BrutalWizard (https://github.com/bru74lw1z4rd). All Rights Reserved. - * - * Licensed under the Apache License 2.0 (the "License"). You may not use - * this file except in compliance with the License. You can obtain a copy - * in the file LICENSE in the source distribution -**/ - -#ifndef QRSA_H -#define QRSA_H - -#include "QSimpleCrypto_global.h" - -#include -#include - -#include - -#include -#include -#include - -#include "QCryptoError.h" - -// clang-format off -namespace QSimpleCrypto -{ - class QSIMPLECRYPTO_EXPORT QRsa { - - #define PublicEncrypt 0 - #define PrivateEncrypt 1 - #define PublicDecrypt 2 - #define PrivateDecrypt 3 - - public: - QRsa(); - - /// - /// \brief generateRsaKeys - Function generate Rsa Keys and returns them in OpenSSL structure. - /// \param bits - RSA key size. - /// \param rsaBigNumber - The exponent is an odd number, typically 3, 17 or 65537. - /// \return Returns 'OpenSSL RSA structure' or 'nullptr', if error happened. Returned value must be cleaned up with 'RSA_free()' to avoid memory leak. - /// - RSA* generateRsaKeys(const int& bits, const int& rsaBigNumber); - - /// - /// \brief savePublicKey - Saves to file RSA public key. - /// \param rsa - OpenSSL RSA structure. - /// \param publicKeyFileName - Public key file name. - /// - void savePublicKey(RSA *rsa, const QByteArray& publicKeyFileName); - - /// - /// \brief savePrivateKey - Saves to file RSA private key. - /// \param rsa - OpenSSL RSA structure. - /// \param privateKeyFileName - Private key file name. - /// \param password - Private key password. - /// \param cipher - Can be used with 'OpenSSL EVP_CIPHER' (ecb, cbc, cfb, ofb, ctr) - 128, 192, 256. Example: EVP_aes_256_cbc(). - /// - void savePrivateKey(RSA* rsa, const QByteArray& privateKeyFileName, QByteArray password = "", const EVP_CIPHER* cipher = nullptr); - - /// - /// \brief getPublicKeyFromFile - Gets RSA public key from a file. - /// \param filePath - File path to public key file. - /// \return Returns 'OpenSSL EVP_PKEY structure' or 'nullptr', if error happened. Returned value must be cleaned up with 'EVP_PKEY_free()' to avoid memory leak. - /// - EVP_PKEY* getPublicKeyFromFile(const QByteArray& filePath); - - /// - /// \brief getPrivateKeyFromFile - Gets RSA private key from a file. - /// \param filePath - File path to private key file. - /// \param password - Private key password. - /// \return - Returns 'OpenSSL EVP_PKEY structure' or 'nullptr', if error happened. Returned value must be cleaned up with 'EVP_PKEY_free()' to avoid memory leak. - /// - EVP_PKEY* getPrivateKeyFromFile(const QByteArray& filePath, const QByteArray& password = ""); - - /// - /// \brief encrypt - Encrypt data with RSA algorithm. - /// \param plaintext - Text that must be encrypted. - /// \param rsa - OpenSSL RSA structure. - /// \param encryptType - Public or private encrypt type. (PUBLIC_ENCRYPT, PRIVATE_ENCRYPT). - /// \param padding - OpenSSL RSA padding can be used with: 'RSA_PKCS1_PADDING', 'RSA_NO_PADDING' and etc. - /// \return Returns encrypted data or "", if error happened. - /// - QByteArray encrypt(QByteArray plainText, RSA* rsa, const int& encryptType = PublicEncrypt, const int& padding = RSA_PKCS1_PADDING); - - /// - /// \brief decrypt - Decrypt data with RSA algorithm. - /// \param cipherText - Text that must be decrypted. - /// \param rsa - OpenSSL RSA structure. - /// \param decryptType - Public or private type. (PUBLIC_DECRYPT, PRIVATE_DECRYPT). - /// \param padding - RSA padding can be used with: 'RSA_PKCS1_PADDING', 'RSA_NO_PADDING' and etc. - /// \return - Returns decrypted data or "", if error happened. - /// - QByteArray decrypt(QByteArray cipherText, RSA* rsa, const int& decryptType = PrivateDecrypt, const int& padding = RSA_PKCS1_PADDING); - - /// - /// \brief error - Error handler class. - /// - QCryptoError error; - }; -} // namespace QSimpleCrypto - -#endif // QRSA_H diff --git a/client/3rd/QSimpleCrypto/include/QSimpleCrypto_global.h b/client/3rd/QSimpleCrypto/include/QSimpleCrypto_global.h deleted file mode 100644 index fdd6c020..00000000 --- a/client/3rd/QSimpleCrypto/include/QSimpleCrypto_global.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef QSIMPLECRYPTO_GLOBAL_H -#define QSIMPLECRYPTO_GLOBAL_H - -#include -#include - -#define QSIMPLECRYPTO_EXPORT - -#endif // QSIMPLECRYPTO_GLOBAL_H diff --git a/client/3rd/QSimpleCrypto/include/QX509.h b/client/3rd/QSimpleCrypto/include/QX509.h deleted file mode 100644 index c31cb9e4..00000000 --- a/client/3rd/QSimpleCrypto/include/QX509.h +++ /dev/null @@ -1,87 +0,0 @@ -/** - * Copyright 2021 BrutalWizard (https://github.com/bru74lw1z4rd). All Rights Reserved. - * - * Licensed under the Apache License 2.0 (the "License"). You may not use - * this file except in compliance with the License. You can obtain a copy - * in the file LICENSE in the source distribution -**/ - -#ifndef QX509_H -#define QX509_H - -#include "QSimpleCrypto_global.h" - -#include -#include - -#include - -#include -#include -#include -#include -#include - -#include "QCryptoError.h" - -// clang-format off -namespace QSimpleCrypto -{ - class QSIMPLECRYPTO_EXPORT QX509 { - - #define oneYear 31536000L - #define x509LastVersion 2 - - public: - QX509(); - - /// - /// \brief loadCertificateFromFile - Function load X509 from file and returns OpenSSL structure. - /// \param fileName - File path to certificate. - /// \return Returns OpenSSL X509 structure or nullptr, if error happened. Returned value must be cleaned up with 'X509_free' to avoid memory leak. - /// - X509* loadCertificateFromFile(const QByteArray& fileName); - - /// - /// \brief signCertificate - Function signs X509 certificate and returns signed X509 OpenSSL structure. - /// \param endCertificate - Certificate that will be signed - /// \param caCertificate - CA certificate that will sign end certificate - /// \param caPrivateKey - CA certificate private key - /// \param fileName - With that name certificate will be saved. Leave "", if don't need to save it - /// \return Returns OpenSSL X509 structure or nullptr, if error happened. - /// - X509* signCertificate(X509* endCertificate, X509* caCertificate, EVP_PKEY* caPrivateKey, const QByteArray& fileName = ""); - - /// - /// \brief verifyCertificate - Function verifies X509 certificate and returns verified X509 OpenSSL structure. - /// \param x509 - OpenSSL X509. That certificate will be verified. - /// \param store - Trusted certificate must be added to X509_Store with 'addCertificateToStore(X509_STORE* ctx, X509* x509)'. - /// \return Returns OpenSSL X509 structure or nullptr, if error happened - /// - X509* verifyCertificate(X509* x509, X509_STORE* store); - - /// - /// \brief generateSelfSignedCertificate - Function generatesand returns self signed X509. - /// \param rsa - OpenSSL RSA. - /// \param additionalData - Certificate information. - /// \param certificateFileName - With that name certificate will be saved. Leave "", if don't need to save it. - /// \param md - OpenSSL EVP_MD structure. Example: EVP_sha512(). - /// \param serialNumber - X509 certificate serial number. - /// \param version - X509 certificate version. - /// \param notBefore - X509 start date. - /// \param notAfter - X509 end date. - /// \return Returns OpenSSL X509 structure or nullptr, if error happened. Returned value must be cleaned up with 'X509_free' to avoid memory leak. - /// - X509* generateSelfSignedCertificate(RSA* rsa, const QMap& additionalData, - const QByteArray& certificateFileName = "", const EVP_MD* md = EVP_sha512(), - const long& serialNumber = 1, const long& version = x509LastVersion, - const long& notBefore = 0, const long& notAfter = oneYear); - - /// - /// \brief error - Error handler class. - /// - QCryptoError error; - }; -} // namespace QSimpleCrypto - -#endif // QX509_H diff --git a/client/3rd/QSimpleCrypto/include/QX509Store.h b/client/3rd/QSimpleCrypto/include/QX509Store.h deleted file mode 100644 index 8cd8ca82..00000000 --- a/client/3rd/QSimpleCrypto/include/QX509Store.h +++ /dev/null @@ -1,120 +0,0 @@ -/** - * Copyright 2021 BrutalWizard (https://github.com/bru74lw1z4rd). All Rights Reserved. - * - * Licensed under the Apache License 2.0 (the "License"). You may not use - * this file except in compliance with the License. You can obtain a copy - * in the file LICENSE in the source distribution -**/ - -#ifndef QX509STORE_H -#define QX509STORE_H - -#include "QSimpleCrypto_global.h" - -#include -#include -#include - -#include - -#include -#include -#include - -#include "QCryptoError.h" - -// clang-format off -namespace QSimpleCrypto -{ - class QSIMPLECRYPTO_EXPORT QX509Store { - public: - QX509Store(); - - /// - /// \brief addCertificateToStore - /// \param store - OpenSSL X509_STORE. - /// \param x509 - OpenSSL X509. - /// \return Returns 'true' on success and 'false', if error happened. - /// - bool addCertificateToStore(X509_STORE* store, X509* x509); - - /// - /// \brief addLookup - /// \param store - OpenSSL X509_STORE. - /// \param method - OpenSSL X509_LOOKUP_METHOD. Example: X509_LOOKUP_file. - /// \return Returns 'true' on success and 'false', if error happened. - /// - bool addLookup(X509_STORE* store, X509_LOOKUP_METHOD* method); - - /// - /// \brief setCertificateDepth - /// \param store - OpenSSL X509_STORE. - /// \param depth - That is the maximum number of untrusted CA certificates that can appear in a chain. Example: 0. - /// \return Returns 'true' on success and 'false', if error happened. - /// - bool setDepth(X509_STORE* store, const int& depth); - - /// - /// \brief setFlag - /// \param store - OpenSSL X509_STORE. - /// \param flag - The verification flags consists of zero or more of the following flags ored together. Example: X509_V_FLAG_CRL_CHECK. - /// \return Returns 'true' on success and 'false', if error happened. - /// - bool setFlag(X509_STORE* store, const unsigned long& flag); - - /// - /// \brief setFlag - /// \param store - OpenSSL X509_STORE. - /// \param purpose - Verification purpose in param to purpose. Example: X509_PURPOSE_ANY. - /// \return Returns 'true' on success and 'false', if error happened. - /// - bool setPurpose(X509_STORE* store, const int& purpose); - - /// - /// \brief setTrust - /// \param store - OpenSSL X509_STORE. - /// \param trust - Trust Level. Example: X509_TRUST_SSL_SERVER. - /// \return Returns 'true' on success and 'false', if error happened. - /// - bool setTrust(X509_STORE* store, const int& trust); - - /// - /// \brief setDefaultPaths - /// \param store - OpenSSL X509_STORE. - /// \return Returns 'true' on success and 'false', if error happened. - /// - bool setDefaultPaths(X509_STORE* store); - - /// - /// \brief loadLocations - /// \param store - OpenSSL X509_STORE. - /// \param fileName - File name. Example: "caCertificate.pem". - /// \param dirPath - Path to file. Example: "path/To/File". - /// \return Returns 'true' on success and 'false', if error happened. - /// - bool loadLocations(X509_STORE* store, const QByteArray& fileName, const QByteArray& dirPath); - - /// - /// \brief loadLocations - /// \param store - OpenSSL X509_STORE. - /// \param file - Qt QFile that will be loaded. - /// \return Returns 'true' on success and 'false', if error happened. - /// - bool loadLocations(X509_STORE* store, const QFile& file); - - /// - /// \brief loadLocations - /// \param store - OpenSSL X509_STORE. - /// \param fileInfo - Qt QFileInfo. - /// \return Returns 'true' on success and 'false', if error happened. - /// - bool loadLocations(X509_STORE* store, const QFileInfo& fileInfo); - - /// - /// \brief error - Error handler class. - /// - QCryptoError error; - }; -} - -#endif // QX509STORE_H diff --git a/client/3rd/QSimpleCrypto/sources/QAead.cpp b/client/3rd/QSimpleCrypto/sources/QAead.cpp deleted file mode 100644 index 968c8841..00000000 --- a/client/3rd/QSimpleCrypto/sources/QAead.cpp +++ /dev/null @@ -1,364 +0,0 @@ -/** - * Copyright 2021 BrutalWizard (https://github.com/bru74lw1z4rd). All Rights Reserved. - * - * Licensed under the Apache License 2.0 (the "License"). You may not use - * this file except in compliance with the License. You can obtain a copy - * in the file LICENSE in the source distribution -**/ - -#include "include/QAead.h" - -QSimpleCrypto::QAead::QAead() -{ -} - -/// -/// \brief QSimpleCrypto::QAEAD::encryptAesGcm - Function encrypts data with Gcm algorithm. -/// \param data - Data that will be encrypted. -/// \param key - AES key. -/// \param iv - Initialization vector. -/// \param tag - Authorization tag. -/// \param aad - Additional authenticated data. Must be nullptr, if not used. -/// \param cipher - Can be used with OpenSSL EVP_CIPHER (gcm) - 128, 192, 256. Example: EVP_aes_256_gcm(). -/// \return Returns encrypted data or "", if error happened. -/// -QByteArray QSimpleCrypto::QAead::encryptAesGcm(QByteArray data, QByteArray key, QByteArray iv, QByteArray* tag, QByteArray aad, const EVP_CIPHER* cipher) -{ - try { - /* Initialize EVP_CIPHER_CTX */ - std::unique_ptr encryptionCipher { EVP_CIPHER_CTX_new(), EVP_CIPHER_CTX_free }; - if (encryptionCipher == nullptr) { - throw std::runtime_error("Couldn't initialize \'encryptionCipher\'. EVP_CIPHER_CTX_new(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - } - - /* Set data length */ - int plainTextLength = data.size(); - int cipherTextLength = 0; - - /* Initialize cipherText. Here encrypted data will be stored */ - std::unique_ptr cipherText { new unsigned char[plainTextLength]() }; - if (cipherText == nullptr) { - throw std::runtime_error("Couldn't allocate memory for 'ciphertext'."); - } - - /* Initialize encryption operation. */ - if (!EVP_EncryptInit_ex(encryptionCipher.get(), cipher, nullptr, reinterpret_cast(key.data()), reinterpret_cast(iv.data()))) { - throw std::runtime_error("Couldn't initialize encryption operation. EVP_EncryptInit_ex(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - } - - /* Set IV length if default 12 bytes (96 bits) is not appropriate */ - if (!EVP_CIPHER_CTX_ctrl(encryptionCipher.get(), EVP_CTRL_GCM_SET_IVLEN, iv.length(), nullptr)) { - throw std::runtime_error("Couldn't set IV length. EVP_CIPHER_CTX_ctrl(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - } - -// /* Check if aad need to be used */ -// if (aad.length() > 0) { -// /* Provide any AAD data. This can be called zero or more times as required */ -// if (!EVP_EncryptUpdate(encryptionCipher.get(), nullptr, &cipherTextLength, reinterpret_cast(aad.data()), aad.length())) { -// throw std::runtime_error("Couldn't provide aad data. EVP_EncryptUpdate(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); -// } -// } - - /* - * Provide the message to be encrypted, and obtain the encrypted output. - * EVP_EncryptUpdate can be called multiple times if necessary - */ - if (!EVP_EncryptUpdate(encryptionCipher.get(), cipherText.get(), &cipherTextLength, reinterpret_cast(data.data()), plainTextLength)) { - throw std::runtime_error("Couldn't provide message to be encrypted. EVP_EncryptUpdate(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - } - - /* - * Finalize the encryption. Normally cipher text bytes may be written at - * this stage, but this does not occur in GCM mode - */ - if (!EVP_EncryptFinal_ex(encryptionCipher.get(), cipherText.get(), &plainTextLength)) { - throw std::runtime_error("Couldn't finalize encryption. EVP_EncryptFinal_ex(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - } - -// /* Get tag */ -// if (!EVP_CIPHER_CTX_ctrl(encryptionCipher.get(), EVP_CTRL_GCM_GET_TAG, tag->length(), reinterpret_cast(tag->data()))) { -// throw std::runtime_error("Couldn't get tag. EVP_CIPHER_CTX_ctrl(. Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); -// } - - /* Finilize data to be readable with qt */ - QByteArray encryptedData = QByteArray(reinterpret_cast(cipherText.get()), cipherTextLength); - - return encryptedData; - - } catch (std::exception& exception) { - QSimpleCrypto::QAead::error.setError(1, exception.what()); - return QByteArray(); - } catch (...) { - QSimpleCrypto::QAead::error.setError(2, "Unknown error!"); - return QByteArray(); - } - - return QByteArray(); -} - -/// -/// \brief QSimpleCrypto::QAEAD::decryptAesGcm - Function decrypts data with Gcm algorithm. -/// \param data - Data that will be decrypted -/// \param key - AES key -/// \param iv - Initialization vector -/// \param tag - Authorization tag -/// \param aad - Additional authenticated data. Must be nullptr, if not used -/// \param cipher - Can be used with OpenSSL EVP_CIPHER (gcm) - 128, 192, 256. Example: EVP_aes_256_gcm() -/// \return Returns decrypted data or "", if error happened. -/// -QByteArray QSimpleCrypto::QAead::decryptAesGcm(QByteArray data, QByteArray key, QByteArray iv, QByteArray* tag, QByteArray aad, const EVP_CIPHER* cipher) -{ - try { - /* Initialize EVP_CIPHER_CTX */ - std::unique_ptr decryptionCipher { EVP_CIPHER_CTX_new(), EVP_CIPHER_CTX_free }; - if (decryptionCipher.get() == nullptr) { - throw std::runtime_error("Couldn't initialize \'decryptionCipher\'. EVP_CIPHER_CTX_new(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - } - - /* Set data length */ - int cipherTextLength = data.size(); - int plainTextLength = 0; - - /* Initialize plainText. Here decrypted data will be stored */ - std::unique_ptr plainText { new unsigned char[cipherTextLength]() }; - if (plainText == nullptr) { - throw std::runtime_error("Couldn't allocate memory for 'plaintext'."); - } - - /* Initialize decryption operation. */ - if (!EVP_DecryptInit_ex(decryptionCipher.get(), cipher, nullptr, reinterpret_cast(key.data()), reinterpret_cast(iv.data()))) { - throw std::runtime_error("Couldn't initialize decryption operation. EVP_DecryptInit_ex(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - } - - /* Set IV length. Not necessary if this is 12 bytes (96 bits) */ - if (!EVP_CIPHER_CTX_ctrl(decryptionCipher.get(), EVP_CTRL_GCM_SET_IVLEN, iv.length(), nullptr)) { - throw std::runtime_error("Couldn't set IV length. EVP_CIPHER_CTX_ctrl(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - } - -// /* Check if aad need to be used */ -// if (aad.length() > 0) { -// /* Provide any AAD data. This can be called zero or more times as required */ -// if (!EVP_DecryptUpdate(decryptionCipher.get(), nullptr, &plainTextLength, reinterpret_cast(aad.data()), aad.length())) { -// throw std::runtime_error("Couldn't provide aad data. EVP_DecryptUpdate(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); -// } -// } - - /* - * Provide the message to be decrypted, and obtain the plain text output. - * EVP_DecryptUpdate can be called multiple times if necessary - */ - if (!EVP_DecryptUpdate(decryptionCipher.get(), plainText.get(), &plainTextLength, reinterpret_cast(data.data()), cipherTextLength)) { - throw std::runtime_error("Couldn't provide message to be decrypted. EVP_DecryptUpdate(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - } - -// /* Set expected tag value. Works in OpenSSL 1.0.1d and later */ -// if (!EVP_CIPHER_CTX_ctrl(decryptionCipher.get(), EVP_CTRL_GCM_SET_TAG, tag->length(), reinterpret_cast(tag->data()))) { -// throw std::runtime_error("Coldn't set tag. EVP_CIPHER_CTX_ctrl(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); -// } - - /* - * Finalize the decryption. A positive return value indicates success, - * anything else is a failure - the plain text is not trustworthy. - */ - if (!EVP_DecryptFinal_ex(decryptionCipher.get(), plainText.get(), &cipherTextLength)) { - throw std::runtime_error("Couldn't finalize decryption. EVP_DecryptFinal_ex(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - } - - /* Finilize data to be readable with qt */ - QByteArray decryptedData = QByteArray(reinterpret_cast(plainText.get()), plainTextLength); - - return decryptedData; - - } catch (std::exception& exception) { - QSimpleCrypto::QAead::error.setError(1, exception.what()); - return QByteArray(); - } catch (...) { - QSimpleCrypto::QAead::error.setError(2, "Unknown error!"); - return QByteArray(); - } - - return QByteArray(); -} - -/// -/// \brief QSimpleCrypto::QAEAD::encryptAesCcm - Function encrypts data with Ccm algorithm. -/// \param data - Data that will be encrypted. -/// \param key - AES key. -/// \param iv - Initialization vector. -/// \param tag - Authorization tag. -/// \param aad - Additional authenticated data. Must be nullptr, if not used. -/// \param cipher - Can be used with OpenSSL EVP_CIPHER (ccm) - 128, 192, 256. Example: EVP_aes_256_ccm(). -/// \return Returns encrypted data or "", if error happened. -/// -QByteArray QSimpleCrypto::QAead::encryptAesCcm(QByteArray data, QByteArray key, QByteArray iv, QByteArray* tag, QByteArray aad, const EVP_CIPHER* cipher) -{ - try { - /* Initialize EVP_CIPHER_CTX */ - std::unique_ptr encryptionCipher { EVP_CIPHER_CTX_new(), EVP_CIPHER_CTX_free }; - if (encryptionCipher == nullptr) { - throw std::runtime_error("Couldn't initialize \'encryptionCipher\'. EVP_CIPHER_CTX_new(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - } - - /* Set data length */ - int plainTextLength = data.size(); - int cipherTextLength = 0; - - /* Initialize cipherText. Here encrypted data will be stored */ - std::unique_ptr cipherText { new unsigned char[plainTextLength]() }; - if (cipherText.get() == nullptr) { - throw std::runtime_error("Couldn't allocate memory for 'ciphertext'."); - } - - /* Initialize encryption operation. */ - if (!EVP_EncryptInit_ex(encryptionCipher.get(), cipher, nullptr, reinterpret_cast(key.data()), reinterpret_cast(iv.data()))) { - throw std::runtime_error("Couldn't initialize encryption operation. EVP_EncryptInit_ex(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - } - - /* Set IV length if default 12 bytes (96 bits) is not appropriate */ - if (!EVP_CIPHER_CTX_ctrl(encryptionCipher.get(), EVP_CTRL_CCM_SET_IVLEN, iv.length(), nullptr)) { - throw std::runtime_error("Couldn't set IV length. EVP_CIPHER_CTX_ctrl(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - } - - /* Set tag length */ - if (!EVP_CIPHER_CTX_ctrl(encryptionCipher.get(), EVP_CTRL_CCM_SET_TAG, tag->length(), nullptr)) { - throw std::runtime_error("Coldn't set tag. EVP_CIPHER_CTX_ctrl(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - } - - /* Check if aad need to be used */ - if (aad.length() > 0) { - /* Provide the total plain text length */ - if (!EVP_EncryptUpdate(encryptionCipher.get(), nullptr, &cipherTextLength, nullptr, plainTextLength)) { - throw std::runtime_error("Couldn't provide total plaintext length. EVP_EncryptUpdate(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - } - - /* Provide any AAD data. This can be called zero or more times as required */ - if (!EVP_EncryptUpdate(encryptionCipher.get(), nullptr, &cipherTextLength, reinterpret_cast(aad.data()), aad.length())) { - throw std::runtime_error("Couldn't provide aad data. EVP_EncryptUpdate(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - } - } - - /* - * Provide the message to be encrypted, and obtain the encrypted output. - * EVP_EncryptUpdate can be called multiple times if necessary - */ - if (!EVP_EncryptUpdate(encryptionCipher.get(), cipherText.get(), &cipherTextLength, reinterpret_cast(data.data()), plainTextLength)) { - throw std::runtime_error("Couldn't provide message to be encrypted. EVP_EncryptUpdate(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - } - - /* - * Finalize the encryption. Normally ciphertext bytes may be written at - * this stage, but this does not occur in GCM mode - */ - if (!EVP_EncryptFinal_ex(encryptionCipher.get(), cipherText.get(), &plainTextLength)) { - throw std::runtime_error("Couldn't finalize encryption. EVP_EncryptFinal_ex(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - } - - /* Get tag */ - if (!EVP_CIPHER_CTX_ctrl(encryptionCipher.get(), EVP_CTRL_CCM_GET_TAG, tag->length(), reinterpret_cast(tag->data()))) { - throw std::runtime_error("Couldn't get tag. EVP_CIPHER_CTX_ctrl(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - } - - /* Finilize data to be readable with qt */ - QByteArray encryptedData = QByteArray(reinterpret_cast(cipherText.get()), cipherTextLength); - - return encryptedData; - - } catch (std::exception& exception) { - QSimpleCrypto::QAead::error.setError(1, exception.what()); - return QByteArray(); - } catch (...) { - QSimpleCrypto::QAead::error.setError(2, "Unknown error!"); - return QByteArray(); - } - - return QByteArray(); -} - -/// -/// \brief QSimpleCrypto::QAEAD::decryptAesCcm - Function decrypts data with Ccm algorithm. -/// \param data - Data that will be decrypted. -/// \param key - AES key. -/// \param iv - Initialization vector. -/// \param tag - Authorization tag. -/// \param aad - Additional authenticated data. Must be nullptr, if not used. -/// \param cipher - Can be used with OpenSSL EVP_CIPHER (ccm) - 128, 192, 256. Example: EVP_aes_256_ccm(). -/// \return Returns decrypted data or "", if error happened. -/// -QByteArray QSimpleCrypto::QAead::decryptAesCcm(QByteArray data, QByteArray key, QByteArray iv, QByteArray* tag, QByteArray aad, const EVP_CIPHER* cipher) -{ - try { - /* Initialize EVP_CIPHER_CTX */ - std::unique_ptr decryptionCipher { EVP_CIPHER_CTX_new(), EVP_CIPHER_CTX_free }; - if (decryptionCipher.get() == nullptr) { - throw std::runtime_error("Couldn't initialize \'decryptionCipher\'. EVP_CIPHER_CTX_new(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - } - - /* Set data length */ - int cipherTextLength = data.size(); - int plainTextLength = 0; - - /* Initialize plainText. Here decrypted data will be stored */ - std::unique_ptr plainText { new unsigned char[cipherTextLength]() }; - if (plainText == nullptr) { - throw std::runtime_error("Couldn't allocate memory for 'plaintext'."); - } - - /* Initialize decryption operation. */ - if (!EVP_DecryptInit_ex(decryptionCipher.get(), cipher, nullptr, reinterpret_cast(key.data()), reinterpret_cast(iv.data()))) { - throw std::runtime_error("Couldn't initialize decryption operation. EVP_DecryptInit_ex(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - } - - /* Set IV length. Not necessary if this is 12 bytes (96 bits) */ - if (!EVP_CIPHER_CTX_ctrl(decryptionCipher.get(), EVP_CTRL_CCM_SET_IVLEN, iv.length(), nullptr)) { - throw std::runtime_error("Couldn't set IV length. EVP_CIPHER_CTX_ctrl(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - } - - /* Set expected tag value. Works in OpenSSL 1.0.1d and later */ - if (!EVP_CIPHER_CTX_ctrl(decryptionCipher.get(), EVP_CTRL_CCM_SET_TAG, tag->length(), reinterpret_cast(tag->data()))) { - throw std::runtime_error("Coldn't set tag. EVP_CIPHER_CTX_ctrl(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - } - - /* Check if aad need to be used */ - if (aad.length() > 0) { - /* Provide the total ciphertext length */ - if (!EVP_DecryptUpdate(decryptionCipher.get(), nullptr, &plainTextLength, nullptr, cipherTextLength)) { - throw std::runtime_error("Couldn't provide total plaintext length. EVP_DecryptUpdate(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - } - - /* Provide any AAD data. This can be called zero or more times as required */ - if (!EVP_DecryptUpdate(decryptionCipher.get(), nullptr, &plainTextLength, reinterpret_cast(aad.data()), aad.length())) { - throw std::runtime_error("Couldn't provide aad data. EVP_DecryptUpdate(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - } - } - - /* - * Provide the message to be decrypted, and obtain the plaintext output. - * EVP_DecryptUpdate can be called multiple times if necessary - */ - if (!EVP_DecryptUpdate(decryptionCipher.get(), plainText.get(), &plainTextLength, reinterpret_cast(data.data()), cipherTextLength)) { - throw std::runtime_error("Couldn't provide message to be decrypted. EVP_DecryptUpdate(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - } - - /* - * Finalize the decryption. A positive return value indicates success, - * anything else is a failure - the plaintext is not trustworthy. - */ - if (!EVP_DecryptFinal_ex(decryptionCipher.get(), plainText.get(), &cipherTextLength)) { - throw std::runtime_error("Couldn't finalize decryption. EVP_DecryptFinal_ex(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - } - - /* Finilize data to be readable with qt */ - QByteArray decryptedData = QByteArray(reinterpret_cast(plainText.get()), plainTextLength); - - return decryptedData; - - } catch (std::exception& exception) { - QSimpleCrypto::QAead::error.setError(1, exception.what()); - return QByteArray(); - } catch (...) { - QSimpleCrypto::QAead::error.setError(2, "Unknown error!"); - return QByteArray(); - } - - return QByteArray(); -} diff --git a/client/3rd/QSimpleCrypto/sources/QBlockCipher.cpp b/client/3rd/QSimpleCrypto/sources/QBlockCipher.cpp deleted file mode 100644 index 8b86ab98..00000000 --- a/client/3rd/QSimpleCrypto/sources/QBlockCipher.cpp +++ /dev/null @@ -1,193 +0,0 @@ -/** - * Copyright 2021 BrutalWizard (https://github.com/bru74lw1z4rd). All Rights Reserved. - * - * Licensed under the Apache License 2.0 (the "License"). You may not use - * this file except in compliance with the License. You can obtain a copy - * in the file LICENSE in the source distribution -**/ - -#include "include/QBlockCipher.h" - -QSimpleCrypto::QBlockCipher::QBlockCipher() -{ -} - -/// -/// \brief QSimpleCrypto::QBlockCipher::generateRandomBytes - Function generates random bytes by size. -/// \param size - Size of generated bytes. -/// \return Returns random bytes. -/// -QByteArray QSimpleCrypto::QBlockCipher::generateRandomBytes(const int& size) -{ - unsigned char arr[sizeof(size)]; - RAND_bytes(arr, sizeof(size)); - - QByteArray buffer = QByteArray(reinterpret_cast(arr), size); - return buffer; -} - -QByteArray QSimpleCrypto::QBlockCipher::generateSecureRandomBytes(const int &size) -{ - unsigned char arr[sizeof(size)]; - RAND_priv_bytes(arr, sizeof(size)); - - QByteArray buffer = QByteArray(reinterpret_cast(arr), size); - return buffer; -} - -/// -/// \brief QSimpleCrypto::QBlockCipher::encryptAesBlockCipher - Function encrypts data with Aes Block Cipher algorithm. -/// \param data - Data that will be encrypted. -/// \param key - AES key. -/// \param iv - Initialization vector. -/// \param password - Encryption password. -/// \param salt - Random delta. -/// \param rounds - Transformation rounds. -/// \param chiper - Can be used with OpenSSL EVP_CIPHER (ecb, cbc, cfb, ofb, ctr) - 128, 192, 256. Example: EVP_aes_256_cbc(). -/// \param md - Hash algroitm (OpenSSL EVP_MD). Example: EVP_sha512(). -/// \return Returns decrypted data or "", if error happened. -/// -QByteArray QSimpleCrypto::QBlockCipher::encryptAesBlockCipher(QByteArray data, QByteArray key, - QByteArray iv, - const int& rounds, const EVP_CIPHER* cipher, const EVP_MD* md) -{ - try { - /* Initialize EVP_CIPHER_CTX */ - std::unique_ptr encryptionCipher { EVP_CIPHER_CTX_new(), EVP_CIPHER_CTX_free }; - if (encryptionCipher == nullptr) { - throw std::runtime_error("Couldn't initialize \'encryptionCipher\'. EVP_CIPHER_CTX_new(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - } - - /* Reinterpret values for multi use */ - unsigned char* m_key = reinterpret_cast(key.data()); - unsigned char* m_iv = reinterpret_cast(iv.data()); - - /* Set data length */ - int cipherTextLength(data.size() + AES_BLOCK_SIZE); - int finalLength = 0; - - /* Initialize cipcherText. Here encrypted data will be stored */ - std::unique_ptr cipherText { new unsigned char[cipherTextLength]() }; - if (cipherText == nullptr) { - throw std::runtime_error("Couldn't allocate memory for 'cipherText'."); - } - - // Bug here -// /* Start encryption with password based encryption routine */ -// if (!EVP_BytesToKey(cipher, md, reinterpret_cast(salt.data()), reinterpret_cast(password.data()), password.length(), rounds, m_key, m_iv)) { -// throw std::runtime_error("Couldn't start encryption routine. EVP_BytesToKey(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); -// } - - /* Initialize encryption operation. */ - if (!EVP_EncryptInit_ex(encryptionCipher.get(), cipher, nullptr, m_key, m_iv)) { - throw std::runtime_error("Couldn't initialize encryption operation. EVP_EncryptInit_ex(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - } - - /* - * Provide the message to be encrypted, and obtain the encrypted output. - * EVP_EncryptUpdate can be called multiple times if necessary - */ - if (!EVP_EncryptUpdate(encryptionCipher.get(), cipherText.get(), &cipherTextLength, reinterpret_cast(data.data()), data.size())) { - throw std::runtime_error("Couldn't provide message to be encrypted. EVP_EncryptUpdate(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - } - - /* Finalize the encryption. Normally ciphertext bytes may be written at this stage */ - if (!EVP_EncryptFinal(encryptionCipher.get(), cipherText.get() + cipherTextLength, &finalLength)) { - throw std::runtime_error("Couldn't finalize encryption. EVP_EncryptFinal(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - } - - /* Finilize data to be readable with qt */ - QByteArray encryptedData = QByteArray(reinterpret_cast(cipherText.get()), cipherTextLength + finalLength); - - return encryptedData; - - } catch (std::exception& exception) { - QSimpleCrypto::QBlockCipher::error.setError(1, exception.what()); - return QByteArray(); - } catch (...) { - QSimpleCrypto::QBlockCipher::error.setError(2, "Unknown error!"); - return QByteArray(); - } - - return QByteArray(); -} - -/// -/// \brief QSimpleCrypto::QBlockCipher::encryptAesBlockCipher - Function decrypts data with Aes Block Cipher algorithm. -/// \param data - Data that will be decrypted. -/// \param key - AES key. -/// \param iv - Initialization vector. -/// \param password - Decryption password. -/// \param salt - Random delta. -/// \param rounds - Transformation rounds. -/// \param chiper - Can be used with OpenSSL EVP_CIPHER (ecb, cbc, cfb, ofb, ctr) - 128, 192, 256. Example: EVP_aes_256_cbc(). -/// \param md - Hash algroitm (OpenSSL EVP_MD). Example: EVP_sha512(). -/// \return Returns decrypted data or "", if error happened. -/// -QByteArray QSimpleCrypto::QBlockCipher::decryptAesBlockCipher(QByteArray data, QByteArray key, - QByteArray iv, - const int& rounds, const EVP_CIPHER* cipher, const EVP_MD* md) -{ - try { - /* Initialize EVP_CIPHER_CTX */ - std::unique_ptr decryptionCipher { EVP_CIPHER_CTX_new(), EVP_CIPHER_CTX_free }; - if (decryptionCipher == nullptr) { - throw std::runtime_error("Couldn't initialize \'decryptionCipher\'. EVP_CIPHER_CTX_new(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - } - - /* Reinterpret values for multi use */ - unsigned char* m_key = reinterpret_cast(key.data()); - unsigned char* m_iv = reinterpret_cast(iv.data()); - - /* Set data length */ - int plainTextLength(data.size()); - int finalLength = 0; - - /* Initialize plainText. Here decrypted data will be stored */ - std::unique_ptr plainText { new unsigned char[plainTextLength + AES_BLOCK_SIZE]() }; - if (plainText == nullptr) { - throw std::runtime_error("Couldn't allocate memory for \'plainText\'. EVP_CIPHER_CTX_new(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - } - - // Bug here -// /* Start encryption with password based encryption routine */ -// if (!EVP_BytesToKey(cipher, md, reinterpret_cast(salt.data()), reinterpret_cast(password.data()), password.length(), rounds, m_key, m_iv)) { -// throw std::runtime_error("Couldn't start decryption routine. EVP_BytesToKey(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); -// } - - /* Initialize decryption operation. */ - if (!EVP_DecryptInit_ex(decryptionCipher.get(), cipher, nullptr, m_key, m_iv)) { - throw std::runtime_error("Couldn't initialize decryption operation. EVP_DecryptInit_ex(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - } - - /* - * Provide the message to be decrypted, and obtain the plaintext output. - * EVP_DecryptUpdate can be called multiple times if necessary - */ - if (!EVP_DecryptUpdate(decryptionCipher.get(), plainText.get(), &plainTextLength, reinterpret_cast(data.data()), data.size())) { - throw std::runtime_error("Couldn't provide message to be decrypted. EVP_DecryptUpdate(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - } - - /* - * Finalize the decryption. A positive return value indicates success, - * anything else is a failure - the plaintext is not trustworthy. - */ - if (!EVP_DecryptFinal(decryptionCipher.get(), plainText.get() + plainTextLength, &finalLength)) { - throw std::runtime_error("Couldn't finalize decryption. EVP_DecryptFinal. Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - } - - /* Finilize data to be readable with qt */ - QByteArray decryptedData = QByteArray(reinterpret_cast(plainText.get()), plainTextLength + finalLength); - - return decryptedData; - - } catch (std::exception& exception) { - QSimpleCrypto::QBlockCipher::error.setError(1, exception.what()); - return QByteArray(exception.what()); - } catch (...) { - QSimpleCrypto::QBlockCipher::error.setError(2, "Unknown error!"); - return QByteArray(); - } - - return QByteArray(); -} diff --git a/client/3rd/QSimpleCrypto/sources/QCryptoError.cpp b/client/3rd/QSimpleCrypto/sources/QCryptoError.cpp deleted file mode 100644 index 234f55d7..00000000 --- a/client/3rd/QSimpleCrypto/sources/QCryptoError.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include "include/QCryptoError.h" - -QSimpleCrypto::QCryptoError::QCryptoError(QObject* parent) - : QObject(parent) -{ -} diff --git a/client/3rd/QSimpleCrypto/sources/QRsa.cpp b/client/3rd/QSimpleCrypto/sources/QRsa.cpp deleted file mode 100644 index 544d6746..00000000 --- a/client/3rd/QSimpleCrypto/sources/QRsa.cpp +++ /dev/null @@ -1,274 +0,0 @@ -/** - * Copyright 2021 BrutalWizard (https://github.com/bru74lw1z4rd). All Rights Reserved. - * - * Licensed under the Apache License 2.0 (the "License"). You may not use - * this file except in compliance with the License. You can obtain a copy - * in the file LICENSE in the source distribution -**/ - -#include "include/QRsa.h" - -QSimpleCrypto::QRsa::QRsa() -{ -} - -/// -/// \brief QSimpleCrypto::QRSA::generateRsaKeys - Function generate Rsa Keys and returns them in OpenSSL structure. -/// \param bits - RSA key size. -/// \param rsaBigNumber - The exponent is an odd number, typically 3, 17 or 65537. -/// \return Returns 'OpenSSL RSA structure' or 'nullptr', if error happened. Returned value must be cleaned up with 'RSA_free()' to avoid memory leak. -/// -RSA* QSimpleCrypto::QRsa::generateRsaKeys(const int& bits, const int& rsaBigNumber) -{ - try { - /* Initialize big number */ - std::unique_ptr bigNumber { BN_new(), BN_free }; - if (bigNumber == nullptr) { - throw std::runtime_error("Couldn't initialize \'bigNumber\'. BN_new(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - return nullptr; - } - - /* Set big number */ - if (!BN_set_word(bigNumber.get(), rsaBigNumber)) { - throw std::runtime_error("Couldn't set bigNumber. BN_set_word(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - } - - /* Initialize RSA */ - RSA* rsa = nullptr; - if (!(rsa = RSA_new())) { - throw std::runtime_error("Couldn't initialize x509. X509_new(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - } - - /* Generate key pair and store it in RSA */ - if (!RSA_generate_key_ex(rsa, bits, bigNumber.get(), nullptr)) { - throw std::runtime_error("Couldn't generate RSA. RSA_generate_key_ex(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - } - - return rsa; - } catch (std::exception& exception) { - QSimpleCrypto::QRsa::error.setError(1, exception.what()); - return nullptr; - } catch (...) { - QSimpleCrypto::QRsa::error.setError(2, "Unknown error!"); - return nullptr; - } -} - -/// -/// \brief QSimpleCrypto::QRSA::savePublicKey - Saves to file RSA public key. -/// \param rsa - OpenSSL RSA structure. -/// \param publicKeyFileName - Public key file name. -/// -void QSimpleCrypto::QRsa::savePublicKey(RSA* rsa, const QByteArray& publicKeyFileName) -{ - try { - /* Initialize BIO */ - std::unique_ptr bioPublicKey { BIO_new_file(publicKeyFileName.data(), "w+"), BIO_free_all }; - if (bioPublicKey == nullptr) { - throw std::runtime_error("Couldn't initialize \'bioPublicKey\'. BIO_new_file(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - } - - /* Write public key on file */ - if (!PEM_write_bio_RSA_PUBKEY(bioPublicKey.get(), rsa)) { - throw std::runtime_error("Couldn't save public key. PEM_write_bio_RSAPublicKey(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - } - } catch (std::exception& exception) { - QSimpleCrypto::QRsa::error.setError(1, exception.what()); - return; - } catch (...) { - QSimpleCrypto::QRsa::error.setError(2, "Unknown error!"); - return; - } -} - -/// -/// \brief QSimpleCrypto::QRSA::savePrivateKey - Saves to file RSA private key. -/// \param rsa - OpenSSL RSA structure. -/// \param privateKeyFileName - Private key file name. -/// \param password - Private key password. -/// \param cipher - Can be used with 'OpenSSL EVP_CIPHER' (ecb, cbc, cfb, ofb, ctr) - 128, 192, 256. Example: EVP_aes_256_cbc(). -/// -void QSimpleCrypto::QRsa::savePrivateKey(RSA* rsa, const QByteArray& privateKeyFileName, QByteArray password, const EVP_CIPHER* cipher) -{ - try { - /* Initialize BIO */ - std::unique_ptr bioPrivateKey { BIO_new_file(privateKeyFileName.data(), "w+"), BIO_free_all }; - if (bioPrivateKey == nullptr) { - throw std::runtime_error("Couldn't initialize bioPrivateKey. BIO_new_file(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - } - - /* Write private key to file */ - if (!PEM_write_bio_RSAPrivateKey(bioPrivateKey.get(), rsa, cipher, reinterpret_cast(password.data()), password.size(), nullptr, nullptr)) { - throw std::runtime_error("Couldn't save private key. PEM_write_bio_RSAPrivateKey(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - } - } catch (std::exception& exception) { - QSimpleCrypto::QRsa::error.setError(1, exception.what()); - return; - } catch (...) { - QSimpleCrypto::QRsa::error.setError(2, "Unknown error!"); - return; - } -} - -/// -/// \brief QSimpleCrypto::QRSA::getPublicKeyFromFile - Gets RSA public key from a file. -/// \param filePath - File path to public key file. -/// \return Returns 'OpenSSL EVP_PKEY structure' or 'nullptr', if error happened. Returned value must be cleaned up with 'EVP_PKEY_free()' to avoid memory leak. -/// -EVP_PKEY* QSimpleCrypto::QRsa::getPublicKeyFromFile(const QByteArray& filePath) -{ - try { - /* Initialize BIO */ - std::unique_ptr bioPublicKey { BIO_new_file(filePath.data(), "r"), BIO_free_all }; - if (bioPublicKey == nullptr) { - throw std::runtime_error("Couldn't initialize bioPublicKey. BIO_new_file(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - } - - /* Initialize EVP_PKEY */ - EVP_PKEY* keyStore = nullptr; - if (!(keyStore = EVP_PKEY_new())) { - throw std::runtime_error("Couldn't initialize keyStore. EVP_PKEY_new(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - } - - /* Write private key to file */ - if (!PEM_read_bio_PUBKEY(bioPublicKey.get(), &keyStore, nullptr, nullptr)) { - throw std::runtime_error("Couldn't read private key. PEM_read_bio_PrivateKey(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - } - - return keyStore; - - } catch (std::exception& exception) { - QSimpleCrypto::QRsa::error.setError(1, exception.what()); - return nullptr; - } catch (...) { - QSimpleCrypto::QRsa::error.setError(2, "Unknown error!"); - return nullptr; - } -} - -/// -/// \brief QSimpleCrypto::QRSA::getPrivateKeyFromFile - Gets RSA private key from a file. -/// \param filePath - File path to private key file. -/// \param password - Private key password. -/// \return - Returns 'OpenSSL EVP_PKEY structure' or 'nullptr', if error happened. Returned value must be cleaned up with 'EVP_PKEY_free()' to avoid memory leak. -/// -EVP_PKEY* QSimpleCrypto::QRsa::getPrivateKeyFromFile(const QByteArray& filePath, const QByteArray& password) -{ - try { - /* Initialize BIO */ - std::unique_ptr bioPrivateKey { BIO_new_file(filePath.data(), "r"), BIO_free_all }; - if (bioPrivateKey == nullptr) { - throw std::runtime_error("Couldn't initialize bioPrivateKey. BIO_new_file(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - } - - /* Initialize EVP_PKEY */ - EVP_PKEY* keyStore = nullptr; - if (!(keyStore = EVP_PKEY_new())) { - throw std::runtime_error("Couldn't initialize keyStore. EVP_PKEY_new(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - } - - /* Write private key to file */ - if (!PEM_read_bio_PrivateKey(bioPrivateKey.get(), &keyStore, nullptr, (void*)password.data())) { - throw std::runtime_error("Couldn't read private key. PEM_read_bio_PrivateKey(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - } - - return keyStore; - - } catch (std::exception& exception) { - QSimpleCrypto::QRsa::error.setError(1, exception.what()); - return nullptr; - } catch (...) { - QSimpleCrypto::QRsa::error.setError(2, "Unknown error!"); - return nullptr; - } -} - -/// -/// \brief QSimpleCrypto::QRSA::encrypt - Encrypt data with RSA algorithm. -/// \param plaintext - Text that must be encrypted. -/// \param rsa - OpenSSL RSA structure. -/// \param encryptType - Public or private encrypt type. (PUBLIC_ENCRYPT, PRIVATE_ENCRYPT). -/// \param padding - OpenSSL RSA padding can be used with: 'RSA_PKCS1_PADDING', 'RSA_NO_PADDING' and etc. -/// \return Returns encrypted data or "", if error happened. -/// -QByteArray QSimpleCrypto::QRsa::encrypt(QByteArray plainText, RSA* rsa, const int& encryptType, const int& padding) -{ - try { - /* Initialize array. Here encrypted data will be saved */ - std::unique_ptr cipherText { new unsigned char[RSA_size(rsa)]() }; - if (cipherText == nullptr) { - throw std::runtime_error("Couldn't allocate memory for 'cipherText'."); - } - - /* Result of encryption operation */ - short int result = 0; - - /* Execute encryption operation */ - if (encryptType == PublicDecrypt) { - result = RSA_public_encrypt(plainText.size(), reinterpret_cast(plainText.data()), cipherText.get(), rsa, padding); - } else if (encryptType == PrivateDecrypt) { - result = RSA_private_encrypt(plainText.size(), reinterpret_cast(plainText.data()), cipherText.get(), rsa, padding); - } - - /* Check for result */ - if (result <= -1) { - throw std::runtime_error("Couldn't encrypt data. Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - } - - /* Get encrypted data */ - const QByteArray& encryptedData = QByteArray(reinterpret_cast(cipherText.get()), RSA_size(rsa)); - - return encryptedData; - } catch (std::exception& exception) { - QSimpleCrypto::QRsa::error.setError(1, exception.what()); - return ""; - } catch (...) { - QSimpleCrypto::QRsa::error.setError(2, "Unknown error!"); - return ""; - } -} - -/// -/// \brief QSimpleCrypto::QRSA::decrypt - Decrypt data with RSA algorithm. -/// \param cipherText - Text that must be decrypted. -/// \param rsa - OpenSSL RSA structure. -/// \param decryptType - Public or private type. (PUBLIC_DECRYPT, PRIVATE_DECRYPT). -/// \param padding - RSA padding can be used with: 'RSA_PKCS1_PADDING', 'RSA_NO_PADDING' and etc. -/// \return - Returns decrypted data or "", if error happened. -/// -QByteArray QSimpleCrypto::QRsa::decrypt(QByteArray cipherText, RSA* rsa, const int& decryptType, const int& padding) -{ - try { - /* Initialize array. Here decrypted data will be saved */ - std::unique_ptr plainText { new unsigned char[cipherText.size()]() }; - if (plainText == nullptr) { - throw std::runtime_error("Couldn't allocate memory for 'plainText'."); - } - - /* Result of decryption operation */ - short int result = 0; - - /* Execute decryption operation */ - if (decryptType == PublicDecrypt) { - result = RSA_public_decrypt(RSA_size(rsa), reinterpret_cast(cipherText.data()), plainText.get(), rsa, padding); - } else if (decryptType == PrivateDecrypt) { - result = RSA_private_decrypt(RSA_size(rsa), reinterpret_cast(cipherText.data()), plainText.get(), rsa, padding); - } - - /* Check for result */ - if (result <= -1) { - throw std::runtime_error("Couldn't decrypt data. Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - } - - /* Get decrypted data */ - const QByteArray& decryptedData = QByteArray(reinterpret_cast(plainText.get())); - - return decryptedData; - } catch (std::exception& exception) { - QSimpleCrypto::QRsa::error.setError(1, exception.what()); - return ""; - } catch (...) { - QSimpleCrypto::QRsa::error.setError(2, "Unknown error!"); - return ""; - } -} diff --git a/client/3rd/QSimpleCrypto/sources/QX509.cpp b/client/3rd/QSimpleCrypto/sources/QX509.cpp deleted file mode 100644 index ac4fd270..00000000 --- a/client/3rd/QSimpleCrypto/sources/QX509.cpp +++ /dev/null @@ -1,234 +0,0 @@ -/** - * Copyright 2021 BrutalWizard (https://github.com/bru74lw1z4rd). All Rights Reserved. - * - * Licensed under the Apache License 2.0 (the "License"). You may not use - * this file except in compliance with the License. You can obtain a copy - * in the file LICENSE in the source distribution -**/ - -#include "include/QX509.h" - -QSimpleCrypto::QX509::QX509() -{ -} - -/// -/// \brief QSimpleCrypto::QX509::loadCertificateFromFile - Function load X509 from file and returns OpenSSL structure. -/// \param fileName - File path to certificate. -/// \return Returns OpenSSL X509 structure or nullptr, if error happened. Returned value must be cleaned up with 'X509_free' to avoid memory leak. -/// -X509* QSimpleCrypto::QX509::loadCertificateFromFile(const QByteArray& fileName) -{ - try { - /* Initialize X509 */ - X509* x509 = nullptr; - if (!(x509 = X509_new())) { - throw std::runtime_error("Couldn't initialize X509. X509_new(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - } - - /* Initialize BIO */ - std::unique_ptr certFile { BIO_new_file(fileName.data(), "r+"), BIO_free_all }; - if (certFile == nullptr) { - throw std::runtime_error("Couldn't initialize certFile. BIO_new_file(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - } - - /* Read file */ - if (!PEM_read_bio_X509(certFile.get(), &x509, nullptr, nullptr)) { - throw std::runtime_error("Couldn't read certificate file from disk. PEM_read_bio_X509(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - } - - return x509; - } catch (std::exception& exception) { - QSimpleCrypto::QX509::error.setError(1, exception.what()); - return nullptr; - } catch (...) { - QSimpleCrypto::QX509::error.setError(2, "Unknown error!"); - return nullptr; - } -} - -/// -/// \brief QSimpleCrypto::QX509::signCertificate - Function signs X509 certificate and returns signed X509 OpenSSL structure. -/// \param endCertificate - Certificate that will be signed -/// \param caCertificate - CA certificate that will sign end certificate -/// \param caPrivateKey - CA certificate private key -/// \param fileName - With that name certificate will be saved. Leave "", if don't need to save it -/// \return Returns OpenSSL X509 structure or nullptr, if error happened. -/// -X509* QSimpleCrypto::QX509::signCertificate(X509* endCertificate, X509* caCertificate, EVP_PKEY* caPrivateKey, const QByteArray& fileName) -{ - try { - /* Set issuer to CA's subject. */ - if (!X509_set_issuer_name(endCertificate, X509_get_subject_name(caCertificate))) { - throw std::runtime_error("Couldn't set issuer name for X509. X509_set_issuer_name(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - } - - /* Sign the certificate with key. */ - if (!X509_sign(endCertificate, caPrivateKey, EVP_sha256())) { - throw std::runtime_error("Couldn't sign X509. X509_sign(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - } - - /* Write certificate file on disk. If needed */ - if (!fileName.isEmpty()) { - /* Initialize BIO */ - std::unique_ptr certFile { BIO_new_file(fileName.data(), "w+"), BIO_free_all }; - if (certFile == nullptr) { - throw std::runtime_error("Couldn't initialize certFile. BIO_new_file(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - } - - /* Write file on disk */ - if (!PEM_write_bio_X509(certFile.get(), endCertificate)) { - throw std::runtime_error("Couldn't write certificate file on disk. PEM_write_bio_X509(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - } - } - - return endCertificate; - } catch (std::exception& exception) { - QSimpleCrypto::QX509::error.setError(1, exception.what()); - return nullptr; - } catch (...) { - QSimpleCrypto::QX509::error.setError(2, "Unknown error!"); - return nullptr; - } -} - -/// -/// \brief QSimpleCrypto::QX509::verifyCertificate - Function verifies X509 certificate and returns verified X509 OpenSSL structure. -/// \param x509 - OpenSSL X509. That certificate will be verified. -/// \param store - Trusted certificate must be added to X509_Store with 'addCertificateToStore(X509_STORE* ctx, X509* x509)'. -/// \return Returns OpenSSL X509 structure or nullptr, if error happened -/// -X509* QSimpleCrypto::QX509::verifyCertificate(X509* x509, X509_STORE* store) -{ - try { - /* Initialize X509_STORE_CTX */ - std::unique_ptr ctx { X509_STORE_CTX_new(), X509_STORE_CTX_free }; - if (ctx == nullptr) { - throw std::runtime_error("Couldn't initialize keyStore. EVP_PKEY_new(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - } - - /* Set up CTX for a subsequent verification operation */ - if (!X509_STORE_CTX_init(ctx.get(), store, x509, nullptr)) { - throw std::runtime_error("Couldn't initialize X509_STORE_CTX. X509_STORE_CTX_init(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - } - - /* Verify X509 */ - if (!X509_verify_cert(ctx.get())) { - throw std::runtime_error("Couldn't verify cert. X509_verify_cert(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - } - - return x509; - } catch (std::exception& exception) { - QSimpleCrypto::QX509::error.setError(1, exception.what()); - return nullptr; - } catch (...) { - QSimpleCrypto::QX509::error.setError(2, "Unknown error!"); - return nullptr; - } -} - -/// -/// \brief QSimpleCrypto::QX509::generateSelfSignedCertificate - Function generatesand returns self signed X509. -/// \param rsa - OpenSSL RSA. -/// \param additionalData - Certificate information. -/// \param certificateFileName - With that name certificate will be saved. Leave "", if don't need to save it. -/// \param md - OpenSSL EVP_MD structure. Example: EVP_sha512(). -/// \param serialNumber - X509 certificate serial number. -/// \param version - X509 certificate version. -/// \param notBefore - X509 start date. -/// \param notAfter - X509 end date. -/// \return Returns OpenSSL X509 structure or nullptr, if error happened. Returned value must be cleaned up with 'X509_free' to avoid memory leak. -/// -X509* QSimpleCrypto::QX509::generateSelfSignedCertificate(RSA* rsa, const QMap& additionalData, - const QByteArray& certificateFileName, const EVP_MD* md, - const long& serialNumber, const long& version, - const long& notBefore, const long& notAfter) -{ - try { - /* Initialize X509 */ - X509* x509 = nullptr; - if (!(x509 = X509_new())) { - throw std::runtime_error("Couldn't initialize X509. X509_new(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - } - - /* Initialize EVP_PKEY */ - std::unique_ptr keyStore { EVP_PKEY_new(), EVP_PKEY_free }; - if (keyStore == nullptr) { - throw std::runtime_error("Couldn't initialize keyStore. EVP_PKEY_new(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - } - - /* Sign rsa key */ - if (!EVP_PKEY_assign_RSA(keyStore.get(), rsa)) { - throw std::runtime_error("Couldn't assign rsa. EVP_PKEY_assign_RSA(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - } - - /* Set certificate serial number. */ - if (!ASN1_INTEGER_set(X509_get_serialNumber(x509), serialNumber)) { - throw std::runtime_error("Couldn't set serial number. ASN1_INTEGER_set(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - } - - /* Set certificate version */ - if (!X509_set_version(x509, version)) { - throw std::runtime_error("Couldn't set version. X509_set_version(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - } - - /* Set certificate creation and expiration date */ - X509_gmtime_adj(X509_get_notBefore(x509), notBefore); - X509_gmtime_adj(X509_get_notAfter(x509), notAfter); - - /* Set certificate public key */ - if (!X509_set_pubkey(x509, keyStore.get())) { - throw std::runtime_error("Couldn't set public key. X509_set_pubkey(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - } - - /* Initialize X509_NAME */ - X509_NAME* x509Name = X509_get_subject_name(x509); - if (x509Name == nullptr) { - throw std::runtime_error("Couldn't initialize X509_NAME. X509_NAME(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - } - - /* Add additional data to certificate */ - QMapIterator certificateInformationList(additionalData); - while (certificateInformationList.hasNext()) { - /* Read next item in list */ - certificateInformationList.next(); - - /* Set additional data */ - if (!X509_NAME_add_entry_by_txt(x509Name, certificateInformationList.key().data(), MBSTRING_UTF8, reinterpret_cast(certificateInformationList.value().data()), -1, -1, 0)) { - throw std::runtime_error("Couldn't set additional information. X509_NAME_add_entry_by_txt(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - } - } - - /* Set certificate info */ - if (!X509_set_issuer_name(x509, x509Name)) { - throw std::runtime_error("Couldn't set issuer name. X509_set_issuer_name(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - } - - /* Sign certificate */ - if (!X509_sign(x509, keyStore.get(), md)) { - throw std::runtime_error("Couldn't sign X509. X509_sign(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - } - - /* Write certificate file on disk. If needed */ - if (!certificateFileName.isEmpty()) { - /* Initialize BIO */ - std::unique_ptr certFile { BIO_new_file(certificateFileName.data(), "w+"), BIO_free_all }; - if (certFile == nullptr) { - throw std::runtime_error("Couldn't initialize certFile. BIO_new_file(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - } - - /* Write file on disk */ - if (!PEM_write_bio_X509(certFile.get(), x509)) { - throw std::runtime_error("Couldn't write certificate file on disk. PEM_write_bio_X509(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - } - } - - return x509; - } catch (std::exception& exception) { - QSimpleCrypto::QX509::error.setError(1, exception.what()); - return nullptr; - } catch (...) { - QSimpleCrypto::QX509::error.setError(2, "Unknown error!"); - return nullptr; - } -} diff --git a/client/3rd/QSimpleCrypto/sources/QX509Store.cpp b/client/3rd/QSimpleCrypto/sources/QX509Store.cpp deleted file mode 100644 index bbbec1a8..00000000 --- a/client/3rd/QSimpleCrypto/sources/QX509Store.cpp +++ /dev/null @@ -1,176 +0,0 @@ -/** - * Copyright 2021 BrutalWizard (https://github.com/bru74lw1z4rd). All Rights Reserved. - * - * Licensed under the Apache License 2.0 (the "License"). You may not use - * this file except in compliance with the License. You can obtain a copy - * in the file LICENSE in the source distribution -**/ - -#include "include/QX509Store.h" - -QSimpleCrypto::QX509Store::QX509Store() -{ -} - -/// -/// \brief QSimpleCrypto::QX509::addCertificateToStore -/// \param store - OpenSSL X509_STORE. -/// \param x509 - OpenSSL X509. -/// \return Returns 'true' on success and 'false', if error happened. -/// -bool QSimpleCrypto::QX509Store::addCertificateToStore(X509_STORE* store, X509* x509) -{ - if (!X509_STORE_add_cert(store, x509)) { - QSimpleCrypto::QX509Store::error.setError(1, "Couldn't add certificate to X509_STORE. X509_STORE_add_cert(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - return false; - } - - return true; -} - -/// -/// \brief QSimpleCrypto::QX509Store::addLookup -/// \param store - OpenSSL X509_STORE. -/// \param method - OpenSSL X509_LOOKUP_METHOD. Example: X509_LOOKUP_file. -/// \return Returns 'true' on success and 'false', if error happened. -/// -bool QSimpleCrypto::QX509Store::addLookup(X509_STORE* store, X509_LOOKUP_METHOD* method) -{ - if (!X509_STORE_add_lookup(store, method)) { - QSimpleCrypto::QX509Store::error.setError(1, "Couldn't add lookup to X509_STORE. X509_STORE_add_lookup(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - return false; - } - - return true; -} - -/// -/// \brief QSimpleCrypto::QX509Store::setCertificateDepth -/// \param store - OpenSSL X509_STORE. -/// \param depth - That is the maximum number of untrusted CA certificates that can appear in a chain. Example: 0. -/// \return Returns 'true' on success and 'false', if error happened. -/// -bool QSimpleCrypto::QX509Store::setDepth(X509_STORE* store, const int& depth) -{ - if (!X509_STORE_set_depth(store, depth)) { - QSimpleCrypto::QX509Store::error.setError(1, "Couldn't set depth for X509_STORE. X509_STORE_set_depth(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - return false; - } - - return true; -} - -/// -/// \brief QSimpleCrypto::QX509Store::setFlag -/// \param store - OpenSSL X509_STORE. -/// \param flag - The verification flags consists of zero or more of the following flags ored together. Example: X509_V_FLAG_CRL_CHECK. -/// \return Returns 'true' on success and 'false', if error happened. -/// -bool QSimpleCrypto::QX509Store::setFlag(X509_STORE* store, const unsigned long& flag) -{ - if (!X509_STORE_set_flags(store, flag)) { - QSimpleCrypto::QX509Store::error.setError(1, "Couldn't set flag for X509_STORE. X509_STORE_set_flags(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - return false; - } - - return true; -} - -/// -/// \brief QSimpleCrypto::QX509Store::setFlag -/// \param store - OpenSSL X509_STORE. -/// \param purpose - Verification purpose in param to purpose. Example: X509_PURPOSE_ANY. -/// \return Returns 'true' on success and 'false', if error happened. -/// -bool QSimpleCrypto::QX509Store::setPurpose(X509_STORE* store, const int& purpose) -{ - if (!X509_STORE_set_purpose(store, purpose)) { - QSimpleCrypto::QX509Store::error.setError(1, "Couldn't set purpose for X509_STORE. X509_STORE_set_purpose(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - return false; - } - - return true; -} - -/// -/// \brief QSimpleCrypto::QX509Store::setTrust -/// \param store - OpenSSL X509_STORE. -/// \param trust - Trust Level. Example: X509_TRUST_SSL_SERVER. -/// \return Returns 'true' on success and 'false', if error happened. -/// -bool QSimpleCrypto::QX509Store::setTrust(X509_STORE* store, const int& trust) -{ - if (!X509_STORE_set_trust(store, trust)) { - QSimpleCrypto::QX509Store::error.setError(1, "Couldn't set trust for X509_STORE. X509_STORE_set_trust(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - return false; - } - - return true; -} - -/// -/// \brief QSimpleCrypto::QX509Store::setDefaultPaths -/// \param store - OpenSSL X509_STORE. -/// \return Returns 'true' on success and 'false', if error happened. -/// -bool QSimpleCrypto::QX509Store::setDefaultPaths(X509_STORE* store) -{ - if (!X509_STORE_set_default_paths(store)) { - QSimpleCrypto::QX509Store::error.setError(1, "Couldn't set default paths for X509_STORE. X509_STORE_set_default_paths(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - return false; - } - - return true; -} - -/// -/// \brief QSimpleCrypto::QX509Store::loadLocations -/// \param store - OpenSSL X509_STORE. -/// \param fileName - File name. Example: "caCertificate.pem". -/// \param dirPath - Path to file. Example: "path/To/File". -/// \return Returns 'true' on success and 'false', if error happened. -/// -bool QSimpleCrypto::QX509Store::loadLocations(X509_STORE* store, const QByteArray& fileName, const QByteArray& dirPath) -{ - if (!X509_STORE_load_locations(store, fileName, dirPath)) { - QSimpleCrypto::QX509Store::error.setError(1, "Couldn't load locations for X509_STORE. X509_STORE_load_locations(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - return false; - } - - return true; -} - -/// -/// \brief QSimpleCrypto::QX509Store::loadLocations -/// \param store - OpenSSL X509_STORE. -/// \param file - Qt QFile that will be loaded. -/// \return Returns 'true' on success and 'false', if error happened. -/// -bool QSimpleCrypto::QX509Store::loadLocations(X509_STORE* store, const QFile& file) -{ - /* Initialize QFileInfo to read information about file */ - QFileInfo info(file); - - if (!X509_STORE_load_locations(store, info.fileName().toLocal8Bit(), info.absoluteDir().path().toLocal8Bit())) { - QSimpleCrypto::QX509Store::error.setError(1, "Couldn't load locations for X509_STORE. X509_STORE_load_locations(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - return false; - } - - return true; -} - -/// -/// \brief QSimpleCrypto::QX509Store::loadLocations -/// \param store - OpenSSL X509_STORE. -/// \param fileInfo - Qt QFileInfo. -/// \return Returns 'true' on success and 'false', if error happened. -/// -bool QSimpleCrypto::QX509Store::loadLocations(X509_STORE* store, const QFileInfo& fileInfo) -{ - if (!X509_STORE_load_locations(store, fileInfo.fileName().toLocal8Bit(), fileInfo.absoluteDir().path().toLocal8Bit())) { - QSimpleCrypto::QX509Store::error.setError(1, "Couldn't load locations for X509_STORE. X509_STORE_load_locations(). Error: " + QByteArray(ERR_error_string(ERR_get_error(), nullptr))); - return false; - } - - return true; -} diff --git a/client/3rd/SingleApplication/singleapplication.cmake b/client/3rd/SingleApplication/singleapplication.cmake deleted file mode 100644 index 78abfa8a..00000000 --- a/client/3rd/SingleApplication/singleapplication.cmake +++ /dev/null @@ -1,25 +0,0 @@ -include_directories(${CMAKE_CURRENT_LIST_DIR}) - -find_package(Qt6 REQUIRED COMPONENTS - Core Network -) -set(LIBS ${LIBS} Qt6::Core Qt6::Network) - - -set(HEADERS ${HEADERS} - ${CMAKE_CURRENT_LIST_DIR}/singleapplication.h - ${CMAKE_CURRENT_LIST_DIR}/singleapplication_p.h -) - -set(SOURCES ${SOURCES} - ${CMAKE_CURRENT_LIST_DIR}/singleapplication.cpp - ${CMAKE_CURRENT_LIST_DIR}/singleapplication_p.cpp -) - -if(WIN32) - if(MSVC) - set(LIBS ${LIBS} Advapi32.lib) - elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") - set(LIBS ${LIBS} advapi32) - endif() -endif() diff --git a/client/3rd/SingleApplication/singleapplication.cpp b/client/3rd/SingleApplication/singleapplication.cpp deleted file mode 100644 index 7e153a00..00000000 --- a/client/3rd/SingleApplication/singleapplication.cpp +++ /dev/null @@ -1,274 +0,0 @@ -// The MIT License (MIT) -// -// Copyright (c) Itay Grudev 2015 - 2020 -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#include -#include -#include - -#include "singleapplication.h" -#include "singleapplication_p.h" - -/** - * @brief Constructor. Checks and fires up LocalServer or closes the program - * if another instance already exists - * @param argc - * @param argv - * @param allowSecondary Whether to enable secondary instance support - * @param options Optional flags to toggle specific behaviour - * @param timeout Maximum time blocking functions are allowed during app load - */ -SingleApplication::SingleApplication( int &argc, char *argv[], bool allowSecondary, Options options, int timeout, const QString &userData ) - : app_t( argc, argv ), d_ptr( new SingleApplicationPrivate( this ) ) -{ - Q_D( SingleApplication ); - -#if defined(Q_OS_ANDROID) || defined(Q_OS_IOS) - // On Android and iOS since the library is not supported fallback to - // standard QApplication behaviour by simply returning at this point. - qWarning() << "SingleApplication is not supported on Android and iOS systems."; - return; -#endif - - // Store the current mode of the program - d->options = options; - - // Add any unique user data - if ( ! userData.isEmpty() ) - d->addAppData( userData ); - - // Generating an application ID used for identifying the shared memory - // block and QLocalServer - d->genBlockServerName(); - - // To mitigate QSharedMemory issues with large amount of processes - // attempting to attach at the same time - SingleApplicationPrivate::randomSleep(); - -#ifdef Q_OS_UNIX - // By explicitly attaching it and then deleting it we make sure that the - // memory is deleted even after the process has crashed on Unix. - d->memory = new QSharedMemory( d->blockServerName ); - d->memory->attach(); - delete d->memory; -#endif - // Guarantee thread safe behaviour with a shared memory block. - d->memory = new QSharedMemory( d->blockServerName ); - - // Create a shared memory block - if( d->memory->create( sizeof( InstancesInfo ) )){ - // Initialize the shared memory block - if( ! d->memory->lock() ){ - qCritical() << "SingleApplication: Unable to lock memory block after create."; - abortSafely(); - } - d->initializeMemoryBlock(); - } else { - if( d->memory->error() == QSharedMemory::AlreadyExists ){ - // Attempt to attach to the memory segment - if( ! d->memory->attach() ){ - qCritical() << "SingleApplication: Unable to attach to shared memory block."; - abortSafely(); - } - if( ! d->memory->lock() ){ - qCritical() << "SingleApplication: Unable to lock memory block after attach."; - abortSafely(); - } - } else { - qCritical() << "SingleApplication: Unable to create block."; - abortSafely(); - } - } - - auto *inst = static_cast( d->memory->data() ); - QElapsedTimer time; - time.start(); - - // Make sure the shared memory block is initialised and in consistent state - while( true ){ - // If the shared memory block's checksum is valid continue - if( d->blockChecksum() == inst->checksum ) break; - - // If more than 5s have elapsed, assume the primary instance crashed and - // assume it's position - if( time.elapsed() > 5000 ){ - qWarning() << "SingleApplication: Shared memory block has been in an inconsistent state from more than 5s. Assuming primary instance failure."; - d->initializeMemoryBlock(); - } - - // Otherwise wait for a random period and try again. The random sleep here - // limits the probability of a collision between two racing apps and - // allows the app to initialise faster - if( ! d->memory->unlock() ){ - qDebug() << "SingleApplication: Unable to unlock memory for random wait."; - qDebug() << d->memory->errorString(); - } - SingleApplicationPrivate::randomSleep(); - if( ! d->memory->lock() ){ - qCritical() << "SingleApplication: Unable to lock memory after random wait."; - abortSafely(); - } - } - - if( inst->primary == false ){ - d->startPrimary(); - if( ! d->memory->unlock() ){ - qDebug() << "SingleApplication: Unable to unlock memory after primary start."; - qDebug() << d->memory->errorString(); - } - return; - } - - // Check if another instance can be started - if( allowSecondary ){ - d->startSecondary(); - if( d->options & Mode::SecondaryNotification ){ - d->connectToPrimary( timeout, SingleApplicationPrivate::SecondaryInstance ); - } - if( ! d->memory->unlock() ){ - qDebug() << "SingleApplication: Unable to unlock memory after secondary start."; - qDebug() << d->memory->errorString(); - } - return; - } - - if( ! d->memory->unlock() ){ - qDebug() << "SingleApplication: Unable to unlock memory at end of execution."; - qDebug() << d->memory->errorString(); - } - - d->connectToPrimary( timeout, SingleApplicationPrivate::NewInstance ); - - delete d; - - ::exit( EXIT_SUCCESS ); -} - -SingleApplication::~SingleApplication() -{ - Q_D( SingleApplication ); - delete d; -} - -/** - * Checks if the current application instance is primary. - * @return Returns true if the instance is primary, false otherwise. - */ -bool SingleApplication::isPrimary() const -{ - Q_D( const SingleApplication ); - return d->server != nullptr; -} - -/** - * Checks if the current application instance is secondary. - * @return Returns true if the instance is secondary, false otherwise. - */ -bool SingleApplication::isSecondary() const -{ - Q_D( const SingleApplication ); - return d->server == nullptr; -} - -/** - * Allows you to identify an instance by returning unique consecutive instance - * ids. It is reset when the first (primary) instance of your app starts and - * only incremented afterwards. - * @return Returns a unique instance id. - */ -quint32 SingleApplication::instanceId() const -{ - Q_D( const SingleApplication ); - return d->instanceNumber; -} - -/** - * Returns the OS PID (Process Identifier) of the process running the primary - * instance. Especially useful when SingleApplication is coupled with OS. - * specific APIs. - * @return Returns the primary instance PID. - */ -qint64 SingleApplication::primaryPid() const -{ - Q_D( const SingleApplication ); - return d->primaryPid(); -} - -/** - * Returns the username the primary instance is running as. - * @return Returns the username the primary instance is running as. - */ -QString SingleApplication::primaryUser() const -{ - Q_D( const SingleApplication ); - return d->primaryUser(); -} - -/** - * Returns the username the current instance is running as. - * @return Returns the username the current instance is running as. - */ -QString SingleApplication::currentUser() const -{ - return SingleApplicationPrivate::getUsername(); -} - -/** - * Sends message to the Primary Instance. - * @param message The message to send. - * @param timeout the maximum timeout in milliseconds for blocking functions. - * @return true if the message was sent successfuly, false otherwise. - */ -bool SingleApplication::sendMessage( const QByteArray &message, int timeout ) -{ - Q_D( SingleApplication ); - - // Nobody to connect to - if( isPrimary() ) return false; - - // Make sure the socket is connected - if( ! d->connectToPrimary( timeout, SingleApplicationPrivate::Reconnect ) ) - return false; - - d->socket->write( message ); - bool dataWritten = d->socket->waitForBytesWritten( timeout ); - d->socket->flush(); - return dataWritten; -} - -/** - * Cleans up the shared memory block and exits with a failure. - * This function halts program execution. - */ -void SingleApplication::abortSafely() -{ - Q_D( SingleApplication ); - - qCritical() << "SingleApplication: " << d->memory->error() << d->memory->errorString(); - delete d; - ::exit( EXIT_FAILURE ); -} - -QStringList SingleApplication::userData() const -{ - Q_D( const SingleApplication ); - return d->appData(); -} diff --git a/client/3rd/SingleApplication/singleapplication.h b/client/3rd/SingleApplication/singleapplication.h deleted file mode 100644 index 400c88ac..00000000 --- a/client/3rd/SingleApplication/singleapplication.h +++ /dev/null @@ -1,154 +0,0 @@ -// The MIT License (MIT) -// -// Copyright (c) Itay Grudev 2015 - 2018 -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#ifndef SINGLE_APPLICATION_H -#define SINGLE_APPLICATION_H - -#include -#include - -#ifndef QAPPLICATION_CLASS - #define QAPPLICATION_CLASS QApplication -#endif - -#include QT_STRINGIFY(QAPPLICATION_CLASS) - -class SingleApplicationPrivate; - -/** - * @brief The SingleApplication class handles multiple instances of the same - * Application - * @see QCoreApplication - */ -class SingleApplication : public QAPPLICATION_CLASS -{ - Q_OBJECT - - using app_t = QAPPLICATION_CLASS; - -public: - /** - * @brief Mode of operation of SingleApplication. - * Whether the block should be user-wide or system-wide and whether the - * primary instance should be notified when a secondary instance had been - * started. - * @note Operating system can restrict the shared memory blocks to the same - * user, in which case the User/System modes will have no effect and the - * block will be user wide. - * @enum - */ - enum Mode { - User = 1 << 0, - System = 1 << 1, - SecondaryNotification = 1 << 2, - ExcludeAppVersion = 1 << 3, - ExcludeAppPath = 1 << 4 - }; - Q_DECLARE_FLAGS(Options, Mode) - - /** - * @brief Intitializes a SingleApplication instance with argc command line - * arguments in argv - * @arg {int &} argc - Number of arguments in argv - * @arg {const char *[]} argv - Supplied command line arguments - * @arg {bool} allowSecondary - Whether to start the instance as secondary - * if there is already a primary instance. - * @arg {Mode} mode - Whether for the SingleApplication block to be applied - * User wide or System wide. - * @arg {int} timeout - Timeout to wait in milliseconds. - * @note argc and argv may be changed as Qt removes arguments that it - * recognizes - * @note Mode::SecondaryNotification only works if set on both the primary - * instance and the secondary instance. - * @note The timeout is just a hint for the maximum time of blocking - * operations. It does not guarantee that the SingleApplication - * initialisation will be completed in given time, though is a good hint. - * Usually 4*timeout would be the worst case (fail) scenario. - * @see See the corresponding QAPPLICATION_CLASS constructor for reference - */ - explicit SingleApplication( int &argc, char *argv[], bool allowSecondary = false, Options options = Mode::User, int timeout = 1000, const QString &userData = {} ); - ~SingleApplication() override; - - /** - * @brief Returns if the instance is the primary instance - * @returns {bool} - */ - bool isPrimary() const; - - /** - * @brief Returns if the instance is a secondary instance - * @returns {bool} - */ - bool isSecondary() const; - - /** - * @brief Returns a unique identifier for the current instance - * @returns {qint32} - */ - quint32 instanceId() const; - - /** - * @brief Returns the process ID (PID) of the primary instance - * @returns {qint64} - */ - qint64 primaryPid() const; - - /** - * @brief Returns the username of the user running the primary instance - * @returns {QString} - */ - QString primaryUser() const; - - /** - * @brief Returns the username of the current user - * @returns {QString} - */ - QString currentUser() const; - - /** - * @brief Sends a message to the primary instance. Returns true on success. - * @param {int} timeout - Timeout for connecting - * @returns {bool} - * @note sendMessage() will return false if invoked from the primary - * instance. - */ - bool sendMessage( const QByteArray &message, int timeout = 100 ); - - /** - * @brief Get the set user data. - * @returns {QStringList} - */ - QStringList userData() const; - -Q_SIGNALS: - void instanceStarted(); - void receivedMessage( quint32 instanceId, QByteArray message ); - -private: - SingleApplicationPrivate *d_ptr; - Q_DECLARE_PRIVATE(SingleApplication) - void abortSafely(); -}; - -Q_DECLARE_OPERATORS_FOR_FLAGS(SingleApplication::Options) - -#endif // SINGLE_APPLICATION_H diff --git a/client/3rd/SingleApplication/singleapplication.pri b/client/3rd/SingleApplication/singleapplication.pri deleted file mode 100644 index 80283fc4..00000000 --- a/client/3rd/SingleApplication/singleapplication.pri +++ /dev/null @@ -1,15 +0,0 @@ -QT += core network -CONFIG += c++11 - -HEADERS += \ - $$PWD/singleapplication.h \ - $$PWD/singleapplication_p.h -SOURCES += $$PWD/singleapplication.cpp \ - $$PWD/singleapplication_p.cpp - -INCLUDEPATH += $$PWD - -win32 { - msvc:LIBS += Advapi32.lib - gcc:LIBS += -ladvapi32 -} diff --git a/client/3rd/SingleApplication/singleapplication_p.cpp b/client/3rd/SingleApplication/singleapplication_p.cpp deleted file mode 100644 index e65bd955..00000000 --- a/client/3rd/SingleApplication/singleapplication_p.cpp +++ /dev/null @@ -1,486 +0,0 @@ -// The MIT License (MIT) -// -// Copyright (c) Itay Grudev 2015 - 2020 -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -// -// W A R N I N G !!! -// ----------------- -// -// This file is not part of the SingleApplication API. It is used purely as an -// implementation detail. This header file may change from version to -// version without notice, or may even be removed. -// - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0) -#include -#else -#include -#endif - -#include "singleapplication.h" -#include "singleapplication_p.h" - -#ifdef Q_OS_UNIX - #include - #include - #include -#endif - -#ifdef Q_OS_WIN - #ifndef NOMINMAX - #define NOMINMAX 1 - #endif - #include - #include -#endif - -SingleApplicationPrivate::SingleApplicationPrivate( SingleApplication *q_ptr ) - : q_ptr( q_ptr ) -{ - server = nullptr; - socket = nullptr; - memory = nullptr; - instanceNumber = 0; -} - -SingleApplicationPrivate::~SingleApplicationPrivate() -{ - if( socket != nullptr ){ - socket->close(); - delete socket; - } - - if( memory != nullptr ){ - memory->lock(); - auto *inst = static_cast(memory->data()); - if( server != nullptr ){ - server->close(); - delete server; - inst->primary = false; - inst->primaryPid = -1; - inst->primaryUser[0] = '\0'; - inst->checksum = blockChecksum(); - } - memory->unlock(); - - delete memory; - } -} - -QString SingleApplicationPrivate::getUsername() -{ -#ifdef Q_OS_WIN - wchar_t username[UNLEN + 1]; - // Specifies size of the buffer on input - DWORD usernameLength = UNLEN + 1; - if( GetUserNameW( username, &usernameLength ) ) - return QString::fromWCharArray( username ); -#if QT_VERSION < QT_VERSION_CHECK(5, 10, 0) - return QString::fromLocal8Bit( qgetenv( "USERNAME" ) ); -#else - return qEnvironmentVariable( "USERNAME" ); -#endif -#endif -#ifdef Q_OS_UNIX - QString username; - uid_t uid = geteuid(); - struct passwd *pw = getpwuid( uid ); - if( pw ) - username = QString::fromLocal8Bit( pw->pw_name ); - if ( username.isEmpty() ){ -#if QT_VERSION < QT_VERSION_CHECK(5, 10, 0) - username = QString::fromLocal8Bit( qgetenv( "USER" ) ); -#else - username = qEnvironmentVariable( "USER" ); -#endif - } - return username; -#endif -} - -void SingleApplicationPrivate::genBlockServerName() -{ - QCryptographicHash appData( QCryptographicHash::Sha256 ); - appData.addData( "SingleApplication", 17 ); - appData.addData( SingleApplication::app_t::applicationName().toUtf8() ); - appData.addData( SingleApplication::app_t::organizationName().toUtf8() ); - appData.addData( SingleApplication::app_t::organizationDomain().toUtf8() ); - - if ( ! appDataList.isEmpty() ) - appData.addData( appDataList.join( "" ).toUtf8() ); - - if( ! (options & SingleApplication::Mode::ExcludeAppVersion) ){ - appData.addData( SingleApplication::app_t::applicationVersion().toUtf8() ); - } - - if( ! (options & SingleApplication::Mode::ExcludeAppPath) ){ -#ifdef Q_OS_WIN - appData.addData( SingleApplication::app_t::applicationFilePath().toLower().toUtf8() ); -#else - appData.addData( SingleApplication::app_t::applicationFilePath().toUtf8() ); -#endif - } - - // User level block requires a user specific data in the hash - if( options & SingleApplication::Mode::User ){ - appData.addData( getUsername().toUtf8() ); - } - - // Replace the backslash in RFC 2045 Base64 [a-zA-Z0-9+/=] to comply with - // server naming requirements. - blockServerName = appData.result().toBase64().replace("/", "_"); -} - -void SingleApplicationPrivate::initializeMemoryBlock() const -{ - auto *inst = static_cast( memory->data() ); - inst->primary = false; - inst->secondary = 0; - inst->primaryPid = -1; - inst->primaryUser[0] = '\0'; - inst->checksum = blockChecksum(); -} - -void SingleApplicationPrivate::startPrimary() -{ - // Reset the number of connections - auto *inst = static_cast ( memory->data() ); - - inst->primary = true; - inst->primaryPid = QCoreApplication::applicationPid(); - qstrncpy( inst->primaryUser, getUsername().toUtf8().data(), sizeof(inst->primaryUser) ); - inst->checksum = blockChecksum(); - instanceNumber = 0; - // Successful creation means that no main process exists - // So we start a QLocalServer to listen for connections - QLocalServer::removeServer( blockServerName ); - server = new QLocalServer(); - - // Restrict access to the socket according to the - // SingleApplication::Mode::User flag on User level or no restrictions - if( options & SingleApplication::Mode::User ){ - server->setSocketOptions( QLocalServer::UserAccessOption ); - } else { - server->setSocketOptions( QLocalServer::WorldAccessOption ); - } - - server->listen( blockServerName ); - QObject::connect( - server, - &QLocalServer::newConnection, - this, - &SingleApplicationPrivate::slotConnectionEstablished - ); -} - -void SingleApplicationPrivate::startSecondary() -{ - auto *inst = static_cast ( memory->data() ); - - inst->secondary += 1; - inst->checksum = blockChecksum(); - instanceNumber = inst->secondary; -} - -bool SingleApplicationPrivate::connectToPrimary( int msecs, ConnectionType connectionType ) -{ - QElapsedTimer time; - time.start(); - - // Connect to the Local Server of the Primary Instance if not already - // connected. - if( socket == nullptr ){ - socket = new QLocalSocket(); - } - - if( socket->state() == QLocalSocket::ConnectedState ) return true; - - if( socket->state() != QLocalSocket::ConnectedState ){ - - while( true ){ - randomSleep(); - - if( socket->state() != QLocalSocket::ConnectingState ) - socket->connectToServer( blockServerName ); - - if( socket->state() == QLocalSocket::ConnectingState ){ - socket->waitForConnected( static_cast(msecs - time.elapsed()) ); - } - - // If connected break out of the loop - if( socket->state() == QLocalSocket::ConnectedState ) break; - - // If elapsed time since start is longer than the method timeout return - if( time.elapsed() >= msecs ) return false; - } - } - - // Initialisation message according to the SingleApplication protocol - QByteArray initMsg; - QDataStream writeStream(&initMsg, QIODevice::WriteOnly); - -#if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)) - writeStream.setVersion(QDataStream::Qt_5_6); -#endif - - writeStream << blockServerName.toLatin1(); - writeStream << static_cast(connectionType); - writeStream << instanceNumber; -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) - quint16 checksum = qChecksum(QByteArray(initMsg, static_cast(initMsg.length()))); -#else - quint16 checksum = qChecksum(initMsg.constData(), static_cast(initMsg.length())); -#endif - writeStream << checksum; - - // The header indicates the message length that follows - QByteArray header; - QDataStream headerStream(&header, QIODevice::WriteOnly); - -#if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)) - headerStream.setVersion(QDataStream::Qt_5_6); -#endif - headerStream << static_cast ( initMsg.length() ); - - socket->write( header ); - socket->write( initMsg ); - bool result = socket->waitForBytesWritten( static_cast(msecs - time.elapsed()) ); - socket->flush(); - return result; -} - -quint16 SingleApplicationPrivate::blockChecksum() const -{ -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) - quint16 checksum = qChecksum(QByteArray(static_cast(memory->constData()), offsetof(InstancesInfo, checksum))); -#else - quint16 checksum = qChecksum(static_cast(memory->constData()), offsetof(InstancesInfo, checksum)); -#endif - return checksum; -} - -qint64 SingleApplicationPrivate::primaryPid() const -{ - qint64 pid; - - memory->lock(); - auto *inst = static_cast( memory->data() ); - pid = inst->primaryPid; - memory->unlock(); - - return pid; -} - -QString SingleApplicationPrivate::primaryUser() const -{ - QByteArray username; - - memory->lock(); - auto *inst = static_cast( memory->data() ); - username = inst->primaryUser; - memory->unlock(); - - return QString::fromUtf8( username ); -} - -/** - * @brief Executed when a connection has been made to the LocalServer - */ -void SingleApplicationPrivate::slotConnectionEstablished() -{ - QLocalSocket *nextConnSocket = server->nextPendingConnection(); - connectionMap.insert(nextConnSocket, ConnectionInfo()); - - QObject::connect(nextConnSocket, &QLocalSocket::aboutToClose, - [nextConnSocket, this](){ - auto &info = connectionMap[nextConnSocket]; - Q_EMIT this->slotClientConnectionClosed( nextConnSocket, info.instanceId ); - } - ); - - QObject::connect(nextConnSocket, &QLocalSocket::disconnected, nextConnSocket, &QLocalSocket::deleteLater); - - QObject::connect(nextConnSocket, &QLocalSocket::destroyed, - [nextConnSocket, this](){ - connectionMap.remove(nextConnSocket); - } - ); - - QObject::connect(nextConnSocket, &QLocalSocket::readyRead, - [nextConnSocket, this](){ - auto &info = connectionMap[nextConnSocket]; - switch(info.stage){ - case StageHeader: - readInitMessageHeader(nextConnSocket); - break; - case StageBody: - readInitMessageBody(nextConnSocket); - break; - case StageConnected: - Q_EMIT this->slotDataAvailable( nextConnSocket, info.instanceId ); - break; - default: - break; - }; - } - ); -} - -void SingleApplicationPrivate::readInitMessageHeader( QLocalSocket *sock ) -{ - if (!connectionMap.contains( sock )){ - return; - } - - if( sock->bytesAvailable() < ( qint64 )sizeof( quint64 ) ){ - return; - } - - QDataStream headerStream( sock ); - -#if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)) - headerStream.setVersion( QDataStream::Qt_5_6 ); -#endif - - // Read the header to know the message length - quint64 msgLen = 0; - headerStream >> msgLen; - ConnectionInfo &info = connectionMap[sock]; - info.stage = StageBody; - info.msgLen = msgLen; - - if ( sock->bytesAvailable() >= (qint64) msgLen ){ - readInitMessageBody( sock ); - } -} - -void SingleApplicationPrivate::readInitMessageBody( QLocalSocket *sock ) -{ - Q_Q(SingleApplication); - - if (!connectionMap.contains( sock )){ - return; - } - - ConnectionInfo &info = connectionMap[sock]; - if( sock->bytesAvailable() < ( qint64 )info.msgLen ){ - return; - } - - // Read the message body - QByteArray msgBytes = sock->read(info.msgLen); - QDataStream readStream(msgBytes); - -#if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)) - readStream.setVersion( QDataStream::Qt_5_6 ); -#endif - - // server name - QByteArray latin1Name; - readStream >> latin1Name; - - // connection type - ConnectionType connectionType = InvalidConnection; - quint8 connTypeVal = InvalidConnection; - readStream >> connTypeVal; - connectionType = static_cast ( connTypeVal ); - - // instance id - quint32 instanceId = 0; - readStream >> instanceId; - - // checksum - quint16 msgChecksum = 0; - readStream >> msgChecksum; - -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) - const quint16 actualChecksum = qChecksum(QByteArray(msgBytes, static_cast(msgBytes.length() - sizeof(quint16)))); -#else - const quint16 actualChecksum = qChecksum(msgBytes.constData(), static_cast(msgBytes.length() - sizeof(quint16))); -#endif - - bool isValid = readStream.status() == QDataStream::Ok && - QLatin1String(latin1Name) == blockServerName && - msgChecksum == actualChecksum; - - if( !isValid ){ - sock->close(); - return; - } - - info.instanceId = instanceId; - info.stage = StageConnected; - - if( connectionType == NewInstance || - ( connectionType == SecondaryInstance && - options & SingleApplication::Mode::SecondaryNotification ) ) - { - Q_EMIT q->instanceStarted(); - } - - if (sock->bytesAvailable() > 0){ - Q_EMIT this->slotDataAvailable( sock, instanceId ); - } -} - -void SingleApplicationPrivate::slotDataAvailable( QLocalSocket *dataSocket, quint32 instanceId ) -{ - Q_Q(SingleApplication); - Q_EMIT q->receivedMessage( instanceId, dataSocket->readAll() ); -} - -void SingleApplicationPrivate::slotClientConnectionClosed( QLocalSocket *closedSocket, quint32 instanceId ) -{ - if( closedSocket->bytesAvailable() > 0 ) - Q_EMIT slotDataAvailable( closedSocket, instanceId ); -} - -void SingleApplicationPrivate::randomSleep() -{ -#if QT_VERSION >= QT_VERSION_CHECK( 5, 10, 0 ) - QThread::msleep( QRandomGenerator::global()->bounded( 8u, 18u )); -#else - qsrand( QDateTime::currentMSecsSinceEpoch() % std::numeric_limits::max() ); - QThread::msleep( 8 + static_cast ( static_cast ( qrand() ) / RAND_MAX * 10 )); -#endif -} - -void SingleApplicationPrivate::addAppData(const QString &data) -{ - appDataList.push_back(data); -} - -QStringList SingleApplicationPrivate::appData() const -{ - return appDataList; -} diff --git a/client/3rd/SingleApplication/singleapplication_p.h b/client/3rd/SingleApplication/singleapplication_p.h deleted file mode 100644 index c49a46dd..00000000 --- a/client/3rd/SingleApplication/singleapplication_p.h +++ /dev/null @@ -1,104 +0,0 @@ -// The MIT License (MIT) -// -// Copyright (c) Itay Grudev 2015 - 2020 -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -// -// W A R N I N G !!! -// ----------------- -// -// This file is not part of the SingleApplication API. It is used purely as an -// implementation detail. This header file may change from version to -// version without notice, or may even be removed. -// - -#ifndef SINGLEAPPLICATION_P_H -#define SINGLEAPPLICATION_P_H - -#include -#include -#include -#include "singleapplication.h" - -struct InstancesInfo { - bool primary; - quint32 secondary; - qint64 primaryPid; - char primaryUser[128]; - quint16 checksum; // Must be the last field -}; - -struct ConnectionInfo { - qint64 msgLen = 0; - quint32 instanceId = 0; - quint8 stage = 0; -}; - -class SingleApplicationPrivate : public QObject { -Q_OBJECT -public: - enum ConnectionType : quint8 { - InvalidConnection = 0, - NewInstance = 1, - SecondaryInstance = 2, - Reconnect = 3 - }; - enum ConnectionStage : quint8 { - StageHeader = 0, - StageBody = 1, - StageConnected = 2, - }; - Q_DECLARE_PUBLIC(SingleApplication) - - SingleApplicationPrivate( SingleApplication *q_ptr ); - ~SingleApplicationPrivate() override; - - static QString getUsername(); - void genBlockServerName(); - void initializeMemoryBlock() const; - void startPrimary(); - void startSecondary(); - bool connectToPrimary( int msecs, ConnectionType connectionType ); - quint16 blockChecksum() const; - qint64 primaryPid() const; - QString primaryUser() const; - void readInitMessageHeader(QLocalSocket *socket); - void readInitMessageBody(QLocalSocket *socket); - static void randomSleep(); - void addAppData(const QString &data); - QStringList appData() const; - - SingleApplication *q_ptr; - QSharedMemory *memory; - QLocalSocket *socket; - QLocalServer *server; - quint32 instanceNumber; - QString blockServerName; - SingleApplication::Options options; - QMap connectionMap; - QStringList appDataList; - -public Q_SLOTS: - void slotConnectionEstablished(); - void slotDataAvailable( QLocalSocket*, quint32 ); - void slotClientConnectionClosed( QLocalSocket*, quint32 ); -}; - -#endif // SINGLEAPPLICATION_P_H diff --git a/client/3rd/qtkeychain b/client/3rd/qtkeychain index 74776e2a..7460df6a 160000 --- a/client/3rd/qtkeychain +++ b/client/3rd/qtkeychain @@ -1 +1 @@ -Subproject commit 74776e2a3e2d98d19943e0968901c5b5e04cc1bd +Subproject commit 7460df6a978669290de5b56c2d98b199b61c3f88 diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt index 1fc28b82..2de5db48 100644 --- a/client/CMakeLists.txt +++ b/client/CMakeLists.txt @@ -24,6 +24,12 @@ execute_process( add_definitions(-DGIT_COMMIT_HASH="${GIT_COMMIT_HASH}") +add_definitions(-DPROD_AGW_PUBLIC_KEY="$ENV{PROD_AGW_PUBLIC_KEY}") +add_definitions(-DPROD_PROXY_STORAGE_KEY="$ENV{PROD_PROXY_STORAGE_KEY}") + +add_definitions(-DDEV_AGW_PUBLIC_KEY="$ENV{DEV_AGW_PUBLIC_KEY}") +add_definitions(-DDEV_AGW_ENDPOINT="$ENV{DEV_AGW_ENDPOINT}") + if(IOS) set(PACKAGES ${PACKAGES} Multimedia) endif() @@ -34,7 +40,7 @@ endif() find_package(Qt6 REQUIRED COMPONENTS ${PACKAGES}) -set(LIBS ${LIBS} +set(LIBS ${LIBS} Qt6::Core Qt6::Gui Qt6::Network Qt6::Xml Qt6::RemoteObjects Qt6::Quick Qt6::Svg Qt6::QuickControls2 @@ -55,6 +61,7 @@ qt_add_executable(${PROJECT} MANUAL_FINALIZATION) if(WIN32 OR (APPLE AND NOT IOS) OR (LINUX AND NOT ANDROID)) qt_add_repc_replicas(${PROJECT} ${CMAKE_CURRENT_LIST_DIR}/../ipc/ipc_interface.rep) qt_add_repc_replicas(${PROJECT} ${CMAKE_CURRENT_LIST_DIR}/../ipc/ipc_process_interface.rep) + qt_add_repc_replicas(${PROJECT} ${CMAKE_CURRENT_LIST_DIR}/../ipc/ipc_process_tun2socks.rep) endif() qt6_add_resources(QRC ${QRC} ${CMAKE_CURRENT_LIST_DIR}/resources.qrc) @@ -107,6 +114,7 @@ include(${CMAKE_CURRENT_LIST_DIR}/cmake/3rdparty.cmake) include_directories( ${CMAKE_CURRENT_LIST_DIR}/../ipc + ${CMAKE_CURRENT_LIST_DIR}/../common/logger ${CMAKE_CURRENT_LIST_DIR} ${CMAKE_CURRENT_BINARY_DIR} ) @@ -128,7 +136,6 @@ set(HEADERS ${HEADERS} ${CMAKE_CURRENT_LIST_DIR}/protocols/protocols_defs.h ${CMAKE_CURRENT_LIST_DIR}/protocols/qml_register_protocols.h ${CMAKE_CURRENT_LIST_DIR}/ui/pages.h - ${CMAKE_CURRENT_LIST_DIR}/ui/property_helper.h ${CMAKE_CURRENT_LIST_DIR}/ui/qautostart.h ${CMAKE_CURRENT_LIST_DIR}/protocols/vpnprotocol.h ${CMAKE_CURRENT_BINARY_DIR}/version.h @@ -136,6 +143,8 @@ set(HEADERS ${HEADERS} ${CMAKE_CURRENT_LIST_DIR}/core/networkUtilities.h ${CMAKE_CURRENT_LIST_DIR}/core/serialization/serialization.h ${CMAKE_CURRENT_LIST_DIR}/core/serialization/transfer.h + ${CMAKE_CURRENT_LIST_DIR}/core/enums/apiEnums.h + ${CMAKE_CURRENT_LIST_DIR}/../common/logger/logger.h ) # Mozilla headres @@ -186,6 +195,7 @@ set(SOURCES ${SOURCES} ${CMAKE_CURRENT_LIST_DIR}/core/serialization/trojan.cpp ${CMAKE_CURRENT_LIST_DIR}/core/serialization/vmess.cpp ${CMAKE_CURRENT_LIST_DIR}/core/serialization/vmess_new.cpp + ${CMAKE_CURRENT_LIST_DIR}/../common/logger/logger.cpp ) # Mozilla sources @@ -252,7 +262,7 @@ set(SOURCES ${SOURCES} if(WIN32) configure_file( - ${CMAKE_CURRENT_LIST_DIR}/platforms/windows/amneziavpn.rc.in + ${CMAKE_CURRENT_LIST_DIR}/platforms/windows/amneziavpn.rc.in ${CMAKE_CURRENT_BINARY_DIR}/amneziavpn.rc ) diff --git a/client/amnezia_application.cpp b/client/amnezia_application.cpp index c3adfe31..4e25097d 100644 --- a/client/amnezia_application.cpp +++ b/client/amnezia_application.cpp @@ -3,13 +3,15 @@ #include #include #include +#include #include #include #include #include #include #include -#include +#include +#include #include "logger.h" #include "ui/models/installedAppsModel.h" @@ -28,13 +30,7 @@ #include #endif -#if defined(Q_OS_ANDROID) || defined(Q_OS_IOS) AmneziaApplication::AmneziaApplication(int &argc, char *argv[]) : AMNEZIA_BASE_CLASS(argc, argv) -#else -AmneziaApplication::AmneziaApplication(int &argc, char *argv[], bool allowSecondary, SingleApplication::Options options, int timeout, - const QString &userData) - : SingleApplication(argc, argv, allowSecondary, options, timeout, userData) -#endif { setQuitOnLastWindowClosed(false); @@ -115,10 +111,11 @@ void AmneziaApplication::init() qFatal("Android controller initialization failed"); } - connect(AndroidController::instance(), &AndroidController::importConfigFromOutside, [this](QString data) { - m_pageController->replaceStartPage(); + connect(AndroidController::instance(), &AndroidController::importConfigFromOutside, this, [this](QString data) { + emit m_pageController->goToPageHome(); m_importController->extractConfigFromData(data); - m_pageController->goToPageViewConfig(); + data.clear(); + emit m_pageController->goToPageViewConfig(); }); m_engine->addImageProvider(QLatin1String("installedAppImage"), new InstalledAppsImageProvider); @@ -126,16 +123,16 @@ void AmneziaApplication::init() #ifdef Q_OS_IOS IosController::Instance()->initialize(); - connect(IosController::Instance(), &IosController::importConfigFromOutside, [this](QString data) { - m_pageController->replaceStartPage(); + connect(IosController::Instance(), &IosController::importConfigFromOutside, this, [this](QString data) { + emit m_pageController->goToPageHome(); m_importController->extractConfigFromData(data); - m_pageController->goToPageViewConfig(); + emit m_pageController->goToPageViewConfig(); }); - connect(IosController::Instance(), &IosController::importBackupFromOutside, [this](QString filePath) { - m_pageController->replaceStartPage(); + connect(IosController::Instance(), &IosController::importBackupFromOutside, this, [this](QString filePath) { + emit m_pageController->goToPageHome(); m_pageController->goToPageSettingsBackup(); - m_settingsController->importBackupFromOutside(filePath); + emit m_settingsController->importBackupFromOutside(filePath); }); QTimer::singleShot(0, this, [this]() { AmneziaVPN::toggleScreenshots(m_settings->isScreenshotsEnabled()); }); @@ -164,7 +161,7 @@ void AmneziaApplication::init() bool enabled = m_settings->isSaveLogs(); #ifndef Q_OS_ANDROID if (enabled) { - if (!Logger::init()) { + if (!Logger::init(false)) { qWarning() << "Initialization of debug subsystem failed"; } } @@ -180,16 +177,6 @@ void AmneziaApplication::init() m_pageController->showOnStartup(); #endif - // TODO - fix -#if !defined(Q_OS_ANDROID) && !defined(Q_OS_IOS) - if (isPrimary()) { - QObject::connect(this, &SingleApplication::instanceStarted, m_pageController.get(), [this]() { - qDebug() << "Secondary instance started, showing this window instead"; - emit m_pageController->raiseMainWindow(); - }); - } -#endif - // Android TextArea clipboard workaround // Text from TextArea always has "text/html" mime-type: // /qt/6.6.1/Src/qtdeclarative/src/quick/items/qquicktextcontrol.cpp:1865 @@ -294,6 +281,24 @@ bool AmneziaApplication::parseCommands() return true; } +#if !defined(Q_OS_ANDROID) && !defined(Q_OS_IOS) +void AmneziaApplication::startLocalServer() { + const QString serverName("AmneziaVPNInstance"); + QLocalServer::removeServer(serverName); + + QLocalServer* server = new QLocalServer(this); + server->listen(serverName); + + QObject::connect(server, &QLocalServer::newConnection, this, [server, this]() { + if (server) { + QLocalSocket* clientConnection = server->nextPendingConnection(); + clientConnection->deleteLater(); + } + emit m_pageController->raiseMainWindow(); + }); +} +#endif + QQmlApplicationEngine *AmneziaApplication::qmlEngine() const { return m_engine; @@ -361,6 +366,18 @@ void AmneziaApplication::initModels() m_engine->rootContext()->setContextProperty("ClientManagementModel", m_clientManagementModel.get()); connect(m_clientManagementModel.get(), &ClientManagementModel::adminConfigRevoked, m_serversModel.get(), &ServersModel::clearCachedProfile); + + m_apiServicesModel.reset(new ApiServicesModel(this)); + m_engine->rootContext()->setContextProperty("ApiServicesModel", m_apiServicesModel.get()); + + m_apiCountryModel.reset(new ApiCountryModel(this)); + m_engine->rootContext()->setContextProperty("ApiCountryModel", m_apiCountryModel.get()); + connect(m_serversModel.get(), &ServersModel::updateApiLanguageModel, this, [this]() { + m_apiCountryModel->updateModel(m_serversModel->getProcessedServerData("apiAvailableCountries").toJsonArray(), + m_serversModel->getProcessedServerData("apiServerCountryCode").toString()); + }); + connect(m_serversModel.get(), &ServersModel::updateApiServicesModel, this, + [this]() { m_apiServicesModel->updateModel(m_serversModel->getProcessedServerData("apiConfig").toJsonObject()); }); } void AmneziaApplication::initControllers() @@ -369,25 +386,26 @@ void AmneziaApplication::initControllers() new ConnectionController(m_serversModel, m_containersModel, m_clientManagementModel, m_vpnConnection, m_settings)); m_engine->rootContext()->setContextProperty("ConnectionController", m_connectionController.get()); - connect(m_connectionController.get(), qOverload(&ConnectionController::connectionErrorOccurred), this, [this](const QString &errorMessage) { - emit m_pageController->showErrorMessage(errorMessage); - emit m_vpnConnection->connectionStateChanged(Vpn::ConnectionState::Disconnected); - }); + connect(m_connectionController.get(), qOverload(&ConnectionController::connectionErrorOccurred), this, + [this](const QString &errorMessage) { + emit m_pageController->showErrorMessage(errorMessage); + emit m_vpnConnection->connectionStateChanged(Vpn::ConnectionState::Disconnected); + }); - connect(m_connectionController.get(), qOverload(&ConnectionController::connectionErrorOccurred), this, [this](ErrorCode errorCode) { - emit m_pageController->showErrorMessage(errorCode); - emit m_vpnConnection->connectionStateChanged(Vpn::ConnectionState::Disconnected); - }); + connect(m_connectionController.get(), qOverload(&ConnectionController::connectionErrorOccurred), this, + [this](ErrorCode errorCode) { + emit m_pageController->showErrorMessage(errorCode); + emit m_vpnConnection->connectionStateChanged(Vpn::ConnectionState::Disconnected); + }); connect(m_connectionController.get(), &ConnectionController::connectButtonClicked, m_connectionController.get(), &ConnectionController::toggleConnection, Qt::QueuedConnection); - connect(this, &AmneziaApplication::translationsUpdated, m_connectionController.get(), &ConnectionController::onTranslationsUpdated); - m_pageController.reset(new PageController(m_serversModel, m_settings)); m_engine->rootContext()->setContextProperty("PageController", m_pageController.get()); - m_installController.reset(new InstallController(m_serversModel, m_containersModel, m_protocolsModel, m_clientManagementModel, m_settings)); + m_installController.reset(new InstallController(m_serversModel, m_containersModel, m_protocolsModel, m_clientManagementModel, + m_apiServicesModel, m_settings)); m_engine->rootContext()->setContextProperty("InstallController", m_installController.get()); connect(m_installController.get(), &InstallController::passphraseRequestStarted, m_pageController.get(), &PageController::showPassphraseRequestDrawer); @@ -396,6 +414,30 @@ void AmneziaApplication::initControllers() connect(m_installController.get(), &InstallController::currentContainerUpdated, m_connectionController.get(), &ConnectionController::onCurrentContainerUpdated); + connect(m_installController.get(), &InstallController::updateServerFromApiFinished, this, [this]() { + disconnect(m_reloadConfigErrorOccurredConnection); + emit m_connectionController->configFromApiUpdated(); + }); + + connect(m_connectionController.get(), &ConnectionController::updateApiConfigFromGateway, this, [this]() { + m_reloadConfigErrorOccurredConnection = connect( + m_installController.get(), qOverload(&InstallController::installationErrorOccurred), this, + [this]() { emit m_vpnConnection->connectionStateChanged(Vpn::ConnectionState::Disconnected); }, + static_cast(Qt::AutoConnection || Qt::SingleShotConnection)); + m_installController->updateServiceFromApi(m_serversModel->getDefaultServerIndex(), "", ""); + }); + + connect(m_connectionController.get(), &ConnectionController::updateApiConfigFromTelegram, this, [this]() { + m_reloadConfigErrorOccurredConnection = connect( + m_installController.get(), qOverload(&InstallController::installationErrorOccurred), this, + [this]() { emit m_vpnConnection->connectionStateChanged(Vpn::ConnectionState::Disconnected); }, + static_cast(Qt::AutoConnection || Qt::SingleShotConnection)); + m_serversModel->removeApiConfig(m_serversModel->getDefaultServerIndex()); + m_installController->updateServiceFromTelegram(m_serversModel->getDefaultServerIndex()); + }); + + connect(this, &AmneziaApplication::translationsUpdated, m_connectionController.get(), &ConnectionController::onTranslationsUpdated); + m_importController.reset(new ImportController(m_serversModel, m_containersModel, m_settings)); m_engine->rootContext()->setContextProperty("ImportController", m_importController.get()); diff --git a/client/amnezia_application.h b/client/amnezia_application.h index b15d55d7..64566216 100644 --- a/client/amnezia_application.h +++ b/client/amnezia_application.h @@ -45,28 +45,22 @@ #include "ui/models/sites_model.h" #include "ui/models/clientManagementModel.h" #include "ui/models/appSplitTunnelingModel.h" +#include "ui/models/apiServicesModel.h" +#include "ui/models/apiCountryModel.h" #define amnApp (static_cast(QCoreApplication::instance())) #if defined(Q_OS_ANDROID) || defined(Q_OS_IOS) #define AMNEZIA_BASE_CLASS QGuiApplication #else - #define AMNEZIA_BASE_CLASS SingleApplication - #define QAPPLICATION_CLASS QApplication - #include "singleapplication.h" + #define AMNEZIA_BASE_CLASS QApplication #endif class AmneziaApplication : public AMNEZIA_BASE_CLASS { Q_OBJECT public: -#if defined(Q_OS_ANDROID) || defined(Q_OS_IOS) AmneziaApplication(int &argc, char *argv[]); -#else - AmneziaApplication(int &argc, char *argv[], bool allowSecondary = false, - SingleApplication::Options options = SingleApplication::User, int timeout = 1000, - const QString &userData = {}); -#endif virtual ~AmneziaApplication(); void init(); @@ -76,6 +70,10 @@ public: void updateTranslator(const QLocale &locale); bool parseCommands(); +#if !defined(Q_OS_ANDROID) && !defined(Q_OS_IOS) + void startLocalServer(); +#endif + QQmlApplicationEngine *qmlEngine() const; QNetworkAccessManager *manager() { return m_nam; } @@ -103,6 +101,8 @@ private: QSharedPointer m_sitesModel; QSharedPointer m_appSplitTunnelingModel; QSharedPointer m_clientManagementModel; + QSharedPointer m_apiServicesModel; + QSharedPointer m_apiCountryModel; QScopedPointer m_openVpnConfigModel; QScopedPointer m_shadowSocksConfigModel; @@ -134,6 +134,8 @@ private: QScopedPointer m_appSplitTunnelingController; QNetworkAccessManager *m_nam; + + QMetaObject::Connection m_reloadConfigErrorOccurredConnection; }; #endif // AMNEZIA_APPLICATION_H diff --git a/client/android/AndroidManifest.xml b/client/android/AndroidManifest.xml index c1c40b52..179def86 100644 --- a/client/android/AndroidManifest.xml +++ b/client/android/AndroidManifest.xml @@ -3,7 +3,6 @@ @@ -46,7 +45,7 @@ android:configChanges="uiMode|screenSize|smallestScreenSize|screenLayout|orientation|density |fontScale|layoutDirection|locale|keyboard|keyboardHidden|navigation|mcc|mnc" android:launchMode="singleInstance" - android:windowSoftInputMode="adjustResize" + android:windowSoftInputMode="stateUnchanged|adjustResize" android:exported="true"> @@ -68,9 +67,6 @@ android:name="android.app.lib_name" android:value="-- %%INSERT_APP_LIB_NAME%% --" /> - + + Unit): AwgConfig = Builder().apply(block).build() - } -} diff --git a/client/android/build.gradle b/client/android/build.gradle index d768000e..5044727b 100644 --- a/client/android/build.gradle +++ b/client/android/build.gradle @@ -3,3 +3,6 @@ // android.bundle.enableUncompressedNativeLibs is deprecated // disable adding gradle property android.bundle.enableUncompressedNativeLibs by androiddeployqt useLegacyPackaging + +// package name for androiddeployqt +namespace = "org.amnezia.vpn" diff --git a/client/android/build.gradle.kts b/client/android/build.gradle.kts index 7c4cec5a..3c742621 100644 --- a/client/android/build.gradle.kts +++ b/client/android/build.gradle.kts @@ -115,9 +115,11 @@ dependencies { implementation(project(":xray")) implementation(libs.androidx.core) implementation(libs.androidx.activity) + implementation(libs.androidx.fragment) implementation(libs.kotlinx.coroutines) implementation(libs.kotlinx.serialization.protobuf) implementation(libs.bundles.androidx.camera) implementation(libs.google.mlkit) implementation(libs.androidx.datastore) + implementation(libs.androidx.biometric) } diff --git a/client/android/cloak/src/main/kotlin/Cloak.kt b/client/android/cloak/src/main/kotlin/Cloak.kt index 5a549130..d408fb19 100644 --- a/client/android/cloak/src/main/kotlin/Cloak.kt +++ b/client/android/cloak/src/main/kotlin/Cloak.kt @@ -3,40 +3,16 @@ package org.amnezia.vpn.protocol.cloak import android.util.Base64 import net.openvpn.ovpn3.ClientAPI_Config import org.amnezia.vpn.protocol.openvpn.OpenVpn +import org.amnezia.vpn.util.LibraryLoader.loadSharedLibrary import org.json.JSONObject -/** - * Config Example: - * { - * "protocol": "cloak", - * "description": "Server 1", - * "dns1": "1.1.1.1", - * "dns2": "1.0.0.1", - * "hostName": "100.100.100.0", - * "splitTunnelSites": [ - * ], - * "splitTunnelType": 0, - * "openvpn_config_data": { - * "config": "openVpnConfig" - * } - * "cloak_config_data": { - * "BrowserSig": "chrome", - * "EncryptionMethod": "aes-gcm", - * "NumConn": 1, - * "ProxyMethod": "openvpn", - * "PublicKey": "PublicKey=", - * "RemoteHost": "100.100.100.0", - * "RemotePort": "443", - * "ServerName": "servername", - * "StreamTimeout": 300, - * "Transport": "direct", - * "UID": "UID=" - * } - * } - */ - class Cloak : OpenVpn() { + override fun internalInit() { + super.internalInit() + if (!isInitialized) loadSharedLibrary(context, "ck-ovpn-plugin") + } + override fun parseConfig(config: JSONObject): ClientAPI_Config { val openVpnConfig = ClientAPI_Config() diff --git a/client/android/gradle/libs.versions.toml b/client/android/gradle/libs.versions.toml index a5466422..c6fa1907 100644 --- a/client/android/gradle/libs.versions.toml +++ b/client/android/gradle/libs.versions.toml @@ -1,24 +1,28 @@ [versions] -agp = "8.2.0" -kotlin = "1.9.20" -androidx-core = "1.12.0" -androidx-activity = "1.8.1" -androidx-annotation = "1.7.0" -androidx-camera = "1.3.0" +agp = "8.5.2" +kotlin = "1.9.24" +androidx-core = "1.13.1" +androidx-activity = "1.9.1" +androidx-annotation = "1.8.2" +androidx-biometric = "1.2.0-alpha05" +androidx-camera = "1.3.4" +androidx-fragment = "1.8.2" androidx-security-crypto = "1.1.0-alpha06" -androidx-datastore = "1.1.0-beta01" -kotlinx-coroutines = "1.7.3" +androidx-datastore = "1.1.1" +kotlinx-coroutines = "1.8.1" kotlinx-serialization = "1.6.3" -google-mlkit = "17.2.0" +google-mlkit = "17.3.0" [libraries] androidx-core = { module = "androidx.core:core-ktx", version.ref = "androidx-core" } androidx-activity = { module = "androidx.activity:activity-ktx", version.ref = "androidx-activity" } androidx-annotation = { module = "androidx.annotation:annotation", version.ref = "androidx-annotation" } +androidx-biometric = { module = "androidx.biometric:biometric-ktx", version.ref = "androidx-biometric" } androidx-camera-core = { module = "androidx.camera:camera-core", version.ref = "androidx-camera" } androidx-camera-camera2 = { module = "androidx.camera:camera-camera2", version.ref = "androidx-camera" } androidx-camera-lifecycle = { module = "androidx.camera:camera-lifecycle", version.ref = "androidx-camera" } androidx-camera-view = { module = "androidx.camera:camera-view", version.ref = "androidx-camera" } +androidx-fragment = { module = "androidx.fragment:fragment-ktx", version.ref = "androidx-fragment" } androidx-security-crypto = { module = "androidx.security:security-crypto-ktx", version.ref = "androidx-security-crypto" } androidx-datastore = { module = "androidx.datastore:datastore-preferences", version.ref = "androidx-datastore" } kotlinx-coroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "kotlinx-coroutines" } diff --git a/client/android/gradle/wrapper/gradle-wrapper.jar b/client/android/gradle/wrapper/gradle-wrapper.jar index d64cd491..a4b76b95 100644 Binary files a/client/android/gradle/wrapper/gradle-wrapper.jar and b/client/android/gradle/wrapper/gradle-wrapper.jar differ diff --git a/client/android/gradle/wrapper/gradle-wrapper.properties b/client/android/gradle/wrapper/gradle-wrapper.properties index 1af9e093..e1adfb49 100644 --- a/client/android/gradle/wrapper/gradle-wrapper.properties +++ b/client/android/gradle/wrapper/gradle-wrapper.properties @@ -1,7 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip -networkTimeout=10000 -validateDistributionUrl=true +distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/client/android/gradlew b/client/android/gradlew index 1aa94a42..f5feea6d 100755 --- a/client/android/gradlew +++ b/client/android/gradlew @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # @@ -55,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -84,7 +86,8 @@ done # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) -APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s +' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum diff --git a/client/android/gradlew.bat b/client/android/gradlew.bat index 93e3f59f..9d21a218 100644 --- a/client/android/gradlew.bat +++ b/client/android/gradlew.bat @@ -13,6 +13,8 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem @if "%DEBUG%"=="" @echo off @rem ########################################################################## @@ -43,11 +45,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -57,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail diff --git a/client/android/openvpn/src/main/kotlin/org/amnezia/vpn/protocol/openvpn/OpenVpn.kt b/client/android/openvpn/src/main/kotlin/org/amnezia/vpn/protocol/openvpn/OpenVpn.kt index abe46245..22fe35cd 100644 --- a/client/android/openvpn/src/main/kotlin/org/amnezia/vpn/protocol/openvpn/OpenVpn.kt +++ b/client/android/openvpn/src/main/kotlin/org/amnezia/vpn/protocol/openvpn/OpenVpn.kt @@ -11,28 +11,12 @@ import org.amnezia.vpn.protocol.Protocol import org.amnezia.vpn.protocol.ProtocolState.DISCONNECTED import org.amnezia.vpn.protocol.Statistics import org.amnezia.vpn.protocol.VpnStartException +import org.amnezia.vpn.util.LibraryLoader.loadSharedLibrary import org.amnezia.vpn.util.net.InetNetwork import org.amnezia.vpn.util.net.getLocalNetworks import org.amnezia.vpn.util.net.parseInetAddress import org.json.JSONObject -/** - * Config Example: - * { - * "protocol": "openvpn", - * "description": "Server 1", - * "dns1": "1.1.1.1", - * "dns2": "1.0.0.1", - * "hostName": "100.100.100.0", - * "splitTunnelSites": [ - * ], - * "splitTunnelType": 0, - * "openvpn_config_data": { - * "config": "openVpnConfig" - * } - * } - */ - open class OpenVpn : Protocol() { private var openVpnClient: OpenVpnClient? = null @@ -51,14 +35,17 @@ open class OpenVpn : Protocol() { } override fun internalInit() { - if (!isInitialized) loadSharedLibrary(context, "ovpn3") + if (!isInitialized) { + loadSharedLibrary(context, "ovpn3") + loadSharedLibrary(context, "ovpnutil") + } if (this::scope.isInitialized) { scope.cancel() } scope = CoroutineScope(Dispatchers.IO) } - override fun startVpn(config: JSONObject, vpnBuilder: Builder, protect: (Int) -> Boolean) { + override suspend fun startVpn(config: JSONObject, vpnBuilder: Builder, protect: (Int) -> Boolean) { val configBuilder = OpenVpnConfig.Builder() openVpnClient = OpenVpnClient( diff --git a/client/android/protocolApi/src/main/kotlin/Exceptions.kt b/client/android/protocolApi/src/main/kotlin/Exceptions.kt index 739a327c..b80648b0 100644 --- a/client/android/protocolApi/src/main/kotlin/Exceptions.kt +++ b/client/android/protocolApi/src/main/kotlin/Exceptions.kt @@ -2,7 +2,6 @@ package org.amnezia.vpn.protocol sealed class ProtocolException(message: String? = null, cause: Throwable? = null) : Exception(message, cause) -class LoadLibraryException(message: String? = null, cause: Throwable? = null) : ProtocolException(message, cause) class BadConfigException(message: String? = null, cause: Throwable? = null) : ProtocolException(message, cause) class VpnStartException(message: String? = null, cause: Throwable? = null) : ProtocolException(message, cause) diff --git a/client/android/protocolApi/src/main/kotlin/Protocol.kt b/client/android/protocolApi/src/main/kotlin/Protocol.kt index a475a2fc..b5c382be 100644 --- a/client/android/protocolApi/src/main/kotlin/Protocol.kt +++ b/client/android/protocolApi/src/main/kotlin/Protocol.kt @@ -42,7 +42,7 @@ abstract class Protocol { protected abstract fun internalInit() - abstract fun startVpn(config: JSONObject, vpnBuilder: Builder, protect: (Int) -> Boolean) + abstract suspend fun startVpn(config: JSONObject, vpnBuilder: Builder, protect: (Int) -> Boolean) abstract fun stopVpn() @@ -158,60 +158,6 @@ abstract class Protocol { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) vpnBuilder.setMetered(false) } - - companion object { - private fun extractLibrary(context: Context, libraryName: String, destination: File): Boolean { - Log.d(TAG, "Extracting library: $libraryName") - val apks = hashSetOf() - context.applicationInfo.run { - sourceDir?.let { apks += it } - splitSourceDirs?.let { apks += it } - } - for (abi in Build.SUPPORTED_ABIS) { - for (apk in apks) { - ZipFile(File(apk), ZipFile.OPEN_READ).use { zipFile -> - val mappedName = System.mapLibraryName(libraryName) - val libraryZipPath = listOf("lib", abi, mappedName).joinToString(File.separator) - val zipEntry = zipFile.getEntry(libraryZipPath) - zipEntry?.let { - Log.d(TAG, "Extracting apk:/$libraryZipPath to ${destination.absolutePath}") - FileOutputStream(destination).use { outStream -> - zipFile.getInputStream(zipEntry).use { inStream -> - inStream.copyTo(outStream, 32 * 1024) - outStream.fd.sync() - } - } - } - return true - } - } - } - return false - } - - @SuppressLint("UnsafeDynamicallyLoadedCode") - fun loadSharedLibrary(context: Context, libraryName: String) { - Log.d(TAG, "Loading library: $libraryName") - try { - System.loadLibrary(libraryName) - return - } catch (_: UnsatisfiedLinkError) { - Log.d(TAG, "Failed to load library, try to extract it from apk") - } - var tempFile: File? = null - try { - tempFile = File.createTempFile("lib", ".so", context.codeCacheDir) - if (extractLibrary(context, libraryName, tempFile)) { - System.load(tempFile.absolutePath) - return - } - } catch (e: Exception) { - throw LoadLibraryException("Failed to load library apk: $libraryName", e) - } finally { - tempFile?.delete() - } - } - } } private fun VpnService.Builder.addAddress(addr: InetNetwork) = addAddress(addr.address, addr.mask) diff --git a/client/android/qt/build.gradle.kts b/client/android/qt/build.gradle.kts index 139adf4f..6b1d3fd1 100644 --- a/client/android/qt/build.gradle.kts +++ b/client/android/qt/build.gradle.kts @@ -21,5 +21,5 @@ android { } dependencies { - implementation(fileTree(mapOf("dir" to "../libs", "include" to listOf("*.jar")))) + api(fileTree(mapOf("dir" to "../libs", "include" to listOf("*.jar")))) } diff --git a/client/android/res/values/libs.xml b/client/android/res/values/libs.xml index fe63866f..3ccf1d80 100644 --- a/client/android/res/values/libs.xml +++ b/client/android/res/values/libs.xml @@ -3,7 +3,6 @@ - diff --git a/client/android/res/values/styles.xml b/client/android/res/values/styles.xml index 9f4201f8..bc67beb9 100644 --- a/client/android/res/values/styles.xml +++ b/client/android/res/values/styles.xml @@ -1,6 +1,9 @@ + #FF0E0E11 diff --git a/client/android/settings.gradle.kts b/client/android/settings.gradle.kts index 5cfc8314..68426ec8 100644 --- a/client/android/settings.gradle.kts +++ b/client/android/settings.gradle.kts @@ -22,7 +22,7 @@ dependencyResolutionManagement { includeBuild("./gradle/plugins") plugins { - id("com.android.settings") version "8.2.0" + id("com.android.settings") version "8.5.2" id("settings-property-delegate") } diff --git a/client/android/src/org/amnezia/vpn/AmneziaActivity.kt b/client/android/src/org/amnezia/vpn/AmneziaActivity.kt index 8a78750b..d5026425 100644 --- a/client/android/src/org/amnezia/vpn/AmneziaActivity.kt +++ b/client/android/src/org/amnezia/vpn/AmneziaActivity.kt @@ -43,6 +43,7 @@ import kotlinx.coroutines.withContext import org.amnezia.vpn.protocol.getStatistics import org.amnezia.vpn.protocol.getStatus import org.amnezia.vpn.qt.QtAndroidController +import org.amnezia.vpn.util.LibraryLoader.loadSharedLibrary import org.amnezia.vpn.util.Log import org.amnezia.vpn.util.Prefs import org.json.JSONException @@ -158,6 +159,11 @@ class AmneziaActivity : QtActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) Log.d(TAG, "Create Amnezia activity: $intent") + loadLibs() + window.apply { + addFlags(LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS) + statusBarColor = getColor(R.color.black) + } mainScope = CoroutineScope(SupervisorJob() + Dispatchers.Main.immediate) val proto = mainScope.async(Dispatchers.IO) { VpnStateStore.getVpnState().vpnProto @@ -175,6 +181,17 @@ class AmneziaActivity : QtActivity() { runBlocking { vpnProto = proto.await() } } + private fun loadLibs() { + listOf( + "rsapss", + "crypto_3", + "ssl_3", + "ssh" + ).forEach { + loadSharedLibrary(this.applicationContext, it) + } + } + private fun registerBroadcastReceivers() { notificationStateReceiver = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { registerBroadcastReceiver( @@ -610,6 +627,14 @@ class AmneziaActivity : QtActivity() { } } + @Suppress("unused") + fun setNavigationBarColor(color: Int) { + Log.v(TAG, "Change navigation bar color: ${"#%08X".format(color)}") + mainScope.launch { + window.navigationBarColor = color + } + } + @Suppress("unused") fun minimizeApp() { Log.v(TAG, "Minimize application") @@ -684,6 +709,17 @@ class AmneziaActivity : QtActivity() { .show() } + @Suppress("unused") + fun requestAuthentication() { + Log.v(TAG, "Request authentication") + mainScope.launch { + qtInitialized.await() + Intent(this@AmneziaActivity, AuthActivity::class.java).also { + startActivity(it) + } + } + } + /** * Utils methods */ diff --git a/client/android/src/org/amnezia/vpn/AmneziaVpnService.kt b/client/android/src/org/amnezia/vpn/AmneziaVpnService.kt index b30f1503..937127ee 100644 --- a/client/android/src/org/amnezia/vpn/AmneziaVpnService.kt +++ b/client/android/src/org/amnezia/vpn/AmneziaVpnService.kt @@ -22,6 +22,7 @@ import androidx.annotation.MainThread import androidx.core.app.ServiceCompat import androidx.core.content.ContextCompat import androidx.core.content.getSystemService +import java.net.UnknownHostException import java.util.concurrent.ConcurrentHashMap import kotlin.LazyThreadSafetyMode.NONE import kotlinx.coroutines.CoroutineExceptionHandler @@ -31,6 +32,7 @@ import kotlinx.coroutines.Job import kotlinx.coroutines.SupervisorJob import kotlinx.coroutines.TimeoutCancellationException import kotlinx.coroutines.cancel +import kotlinx.coroutines.cancelAndJoin import kotlinx.coroutines.delay import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.drop @@ -39,7 +41,6 @@ import kotlinx.coroutines.launch import kotlinx.coroutines.runBlocking import kotlinx.coroutines.withTimeout import org.amnezia.vpn.protocol.BadConfigException -import org.amnezia.vpn.protocol.LoadLibraryException import org.amnezia.vpn.protocol.ProtocolState.CONNECTED import org.amnezia.vpn.protocol.ProtocolState.CONNECTING import org.amnezia.vpn.protocol.ProtocolState.DISCONNECTED @@ -49,6 +50,7 @@ import org.amnezia.vpn.protocol.ProtocolState.UNKNOWN import org.amnezia.vpn.protocol.VpnException import org.amnezia.vpn.protocol.VpnStartException import org.amnezia.vpn.protocol.putStatus +import org.amnezia.vpn.util.LoadLibraryException import org.amnezia.vpn.util.Log import org.amnezia.vpn.util.Prefs import org.amnezia.vpn.util.net.NetworkState @@ -111,6 +113,10 @@ open class AmneziaVpnService : VpnService() { get() = clientMessengers.any { it.value.name == ACTIVITY_MESSENGER_NAME } private val connectionExceptionHandler = CoroutineExceptionHandler { _, e -> + connectionJob?.cancel() + connectionJob = null + disconnectionJob?.cancel() + disconnectionJob = null protocolState.value = DISCONNECTED when (e) { is IllegalArgumentException, @@ -122,6 +128,8 @@ open class AmneziaVpnService : VpnService() { is LoadLibraryException -> onError("${e.message}. Caused: ${e.cause?.message}") + is UnknownHostException -> onError("Unknown host") + else -> throw e } } @@ -531,7 +539,7 @@ open class AmneziaVpnService : VpnService() { protocolState.value = DISCONNECTING disconnectionJob = connectionScope.launch { - connectionJob?.join() + connectionJob?.cancelAndJoin() connectionJob = null vpnProto?.protocol?.stopVpn() diff --git a/client/android/src/org/amnezia/vpn/AuthActivity.kt b/client/android/src/org/amnezia/vpn/AuthActivity.kt new file mode 100644 index 00000000..2593315c --- /dev/null +++ b/client/android/src/org/amnezia/vpn/AuthActivity.kt @@ -0,0 +1,97 @@ +package org.amnezia.vpn + +import android.os.Build +import android.os.Bundle +import androidx.biometric.BiometricManager +import androidx.biometric.BiometricManager.Authenticators.BIOMETRIC_STRONG +import androidx.biometric.BiometricManager.Authenticators.DEVICE_CREDENTIAL +import androidx.biometric.BiometricPrompt +import androidx.biometric.BiometricPrompt.AuthenticationResult +import androidx.core.content.ContextCompat +import androidx.fragment.app.FragmentActivity +import org.amnezia.vpn.qt.QtAndroidController +import org.amnezia.vpn.util.Log + +private const val TAG = "AuthActivity" + +private const val AUTHENTICATORS = BIOMETRIC_STRONG or DEVICE_CREDENTIAL + +class AuthActivity : FragmentActivity() { + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + + val biometricManager = BiometricManager.from(applicationContext) + when (biometricManager.canAuthenticate(AUTHENTICATORS)) { + BiometricManager.BIOMETRIC_SUCCESS -> { + showBiometricPrompt(biometricManager) + return + } + + BiometricManager.BIOMETRIC_STATUS_UNKNOWN -> { + Log.w(TAG, "Unknown biometric status") + showBiometricPrompt(biometricManager) + return + } + + BiometricManager.BIOMETRIC_ERROR_UNSUPPORTED -> { + Log.e(TAG, "The specified options are incompatible with the current Android " + + "version ${Build.VERSION.SDK_INT}") + } + + BiometricManager.BIOMETRIC_ERROR_HW_UNAVAILABLE -> { + Log.w(TAG, "The hardware is unavailable") + } + + BiometricManager.BIOMETRIC_ERROR_NONE_ENROLLED -> { + Log.w(TAG, "No biometric or device credential is enrolled") + } + + BiometricManager.BIOMETRIC_ERROR_NO_HARDWARE -> { + Log.w(TAG, "There is no suitable hardware") + } + + BiometricManager.BIOMETRIC_ERROR_SECURITY_UPDATE_REQUIRED -> { + Log.w(TAG, "A security vulnerability has been discovered with one or " + + "more hardware sensors") + } + } + QtAndroidController.onAuthResult(true) + finish() + } + + private fun showBiometricPrompt(biometricManager: BiometricManager) { + val executor = ContextCompat.getMainExecutor(applicationContext) + val biometricPrompt = BiometricPrompt(this, executor, + object : BiometricPrompt.AuthenticationCallback() { + override fun onAuthenticationSucceeded(result: AuthenticationResult) { + super.onAuthenticationSucceeded(result) + Log.d(TAG, "Authentication succeeded") + QtAndroidController.onAuthResult(true) + finish() + } + + override fun onAuthenticationFailed() { + super.onAuthenticationFailed() + Log.w(TAG, "Authentication failed") + } + + override fun onAuthenticationError(errorCode: Int, errString: CharSequence) { + super.onAuthenticationError(errorCode, errString) + Log.e(TAG, "Authentication error $errorCode: $errString") + QtAndroidController.onAuthResult(false) + finish() + } + }) + + + + val promptInfo = BiometricPrompt.PromptInfo.Builder() + .setAllowedAuthenticators(AUTHENTICATORS) + .setTitle("AmneziaVPN") + .setSubtitle(biometricManager.getStrings(AUTHENTICATORS)?.promptMessage) + .build() + + biometricPrompt.authenticate(promptInfo) + } +} diff --git a/client/android/src/org/amnezia/vpn/AuthHelper.java b/client/android/src/org/amnezia/vpn/AuthHelper.java deleted file mode 100644 index 940d03c2..00000000 --- a/client/android/src/org/amnezia/vpn/AuthHelper.java +++ /dev/null @@ -1,24 +0,0 @@ -package org.amnezia.vpn; - -import android.content.Context; -import android.app.KeyguardManager; -import android.content.Intent; -import org.qtproject.qt.android.bindings.QtActivity; - - -import static android.content.Context.KEYGUARD_SERVICE; - -public class AuthHelper extends QtActivity { - - static final String TAG = "AuthHelper"; - - public static Intent getAuthIntent(Context context) { - KeyguardManager mKeyguardManager = (KeyguardManager)context.getSystemService(KEYGUARD_SERVICE); - if (mKeyguardManager.isDeviceSecure()) { - return mKeyguardManager.createConfirmDeviceCredentialIntent(null, null); - } else { - return null; - } - } - -} diff --git a/client/android/src/org/amnezia/vpn/ImportConfigActivity.kt b/client/android/src/org/amnezia/vpn/ImportConfigActivity.kt index cae7ab75..9faa30d0 100644 --- a/client/android/src/org/amnezia/vpn/ImportConfigActivity.kt +++ b/client/android/src/org/amnezia/vpn/ImportConfigActivity.kt @@ -33,10 +33,10 @@ class ImportConfigActivity : ComponentActivity() { intent?.let(::readConfig) } - override fun onNewIntent(intent: Intent?) { + override fun onNewIntent(intent: Intent) { super.onNewIntent(intent) Log.d(TAG, "onNewIntent: $intent") - intent?.let(::readConfig) + intent.let(::readConfig) } private fun readConfig(intent: Intent) { diff --git a/client/android/src/org/amnezia/vpn/qt/QtAndroidController.kt b/client/android/src/org/amnezia/vpn/qt/QtAndroidController.kt index e382b080..4af138a2 100644 --- a/client/android/src/org/amnezia/vpn/qt/QtAndroidController.kt +++ b/client/android/src/org/amnezia/vpn/qt/QtAndroidController.kt @@ -25,5 +25,7 @@ object QtAndroidController { external fun onConfigImported(data: String) + external fun onAuthResult(result: Boolean) + external fun decodeQrCode(data: String): Boolean } \ No newline at end of file diff --git a/client/android/utils/src/main/kotlin/JsonExt.kt b/client/android/utils/src/main/kotlin/JsonExt.kt new file mode 100644 index 00000000..45c5bacd --- /dev/null +++ b/client/android/utils/src/main/kotlin/JsonExt.kt @@ -0,0 +1,9 @@ +package org.amnezia.vpn.util + +import org.json.JSONArray +import org.json.JSONObject + +inline fun JSONArray.asSequence(): Sequence = + (0..() + context.applicationInfo.run { + sourceDir?.let { apks += it } + splitSourceDirs?.let { apks += it } + } + for (abi in Build.SUPPORTED_ABIS) { + for (apk in apks) { + ZipFile(File(apk), ZipFile.OPEN_READ).use { zipFile -> + val mappedName = System.mapLibraryName(libraryName) + val libraryZipPath = listOf("lib", abi, mappedName).joinToString(File.separator) + val zipEntry = zipFile.getEntry(libraryZipPath) + zipEntry?.let { + Log.d(TAG, "Extracting apk:/$libraryZipPath to ${destination.absolutePath}") + FileOutputStream(destination).use { outStream -> + zipFile.getInputStream(zipEntry).use { inStream -> + inStream.copyTo(outStream, 32 * 1024) + outStream.fd.sync() + } + } + } + return true + } + } + } + return false + } + + @SuppressLint("UnsafeDynamicallyLoadedCode") + fun loadSharedLibrary(context: Context, libraryName: String) { + Log.d(TAG, "Loading library: $libraryName") + try { + System.loadLibrary(libraryName) + return + } catch (_: UnsatisfiedLinkError) { + Log.d(TAG, "Failed to load library, try to extract it from apk") + } + var tempFile: File? = null + try { + tempFile = File.createTempFile("lib", ".so", context.codeCacheDir) + if (extractLibrary(context, libraryName, tempFile)) { + System.load(tempFile.absolutePath) + return + } + } catch (e: Exception) { + throw LoadLibraryException("Failed to load library apk: $libraryName", e) + } finally { + tempFile?.delete() + } + } +} + +class LoadLibraryException(message: String? = null, cause: Throwable? = null) : Exception(message, cause) diff --git a/client/android/utils/src/main/kotlin/net/NetworkState.kt b/client/android/utils/src/main/kotlin/net/NetworkState.kt index 26d23215..b71bf393 100644 --- a/client/android/utils/src/main/kotlin/net/NetworkState.kt +++ b/client/android/utils/src/main/kotlin/net/NetworkState.kt @@ -88,7 +88,7 @@ class NetworkState( if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { connectivityManager.registerBestMatchingNetworkCallback(networkRequest, networkCallback, handler) } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { - val numberAttempts = 3 + val numberAttempts = 300 var attemptCount = 0 while(true) { try { diff --git a/client/android/utils/src/main/kotlin/net/NetworkUtils.kt b/client/android/utils/src/main/kotlin/net/NetworkUtils.kt index b75748be..784aa352 100644 --- a/client/android/utils/src/main/kotlin/net/NetworkUtils.kt +++ b/client/android/utils/src/main/kotlin/net/NetworkUtils.kt @@ -35,7 +35,7 @@ fun getLocalNetworks(context: Context, ipv6: Boolean): List { return emptyList() } -fun parseInetAddress(address: String): InetAddress = parseNumericAddressCompat(address) +fun parseInetAddress(address: String): InetAddress = InetAddress.getByName(address) private val parseNumericAddressCompat: (String) -> InetAddress = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { @@ -60,7 +60,7 @@ private val parseNumericAddressCompat: (String) -> InetAddress = internal fun convertIpv6ToCanonicalForm(ipv6: String): String = ipv6 .replace("((?:(?:^|:)0+\\b){2,}):?(?!\\S*\\b\\1:0+\\b)(\\S*)".toRegex(), "::$2") -internal val InetAddress.ip: String +val InetAddress.ip: String get() = if (this is Inet4Address) { hostAddress!! } else { diff --git a/client/android/wireguard/src/main/kotlin/org/amnezia/vpn/protocol/wireguard/Wireguard.kt b/client/android/wireguard/src/main/kotlin/org/amnezia/vpn/protocol/wireguard/Wireguard.kt index 690510eb..ac11374b 100644 --- a/client/android/wireguard/src/main/kotlin/org/amnezia/vpn/protocol/wireguard/Wireguard.kt +++ b/client/android/wireguard/src/main/kotlin/org/amnezia/vpn/protocol/wireguard/Wireguard.kt @@ -1,54 +1,26 @@ package org.amnezia.vpn.protocol.wireguard import android.net.VpnService.Builder -import java.util.TreeMap +import java.io.IOException +import java.util.Locale +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.delay +import kotlinx.coroutines.withContext import org.amnezia.awg.GoBackend import org.amnezia.vpn.protocol.Protocol import org.amnezia.vpn.protocol.ProtocolState.CONNECTED import org.amnezia.vpn.protocol.ProtocolState.DISCONNECTED import org.amnezia.vpn.protocol.Statistics import org.amnezia.vpn.protocol.VpnStartException +import org.amnezia.vpn.util.LibraryLoader.loadSharedLibrary import org.amnezia.vpn.util.Log +import org.amnezia.vpn.util.asSequence import org.amnezia.vpn.util.net.InetEndpoint import org.amnezia.vpn.util.net.InetNetwork import org.amnezia.vpn.util.net.parseInetAddress +import org.amnezia.vpn.util.optStringOrNull import org.json.JSONObject -/** - * Config example: - * { - * "protocol": "wireguard", - * "description": "Server 1", - * "dns1": "1.1.1.1", - * "dns2": "1.0.0.1", - * "hostName": "100.100.100.0", - * "splitTunnelSites": [ - * ], - * "splitTunnelType": 0, - * "wireguard_config_data": { - * "client_ip": "10.8.1.1", - * "hostName": "100.100.100.0", - * "port": 12345, - * "client_pub_key": "clientPublicKeyBase64", - * "client_priv_key": "privateKeyBase64", - * "psk_key": "presharedKeyBase64", - * "server_pub_key": "publicKeyBase64", - * "config": "[Interface] - * Address = 10.8.1.1/32 - * DNS = 1.1.1.1, 1.0.0.1 - * PrivateKey = privateKeyBase64 - * - * [Peer] - * PublicKey = publicKeyBase64 - * PresharedKey = presharedKeyBase64 - * AllowedIPs = 0.0.0.0/0, ::/0 - * Endpoint = 100.100.100.0:12345 - * PersistentKeepalive = 25 - * " - * } - * } - */ - private const val TAG = "Wireguard" open class Wireguard : Protocol() { @@ -79,67 +51,105 @@ open class Wireguard : Protocol() { if (!isInitialized) loadSharedLibrary(context, "wg-go") } - override fun startVpn(config: JSONObject, vpnBuilder: Builder, protect: (Int) -> Boolean) { + override suspend fun startVpn(config: JSONObject, vpnBuilder: Builder, protect: (Int) -> Boolean) { val wireguardConfig = parseConfig(config) + val startTime = System.currentTimeMillis() start(wireguardConfig, vpnBuilder, protect) + waitForConnection(startTime) state.value = CONNECTED } + private suspend fun waitForConnection(startTime: Long) { + Log.d(TAG, "Waiting for connection") + withContext(Dispatchers.IO) { + val time = String.format(Locale.ROOT,"%.3f", startTime / 1000.0) + try { + delay(1000) + var log = getLogcat(time) + Log.d(TAG, "First waiting log: $log") + // check that there is a connection log, + // to avoid infinite connection + if (!log.contains("Attaching to interface")) { + Log.w(TAG, "Logs do not contain a connection log") + return@withContext + } + while (!log.contains("Received handshake response")) { + delay(1000) + log = getLogcat(time) + } + } catch (e: IOException) { + Log.e(TAG, "Failed to get logcat: $e") + } + } + } + + private fun getLogcat(time: String): String = + ProcessBuilder("logcat", "--buffer=main", "--format=raw", "*:S AmneziaWG/awg0", "-t", time) + .redirectErrorStream(true) + .start() + .inputStream.reader().readText() + protected open fun parseConfig(config: JSONObject): WireguardConfig { - val configDataJson = config.getJSONObject("wireguard_config_data") - val configData = parseConfigData(configDataJson.getString("config")) + val configData = config.getJSONObject("wireguard_config_data") return WireguardConfig.build { - configWireguard(configData, configDataJson) + configWireguard(config, configData) configSplitTunneling(config) configAppSplitTunneling(config) } } - protected fun WireguardConfig.Builder.configWireguard(configData: Map, configDataJson: JSONObject) { - configData["Address"]?.split(",")?.map { address -> + protected fun WireguardConfig.Builder.configWireguard(config: JSONObject, configData: JSONObject) { + configData.getString("client_ip").split(",").map { address -> InetNetwork.parse(address.trim()) - }?.forEach(::addAddress) + }.forEach(::addAddress) - configData["DNS"]?.split(",")?.map { dns -> - parseInetAddress(dns.trim()) - }?.forEach(::addDnsServer) + config.optStringOrNull("dns1")?.let { dns -> + addDnsServer(parseInetAddress(dns.trim())) + } + + config.optStringOrNull("dns2")?.let { dns -> + addDnsServer(parseInetAddress(dns.trim())) + } val defRoutes = hashSetOf( InetNetwork("0.0.0.0", 0), InetNetwork("::", 0) ) val routes = hashSetOf() - configData["AllowedIPs"]?.split(",")?.map { route -> + configData.getJSONArray("allowed_ips").asSequence().map { route -> InetNetwork.parse(route.trim()) - }?.forEach(routes::add) + }.forEach(routes::add) // if the allowed IPs list contains at least one non-default route, disable global split tunneling if (routes.any { it !in defRoutes }) disableSplitTunneling() addRoutes(routes) - configDataJson.optString("mtu").let { mtu -> - if (mtu.isNotEmpty()) { - setMtu(mtu.toInt()) - } else { - configData["MTU"]?.let { setMtu(it.toInt()) } - } + configData.optStringOrNull("mtu")?.let { setMtu(it.toInt()) } + + val host = configData.getString("hostName").let { parseInetAddress(it.trim()) } + val port = configData.getInt("port") + setEndpoint(InetEndpoint(host, port)) + + if (configData.optBoolean("isObfuscationEnabled")) { + setUseProtocolExtension(true) + configExtensionParameters(configData) } - configData["Endpoint"]?.let { setEndpoint(InetEndpoint.parse(it)) } - configData["PersistentKeepalive"]?.let { setPersistentKeepalive(it.toInt()) } - configData["PrivateKey"]?.let { setPrivateKeyHex(it.base64ToHex()) } - configData["PublicKey"]?.let { setPublicKeyHex(it.base64ToHex()) } - configData["PresharedKey"]?.let { setPreSharedKeyHex(it.base64ToHex()) } + configData.optStringOrNull("persistent_keep_alive")?.let { setPersistentKeepalive(it.toInt()) } + configData.getString("client_priv_key").let { setPrivateKeyHex(it.base64ToHex()) } + configData.getString("server_pub_key").let { setPublicKeyHex(it.base64ToHex()) } + configData.optStringOrNull("psk_key")?.let { setPreSharedKeyHex(it.base64ToHex()) } } - protected fun parseConfigData(data: String): Map { - val parsedData = TreeMap(String.CASE_INSENSITIVE_ORDER) - data.lineSequence() - .filter { it.isNotEmpty() && !it.startsWith('[') } - .forEach { line -> - val attr = line.split("=", limit = 2) - parsedData[attr.first().trim()] = attr.last().trim() - } - return parsedData + protected fun WireguardConfig.Builder.configExtensionParameters(configData: JSONObject) { + configData.optStringOrNull("Jc")?.let { setJc(it.toInt()) } + configData.optStringOrNull("Jmin")?.let { setJmin(it.toInt()) } + configData.optStringOrNull("Jmax")?.let { setJmax(it.toInt()) } + configData.optStringOrNull("S1")?.let { setS1(it.toInt()) } + configData.optStringOrNull("S2")?.let { setS2(it.toInt()) } + configData.optStringOrNull("H1")?.let { setH1(it.toLong()) } + configData.optStringOrNull("H2")?.let { setH2(it.toLong()) } + configData.optStringOrNull("H3")?.let { setH3(it.toLong()) } + configData.optStringOrNull("H4")?.let { setH4(it.toLong()) } } private fun start(config: WireguardConfig, vpnBuilder: Builder, protect: (Int) -> Boolean) { diff --git a/client/android/wireguard/src/main/kotlin/org/amnezia/vpn/protocol/wireguard/WireguardConfig.kt b/client/android/wireguard/src/main/kotlin/org/amnezia/vpn/protocol/wireguard/WireguardConfig.kt index 09269f54..7ae3d43b 100644 --- a/client/android/wireguard/src/main/kotlin/org/amnezia/vpn/protocol/wireguard/WireguardConfig.kt +++ b/client/android/wireguard/src/main/kotlin/org/amnezia/vpn/protocol/wireguard/WireguardConfig.kt @@ -1,6 +1,7 @@ package org.amnezia.vpn.protocol.wireguard import android.util.Base64 +import org.amnezia.vpn.protocol.BadConfigException import org.amnezia.vpn.protocol.ProtocolConfig import org.amnezia.vpn.util.net.InetEndpoint @@ -12,7 +13,17 @@ open class WireguardConfig protected constructor( val persistentKeepalive: Int, val publicKeyHex: String, val preSharedKeyHex: String?, - val privateKeyHex: String + val privateKeyHex: String, + val useProtocolExtension: Boolean, + val jc: Int?, + val jmin: Int?, + val jmax: Int?, + val s1: Int?, + val s2: Int?, + val h1: Long?, + val h2: Long?, + val h3: Long?, + val h4: Long? ) : ProtocolConfig(protocolConfigBuilder) { protected constructor(builder: Builder) : this( @@ -21,7 +32,17 @@ open class WireguardConfig protected constructor( builder.persistentKeepalive, builder.publicKeyHex, builder.preSharedKeyHex, - builder.privateKeyHex + builder.privateKeyHex, + builder.useProtocolExtension, + builder.jc, + builder.jmin, + builder.jmax, + builder.s1, + builder.s2, + builder.h1, + builder.h2, + builder.h3, + builder.h4 ) fun toWgUserspaceString(): String = with(StringBuilder()) { @@ -33,6 +54,30 @@ open class WireguardConfig protected constructor( open fun appendDeviceLine(sb: StringBuilder) = with(sb) { appendLine("private_key=$privateKeyHex") + if (useProtocolExtension) { + validateProtocolExtensionParameters() + appendLine("jc=$jc") + appendLine("jmin=$jmin") + appendLine("jmax=$jmax") + appendLine("s1=$s1") + appendLine("s2=$s2") + appendLine("h1=$h1") + appendLine("h2=$h2") + appendLine("h3=$h3") + appendLine("h4=$h4") + } + } + + private fun validateProtocolExtensionParameters() { + if (jc == null) throw BadConfigException("Parameter jc is undefined") + if (jmin == null) throw BadConfigException("Parameter jmin is undefined") + if (jmax == null) throw BadConfigException("Parameter jmax is undefined") + if (s1 == null) throw BadConfigException("Parameter s1 is undefined") + if (s2 == null) throw BadConfigException("Parameter s2 is undefined") + if (h1 == null) throw BadConfigException("Parameter h1 is undefined") + if (h2 == null) throw BadConfigException("Parameter h2 is undefined") + if (h3 == null) throw BadConfigException("Parameter h3 is undefined") + if (h4 == null) throw BadConfigException("Parameter h4 is undefined") } open fun appendPeerLine(sb: StringBuilder) = with(sb) { @@ -65,6 +110,18 @@ open class WireguardConfig protected constructor( override var mtu: Int = WIREGUARD_DEFAULT_MTU + internal var useProtocolExtension: Boolean = false + + internal var jc: Int? = null + internal var jmin: Int? = null + internal var jmax: Int? = null + internal var s1: Int? = null + internal var s2: Int? = null + internal var h1: Long? = null + internal var h2: Long? = null + internal var h3: Long? = null + internal var h4: Long? = null + fun setEndpoint(endpoint: InetEndpoint) = apply { this.endpoint = endpoint } fun setPersistentKeepalive(persistentKeepalive: Int) = apply { this.persistentKeepalive = persistentKeepalive } @@ -75,6 +132,18 @@ open class WireguardConfig protected constructor( fun setPrivateKeyHex(privateKeyHex: String) = apply { this.privateKeyHex = privateKeyHex } + fun setUseProtocolExtension(useProtocolExtension: Boolean) = apply { this.useProtocolExtension = useProtocolExtension } + + fun setJc(jc: Int) = apply { this.jc = jc } + fun setJmin(jmin: Int) = apply { this.jmin = jmin } + fun setJmax(jmax: Int) = apply { this.jmax = jmax } + fun setS1(s1: Int) = apply { this.s1 = s1 } + fun setS2(s2: Int) = apply { this.s2 = s2 } + fun setH1(h1: Long) = apply { this.h1 = h1 } + fun setH2(h2: Long) = apply { this.h2 = h2 } + fun setH3(h3: Long) = apply { this.h3 = h3 } + fun setH4(h4: Long) = apply { this.h4 = h4 } + override fun build(): WireguardConfig = configBuild().run { WireguardConfig(this@Builder) } } diff --git a/client/android/xray/src/main/kotlin/Xray.kt b/client/android/xray/src/main/kotlin/Xray.kt index 3e5f9f7c..6e37c9c2 100644 --- a/client/android/xray/src/main/kotlin/Xray.kt +++ b/client/android/xray/src/main/kotlin/Xray.kt @@ -17,72 +17,10 @@ import org.amnezia.vpn.protocol.xray.libXray.Logger import org.amnezia.vpn.protocol.xray.libXray.Tun2SocksConfig import org.amnezia.vpn.util.Log import org.amnezia.vpn.util.net.InetNetwork +import org.amnezia.vpn.util.net.ip import org.amnezia.vpn.util.net.parseInetAddress import org.json.JSONObject -/** - * Config example: - * { - * "appSplitTunnelType": 0, - * "config_version": 0, - * "description": "Server 1", - * "dns1": "1.1.1.1", - * "dns2": "1.0.0.1", - * "hostName": "100.100.100.0", - * "protocol": "xray", - * "splitTunnelApps": [], - * "splitTunnelSites": [], - * "splitTunnelType": 0, - * "xray_config_data": { - * "inbounds": [ - * { - * "listen": "127.0.0.1", - * "port": 8080, - * "protocol": "socks", - * "settings": { - * "udp": true - * } - * } - * ], - * "log": { - * "loglevel": "error" - * }, - * "outbounds": [ - * { - * "protocol": "vless", - * "settings": { - * "vnext": [ - * { - * "address": "100.100.100.0", - * "port": 443, - * "users": [ - * { - * "encryption": "none", - * "flow": "xtls-rprx-vision", - * "id": "id" - * } - * ] - * } - * ] - * }, - * "streamSettings": { - * "network": "tcp", - * "realitySettings": { - * "fingerprint": "chrome", - * "publicKey": "publicKey", - * "serverName": "google.com", - * "shortId": "id", - * "spiderX": "" - * }, - * "security": "reality" - * } - * } - * ] - * } - * } - * - */ - private const val TAG = "Xray" private const val LIBXRAY_TAG = "libXray" @@ -109,7 +47,7 @@ class Xray : Protocol() { } } - override fun startVpn(config: JSONObject, vpnBuilder: Builder, protect: (Int) -> Boolean) { + override suspend fun startVpn(config: JSONObject, vpnBuilder: Builder, protect: (Int) -> Boolean) { if (isRunning) { Log.w(TAG, "XRay already running") return @@ -124,7 +62,15 @@ class Xray : Protocol() { .put("loglevel", "warning") .put("access", "none") // disable access log - start(xrayConfig, xrayJsonConfig.toString(), vpnBuilder, protect) + var xrayJsonConfigString = xrayJsonConfig.toString() + config.getString("hostName").let { hostName -> + val ipAddress = parseInetAddress(hostName).ip + if (hostName != ipAddress) { + xrayJsonConfigString = xrayJsonConfigString.replace(hostName, ipAddress) + } + } + + start(xrayConfig, xrayJsonConfigString, vpnBuilder, protect) state.value = CONNECTED isRunning = true } diff --git a/client/cmake/3rdparty.cmake b/client/cmake/3rdparty.cmake index ec544764..2b5036c5 100644 --- a/client/cmake/3rdparty.cmake +++ b/client/cmake/3rdparty.cmake @@ -2,15 +2,11 @@ set(CLIENT_ROOT_DIR ${CMAKE_CURRENT_LIST_DIR}/..) set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/Modules;${CMAKE_MODULE_PATH}") -if(NOT IOS AND NOT ANDROID) - include(${CLIENT_ROOT_DIR}/3rd/SingleApplication/singleapplication.cmake) -endif() - add_subdirectory(${CLIENT_ROOT_DIR}/3rd/SortFilterProxyModel) set(LIBS ${LIBS} SortFilterProxyModel) +include(${CLIENT_ROOT_DIR}/cmake/QSimpleCrypto.cmake) include(${CLIENT_ROOT_DIR}/3rd/qrcodegen/qrcodegen.cmake) -include(${CLIENT_ROOT_DIR}/3rd/QSimpleCrypto/QSimpleCrypto.cmake) set(LIBSSH_ROOT_DIR "${CLIENT_ROOT_DIR}/3rd-prebuilt/3rd-prebuilt/libssh/") set(OPENSSL_ROOT_DIR "${CLIENT_ROOT_DIR}/3rd-prebuilt/3rd-prebuilt/openssl/") @@ -83,13 +79,12 @@ set(BUILD_WITH_QT6 ON) add_subdirectory(${CLIENT_ROOT_DIR}/3rd/qtkeychain) set(LIBS ${LIBS} qt6keychain) - include_directories( ${OPENSSL_INCLUDE_DIR} ${LIBSSH_INCLUDE_DIR}/include ${LIBSSH_ROOT_DIR}/include ${CLIENT_ROOT_DIR}/3rd/libssh/include - ${CLIENT_ROOT_DIR}/3rd/QSimpleCrypto/include + ${CLIENT_ROOT_DIR}/3rd/QSimpleCrypto/src/include ${CLIENT_ROOT_DIR}/3rd/qtkeychain/qtkeychain ${CMAKE_CURRENT_BINARY_DIR}/3rd/qtkeychain ${CMAKE_CURRENT_BINARY_DIR}/3rd/libssh/include diff --git a/client/cmake/QSimpleCrypto.cmake b/client/cmake/QSimpleCrypto.cmake new file mode 100644 index 00000000..ec43cb83 --- /dev/null +++ b/client/cmake/QSimpleCrypto.cmake @@ -0,0 +1,21 @@ +set(CLIENT_ROOT_DIR ${CMAKE_CURRENT_LIST_DIR}/..) +set(QSIMPLECRYPTO_DIR ${CLIENT_ROOT_DIR}/3rd/QSimpleCrypto/src) + +include_directories(${QSIMPLECRYPTO_DIR}) + +set(HEADERS ${HEADERS} + ${QSIMPLECRYPTO_DIR}/include/QAead.h + ${QSIMPLECRYPTO_DIR}/include/QBlockCipher.h + ${QSIMPLECRYPTO_DIR}/include/QRsa.h + ${QSIMPLECRYPTO_DIR}/include/QSimpleCrypto_global.h + ${QSIMPLECRYPTO_DIR}/include/QX509.h + ${QSIMPLECRYPTO_DIR}/include/QX509Store.h +) + +set(SOURCES ${SOURCES} + ${QSIMPLECRYPTO_DIR}/sources/QAead.cpp + ${QSIMPLECRYPTO_DIR}/sources/QBlockCipher.cpp + ${QSIMPLECRYPTO_DIR}/sources/QRsa.cpp + ${QSIMPLECRYPTO_DIR}/sources/QX509.cpp + ${QSIMPLECRYPTO_DIR}/sources/QX509Store.cpp +) diff --git a/client/cmake/android.cmake b/client/cmake/android.cmake index 13c357bd..c96d9ab8 100644 --- a/client/cmake/android.cmake +++ b/client/cmake/android.cmake @@ -27,7 +27,6 @@ link_directories(${CMAKE_CURRENT_SOURCE_DIR}/platforms/android) set(HEADERS ${HEADERS} ${CMAKE_CURRENT_SOURCE_DIR}/platforms/android/android_controller.h ${CMAKE_CURRENT_SOURCE_DIR}/platforms/android/android_utils.h - ${CMAKE_CURRENT_SOURCE_DIR}/platforms/android/authResultReceiver.h ${CMAKE_CURRENT_SOURCE_DIR}/protocols/android_vpnprotocol.h ${CMAKE_CURRENT_SOURCE_DIR}/core/installedAppsImageProvider.h ) @@ -35,7 +34,6 @@ set(HEADERS ${HEADERS} set(SOURCES ${SOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/platforms/android/android_controller.cpp ${CMAKE_CURRENT_SOURCE_DIR}/platforms/android/android_utils.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/platforms/android/authResultReceiver.cpp ${CMAKE_CURRENT_SOURCE_DIR}/protocols/android_vpnprotocol.cpp ${CMAKE_CURRENT_SOURCE_DIR}/core/installedAppsImageProvider.cpp ) diff --git a/client/configurators/wireguard_configurator.cpp b/client/configurators/wireguard_configurator.cpp index f7faaa52..3f96e74c 100644 --- a/client/configurators/wireguard_configurator.cpp +++ b/client/configurators/wireguard_configurator.cpp @@ -95,6 +95,18 @@ WireguardConfigurator::ConnectionData WireguardConfigurator::prepareWireguardCon stdOut.replace("/32", ""); QStringList ips = stdOut.split("\n", Qt::SkipEmptyParts); + // remove extra IPs from each line for case when user manually edited the wg0.conf + // and added there more IPs for route his itnernal networks, like: + // ... + // AllowedIPs = 10.8.1.6/32, 192.168.1.0/24, 192.168.2.0/24, ... + // ... + // without this code - next IP would be 1 if last item in 'ips' has format above + QStringList vpnIps; + for (const auto &ip : ips) { + vpnIps.append(ip.split(",", Qt::SkipEmptyParts).first().trimmed()); + } + ips = vpnIps; + // Calc next IP address if (ips.isEmpty()) { nextIpNumber = "2"; @@ -187,6 +199,10 @@ QString WireguardConfigurator::createConfig(const ServerCredentials &credentials jConfig[config_key::server_pub_key] = connData.serverPubKey; jConfig[config_key::mtu] = wireguarConfig.value(config_key::mtu).toString(protocols::wireguard::defaultMtu); + jConfig[config_key::persistent_keep_alive] = "25"; + QJsonArray allowedIps { "0.0.0.0/0", "::/0" }; + jConfig[config_key::allowed_ips] = allowedIps; + jConfig[config_key::clientId] = connData.clientPubKey; return QJsonDocument(jConfig).toJson(); diff --git a/client/core/controllers/apiController.cpp b/client/core/controllers/apiController.cpp index 35b459be..5cdaa7ae 100644 --- a/client/core/controllers/apiController.cpp +++ b/client/core/controllers/apiController.cpp @@ -5,8 +5,12 @@ #include #include +#include "QBlockCipher.h" +#include "QRsa.h" + #include "amnezia_application.h" #include "configurators/wireguard_configurator.h" +#include "core/enums/apiEnums.h" #include "version.h" namespace @@ -25,25 +29,75 @@ namespace constexpr char uuid[] = "installation_uuid"; constexpr char osVersion[] = "os_version"; constexpr char appVersion[] = "app_version"; + + constexpr char userCountryCode[] = "user_country_code"; + constexpr char serverCountryCode[] = "server_country_code"; + constexpr char serviceType[] = "service_type"; + + constexpr char aesKey[] = "aes_key"; + constexpr char aesIv[] = "aes_iv"; + constexpr char aesSalt[] = "aes_salt"; + + constexpr char apiPayload[] = "api_payload"; + constexpr char keyPayload[] = "key_payload"; + } + + const QStringList proxyStorageUrl = { "" }; + + ErrorCode checkErrors(const QList &sslErrors, QNetworkReply *reply) + { + if (!sslErrors.empty()) { + qDebug().noquote() << sslErrors; + return ErrorCode::ApiConfigSslError; + } else if (reply->error() == QNetworkReply::NoError) { + return ErrorCode::NoError; + } else if (reply->error() == QNetworkReply::NetworkError::OperationCanceledError + || reply->error() == QNetworkReply::NetworkError::TimeoutError) { + return ErrorCode::ApiConfigTimeoutError; + } else { + QString err = reply->errorString(); + qDebug() << QString::fromUtf8(reply->readAll()); + qDebug() << reply->error(); + qDebug() << err; + qDebug() << reply->attribute(QNetworkRequest::HttpStatusCodeAttribute); + return ErrorCode::ApiConfigDownloadError; + } } } -ApiController::ApiController(QObject *parent) : QObject(parent) +ApiController::ApiController(const QString &gatewayEndpoint, bool isDevEnvironment, QObject *parent) + : QObject(parent), m_gatewayEndpoint(gatewayEndpoint), m_isDevEnvironment(isDevEnvironment) { } -void ApiController::processApiConfig(const QString &protocol, const ApiController::ApiPayloadData &apiPayloadData, QString &config) +void ApiController::fillServerConfig(const QString &protocol, const ApiController::ApiPayloadData &apiPayloadData, + const QByteArray &apiResponseBody, QJsonObject &serverConfig) { - if (protocol == configKey::cloak) { - config.replace("", "\n"); - config.replace("$OPENVPN_PRIV_KEY", apiPayloadData.certRequest.privKey); + QString data = QJsonDocument::fromJson(apiResponseBody).object().value(config_key::config).toString(); + + data.replace("vpn://", ""); + QByteArray ba = QByteArray::fromBase64(data.toUtf8(), QByteArray::Base64UrlEncoding | QByteArray::OmitTrailingEquals); + + if (ba.isEmpty()) { + emit errorOccurred(ErrorCode::ApiConfigEmptyError); return; + } + + QByteArray ba_uncompressed = qUncompress(ba); + if (!ba_uncompressed.isEmpty()) { + ba = ba_uncompressed; + } + + QString configStr = ba; + if (protocol == configKey::cloak) { + configStr.replace("", "\n"); + configStr.replace("$OPENVPN_PRIV_KEY", apiPayloadData.certRequest.privKey); } else if (protocol == configKey::awg) { - config.replace("$WIREGUARD_CLIENT_PRIVATE_KEY", apiPayloadData.wireGuardClientPrivKey); - auto serverConfig = QJsonDocument::fromJson(config.toUtf8()).object(); + configStr.replace("$WIREGUARD_CLIENT_PRIVATE_KEY", apiPayloadData.wireGuardClientPrivKey); + auto serverConfig = QJsonDocument::fromJson(configStr.toUtf8()).object(); auto containers = serverConfig.value(config_key::containers).toArray(); if (containers.isEmpty()) { - return; + return; // todo process error } auto container = containers.at(0).toObject(); QString containerName = ContainerProps::containerTypeToString(DockerContainer::Awg); @@ -61,11 +115,75 @@ void ApiController::processApiConfig(const QString &protocol, const ApiControlle container[containerName] = containerConfig; containers.replace(0, container); serverConfig[config_key::containers] = containers; - config = QString(QJsonDocument(serverConfig).toJson()); + configStr = QString(QJsonDocument(serverConfig).toJson()); } + + QJsonObject apiConfig = QJsonDocument::fromJson(configStr.toUtf8()).object(); + serverConfig[config_key::dns1] = apiConfig.value(config_key::dns1); + serverConfig[config_key::dns2] = apiConfig.value(config_key::dns2); + serverConfig[config_key::containers] = apiConfig.value(config_key::containers); + serverConfig[config_key::hostName] = apiConfig.value(config_key::hostName); + + if (apiConfig.value(config_key::configVersion).toInt() == ApiConfigSources::AmneziaGateway) { + serverConfig[config_key::configVersion] = apiConfig.value(config_key::configVersion); + serverConfig[config_key::description] = apiConfig.value(config_key::description); + serverConfig[config_key::name] = apiConfig.value(config_key::name); + } + + auto defaultContainer = apiConfig.value(config_key::defaultContainer).toString(); + serverConfig[config_key::defaultContainer] = defaultContainer; + return; } +QStringList ApiController::getProxyUrls() +{ + QNetworkRequest request; + request.setTransferTimeout(7000); + request.setHeader(QNetworkRequest::ContentTypeHeader, "application/json"); + + QEventLoop wait; + QList sslErrors; + QNetworkReply *reply; + + for (const auto &proxyStorageUrl : proxyStorageUrl) { + request.setUrl(proxyStorageUrl); + reply = amnApp->manager()->get(request); + + connect(reply, &QNetworkReply::finished, &wait, &QEventLoop::quit); + connect(reply, &QNetworkReply::sslErrors, [this, &sslErrors](const QList &errors) { sslErrors = errors; }); + wait.exec(); + + if (reply->error() == QNetworkReply::NetworkError::NoError) { + break; + } + reply->deleteLater(); + } + + auto encryptedResponseBody = reply->readAll(); + reply->deleteLater(); + + EVP_PKEY *privateKey = nullptr; + QByteArray responseBody; + try { + QByteArray key = PROD_PROXY_STORAGE_KEY; + QSimpleCrypto::QRsa rsa; + privateKey = rsa.getPrivateKeyFromByteArray(key, ""); + responseBody = rsa.decrypt(encryptedResponseBody, privateKey, RSA_PKCS1_PADDING); + } catch (...) { + qCritical() << "error loading private key from environment variables or decrypting payload"; + return {}; + } + + auto endpointsArray = QJsonDocument::fromJson(responseBody).array(); + + QStringList endpoints; + for (const auto &endpoint : endpointsArray) { + endpoints.push_back(endpoint.toString()); + } + return endpoints; +} + ApiController::ApiPayloadData ApiController::generateApiPayloadData(const QString &protocol) { ApiController::ApiPayloadData apiPayload; @@ -101,8 +219,6 @@ void ApiController::updateServerConfigFromApi(const QString &installationUuid, c QThread::msleep(10); #endif - auto containerConfig = serverConfig.value(config_key::containers).toArray(); - if (serverConfig.value(config_key::configVersion).toInt()) { QNetworkRequest request; request.setTransferTimeout(7000); @@ -120,39 +236,13 @@ void ApiController::updateServerConfigFromApi(const QString &installationUuid, c QByteArray requestBody = QJsonDocument(apiPayload).toJson(); - QNetworkReply *reply = amnApp->manager()->post(request, requestBody); // ?? + QNetworkReply *reply = amnApp->manager()->post(request, requestBody); QObject::connect(reply, &QNetworkReply::finished, [this, reply, protocol, apiPayloadData, serverIndex, serverConfig]() mutable { if (reply->error() == QNetworkReply::NoError) { - QString contents = QString::fromUtf8(reply->readAll()); - QString data = QJsonDocument::fromJson(contents.toUtf8()).object().value(config_key::config).toString(); - - data.replace("vpn://", ""); - QByteArray ba = QByteArray::fromBase64(data.toUtf8(), QByteArray::Base64UrlEncoding | QByteArray::OmitTrailingEquals); - - if (ba.isEmpty()) { - emit errorOccurred(ErrorCode::ApiConfigEmptyError); - return; - } - - QByteArray ba_uncompressed = qUncompress(ba); - if (!ba_uncompressed.isEmpty()) { - ba = ba_uncompressed; - } - - QString configStr = ba; - processApiConfig(protocol, apiPayloadData, configStr); - - QJsonObject apiConfig = QJsonDocument::fromJson(configStr.toUtf8()).object(); - serverConfig[config_key::dns1] = apiConfig.value(config_key::dns1); - serverConfig[config_key::dns2] = apiConfig.value(config_key::dns2); - serverConfig[config_key::containers] = apiConfig.value(config_key::containers); - serverConfig[config_key::hostName] = apiConfig.value(config_key::hostName); - - auto defaultContainer = apiConfig.value(config_key::defaultContainer).toString(); - serverConfig[config_key::defaultContainer] = defaultContainer; - - emit configUpdated(true, serverConfig, serverIndex); + auto apiResponseBody = reply->readAll(); + fillServerConfig(protocol, apiPayloadData, apiResponseBody, serverConfig); + emit finished(serverConfig, serverIndex); } else { if (reply->error() == QNetworkReply::NetworkError::OperationCanceledError || reply->error() == QNetworkReply::NetworkError::TimeoutError) { @@ -178,3 +268,156 @@ void ApiController::updateServerConfigFromApi(const QString &installationUuid, c }); } } + +ErrorCode ApiController::getServicesList(QByteArray &responseBody) +{ +#ifdef Q_OS_IOS + IosController::Instance()->requestInetAccess(); + QThread::msleep(10); +#endif + + QNetworkRequest request; + request.setTransferTimeout(7000); + request.setHeader(QNetworkRequest::ContentTypeHeader, "application/json"); + + request.setUrl(QString("%1v1/services").arg(m_gatewayEndpoint)); + + QNetworkReply *reply; + reply = amnApp->manager()->get(request); + + QEventLoop wait; + QObject::connect(reply, &QNetworkReply::finished, &wait, &QEventLoop::quit); + + QList sslErrors; + connect(reply, &QNetworkReply::sslErrors, [this, &sslErrors](const QList &errors) { sslErrors = errors; }); + wait.exec(); + + if (reply->error() == QNetworkReply::NetworkError::TimeoutError || reply->error() == QNetworkReply::NetworkError::OperationCanceledError) { + m_proxyUrls = getProxyUrls(); + for (const QString &proxyUrl : m_proxyUrls) { + request.setUrl(QString("%1v1/services").arg(proxyUrl)); + reply = amnApp->manager()->get(request); + + QObject::connect(reply, &QNetworkReply::finished, &wait, &QEventLoop::quit); + connect(reply, &QNetworkReply::sslErrors, [this, &sslErrors](const QList &errors) { sslErrors = errors; }); + wait.exec(); + if (reply->error() != QNetworkReply::NetworkError::TimeoutError + && reply->error() != QNetworkReply::NetworkError::OperationCanceledError) { + break; + } + reply->deleteLater(); + } + } + + responseBody = reply->readAll(); + auto errorCode = checkErrors(sslErrors, reply); + reply->deleteLater(); + return errorCode; +} + +ErrorCode ApiController::getConfigForService(const QString &installationUuid, const QString &userCountryCode, const QString &serviceType, + const QString &protocol, const QString &serverCountryCode, QJsonObject &serverConfig) +{ +#ifdef Q_OS_IOS + IosController::Instance()->requestInetAccess(); + QThread::msleep(10); +#endif + + QNetworkAccessManager manager; + QNetworkRequest request; + request.setTransferTimeout(7000); + request.setHeader(QNetworkRequest::ContentTypeHeader, "application/json"); + + request.setUrl(QString("%1v1/config").arg(m_gatewayEndpoint)); + + ApiPayloadData apiPayloadData = generateApiPayloadData(protocol); + + QJsonObject apiPayload = fillApiPayload(protocol, apiPayloadData); + apiPayload[configKey::userCountryCode] = userCountryCode; + if (!serverCountryCode.isEmpty()) { + apiPayload[configKey::serverCountryCode] = serverCountryCode; + } + apiPayload[configKey::serviceType] = serviceType; + apiPayload[configKey::uuid] = installationUuid; + + QSimpleCrypto::QBlockCipher blockCipher; + QByteArray key = blockCipher.generatePrivateSalt(32); + QByteArray iv = blockCipher.generatePrivateSalt(32); + QByteArray salt = blockCipher.generatePrivateSalt(8); + + QJsonObject keyPayload; + keyPayload[configKey::aesKey] = QString(key.toBase64()); + keyPayload[configKey::aesIv] = QString(iv.toBase64()); + keyPayload[configKey::aesSalt] = QString(salt.toBase64()); + + QByteArray encryptedKeyPayload; + QByteArray encryptedApiPayload; + try { + QSimpleCrypto::QRsa rsa; + + EVP_PKEY *publicKey = nullptr; + try { + QByteArray rsaKey = m_isDevEnvironment ? DEV_AGW_PUBLIC_KEY : PROD_AGW_PUBLIC_KEY; + QSimpleCrypto::QRsa rsa; + publicKey = rsa.getPublicKeyFromByteArray(rsaKey); + } catch (...) { + qCritical() << "error loading public key from environment variables"; + return ErrorCode::ApiMissingAgwPublicKey; + } + + encryptedKeyPayload = rsa.encrypt(QJsonDocument(keyPayload).toJson(), publicKey, RSA_PKCS1_PADDING); + EVP_PKEY_free(publicKey); + + encryptedApiPayload = blockCipher.encryptAesBlockCipher(QJsonDocument(apiPayload).toJson(), key, iv, "", salt); + } catch (...) { // todo change error handling in QSimpleCrypto? + qCritical() << "error when encrypting the request body"; + } + + QJsonObject requestBody; + requestBody[configKey::keyPayload] = QString(encryptedKeyPayload.toBase64()); + requestBody[configKey::apiPayload] = QString(encryptedApiPayload.toBase64()); + + QNetworkReply *reply = manager.post(request, QJsonDocument(requestBody).toJson()); + + QEventLoop wait; + connect(reply, &QNetworkReply::finished, &wait, &QEventLoop::quit); + + QList sslErrors; + connect(reply, &QNetworkReply::sslErrors, [this, &sslErrors](const QList &errors) { sslErrors = errors; }); + wait.exec(); + + if (reply->error() == QNetworkReply::NetworkError::TimeoutError || reply->error() == QNetworkReply::NetworkError::OperationCanceledError) { + if (m_proxyUrls.isEmpty()) { + m_proxyUrls = getProxyUrls(); + } + for (const QString &proxyUrl : m_proxyUrls) { + request.setUrl(QString("%1v1/config").arg(proxyUrl)); + reply = manager.post(request, QJsonDocument(requestBody).toJson()); + + QObject::connect(reply, &QNetworkReply::finished, &wait, &QEventLoop::quit); + connect(reply, &QNetworkReply::sslErrors, [this, &sslErrors](const QList &errors) { sslErrors = errors; }); + wait.exec(); + if (reply->error() != QNetworkReply::NetworkError::TimeoutError + && reply->error() != QNetworkReply::NetworkError::OperationCanceledError) { + break; + } + reply->deleteLater(); + } + } + + auto errorCode = checkErrors(sslErrors, reply); + if (errorCode) { + return errorCode; + } + + auto encryptedResponseBody = reply->readAll(); + reply->deleteLater(); + try { + auto responseBody = blockCipher.decryptAesBlockCipher(encryptedResponseBody, key, iv, "", salt); + fillServerConfig(protocol, apiPayloadData, responseBody, serverConfig); + } catch (...) { // todo change error handling in QSimpleCrypto? + qCritical() << "error when decrypting the request body"; + } + + return errorCode; +} diff --git a/client/core/controllers/apiController.h b/client/core/controllers/apiController.h index cc5d9f31..1f811498 100644 --- a/client/core/controllers/apiController.h +++ b/client/core/controllers/apiController.h @@ -14,14 +14,18 @@ class ApiController : public QObject Q_OBJECT public: - explicit ApiController(QObject *parent = nullptr); + explicit ApiController(const QString &gatewayEndpoint, bool isDevEnvironment, QObject *parent = nullptr); public slots: void updateServerConfigFromApi(const QString &installationUuid, const int serverIndex, QJsonObject serverConfig); + ErrorCode getServicesList(QByteArray &responseBody); + ErrorCode getConfigForService(const QString &installationUuid, const QString &userCountryCode, const QString &serviceType, + const QString &protocol, const QString &serverCountryCode, QJsonObject &serverConfig); + signals: void errorOccurred(ErrorCode errorCode); - void configUpdated(const bool updateConfig, const QJsonObject &config, const int serverIndex); + void finished(const QJsonObject &config, const int serverIndex); private: struct ApiPayloadData @@ -34,7 +38,13 @@ private: ApiPayloadData generateApiPayloadData(const QString &protocol); QJsonObject fillApiPayload(const QString &protocol, const ApiController::ApiPayloadData &apiPayloadData); - void processApiConfig(const QString &protocol, const ApiController::ApiPayloadData &apiPayloadData, QString &config); + void fillServerConfig(const QString &protocol, const ApiController::ApiPayloadData &apiPayloadData, const QByteArray &apiResponseBody, + QJsonObject &serverConfig); + QStringList getProxyUrls(); + + QString m_gatewayEndpoint; + QStringList m_proxyUrls; + bool m_isDevEnvironment = false; }; #endif // APICONTROLLER_H diff --git a/client/core/controllers/serverController.cpp b/client/core/controllers/serverController.cpp index 233d66d4..b6795a01 100644 --- a/client/core/controllers/serverController.cpp +++ b/client/core/controllers/serverController.cpp @@ -83,7 +83,6 @@ ErrorCode ServerController::runScript(const ServerCredentials &credentials, QStr } qDebug().noquote() << lineToExec; - Logger::appendSshLog("Run command:" + lineToExec); error = m_sshClient.executeCommand(lineToExec, cbReadStdOut, cbReadStdErr); if (error != ErrorCode::NoError) { @@ -100,13 +99,13 @@ ErrorCode ServerController::runContainerScript(const ServerCredentials &credenti const std::function &cbReadStdErr) { QString fileName = "/opt/amnezia/" + Utils::getRandomString(16) + ".sh"; - Logger::appendSshLog("Run container script for " + ContainerProps::containerToString(container) + ":\n" + script); ErrorCode e = uploadTextFileToContainer(container, credentials, script, fileName); if (e) return e; - QString runner = QString("sudo docker exec -i $CONTAINER_NAME %2 %1 ").arg(fileName, (container == DockerContainer::Socks5Proxy ? "sh" : "bash")); + QString runner = + QString("sudo docker exec -i $CONTAINER_NAME %2 %1 ").arg(fileName, (container == DockerContainer::Socks5Proxy ? "sh" : "bash")); e = runScript(credentials, replaceVars(runner, genVarsForScript(credentials, container)), cbReadStdOut, cbReadStdErr); QString remover = QString("sudo docker exec -i $CONTAINER_NAME rm %1 ").arg(fileName); @@ -426,7 +425,7 @@ ErrorCode ServerController::buildContainerWorker(const ServerCredentials &creden if (errorCode) return errorCode; - errorCode = uploadFileToHost(credentials, amnezia::scriptData(ProtocolScriptType::dockerfile, container).toUtf8(),dockerFilePath); + errorCode = uploadFileToHost(credentials, amnezia::scriptData(ProtocolScriptType::dockerfile, container).toUtf8(), dockerFilePath); if (errorCode) return errorCode; @@ -437,9 +436,10 @@ ErrorCode ServerController::buildContainerWorker(const ServerCredentials &creden return ErrorCode::NoError; }; - errorCode = runScript(credentials, - replaceVars(amnezia::scriptData(SharedScriptType::build_container), genVarsForScript(credentials, container, config)), - cbReadStdOut); + errorCode = + runScript(credentials, + replaceVars(amnezia::scriptData(SharedScriptType::build_container), genVarsForScript(credentials, container, config)), + cbReadStdOut); if (errorCode) return errorCode; @@ -621,13 +621,15 @@ ServerController::Vars ServerController::genVarsForScript(const ServerCredential // Socks5 proxy vars vars.append({ { "$SOCKS5_PROXY_PORT", socks5ProxyConfig.value(config_key::port).toString(protocols::socks5Proxy::defaultPort) } }); - auto username = socks5ProxyConfig.value(config_key:: userName).toString(); + auto username = socks5ProxyConfig.value(config_key::userName).toString(); auto password = socks5ProxyConfig.value(config_key::password).toString(); QString socks5user = (!username.isEmpty() && !password.isEmpty()) ? QString("users %1:CL:%2").arg(username, password) : ""; - vars.append({ { "$SOCKS5_USER", socks5user } }); - vars.append({ { "$SOCKS5_AUTH_TYPE", socks5user.isEmpty() ? "none" : "strong" } }); + vars.append({ { "$SOCKS5_USER", socks5user } }); + vars.append({ { "$SOCKS5_AUTH_TYPE", socks5user.isEmpty() ? "none" : "strong" } }); - QString serverIp = NetworkUtilities::getIPAddress(credentials.hostName); + QString serverIp = (container != DockerContainer::Awg && container != DockerContainer::WireGuard && container != DockerContainer::Xray) + ? NetworkUtilities::getIPAddress(credentials.hostName) + : credentials.hostName; if (!serverIp.isEmpty()) { vars.append({ { "$SERVER_IP_ADDRESS", serverIp } }); } else { @@ -713,7 +715,8 @@ ErrorCode ServerController::isServerPortBusy(const ServerCredentials &credential udpProtoScript.append("' | grep -i udp"); tcpProtoScript.append(" | grep LISTEN"); - ErrorCode errorCode = runScript(credentials, replaceVars(tcpProtoScript, genVarsForScript(credentials, container)), cbReadStdOut, cbReadStdErr); + ErrorCode errorCode = + runScript(credentials, replaceVars(tcpProtoScript, genVarsForScript(credentials, container)), cbReadStdOut, cbReadStdErr); if (errorCode != ErrorCode::NoError) { return errorCode; } diff --git a/client/core/controllers/vpnConfigurationController.cpp b/client/core/controllers/vpnConfigurationController.cpp index 818cf57e..52f42c42 100644 --- a/client/core/controllers/vpnConfigurationController.cpp +++ b/client/core/controllers/vpnConfigurationController.cpp @@ -100,7 +100,13 @@ QJsonObject VpnConfigurationsController::createVpnConfiguration(const QPairprocessConfigWithLocalSettings(dns, isApiConfig, protocolConfigString); QJsonObject vpnConfigData = QJsonDocument::fromJson(protocolConfigString.toUtf8()).object(); - vpnConfigData = QJsonDocument::fromJson(protocolConfigString.toUtf8()).object(); + if (container == DockerContainer::Awg || container == DockerContainer::WireGuard) { + // add mtu for old configs + if (vpnConfigData[config_key::mtu].toString().isEmpty()) { + vpnConfigData[config_key::mtu] = container == DockerContainer::Awg ? protocols::awg::defaultMtu : protocols::wireguard::defaultMtu; + } + } + vpnConfiguration.insert(ProtocolProps::key_proto_config_data(proto), vpnConfigData); } diff --git a/client/core/defs.h b/client/core/defs.h index a441ee1c..802eca45 100644 --- a/client/core/defs.h +++ b/client/core/defs.h @@ -96,6 +96,7 @@ namespace amnezia // import and install errors ImportInvalidConfigError = 900, + ImportOpenConfigError = 901, // Android errors AndroidError = 1000, @@ -106,6 +107,7 @@ namespace amnezia ApiConfigEmptyError = 1102, ApiConfigTimeoutError = 1103, ApiConfigSslError = 1104, + ApiMissingAgwPublicKey = 1105, // QFile errors OpenError = 1200, diff --git a/client/core/enums/apiEnums.h b/client/core/enums/apiEnums.h new file mode 100644 index 00000000..1f050007 --- /dev/null +++ b/client/core/enums/apiEnums.h @@ -0,0 +1,9 @@ +#ifndef APIENUMS_H +#define APIENUMS_H + +enum ApiConfigSources { + Telegram = 1, + AmneziaGateway +}; + +#endif // APIENUMS_H diff --git a/client/core/errorstrings.cpp b/client/core/errorstrings.cpp index 645ec6c5..00e94995 100644 --- a/client/core/errorstrings.cpp +++ b/client/core/errorstrings.cpp @@ -50,6 +50,7 @@ QString errorString(ErrorCode code) { case (ErrorCode::AddressPoolError): errorMessage = QObject::tr("VPN pool error: no available addresses"); break; case (ErrorCode::ImportInvalidConfigError): errorMessage = QObject::tr("The config does not contain any containers and credentials for connecting to the server"); break; + case (ErrorCode::ImportOpenConfigError): errorMessage = QObject::tr(""); break; // Android errors case (ErrorCode::AndroidError): errorMessage = QObject::tr("VPN connection error"); break; @@ -60,6 +61,7 @@ QString errorString(ErrorCode code) { case (ErrorCode::ApiConfigEmptyError): errorMessage = QObject::tr("In the response from the server, an empty config was received"); break; case (ErrorCode::ApiConfigSslError): errorMessage = QObject::tr("SSL error occurred"); break; case (ErrorCode::ApiConfigTimeoutError): errorMessage = QObject::tr("Server response timeout on api request"); break; + case (ErrorCode::ApiMissingAgwPublicKey): errorMessage = QObject::tr("Missing AGW public key"); break; // QFile errors case(ErrorCode::OpenError): errorMessage = QObject::tr("QFile error: The file could not be opened"); break; diff --git a/client/core/ipcclient.cpp b/client/core/ipcclient.cpp index 3e364452..b44da1bf 100644 --- a/client/core/ipcclient.cpp +++ b/client/core/ipcclient.cpp @@ -29,6 +29,12 @@ QSharedPointer IpcClient::Interface() return Instance()->m_ipcClient; } +QSharedPointer IpcClient::InterfaceTun2Socks() +{ + if (!Instance()) return nullptr; + return Instance()->m_Tun2SocksClient; +} + bool IpcClient::init(IpcClient *instance) { m_instance = instance; @@ -44,6 +50,12 @@ bool IpcClient::init(IpcClient *instance) qWarning() << "IpcClient replica is not connected!"; } + Instance()->m_Tun2SocksClient.reset(Instance()->m_ClientNode.acquire()); + Instance()->m_Tun2SocksClient->waitForSource(1000); + + if (!Instance()->m_Tun2SocksClient->isReplicaValid()) { + qWarning() << "IpcClient::m_Tun2SocksClient replica is not connected!"; + } }); connect(Instance()->m_localSocket, &QLocalSocket::disconnected, [instance](){ @@ -51,16 +63,16 @@ bool IpcClient::init(IpcClient *instance) }); Instance()->m_localSocket->connectToServer(amnezia::getIpcServiceUrl()); - Instance()->m_localSocket->waitForConnected(); if (!Instance()->m_ipcClient) { qDebug() << "IpcClient::init failed"; return false; } + qDebug() << "IpcClient::init succeed"; - return Instance()->m_ipcClient->isReplicaValid(); + return (Instance()->m_ipcClient->isReplicaValid() && Instance()->m_Tun2SocksClient->isReplicaValid()); } QSharedPointer IpcClient::CreatePrivilegedProcess() diff --git a/client/core/ipcclient.h b/client/core/ipcclient.h index ab5d750a..ad2e6b6e 100644 --- a/client/core/ipcclient.h +++ b/client/core/ipcclient.h @@ -6,6 +6,7 @@ #include "ipc.h" #include "rep_ipc_interface_replica.h" +#include "rep_ipc_process_tun2socks_replica.h" #include "privileged_process.h" @@ -18,6 +19,7 @@ public: static IpcClient *Instance(); static bool init(IpcClient *instance); static QSharedPointer Interface(); + static QSharedPointer InterfaceTun2Socks(); static QSharedPointer CreatePrivilegedProcess(); bool isSocketConnected() const; @@ -28,8 +30,11 @@ private: ~IpcClient() override; QRemoteObjectNode m_ClientNode; + QRemoteObjectNode m_Tun2SocksNode; QSharedPointer m_ipcClient; QPointer m_localSocket; + QPointer m_tun2socksSocket; + QSharedPointer m_Tun2SocksClient; struct ProcessDescriptor { ProcessDescriptor () { diff --git a/client/core/networkUtilities.cpp b/client/core/networkUtilities.cpp index 7ffd4c41..a5825f0d 100644 --- a/client/core/networkUtilities.cpp +++ b/client/core/networkUtilities.cpp @@ -109,7 +109,10 @@ QStringList NetworkUtilities::summarizeRoutes(const QStringList &ips, const QStr QString NetworkUtilities::getIPAddress(const QString &host) { - if (ipAddressRegExp().match(host).hasMatch()) { + QHostAddress address(host); + if (QAbstractSocket::IPv4Protocol == address.protocol()) { + return host; + } else if (QAbstractSocket::IPv6Protocol == address.protocol()) { return host; } diff --git a/client/images/amneziaBigLogo.svg b/client/images/amneziaBigLogo.svg deleted file mode 100644 index c50c7743..00000000 --- a/client/images/amneziaBigLogo.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/client/images/animation.gif b/client/images/animation.gif deleted file mode 100644 index 6f7f38e8..00000000 Binary files a/client/images/animation.gif and /dev/null differ diff --git a/client/images/arrow_left.png b/client/images/arrow_left.png deleted file mode 100644 index 3a4d149d..00000000 Binary files a/client/images/arrow_left.png and /dev/null differ diff --git a/client/images/background_connected.png b/client/images/background_connected.png deleted file mode 100644 index 62480d5f..00000000 Binary files a/client/images/background_connected.png and /dev/null differ diff --git a/client/images/background_connected@2x.png b/client/images/background_connected@2x.png deleted file mode 100644 index 4f76b956..00000000 Binary files a/client/images/background_connected@2x.png and /dev/null differ diff --git a/client/images/check.png b/client/images/check.png deleted file mode 100644 index 43039eb1..00000000 Binary files a/client/images/check.png and /dev/null differ diff --git a/client/images/close.png b/client/images/close.png deleted file mode 100644 index 072232c1..00000000 Binary files a/client/images/close.png and /dev/null differ diff --git a/client/images/connected.png b/client/images/connected.png deleted file mode 100644 index b3c907c8..00000000 Binary files a/client/images/connected.png and /dev/null differ diff --git a/client/images/connectionOff.svg b/client/images/connectionOff.svg deleted file mode 100644 index 27905ff9..00000000 --- a/client/images/connectionOff.svg +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/client/images/connectionOn.svg b/client/images/connectionOn.svg deleted file mode 100644 index ef317622..00000000 --- a/client/images/connectionOn.svg +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/client/images/connectionProgress.svg b/client/images/connectionProgress.svg deleted file mode 100644 index 8c4024c9..00000000 --- a/client/images/connectionProgress.svg +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/client/images/controls/archive-restore.svg b/client/images/controls/archive-restore.svg new file mode 100644 index 00000000..d3ad8c9e --- /dev/null +++ b/client/images/controls/archive-restore.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/client/images/controls/bug.svg b/client/images/controls/bug.svg new file mode 100644 index 00000000..80fd2277 --- /dev/null +++ b/client/images/controls/bug.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/client/images/controls/folder-search-2.svg b/client/images/controls/folder-search-2.svg new file mode 100644 index 00000000..f77ce57d --- /dev/null +++ b/client/images/controls/folder-search-2.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/client/images/controls/gauge.svg b/client/images/controls/gauge.svg new file mode 100644 index 00000000..4b9c1444 --- /dev/null +++ b/client/images/controls/gauge.svg @@ -0,0 +1,4 @@ + + + + diff --git a/client/images/controls/help-circle.svg b/client/images/controls/help-circle.svg new file mode 100644 index 00000000..7bcd4450 --- /dev/null +++ b/client/images/controls/help-circle.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/client/images/controls/history.svg b/client/images/controls/history.svg new file mode 100644 index 00000000..73beb8b3 --- /dev/null +++ b/client/images/controls/history.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/client/images/controls/info.svg b/client/images/controls/info.svg new file mode 100644 index 00000000..43a40245 --- /dev/null +++ b/client/images/controls/info.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/client/images/controls/map-pin.svg b/client/images/controls/map-pin.svg new file mode 100644 index 00000000..64b75b48 --- /dev/null +++ b/client/images/controls/map-pin.svg @@ -0,0 +1,4 @@ + + + + diff --git a/client/images/controls/refresh-cw.svg b/client/images/controls/refresh-cw.svg new file mode 100644 index 00000000..9572e3e2 --- /dev/null +++ b/client/images/controls/refresh-cw.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/client/images/controls/scan-line.svg b/client/images/controls/scan-line.svg new file mode 100644 index 00000000..be4acc2a --- /dev/null +++ b/client/images/controls/scan-line.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/client/images/controls/tag.svg b/client/images/controls/tag.svg new file mode 100644 index 00000000..88a9db8d --- /dev/null +++ b/client/images/controls/tag.svg @@ -0,0 +1,4 @@ + + + + diff --git a/client/images/delete.png b/client/images/delete.png deleted file mode 100644 index 59687bd2..00000000 Binary files a/client/images/delete.png and /dev/null differ diff --git a/client/images/disconnected.png b/client/images/disconnected.png deleted file mode 100644 index 199f71dc..00000000 Binary files a/client/images/disconnected.png and /dev/null differ diff --git a/client/images/download.png b/client/images/download.png deleted file mode 100644 index 0e949133..00000000 Binary files a/client/images/download.png and /dev/null differ diff --git a/client/images/favorites_disabled.png b/client/images/favorites_disabled.png deleted file mode 100644 index 12a821ac..00000000 Binary files a/client/images/favorites_disabled.png and /dev/null differ diff --git a/client/images/favorites_enabled.png b/client/images/favorites_enabled.png deleted file mode 100644 index 61e28f42..00000000 Binary files a/client/images/favorites_enabled.png and /dev/null differ diff --git a/client/images/favorites_hover.png b/client/images/favorites_hover.png deleted file mode 100644 index 71e7a1b2..00000000 Binary files a/client/images/favorites_hover.png and /dev/null differ diff --git a/client/images/flagKit/AD.svg b/client/images/flagKit/AD.svg new file mode 100644 index 00000000..4855f9fb --- /dev/null +++ b/client/images/flagKit/AD.svg @@ -0,0 +1,35 @@ + + + + AD + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/AE.svg b/client/images/flagKit/AE.svg new file mode 100644 index 00000000..3095fe31 --- /dev/null +++ b/client/images/flagKit/AE.svg @@ -0,0 +1,33 @@ + + + + AE + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/AF.svg b/client/images/flagKit/AF.svg new file mode 100644 index 00000000..75216b74 --- /dev/null +++ b/client/images/flagKit/AF.svg @@ -0,0 +1,34 @@ + + + + AF + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/AG.svg b/client/images/flagKit/AG.svg new file mode 100644 index 00000000..ac56b808 --- /dev/null +++ b/client/images/flagKit/AG.svg @@ -0,0 +1,44 @@ + + + + AG + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/AI.svg b/client/images/flagKit/AI.svg new file mode 100644 index 00000000..7f53e464 --- /dev/null +++ b/client/images/flagKit/AI.svg @@ -0,0 +1,50 @@ + + + + AI + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/AL.svg b/client/images/flagKit/AL.svg new file mode 100644 index 00000000..43ff1a3b --- /dev/null +++ b/client/images/flagKit/AL.svg @@ -0,0 +1,27 @@ + + + + AL + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/AM.svg b/client/images/flagKit/AM.svg new file mode 100644 index 00000000..5224d30f --- /dev/null +++ b/client/images/flagKit/AM.svg @@ -0,0 +1,32 @@ + + + + AM + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/AO.svg b/client/images/flagKit/AO.svg new file mode 100644 index 00000000..86044f3b --- /dev/null +++ b/client/images/flagKit/AO.svg @@ -0,0 +1,37 @@ + + + + AO + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/AR.svg b/client/images/flagKit/AR.svg new file mode 100644 index 00000000..4dbc96f1 --- /dev/null +++ b/client/images/flagKit/AR.svg @@ -0,0 +1,26 @@ + + + + AR + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/AS.svg b/client/images/flagKit/AS.svg new file mode 100644 index 00000000..afb37540 --- /dev/null +++ b/client/images/flagKit/AS.svg @@ -0,0 +1,36 @@ + + + + AS + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/AT.svg b/client/images/flagKit/AT.svg new file mode 100644 index 00000000..627245e3 --- /dev/null +++ b/client/images/flagKit/AT.svg @@ -0,0 +1,24 @@ + + + + AT + Created with sketchtool. + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/AU.svg b/client/images/flagKit/AU.svg new file mode 100644 index 00000000..aad6b1e6 --- /dev/null +++ b/client/images/flagKit/AU.svg @@ -0,0 +1,36 @@ + + + + AU + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/AW.svg b/client/images/flagKit/AW.svg new file mode 100644 index 00000000..892d8aa0 --- /dev/null +++ b/client/images/flagKit/AW.svg @@ -0,0 +1,30 @@ + + + + AW + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/AX.svg b/client/images/flagKit/AX.svg new file mode 100644 index 00000000..577cd268 --- /dev/null +++ b/client/images/flagKit/AX.svg @@ -0,0 +1,32 @@ + + + + AX + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/AZ.svg b/client/images/flagKit/AZ.svg new file mode 100644 index 00000000..3f082f33 --- /dev/null +++ b/client/images/flagKit/AZ.svg @@ -0,0 +1,33 @@ + + + + AZ + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/BA.svg b/client/images/flagKit/BA.svg new file mode 100644 index 00000000..a16324e1 --- /dev/null +++ b/client/images/flagKit/BA.svg @@ -0,0 +1,32 @@ + + + + BA + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/BB.svg b/client/images/flagKit/BB.svg new file mode 100644 index 00000000..5c89e132 --- /dev/null +++ b/client/images/flagKit/BB.svg @@ -0,0 +1,38 @@ + + + + BB + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/BD.svg b/client/images/flagKit/BD.svg new file mode 100644 index 00000000..e1a3cd31 --- /dev/null +++ b/client/images/flagKit/BD.svg @@ -0,0 +1,27 @@ + + + + BD + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/BE.svg b/client/images/flagKit/BE.svg new file mode 100644 index 00000000..ac00173d --- /dev/null +++ b/client/images/flagKit/BE.svg @@ -0,0 +1,32 @@ + + + + BE + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/BF.svg b/client/images/flagKit/BF.svg new file mode 100644 index 00000000..5b4286bb --- /dev/null +++ b/client/images/flagKit/BF.svg @@ -0,0 +1,28 @@ + + + + BF + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/BG.svg b/client/images/flagKit/BG.svg new file mode 100644 index 00000000..e8256f47 --- /dev/null +++ b/client/images/flagKit/BG.svg @@ -0,0 +1,28 @@ + + + + BG + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/BH.svg b/client/images/flagKit/BH.svg new file mode 100644 index 00000000..e1c11093 --- /dev/null +++ b/client/images/flagKit/BH.svg @@ -0,0 +1,23 @@ + + + + BH + Created with sketchtool. + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/BI.svg b/client/images/flagKit/BI.svg new file mode 100644 index 00000000..2f208253 --- /dev/null +++ b/client/images/flagKit/BI.svg @@ -0,0 +1,36 @@ + + + + BI + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/BJ.svg b/client/images/flagKit/BJ.svg new file mode 100644 index 00000000..b21c46e0 --- /dev/null +++ b/client/images/flagKit/BJ.svg @@ -0,0 +1,32 @@ + + + + BJ + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/BL.svg b/client/images/flagKit/BL.svg new file mode 100644 index 00000000..b99bc2c7 --- /dev/null +++ b/client/images/flagKit/BL.svg @@ -0,0 +1,42 @@ + + + + BL + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/BM.svg b/client/images/flagKit/BM.svg new file mode 100644 index 00000000..798dd8b9 --- /dev/null +++ b/client/images/flagKit/BM.svg @@ -0,0 +1,49 @@ + + + + BM + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/BN.svg b/client/images/flagKit/BN.svg new file mode 100644 index 00000000..1fe9afc4 --- /dev/null +++ b/client/images/flagKit/BN.svg @@ -0,0 +1,28 @@ + + + + BN + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/BO.svg b/client/images/flagKit/BO.svg new file mode 100644 index 00000000..7ee247bd --- /dev/null +++ b/client/images/flagKit/BO.svg @@ -0,0 +1,32 @@ + + + + BO + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/BR.svg b/client/images/flagKit/BR.svg new file mode 100644 index 00000000..17edb103 --- /dev/null +++ b/client/images/flagKit/BR.svg @@ -0,0 +1,35 @@ + + + + BR + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/BS.svg b/client/images/flagKit/BS.svg new file mode 100644 index 00000000..767423af --- /dev/null +++ b/client/images/flagKit/BS.svg @@ -0,0 +1,33 @@ + + + + BS + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/BT.svg b/client/images/flagKit/BT.svg new file mode 100644 index 00000000..d2f749bd --- /dev/null +++ b/client/images/flagKit/BT.svg @@ -0,0 +1,27 @@ + + + + BT + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/BV.svg b/client/images/flagKit/BV.svg new file mode 100644 index 00000000..00a47ee5 --- /dev/null +++ b/client/images/flagKit/BV.svg @@ -0,0 +1,28 @@ + + + + BV + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/BW.svg b/client/images/flagKit/BW.svg new file mode 100644 index 00000000..ccac652b --- /dev/null +++ b/client/images/flagKit/BW.svg @@ -0,0 +1,29 @@ + + + + BW + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/BY.svg b/client/images/flagKit/BY.svg new file mode 100644 index 00000000..d584988d --- /dev/null +++ b/client/images/flagKit/BY.svg @@ -0,0 +1,30 @@ + + + + BY + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/BZ.svg b/client/images/flagKit/BZ.svg new file mode 100644 index 00000000..8758df23 --- /dev/null +++ b/client/images/flagKit/BZ.svg @@ -0,0 +1,30 @@ + + + + BZ + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/CA.svg b/client/images/flagKit/CA.svg new file mode 100644 index 00000000..786b609b --- /dev/null +++ b/client/images/flagKit/CA.svg @@ -0,0 +1,25 @@ + + + + CA + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/CC.svg b/client/images/flagKit/CC.svg new file mode 100644 index 00000000..b96f3016 --- /dev/null +++ b/client/images/flagKit/CC.svg @@ -0,0 +1,33 @@ + + + + CC + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/CD.svg b/client/images/flagKit/CD.svg new file mode 100644 index 00000000..0d351c30 --- /dev/null +++ b/client/images/flagKit/CD.svg @@ -0,0 +1,31 @@ + + + + CD + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/CF.svg b/client/images/flagKit/CF.svg new file mode 100644 index 00000000..68566a2e --- /dev/null +++ b/client/images/flagKit/CF.svg @@ -0,0 +1,43 @@ + + + + CF + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/CG.svg b/client/images/flagKit/CG.svg new file mode 100644 index 00000000..bc4eb95b --- /dev/null +++ b/client/images/flagKit/CG.svg @@ -0,0 +1,34 @@ + + + + CG + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/CH.svg b/client/images/flagKit/CH.svg new file mode 100644 index 00000000..772f4fa3 --- /dev/null +++ b/client/images/flagKit/CH.svg @@ -0,0 +1,23 @@ + + + + CH + Created with sketchtool. + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/CI.svg b/client/images/flagKit/CI.svg new file mode 100644 index 00000000..096d98ab --- /dev/null +++ b/client/images/flagKit/CI.svg @@ -0,0 +1,28 @@ + + + + CI + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/CK.svg b/client/images/flagKit/CK.svg new file mode 100644 index 00000000..c1ea3734 --- /dev/null +++ b/client/images/flagKit/CK.svg @@ -0,0 +1,31 @@ + + + + CK + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/CL.svg b/client/images/flagKit/CL.svg new file mode 100644 index 00000000..d456d951 --- /dev/null +++ b/client/images/flagKit/CL.svg @@ -0,0 +1,29 @@ + + + + CL + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/CM.svg b/client/images/flagKit/CM.svg new file mode 100644 index 00000000..482f4a97 --- /dev/null +++ b/client/images/flagKit/CM.svg @@ -0,0 +1,38 @@ + + + + CM + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/CN.svg b/client/images/flagKit/CN.svg new file mode 100644 index 00000000..883ba157 --- /dev/null +++ b/client/images/flagKit/CN.svg @@ -0,0 +1,32 @@ + + + + CN + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/CO.svg b/client/images/flagKit/CO.svg new file mode 100644 index 00000000..be492e3d --- /dev/null +++ b/client/images/flagKit/CO.svg @@ -0,0 +1,32 @@ + + + + CO + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/CR.svg b/client/images/flagKit/CR.svg new file mode 100644 index 00000000..271204eb --- /dev/null +++ b/client/images/flagKit/CR.svg @@ -0,0 +1,29 @@ + + + + CR + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/CU.svg b/client/images/flagKit/CU.svg new file mode 100644 index 00000000..23750cd9 --- /dev/null +++ b/client/images/flagKit/CU.svg @@ -0,0 +1,32 @@ + + + + CU + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/CV.svg b/client/images/flagKit/CV.svg new file mode 100644 index 00000000..4b6152fb --- /dev/null +++ b/client/images/flagKit/CV.svg @@ -0,0 +1,30 @@ + + + + CV + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/CW.svg b/client/images/flagKit/CW.svg new file mode 100644 index 00000000..14acd27f --- /dev/null +++ b/client/images/flagKit/CW.svg @@ -0,0 +1,29 @@ + + + + CW + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/CX.svg b/client/images/flagKit/CX.svg new file mode 100644 index 00000000..b3fe73d9 --- /dev/null +++ b/client/images/flagKit/CX.svg @@ -0,0 +1,38 @@ + + + + CX + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/CY.svg b/client/images/flagKit/CY.svg new file mode 100644 index 00000000..b7860aa9 --- /dev/null +++ b/client/images/flagKit/CY.svg @@ -0,0 +1,24 @@ + + + + CY + Created with sketchtool. + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/CZ.svg b/client/images/flagKit/CZ.svg new file mode 100644 index 00000000..d56c61b8 --- /dev/null +++ b/client/images/flagKit/CZ.svg @@ -0,0 +1,28 @@ + + + + CZ + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/DE.svg b/client/images/flagKit/DE.svg new file mode 100644 index 00000000..4ff1ebd5 --- /dev/null +++ b/client/images/flagKit/DE.svg @@ -0,0 +1,32 @@ + + + + DE + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/DJ.svg b/client/images/flagKit/DJ.svg new file mode 100644 index 00000000..c0a019f9 --- /dev/null +++ b/client/images/flagKit/DJ.svg @@ -0,0 +1,33 @@ + + + + DJ + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/DK.svg b/client/images/flagKit/DK.svg new file mode 100644 index 00000000..27900e15 --- /dev/null +++ b/client/images/flagKit/DK.svg @@ -0,0 +1,23 @@ + + + + DK + Created with sketchtool. + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/DM.svg b/client/images/flagKit/DM.svg new file mode 100644 index 00000000..d5c401eb --- /dev/null +++ b/client/images/flagKit/DM.svg @@ -0,0 +1,41 @@ + + + + DM + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/DO.svg b/client/images/flagKit/DO.svg new file mode 100644 index 00000000..9188e0be --- /dev/null +++ b/client/images/flagKit/DO.svg @@ -0,0 +1,33 @@ + + + + DO + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/DZ.svg b/client/images/flagKit/DZ.svg new file mode 100644 index 00000000..0920d712 --- /dev/null +++ b/client/images/flagKit/DZ.svg @@ -0,0 +1,29 @@ + + + + DZ + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/EC.svg b/client/images/flagKit/EC.svg new file mode 100644 index 00000000..0fbd3ea6 --- /dev/null +++ b/client/images/flagKit/EC.svg @@ -0,0 +1,39 @@ + + + + EC + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/EE.svg b/client/images/flagKit/EE.svg new file mode 100644 index 00000000..63605223 --- /dev/null +++ b/client/images/flagKit/EE.svg @@ -0,0 +1,28 @@ + + + + EE + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/EG.svg b/client/images/flagKit/EG.svg new file mode 100644 index 00000000..32d4447e --- /dev/null +++ b/client/images/flagKit/EG.svg @@ -0,0 +1,30 @@ + + + + EG + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/ER.svg b/client/images/flagKit/ER.svg new file mode 100644 index 00000000..bb70368b --- /dev/null +++ b/client/images/flagKit/ER.svg @@ -0,0 +1,40 @@ + + + + ER + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/ES.svg b/client/images/flagKit/ES.svg new file mode 100644 index 00000000..883554f8 --- /dev/null +++ b/client/images/flagKit/ES.svg @@ -0,0 +1,34 @@ + + + + ES + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/ET.svg b/client/images/flagKit/ET.svg new file mode 100644 index 00000000..c4387b9f --- /dev/null +++ b/client/images/flagKit/ET.svg @@ -0,0 +1,42 @@ + + + + ET + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/EU.svg b/client/images/flagKit/EU.svg new file mode 100644 index 00000000..db74ffaf --- /dev/null +++ b/client/images/flagKit/EU.svg @@ -0,0 +1,27 @@ + + + + EU + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/FI.svg b/client/images/flagKit/FI.svg new file mode 100644 index 00000000..9d243ed5 --- /dev/null +++ b/client/images/flagKit/FI.svg @@ -0,0 +1,22 @@ + + + + FI + Created with sketchtool. + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/FJ.svg b/client/images/flagKit/FJ.svg new file mode 100644 index 00000000..e3ebc9bb --- /dev/null +++ b/client/images/flagKit/FJ.svg @@ -0,0 +1,51 @@ + + + + FJ + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/FK.svg b/client/images/flagKit/FK.svg new file mode 100644 index 00000000..01b0f2a8 --- /dev/null +++ b/client/images/flagKit/FK.svg @@ -0,0 +1,58 @@ + + + + FK + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/FM.svg b/client/images/flagKit/FM.svg new file mode 100644 index 00000000..befd157c --- /dev/null +++ b/client/images/flagKit/FM.svg @@ -0,0 +1,23 @@ + + + + FM + Created with sketchtool. + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/FO.svg b/client/images/flagKit/FO.svg new file mode 100644 index 00000000..77618c05 --- /dev/null +++ b/client/images/flagKit/FO.svg @@ -0,0 +1,27 @@ + + + + FO + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/FR.svg b/client/images/flagKit/FR.svg new file mode 100644 index 00000000..940de616 --- /dev/null +++ b/client/images/flagKit/FR.svg @@ -0,0 +1,28 @@ + + + + FR + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/GA.svg b/client/images/flagKit/GA.svg new file mode 100644 index 00000000..45c68087 --- /dev/null +++ b/client/images/flagKit/GA.svg @@ -0,0 +1,32 @@ + + + + GA + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/GB.svg b/client/images/flagKit/GB.svg new file mode 100644 index 00000000..679d27c7 --- /dev/null +++ b/client/images/flagKit/GB.svg @@ -0,0 +1,32 @@ + + + + GB + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/GD.svg b/client/images/flagKit/GD.svg new file mode 100644 index 00000000..210dc3fd --- /dev/null +++ b/client/images/flagKit/GD.svg @@ -0,0 +1,49 @@ + + + + GD + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/GE.svg b/client/images/flagKit/GE.svg new file mode 100644 index 00000000..818f3f5b --- /dev/null +++ b/client/images/flagKit/GE.svg @@ -0,0 +1,26 @@ + + + + GE + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/GF.svg b/client/images/flagKit/GF.svg new file mode 100644 index 00000000..bae1448d --- /dev/null +++ b/client/images/flagKit/GF.svg @@ -0,0 +1,32 @@ + + + + GF + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/GG.svg b/client/images/flagKit/GG.svg new file mode 100644 index 00000000..fa428535 --- /dev/null +++ b/client/images/flagKit/GG.svg @@ -0,0 +1,27 @@ + + + + GG + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/GH.svg b/client/images/flagKit/GH.svg new file mode 100644 index 00000000..528473ff --- /dev/null +++ b/client/images/flagKit/GH.svg @@ -0,0 +1,37 @@ + + + + GH + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/GI.svg b/client/images/flagKit/GI.svg new file mode 100644 index 00000000..ecd8530a --- /dev/null +++ b/client/images/flagKit/GI.svg @@ -0,0 +1,38 @@ + + + + GI + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/GL.svg b/client/images/flagKit/GL.svg new file mode 100644 index 00000000..33b22333 --- /dev/null +++ b/client/images/flagKit/GL.svg @@ -0,0 +1,33 @@ + + + + GL + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/GM.svg b/client/images/flagKit/GM.svg new file mode 100644 index 00000000..b6330f52 --- /dev/null +++ b/client/images/flagKit/GM.svg @@ -0,0 +1,33 @@ + + + + GM + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/GN.svg b/client/images/flagKit/GN.svg new file mode 100644 index 00000000..2d20595e --- /dev/null +++ b/client/images/flagKit/GN.svg @@ -0,0 +1,32 @@ + + + + GN + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/GP.svg b/client/images/flagKit/GP.svg new file mode 100644 index 00000000..3dbdcc13 --- /dev/null +++ b/client/images/flagKit/GP.svg @@ -0,0 +1,40 @@ + + + + GP + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/GQ.svg b/client/images/flagKit/GQ.svg new file mode 100644 index 00000000..e2d5c67d --- /dev/null +++ b/client/images/flagKit/GQ.svg @@ -0,0 +1,34 @@ + + + + GQ + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/GR.svg b/client/images/flagKit/GR.svg new file mode 100644 index 00000000..a9b12c00 --- /dev/null +++ b/client/images/flagKit/GR.svg @@ -0,0 +1,22 @@ + + + + GR + Created with sketchtool. + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/GS.svg b/client/images/flagKit/GS.svg new file mode 100644 index 00000000..03984521 --- /dev/null +++ b/client/images/flagKit/GS.svg @@ -0,0 +1,112 @@ + + + + GS + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/GT.svg b/client/images/flagKit/GT.svg new file mode 100644 index 00000000..be45ee89 --- /dev/null +++ b/client/images/flagKit/GT.svg @@ -0,0 +1,26 @@ + + + + GT + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/GU.svg b/client/images/flagKit/GU.svg new file mode 100644 index 00000000..6233a0bb --- /dev/null +++ b/client/images/flagKit/GU.svg @@ -0,0 +1,65 @@ + + + + GU + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/GW.svg b/client/images/flagKit/GW.svg new file mode 100644 index 00000000..b09530d4 --- /dev/null +++ b/client/images/flagKit/GW.svg @@ -0,0 +1,37 @@ + + + + GW + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/GY.svg b/client/images/flagKit/GY.svg new file mode 100644 index 00000000..e5937c24 --- /dev/null +++ b/client/images/flagKit/GY.svg @@ -0,0 +1,42 @@ + + + + GY + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/HK.svg b/client/images/flagKit/HK.svg new file mode 100644 index 00000000..f99b8882 --- /dev/null +++ b/client/images/flagKit/HK.svg @@ -0,0 +1,23 @@ + + + + HK + Created with sketchtool. + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/HM.svg b/client/images/flagKit/HM.svg new file mode 100644 index 00000000..8ef4f346 --- /dev/null +++ b/client/images/flagKit/HM.svg @@ -0,0 +1,36 @@ + + + + HM + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/HN.svg b/client/images/flagKit/HN.svg new file mode 100644 index 00000000..50a48cd9 --- /dev/null +++ b/client/images/flagKit/HN.svg @@ -0,0 +1,33 @@ + + + + HN + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/HR.svg b/client/images/flagKit/HR.svg new file mode 100644 index 00000000..a6cf5daa --- /dev/null +++ b/client/images/flagKit/HR.svg @@ -0,0 +1,35 @@ + + + + HR + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/HT.svg b/client/images/flagKit/HT.svg new file mode 100644 index 00000000..0cd82be1 --- /dev/null +++ b/client/images/flagKit/HT.svg @@ -0,0 +1,46 @@ + + + + HT + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/HU.svg b/client/images/flagKit/HU.svg new file mode 100644 index 00000000..795319ea --- /dev/null +++ b/client/images/flagKit/HU.svg @@ -0,0 +1,28 @@ + + + + HU + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/ID.svg b/client/images/flagKit/ID.svg new file mode 100644 index 00000000..8101da05 --- /dev/null +++ b/client/images/flagKit/ID.svg @@ -0,0 +1,23 @@ + + + + ID + Created with sketchtool. + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/IE.svg b/client/images/flagKit/IE.svg new file mode 100644 index 00000000..60d9af87 --- /dev/null +++ b/client/images/flagKit/IE.svg @@ -0,0 +1,28 @@ + + + + IE + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/IL.svg b/client/images/flagKit/IL.svg new file mode 100644 index 00000000..7646f91e --- /dev/null +++ b/client/images/flagKit/IL.svg @@ -0,0 +1,26 @@ + + + + IL + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/IM.svg b/client/images/flagKit/IM.svg new file mode 100644 index 00000000..ecc7c12e --- /dev/null +++ b/client/images/flagKit/IM.svg @@ -0,0 +1,30 @@ + + + + IM + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/IN.svg b/client/images/flagKit/IN.svg new file mode 100644 index 00000000..3726ceb7 --- /dev/null +++ b/client/images/flagKit/IN.svg @@ -0,0 +1,31 @@ + + + + IN + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/IO.svg b/client/images/flagKit/IO.svg new file mode 100644 index 00000000..4d8b5229 --- /dev/null +++ b/client/images/flagKit/IO.svg @@ -0,0 +1,33 @@ + + + + IO + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/IQ.svg b/client/images/flagKit/IQ.svg new file mode 100644 index 00000000..16c4cf18 --- /dev/null +++ b/client/images/flagKit/IQ.svg @@ -0,0 +1,33 @@ + + + + IQ + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/IR.svg b/client/images/flagKit/IR.svg new file mode 100644 index 00000000..af325017 --- /dev/null +++ b/client/images/flagKit/IR.svg @@ -0,0 +1,31 @@ + + + + IR + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/IS.svg b/client/images/flagKit/IS.svg new file mode 100644 index 00000000..385a2bf9 --- /dev/null +++ b/client/images/flagKit/IS.svg @@ -0,0 +1,28 @@ + + + + IS + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/IT.svg b/client/images/flagKit/IT.svg new file mode 100644 index 00000000..9e76f24c --- /dev/null +++ b/client/images/flagKit/IT.svg @@ -0,0 +1,28 @@ + + + + IT + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/JE.svg b/client/images/flagKit/JE.svg new file mode 100644 index 00000000..6663c504 --- /dev/null +++ b/client/images/flagKit/JE.svg @@ -0,0 +1,32 @@ + + + + JE + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/JM.svg b/client/images/flagKit/JM.svg new file mode 100644 index 00000000..54779e77 --- /dev/null +++ b/client/images/flagKit/JM.svg @@ -0,0 +1,33 @@ + + + + JM + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/JO.svg b/client/images/flagKit/JO.svg new file mode 100644 index 00000000..b0788e76 --- /dev/null +++ b/client/images/flagKit/JO.svg @@ -0,0 +1,34 @@ + + + + JO + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/JP.svg b/client/images/flagKit/JP.svg new file mode 100644 index 00000000..0a655c04 --- /dev/null +++ b/client/images/flagKit/JP.svg @@ -0,0 +1,22 @@ + + + + JP + Created with sketchtool. + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/KE.svg b/client/images/flagKit/KE.svg new file mode 100644 index 00000000..6c6a6cf6 --- /dev/null +++ b/client/images/flagKit/KE.svg @@ -0,0 +1,43 @@ + + + + KE + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/KG.svg b/client/images/flagKit/KG.svg new file mode 100644 index 00000000..12e6a244 --- /dev/null +++ b/client/images/flagKit/KG.svg @@ -0,0 +1,28 @@ + + + + KG + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/KH.svg b/client/images/flagKit/KH.svg new file mode 100644 index 00000000..9ea454bb --- /dev/null +++ b/client/images/flagKit/KH.svg @@ -0,0 +1,29 @@ + + + + KH + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/KI.svg b/client/images/flagKit/KI.svg new file mode 100644 index 00000000..e00e2352 --- /dev/null +++ b/client/images/flagKit/KI.svg @@ -0,0 +1,35 @@ + + + + KI + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/KM.svg b/client/images/flagKit/KM.svg new file mode 100644 index 00000000..2da152d5 --- /dev/null +++ b/client/images/flagKit/KM.svg @@ -0,0 +1,39 @@ + + + + KM + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/KN.svg b/client/images/flagKit/KN.svg new file mode 100644 index 00000000..e65b7b61 --- /dev/null +++ b/client/images/flagKit/KN.svg @@ -0,0 +1,39 @@ + + + + KN + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/KP.svg b/client/images/flagKit/KP.svg new file mode 100644 index 00000000..649feb27 --- /dev/null +++ b/client/images/flagKit/KP.svg @@ -0,0 +1,30 @@ + + + + KP + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/KR.svg b/client/images/flagKit/KR.svg new file mode 100644 index 00000000..078665a5 --- /dev/null +++ b/client/images/flagKit/KR.svg @@ -0,0 +1,38 @@ + + + + KR + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/KW.svg b/client/images/flagKit/KW.svg new file mode 100644 index 00000000..a73b0113 --- /dev/null +++ b/client/images/flagKit/KW.svg @@ -0,0 +1,33 @@ + + + + KW + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/KY.svg b/client/images/flagKit/KY.svg new file mode 100644 index 00000000..2240dbc6 --- /dev/null +++ b/client/images/flagKit/KY.svg @@ -0,0 +1,44 @@ + + + + KY + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/KZ.svg b/client/images/flagKit/KZ.svg new file mode 100644 index 00000000..6076ac54 --- /dev/null +++ b/client/images/flagKit/KZ.svg @@ -0,0 +1,29 @@ + + + + KZ + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/LA.svg b/client/images/flagKit/LA.svg new file mode 100644 index 00000000..5b740da7 --- /dev/null +++ b/client/images/flagKit/LA.svg @@ -0,0 +1,29 @@ + + + + LA + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/LB.svg b/client/images/flagKit/LB.svg new file mode 100644 index 00000000..401a235d --- /dev/null +++ b/client/images/flagKit/LB.svg @@ -0,0 +1,29 @@ + + + + LB + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/LC.svg b/client/images/flagKit/LC.svg new file mode 100644 index 00000000..8d809d3e --- /dev/null +++ b/client/images/flagKit/LC.svg @@ -0,0 +1,33 @@ + + + + LC + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/LI.svg b/client/images/flagKit/LI.svg new file mode 100644 index 00000000..1160975a --- /dev/null +++ b/client/images/flagKit/LI.svg @@ -0,0 +1,27 @@ + + + + LI + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/LICENSE b/client/images/flagKit/LICENSE new file mode 100644 index 00000000..59f47bf1 --- /dev/null +++ b/client/images/flagKit/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2016 Bowtie AB + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/client/images/flagKit/LK.svg b/client/images/flagKit/LK.svg new file mode 100644 index 00000000..55386d5c --- /dev/null +++ b/client/images/flagKit/LK.svg @@ -0,0 +1,43 @@ + + + + LK + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/LR.svg b/client/images/flagKit/LR.svg new file mode 100644 index 00000000..3d6cef1e --- /dev/null +++ b/client/images/flagKit/LR.svg @@ -0,0 +1,36 @@ + + + + LR + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/LS.svg b/client/images/flagKit/LS.svg new file mode 100644 index 00000000..3ec5277d --- /dev/null +++ b/client/images/flagKit/LS.svg @@ -0,0 +1,34 @@ + + + + LS + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/LT.svg b/client/images/flagKit/LT.svg new file mode 100644 index 00000000..8e592267 --- /dev/null +++ b/client/images/flagKit/LT.svg @@ -0,0 +1,32 @@ + + + + LT + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/LU.svg b/client/images/flagKit/LU.svg new file mode 100644 index 00000000..860e730b --- /dev/null +++ b/client/images/flagKit/LU.svg @@ -0,0 +1,28 @@ + + + + LU + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/LV.svg b/client/images/flagKit/LV.svg new file mode 100644 index 00000000..5d0255e6 --- /dev/null +++ b/client/images/flagKit/LV.svg @@ -0,0 +1,24 @@ + + + + LV + Created with sketchtool. + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/LY.svg b/client/images/flagKit/LY.svg new file mode 100644 index 00000000..4b9f2a0e --- /dev/null +++ b/client/images/flagKit/LY.svg @@ -0,0 +1,33 @@ + + + + LY + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/MA.svg b/client/images/flagKit/MA.svg new file mode 100644 index 00000000..cb22ba95 --- /dev/null +++ b/client/images/flagKit/MA.svg @@ -0,0 +1,23 @@ + + + + MA + Created with sketchtool. + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/MC.svg b/client/images/flagKit/MC.svg new file mode 100644 index 00000000..207590a7 --- /dev/null +++ b/client/images/flagKit/MC.svg @@ -0,0 +1,23 @@ + + + + MC + Created with sketchtool. + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/MD.svg b/client/images/flagKit/MD.svg new file mode 100644 index 00000000..301e93ee --- /dev/null +++ b/client/images/flagKit/MD.svg @@ -0,0 +1,42 @@ + + + + MD + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/ME.svg b/client/images/flagKit/ME.svg new file mode 100644 index 00000000..9b0838e9 --- /dev/null +++ b/client/images/flagKit/ME.svg @@ -0,0 +1,29 @@ + + + + ME + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/MF.svg b/client/images/flagKit/MF.svg new file mode 100644 index 00000000..c45b62a0 --- /dev/null +++ b/client/images/flagKit/MF.svg @@ -0,0 +1,28 @@ + + + + MF + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/MG.svg b/client/images/flagKit/MG.svg new file mode 100644 index 00000000..c173fdd5 --- /dev/null +++ b/client/images/flagKit/MG.svg @@ -0,0 +1,28 @@ + + + + MG + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/MH.svg b/client/images/flagKit/MH.svg new file mode 100644 index 00000000..e6b66091 --- /dev/null +++ b/client/images/flagKit/MH.svg @@ -0,0 +1,29 @@ + + + + MH + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/MK.svg b/client/images/flagKit/MK.svg new file mode 100644 index 00000000..35b92297 --- /dev/null +++ b/client/images/flagKit/MK.svg @@ -0,0 +1,29 @@ + + + + MK + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/ML.svg b/client/images/flagKit/ML.svg new file mode 100644 index 00000000..babc6e59 --- /dev/null +++ b/client/images/flagKit/ML.svg @@ -0,0 +1,32 @@ + + + + ML + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/MM.svg b/client/images/flagKit/MM.svg new file mode 100644 index 00000000..eb3c18a3 --- /dev/null +++ b/client/images/flagKit/MM.svg @@ -0,0 +1,33 @@ + + + + MM + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/MN.svg b/client/images/flagKit/MN.svg new file mode 100644 index 00000000..8af15a51 --- /dev/null +++ b/client/images/flagKit/MN.svg @@ -0,0 +1,33 @@ + + + + MN + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/MO.svg b/client/images/flagKit/MO.svg new file mode 100644 index 00000000..be4bc875 --- /dev/null +++ b/client/images/flagKit/MO.svg @@ -0,0 +1,26 @@ + + + + MO + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/MP.svg b/client/images/flagKit/MP.svg new file mode 100644 index 00000000..33151489 --- /dev/null +++ b/client/images/flagKit/MP.svg @@ -0,0 +1,29 @@ + + + + MP + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/MQ.svg b/client/images/flagKit/MQ.svg new file mode 100644 index 00000000..adc82074 --- /dev/null +++ b/client/images/flagKit/MQ.svg @@ -0,0 +1,27 @@ + + + + MQ + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/MR.svg b/client/images/flagKit/MR.svg new file mode 100644 index 00000000..da5adee6 --- /dev/null +++ b/client/images/flagKit/MR.svg @@ -0,0 +1,27 @@ + + + + MR + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/MS.svg b/client/images/flagKit/MS.svg new file mode 100644 index 00000000..184c9178 --- /dev/null +++ b/client/images/flagKit/MS.svg @@ -0,0 +1,47 @@ + + + + MS + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/MT.svg b/client/images/flagKit/MT.svg new file mode 100644 index 00000000..5ce0b3fe --- /dev/null +++ b/client/images/flagKit/MT.svg @@ -0,0 +1,29 @@ + + + + MT + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/MU.svg b/client/images/flagKit/MU.svg new file mode 100644 index 00000000..f2c6f3f8 --- /dev/null +++ b/client/images/flagKit/MU.svg @@ -0,0 +1,37 @@ + + + + MU + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/MV.svg b/client/images/flagKit/MV.svg new file mode 100644 index 00000000..f10e07d5 --- /dev/null +++ b/client/images/flagKit/MV.svg @@ -0,0 +1,28 @@ + + + + MV + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/MW.svg b/client/images/flagKit/MW.svg new file mode 100644 index 00000000..5b0cc5c6 --- /dev/null +++ b/client/images/flagKit/MW.svg @@ -0,0 +1,33 @@ + + + + MW + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/MX.svg b/client/images/flagKit/MX.svg new file mode 100644 index 00000000..7ed245bc --- /dev/null +++ b/client/images/flagKit/MX.svg @@ -0,0 +1,30 @@ + + + + MX + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/MY.svg b/client/images/flagKit/MY.svg new file mode 100644 index 00000000..e7ff885f --- /dev/null +++ b/client/images/flagKit/MY.svg @@ -0,0 +1,32 @@ + + + + MY + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/MZ.svg b/client/images/flagKit/MZ.svg new file mode 100644 index 00000000..7f553b00 --- /dev/null +++ b/client/images/flagKit/MZ.svg @@ -0,0 +1,43 @@ + + + + MZ + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/NA.svg b/client/images/flagKit/NA.svg new file mode 100644 index 00000000..cb0ba69f --- /dev/null +++ b/client/images/flagKit/NA.svg @@ -0,0 +1,75 @@ + + + + NA + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/NC.svg b/client/images/flagKit/NC.svg new file mode 100644 index 00000000..bae580e8 --- /dev/null +++ b/client/images/flagKit/NC.svg @@ -0,0 +1,42 @@ + + + + NC + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/NE.svg b/client/images/flagKit/NE.svg new file mode 100644 index 00000000..12bcf8a0 --- /dev/null +++ b/client/images/flagKit/NE.svg @@ -0,0 +1,33 @@ + + + + NE + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/NF.svg b/client/images/flagKit/NF.svg new file mode 100644 index 00000000..b707e52d --- /dev/null +++ b/client/images/flagKit/NF.svg @@ -0,0 +1,29 @@ + + + + NF + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/NG.svg b/client/images/flagKit/NG.svg new file mode 100644 index 00000000..4063ff84 --- /dev/null +++ b/client/images/flagKit/NG.svg @@ -0,0 +1,24 @@ + + + + NG + Created with sketchtool. + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/NI.svg b/client/images/flagKit/NI.svg new file mode 100644 index 00000000..7adb4ba4 --- /dev/null +++ b/client/images/flagKit/NI.svg @@ -0,0 +1,26 @@ + + + + NI + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/NL.svg b/client/images/flagKit/NL.svg new file mode 100644 index 00000000..c62f42ad --- /dev/null +++ b/client/images/flagKit/NL.svg @@ -0,0 +1,28 @@ + + + + NL + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/NO.svg b/client/images/flagKit/NO.svg new file mode 100644 index 00000000..cdc23f49 --- /dev/null +++ b/client/images/flagKit/NO.svg @@ -0,0 +1,28 @@ + + + + NO + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/NP.svg b/client/images/flagKit/NP.svg new file mode 100644 index 00000000..c879fa80 --- /dev/null +++ b/client/images/flagKit/NP.svg @@ -0,0 +1,35 @@ + + + + NP + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/NR.svg b/client/images/flagKit/NR.svg new file mode 100644 index 00000000..1a6c3a21 --- /dev/null +++ b/client/images/flagKit/NR.svg @@ -0,0 +1,28 @@ + + + + NR + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/NU.svg b/client/images/flagKit/NU.svg new file mode 100644 index 00000000..3d9bc80c --- /dev/null +++ b/client/images/flagKit/NU.svg @@ -0,0 +1,41 @@ + + + + NU + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/NZ.svg b/client/images/flagKit/NZ.svg new file mode 100644 index 00000000..c1f624df --- /dev/null +++ b/client/images/flagKit/NZ.svg @@ -0,0 +1,34 @@ + + + + NZ + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/OM.svg b/client/images/flagKit/OM.svg new file mode 100644 index 00000000..cb08ac82 --- /dev/null +++ b/client/images/flagKit/OM.svg @@ -0,0 +1,29 @@ + + + + OM + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/PA.svg b/client/images/flagKit/PA.svg new file mode 100644 index 00000000..d8516682 --- /dev/null +++ b/client/images/flagKit/PA.svg @@ -0,0 +1,30 @@ + + + + PA + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/PE.svg b/client/images/flagKit/PE.svg new file mode 100644 index 00000000..98a26cf2 --- /dev/null +++ b/client/images/flagKit/PE.svg @@ -0,0 +1,24 @@ + + + + PE + Created with sketchtool. + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/PF.svg b/client/images/flagKit/PF.svg new file mode 100644 index 00000000..b29385f4 --- /dev/null +++ b/client/images/flagKit/PF.svg @@ -0,0 +1,52 @@ + + + + PF + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/PG.svg b/client/images/flagKit/PG.svg new file mode 100644 index 00000000..0630fab6 --- /dev/null +++ b/client/images/flagKit/PG.svg @@ -0,0 +1,36 @@ + + + + PG + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/PH.svg b/client/images/flagKit/PH.svg new file mode 100644 index 00000000..4c1087b8 --- /dev/null +++ b/client/images/flagKit/PH.svg @@ -0,0 +1,33 @@ + + + + PH + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/PK.svg b/client/images/flagKit/PK.svg new file mode 100644 index 00000000..7ecb09cf --- /dev/null +++ b/client/images/flagKit/PK.svg @@ -0,0 +1,32 @@ + + + + PK + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/PL.svg b/client/images/flagKit/PL.svg new file mode 100644 index 00000000..fadbd2d6 --- /dev/null +++ b/client/images/flagKit/PL.svg @@ -0,0 +1,23 @@ + + + + PL + Created with sketchtool. + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/PM.svg b/client/images/flagKit/PM.svg new file mode 100644 index 00000000..1f39fd0a --- /dev/null +++ b/client/images/flagKit/PM.svg @@ -0,0 +1,66 @@ + + + + PM + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/PN.svg b/client/images/flagKit/PN.svg new file mode 100644 index 00000000..f2b2cc4f --- /dev/null +++ b/client/images/flagKit/PN.svg @@ -0,0 +1,51 @@ + + + + PN + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/PR.svg b/client/images/flagKit/PR.svg new file mode 100644 index 00000000..7d120445 --- /dev/null +++ b/client/images/flagKit/PR.svg @@ -0,0 +1,30 @@ + + + + PR + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/PS.svg b/client/images/flagKit/PS.svg new file mode 100644 index 00000000..e68583ba --- /dev/null +++ b/client/images/flagKit/PS.svg @@ -0,0 +1,33 @@ + + + + PS + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/PT.svg b/client/images/flagKit/PT.svg new file mode 100644 index 00000000..49b59be2 --- /dev/null +++ b/client/images/flagKit/PT.svg @@ -0,0 +1,38 @@ + + + + PT + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/PW.svg b/client/images/flagKit/PW.svg new file mode 100644 index 00000000..4ab7f166 --- /dev/null +++ b/client/images/flagKit/PW.svg @@ -0,0 +1,27 @@ + + + + PW + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/PY.svg b/client/images/flagKit/PY.svg new file mode 100644 index 00000000..2ae00546 --- /dev/null +++ b/client/images/flagKit/PY.svg @@ -0,0 +1,30 @@ + + + + PY + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/QA.svg b/client/images/flagKit/QA.svg new file mode 100644 index 00000000..985171d1 --- /dev/null +++ b/client/images/flagKit/QA.svg @@ -0,0 +1,23 @@ + + + + QA + Created with sketchtool. + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/RE.svg b/client/images/flagKit/RE.svg new file mode 100644 index 00000000..7e130938 --- /dev/null +++ b/client/images/flagKit/RE.svg @@ -0,0 +1,28 @@ + + + + RE + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/RO.svg b/client/images/flagKit/RO.svg new file mode 100644 index 00000000..dd82b266 --- /dev/null +++ b/client/images/flagKit/RO.svg @@ -0,0 +1,32 @@ + + + + RO + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/RS.svg b/client/images/flagKit/RS.svg new file mode 100644 index 00000000..892dd5e4 --- /dev/null +++ b/client/images/flagKit/RS.svg @@ -0,0 +1,39 @@ + + + + RS + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/RU.svg b/client/images/flagKit/RU.svg new file mode 100644 index 00000000..a9ba65b5 --- /dev/null +++ b/client/images/flagKit/RU.svg @@ -0,0 +1,28 @@ + + + + RU + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/RW.svg b/client/images/flagKit/RW.svg new file mode 100644 index 00000000..43b26156 --- /dev/null +++ b/client/images/flagKit/RW.svg @@ -0,0 +1,37 @@ + + + + RW + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/SA.svg b/client/images/flagKit/SA.svg new file mode 100644 index 00000000..735b986f --- /dev/null +++ b/client/images/flagKit/SA.svg @@ -0,0 +1,26 @@ + + + + SA + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/SB.svg b/client/images/flagKit/SB.svg new file mode 100644 index 00000000..768c45c0 --- /dev/null +++ b/client/images/flagKit/SB.svg @@ -0,0 +1,39 @@ + + + + SB + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/SC.svg b/client/images/flagKit/SC.svg new file mode 100644 index 00000000..62b380b8 --- /dev/null +++ b/client/images/flagKit/SC.svg @@ -0,0 +1,43 @@ + + + + SC + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/SD.svg b/client/images/flagKit/SD.svg new file mode 100644 index 00000000..c68d6b1b --- /dev/null +++ b/client/images/flagKit/SD.svg @@ -0,0 +1,33 @@ + + + + SD + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/SE.svg b/client/images/flagKit/SE.svg new file mode 100644 index 00000000..bb4f4e11 --- /dev/null +++ b/client/images/flagKit/SE.svg @@ -0,0 +1,27 @@ + + + + SE + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/SG.svg b/client/images/flagKit/SG.svg new file mode 100644 index 00000000..27011483 --- /dev/null +++ b/client/images/flagKit/SG.svg @@ -0,0 +1,24 @@ + + + + SG + Created with sketchtool. + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/SH.svg b/client/images/flagKit/SH.svg new file mode 100644 index 00000000..e0dde764 --- /dev/null +++ b/client/images/flagKit/SH.svg @@ -0,0 +1,53 @@ + + + + SH + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/SI.svg b/client/images/flagKit/SI.svg new file mode 100644 index 00000000..497f8705 --- /dev/null +++ b/client/images/flagKit/SI.svg @@ -0,0 +1,28 @@ + + + + SI + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/SJ.svg b/client/images/flagKit/SJ.svg new file mode 100644 index 00000000..bef7e505 --- /dev/null +++ b/client/images/flagKit/SJ.svg @@ -0,0 +1,28 @@ + + + + SJ + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/SK.svg b/client/images/flagKit/SK.svg new file mode 100644 index 00000000..2b8ba801 --- /dev/null +++ b/client/images/flagKit/SK.svg @@ -0,0 +1,46 @@ + + + + SK + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/SL.svg b/client/images/flagKit/SL.svg new file mode 100644 index 00000000..817419ef --- /dev/null +++ b/client/images/flagKit/SL.svg @@ -0,0 +1,28 @@ + + + + SL + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/SM.svg b/client/images/flagKit/SM.svg new file mode 100644 index 00000000..abf62171 --- /dev/null +++ b/client/images/flagKit/SM.svg @@ -0,0 +1,25 @@ + + + + SM + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/SN.svg b/client/images/flagKit/SN.svg new file mode 100644 index 00000000..09484160 --- /dev/null +++ b/client/images/flagKit/SN.svg @@ -0,0 +1,33 @@ + + + + SN + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/SO.svg b/client/images/flagKit/SO.svg new file mode 100644 index 00000000..6372e377 --- /dev/null +++ b/client/images/flagKit/SO.svg @@ -0,0 +1,23 @@ + + + + SO + Created with sketchtool. + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/SR.svg b/client/images/flagKit/SR.svg new file mode 100644 index 00000000..97963b0c --- /dev/null +++ b/client/images/flagKit/SR.svg @@ -0,0 +1,34 @@ + + + + SR + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/SS.svg b/client/images/flagKit/SS.svg new file mode 100644 index 00000000..e8d68dd0 --- /dev/null +++ b/client/images/flagKit/SS.svg @@ -0,0 +1,44 @@ + + + + SS + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/ST.svg b/client/images/flagKit/ST.svg new file mode 100644 index 00000000..4b355d71 --- /dev/null +++ b/client/images/flagKit/ST.svg @@ -0,0 +1,39 @@ + + + + ST + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/SV.svg b/client/images/flagKit/SV.svg new file mode 100644 index 00000000..9bfdd5ce --- /dev/null +++ b/client/images/flagKit/SV.svg @@ -0,0 +1,30 @@ + + + + SV + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/SX.svg b/client/images/flagKit/SX.svg new file mode 100644 index 00000000..ccefe037 --- /dev/null +++ b/client/images/flagKit/SX.svg @@ -0,0 +1,45 @@ + + + + SX + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/SY.svg b/client/images/flagKit/SY.svg new file mode 100644 index 00000000..040530b6 --- /dev/null +++ b/client/images/flagKit/SY.svg @@ -0,0 +1,34 @@ + + + + SY + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/SZ.svg b/client/images/flagKit/SZ.svg new file mode 100644 index 00000000..fc4120de --- /dev/null +++ b/client/images/flagKit/SZ.svg @@ -0,0 +1,47 @@ + + + + SZ + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/TC.svg b/client/images/flagKit/TC.svg new file mode 100644 index 00000000..c3ea149a --- /dev/null +++ b/client/images/flagKit/TC.svg @@ -0,0 +1,40 @@ + + + + TC + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/TD.svg b/client/images/flagKit/TD.svg new file mode 100644 index 00000000..74756faf --- /dev/null +++ b/client/images/flagKit/TD.svg @@ -0,0 +1,32 @@ + + + + TD + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/TF.svg b/client/images/flagKit/TF.svg new file mode 100644 index 00000000..d1ea6918 --- /dev/null +++ b/client/images/flagKit/TF.svg @@ -0,0 +1,35 @@ + + + + TF + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/TG.svg b/client/images/flagKit/TG.svg new file mode 100644 index 00000000..e9f6360f --- /dev/null +++ b/client/images/flagKit/TG.svg @@ -0,0 +1,33 @@ + + + + TG + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/TH.svg b/client/images/flagKit/TH.svg new file mode 100644 index 00000000..1bf403a2 --- /dev/null +++ b/client/images/flagKit/TH.svg @@ -0,0 +1,29 @@ + + + + TH + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/TJ.svg b/client/images/flagKit/TJ.svg new file mode 100644 index 00000000..77d6728b --- /dev/null +++ b/client/images/flagKit/TJ.svg @@ -0,0 +1,29 @@ + + + + TJ + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/TK.svg b/client/images/flagKit/TK.svg new file mode 100644 index 00000000..3cde9608 --- /dev/null +++ b/client/images/flagKit/TK.svg @@ -0,0 +1,31 @@ + + + + TK + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/TL.svg b/client/images/flagKit/TL.svg new file mode 100644 index 00000000..41b89521 --- /dev/null +++ b/client/images/flagKit/TL.svg @@ -0,0 +1,33 @@ + + + + TL + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/TM.svg b/client/images/flagKit/TM.svg new file mode 100644 index 00000000..dac62a13 --- /dev/null +++ b/client/images/flagKit/TM.svg @@ -0,0 +1,74 @@ + + + + TM + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/TN.svg b/client/images/flagKit/TN.svg new file mode 100644 index 00000000..3ff74a9e --- /dev/null +++ b/client/images/flagKit/TN.svg @@ -0,0 +1,23 @@ + + + + TN + Created with sketchtool. + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/TO.svg b/client/images/flagKit/TO.svg new file mode 100644 index 00000000..e0e42ee2 --- /dev/null +++ b/client/images/flagKit/TO.svg @@ -0,0 +1,28 @@ + + + + TO + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/TR.svg b/client/images/flagKit/TR.svg new file mode 100644 index 00000000..e5c0924d --- /dev/null +++ b/client/images/flagKit/TR.svg @@ -0,0 +1,23 @@ + + + + TR + Created with sketchtool. + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/TT.svg b/client/images/flagKit/TT.svg new file mode 100644 index 00000000..69bdb9a9 --- /dev/null +++ b/client/images/flagKit/TT.svg @@ -0,0 +1,28 @@ + + + + TT + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/TV.svg b/client/images/flagKit/TV.svg new file mode 100644 index 00000000..839c97f1 --- /dev/null +++ b/client/images/flagKit/TV.svg @@ -0,0 +1,36 @@ + + + + TV + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/TW.svg b/client/images/flagKit/TW.svg new file mode 100644 index 00000000..488d1120 --- /dev/null +++ b/client/images/flagKit/TW.svg @@ -0,0 +1,28 @@ + + + + TW + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/TZ.svg b/client/images/flagKit/TZ.svg new file mode 100644 index 00000000..d652e211 --- /dev/null +++ b/client/images/flagKit/TZ.svg @@ -0,0 +1,37 @@ + + + + TZ + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/UA.svg b/client/images/flagKit/UA.svg new file mode 100644 index 00000000..8dac8366 --- /dev/null +++ b/client/images/flagKit/UA.svg @@ -0,0 +1,27 @@ + + + + UA + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/UG.svg b/client/images/flagKit/UG.svg new file mode 100644 index 00000000..7fabd77c --- /dev/null +++ b/client/images/flagKit/UG.svg @@ -0,0 +1,37 @@ + + + + UG + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/UM.svg b/client/images/flagKit/UM.svg new file mode 100644 index 00000000..1a8fc6a7 --- /dev/null +++ b/client/images/flagKit/UM.svg @@ -0,0 +1,28 @@ + + + + UM + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/US.svg b/client/images/flagKit/US.svg new file mode 100644 index 00000000..846ec9d2 --- /dev/null +++ b/client/images/flagKit/US.svg @@ -0,0 +1,28 @@ + + + + US + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/UY.svg b/client/images/flagKit/UY.svg new file mode 100644 index 00000000..81c28154 --- /dev/null +++ b/client/images/flagKit/UY.svg @@ -0,0 +1,29 @@ + + + + UY + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/UZ.svg b/client/images/flagKit/UZ.svg new file mode 100644 index 00000000..f6cf2140 --- /dev/null +++ b/client/images/flagKit/UZ.svg @@ -0,0 +1,29 @@ + + + + UZ + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/VA.svg b/client/images/flagKit/VA.svg new file mode 100644 index 00000000..14c78aaa --- /dev/null +++ b/client/images/flagKit/VA.svg @@ -0,0 +1,39 @@ + + + + VA + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/VC.svg b/client/images/flagKit/VC.svg new file mode 100644 index 00000000..22cc1d53 --- /dev/null +++ b/client/images/flagKit/VC.svg @@ -0,0 +1,37 @@ + + + + VC + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/VE.svg b/client/images/flagKit/VE.svg new file mode 100644 index 00000000..1a14634f --- /dev/null +++ b/client/images/flagKit/VE.svg @@ -0,0 +1,33 @@ + + + + VE + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/VG.svg b/client/images/flagKit/VG.svg new file mode 100644 index 00000000..c3c31ed1 --- /dev/null +++ b/client/images/flagKit/VG.svg @@ -0,0 +1,42 @@ + + + + VG + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/VI.svg b/client/images/flagKit/VI.svg new file mode 100644 index 00000000..071cf62c --- /dev/null +++ b/client/images/flagKit/VI.svg @@ -0,0 +1,49 @@ + + + + VI + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/VN.svg b/client/images/flagKit/VN.svg new file mode 100644 index 00000000..2bb79564 --- /dev/null +++ b/client/images/flagKit/VN.svg @@ -0,0 +1,27 @@ + + + + VN + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/VU.svg b/client/images/flagKit/VU.svg new file mode 100644 index 00000000..26e02981 --- /dev/null +++ b/client/images/flagKit/VU.svg @@ -0,0 +1,38 @@ + + + + VU + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/WF.svg b/client/images/flagKit/WF.svg new file mode 100644 index 00000000..26a5e414 --- /dev/null +++ b/client/images/flagKit/WF.svg @@ -0,0 +1,28 @@ + + + + WF + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/WS.svg b/client/images/flagKit/WS.svg new file mode 100644 index 00000000..756c78f5 --- /dev/null +++ b/client/images/flagKit/WS.svg @@ -0,0 +1,28 @@ + + + + WS + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/XK.svg b/client/images/flagKit/XK.svg new file mode 100644 index 00000000..a9c245fd --- /dev/null +++ b/client/images/flagKit/XK.svg @@ -0,0 +1,28 @@ + + + + XK + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/YE.svg b/client/images/flagKit/YE.svg new file mode 100644 index 00000000..535406f9 --- /dev/null +++ b/client/images/flagKit/YE.svg @@ -0,0 +1,28 @@ + + + + YE + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/YT.svg b/client/images/flagKit/YT.svg new file mode 100644 index 00000000..be67985d --- /dev/null +++ b/client/images/flagKit/YT.svg @@ -0,0 +1,77 @@ + + + + YT + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/ZA.svg b/client/images/flagKit/ZA.svg new file mode 100644 index 00000000..f3ad3726 --- /dev/null +++ b/client/images/flagKit/ZA.svg @@ -0,0 +1,44 @@ + + + + ZA + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/ZM.svg b/client/images/flagKit/ZM.svg new file mode 100644 index 00000000..3e6f42a8 --- /dev/null +++ b/client/images/flagKit/ZM.svg @@ -0,0 +1,42 @@ + + + + ZM + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/flagKit/ZW.svg b/client/images/flagKit/ZW.svg new file mode 100644 index 00000000..dfaf1f3f --- /dev/null +++ b/client/images/flagKit/ZW.svg @@ -0,0 +1,43 @@ + + + + ZW + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/images/folder.png b/client/images/folder.png deleted file mode 100644 index 07407596..00000000 Binary files a/client/images/folder.png and /dev/null differ diff --git a/client/images/icon_src.png b/client/images/icon_src.png deleted file mode 100644 index 1201a89a..00000000 Binary files a/client/images/icon_src.png and /dev/null differ diff --git a/client/images/icon_src.svg b/client/images/icon_src.svg deleted file mode 100644 index b27d1360..00000000 --- a/client/images/icon_src.svg +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - - - diff --git a/client/images/settings.png b/client/images/settings.png deleted file mode 100644 index a64c6116..00000000 Binary files a/client/images/settings.png and /dev/null differ diff --git a/client/images/settings_grey.png b/client/images/settings_grey.png deleted file mode 100644 index 60127b5c..00000000 Binary files a/client/images/settings_grey.png and /dev/null differ diff --git a/client/images/share.png b/client/images/share.png deleted file mode 100644 index e1451e06..00000000 Binary files a/client/images/share.png and /dev/null differ diff --git a/client/images/svg/close_black_24dp.svg b/client/images/svg/close_black_24dp.svg deleted file mode 100644 index 5f1267d7..00000000 --- a/client/images/svg/close_black_24dp.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/client/images/svg/control_point_black_24dp.svg b/client/images/svg/control_point_black_24dp.svg deleted file mode 100644 index 75b25e67..00000000 --- a/client/images/svg/control_point_black_24dp.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/client/images/svg/delete_black_24dp.svg b/client/images/svg/delete_black_24dp.svg deleted file mode 100644 index 69a68354..00000000 --- a/client/images/svg/delete_black_24dp.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/client/images/svg/density_small_black_24dp.svg b/client/images/svg/density_small_black_24dp.svg deleted file mode 100644 index f79483de..00000000 --- a/client/images/svg/density_small_black_24dp.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/client/images/svg/done_black_24dp.svg b/client/images/svg/done_black_24dp.svg deleted file mode 100644 index b7e19d35..00000000 --- a/client/images/svg/done_black_24dp.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/client/images/svg/format_list_bulleted_black_24dp.svg b/client/images/svg/format_list_bulleted_black_24dp.svg deleted file mode 100644 index 21821a14..00000000 --- a/client/images/svg/format_list_bulleted_black_24dp.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/client/images/svg/gpp_good_black_24dp.svg b/client/images/svg/gpp_good_black_24dp.svg deleted file mode 100644 index 45d4a819..00000000 --- a/client/images/svg/gpp_good_black_24dp.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/client/images/svg/gpp_maybe_black_24dp.svg b/client/images/svg/gpp_maybe_black_24dp.svg deleted file mode 100644 index dceeac79..00000000 --- a/client/images/svg/gpp_maybe_black_24dp.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/client/images/svg/logout_black_24dp.svg b/client/images/svg/logout_black_24dp.svg deleted file mode 100644 index 1b785f84..00000000 --- a/client/images/svg/logout_black_24dp.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/client/images/svg/miscellaneous_services_black_24dp.svg b/client/images/svg/miscellaneous_services_black_24dp.svg deleted file mode 100644 index 425990e5..00000000 --- a/client/images/svg/miscellaneous_services_black_24dp.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/client/images/svg/refresh_black_24dp.svg b/client/images/svg/refresh_black_24dp.svg deleted file mode 100644 index f31411f5..00000000 --- a/client/images/svg/refresh_black_24dp.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/client/images/svg/settings_black_24dp.svg b/client/images/svg/settings_black_24dp.svg deleted file mode 100644 index 4165162b..00000000 --- a/client/images/svg/settings_black_24dp.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/client/images/svg/settings_suggest_black_24dp.svg b/client/images/svg/settings_suggest_black_24dp.svg deleted file mode 100644 index 80053d0e..00000000 --- a/client/images/svg/settings_suggest_black_24dp.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/client/images/svg/share_black_24dp.svg b/client/images/svg/share_black_24dp.svg deleted file mode 100644 index 4c5fa323..00000000 --- a/client/images/svg/share_black_24dp.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/client/images/svg/vpn_key_black_24dp.svg b/client/images/svg/vpn_key_black_24dp.svg deleted file mode 100644 index 2c18df46..00000000 --- a/client/images/svg/vpn_key_black_24dp.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/client/images/uncheck.png b/client/images/uncheck.png deleted file mode 100644 index b6723a44..00000000 Binary files a/client/images/uncheck.png and /dev/null differ diff --git a/client/images/upload.png b/client/images/upload.png deleted file mode 100644 index 185e7a7b..00000000 Binary files a/client/images/upload.png and /dev/null differ diff --git a/client/logger.h b/client/logger.h deleted file mode 100644 index 0dcbd35c..00000000 --- a/client/logger.h +++ /dev/null @@ -1,107 +0,0 @@ -#ifndef LOGGER_H -#define LOGGER_H - -#include -#include -#include -#include -#include - -#include "ui/property_helper.h" - -#include "mozilla/shared/loglevel.h" - -class Logger : public QObject -{ - Q_OBJECT - AUTO_PROPERTY(QString, sshLog) - AUTO_PROPERTY(QString, allLog) - -public: - static Logger& Instance(); - - static void appendSshLog(const QString &log); - static void appendAllLog(const QString &log); - - - static bool init(); - static void deInit(); - static bool setServiceLogsEnabled(bool enabled); - static bool openLogsFolder(); - static bool openServiceLogsFolder(); - static QString appLogFileNamePath(); - static void clearLogs(); - static void clearServiceLogs(); - static void cleanUp(); - - static QString userLogsFilePath(); - static QString getLogFile(); - - // compat with Mozilla logger - Logger(const QString &className) { m_className = className; } - const QString& className() const { return m_className; } - - class Log { - public: - Log(Logger* logger, LogLevel level); - ~Log(); - - Log& operator<<(uint64_t t); - Log& operator<<(const char* t); - Log& operator<<(const QString& t); - Log& operator<<(const QStringList& t); - Log& operator<<(const QByteArray& t); - Log& operator<<(const QJsonObject& t); - Log& operator<<(QTextStreamFunction t); - Log& operator<<(const void* t); - - // Q_ENUM - template - typename std::enable_if::Value, Log&>::type - operator<<(T t) { - const QMetaObject* meta = qt_getEnumMetaObject(t); - const char* name = qt_getEnumName(t); - addMetaEnum(typename QFlags::Int(t), meta, name); - return *this; - } - - private: - void addMetaEnum(quint64 value, const QMetaObject* meta, const char* name); - - Logger* m_logger; - LogLevel m_logLevel; - - struct Data { - Data() : m_ts(&m_buffer, QIODevice::WriteOnly) {} - - QString m_buffer; - QTextStream m_ts; - }; - - Data* m_data; - }; - - Log error(); - Log warning(); - Log info(); - Log debug(); - QString sensitive(const QString& input); - -private: - Logger() {} - Logger(Logger const &) = delete; - Logger& operator= (Logger const&) = delete; - - static QString userLogsDir(); - - static QFile m_file; - static QTextStream m_textStream; - static QString m_logFileName; - - friend void debugMessageHandler(QtMsgType type, const QMessageLogContext& context, const QString& msg); - - // compat with Mozilla logger - QString m_className; -}; - -#endif // LOGGER_H diff --git a/client/main.cpp b/client/main.cpp index 3a719096..aca9e62b 100644 --- a/client/main.cpp +++ b/client/main.cpp @@ -15,13 +15,24 @@ #include "platforms/ios/QtAppDelegate-C-Interface.h" #endif +#if !defined(Q_OS_ANDROID) && !defined(Q_OS_IOS) +bool isAnotherInstanceRunning() +{ + QLocalSocket socket; + socket.connectToServer("AmneziaVPNInstance"); + if (socket.waitForConnected(500)) { + qWarning() << "AmneziaVPN is already running"; + return true; + } + return false; +} +#endif + int main(int argc, char *argv[]) { Migrations migrationsManager; migrationsManager.doMigrations(); - QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling, true); - #ifdef Q_OS_WIN AllowSetForegroundWindow(ASFW_ANY); #endif @@ -32,16 +43,14 @@ int main(int argc, char *argv[]) qputenv("ANDROID_OPENSSL_SUFFIX", "_3"); #endif -#if defined(Q_OS_ANDROID) || defined(Q_OS_IOS) AmneziaApplication app(argc, argv); -#else - AmneziaApplication app(argc, argv, true, - SingleApplication::Mode::User | SingleApplication::Mode::SecondaryNotification); - if (!app.isPrimary()) { +#if !defined(Q_OS_ANDROID) && !defined(Q_OS_IOS) + if (isAnotherInstanceRunning()) { QTimer::singleShot(1000, &app, [&]() { app.quit(); }); return app.exec(); } + app.startLocalServer(); #endif // Allow to raise app window if secondary instance launched diff --git a/client/mozilla/localsocketcontroller.cpp b/client/mozilla/localsocketcontroller.cpp index 0502facc..4d040288 100644 --- a/client/mozilla/localsocketcontroller.cpp +++ b/client/mozilla/localsocketcontroller.cpp @@ -149,7 +149,7 @@ void LocalSocketController::activate(const QJsonObject &rawConfig) { QJsonArray jsAllowedIPAddesses; QJsonArray plainAllowedIP = wgConfig.value(amnezia::config_key::allowed_ips).toArray(); - QJsonArray defaultAllowedIP = QJsonArray::fromStringList(QString("0.0.0.0/0, ::/0").split(",")); + QJsonArray defaultAllowedIP = { "0.0.0.0/0", "::/0" }; if (plainAllowedIP != defaultAllowedIP && !plainAllowedIP.isEmpty()) { // Use AllowedIP list from WG config because of higher priority diff --git a/client/platforms/android/android_controller.cpp b/client/platforms/android/android_controller.cpp index c9ee3cfd..2790eb1b 100644 --- a/client/platforms/android/android_controller.cpp +++ b/client/platforms/android/android_controller.cpp @@ -98,6 +98,7 @@ bool AndroidController::initialize() {"onStatisticsUpdate", "(JJ)V", reinterpret_cast(onStatisticsUpdate)}, {"onFileOpened", "(Ljava/lang/String;)V", reinterpret_cast(onFileOpened)}, {"onConfigImported", "(Ljava/lang/String;)V", reinterpret_cast(onConfigImported)}, + {"onAuthResult", "(Z)V", reinterpret_cast(onAuthResult)}, {"decodeQrCode", "(Ljava/lang/String;)Z", reinterpret_cast(decodeQrCode)} }; @@ -210,6 +211,11 @@ void AndroidController::setScreenshotsEnabled(bool enabled) callActivityMethod("setScreenshotsEnabled", "(Z)V", enabled); } +void AndroidController::setNavigationBarColor(unsigned int color) +{ + callActivityMethod("setNavigationBarColor", "(I)V", color); +} + void AndroidController::minimizeApp() { callActivityMethod("minimizeApp", "()V"); @@ -265,6 +271,22 @@ void AndroidController::requestNotificationPermission() callActivityMethod("requestNotificationPermission", "()V"); } +bool AndroidController::requestAuthentication() +{ + QEventLoop wait; + bool result; + connect(this, &AndroidController::authenticationResult, this, + [&result, &wait](const bool &authResult){ + qDebug() << "Android authentication result:" << authResult; + result = authResult; + wait.quit(); + }, + static_cast(Qt::QueuedConnection | Qt::SingleShotConnection)); + callActivityMethod("requestAuthentication", "()V"); + wait.exec(); + return result; +} + // Moving log processing to the Android side jclass AndroidController::log; jmethodID AndroidController::logDebug; @@ -462,6 +484,14 @@ void AndroidController::onConfigImported(JNIEnv *env, jobject thiz, jstring data emit AndroidController::instance()->configImported(AndroidUtils::convertJString(env, data)); } +// static +void AndroidController::onAuthResult(JNIEnv *env, jobject thiz, jboolean result) +{ + Q_UNUSED(thiz); + + emit AndroidController::instance()->authenticationResult(result); +} + // static bool AndroidController::decodeQrCode(JNIEnv *env, jobject thiz, jstring data) { diff --git a/client/platforms/android/android_controller.h b/client/platforms/android/android_controller.h index 1041c31f..759c9c3f 100644 --- a/client/platforms/android/android_controller.h +++ b/client/platforms/android/android_controller.h @@ -41,11 +41,13 @@ public: void exportLogsFile(const QString &fileName); void clearLogs(); void setScreenshotsEnabled(bool enabled); + void setNavigationBarColor(unsigned int color); void minimizeApp(); QJsonArray getAppList(); QPixmap getAppIcon(const QString &package, QSize *size, const QSize &requestedSize); bool isNotificationPermissionGranted(); void requestNotificationPermission(); + bool requestAuthentication(); static bool initLogging(); static void messageHandler(QtMsgType type, const QMessageLogContext &context, const QString &message); @@ -63,6 +65,7 @@ signals: void configImported(QString config); void importConfigFromOutside(QString config); void initConnectionState(Vpn::ConnectionState state); + void authenticationResult(bool result); private: bool isWaitingStatus = true; @@ -89,6 +92,7 @@ private: static void onStatisticsUpdate(JNIEnv *env, jobject thiz, jlong rxBytes, jlong txBytes); static void onConfigImported(JNIEnv *env, jobject thiz, jstring data); static void onFileOpened(JNIEnv *env, jobject thiz, jstring uri); + static void onAuthResult(JNIEnv *env, jobject thiz, jboolean result); static bool decodeQrCode(JNIEnv *env, jobject thiz, jstring data); template diff --git a/client/platforms/android/authResultReceiver.cpp b/client/platforms/android/authResultReceiver.cpp deleted file mode 100644 index 21e838a2..00000000 --- a/client/platforms/android/authResultReceiver.cpp +++ /dev/null @@ -1,16 +0,0 @@ -#include "authResultReceiver.h" - -AuthResultReceiver::AuthResultReceiver(QSharedPointer ¬ifier) : m_notifier(notifier) -{ -} - -void AuthResultReceiver::handleActivityResult(int receiverRequestCode, int resultCode, const QJniObject &data) -{ - qDebug() << "receiverRequestCode" << receiverRequestCode << "resultCode" << resultCode; - - if (resultCode == -1) { // ResultOK - emit m_notifier->authSuccessful(); - } else { - emit m_notifier->authFailed(); - } -} diff --git a/client/platforms/android/authResultReceiver.h b/client/platforms/android/authResultReceiver.h deleted file mode 100644 index 9a88dcf5..00000000 --- a/client/platforms/android/authResultReceiver.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef AUTHRESULTRECEIVER_H -#define AUTHRESULTRECEIVER_H - -#include - -#include - -class AuthResultNotifier : public QObject -{ - Q_OBJECT - -public: - AuthResultNotifier(QObject *parent = nullptr) : QObject(parent) {}; - -signals: - void authFailed(); - void authSuccessful(); -}; - -/* Auth result handler for Android */ -class AuthResultReceiver final : public QAndroidActivityResultReceiver -{ -public: - AuthResultReceiver(QSharedPointer ¬ifier); - - void handleActivityResult(int receiverRequestCode, int resultCode, const QJniObject &data) override; - -private: - QSharedPointer m_notifier; -}; - -#endif // AUTHRESULTRECEIVER_H diff --git a/client/platforms/ios/ios_controller.mm b/client/platforms/ios/ios_controller.mm index f4ba2798..85fb50b7 100644 --- a/client/platforms/ios/ios_controller.mm +++ b/client/platforms/ios/ios_controller.mm @@ -351,8 +351,6 @@ void IosController::vpnStatusDidChange(void *pNotification) } } } - } else { - qDebug() << "Disconnect error is absent"; } }]; } else { @@ -501,6 +499,20 @@ bool IosController::setupWireGuard() wgConfig.insert(config_key::persistent_keep_alive, "25"); } + if (config.contains(config_key::isObfuscationEnabled) && config.value(config_key::isObfuscationEnabled).toBool()) { + wgConfig.insert(config_key::initPacketMagicHeader, config[config_key::initPacketMagicHeader]); + wgConfig.insert(config_key::responsePacketMagicHeader, config[config_key::responsePacketMagicHeader]); + wgConfig.insert(config_key::underloadPacketMagicHeader, config[config_key::underloadPacketMagicHeader]); + wgConfig.insert(config_key::transportPacketMagicHeader, config[config_key::transportPacketMagicHeader]); + + wgConfig.insert(config_key::initPacketJunkSize, config[config_key::initPacketJunkSize]); + wgConfig.insert(config_key::responsePacketJunkSize, config[config_key::responsePacketJunkSize]); + + wgConfig.insert(config_key::junkPacketCount, config[config_key::junkPacketCount]); + wgConfig.insert(config_key::junkPacketMinSize, config[config_key::junkPacketMinSize]); + wgConfig.insert(config_key::junkPacketMaxSize, config[config_key::junkPacketMaxSize]); + } + QJsonDocument wgConfigDoc(wgConfig); QString wgConfigDocStr(wgConfigDoc.toJson(QJsonDocument::Compact)); @@ -835,7 +847,7 @@ QString IosController::openFile() { void IosController::requestInetAccess() { NSURL *url = [NSURL URLWithString:@"http://captive.apple.com/generate_204"]; - if (url) { + if (!url) { qDebug() << "IosController::requestInetAccess URL error"; return; } @@ -847,7 +859,6 @@ void IosController::requestInetAccess() { } else { NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *)response; QString responseBody = QString::fromUtf8((const char*)data.bytes, data.length); - qDebug() << "IosController::requestInetAccess server response:" << httpResponse.statusCode << "\n\n" <setAutoRemove(false); + certFile->open(); + QString m_filename = certFile->fileName(); + certFile->write(cert); + certFile->close(); + delete certFile; { auto certInstallProcess = IpcClient::CreatePrivilegedProcess(); @@ -193,19 +196,19 @@ ErrorCode Ikev2Protocol::start() return ErrorCode::AmneziaServiceConnectionFailed; } - certInstallProcess->waitForSource(1000); + certInstallProcess->waitForSource(); if (!certInstallProcess->isInitialized()) { qWarning() << "IpcProcess replica is not connected!"; setLastError(ErrorCode::AmneziaServiceConnectionFailed); return ErrorCode::AmneziaServiceConnectionFailed; } certInstallProcess->setProgram(PermittedProcess::CertUtil); - QStringList arguments({"-f" , "-importpfx", - "-p", m_config[config_key::password].toString(), - certFile.fileName(), "NoExport" - }); - certInstallProcess->setArguments(arguments); + QStringList arguments({"-f", "-importpfx", "-p", m_config[config_key::password].toString(), + QDir::toNativeSeparators(m_filename), "NoExport" + }); + + certInstallProcess->setArguments(arguments); certInstallProcess->start(); } // /* @@ -219,40 +222,40 @@ ErrorCode Ikev2Protocol::start() } { - { - if ( !create_new_vpn(tunnelName(), m_config[config_key::hostName].toString())){ - qDebug() <<"Can't create the VPN connect"; - } - } - } + { + if ( !create_new_vpn(tunnelName(), m_config[config_key::hostName].toString())){ + qDebug() <<"Can't create the VPN connect"; +} +} +} - { - auto adapterConfigProcess = new QProcess; +{ + QProcess adapterConfigProcess; + adapterConfigProcess.setProgram("powershell"); + QString arguments = QString("-command \"Set-VpnConnectionIPsecConfiguration\" " + "-ConnectionName '%1' " + "-AuthenticationTransformConstants GCMAES128 " + "-CipherTransformConstants GCMAES128 " + "-EncryptionMethod AES256 " + "-IntegrityCheckMethod SHA256 " + "-PfsGroup None " + "-DHGroup Group14 " + "-PassThru -Force\"") + .arg(tunnelName()); - adapterConfigProcess->setProgram("powershell"); - QString arguments = QString("-command \"Set-VpnConnectionIPsecConfiguration\" " - "-ConnectionName '%1' " - "-AuthenticationTransformConstants GCMAES128 " - "-CipherTransformConstants GCMAES128 " - "-EncryptionMethod AES256 " - "-IntegrityCheckMethod SHA256 " - "-PfsGroup None " - "-DHGroup Group14 " - "-PassThru -Force\"") - .arg(tunnelName()); - adapterConfigProcess->setNativeArguments(arguments); + adapterConfigProcess.setNativeArguments(arguments); - adapterConfigProcess->start(); - adapterConfigProcess->waitForFinished(5000); + adapterConfigProcess.start(); + adapterConfigProcess.waitForFinished(5000); +} +//*/ +{ + if (!connect_to_vpn(tunnelName())) { + qDebug()<<"We can't connect to VPN"; } - //*/ - { - if (!connect_to_vpn(tunnelName())) { - qDebug()<<"We can't connect to VPN"; - } - } - //setConnectionState(Connecting); - return ErrorCode::NoError; +} +//setConnectionState(Connecting); +return ErrorCode::NoError; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bool Ikev2Protocol::create_new_vpn(const QString & vpn_name, @@ -299,6 +302,7 @@ bool Ikev2Protocol::connect_to_vpn(const QString & vpn_name){ auto ret = RasDial(NULL, NULL, &RasDialParams, 0, &RasDialFuncCallback, &hRasConn); + if (ret == ERROR_SUCCESS){ return true; } diff --git a/client/protocols/openvpnprotocol.cpp b/client/protocols/openvpnprotocol.cpp index 04a18327..4c2feb52 100644 --- a/client/protocols/openvpnprotocol.cpp +++ b/client/protocols/openvpnprotocol.cpp @@ -6,6 +6,7 @@ #include #include +#include "core/networkUtilities.h" #include "logger.h" #include "openvpnprotocol.h" #include "utilities.h" @@ -127,7 +128,6 @@ void OpenVpnProtocol::sendManagementCommand(const QString &command) uint OpenVpnProtocol::selectMgmtPort() { - for (int i = 0; i < 100; ++i) { quint32 port = QRandomGenerator::global()->generate(); port = (double)(65000 - 15001) * port / UINT32_MAX + 15001; @@ -137,7 +137,6 @@ uint OpenVpnProtocol::selectMgmtPort() if (ok) return port; } - return m_managementPort; } @@ -343,7 +342,8 @@ void OpenVpnProtocol::updateVpnGateway(const QString &line) } m_configData.insert("vpnAdapterIndex", netInterfaces.at(i).index()); m_configData.insert("vpnGateway", m_vpnGateway); - m_configData.insert("vpnServer", m_configData.value(amnezia::config_key::hostName).toString()); + m_configData.insert("vpnServer", + NetworkUtilities::getIPAddress(m_configData.value(amnezia::config_key::hostName).toString())); IpcClient::Interface()->enablePeerTraffic(m_configData); } } @@ -352,6 +352,8 @@ void OpenVpnProtocol::updateVpnGateway(const QString &line) #if defined(Q_OS_LINUX) || defined(Q_OS_MACOS) // killSwitch toggle if (QVariant(m_configData.value(config_key::killSwitchOption).toString()).toBool()) { + m_configData.insert("vpnServer", + NetworkUtilities::getIPAddress(m_configData.value(amnezia::config_key::hostName).toString())); IpcClient::Interface()->enableKillSwitch(m_configData, 0); } #endif diff --git a/client/protocols/protocols_defs.cpp b/client/protocols/protocols_defs.cpp index 2c9cf186..ac5bb1ad 100644 --- a/client/protocols/protocols_defs.cpp +++ b/client/protocols/protocols_defs.cpp @@ -154,6 +154,7 @@ bool ProtocolProps::defaultPortChangeable(Proto p) case Proto::Awg: return true; case Proto::Ikev2: return false; case Proto::L2tp: return false; + case Proto::Xray: return true; case Proto::TorWebSite: return false; case Proto::Dns: return false; diff --git a/client/protocols/protocols_defs.h b/client/protocols/protocols_defs.h index c6863b90..498c89a0 100644 --- a/client/protocols/protocols_defs.h +++ b/client/protocols/protocols_defs.h @@ -65,6 +65,7 @@ namespace amnezia constexpr char last_config[] = "last_config"; constexpr char isThirdPartyConfig[] = "isThirdPartyConfig"; + constexpr char isObfuscationEnabled[] = "isObfuscationEnabled"; constexpr char junkPacketCount[] = "Jc"; constexpr char junkPacketMinSize[] = "Jmin"; diff --git a/client/protocols/wireguardprotocol.cpp b/client/protocols/wireguardprotocol.cpp index 61b2e261..80579f16 100644 --- a/client/protocols/wireguardprotocol.cpp +++ b/client/protocols/wireguardprotocol.cpp @@ -4,9 +4,8 @@ #include #include -#include "logger.h" -#include "utilities.h" #include "wireguardprotocol.h" +#include "core/networkUtilities.h" #include "mozilla/localsocketcontroller.h" @@ -37,6 +36,12 @@ void WireguardProtocol::stop() ErrorCode WireguardProtocol::startMzImpl() { + QString protocolName = m_rawConfig.value("protocol").toString(); + QJsonObject vpnConfigData = m_rawConfig.value(protocolName + "_config_data").toObject(); + vpnConfigData[config_key::hostName] = NetworkUtilities::getIPAddress(vpnConfigData.value(config_key::hostName).toString()); + m_rawConfig.insert(protocolName + "_config_data", vpnConfigData); + m_rawConfig[config_key::hostName] = NetworkUtilities::getIPAddress(m_rawConfig[config_key::hostName].toString()); + m_impl->activate(m_rawConfig); return ErrorCode::NoError; } diff --git a/client/protocols/xrayprotocol.cpp b/client/protocols/xrayprotocol.cpp old mode 100644 new mode 100755 index 15106c51..2dfbcc21 --- a/client/protocols/xrayprotocol.cpp +++ b/client/protocols/xrayprotocol.cpp @@ -17,6 +17,7 @@ XrayProtocol::XrayProtocol(const QJsonObject &configuration, QObject *parent): m_routeGateway = NetworkUtilities::getGatewayAndIface(); m_vpnGateway = amnezia::protocols::xray::defaultLocalAddr; m_vpnLocalAddress = amnezia::protocols::xray::defaultLocalAddr; + m_t2sProcess = IpcClient::InterfaceTun2Socks(); } XrayProtocol::~XrayProtocol() @@ -43,7 +44,9 @@ ErrorCode XrayProtocol::start() m_xrayCfgFile.setAutoRemove(false); #endif m_xrayCfgFile.open(); - m_xrayCfgFile.write(QJsonDocument(m_xrayConfig).toJson()); + QString config = QJsonDocument(m_xrayConfig).toJson(); + config.replace(m_remoteHost, m_remoteAddress); + m_xrayCfgFile.write(config.toUtf8()); m_xrayCfgFile.close(); QStringList args = QStringList() << "-c" << m_xrayCfgFile.fileName() << "-format=json"; @@ -63,7 +66,7 @@ ErrorCode XrayProtocol::start() }); connect(&m_xrayProcess, QOverload::of(&QProcess::finished), this, [this](int exitCode, QProcess::ExitStatus exitStatus) { - qDebug().noquote() << "XrayProtocol finished, exitCode, exiStatus" << exitCode << exitStatus; + qDebug().noquote() << "XrayProtocol finished, exitCode, exitStatus" << exitCode << exitStatus; setConnectionState(Vpn::ConnectionState::Disconnected); if (exitStatus != QProcess::NormalExit) { emit protocolError(amnezia::ErrorCode::XrayExecutableCrashed); @@ -89,116 +92,80 @@ ErrorCode XrayProtocol::start() ErrorCode XrayProtocol::startTun2Sock() { - if (!QFileInfo::exists(Utils::tun2socksPath())) { - setLastError(ErrorCode::Tun2SockExecutableMissing); - return lastError(); - } - - m_t2sProcess = IpcClient::CreatePrivilegedProcess(); - - if (!m_t2sProcess) { - setLastError(ErrorCode::AmneziaServiceConnectionFailed); - return ErrorCode::AmneziaServiceConnectionFailed; - } - - m_t2sProcess->waitForSource(1000); - if (!m_t2sProcess->isInitialized()) { - qWarning() << "IpcProcess replica is not connected!"; - setLastError(ErrorCode::AmneziaServiceConnectionFailed); - return ErrorCode::AmneziaServiceConnectionFailed; - } - - QString XrayConStr = "socks5://127.0.0.1:" + QString::number(m_localPort); - - m_t2sProcess->setProgram(PermittedProcess::Tun2Socks); -#ifdef Q_OS_WIN - m_configData.insert("inetAdapterIndex", NetworkUtilities::AdapterIndexTo(QHostAddress(m_remoteAddress))); - QStringList arguments({"-device", "tun://tun2", "-proxy", XrayConStr, "-tun-post-up", - QString("cmd /c netsh interface ip set address name=\"tun2\" static %1 255.255.255.255").arg(amnezia::protocols::xray::defaultLocalAddr)}); -#endif -#ifdef Q_OS_LINUX - QStringList arguments({"-device", "tun://tun2", "-proxy", XrayConStr}); -#endif -#ifdef Q_OS_MAC - QStringList arguments({"-device", "utun22", "-proxy", XrayConStr}); -#endif - m_t2sProcess->setArguments(arguments); - - qDebug() << arguments.join(" "); - connect(m_t2sProcess.data(), &PrivilegedProcess::errorOccurred, - [&](QProcess::ProcessError error) { qDebug() << "PrivilegedProcess errorOccurred" << error; }); - - connect(m_t2sProcess.data(), &PrivilegedProcess::stateChanged, - [&](QProcess::ProcessState newState) { - qDebug() << "PrivilegedProcess stateChanged" << newState; - if (newState == QProcess::Running) - { - setConnectionState(Vpn::ConnectionState::Connecting); - QList dnsAddr; - dnsAddr.push_back(QHostAddress(m_configData.value(config_key::dns1).toString())); - dnsAddr.push_back(QHostAddress(m_configData.value(config_key::dns2).toString())); - -#ifdef Q_OS_MACOS - QThread::msleep(5000); - IpcClient::Interface()->createTun("utun22", amnezia::protocols::xray::defaultLocalAddr); - IpcClient::Interface()->updateResolvers("utun22", dnsAddr); -#endif -#ifdef Q_OS_WINDOWS - QThread::msleep(15000); -#endif -#ifdef Q_OS_LINUX - QThread::msleep(1000); - IpcClient::Interface()->createTun("tun2", amnezia::protocols::xray::defaultLocalAddr); - IpcClient::Interface()->updateResolvers("tun2", dnsAddr); -#endif -#if defined(Q_OS_LINUX) || defined(Q_OS_MACOS) - // killSwitch toggle - if (QVariant(m_configData.value(config_key::killSwitchOption).toString()).toBool()) { - IpcClient::Interface()->enableKillSwitch(m_configData, 0); - } -#endif - if (m_routeMode == 0) { - IpcClient::Interface()->routeAddList(m_vpnGateway, QStringList() << "0.0.0.0/1"); - IpcClient::Interface()->routeAddList(m_vpnGateway, QStringList() << "128.0.0.0/1"); - IpcClient::Interface()->routeAddList(m_routeGateway, QStringList() << m_remoteAddress); - } - IpcClient::Interface()->StopRoutingIpv6(); -#ifdef Q_OS_WIN - IpcClient::Interface()->updateResolvers("tun2", dnsAddr); - QList netInterfaces = QNetworkInterface::allInterfaces(); - for (int i = 0; i < netInterfaces.size(); i++) { - for (int j=0; j < netInterfaces.at(i).addressEntries().size(); j++) - { - // killSwitch toggle - if (m_vpnLocalAddress == netInterfaces.at(i).addressEntries().at(j).ip().toString()) { - if (QVariant(m_configData.value(config_key::killSwitchOption).toString()).toBool()) { - IpcClient::Interface()->enableKillSwitch(QJsonObject(), netInterfaces.at(i).index()); - } - m_configData.insert("vpnAdapterIndex", netInterfaces.at(i).index()); - m_configData.insert("vpnGateway", m_vpnGateway); - m_configData.insert("vpnServer", m_remoteAddress); - IpcClient::Interface()->enablePeerTraffic(m_configData); - } - } - } -#endif - setConnectionState(Vpn::ConnectionState::Connected); - } - }); - - -#if !defined(Q_OS_MACOS) - connect(m_t2sProcess.data(), &PrivilegedProcess::finished, this, - [&]() { - setConnectionState(Vpn::ConnectionState::Disconnected); - IpcClient::Interface()->deleteTun("tun2"); - IpcClient::Interface()->StartRoutingIpv6(); - IpcClient::Interface()->clearSavedRoutes(); - }); -#endif - m_t2sProcess->start(); +#ifdef Q_OS_WIN + m_configData.insert("inetAdapterIndex", NetworkUtilities::AdapterIndexTo(QHostAddress(m_remoteAddress))); +#endif + + connect(m_t2sProcess.data(), &IpcProcessTun2SocksReplica::stateChanged, this, + [&](QProcess::ProcessState newState) { qDebug() << "PrivilegedProcess stateChanged" << newState; }); + + connect(m_t2sProcess.data(), &IpcProcessTun2SocksReplica::setConnectionState, this, + [&](int vpnState) { + qDebug() << "PrivilegedProcess setConnectionState " << vpnState; + if (vpnState == Vpn::ConnectionState::Connected) + { + setConnectionState(Vpn::ConnectionState::Connecting); + QList dnsAddr; + dnsAddr.push_back(QHostAddress(m_configData.value(config_key::dns1).toString())); + dnsAddr.push_back(QHostAddress(m_configData.value(config_key::dns2).toString())); +#ifdef Q_OS_WIN + QThread::msleep(8000); +#endif +#ifdef Q_OS_MACOS + QThread::msleep(5000); + IpcClient::Interface()->createTun("utun22", amnezia::protocols::xray::defaultLocalAddr); + IpcClient::Interface()->updateResolvers("utun22", dnsAddr); +#endif +#ifdef Q_OS_LINUX + QThread::msleep(1000); + IpcClient::Interface()->createTun("tun2", amnezia::protocols::xray::defaultLocalAddr); + IpcClient::Interface()->updateResolvers("tun2", dnsAddr); +#endif +#if defined(Q_OS_LINUX) || defined(Q_OS_MACOS) + // killSwitch toggle + if (QVariant(m_configData.value(config_key::killSwitchOption).toString()).toBool()) { + m_configData.insert("vpnServer", m_remoteAddress); + IpcClient::Interface()->enableKillSwitch(m_configData, 0); + } +#endif + if (m_routeMode == 0) { + IpcClient::Interface()->routeAddList(m_vpnGateway, QStringList() << "0.0.0.0/1"); + IpcClient::Interface()->routeAddList(m_vpnGateway, QStringList() << "128.0.0.0/1"); + IpcClient::Interface()->routeAddList(m_routeGateway, QStringList() << m_remoteAddress); + } + IpcClient::Interface()->StopRoutingIpv6(); +#ifdef Q_OS_WIN + IpcClient::Interface()->updateResolvers("tun2", dnsAddr); + QList netInterfaces = QNetworkInterface::allInterfaces(); + for (int i = 0; i < netInterfaces.size(); i++) { + for (int j = 0; j < netInterfaces.at(i).addressEntries().size(); j++) + { + // killSwitch toggle + if (m_vpnLocalAddress == netInterfaces.at(i).addressEntries().at(j).ip().toString()) { + if (QVariant(m_configData.value(config_key::killSwitchOption).toString()).toBool()) { + IpcClient::Interface()->enableKillSwitch(QJsonObject(), netInterfaces.at(i).index()); + } + m_configData.insert("vpnAdapterIndex", netInterfaces.at(i).index()); + m_configData.insert("vpnGateway", m_vpnGateway); + m_configData.insert("vpnServer", m_remoteAddress); + IpcClient::Interface()->enablePeerTraffic(m_configData); + } + } + } +#endif + setConnectionState(Vpn::ConnectionState::Connected); + } +#if !defined(Q_OS_MACOS) + if (vpnState == Vpn::ConnectionState::Disconnected) { + setConnectionState(Vpn::ConnectionState::Disconnected); + IpcClient::Interface()->deleteTun("tun2"); + IpcClient::Interface()->StartRoutingIpv6(); + IpcClient::Interface()->clearSavedRoutes(); + } +#endif + }); return ErrorCode::NoError; } @@ -212,7 +179,7 @@ void XrayProtocol::stop() qDebug() << "XrayProtocol::stop()"; m_xrayProcess.terminate(); if (m_t2sProcess) { - m_t2sProcess->close(); + m_t2sProcess->stop(); } #ifdef Q_OS_WIN @@ -238,7 +205,8 @@ void XrayProtocol::readXrayConfiguration(const QJsonObject &configuration) } m_xrayConfig = xrayConfiguration; m_localPort = QString(amnezia::protocols::xray::defaultLocalProxyPort).toInt(); - m_remoteAddress = configuration.value(amnezia::config_key::hostName).toString(); + m_remoteHost = configuration.value(amnezia::config_key::hostName).toString(); + m_remoteAddress = NetworkUtilities::getIPAddress(m_remoteHost); m_routeMode = configuration.value(amnezia::config_key::splitTunnelType).toInt(); m_primaryDNS = configuration.value(amnezia::config_key::dns1).toString(); m_secondaryDNS = configuration.value(amnezia::config_key::dns2).toString(); diff --git a/client/protocols/xrayprotocol.h b/client/protocols/xrayprotocol.h index 8df2afb2..ee632333 100644 --- a/client/protocols/xrayprotocol.h +++ b/client/protocols/xrayprotocol.h @@ -26,6 +26,7 @@ private: static QString tun2SocksExecPath(); private: int m_localPort; + QString m_remoteHost; QString m_remoteAddress; int m_routeMode; QJsonObject m_configData; @@ -33,9 +34,10 @@ private: QString m_secondaryDNS; #ifndef Q_OS_IOS QProcess m_xrayProcess; - QSharedPointer m_t2sProcess; + QSharedPointer m_t2sProcess; #endif QTemporaryFile m_xrayCfgFile; + }; #endif // XRAYPROTOCOL_H diff --git a/client/resources.qrc b/client/resources.qrc index 98f04802..a10a784d 100644 --- a/client/resources.qrc +++ b/client/resources.qrc @@ -1,18 +1,9 @@ - images/close.png - images/settings.png - images/favorites_disabled.png - images/favorites_enabled.png - images/favorites_hover.png - images/download.png - images/upload.png images/tray/active.png images/tray/default.png images/tray/error.png - images/arrow_left.png images/AmneziaVPN.png - images/share.png server_scripts/remove_container.sh server_scripts/setup_host_firewall.sh server_scripts/openvpn_cloak/Dockerfile @@ -22,9 +13,6 @@ server_scripts/install_docker.sh server_scripts/build_container.sh server_scripts/prepare_host.sh - images/check.png - images/uncheck.png - images/settings_grey.png server_scripts/check_connection.sh server_scripts/remove_all_containers.sh server_scripts/openvpn_cloak/run_container.sh @@ -38,7 +26,6 @@ server_scripts/openvpn_shadowsocks/run_container.sh server_scripts/openvpn_shadowsocks/start.sh server_scripts/openvpn_shadowsocks/template.ovpn - images/folder.png server_scripts/wireguard/configure_container.sh server_scripts/wireguard/Dockerfile server_scripts/wireguard/run_container.sh @@ -61,26 +48,6 @@ server_scripts/ipsec/start.sh server_scripts/ipsec/mobileconfig.plist server_scripts/ipsec/strongswan.profile - images/background_connected.png - images/background_connected@2x.png - images/delete.png - images/animation.gif - images/connected.png - images/disconnected.png - images/svg/gpp_good_black_24dp.svg - images/svg/gpp_maybe_black_24dp.svg - images/svg/close_black_24dp.svg - images/svg/delete_black_24dp.svg - images/svg/done_black_24dp.svg - images/svg/format_list_bulleted_black_24dp.svg - images/svg/logout_black_24dp.svg - images/svg/miscellaneous_services_black_24dp.svg - images/svg/refresh_black_24dp.svg - images/svg/settings_black_24dp.svg - images/svg/share_black_24dp.svg - images/svg/vpn_key_black_24dp.svg - images/svg/control_point_black_24dp.svg - images/svg/settings_suggest_black_24dp.svg server_scripts/website_tor/Dockerfile server_scripts/check_user_in_sudo.sh ui/qml/Controls2/BasicButtonType.qml @@ -96,7 +63,6 @@ ui/qml/Pages2/PageSetupWizardStart.qml ui/qml/main2.qml images/amneziaBigLogo.png - images/amneziaBigLogo.svg ui/qml/Controls2/FlickableType.qml ui/qml/Pages2/PageSetupWizardCredentials.qml ui/qml/Controls2/HeaderType.qml @@ -132,9 +98,6 @@ ui/qml/Controls2/Header2Type.qml images/controls/plus.svg ui/qml/Components/ConnectButton.qml - images/connectionProgress.svg - images/connectionOff.svg - images/connectionOn.svg images/controls/download.svg ui/qml/Controls2/ProgressBarType.qml ui/qml/Components/ConnectionTypeSelectionDrawer.qml @@ -236,5 +199,276 @@ server_scripts/socks5_proxy/Dockerfile server_scripts/socks5_proxy/configure_container.sh server_scripts/socks5_proxy/start.sh + ui/qml/Pages2/PageProtocolAwgClientSettings.qml + ui/qml/Pages2/PageProtocolWireGuardClientSettings.qml + ui/qml/Pages2/PageSetupWizardApiServicesList.qml + ui/qml/Pages2/PageSetupWizardApiServiceInfo.qml + ui/qml/Controls2/CardWithIconsType.qml + images/controls/tag.svg + images/controls/history.svg + images/controls/gauge.svg + images/controls/map-pin.svg + ui/qml/Controls2/LabelWithImageType.qml + images/controls/info.svg + ui/qml/Controls2/TextAreaWithFooterType.qml + images/controls/scan-line.svg + images/controls/folder-search-2.svg + ui/qml/Pages2/PageSettingsApiServerInfo.qml + images/controls/bug.svg + ui/qml/Pages2/PageDevMenu.qml + images/controls/refresh-cw.svg + ui/qml/Pages2/PageSettingsApiLanguageList.qml + images/controls/archive-restore.svg + images/controls/help-circle.svg + + + images/flagKit/ZW.svg + images/flagKit/ZM.svg + images/flagKit/ZA.svg + images/flagKit/YT.svg + images/flagKit/YE.svg + images/flagKit/XK.svg + images/flagKit/WS.svg + images/flagKit/WF.svg + images/flagKit/VU.svg + images/flagKit/VN.svg + images/flagKit/VI.svg + images/flagKit/VG.svg + images/flagKit/VE.svg + images/flagKit/VC.svg + images/flagKit/VA.svg + images/flagKit/UZ.svg + images/flagKit/UY.svg + images/flagKit/US.svg + images/flagKit/UM.svg + images/flagKit/UG.svg + images/flagKit/UA.svg + images/flagKit/TZ.svg + images/flagKit/TW.svg + images/flagKit/TV.svg + images/flagKit/TT.svg + images/flagKit/TR.svg + images/flagKit/TO.svg + images/flagKit/TN.svg + images/flagKit/TM.svg + images/flagKit/TL.svg + images/flagKit/TK.svg + images/flagKit/TJ.svg + images/flagKit/TH.svg + images/flagKit/TG.svg + images/flagKit/TF.svg + images/flagKit/TD.svg + images/flagKit/TC.svg + images/flagKit/SZ.svg + images/flagKit/SY.svg + images/flagKit/SX.svg + images/flagKit/SV.svg + images/flagKit/ST.svg + images/flagKit/SS.svg + images/flagKit/SR.svg + images/flagKit/SO.svg + images/flagKit/SN.svg + images/flagKit/SM.svg + images/flagKit/SL.svg + images/flagKit/SK.svg + images/flagKit/SJ.svg + images/flagKit/SI.svg + images/flagKit/SH.svg + images/flagKit/SG.svg + images/flagKit/SE.svg + images/flagKit/SD.svg + images/flagKit/SC.svg + images/flagKit/SB.svg + images/flagKit/SA.svg + images/flagKit/RW.svg + images/flagKit/RU.svg + images/flagKit/RS.svg + images/flagKit/RO.svg + images/flagKit/RE.svg + images/flagKit/QA.svg + images/flagKit/PY.svg + images/flagKit/PW.svg + images/flagKit/PT.svg + images/flagKit/PS.svg + images/flagKit/PR.svg + images/flagKit/PN.svg + images/flagKit/PM.svg + images/flagKit/PL.svg + images/flagKit/PK.svg + images/flagKit/PH.svg + images/flagKit/PG.svg + images/flagKit/PF.svg + images/flagKit/PE.svg + images/flagKit/PA.svg + images/flagKit/OM.svg + images/flagKit/NZ.svg + images/flagKit/NU.svg + images/flagKit/NR.svg + images/flagKit/NP.svg + images/flagKit/NO.svg + images/flagKit/NL.svg + images/flagKit/NI.svg + images/flagKit/NG.svg + images/flagKit/NF.svg + images/flagKit/NE.svg + images/flagKit/NC.svg + images/flagKit/NA.svg + images/flagKit/MZ.svg + images/flagKit/MY.svg + images/flagKit/MX.svg + images/flagKit/MW.svg + images/flagKit/MV.svg + images/flagKit/MU.svg + images/flagKit/MT.svg + images/flagKit/MS.svg + images/flagKit/MR.svg + images/flagKit/MQ.svg + images/flagKit/MP.svg + images/flagKit/MO.svg + images/flagKit/MN.svg + images/flagKit/MM.svg + images/flagKit/ML.svg + images/flagKit/MK.svg + images/flagKit/MH.svg + images/flagKit/MG.svg + images/flagKit/MF.svg + images/flagKit/ME.svg + images/flagKit/MD.svg + images/flagKit/MC.svg + images/flagKit/MA.svg + images/flagKit/LY.svg + images/flagKit/LV.svg + images/flagKit/LU.svg + images/flagKit/LT.svg + images/flagKit/LS.svg + images/flagKit/LR.svg + images/flagKit/LK.svg + images/flagKit/LI.svg + images/flagKit/LC.svg + images/flagKit/LB.svg + images/flagKit/LA.svg + images/flagKit/KZ.svg + images/flagKit/KY.svg + images/flagKit/KW.svg + images/flagKit/KR.svg + images/flagKit/KP.svg + images/flagKit/KN.svg + images/flagKit/KM.svg + images/flagKit/KI.svg + images/flagKit/KH.svg + images/flagKit/KG.svg + images/flagKit/KE.svg + images/flagKit/JP.svg + images/flagKit/JO.svg + images/flagKit/JM.svg + images/flagKit/JE.svg + images/flagKit/IT.svg + images/flagKit/IS.svg + images/flagKit/IR.svg + images/flagKit/IQ.svg + images/flagKit/IO.svg + images/flagKit/IN.svg + images/flagKit/IM.svg + images/flagKit/IL.svg + images/flagKit/IE.svg + images/flagKit/ID.svg + images/flagKit/HU.svg + images/flagKit/HT.svg + images/flagKit/HR.svg + images/flagKit/HN.svg + images/flagKit/HM.svg + images/flagKit/HK.svg + images/flagKit/GY.svg + images/flagKit/GW.svg + images/flagKit/GU.svg + images/flagKit/GT.svg + images/flagKit/GS.svg + images/flagKit/GR.svg + images/flagKit/GQ.svg + images/flagKit/GP.svg + images/flagKit/GN.svg + images/flagKit/GM.svg + images/flagKit/GL.svg + images/flagKit/GI.svg + images/flagKit/GH.svg + images/flagKit/GG.svg + images/flagKit/GF.svg + images/flagKit/GE.svg + images/flagKit/GD.svg + images/flagKit/GB.svg + images/flagKit/GA.svg + images/flagKit/FR.svg + images/flagKit/FO.svg + images/flagKit/FM.svg + images/flagKit/FK.svg + images/flagKit/FJ.svg + images/flagKit/FI.svg + images/flagKit/EU.svg + images/flagKit/ET.svg + images/flagKit/ES.svg + images/flagKit/ER.svg + images/flagKit/EG.svg + images/flagKit/EE.svg + images/flagKit/EC.svg + images/flagKit/DZ.svg + images/flagKit/DO.svg + images/flagKit/DM.svg + images/flagKit/DK.svg + images/flagKit/DJ.svg + images/flagKit/DE.svg + images/flagKit/CZ.svg + images/flagKit/CY.svg + images/flagKit/CX.svg + images/flagKit/CW.svg + images/flagKit/CV.svg + images/flagKit/CU.svg + images/flagKit/CR.svg + images/flagKit/CO.svg + images/flagKit/CN.svg + images/flagKit/CM.svg + images/flagKit/CL.svg + images/flagKit/CK.svg + images/flagKit/CI.svg + images/flagKit/CH.svg + images/flagKit/CG.svg + images/flagKit/CF.svg + images/flagKit/CD.svg + images/flagKit/CC.svg + images/flagKit/CA.svg + images/flagKit/BZ.svg + images/flagKit/BY.svg + images/flagKit/BW.svg + images/flagKit/BV.svg + images/flagKit/BT.svg + images/flagKit/BS.svg + images/flagKit/BR.svg + images/flagKit/BO.svg + images/flagKit/BN.svg + images/flagKit/BM.svg + images/flagKit/BL.svg + images/flagKit/BJ.svg + images/flagKit/BI.svg + images/flagKit/BH.svg + images/flagKit/BG.svg + images/flagKit/BF.svg + images/flagKit/BE.svg + images/flagKit/BD.svg + images/flagKit/BB.svg + images/flagKit/BA.svg + images/flagKit/AZ.svg + images/flagKit/AX.svg + images/flagKit/AW.svg + images/flagKit/AU.svg + images/flagKit/AT.svg + images/flagKit/AS.svg + images/flagKit/AR.svg + images/flagKit/AO.svg + images/flagKit/AM.svg + images/flagKit/AL.svg + images/flagKit/AI.svg + images/flagKit/AG.svg + images/flagKit/AF.svg + images/flagKit/AE.svg + images/flagKit/AD.svg diff --git a/client/secure_qsettings.cpp b/client/secure_qsettings.cpp index 592f77d4..88c0242b 100644 --- a/client/secure_qsettings.cpp +++ b/client/secure_qsettings.cpp @@ -174,18 +174,30 @@ bool SecureQSettings::restoreAppConfig(const QByteArray &json) QByteArray SecureQSettings::encryptText(const QByteArray &value) const { QSimpleCrypto::QBlockCipher cipher; - return cipher.encryptAesBlockCipher(value, getEncKey(), getEncIv()); + QByteArray result; + try { + result = cipher.encryptAesBlockCipher(value, getEncKey(), getEncIv()); + } catch (...) { // todo change error handling in QSimpleCrypto? + qCritical() << "error when encrypting the settings value"; + } + return result; } QByteArray SecureQSettings::decryptText(const QByteArray &ba) const { QSimpleCrypto::QBlockCipher cipher; - return cipher.decryptAesBlockCipher(ba, getEncKey(), getEncIv()); + QByteArray result; + try { + result = cipher.decryptAesBlockCipher(ba, getEncKey(), getEncIv()); + } catch (...) { // todo change error handling in QSimpleCrypto? + qCritical() << "error when decrypting the settings value"; + } + return result; } bool SecureQSettings::encryptionRequired() const { -#ifdef Q_OS_LINUX +#if defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID) // QtKeyChain failing on Linux return false; #endif @@ -200,7 +212,7 @@ QByteArray SecureQSettings::getEncKey() const if (m_key.isEmpty()) { // Create new key QSimpleCrypto::QBlockCipher cipher; - QByteArray key = cipher.generateSecureRandomBytes(32); + QByteArray key = cipher.generatePrivateSalt(32); if (key.isEmpty()) { qCritical() << "SecureQSettings::getEncKey Unable to generate new enc key"; } @@ -226,7 +238,7 @@ QByteArray SecureQSettings::getEncIv() const if (m_iv.isEmpty()) { // Create new IV QSimpleCrypto::QBlockCipher cipher; - QByteArray iv = cipher.generateSecureRandomBytes(32); + QByteArray iv = cipher.generatePrivateSalt(32); if (iv.isEmpty()) { qCritical() << "SecureQSettings::getEncIv Unable to generate new enc IV"; } diff --git a/client/server_scripts/xray/configure_container.sh b/client/server_scripts/xray/configure_container.sh index 76195417..4e27f734 100644 --- a/client/server_scripts/xray/configure_container.sh +++ b/client/server_scripts/xray/configure_container.sh @@ -28,7 +28,7 @@ cat > /opt/amnezia/xray/server.json < /opt/amnezia/xray/server.json < Settings::containers(int serverIndex) const QMap containersMap; for (const QJsonValue &val : containers) { - containersMap.insert(ContainerProps::containerFromString(val.toObject().value(config_key::container).toString()), - val.toObject()); + containersMap.insert(ContainerProps::containerFromString(val.toObject().value(config_key::container).toString()), val.toObject()); } return containersMap; @@ -221,7 +227,7 @@ void Settings::setSaveLogs(bool enabled) if (!isSaveLogs()) { Logger::deInit(); } else { - if (!Logger::init()) { + if (!Logger::init(false)) { qWarning() << "Initialization of debug subsystem failed"; } } @@ -442,6 +448,17 @@ QString Settings::getInstallationUuid(const bool needCreate) auto uuid = value("Conf/installationUuid", "").toString(); if (needCreate && uuid.isEmpty()) { uuid = QUuid::createUuid().toString(); + + //remove {} from uuid + uuid.remove(0, 1); + uuid.chop(1); + + setInstallationUuid(uuid); + } else if (uuid.contains("{") && uuid.contains("}")) { + //remove {} from old uuid + uuid.remove(0, 1); + uuid.chop(1); + setInstallationUuid(uuid); } return uuid; @@ -476,11 +493,8 @@ QVariant Settings::value(const QString &key, const QVariant &defaultValue) const if (QThread::currentThread() == QCoreApplication::instance()->thread()) { returnValue = m_settings.value(key, defaultValue); } else { - QMetaObject::invokeMethod(&m_settings, "value", - Qt::BlockingQueuedConnection, - Q_RETURN_ARG(QVariant, returnValue), - Q_ARG(const QString&, key), - Q_ARG(const QVariant&, defaultValue)); + QMetaObject::invokeMethod(&m_settings, "value", Qt::BlockingQueuedConnection, Q_RETURN_ARG(QVariant, returnValue), + Q_ARG(const QString &, key), Q_ARG(const QVariant &, defaultValue)); } return returnValue; } @@ -490,9 +504,37 @@ void Settings::setValue(const QString &key, const QVariant &value) if (QThread::currentThread() == QCoreApplication::instance()->thread()) { m_settings.setValue(key, value); } else { - QMetaObject::invokeMethod(&m_settings, "setValue", - Qt::BlockingQueuedConnection, - Q_ARG(const QString&, key), - Q_ARG(const QVariant&, value)); + QMetaObject::invokeMethod(&m_settings, "setValue", Qt::BlockingQueuedConnection, Q_ARG(const QString &, key), + Q_ARG(const QVariant &, value)); } } + +void Settings::resetGatewayEndpoint() +{ + m_gatewayEndpoint = gatewayEndpoint; +} + +void Settings::setGatewayEndpoint(const QString &endpoint) +{ + m_gatewayEndpoint = endpoint; +} + +void Settings::setDevGatewayEndpoint() +{ + m_gatewayEndpoint = DEV_AGW_ENDPOINT; +} + +QString Settings::getGatewayEndpoint() +{ + return m_gatewayEndpoint; +} + +bool Settings::isDevGatewayEnv() +{ + return m_isDevGatewayEnv; +} + +void Settings::toggleDevGatewayEnv(bool enabled) +{ + m_isDevGatewayEnv = enabled; +} diff --git a/client/settings.h b/client/settings.h index 74d1b4b9..f41f4d29 100644 --- a/client/settings.h +++ b/client/settings.h @@ -160,9 +160,6 @@ public: setValue("Conf/secondaryDns", secondaryDns); } - static const char cloudFlareNs1[]; - static const char cloudFlareNs2[]; - // static constexpr char openNicNs5[] = "94.103.153.176"; // static constexpr char openNicNs13[] = "144.76.103.143"; @@ -186,7 +183,7 @@ public: bool isScreenshotsEnabled() const { - return value("Conf/screenshotsEnabled", false).toBool(); + return value("Conf/screenshotsEnabled", true).toBool(); } void setScreenshotsEnabled(bool enabled) { @@ -218,6 +215,13 @@ public: void setKillSwitchEnabled(bool enabled); QString getInstallationUuid(const bool needCreate); + void resetGatewayEndpoint(); + void setGatewayEndpoint(const QString &endpoint); + void setDevGatewayEndpoint(); + QString getGatewayEndpoint(); + bool isDevGatewayEnv(); + void toggleDevGatewayEnv(bool enabled); + signals: void saveLogsChanged(bool enabled); void screenshotsEnabledChanged(bool enabled); @@ -231,6 +235,9 @@ private: void setInstallationUuid(const QString &uuid); mutable SecureQSettings m_settings; + + QString m_gatewayEndpoint; + bool m_isDevGatewayEnv = false; }; #endif // SETTINGS_H diff --git a/client/translations/amneziavpn_ar_EG.ts b/client/translations/amneziavpn_ar_EG.ts index 4f985142..e176d8eb 100644 --- a/client/translations/amneziavpn_ar_EG.ts +++ b/client/translations/amneziavpn_ar_EG.ts @@ -1,6 +1,59 @@ + + ApiServicesModel + + + Classic VPN for comfortable work, downloading large files and watching videos. Works for any sites. Speed up to %1 MBit/s + شبكة VPN كلاسيكية للعمل المريح وتنزيل الملفات الكبيرة ومشاهدة مقاطع الفيديو. تعمل مع أي موقع. تصل السرعة إلى %1 ميجابت/ثانية + + + + VPN to access blocked sites in regions with high levels of Internet censorship. + شبكة VPN للولوج للمواقع المحظورة في بلاد ذو مستوي عالي من الرقابة علي الانترنت. + + + + <p><a style="color: #EB5757;">Not available in your region. If you have VPN enabled, disable it, return to the previous screen, and try again.</a> + + + + + Amnezia Premium - A classic VPN for comfortable work, downloading large files, and watching videos in high resolution. It works for all websites, even in countries with the highest level of internet censorship. + Amenzia Premium - شبكة VPN للعمل المريح, تحميل ملفات كبيرة الحجم, ومشاهدة مقاطع الفيديو ب جودة عالية. تعمل لجميع المواقع, حتي في البلاد ذو مستوي عالي من الرقابة علي الانترنت + + + + Amnezia Free is a free VPN to bypass blocking in countries with high levels of internet censorship + Amnezia Free هو VPN مجاني لتخطي الحظر في البلاد ذو مستوي عالي من الرقابة علي الانترنت + + + + %1 MBit/s + %1 ميجابت/ثانية + + + + %1 days + %1 ايام + + + + VPN will open only popular sites blocked in your region, such as Instagram, Facebook, Twitter and others. Other sites will be opened from your real IP address, <a href="%1/free" style="color: #FBB26A;">more details on the website.</a> + سيقوم VPN فقط بفتح المواقع المشهورة المحظورة في بلدك, مثل Instagram, Facebook, Twitter و مواقع اخري. المواقع الاخري ستٌفتح من عنوان ال IP الحقيقي الخاص بك, <a href="%1/free" style="color: #FBB26A;">معلومات اخري علي الموقع.</a> + + + + Free + مجاني + + + + %1 $/month + %1 دولار/الشهر + + AppSplitTunnelingController @@ -27,7 +80,7 @@ ConnectButton - + Unable to disconnect during configuration preparation غير قادر علي قطع الاتصال اثناء إعداد التكوين @@ -35,61 +88,61 @@ ConnectionController - - - + + + Connect اتصل - + VPN Protocols is not installed. Please install VPN container at first لم يتم تثبيت بروتوكولات VPN, من فضلك قم بتنزيل حاوية VPN اولاً - + Connecting... اتصال... - + Connected تم الاتصال - + Reconnecting... إعادة الاتصال... - + Disconnecting... إنهاء الاتصال... - + Preparing... جاري التحضير... - + Settings updated successfully, reconnnection... تم تحديث الاعدادات بنجاح, جاري إعادة الاتصال... - + Settings updated successfully تم تحديث الاعدادات بنجاح - + The selected protocol is not supported on the current platform البروتوكول المحدد غير مدعوم علي المنصة الحالية - + unable to create configuration غير قادر علي إنشاء تكوين @@ -130,7 +183,7 @@ &لصق - + &SelectAll &تحديد الكل @@ -138,9 +191,8 @@ ExportController - Access error! - خطأ في الوصول! + خطأ في الوصول! @@ -206,18 +258,18 @@ Can't be disabled for current server غير قادر علي فتح الملف - - + + Invalid configuration file ملف تكوين غير صحيح - + Scanned %1 of %2. تم فحص%1 من %2. - + In the imported configuration, potentially dangerous lines were found: في التكوين المستورد، تم العثور على سطور يحتمل أن تكون خطرة: @@ -225,24 +277,24 @@ Can't be disabled for current server InstallController - + %1 installed successfully. %1 تم التثبيت بنجاح. - + %1 is already installed on the server. %1 بالفعل مٌثبت علي الخادم. - + Added containers that were already installed on the server تمت إضافة الحاويات التي كانت مٌثبتة بالفعل علي الخادم - + Already installed containers were found on the server. All installed containers have been added to the application @@ -250,45 +302,65 @@ Already installed containers were found on the server. All installed containers تمت إضافة جميع الحاويات المٌثبتة إلي التطبيق - + Settings updated successfully تم تحديث الاعدادات بنجاح - + Server '%1' was rebooted تمت إعادة تشغيل الخادم%1 - + Server '%1' was removed تمت إزالة الخادم '%1' - + All containers from server '%1' have been removed قد تم حذفها '%1' جميع الحاويات من الخادم - + %1 has been removed from the server '%2' %1 تم حدف '%2' اسم الخادم - + + Api config removed + تم حذف تكوين Api + + + %1 cached profile cleared تم مسح ملف تعريف %1 المخزن مؤقتًا - + Please login as the user من فضلك قم بتسجيل الدخول كمستخدم - + Server added successfully تمت إضافة الخادم بنجاح + + + %1 installed successfully. + تم تحميل %1 بنجاح + + + + API config reloaded + تمت إعادة تحميل تكوين API + + + + Successfully changed the country of connection to %1 + تم تغيير بلد الاتصال بنجاح إلى %1 + InstalledAppsDrawer @@ -358,16 +430,29 @@ Already installed containers were found on the server. All installed containers PageDeinstalling - + Removing services from %1 من %1 مسح الخدمة - + Usually it takes no more than 5 minutes في العادة تستغرق اقل من 5 دقائق + + PageDevMenu + + + Gateway endpoint + نقطة نهاية البوابة + + + + Dev gateway environment + + + PageHome @@ -386,75 +471,168 @@ Already installed containers were found on the server. All installed containers تقسيم الانفاق مٌعطل - + VPN protocol بروتوكول VPN - + Servers الخوادم - + Unable change server while there is an active connection لا يمكن تغير الخادم بينما هناك اتصال مفعل + + PageProtocolAwgClientSettings + + + AmneziaWG settings + اعدادات AmneziaWG + + + + MTU + + + + + Server settings + + + + + Port + منفذ + + + + Save + احفظ + + + + Save settings? + احفظ الإعدادات؟ + + + + Only the settings for this device will be changed + + + + + Continue + واصل + + + + Cancel + إلغاء + + + + Unable change settings while there is an active connection + لا يمكن تغيير الإعدادات أثناء وجود اتصال نشط + + PageProtocolAwgSettings - + AmneziaWG settings اعدادات AmneziaWG - + Port منفذ - - MTU - - - - + All users with whom you shared a connection with will no longer be able to connect to it. جميع المستخدمين الذين شاركت معهم اتصال لن يكونو قادرين علي الاتصال مرة اخري. - + Save احفظ - + + Jc - Junk packet count + Jc - عدد الحزم غير المرغوب فيها + + + + Jmin - Junk packet minimum size + Jmin - الحجم الادني للحزم الغير مرغوب فيها + + + + Jmax - Junk packet maximum size + Jmax - الحجم الاقصي للحزم الغير مرغوب فيها + + + + S1 - Init packet junk size + S1 - حجم حزمة البيانات العشوائية الأولية + + + + S2 - Response packet junk size + S2 - حجم حزمة الاستجابة غير المرغوب فيها + + + + H1 - Init packet magic header + H1 - حزمة رأس سحرية مبدئية + + + + H2 - Response packet magic header + H2 - رأس حزمة الاستجابة السحرية + + + + H4 - Transport packet magic header + H4 - رأس حزمة النقل السحرية + + + + H3 - Underload packet magic header + H3 - رأس حزمة السحر غير المحمل + + + The values of the H1-H4 fields must be unique يجب أن تكون قيم الحقول H1-H4 فريدة - + The value of the field S1 + message initiation size (148) must not equal S2 + message response size (92) يجب ألا تساوي قيمة الحقل S1 + حجم بدء الرسالة (148) S2 + حجم استجابة الرسالة (92) - + Save settings? احفظ الإعدادات؟ - + Continue واصل - + Cancel إلغاء - + Unable change settings while there is an active connection لا يمكن تغيير الإعدادات أثناء وجود اتصال نشط @@ -462,33 +640,33 @@ Already installed containers were found on the server. All installed containers PageProtocolCloakSettings - + Cloak settings Cloak إعدادات - + Disguised as traffic from متنكراً في حركة مرور من - + Port منفذ - + Cipher الشفرة - + Save احفظ - + Unable change settings while there is an active connection لا يمكن تغيير الإعدادات أثناء وجود اتصال نشط @@ -715,56 +893,124 @@ Already installed containers were found on the server. All installed containers PageProtocolShadowSocksSettings - + Shadowsocks settings Shadowsocks إعدادات - + Port منفذ - + Cipher تشفير - + Save احفظ - + Unable change settings while there is an active connection لا يمكن تغيير الإعدادات أثناء وجود اتصال نشط + + PageProtocolWireGuardClientSettings + + + WG settings + إعدادات WG + + + + MTU + + + + + Server settings + + + + + Port + منفذ + + + + Save + احفظ + + + + Save settings? + احفظ الإعدادات؟ + + + + Only the settings for this device will be changed + + + + + Continue + واصل + + + + Cancel + إلغاء + + + + Unable change settings while there is an active connection + لا يمكن تغيير الإعدادات أثناء وجود اتصال نشط + + PageProtocolWireGuardSettings - + WG settings إعدادات WG - + Port منفذ - - MTU - + + Save settings? + احفظ الإعدادات؟ - + + All users with whom you shared a connection with will no longer be able to connect to it. + جميع المستخدمين الذين شاركت معهم اتصال لن يكونو قادرين علي الاتصال مرة اخري. + + + + Continue + واصل + + + + Cancel + إلغاء + + + Unable change settings while there is an active connection لا يمكن تغيير الإعدادات أثناء وجود اتصال نشط - + Save احفظ @@ -772,22 +1018,22 @@ Already installed containers were found on the server. All installed containers PageProtocolXraySettings - + XRay settings إعدادات XRay - + Disguised as traffic from متنكراً في حركة مرور من - + Save احفظ - + Unable change settings while there is an active connection لا يمكن تغيير الإعدادات أثناء وجود اتصال نشط @@ -903,69 +1149,69 @@ Already installed containers were found on the server. All installed containers PageServiceSocksProxySettings - + Settings updated successfully تم تحديث الإعدادات بنجاح - - + + SOCKS5 settings إعدادات SOCKS5 - + Host استضافة - - - - + + + + Copied تم النسخ - - + + Port منفذ - + User name اسم المستخدم - - + + Password كلمة المرور - + Username اسم المستخدم - - + + Change connection settings تغيير إعدادات الاتصال - + The port must be in the range of 1 to 65535 يجب أن يكون المنفذ في النطاق من 1 إلى 65535 - + Password cannot be empty لا يمكن ان تكون كلمة المرور فارغة - + Username cannot be empty اسم المستخدم لا يمكن ان يكون فارغ @@ -1011,37 +1257,42 @@ Already installed containers were found on the server. All installed containers PageSettings - + Settings إعدادات - + Servers الخوادم - + Connection الاتصال - + Application تطبيق - + Backup نسخة احتياطية - + About AmneziaVPN عن AmneziaVPN + Dev console + وحدة تحكم التطوير + + + Close application إغلاق التطبيق @@ -1079,9 +1330,13 @@ Already installed containers were found on the server. All installed containers - Mail - البريد + البريد + + + + support@amnezia.org + @@ -1089,41 +1344,116 @@ Already installed containers were found on the server. All installed containers لل مراجعات والابلاغات عن المشاكل - + + Copied + + + + GitHub GitHub - + https://github.com/amnezia-vpn/amnezia-client - + Website موقع - - https://amnezia.org - - - - + Software version: %1 %1 :إصدار البرنامج - + Check for updates تحقق من وجود تحديثات - + Privacy Policy سياسات الخصوصية + + PageSettingsApiServerInfo + + + For the region + للمنطقة + + + + Price + السعر + + + + Work period + مدة العمل + + + + Speed + السرعة + + + + Support tag + علامة الدعم + + + + Copied + تم النسخ + + + + Reload API config + إعادة تحميل تكوين API + + + + Reload API config? + إعادة تحميل تكوين API + + + + + Continue + واصل + + + + + Cancel + إلغاء + + + + Cannot reload API config during active connection + لا يمكن إعادة تحميل تكوين API اثناء تواجد اتصال نشط + + + + Remove from application + احذف من التطبيق + + + + Remove from application? + احذف من التطبيق؟ + + + + Cannot remove server during active connection + لا يمكن إزالة الخادم أثناء الاتصال النشط + + PageSettingsAppSplitTunneling @@ -1293,73 +1623,73 @@ Already installed containers were found on the server. All installed containers تم إعادة الاعدادات من ملف نسخة احتياطية - + Back up your configuration قم بعمل نسخة احتياطية - + You can save your settings to a backup file to restore them the next time you install the application. يمكنك حفظ الإعدادات في ملف نسخة احتياطية لأعادتهم في المرة القادمة التي تثبت فيها التطبيق. - + The backup will contain your passwords and private keys for all servers added to AmneziaVPN. Keep this information in a secure place. ستحتوي النسخة الاحتياطية علي كلمات مرورك و المفاتيح الخاصة للخوادم المٌضافة إلي AmneziaVPN. احفظ هذه المعلومات في مكان امن. - + Make a backup إضافة نسخة احتياطية - + Save backup file احفظ ملف النسخه الاحتياطيه - - + + Backup files (*.backup) ملفات نٌسخ احتياطية (*.backup) - + Backup file saved تم حفظ ملف النسخ الاحتياطي - + Restore from backup استرجاع من ملف يحتوي علي نسخة احتياطية - + Open backup file افتح ملف نسخ احتياطي - + Import settings from a backup file? استرد الإعدادات من ملف نسخ احتياطي؟ - + All current settings will be reset ستتم إعادة ضبط جميع الإعدادات الحالية - + Continue واصل - + Cancel إلغاء - + Cannot restore backup settings during active connection لا يمكن استعادة إعدادات النسخ الاحتياطي أثناء الاتصال النشط @@ -1367,62 +1697,62 @@ Already installed containers were found on the server. All installed containers PageSettingsConnection - + Connection الاتصال - + When AmneziaDNS is not used or installed عندما يكون AmneziaDNS غير مٌثبت او غير مستخدم - + Allows you to use the VPN only for certain Apps يسمح لك بأستخدام ال VPN علي تطبيقات معينة - + Use AmneziaDNS استخدم AmneziaDNS - + If AmneziaDNS is installed on the server في حالة كان AmneziaDNS مٌثبت علي الخادم - + DNS servers خوادم DNS - + Site-based split tunneling انقسام الانفاق القائم علي الموقع - + Allows you to select which sites you want to access through the VPN يسمح لك بتحديد اي موقع تريد الوصول له عن طريق ال VPN - + App-based split tunneling انقسام الانفاق القائم علي التطبيق - + KillSwitch - + Disables your internet if your encrypted VPN connection drops out for any reason. يعطل اتصال الإنترنت الخاص بك إذا انقطع اتصال VPN المشفر لأي سبب من الأسباب. - + Cannot change killSwitch settings during active connection لا يمكن تغيير إعدادات KillSwitch اثناء تواجد اتصال فعال @@ -1493,72 +1823,108 @@ Already installed containers were found on the server. All installed containers PageSettingsLogging - Logging is enabled. Note that logs will be automatically disabled after 14 days, and all log files will be deleted. - تم تمكين التسجيل. لاحظ أنه سيتم تعطيل السجلات تلقائيًا بعد 14 يومًا، وسيتم حذف جميع ملفات السجل. + تم تمكين التسجيل. لاحظ أنه سيتم تعطيل السجلات تلقائيًا بعد 14 يومًا، وسيتم حذف جميع ملفات السجل. - + Logging التسجيل - + Enabling this function will save application's logs automatically. By default, logging functionality is disabled. Enable log saving in case of application malfunction. سيتم حفظ سجلات البرنامج بشكل تلقائي عند تفعيل هذه الميزة, بشكل افتراضي, هذه الميزة مٌعطلة. قم بتفعيل هذه الميزة في حالة هناك خلل في التطبيق. - Save logs - احفظ السجلات + احفظ السجلات - Open folder with logs - افتح مجلد يحتوي علي سجلات + افتح مجلد يحتوي علي سجلات - + + Save احفظ - + + Logs files (*.log) ملفات الولوج (*.log) - + + Logs file saved تم حفظ ملف السجل - Save logs to file - احفظ السجلات في ملف + احفظ السجلات في ملف - + + Enable logs + + + + Clear logs? مسح السجلات؟ - + Continue واصل - + Cancel إلغاء - + Logs have been cleaned up تم مسح السجلات - + + Client logs + + + + + AmneziaVPN logs + + + + + + Open logs folder + + + + + + Export logs + + + + + Service logs + + + + + AmneziaVPN-service logs + + + + Clear logs احذف السجلات @@ -1573,7 +1939,7 @@ Already installed containers were found on the server. All installed containers No new installed containers found - لم يتم العثور علي اي حاويات جديدة مٌثبتة + لم يتم العثور علي اي خدمات مٌثبتة سابقاً @@ -1685,27 +2051,27 @@ Already installed containers were found on the server. All installed containers PageSettingsServerInfo - + Server name اسم الخادم - + Save احفظ - + Protocols البروتوكولات - + Services الخدمات - + Management الإدارة @@ -1718,12 +2084,11 @@ Already installed containers were found on the server. All installed containers الإعدادات - Clear %1 profile - مسح ملف تعريف %1 + مسح ملف تعريف %1 - + Clear %1 profile? مسح ملف تعريف %1؟ @@ -1733,34 +2098,64 @@ Already installed containers were found on the server. All installed containers - + Unable to clear %1 profile while there is an active connection غير قادر على مسح ملف تعريف %1 أثناء وجود اتصال نشط - + Remove احذف - + + Remove %1 from server? + احذف %1 من الخادم؟ + + + All users with whom you shared a connection will no longer be able to connect to it. جميع المستخدمين الذين شاركت معاهم اتصال لن يستطيعو الاتصال بعد الان. - + Cannot remove active container لا يمكن إزالة الحاوية النشطة - - + + Continue واصل - - + + connection settings + + + + + Click the "connect" button to create a connection configuration + + + + + server settings + + + + + Clear profile + + + + + The connection configuration will be deleted for this device only + + + + + Cancel إلغاء @@ -1768,7 +2163,7 @@ Already installed containers were found on the server. All installed containers PageSettingsServersList - + Servers الخوادم @@ -1874,103 +2269,214 @@ Already installed containers were found on the server. All installed containers إضافة المواقع المستردة للمواقع الموجودة + + PageSetupWizardApiServiceInfo + + + For the region + للمنطقة + + + + Price + السعر + + + + Work period + مدة العمل + + + + Speed + السرعة + + + + Features + المميزات + + + + Connect + اتصل + + + + PageSetupWizardApiServicesList + + + VPN by Amnezia + VPN بواسطة Amnezia + + + + Choose a VPN service that suits your needs. + اختر خدمة VPN تلبي احتياجاتك + + PageSetupWizardConfigSource - - Server connection - اتصال الخادم + + Connection + الاتصال - - Do not use connection codes from untrusted sources, as they may be created to intercept your data. - لا تستخدم رموز اتصال من مصادر غير موثوقة, حيث قد يكون تم إنشاؤها لاعتراض بياناتك. + + Settings + إعدادات - - What do you have? - ماذا لديك؟ + + Enable logs + - - File with connection settings or backup - ملف إعدادات اتصال او نسخ احتياطي + + Insert the key, add a configuration file or scan the QR-code + أدخل المفتاح، أضف ملف تكوين أو امسح رمز الاستجابة السريعة - + + Insert key + أدخل مفتاح + + + + Insert + أدخل + + + + Continue + واصل + + + + Other connection options + اختيارات اتصال اخري + + + + VPN by Amnezia + VPN بواسطة Amnezia + + + + Connect to classic paid and free VPN services from Amnezia + اتصل بخدمات VPN الكلاسيكية المدفوعة والمجانية من Amnezia + + + + Self-hosted VPN + VPN ذاتية الاستضافة + + + + Configure Amnezia VPN on your own server + قم بتكوين Amnezia VPN على الخادم الخاص بك + + + + Restore from backup + استرجاع من ملف يحتوي علي نسخة احتياطية + + + + Open backup file + افتح ملف نسخ احتياطي + + + + Backup files (*.backup) + ملفات نٌسخ احتياطية (*.backup) + + + File with connection settings ملف إعدادات اتصال - + Open config file افتح ملف تكوين - + QR code رمز QR - - Key as text - مفتاح كنص + + I have nothing + ليس لدي اي شئ PageSetupWizardCredentials - + Configure your server تكوين الخادم الخاص بك - + Server IP address [:port] عنوان خادم IP [:منفذ] - + Continue واصل - + All data you enter will remain strictly confidential and will not be shared or disclosed to the Amnezia or any third parties ستظل جميع البيانات التي تدخلها سرية للغاية ولن تتم مشاركتها أو الكشف عنها ل Amnezia أو أي طرف ثالث - + 255.255.255.255:22 - + SSH Username - + Password or SSH private key كلمة مرور او مفتاح SSH خاص - + + How to run your VPN server + كيف تقوم بتشغيل خادم ال VPN الخاص بك + + + + Where to get connection data, step-by-step instructions for buying a VPS + اين تحصل علي بيانات الاتصال, تعليمات خطوة ب خطوة لشراء VPS + + + Ip address cannot be empty لا يمكن لعنوان IP ان يكون فارغ - + Enter the address in the format 255.255.255.255:88 ادخل العنوان في شكل 255.255.255.255:88 - + Login cannot be empty تسجيل دخول لا يمكن ان يكون فارغ - + Password/private key cannot be empty كلمة مرور/مفتاح خاص لأ يمكن ان يكونو فارغين @@ -2001,38 +2507,38 @@ Already installed containers were found on the server. All installed containers PageSetupWizardInstalling - - + + Usually it takes no more than 5 minutes عادة لا تستغرق اكثر من 5 دقائق - + The server has already been added to the application تمت إضافة الخادم بالفعل للتطبيق - + Amnezia has detected that your server is currently اكتشف Amnezia الخادم الخاص بك موجود حاليًا - + busy installing other software. Amnezia installation مشغول بتثبيت برامج اخري, تثبيت Amnezia - + Cancel installation إلغاء التثبيت - + will pause until the server finishes installing other software سيتوقف مؤقتًا حتى ينتهي الخادم من تثبيت البرامج الأخرى - + Installing جاري التثبيت @@ -2070,7 +2576,7 @@ Already installed containers were found on the server. All installed containers تثبيت - + The port must be in the range of 1 to 65535 يجب أن يكون المنفذ في النطاق من 1 إلى 65535 @@ -2078,12 +2584,12 @@ Already installed containers were found on the server. All installed containers PageSetupWizardProtocols - + VPN protocol VPN بروتوكول - + Choose the one with the highest priority for you. Later, you can install other protocols and additional services, such as DNS proxy and SFTP. اختر بالنسبة للأولوية القصوى بالنسبة لك. ويمكنك لاحقًا تثبيت بروتوكولات وخدمات إضافية أخرى، مثل وكيل DNS وSFTP. @@ -2099,61 +2605,36 @@ Already installed containers were found on the server. All installed containers PageSetupWizardStart - - Settings restored from backup file - تم استرداد الإعدادات من ملف نسخة احتياطية - - - - Free service for creating a personal VPN on your server. - خدمة مجانية لأنشاء VPN شخصي علي الخادم الشخصي. - - - - Helps you access blocked content without revealing your privacy, even to VPN providers. - يساعدك في الولوج للمحتوي المحظور بدون إظهار خصوصيات, حتي لمزود ال VPN. - - - - I have the data to connect - لدي البيانات المطلوبة للأتصال - - - - I have nothing - ليس لدي اي شئ - - - - https://amnezia.org/instructions/0_starter-guide - + + Let's get started + هيا نبدأ PageSetupWizardTextKey - + Connection key مفتاح اتصال - + A line that starts with vpn://... يجب ان تٌكتب بهذه الطريقة حتي بوجود التحذير كي تظهر بشكل صحيح داخل التطبيق سطر يبدأ ب ...//:vpn - + Key مفتاح - + Insert ادخل - + Continue واصل @@ -2161,32 +2642,32 @@ Already installed containers were found on the server. All installed containers PageSetupWizardViewConfig - + New connection اتصال جديد - + Collapse content طي المحتوي - + Show content اظهر المحتوي - + Enable WireGuard obfuscation. It may be useful if WireGuard is blocked on your provider. تمكين تشويش WireGuard. قد يكون من المفيد إذا تم حظر WireGuard على مزود الخدمة الخاص بك. - + Use connection codes only from sources you trust. Codes from public sources may have been created to intercept your data. استخدم رموز اتصال فقط من المصادر التي تثق بها, ربما تم إنشاء رموز من مصادر عامة لاعتراض بياناتك. - + Connect اتصل @@ -2440,12 +2921,17 @@ Already installed containers were found on the server. All installed containers مشاركة - + + Access error! + خطأ في الوصول! + + + Connection to اتصال إلي - + File with connection settings to معلف مع إعدادات الاتصال إلي @@ -2453,10 +2939,20 @@ Already installed containers were found on the server. All installed containers PageStart - + Logging was disabled after 14 days, log files were deleted تم تعطيل التسجيل بعد 14 يومًا، وتم حذف ملفات السجل + + + Settings restored from backup file + تم تحميل الإعدادات من ملف نسخة احتياطية + + + + Logging is enabled. Note that logs will be automaticallydisabled after 14 days, and all log files will be deleted. + + PopupType @@ -2495,12 +2991,12 @@ Already installed containers were found on the server. All installed containers لم يتم العثور علي كلمة المرور - + Could not open keystore فشل فتح مخزن المفاتيح - + Could not remove private key from keystore فشل حذف المفتاح الخاص من مخزن المفاتيح @@ -2676,27 +3172,27 @@ Already installed containers were found on the server. All installed containers فشل في فتح مخزن المفاتيح - + Could not create private key generator فشل ف إنشاء مولد المفاتيح الخاصة - + Could not generate new private key فشل في إنشاء مفتاح خاص جديد - + Could not retrieve private key from keystore فشل في استرداد مفتاح خاص من مخزن المفاتيح - + Could not create encryption cipher فشل في إنشاء شفرة التشفير - + Could not encrypt data فشل في تشفير الداتا @@ -2807,7 +3303,7 @@ Already installed containers were found on the server. All installed containers هذا التكوين بالفعل تمت إضافتة للبرنامج - + ErrorCode: %1. @@ -2897,37 +3393,42 @@ Already installed containers were found on the server. All installed containers انتهت مهلة استجابة الخادم عند طلب واجهة برمجة التطبيقات - + + Missing AGW public key + مفتاح AGW عام مفقود + + + QFile error: The file could not be opened خطأ QFile: لا يمكن فتح الملف - + QFile error: An error occurred when reading from the file خطأ QFile: ظهر خطأ اثناء القراءه من الملف - + QFile error: The file could not be accessed خطأ QFile: لا يمكن الوصول للملف - + QFile error: An unspecified error occurred خطأ QFile: ظهر خطأ غير محدد - + QFile error: A fatal error occurred خطأ QFile: حدث خطأ فادح - + QFile error: The operation was aborted خطأ QFile: تم إحباط العملية - + Internal error خطأ داخلي @@ -2972,7 +3473,7 @@ Already installed containers were found on the server. All installed containers XRay with REALITY - Suitable for countries with the highest level of internet censorship. Traffic masking as web traffic at the TLS level, and protection against detection by active probing methods. - الأشعة السينية مع الواقع - مناسبة للبلدان التي لديها أعلى مستوى من الرقابة على الإنترنت. إخفاء حركة المرور كحركة مرور على الويب على مستوى TLS، والحماية من الكشف عن طريق طرق التحقيق النشطة. + XRay مع REALITY - مناسبة للبلدان التي لديها أعلى مستوى من الرقابة على الإنترنت. إخفاء حركة المرور كحركة مرور على الويب على مستوى TLS، والحماية من الكشف عن طريق طرق التحقيق النشطة. @@ -3374,13 +3875,13 @@ While it offers a blend of security, stability, and speed, it's essential t Settings - + Server #1 خادم #1 - - + + Server خادم @@ -3388,12 +3889,12 @@ While it offers a blend of security, stability, and speed, it's essential t SettingsController - + Backup file is corrupted ملف النسخه الاحتياطيه تالف - + All settings have been reset to default values تم استرجاع جميع الإعدادات للإعدادات الافتراضية @@ -3525,7 +4026,7 @@ While it offers a blend of security, stability, and speed, it's essential t VpnConnection - + Mbps @@ -3599,12 +4100,12 @@ While it offers a blend of security, stability, and speed, it's essential t main2 - + Private key passphrase عبارة المرور الخاصة بالمفتاح - + Save احفظ diff --git a/client/translations/amneziavpn_fa_IR.ts b/client/translations/amneziavpn_fa_IR.ts index 0b5b264c..6cd78e77 100644 --- a/client/translations/amneziavpn_fa_IR.ts +++ b/client/translations/amneziavpn_fa_IR.ts @@ -1,97 +1,150 @@ + + ApiServicesModel + + + Classic VPN for comfortable work, downloading large files and watching videos. Works for any sites. Speed up to %1 MBit/s + برای کار راحت، دانلود فایل‌های بزرگ و تماشای ویدیوها، از VPN کلاسیک استفاده کنید. این VPN برای هر سایتی کار می‌کند و سرعت آن تا %1 مگابیت بر ثانیه است. + + + + VPN to access blocked sites in regions with high levels of Internet censorship. + وی پی ان برای دسترسی به سایت‌های مسدود شده در مناطق با سانسور شدید اینترنت. + + + + <p><a style="color: #EB5757;">Not available in your region. If you have VPN enabled, disable it, return to the previous screen, and try again.</a> + + + + + Amnezia Premium - A classic VPN for comfortable work, downloading large files, and watching videos in high resolution. It works for all websites, even in countries with the highest level of internet censorship. + امنزیا پریمیوم - یک وی پی ان کلاسیک برای کار راحت، دانلود فایل‌های بزرگ و تماشای ویدیو با کیفیت بالا. قابل استفاده برای تمامی سایت‌ها، حتی در کشورهایی با بالاترین سطح سانسور اینترنت. + + + + Amnezia Free is a free VPN to bypass blocking in countries with high levels of internet censorship + امنزیا رایگان یک وی پی ان رایگان برای دور زدن مسدودیت‌ها در کشورهایی با سطح بالای سانسور اینترنت است. + + + + %1 MBit/s + %1 MBit/s + + + + %1 days + %1 روز + + + + VPN will open only popular sites blocked in your region, such as Instagram, Facebook, Twitter and others. Other sites will be opened from your real IP address, <a href="%1/free" style="color: #FBB26A;">more details on the website.</a> + وی پی ان فقط سایت‌های محبوبی را که در منطقه شما مسدود شده‌اند، مانند اینستاگرام، فیسبوک، توییتر و غیره باز می‌کند. سایر سایت‌ها با آدرس آی‌پی واقعی شما باز خواهند شد. <a href="%1/free" style="color: #FBB26A;">more details on the website.</a> + + + + Free + رایگان + + + + %1 $/month + %1 $/ماه + + AppSplitTunnelingController Application added: %1 - + برنامه اضافه شد: %1 The application has already been added - + برنامه از قبل اضافه شده است The selected applications have been added - + برنامه‌های انتخاب شده اضافه شدند Application removed: %1 - + برنامه حذف شد: %1 ConnectButton - + Unable to disconnect during configuration preparation - + در هنگام آماده‌سازی پیکربندی، نمی‌توان از اتصال خارج شد. ConnectionController - + VPN Protocols is not installed. Please install VPN container at first پروتکل وی‎پی‎ان نصب نشده است لطفا کانتینر وی‎پی‎ان را نصب کنید - + Connecting... در حال ارتباط... - + Connected متصل - + Preparing... - + در حال آماده‌سازی... - + Settings updated successfully, reconnnection... تنظیمات به روز رسانی شد در حال اتصال دوباره... - + Settings updated successfully تنظیمات با موفقیت به‎روز‎رسانی شدند - + The selected protocol is not supported on the current platform - پروتکل انتخاب شده بر روی این پلتفرم پشتیبانی نمی‎‎شود + پروتکل انتخاب‌شده در پلتفرم فعلی پشتیبانی نمی‌شود. - + unable to create configuration - + نمی‌توان پیکربندی را ایجاد کرد. - + Reconnecting... اتصال دوباره... - - - + + + Connect اتصال - + Disconnecting... قطع ارتباط... @@ -132,7 +185,7 @@ &پیوست - + &SelectAll &انتخاب همه @@ -140,9 +193,8 @@ ExportController - Access error! - خطای دسترسی! + خطای دسترسی! @@ -208,108 +260,128 @@ Can't be disabled for current server Unable to open file - + نمی‌توان فایل را باز کرد. - - + + Invalid configuration file - + فایل پیکربندی نامعتبر است. - + Scanned %1 of %2. ارزیابی %1 از %2. - + In the imported configuration, potentially dangerous lines were found: - + در پیکربندی وارد شده، خطوطی که ممکن است خطرناک باشند، یافت شدند: InstallController - + %1 installed successfully. %1 با موفقیت نصب شد. - + %1 is already installed on the server. %1 در حال حاضر بر روی سرور نصب شده است. - + Added containers that were already installed on the server کانتینرهایی که بر روی سرور موجود بودند اضافه شدند - + Already installed containers were found on the server. All installed containers have been added to the application کانتینرهای نصب شده بر روی سرور شناسایی شدند. تمام کانتینترهای نصب شده به نرم افزار اضافه شدند - + Settings updated successfully تنظیمات با موفقیت به‎روز‎رسانی شدند - + Server '%1' was rebooted سرور %1 راه اندازی مجدد شد - + Server '%1' was removed سرور %1 حذف شد - + All containers from server '%1' have been removed تمام کانتینترها از سرور %1 حذف شدند - + %1 has been removed from the server '%2' %1 از سرور %2 حذف شد - - %1 cached profile cleared - + + Api config removed + پیکربندی API حذف شد. - + + %1 cached profile cleared + %1 پروفایل ذخیره شده پاک شد. + + + Please login as the user لطفا به عنوان کاربر وارد شوید - + Server added successfully سرور با موفقیت اضافه شد + + + %1 installed successfully. + %1 با موفقیت نصب شد. + + + + API config reloaded + پیکربندی API دوباره بارگذاری شد. + + + + Successfully changed the country of connection to %1 + کشور اتصال با موفقیت به %1 تغییر یافت. + InstalledAppsDrawer - + Choose application - + انتخاب برنامه - + application name - + نام برنامه - + Add selected - + اضافه کردن انتخاب شده @@ -362,66 +434,127 @@ Already installed containers were found on the server. All installed containers PageDeinstalling - + Removing services from %1 حذف سرویس‎ها از %1 - + Usually it takes no more than 5 minutes معمولا بیش از 5 دقیقه طول نمی‎کشد - PageHome + PageDevMenu - - Logging enabled + + Gateway endpoint - + + Dev gateway environment + + + + + PageHome + + + Logging enabled + لاگ‌برداری فعال شد + + + Split tunneling enabled فعال شدن تونل تقسیم‌شده - + Split tunneling disabled تونل تقسیم‌شده غیرفعال شده - + VPN protocol پروتکل وی‎پی‎ان - + Servers سرورها - + Unable change server while there is an active connection امکان تغییر سرور در هنگام متصل بودن وجود ندارد + + PageProtocolAwgClientSettings + + + AmneziaWG settings + تنظیمات AmneziaWG + + + + MTU + + + + + Server settings + + + + + Port + پورت + + + + Save + ذخیره + + + + Save settings? + تنظیمات را ذخیره کن? + + + + Only the settings for this device will be changed + + + + + Continue + + + + + Cancel + + + + + Unable change settings while there is an active connection + نمی‌توان تنظیمات را تغییر داد در حالی که اتصال فعال است. + + PageProtocolAwgSettings - + AmneziaWG settings تنظیمات AmneziaWG - + Port پورت - - - MTU - - Remove AmneziaWG حذف AmneziaWG @@ -431,249 +564,294 @@ Already installed containers were found on the server. All installed containers آیا میخواهید AmneziaWG از سرور حذف شود؟ - + All users with whom you shared a connection with will no longer be able to connect to it. همه کاربرانی که با آن‌ها ارتباطی به اشتراک گذاشته‌اید دیگر قادر به اتصال به آن نخواهند بود. - + Save ذخیره - + + Jc - Junk packet count + + + + + Jmin - Junk packet minimum size + + + + + Jmax - Junk packet maximum size + + + + + S1 - Init packet junk size + + + + + S2 - Response packet junk size + + + + + H1 - Init packet magic header + + + + + H2 - Response packet magic header + + + + + H4 - Transport packet magic header + + + + + H3 - Underload packet magic header + + + + The values of the H1-H4 fields must be unique - + The value of the field S1 + message initiation size (148) must not equal S2 + message response size (92) - + Save settings? تنظیمات را ذخیره کن? - + Continue ادامه - + Cancel کنسل - + Unable change settings while there is an active connection - + نمی‌توان تنظیمات را تغییر داد در حالی که اتصال فعال است. PageProtocolCloakSettings - + Cloak settings تنظیمات Cloak - + Disguised as traffic from پنهان کردن به عنوان ترافیک از - + Port پورت - + Cipher رمزگذاری - + Save ذخیره - + Unable change settings while there is an active connection - + نمی‌توان تنظیمات را تغییر داد در حالی که اتصال فعال است. PageProtocolOpenVpnSettings - + OpenVPN settings تنظیمات OpenVPN - + VPN address subnet زیرشبکه آدرس VPN - + Network protocol پروتکل شبکه - + Port پورت - + Auto-negotiate encryption رمزگذاری خودکار - + Hash هش - + SHA512 SHA512 - + SHA384 SHA384 - + SHA256 SHA256 - + SHA3-512 SHA3-512 - + SHA3-384 SHA3-384 - + SHA3-256 SHA3-256 - + whirlpool whirlpool - + BLAKE2b512 BLAKE2b512 - + BLAKE2s256 BLAKE2s256 - + SHA1 SHA1 - + Cipher رمزگذاری - + AES-256-GCM AES-256-GCM - + AES-192-GCM AES-192-GCM - + AES-128-GCM AES-128-GCM - + AES-256-CBC AES-256-CBC - + AES-192-CBC AES-192-CBC - + AES-128-CBC AES-128-CBC - + ChaCha20-Poly1305 ChaCha20-Poly1305 - + ARIA-256-CBC ARIA-256-CBC - + CAMELLIA-256-CBC CAMELLIA-256-CBC - + none none - + TLS auth اعتبار TLS - + Block DNS requests outside of VPN مسدود کردن درخواست‎های DNS خارج از وی‎پی‎ان - + Additional client configuration commands تنظیمات و دستورات اضافه برنامه متصل شونده - - + + Commands: دستورات: - + Additional server configuration commands تنظیمات و دستورات اضافه سرور - + Unable change settings while there is an active connection - + نمی‌توان تنظیمات را تغییر داد در حالی که اتصال فعال است. Remove OpenVPN @@ -696,7 +874,7 @@ Already installed containers were found on the server. All installed containers کنسل - + Save ذخیره @@ -704,32 +882,32 @@ Already installed containers were found on the server. All installed containers PageProtocolRaw - + settings تنظیمات - + Show connection options نمایش تنظیمات اتصال - + Connection options %1 تنظیمات اتصال %1 - + Remove حذف - + Remove %1 from server? %1 از سرور حذف شود؟ - + All users with whom you shared a connection with will no longer be able to connect to it. همه کاربرانی که با آن‌ها ارتباطی به اشتراک گذاشته‌اید دیگر قادر به اتصال به آن نخواهند بود. @@ -738,12 +916,12 @@ Already installed containers were found on the server. All installed containers همه کاربرانی که با آن این پروتکل VPN را به اشتراک گذاشته‌اید دیگر نمی‌توانند به آن متصل شوند. - + Continue ادامه - + Cancel کنسل @@ -751,64 +929,128 @@ Already installed containers were found on the server. All installed containers PageProtocolShadowSocksSettings - + Shadowsocks settings تنظیمات Shadowsocks - + Port پورت - + Cipher رمزگذاری - + Save ذخیره - + Unable change settings while there is an active connection + نمی‌توان تنظیمات را تغییر داد در حالی که اتصال فعال است. + + + + PageProtocolWireGuardClientSettings + + + WG settings + تنظیمات WG + + + + MTU + + + Server settings + + + + + Port + پورت + + + + Save + ذخیره + + + + Save settings? + تنظیمات را ذخیره کن? + + + + Only the settings for this device will be changed + + + + + Continue + + + + + Cancel + + + + + Unable change settings while there is an active connection + نمی‌توان تنظیمات را تغییر داد در حالی که اتصال فعال است. + PageProtocolWireGuardSettings - + WG settings - + تنظیمات WG - + Port - پورت + پورت - - MTU + + Save settings? + تنظیمات را ذخیره کن? + + + + All users with whom you shared a connection with will no longer be able to connect to it. + همه کاربرانی که با آن‌ها ارتباطی به اشتراک گذاشته‌اید دیگر قادر به اتصال به آن نخواهند بود. + + + + Continue - + Unable change settings while there is an active connection - + نمی‌توان تنظیمات را تغییر داد در حالی که اتصال فعال است. All users with whom you shared a connection will no longer be able to connect to it. تمام کاربرانی که این ارتباط را با آنها به اشتراک گذاشته‎اید دیگر نمی‎توانند به آن متصل شوند. + Cancel - کنسل + کنسل - + Save ذخیره @@ -816,24 +1058,24 @@ Already installed containers were found on the server. All installed containers PageProtocolXraySettings - + XRay settings - + تنظیمات XRay - + Disguised as traffic from - پنهان کردن به عنوان ترافیک از + به‌عنوان ترافیک از طرف زیر نمایش داده می‌شود - + Save - ذخیره + ذخیره - + Unable change settings while there is an active connection - + نمی‌توان تنظیمات را تغییر داد در حالی که اتصال فعال است. @@ -846,293 +1088,290 @@ Already installed containers were found on the server. All installed containers PageServiceDnsSettings - + A DNS service is installed on your server, and it is only accessible via VPN. یک سرویس DSN بر روی سرور شما نصب شده و فقط از طریق وی‎پی‎ان قابل دسترسی می‎باشد. - + The DNS address is the same as the address of your server. You can configure DNS in the settings, under the connections tab. آدرس DSN همان آدرس سرور شماست. میتوانید از قسمت تنظیمات و تب اتصالات DSN خود را تنظیم کنید. - + Remove جذف - + Remove %1 from server? %1 از سرور حذف شود؟ - + Continue ادامه - + Cancel کنسل - + Cannot remove AmneziaDNS from running server - + نمی‌توان AmneziaDNS را از سرور در حال اجرا حذف کرد. PageServiceSftpSettings - + Settings updated successfully تنظیمات با موفقیت به‎روز‎رسانی شد - + SFTP settings تنظیمات SFTP - + Host هاست - - - - + + + + Copied کپی شد - + Port پورت - + User name نام کاربری - + Password رمز عبور - + Mount folder on device بارگذاری پوشه بر روی دستگاه - + In order to mount remote SFTP folder as local drive, perform following steps: <br> برای بارگذاری پوشه SFTP بر روی درایو محلی قدم‎های زیر را انجام دهید: <br> - - + + <br>1. Install the latest version of <br> 1. آخرین نسخه را نصب کنید - - + + <br>2. Install the latest version of <br> 2. آخرین نسخه را نصب کنید - + Detailed instructions جزییات دستورالعمل‎ها - Remove SFTP and all data stored there - حذف SFTP و تمام داده‎های ذخیره شده در آن + حذف SFTP و تمام داده‎های ذخیره شده در آن - Remove SFTP and all data stored there? - پوشه SFTP و تمام داده‎های آن حذف شوند؟ + پوشه SFTP و تمام داده‎های آن حذف شوند؟ - Continue - ادامه + ادامه - Cancel - کنسل + کنسل PageServiceSocksProxySettings - + Settings updated successfully - + تنظیمات با موفقیت به‌روزرسانی شد. - - + + SOCKS5 settings - + تنظیمات SOCKS5 - + Host - هاست + هاستمیزبان - - - - + + + + Copied - کپی شد + کپی شد - - + + Port - پورت + پورت - + User name - نام کاربری + نام کاربری - - + + Password - رمز عبور + رمز عبور - + Username - + نام کاربری - - + + Change connection settings - + تغییر تنظیمات اتصال - + The port must be in the range of 1 to 65535 - + پورت باید در محدوده ۱ تا ۶۵۵۳۵ باشد - + Password cannot be empty - + رمز عبور نمی‌تواند خالی باشد - + Username cannot be empty - + نام کاربری نمی‌تواند خالی باشد PageServiceTorWebsiteSettings - + Settings updated successfully تنظیمات با موفقیت به‎روز‎‌رسانی شد - + Tor website settings تنظیمات وب‎سایت Tor - + Website address آدرس وب‎سایت - + Copied کپی شد - + Use <a href="https://www.torproject.org/download/" style="color: #FBB26A;">Tor Browser</a> to open this URL. - + After creating your onion site, it takes a few minutes for the Tor network to make it available for use. پس از ایجاد سایت پیاز خود، چند دقیقه طول می‌کشد تا شبکه تور آن را برای استفاده فراهم کند. - + When configuring WordPress set the this onion address as domain. زمانی که سایت وردپرس را تنظیم میکنید این آدرس پیازی را به عنوان دامنه قرار دهید. - Remove website - حذف وب سایت + حذف وب سایت - The site with all data will be removed from the tor network. - سایت با تمام داده‎ها از شبکه Tor حذف خواهد شد. + سایت با تمام داده‎ها از شبکه Tor حذف خواهد شد. - Continue - ادامه + ادامه - Cancel - کنسل + کنسل PageSettings - + Settings تنظیمات - + Servers سرورها - + Connection ارتباط - + Application نرم‎افزار - + Backup بک‎آپ - + About AmneziaVPN درباره Amnezia + Dev console + + + + Close application بستن نرم‎افزار @@ -1140,246 +1379,329 @@ Already installed containers were found on the server. All installed containers PageSettingsAbout - + Support Amnezia پشتیبانی از Amnezia - + Amnezia is a free and open-source application. You can support the developers if you like it. Amnezia یک برنامه رایگان و متن باز است. اگر دوست دارید می توانید از توسعه دهندگان حمایت کنید. - + Contacts مخاطب - + Telegram group گروه تلگرام - + To discuss features برای گفتگو در مورد ویژگی‎ها - + https://t.me/amnezia_vpn_en - https://t.me/amnezia_vpn - - - - Mail - ایمیل + https://t.me/amnezia_vpn_ir + support@amnezia.org + + + + Mail + ایمیل + + + For reviews and bug reports برای ارائه نظرات و گزارشات باگ - + + Copied + کپی شد + + + GitHub GitHub - + https://github.com/amnezia-vpn/amnezia-client https://github.com/amnezia-vpn/amnezia-client - + Website وب سایت - https://amnezia.org - https://amnezia.org + https://amnezia.org - + Software version: %1 %1 :نسخه نرم‎افزار - + Check for updates بررسی بروز‎رسانی - + Privacy Policy + + PageSettingsApiServerInfo + + + For the region + برای منطقه + + + + Price + قیمت + + + + Work period + مدت زمان کار + + + + Speed + سرعت + + + + Support tag + + + + + Copied + کپی شد + + + + Reload API config + بارگذاری مجدد پیکربندی API + + + + Reload API config? + آیا می‌خواهید پیکربندی API را دوباره بارگذاری کنید؟ + + + + + Continue + ادامه دهید + + + + + Cancel + لغو + + + + Cannot reload API config during active connection + نمی‌توان پیکربندی API را در حین اتصال فعال دوباره بارگذاری کرد. + + + + Remove from application + حذف از برنامه + + + + Remove from application? + آیا می‌خواهید از برنامه حذف کنید؟ + + + + Cannot remove server during active connection + نمی‌توان سرور را در حین اتصال فعال حذف کرد. + + PageSettingsAppSplitTunneling - + Cannot change split tunneling settings during active connection - نمی توان تنظیمات تونل تقسیم را در طول اتصال فعال تغییر داد + نمی توان تنظیمات تونل تقسیم را در طول اتصال فعال تغییر دادنمی‌توان تنظیمات تقسیم تونلینگ را در حین اتصال فعال تغییر داد. - + Only the apps from the list should have access via VPN - + فقط برنامه‌های موجود در لیست باید از طریق VPN دسترسی داشته باشند. - + Apps from the list should not have access via VPN - + برنامه‌های موجود در لیست نباید از طریق VPN دسترسی داشته باشند. - + App split tunneling - + تقسیم تونلینگ برنامه‌ها - + Mode - حالت - - - - Remove - + حالت - Continue - + Remove + حذف + Continue + ادامه دهید + + + Cancel - کنسل + کنسل - + application name - - - - - Open executable file - + نام برنامه + Open executable file + فایل اجرایی را باز کنید + + + Executable files (*.*) - + فایل‌های اجرایی (*.*) PageSettingsApplication - + Application نرم افزار - + Allow application screenshots مجوز اسکرین‎شات در برنامه - + Enable notifications - + فعال کردن اعلان‌ها - + Enable notifications to show the VPN state in the status bar - + اعلان ها را فعال کنید تا وضعیت VPN را در نوار وضعیت ببینید - + Auto start شروع خودکار - + Launch the application every time the device is starts راه‎اندازی نرم‎افزار با هر بار روشن شدن دستگاه - + Auto connect اتصال خودکار - + Connect to VPN on app start اتصال به وی‎‎پی‎ان با شروع نرم‎افزار - + Start minimized شروع به صورت کوچک - + Launch application minimized راه‎اندازی برنامه به صورت کوچک - + Language زبان - + Logging گزارشات - + Enabled فعال - + Disabled غیر فعال - + Reset settings and remove all data from the application ریست کردن تنظیمات و حذف تمام داده‎ها از نرم‎افزار - + Reset settings and remove all data from the application? ریست کردن تنظیمات و حذف تمام داده‎ها از نرم‎افزار؟ - + All settings will be reset to default. All installed AmneziaVPN services will still remain on the server. تمام تنظیمات به حالت پیش‎فرض ریست می‎شوند. تمام سرویس‎های Amnezia بر روی سرور باقی می‎مانند. - + Continue ادامه - + Cancel کنسل - + Cannot reset settings during active connection - + نمی‌توان تنظیمات را در حین اتصال فعال بازنشانی کرد. PageSettingsBackup - + Settings restored from backup file تنظیمات از فایل پشتیبان بازیابی شد @@ -1452,68 +1774,68 @@ Already installed containers were found on the server. All installed containers Cannot restore backup settings during active connection - + نمی‌توان تنظیمات پشتیبان را در حین اتصال فعال بازیابی کرد. PageSettingsConnection - + Connection ارتباط - + Use AmneziaDNS استفاده از AmneziaDNS - + If AmneziaDNS is installed on the server اگر AmneziaDNS بر روی سرور نصب شده باشد - + DNS servers سرورهای DNS - + When AmneziaDNS is not used or installed وقتی AmneziaDNS استفاده نشده یا نصب نشده است - + Allows you to use the VPN only for certain Apps به شما امکان می دهد از VPN فقط برای برخی برنامه ها استفاده کنید - - - KillSwitch - - + KillSwitch + KillSwitch + + + Disables your internet if your encrypted VPN connection drops out for any reason. - + اگر به هر دلیلی اتصال VPN رمزگذاری شده شما قطع شود، اینترنت شما را غیرفعال می‌کند. - + Cannot change killSwitch settings during active connection - + نمی‌توان تنظیمات Kill Switch را در حین اتصال فعال تغییر داد. - + Site-based split tunneling جداسازی ترافیک بر اساس سایت - + Allows you to select which sites you want to access through the VPN میتوانید مشخص کنید که چه سایت‎هایی از وی‎پی‎ان استفاده کنند - + App-based split tunneling جداسازی ترافیک بر اساس نرم‎افزار @@ -1521,62 +1843,62 @@ Already installed containers were found on the server. All installed containers PageSettingsDns - + Default server does not support custom DNS سرور پیش‌فرض از دی‌ان‌اس سفارشی پشتیبانی نمی‌کند - + DNS servers سرورهای DNS - + If AmneziaDNS is not used or installed اگر AmneziaDNS نصب نباشد یا استفاده نشود - + Primary DNS DNS اصلی - + Secondary DNS DNS ثانویه - + Restore default بازگشت به پیش‎فرض - + Restore default DNS settings? بازگشت به تنظیمات پیش‎فرض DNS؟ - + Continue ادامه - + Cancel کنسل - + Settings have been reset تنظیمات ریست شد - + Save ذخیره - + Settings saved ذخیره تنظیمات @@ -1584,72 +1906,108 @@ Already installed containers were found on the server. All installed containers PageSettingsLogging - Logging is enabled. Note that logs will be automatically disabled after 14 days, and all log files will be deleted. - + ثبت وقایع فعال است. توجه داشته باشید که ثبت وقایع به‌طور خودکار پس از ۱۴ روز غیرفعال شده و تمام فایل‌های ثبت وقایع حذف خواهند شد. - + Logging گزارشات - + Enabling this function will save application's logs automatically. By default, logging functionality is disabled. Enable log saving in case of application malfunction. فعال کردن این عملکرد باعث ذخیره خودکار لاگ‌های برنامه می‌شود. به طور پیش‌فرض، قابلیت ثبت لاگ غیرفعال است. در صورت بروز خطا در برنامه، ذخیره لاگ را فعال کنید. - Save logs - ذخیره گزارشات + ذخیره گزارشات - Open folder with logs - باز کردن پوشه گزارشات + باز کردن پوشه گزارشات - + + Save ذخیره - + + Logs files (*.log) Logs files (*.log) - + + Logs file saved فایل گزارشات ذخیره شد - Save logs to file - ذخیره گزارشات در فایل + ذخیره گزارشات در فایل - + + Enable logs + + + + Clear logs? پاک کردن گزارشات؟ - + Continue ادامه - + Cancel کنسل - + Logs have been cleaned up گزارشات پاک شدند - + + Client logs + + + + + AmneziaVPN logs + + + + + + Open logs folder + + + + + + Export logs + + + + + Service logs + + + + + AmneziaVPN-service logs + + + + Clear logs پاک کردن گزارشات @@ -1657,7 +2015,7 @@ Already installed containers were found on the server. All installed containers PageSettingsServerData - + All installed containers have been added to the application تمام کانتینرهای نصب شده به نرم‎افزار اضافه شدند @@ -1674,7 +2032,7 @@ Already installed containers were found on the server. All installed containers پاک کردن پروفایل ذخیره شده؟ - + No new installed containers found کانتینر نصب شده جدیدی پیدا نشد @@ -1683,104 +2041,104 @@ Already installed containers were found on the server. All installed containers - - - - - - Continue - ادامه - + Continue + ادامه + + + + + + Cancel کنسل - + Check the server for previously installed Amnezia services چک کردن سرویس‎های نصب شده Amnezia بر روی سرور - + Add them to the application if they were not displayed اضافه کردن آنها به نرم‎افزار اگر نمایش داده نشده‎اند - + Reboot server سرور را دوباره راه‌اندازی کنید - + Do you want to reboot the server? آیا می‌خواهید سرور را دوباره راه‌اندازی کنید؟ - + The reboot process may take approximately 30 seconds. Are you sure you wish to proceed? فرآیند راه‌اندازی ممکن است حدود ۳۰ ثانیه طول بکشد. آیا مطمئن هستید که می‌خواهید ادامه دهید؟ - + Cannot reboot server during active connection - + نمی‌توان سرور را در حین اتصال فعال راه‌اندازی مجدد کرد. - + Do you want to remove the server from application? آیا می‌خواهید سرور را از برنامه حذف کنید؟ - + Cannot remove server during active connection - + نمی‌توان سرور را در حین اتصال فعال حذف کرد. - + Do you want to clear server from Amnezia software? آیا می‌خواهید سرور را از نرم‌افزار Amnezia پاک کنید؟ - + All users whom you shared a connection with will no longer be able to connect to it. همه کاربرانی که با آن‌ها ارتباطی به اشتراک گذاشته‌اید دیگر قادر به اتصال به آن نخواهند بود. - + Cannot clear server from Amnezia software during active connection - + نمی‌توان سرور را در حین اتصال فعال از نرم‌افزار Amnezia پاک کرد. - + Reset API config تنظیمات API را بازنشانی کنید - + Do you want to reset API config? آیا می خواهید پیکربندی API را بازنشانی کنید؟ - + Cannot reset API config during active connection - + نمی‌توان پیکربندی API را در حین اتصال فعال بازنشانی کرد. - + Remove server from application حذف کردن سرور از نرم‎افزار - + All installed AmneziaVPN services will still remain on the server. تمام سرویس‎های نصب‎شده Amnezia همچنان بر روی سرور باقی خواهند ماند. - + Clear server from Amnezia software پاک کردن سرور از نرم‎افزار Amnezia @@ -1788,27 +2146,27 @@ Already installed containers were found on the server. All installed containers PageSettingsServerInfo - + Server name نام سرور - + Save ذخیره - + Protocols پروتکل‎ها - + Services سرویس‎ها - + Management مدیریت @@ -1816,59 +2174,83 @@ Already installed containers were found on the server. All installed containers PageSettingsServerProtocol - + settings تنظیمات - Clear %1 profile - + پاک کردن پروفایل %1 - + Clear %1 profile? - + آیا می‌خواهید پروفایل %1 را پاک کنید؟ - + - + Unable to clear %1 profile while there is an active connection - + نمی‌توان پروفایل %1 را در حین اتصال فعال پاک کرد. - + Remove حذف - + Remove %1 from server? حذف %1 از سرور؟ - + All users with whom you shared a connection will no longer be able to connect to it. تمام کاربرانی که این ارتباط را با آنها به اشتراک گذاشته‎اید دیگر نمی‎توانند به آن متصل شوند. - + Cannot remove active container - + نمی‌توان کانتینر فعال را حذف کرد. - - + + Continue ادامه - - + + connection settings + + + + + Click the "connect" button to create a connection configuration + + + + + server settings + + + + + Clear profile + + + + + The connection configuration will be deleted for this device only + + + + + Cancel کنسل @@ -1876,7 +2258,7 @@ Already installed containers were found on the server. All installed containers PageSettingsServersList - + Servers سرورها @@ -1884,110 +2266,155 @@ Already installed containers were found on the server. All installed containers PageSettingsSplitTunneling - + Default server does not support split tunneling function سرور پیش‌فرض از عملکرد تونل‌سازی تقسیم شده پشتیبانی نمی‌کند - + Addresses from the list should not be accessed via VPN دسترسی به آدرس‎های لیست بدون وی‎پی‎ان - + Split tunneling جداسازی ترافیک - + Mode حالت - + Remove حذف - + Continue ادامه - + Cancel کنسل - + Cannot change split tunneling settings during active connection نمی توان تنظیمات تونل تقسیم را در طول اتصال فعال تغییر داد - + Only the sites listed here will be accessed through the VPN تنها سایت‌های موجود در اینجا از طریق VPN دسترسی داده خواهند شد - + website or IP وب‌سایت یا آدرس IP - + Import / Export Sites وارد کردن / صادر کردن وب‌سایت‌ها - + Import بارگذاری - + Save site list ذخیره لیست سایت‎ها - + Save sites ذخیره سایت‎ها - - - + + + Sites files (*.json) Sites files (*.json) - + Import a list of sites بارگذاری لیست سایت‎ها - + Replace site list جایگزین کردن لیست سایت - - + + Open sites file باز کردن فایل سایت‎ها - + Add imported sites to existing ones اضافه کردن سایت‎های بارگذاری شده به سایت‎های موجود + + PageSetupWizardApiServiceInfo + + + For the region + برای منطقه + + + + Price + قیمت + + + + Work period + مدت زمان کار + + + + Speed + سرعت + + + + Features + ویژگی‌ها + + + + Connect + اتصال + + + + PageSetupWizardApiServicesList + + + VPN by Amnezia + VPN توسط Amnezia + + + + Choose a VPN service that suits your needs. + یک سرویس VPN که مناسب نیازهای شما باشد را انتخاب کنید. + + PageSetupWizardConfigSource - Server connection - ارتباط سرور + ارتباط سرور Do not use connection code from public sources. It may have been created to intercept your data. @@ -1998,95 +2425,181 @@ It's okay as long as it's from someone you trust. ایرادی ندارد که از طرف کسی باشد که به او اعتماد دارید. - Do not use connection codes from untrusted sources, as they may be created to intercept your data. - از کدهای اتصال از منابع نامعتبر استفاده نکنید، زیرا ممکن است برای رهگیری داده های شما ایجاد شده باشند. + از کدهای اتصال از منابع نامعتبر استفاده نکنید، زیرا ممکن است برای رهگیری داده های شما ایجاد شده باشند. - What do you have? - چی داری؟ + چی داری؟ - + File with connection settings فایل شامل تنظیمات اتصال - File with connection settings or backup - فایل شامل تنظیمات اتصال یا بک‎آپ + فایل شامل تنظیمات اتصال یا بک‎آپ - + + Connection + ارتباط + + + + Settings + تنظیمات + + + + Enable logs + + + + + Insert the key, add a configuration file or scan the QR-code + کلید را وارد کنید، فایل پیکربندی را اضافه کنید یا کد QR را اسکن کنید + + + + Insert key + کلید را وارد کنید + + + + Insert + وارد کردن + + + + Continue + ادامه دهید + + + + Other connection options + گزینه‌های اتصال دیگر + + + + VPN by Amnezia + VPN توسط Amnezia + + + + Connect to classic paid and free VPN services from Amnezia + اتصال به سرویس‌های VPN کلاسیک پولی و رایگان از Amnezia + + + + Self-hosted VPN + Self-hosted VPN + + + + Configure Amnezia VPN on your own server + پیکربندی VPN Amnezia بر روی سرور خودتان + + + + Restore from backup + بازیابی از پشتیبان + + + + Open backup file + باز کردن فایل پشتیبان + + + + Backup files (*.backup) + Backup files (*.backup) + + + Open config file باز کردن فایل تنظیمات - + QR code QR-Code - + + I have nothing + من هیچی ندارم + + Key as text - متن شامل کلید + متن شامل کلید PageSetupWizardCredentials - + Server IP address [:port] آدرس آی‎پی سرور (:پورت) - + Continue ادامه - + Enter the address in the format 255.255.255.255:88 آدرس را با فرمت 255.255.255.255:88 وارد کنید - + Configure your server سرور خود را پیکربندی کنید - + 255.255.255.255:22 - + SSH Username - + Password or SSH private key رمز عبور یا کلید خصوصی SSH - + All data you enter will remain strictly confidential and will not be shared or disclosed to the Amnezia or any third parties تمام داده‎هایی که شما وارد می‎کنید به شدت محرمانه‎ است و با Amnezia یا هر شخص ثالث دیگری به اشتراک گذاشته نمی‎شود - + + How to run your VPN server + چگونه سرور VPN خود را اجرا کنید + + + + Where to get connection data, step-by-step instructions for buying a VPS + داده‌های اتصال را از کجا دریافت کنید و دستورالعمل‌های مرحله به مرحله برای خرید یک VPS + + + Ip address cannot be empty آدرس آی‎پی نمی‎تواند خالی باشد - + Login cannot be empty نام‎کاربری نمی‎تواند خالی باشد - + Password/private key cannot be empty پسورد یا کلید خصوصی نمی‎تواند خالی باشد @@ -2094,22 +2607,22 @@ It's okay as long as it's from someone you trust. PageSetupWizardEasy - + What is the level of internet control in your region? سطح کنترل اینترنت در منطقه شما چگونه است؟ - + Choose a VPN protocol یک پروتکل VPN را انتخاب کنید - + Skip setup رد شدن از تنظیم - + Continue ادامه @@ -2117,38 +2630,38 @@ It's okay as long as it's from someone you trust. PageSetupWizardInstalling - + The server has already been added to the application سرور در حال حاضر به نرم‎افزار اضافه شده است - + Amnezia has detected that your server is currently Amnezia has detected that your server is currently - + busy installing other software. Amnezia installation مشغول نصب نرم افزارهای دیگر نصب Amnezia - + will pause until the server finishes installing other software متوقف شده تا زمانی که سرور نصب نرم‎افزار دیگر را تمام کند - + Installing در حال نصب - + Cancel installation لغو عملیات نصب - - + + Usually it takes no more than 5 minutes معمولا بیش از 5 دقیقه طول نمی‎کشد @@ -2156,50 +2669,50 @@ It's okay as long as it's from someone you trust. PageSetupWizardProtocolSettings - + Installing %1 در حال نصب %1 - + More detailed جزییات بیشتر - + Close بستن - + Network protocol پروتکل شبکه - + Port پورت - + Install نصب - + The port must be in the range of 1 to 65535 - + پورت باید در محدوده ۱ تا ۶۵۵۳۵ باشد PageSetupWizardProtocols - + VPN protocol پروتکل وی‎پی‎ان - + Choose the one with the highest priority for you. Later, you can install other protocols and additional services, such as DNS proxy and SFTP. پروتکلی که بیشترین اولویت را برای شما دارد انتخاب کنید. بعدا، میتوانید پروتکل‎ها و سرویس‎های اضافه مانند پروکسی DNS و SFTP را هم نصب کنید. @@ -2207,7 +2720,7 @@ It's okay as long as it's from someone you trust. PageSetupWizardQrReader - + Point the camera at the QR code and hold for a couple of seconds. دوربین را روی QR Code بگیرید و برای چند ثانیه آن را نگه دارید. @@ -2215,60 +2728,55 @@ It's okay as long as it's from someone you trust. PageSetupWizardStart - Settings restored from backup file - تنظیمات از فایل بک‎آپ بازیابی شدند + تنظیمات از فایل بک‎آپ بازیابی شدند - Free service for creating a personal VPN on your server. - سرویس رایگان برای ایجاد وی‎پی‎ان شخصی بر روی سرور خودتان. + سرویس رایگان برای ایجاد وی‎پی‎ان شخصی بر روی سرور خودتان. - Helps you access blocked content without revealing your privacy, even to VPN providers. - به شما کمک می‎کند که بدون فاش کردن حریم شخصی خودتان, حتی برای ارائه دهنده وی‎پی‎ان به محتوای مسدود شده دسترسی پیدا کنید. + به شما کمک می‎کند که بدون فاش کردن حریم شخصی خودتان, حتی برای ارائه دهنده وی‎پی‎ان به محتوای مسدود شده دسترسی پیدا کنید. - I have the data to connect - من داده برای اتصال دارم + من داده برای اتصال دارم - I have nothing - من هیچی ندارم + من هیچی ندارم - - https://amnezia.org/instructions/0_starter-guide - + + Let's get started + بیایید شروع کنیم PageSetupWizardTextKey - + Connection key کلید ارتباط - + A line that starts with vpn://... خطی که با آن شروع می شود vpn://... - + Key کلید - + Insert وارد کردن - + Continue ادامه @@ -2276,32 +2784,32 @@ It's okay as long as it's from someone you trust. PageSetupWizardViewConfig - + New connection ارتباط جدید - + Collapse content جمع کردن محتوا - + Show content نمایش محتوا - + Enable WireGuard obfuscation. It may be useful if WireGuard is blocked on your provider. - + فعال‌سازی استتار WireGuard. این ممکن است مفید باشد اگر WireGuard توسط ارائه‌دهنده شما مسدود شده باشد. - + Use connection codes only from sources you trust. Codes from public sources may have been created to intercept your data. از کدهای اتصال فقط از منابع مورد اعتماد خود استفاده کنید. ممکن است کدهایی از منابع عمومی برای رهگیری داده های شما ایجاد شده باشند - + Connect اتصال @@ -2309,211 +2817,211 @@ It's okay as long as it's from someone you trust. PageShare - + OpenVPN native format فرمت OpenVPN - + WireGuard native format فرمت WireGuard - + Connection ارتباط - - + + Server سرور - + Config revoked تنظیمات ابطال‎شد - + Connection to ارتباط با - + File with connection settings to فایل شامل تنظیمات ارتباط با - + Save OpenVPN config ذخیره تنظیمات OpenVPN - + Save WireGuard config ذخیره تنظیمات WireGuard - + Save AmneziaWG config تنظیمات AmneziaWG را ذخیره کنید - + Save Shadowsocks config ذخیره تنظیمات Shadowsocks - + Save Cloak config ذخیره تنظیمات Cloak - + Save XRay config - + ذخیره پیکربندی XRay - + For the AmneziaVPN app برای نرم‎افزار AmneziaVPN - + AmneziaWG native format فرمت بومی AmneziaWG - + Shadowsocks native format فرمت Shadowsocks - + Cloak native format فرمت Cloak - + XRay native format - + فرمت بومی XRay - + Share VPN Access اتصال vpn را به اشتراک بگذارید - + Share full access to the server and VPN به اشتراک گذاشتن دسترسی کامل به سرور و وی‎پی‎ان - + Use for your own devices, or share with those you trust to manage the server. برای دستگاه‎های خودتان استفاده کنید یا با آنهایی که برای مدیریت سرور به آن‎ها اعتماد دارید به اشتراک بگذارید. - - + + Users کاربران - + User name نام کاربری - + Search جستجو - + Creation date: %1 - + تاریخ ایجاد: %1 - + Latest handshake: %1 - + آخرین ارتباط: %1 - + Data received: %1 - + داده‌های دریافت شده: %1 - + Data sent: %1 - + داده‌های ارسال شده: %1 Creation date: تاریخ ایجاد: - + Rename تغییر نام - + Client name نام کلاینت - + Save ذخیره - + Revoke ابطال - + Revoke the config for a user - %1? لغو پیکربندی برای یک کاربر - %1? - + The user will no longer be able to connect to your server. کاربر دیگر نمی‎تواند به سرور وصل شود. - + Continue ادامه - + Cancel کنسل - + Share VPN access without the ability to manage the server به اشتراک گذاشتن دسترسی وی‎پی‎ان بدون امکان مدیریت سرور - - + + Protocol پروتکل - - + + Connection format فرمت ارتباط - - + + Share اشتراک‎گذاری @@ -2521,50 +3029,55 @@ It's okay as long as it's from someone you trust. PageShareFullAccess - + Full access to the server and VPN دسترسی کامل به سرور و وی‎پی‎ان - + We recommend that you use full access to the server only for your own additional devices. ما پیشنهاد میکنیم که ازحالت دسترسی کامل به سرور فقط برای دستگاه‎های دیگر خودتان استفاده کنید. - + If you share full access with other people, they can remove and add protocols and services to the server, which will cause the VPN to work incorrectly for all users. اگر دسترسی کامل را با دیگران به اشتراک بگذارید، آن‎ها می‎توانند پروتکل‎ها و سرویس‎ها را حذف یا اضافه کنند که باعث می‎شود که وی‎پی‎ان دیگر برای سایر کاربران کار نکند. - + Server سرور - + Accessing در حال دسترسی به - + File with accessing settings to فایل شامل تنظیمات دسترسی به - + Share اشتراک‎گذاری - + + Access error! + خطای دسترسی! + + + Connection to ارتباط با - + File with connection settings to فایل شامل تنظیمات ارتباط با @@ -2572,15 +3085,25 @@ It's okay as long as it's from someone you trust. PageStart - + Logging was disabled after 14 days, log files were deleted + ثبت وقایع پس از ۱۴ روز غیرفعال شد و فایل‌های ثبت وقایع حذف شدند + + + + Settings restored from backup file + تنظیمات از فایل پشتیبان بازیابی شد + + + + Logging is enabled. Note that logs will be automaticallydisabled after 14 days, and all log files will be deleted. PopupType - + Close بستن @@ -2614,12 +3137,12 @@ It's okay as long as it's from someone you trust. Password not found - + Could not open keystore Could not open keystore - + Could not remove private key from keystore Could not remove private key from keystore @@ -2795,27 +3318,27 @@ It's okay as long as it's from someone you trust. Could not open keystore - + Could not create private key generator Could not create private key generator - + Could not generate new private key Could not generate new private key - + Could not retrieve private key from keystore Could not retrieve private key from keystore - + Could not create encryption cipher Could not create encryption cipher - + Could not encrypt data Could not encrypt data @@ -2971,7 +3494,7 @@ It's okay as long as it's from someone you trust. این پیکربندی قبلاً به برنامه اضافه شده است - + ErrorCode: %1. کد خطا: %1. @@ -2983,17 +3506,17 @@ It's okay as long as it's from someone you trust. Background service is not running - + Background service is not running Server error: Packet manager error - + Server error: Packet manager error SCP error: Generic failure - + SCP error: Generic failure @@ -3043,50 +3566,55 @@ It's okay as long as it's from someone you trust. In the response from the server, an empty config was received - + در پاسخ از سرور، پیکربندی خالی دریافت شد SSL error occurred - + SSL error occurred Server response timeout on api request - + Server response timeout on api request - - QFile error: The file could not be opened + + Missing AGW public key - QFile error: An error occurred when reading from the file + QFile error: The file could not be opened - QFile error: The file could not be accessed + QFile error: An error occurred when reading from the file - QFile error: An unspecified error occurred + QFile error: The file could not be accessed - QFile error: A fatal error occurred + QFile error: An unspecified error occurred + QFile error: A fatal error occurred + + + + QFile error: The operation was aborted - + Internal error Internal error @@ -3108,12 +3636,12 @@ It's okay as long as it's from someone you trust. XRay with REALITY - Suitable for countries with the highest level of internet censorship. Traffic masking as web traffic at the TLS level, and protection against detection by active probing methods. - + XRay با REALITY - مناسب برای کشورهایی با بالاترین سطح سانسور اینترنت. استتار ترافیک به عنوان ترافیک وب در سطح TLS و حفاظت در برابر شناسایی با روش‌های پروب فعال. IKEv2/IPsec - Modern stable protocol, a bit faster than others, restores connection after signal loss. It has native support on the latest versions of Android and iOS. - + IKEv2/IPsec - پروتکل مدرن و پایدار، کمی سریع‌تر از سایرین است و پس از قطع شدن سیگنال، اتصال را بازیابی می‌کند. از پشتیبانی بومی در آخرین نسخه‌های Android و iOS برخوردار است. @@ -3186,7 +3714,11 @@ WireGuard به دلیل امضاهای بسته متمایز خود، بسیار It uniquely identifies censors during the TLS handshake phase, seamlessly operating as a proxy for legitimate clients while diverting censors to genuine websites like google.com, thus presenting an authentic TLS certificate and data. This advanced capability differentiates REALITY from similar technologies by its ability to disguise web traffic as coming from random, legitimate sites without the need for specific configurations. Unlike older protocols such as VMess, VLESS, and the XTLS-Vision transport, REALITY's innovative "friend or foe" recognition at the TLS handshake enhances security and circumvents detection by sophisticated DPI systems employing active probing techniques. This makes REALITY a robust solution for maintaining internet freedom in environments with stringent censorship. - + پروتکل REALITY، یک توسعه پیشگامانه توسط خالقان XRay، به‌طور خاص برای مقابله با بالاترین سطح سانسور اینترنتی طراحی شده است و از رویکرد نوآورانه‌ای برای دور زدن محدودیت‌ها استفاده می‌کند. + +REALITY به‌طور منحصربه‌فردی سانسورچیان را در مرحله دست‌دهی TLS شناسایی می‌کند و به‌صورت یکپارچه به‌عنوان پراکسی برای کاربران قانونی عمل می‌کند، در حالی که سانسورچیان را به سایت‌های معتبر مانند google.com هدایت می‌کند و در نتیجه یک گواهی TLS واقعی و داده‌های اصلی ارائه می‌دهد. + +این قابلیت پیشرفته، REALITY را از فناوری‌های مشابه متمایز می‌کند، زیرا می‌تواند ترافیک وب را بدون نیاز به پیکربندی‌های خاص، به‌عنوان ترافیک از سایت‌های تصادفی و معتبر جا بزند. برخلاف پروتکل‌های قدیمی‌تر مانند VMess، VLESS و انتقال XTLS-Vision، تشخیص نوآورانه "دوست یا دشمن" REALITY در مرحله دست‌دهی TLS امنیت را افزایش داده و از شناسایی توسط سیستم‌های پیشرفته DPI که از تکنیک‌های پروب فعال استفاده می‌کنند، جلوگیری می‌کند. این ویژگی REALITY را به یک راه‌حل قوی برای حفظ آزادی اینترنت در محیط‌هایی با سانسور شدید تبدیل می‌کند. @@ -3347,7 +3879,7 @@ For more detailed information, you can SOCKS5 proxy server - + سرور پروکسی SOCKS5 @@ -3539,7 +4071,7 @@ For more detailed information, you can SelectLanguageDrawer - + Choose language انتخاب زبان @@ -3547,13 +4079,13 @@ For more detailed information, you can Settings - + Server #1 Server #1 - - + + Server Server @@ -3561,7 +4093,7 @@ For more detailed information, you can SettingsController - + All settings have been reset to default values تمام تنظیمات به مقادیر پیش فرض ریست شد @@ -3570,7 +4102,7 @@ For more detailed information, you can پروفایل ذخیره شده پاک شد - + Backup file is corrupted فایل بک‎آپ خراب شده است @@ -3578,39 +4110,39 @@ For more detailed information, you can ShareConnectionDrawer - - + + Save AmneziaVPN config ذخیره تنظیمات AmneziaVPN - + Share اشتراک‎گذاری - + Copy کپی - - + + Copied کپی شد - + Copy config string کپی‎کردن متن تنظیمات - + Show connection settings نمایش تنظیمات ارتباط - + To read the QR code in the Amnezia app, select "Add server" → "I have data to connect" → "QR code, key or settings file" برای خواندن QR Code در نرم‎افزار AmneziaVPN "اضافه کردن سرور" -> "من داده برای اتصال دارم" -> "QR Code، کلید یا فایل تنظیمات" @@ -3694,7 +4226,7 @@ For more detailed information, you can TextFieldWithHeaderType - + The field can't be empty این فیلد نمی‌تواند خالی باشد. @@ -3702,7 +4234,7 @@ For more detailed information, you can VpnConnection - + Mbps Mbps @@ -3753,12 +4285,12 @@ For more detailed information, you can amnezia::ContainerProps - + Low پایین - + High متوسط یا بالا @@ -3767,12 +4299,12 @@ For more detailed information, you can شدید - + I just want to increase the level of my privacy. من فقط میخواهم سطح حریم شخصی خودم را بالا ببرم - + I want to bypass censorship. This option recommended in most cases. من میخواهم از سانسور عبور کنم. این گزینه در اکثر موارد توصیه می‎‌شود @@ -3784,12 +4316,12 @@ For more detailed information, you can main2 - + Private key passphrase عبارت کلید خصوصی - + Save ذخیره diff --git a/client/translations/amneziavpn_hi_IN.ts b/client/translations/amneziavpn_hi_IN.ts index e63fe3ff..ab459b7c 100644 --- a/client/translations/amneziavpn_hi_IN.ts +++ b/client/translations/amneziavpn_hi_IN.ts @@ -1,6 +1,59 @@ + + ApiServicesModel + + + Classic VPN for comfortable work, downloading large files and watching videos. Works for any sites. Speed up to %1 MBit/s + + + + + VPN to access blocked sites in regions with high levels of Internet censorship. + + + + + <p><a style="color: #EB5757;">Not available in your region. If you have VPN enabled, disable it, return to the previous screen, and try again.</a> + + + + + Amnezia Premium - A classic VPN for comfortable work, downloading large files, and watching videos in high resolution. It works for all websites, even in countries with the highest level of internet censorship. + + + + + Amnezia Free is a free VPN to bypass blocking in countries with high levels of internet censorship + + + + + %1 MBit/s + + + + + %1 days + + + + + VPN will open only popular sites blocked in your region, such as Instagram, Facebook, Twitter and others. Other sites will be opened from your real IP address, <a href="%1/free" style="color: #FBB26A;">more details on the website.</a> + + + + + Free + + + + + %1 $/month + + + AppSplitTunnelingController @@ -27,7 +80,7 @@ ConnectButton - + Unable to disconnect during configuration preparation कॉन्फ़िगरेशन तैयारी के दौरान डिस्कनेक्ट करने में असमर्थ @@ -35,62 +88,62 @@ ConnectionController - - - + + + Connect कनेक्ट - + VPN Protocols is not installed. Please install VPN container at first पीएन प्रोटोकॉल स्थापित नहीं है. कृपया पहले वीपीएन कंटेनर स्थापित करें - + Connected जुड़ा हुआ - + The selected protocol is not supported on the current platform चयनित प्रोटोकॉल वर्तमान प्लेटफ़ॉर्म पर समर्थित नहीं है - + unable to create configuration कॉन्फ़िगरेशन बनाने में असमर्थ - + Connecting... कनेक्ट... - + Reconnecting... पुनः कनेक्ट हो रहा है... - + Disconnecting... डिस्कनेक्ट हो रहा है... - + Preparing... तैयार कर रहे हैं... - + Settings updated successfully, reconnnection... सेटिंग्स सफलतापूर्वक अपडेट हो गईं... - + Settings updated successfully सेटिंग्स सफलतापूर्वक अपडेट हो गईं @@ -131,7 +184,7 @@ &चपकाएं - + &SelectAll &सबका चयन करें @@ -139,9 +192,8 @@ ExportController - Access error! - प्रवेश त्रुटि! + प्रवेश त्रुटि! @@ -207,18 +259,18 @@ Can't be disabled for current server फाइल खोलने में असमर्थ - - + + Invalid configuration file अमान्य कॉन्फ़िगरेशन फ़ाइल - + Scanned %1 of %2. %2 में से %1 स्कैन किया गया. - + In the imported configuration, potentially dangerous lines were found: @@ -226,84 +278,104 @@ Can't be disabled for current server InstallController - + %1 installed successfully. %1 सफलतापूर्वक स्थापित हुआ. - + %1 is already installed on the server. %1 पहले से ही सर्वर पर स्थापित है. - + Added containers that were already installed on the server सर्वर पर पहले से स्थापित कंटेनर जोड़े गए - + Already installed containers were found on the server. All installed containers have been added to the application सर्वर पर पहले से स्थापित कंटेनर पाए गए। सभी स्थापित कंटेनरों को एप्लिकेशन में जोड़ दिया गया है - + Settings updated successfully सेटिंग्स सफलतापूर्वक अपडेट हो गईं - + Server '%1' was rebooted सर्वर '%1' रीबूट किया गया था - + Server '%1' was removed सर्वर '%1' रीबूट किया गया था - + All containers from server '%1' have been removed सर्वर '%1' से सभी कंटेनर हटा दिए गए हैं - + %1 has been removed from the server '%2' %1 को सर्वर '%2' से हटा दिया गया है - + + Api config removed + + + + %1 cached profile cleared %1 कैश्ड प्रोफ़ाइल साफ़ की गई - + Please login as the user कृपया उपयोगकर्ता के रूप में लॉगिन करें - + Server added successfully सर्वर सफलतापूर्वक जोड़ा गया + + + %1 installed successfully. + + + + + API config reloaded + + + + + Successfully changed the country of connection to %1 + + InstalledAppsDrawer - + Choose application एप्लिकेशन चुनें - + application name आवेदन का नाम - + Add selected चुने हुए को जोड़ो @@ -358,103 +430,213 @@ Already installed containers were found on the server. All installed containers PageDeinstalling - + Removing services from %1 सर्वर से %1 हटाया गया - + Usually it takes no more than 5 minutes आमतौर पर इसमें 5 मिनट से अधिक समय नहीं लगता है + + PageDevMenu + + + Gateway endpoint + + + + + Dev gateway environment + + + PageHome - + Logging enabled लॉगिंग सक्षम - + Split tunneling enabled स्प्लिट टनलिंग सक्षम - + Split tunneling disabled स्प्लिट टनलिंग अक्षम - + VPN protocol VPN प्रोटोकॉल - + Servers सर्वर - + Unable change server while there is an active connection सक्रिय कनेक्शन होने पर सर्वर बदलने में असमर्थ + + PageProtocolAwgClientSettings + + + AmneziaWG settings + Amneziaडब्ल्यूजी सेटिंग्स + + + + MTU + एमटीयू + + + + Server settings + + + + + Port + + + + + Save + सहेजें + + + + Save settings? + सेटिंग्स सेव करें? + + + + Only the settings for this device will be changed + + + + + Continue + जारी रखना + + + + Cancel + रद्द करना + + + + Unable change settings while there is an active connection + सक्रिय कनेक्शन होने पर सेटिंग बदलने में असमर्थ + + PageProtocolAwgSettings - + AmneziaWG settings Amneziaडब्ल्यूजी सेटिंग्स - + Port पोर्ट - MTU - एमटीयू + एमटीयू - + + Jc - Junk packet count + + + + + Jmin - Junk packet minimum size + + + + + Jmax - Junk packet maximum size + + + + + S1 - Init packet junk size + + + + + S2 - Response packet junk size + + + + + H1 - Init packet magic header + + + + + H2 - Response packet magic header + + + + + H4 - Transport packet magic header + + + + + H3 - Underload packet magic header + + + + Save सहेजें - + The values of the H1-H4 fields must be unique H1-H4 फ़ील्ड का मान अद्वितीय होना चाहिए - + The value of the field S1 + message initiation size (148) must not equal S2 + message response size (92) फ़ील्ड S1 + संदेश आरंभ आकार (148) का मान S2 + संदेश प्रतिक्रिया आकार (92) के बराबर नहीं होना चाहिए - + Save settings? सेटिंग्स सेव करें? - + All users with whom you shared a connection with will no longer be able to connect to it. वे सभी उपयोगकर्ता जिनके साथ आपने कनेक्शन साझा किया था, वे अब इससे कनेक्ट नहीं हो पाएंगे. - + Unable change settings while there is an active connection सक्रिय कनेक्शन होने पर सेटिंग बदलने में असमर्थ - + Continue जारी रखना - + Cancel रद्द करना @@ -462,33 +644,33 @@ Already installed containers were found on the server. All installed containers PageProtocolCloakSettings - + Cloak settings लबादा सेटिंग - + Disguised as traffic from से यातायात के रूप में प्रच्छन्न - + Port पोर्ट - + Cipher साइफर - + Save सहेजें - + Unable change settings while there is an active connection सक्रिय कनेक्शन होने पर सेटिंग बदलने में असमर्थ @@ -496,175 +678,175 @@ Already installed containers were found on the server. All installed containers PageProtocolOpenVpnSettings - + OpenVPN settings OpenVPN सेटिंग्स - + VPN address subnet VPN एड्रेस सबनेट - + Network protocol नेटवर्क प्रोटोकॉल - + Port पोर्ट - + Auto-negotiate encryption स्वतः-निगोशिएट एन्क्रिप्शन - + Hash - + SHA512 - + SHA384 - + SHA256 - + SHA3-512 - + SHA3-384 - + SHA3-256 - + whirlpool - + BLAKE2b512 - + BLAKE2s256 अक्षम - + SHA1 - + Cipher साइफर - + AES-256-GCM - + AES-192-GCM - + AES-128-GCM एईएस-128-जीसीएम - + AES-256-CBC - + AES-192-CBC - + AES-128-CBC एईएस-128-सीबीसी - + ChaCha20-Poly1305 चाचा20-पॉली1305 - + ARIA-256-CBC एआरआईए-256-सीबीसी - + CAMELLIA-256-CBC कैमेलिया-256-सीबीसी - + none कोई नहीं - + TLS auth टीएलएस प्राधिकरण - + Block DNS requests outside of VPN VPN के बाहर डीएनएस अनुरोधों को ब्लॉक करें - + Additional client configuration commands अतिरिक्त क्लाइंट कॉन्फ़िगरेशन आदेश - - + + Commands: आदेश: - + Additional server configuration commands अतिरिक्त सर्वर कॉन्फ़िगरेशन आदेश - + Save सहेजें - + Unable change settings while there is an active connection सक्रिय कनेक्शन होने पर सेटिंग बदलने में असमर्थ @@ -672,42 +854,42 @@ Already installed containers were found on the server. All installed containers PageProtocolRaw - + settings समायोजन - + Show connection options कनेक्शन विकल्प दिखाएँ - + Connection options %1 कनेक्शन विकल्प%1 - + Remove निकालना - + Remove %1 from server? सर्वर से %1 हटाएँ? - + All users with whom you shared a connection with will no longer be able to connect to it. वे सभी उपयोगकर्ता जिनके साथ आपने कनेक्शन साझा किया था, वे अब इससे कनेक्ट नहीं हो पाएंगे. - + Continue जारी रखना - + Cancel रद्द करना @@ -715,56 +897,128 @@ Already installed containers were found on the server. All installed containers PageProtocolShadowSocksSettings - + Shadowsocks settings शैडोसॉक्स सेटिंग्स - + Port पोर्ट - + Cipher साइफर - + Save सहेजें - + Unable change settings while there is an active connection सक्रिय कनेक्शन होने पर सेटिंग बदलने में असमर्थ + + PageProtocolWireGuardClientSettings + + + WG settings + डब्ल्यूजी सेटिंग्स + + + + MTU + एमटीयू + + + + Server settings + + + + + Port + + + + + Save + सहेजें + + + + Save settings? + सेटिंग्स सेव करें? + + + + Only the settings for this device will be changed + + + + + Continue + जारी रखना + + + + Cancel + रद्द करना + + + + Unable change settings while there is an active connection + सक्रिय कनेक्शन होने पर सेटिंग बदलने में असमर्थ + + PageProtocolWireGuardSettings - + WG settings डब्ल्यूजी सेटिंग्स - + Port बंदरगाह - MTU - एमटीयू + एमटीयू - + Save सहेजें - + + Save settings? + सेटिंग्स सेव करें? + + + + All users with whom you shared a connection with will no longer be able to connect to it. + वे सभी उपयोगकर्ता जिनके साथ आपने कनेक्शन साझा किया था, वे अब इससे कनेक्ट नहीं हो पाएंगे. + + + + Continue + जारी रखना + + + + Cancel + रद्द करना + + + Unable change settings while there is an active connection सक्रिय कनेक्शन होने पर सेटिंग बदलने में असमर्थ @@ -772,22 +1026,22 @@ Already installed containers were found on the server. All installed containers PageProtocolXraySettings - + XRay settings एक्सरे सेटिंग्स - + Disguised as traffic from से यातायात के रूप में प्रच्छन्न - + Save सहेजें - + Unable change settings while there is an active connection सक्रिय कनेक्शन होने पर सेटिंग बदलने में असमर्थ @@ -795,39 +1049,39 @@ Already installed containers were found on the server. All installed containers PageServiceDnsSettings - + A DNS service is installed on your server, and it is only accessible via VPN. आपके सर्वर पर एक DNS सेवा स्थापित है, और यह केवल वीपीएन के माध्यम से पहुंच योग्य है. - + The DNS address is the same as the address of your server. You can configure DNS in the settings, under the connections tab. DNS पता आपके सर्वर के पते के समान है। आप कनेक्शन टैब के अंतर्गत सेटिंग्स में DNS को कॉन्फ़िगर कर सकते हैं. - + Remove निकालना - + Remove %1 from server? सर्वर से %1 हटाएँ? - + Continue जारी रखना - + Cancel रद्द करना - + Cannot remove AmneziaDNS from running server चल रहे सर्वर से एम्नेज़िया डीएनएस को नहीं हटाया जा सकता @@ -835,157 +1089,153 @@ Already installed containers were found on the server. All installed containers PageServiceSftpSettings - + Settings updated successfully सेटिंग्स सफलतापूर्वक अपडेट हो गईं - + SFTP settings एसएफटीपी सेटिंग्स - + Host मेज़बान - - - - + + + + Copied कॉपी किया गया - + Port पोर्ट - + User name उपयोगकर्ता नाम - + Password पासवर्ड - + Mount folder on device डिवाइस पर फ़ोल्डर माउंट करें - + In order to mount remote SFTP folder as local drive, perform following steps: <br> दूरस्थ SFTP फ़ोल्डर को स्थानीय ड्राइव के रूप में माउंट करने के लिए, निम्नलिखित चरण निष्पादित करें: <br> - - + + <br>1. Install the latest version of <br>1. का नवीनतम संस्करण स्थापित करें - - + + <br>2. Install the latest version of <br>2. का नवीनतम संस्करण स्थापित करें - + Detailed instructions विस्तृत निर्देश - Remove SFTP and all data stored there - एसएफटीपी और वहां संग्रहीत सभी डेटा हटा दें + एसएफटीपी और वहां संग्रहीत सभी डेटा हटा दें - Remove SFTP and all data stored there? - एसएफटीपी और वहां संग्रहीत सभी डेटा हटाएं? + एसएफटीपी और वहां संग्रहीत सभी डेटा हटाएं? - Continue - जारी रखना + जारी रखना - Cancel - रद्द करना + रद्द करना PageServiceSocksProxySettings - + Settings updated successfully सेटिंग्स सफलतापूर्वक अपडेट हो गईं - - + + SOCKS5 settings - + Host मेज़बान - - - - + + + + Copied कॉपी किया गया - - + + Port - + User name उपयोगकर्ता नाम - - + + Password पासवर्ड - + Username - - + + Change connection settings - + The port must be in the range of 1 to 65535 - + Password cannot be empty - + Username cannot be empty @@ -993,95 +1243,96 @@ Already installed containers were found on the server. All installed containers PageServiceTorWebsiteSettings - + Settings updated successfully सेटिंग्स सफलतापूर्वक अपडेट हो गईं - + Tor website settings टोर वेबसाइट सेटिंग्स - + Website address वेबसाइट का पता - + Copied कॉपी किया गया - + Use <a href="https://www.torproject.org/download/" style="color: #FBB26A;">Tor Browser</a> to open this URL. इस यूआरएल को खोलने के लिए <a href='https://www.torproject.org/download/' style='color: #FBB26A;'>Tor ब्राउज़र</a> का उपयोग करें। - + After creating your onion site, it takes a few minutes for the Tor network to make it available for use. आपकी onionसाइट बनाने के बाद, टोर नेटवर्क को इसे उपयोग के लिए उपलब्ध कराने में कुछ मिनट लगते हैं. - + When configuring WordPress set the this onion address as domain. वर्डप्रेस को कॉन्फ़िगर करते समय इस प्याज पते को डोमेन के रूप में सेट करें. - Remove website - वेबसाइट हटाएँ + वेबसाइट हटाएँ - The site with all data will be removed from the tor network. - सभी डेटा वाली साइट को टोर नेटवर्क से हटा दिया जाएगा. + सभी डेटा वाली साइट को टोर नेटवर्क से हटा दिया जाएगा. - Continue - जारी रखना + जारी रखना - Cancel - रद्द करना + रद्द करना PageSettings - + Settings समायोजन - + Servers सर्वर - + Connection कनेक्शन - + Application एप्लिकेशन - + Backup बैकअप - + About AmneziaVPN AmneziaVPN के बारे में + Dev console + + + + Close application एप्लिकेशन बंद करो @@ -1089,85 +1340,164 @@ Already installed containers were found on the server. All installed containers PageSettingsAbout - + Support Amnezia Amnezia का समर्थन करें - + Amnezia is a free and open-source application. You can support the developers if you like it. एमनेज़िया एक निःशुल्क और ओपन-सोर्स एप्लिकेशन है। यदि आपको यह पसंद है तो आप डेवलपर्स का समर्थन कर सकते हैं।. - + Contacts संपर्क - + Telegram group टेलीग्राम समूह - + To discuss features सुविधाओं पर चर्चा करना - + https://t.me/amnezia_vpn_en - Mail - मेल + मेल + support@amnezia.org + + + + For reviews and bug reports समीक्षाओं और बग रिपोर्टों के लिए - + + Copied + कॉपी किया गया + + + GitHub GitHub - + https://github.com/amnezia-vpn/amnezia-client https://github.com/amnezia-vpn/amnezia-client - + Website वेबसाइट - - https://amnezia.org - - - - + Software version: %1 सॉफ़्टवेयर संस्करण: %1 - + Check for updates अद्यतन के लिए जाँच - + Privacy Policy गोपनीयता नीति + + PageSettingsApiServerInfo + + + For the region + + + + + Price + + + + + Work period + + + + + Speed + + + + + Support tag + + + + + Copied + कॉपी किया गया + + + + Reload API config + + + + + Reload API config? + + + + + + Continue + जारी रखना + + + + + Cancel + रद्द करना + + + + Cannot reload API config during active connection + + + + + Remove from application + + + + + Remove from application? + + + + + Cannot remove server during active connection + सक्रिय कनेक्शन के दौरान सर्वर को हटाया नहीं जा सकता + + PageSettingsAppSplitTunneling - + Cannot change split tunneling settings during active connection सक्रिय कनेक्शन के दौरान स्प्लिट टनलिंग सेटिंग्स को नहीं बदला जा सकता @@ -1180,52 +1510,52 @@ Already installed containers were found on the server. All installed containers सूची के ऐप्स को वीपीएन के माध्यम से एक्सेस नहीं किया जाना चाहिए - + Only the apps from the list should have access via VPN - + Apps from the list should not have access via VPN - + App split tunneling ऐप स्प्लिट टनलिंग - + Mode तरीका - + Remove निकालना - + Continue जारी रखना - + Cancel रद्द करना - + application name आवेदन का नाम - + Open executable file निष्पादन योग्य फ़ाइल खोलें - + Executable files (*.*) निष्पादनीय फाइल (*.*) @@ -1233,102 +1563,102 @@ Already installed containers were found on the server. All installed containers PageSettingsApplication - + Application एप्लिकेशन - + Allow application screenshots एप्लिकेशन स्क्रीनशॉट की अनुमति दें - + Enable notifications - + Enable notifications to show the VPN state in the status bar - + Auto start ऑटो स्टार्ट - + Launch the application every time the device is starts हर बार डिवाइस चालू होने पर एप्लिकेशन लॉन्च करें - + Auto connect ऑटो कनेक्ट - + Connect to VPN on app start ऐप शुरू होने पर वीपीएन से कनेक्ट करें - + Start minimized स्टार्ट को मिनिमाइज किया गया - + Launch application minimized लॉन्च एप्लिकेशन को न्यूनतम किया गया - + Language भाषा - + Logging लॉगिंग - + Enabled सक्रिय किया - + Disabled अक्षम - + Reset settings and remove all data from the application सेटिंग्स रीसेट करें और एप्लिकेशन से सभी डेटा हटा दें - + Reset settings and remove all data from the application? सेटिंग्स रीसेट करें और एप्लिकेशन से सभी डेटा हटा दें? - + All settings will be reset to default. All installed AmneziaVPN services will still remain on the server. सभी सेटिंग्स डिफ़ॉल्ट पर रीसेट हो जाएंगी. सभी स्थापित AmneziaVPN सेवाएँ अभी भी सर्वर पर रहेंगी।. - + Continue जारी रखना - + Cancel रद्द करना - + Cannot reset settings during active connection सक्रिय कनेक्शन के दौरान सेटिंग्स रीसेट नहीं की जा सकतीं @@ -1336,7 +1666,7 @@ Already installed containers were found on the server. All installed containers PageSettingsBackup - + Settings restored from backup file बैकअप फ़ाइल से सेटिंग्स पुनर्स्थापित की गईं @@ -1415,62 +1745,62 @@ Already installed containers were found on the server. All installed containers PageSettingsConnection - + Connection कनेक्शन - + When AmneziaDNS is not used or installed जब AmneziaDNS का उपयोग या स्थापित नहीं किया जाता है - + Allows you to use the VPN only for certain Apps आपको केवल कुछ ऐप्स के लिए वीपीएन का उपयोग करने की अनुमति देता है - + Use AmneziaDNS Amneziaडीएनएस का प्रयोग करें - + If AmneziaDNS is installed on the server यदि AmneziaDNS सर्वर पर स्थापित है - + DNS servers DNS सर्वर - + Site-based split tunneling साइट-आधारित विभाजित टनलिंग - + Allows you to select which sites you want to access through the VPN आपको यह चुनने की अनुमति देता है कि आप वीपीएन के माध्यम से किन साइटों तक पहुंचना चाहते हैं - + App-based split tunneling ऐप-आधारित स्प्लिट टनलिंग - + KillSwitch स्विच बन्द कर दो - + Disables your internet if your encrypted VPN connection drops out for any reason. यदि आपका एन्क्रिप्टेड वीपीएन कनेक्शन किसी भी कारण से बंद हो जाता है तो आपका इंटरनेट अक्षम कर देता है. - + Cannot change killSwitch settings during active connection सक्रिय कनेक्शन के दौरान किलस्विच सेटिंग्स को नहीं बदला जा सकता @@ -1478,62 +1808,62 @@ Already installed containers were found on the server. All installed containers PageSettingsDns - + Default server does not support custom DNS डिफ़ॉल्ट सर्वर कस्टम डीएनएस का समर्थन नहीं करता है - + DNS servers DNS सर्वर - + If AmneziaDNS is not used or installed यदि AmneziaDNS का उपयोग या स्थापित नहीं किया गया है - + Primary DNS प्राथमिक डीएनएस - + Secondary DNS द्वितीयक डीएनएस - + Restore default डिफ़ॉल्ट बहाल - + Restore default DNS settings? डिफ़ॉल्ट DNS सेटिंग्स पुनर्स्थापित करें? - + Continue जारी रखना - + Cancel रद्द करना - + Settings have been reset सेटिंग्स रीसेट कर दी गई हैं - + Save सहेजें - + Settings saved सेटिंग्स को सहेजा गया @@ -1541,72 +1871,108 @@ Already installed containers were found on the server. All installed containers PageSettingsLogging - Logging is enabled. Note that logs will be automatically disabled after 14 days, and all log files will be deleted. - लॉगिंग सक्षम है. ध्यान दें कि 14 दिनों के बाद लॉग स्वचालित रूप से अक्षम हो जाएंगे, और सभी लॉग फ़ाइलें हटा दी जाएंगी. + लॉगिंग सक्षम है. ध्यान दें कि 14 दिनों के बाद लॉग स्वचालित रूप से अक्षम हो जाएंगे, और सभी लॉग फ़ाइलें हटा दी जाएंगी. - + Logging लॉगिंग - + Enabling this function will save application's logs automatically. By default, logging functionality is disabled. Enable log saving in case of application malfunction. इस फ़ंक्शन को सक्षम करने से एप्लिकेशन के लॉग स्वचालित रूप से सहेजे जाएंगे, डिफ़ॉल्ट रूप से, लॉगिंग कार्यक्षमता अक्षम है। एप्लिकेशन की खराबी की स्थिति में लॉग सेविंग सक्षम करें. - Save logs - लॉग सहेजें + लॉग सहेजें - Open folder with logs - लॉग के साथ फ़ोल्डर खोलें + लॉग के साथ फ़ोल्डर खोलें - + + Save सहेजें - + + Logs files (*.log) लॉग फ़ाइलें (*.log) - + + Logs file saved लॉग फ़ाइल सहेजी गई - Save logs to file - फ़ाइल में लॉग सहेजें + फ़ाइल में लॉग सहेजें - + + Enable logs + + + + Clear logs? लॉग साफ़ करें? - + Continue जारी रखना - + Cancel रद्द करना - + Logs have been cleaned up लॉग साफ़ कर दिए गए हैं - + + Client logs + + + + + AmneziaVPN logs + + + + + + Open logs folder + + + + + + Export logs + + + + + Service logs + + + + + AmneziaVPN-service logs + + + + Clear logs लॉग साफ़ करें @@ -1614,22 +1980,22 @@ Already installed containers were found on the server. All installed containers PageSettingsServerData - + All installed containers have been added to the application सभी स्थापित कंटेनरों को एप्लिकेशन में जोड़ दिया गया है - + No new installed containers found कोई नया स्थापित कंटेनर नहीं मिला - + Do you want to reboot the server? क्या आप सर्वर को रीबूट करना चाहते हैं? - + Do you want to clear server from Amnezia software? क्या आप एमनेज़िया सॉफ़्टवेयर से सर्वर साफ़ करना चाहते हैं? @@ -1638,94 +2004,94 @@ Already installed containers were found on the server. All installed containers - - - - - - Continue - जारी रखना - + Continue + जारी रखना + + + + + + Cancel रद्द करना - + Check the server for previously installed Amnezia services पहले से स्थापित एमनेज़िया सेवाओं के लिए सर्वर की जाँच करें - + Add them to the application if they were not displayed यदि वे प्रदर्शित नहीं थे तो उन्हें एप्लिकेशन में जोड़ें - + Reboot server सर्वर रीबूट करें - + The reboot process may take approximately 30 seconds. Are you sure you wish to proceed? रीबूट प्रक्रिया में लगभग 30 सेकंड लग सकते हैं। आप निश्चित है आप आगे बढ़ना चाहते है? - + Cannot reboot server during active connection सक्रिय कनेक्शन के दौरान सर्वर को रीबूट नहीं किया जा सकता - + Remove server from application एप्लिकेशन से सर्वर हटाएं - + Do you want to remove the server from application? क्या आप एप्लिकेशन से सर्वर हटाना चाहते हैं? - + Cannot remove server during active connection सक्रिय कनेक्शन के दौरान सर्वर को हटाया नहीं जा सकता - + All users whom you shared a connection with will no longer be able to connect to it. वे सभी उपयोगकर्ता जिनके साथ आपने कनेक्शन साझा किया था, वे अब इससे कनेक्ट नहीं हो पाएंगे. - + Cannot clear server from Amnezia software during active connection सक्रिय कनेक्शन के दौरान एमनेज़िया सॉफ़्टवेयर से सर्वर साफ़ नहीं किया जा सकता - + Reset API config एपीआई कॉन्फिगरेशन रीसेट करें - + Do you want to reset API config? क्या आप एपीआई कॉन्फिगरेशन रीसेट करना चाहते हैं? - + Cannot reset API config during active connection सक्रिय कनेक्शन के दौरान एपीआई कॉन्फिगरेशन को रीसेट नहीं किया जा सकता - + All installed AmneziaVPN services will still remain on the server. सभी स्थापित AmneziaVPN सेवाएँ अभी भी सर्वर पर रहेंगी. - + Clear server from Amnezia software एमनेज़िया सॉफ़्टवेयर से सर्वर साफ़ करें @@ -1733,27 +2099,27 @@ Already installed containers were found on the server. All installed containers PageSettingsServerInfo - + Server name सर्वर का नाम - + Save सहेजें - + Protocols प्रोटोकॉल - + Services सेवाएं - + Management प्रबंध @@ -1761,17 +2127,16 @@ Already installed containers were found on the server. All installed containers PageSettingsServerProtocol - + settings समायोजन - Clear %1 profile - %1 प्रोफ़ाइल साफ़ करें + %1 प्रोफ़ाइल साफ़ करें - + Clear %1 profile? %1 प्रोफ़ाइल साफ़ करें? @@ -1781,39 +2146,64 @@ Already installed containers were found on the server. All installed containers - + Unable to clear %1 profile while there is an active connection सक्रिय कनेक्शन होने पर %1 प्रोफ़ाइल साफ़ करने में असमर्थ - + Remove निकालना - + All users with whom you shared a connection will no longer be able to connect to it. वे सभी उपयोगकर्ता जिनके साथ आपने कनेक्शन साझा किया था, वे अब इससे कनेक्ट नहीं हो पाएंगे. - + Cannot remove active container सक्रिय कंटेनर को हटाया नहीं जा सकता - + Remove %1 from server? सर्वर से %1 हटाएँ? - - + + connection settings + + + + + Click the "connect" button to create a connection configuration + + + + + server settings + + + + + Clear profile + + + + + The connection configuration will be deleted for this device only + + + + + Continue जारी रखना - - + + Cancel रद्द करना @@ -1821,7 +2211,7 @@ Already installed containers were found on the server. All installed containers PageSettingsServersList - + Servers सर्वर @@ -1829,201 +2219,332 @@ Already installed containers were found on the server. All installed containers PageSettingsSplitTunneling - + Default server does not support split tunneling function डिफ़ॉल्ट सर्वर स्प्लिट टनलिंग फ़ंक्शन का समर्थन नहीं करता है - + Addresses from the list should not be accessed via VPN सूची के पतों को वीपीएन के माध्यम से एक्सेस नहीं किया जाना चाहिए - + Split tunneling विभाजित सुरंग - + Mode तरीका - + Remove निकालना - + Continue जारी रखना - + Cancel रद्द करना - + Only the sites listed here will be accessed through the VPN केवल यहां सूचीबद्ध साइटों को ही वीपीएन के माध्यम से एक्सेस किया जाएगा - + Cannot change split tunneling settings during active connection सक्रिय कनेक्शन के दौरान स्प्लिट टनलिंग सेटिंग्स को नहीं बदला जा सकता - + website or IP वेबसाइट या आईपी - + Import / Export Sites आयात/निर्यात साइटें - + Import आयात - + Save site list साइट सूची सहेजें - + Save sites साइटें सहेजें - - - + + + Sites files (*.json) - + Import a list of sites साइटों की सूची आयात करें - + Replace site list साइट सूची बदलें - - + + Open sites file साइट फ़ाइल खोलें - + Add imported sites to existing ones आयातित साइटों को मौजूदा साइटों में जोड़ें + + PageSetupWizardApiServiceInfo + + + For the region + + + + + Price + + + + + Work period + + + + + Speed + + + + + Features + + + + + Connect + कनेक्ट + + + + PageSetupWizardApiServicesList + + + VPN by Amnezia + + + + + Choose a VPN service that suits your needs. + + + PageSetupWizardConfigSource - Server connection - सर्वर कनेक्शन + सर्वर कनेक्शन - Do not use connection codes from untrusted sources, as they may be created to intercept your data. - अविश्वसनीय स्रोतों से कनेक्शन कोड का उपयोग न करें, क्योंकि वे आपके डेटा को बाधित करने के लिए बनाए जा सकते हैं. + अविश्वसनीय स्रोतों से कनेक्शन कोड का उपयोग न करें, क्योंकि वे आपके डेटा को बाधित करने के लिए बनाए जा सकते हैं. - What do you have? - तुम्हारे पास क्या है? + तुम्हारे पास क्या है? - File with connection settings or backup - कनेक्शन सेटिंग्स वाली फ़ाइल + कनेक्शन सेटिंग्स वाली फ़ाइल - + + Connection + कनेक्शन + + + + Settings + समायोजन + + + + Enable logs + + + + + Insert the key, add a configuration file or scan the QR-code + + + + + Insert key + + + + + Insert + डालना + + + + Continue + जारी रखना + + + + Other connection options + + + + + VPN by Amnezia + + + + + Connect to classic paid and free VPN services from Amnezia + + + + + Self-hosted VPN + + + + + Configure Amnezia VPN on your own server + + + + + Restore from backup + बैकअप से बहाल करना + + + + Open backup file + बैकअप फ़ाइल खोलें + + + + Backup files (*.backup) + बैकअप फ़ाइलें (*.backup) + + + File with connection settings कनेक्शन सेटिंग्स वाली फ़ाइल - + Open config file कॉन्फ़िग फ़ाइल खोलें - + QR code क्यू आर संहिता - + + I have nothing + मेरे पास कुछ नहीं है + + Key as text - पाठ के रूप में कुंजी + पाठ के रूप में कुंजी PageSetupWizardCredentials - + Configure your server अपना सर्वर कॉन्फ़िगर करें - + Server IP address [:port] सर्वर आईपी पता [:पोर्ट] - + Continue जारी रखना - + All data you enter will remain strictly confidential and will not be shared or disclosed to the Amnezia or any third parties आपके द्वारा दर्ज किया गया सभी डेटा पूरी तरह से गोपनीय रहेगा और एमनेज़िया या किसी तीसरे पक्ष को साझा या प्रकट नहीं किया जाएगा - + 255.255.255.255:22 255.255.255.255:22 - + SSH Username SSH उपयोगकर्ता नाम - + Password or SSH private key पासवर्ड या SSH निजी कुंजी - + + How to run your VPN server + + + + + Where to get connection data, step-by-step instructions for buying a VPS + + + + Ip address cannot be empty आईपी ​​पता खाली नहीं हो सकता - + Enter the address in the format 255.255.255.255:88 पता 255.255.255.255:88 प्रारूप में दर्ज करें - + Login cannot be empty लॉगिन खाली नहीं हो सकता - + Password/private key cannot be empty पासवर्ड/निजी कुंजी खाली नहीं हो सकती @@ -2031,22 +2552,22 @@ Already installed containers were found on the server. All installed containers PageSetupWizardEasy - + What is the level of internet control in your region? आपके क्षेत्र में इंटरनेट नियंत्रण का स्तर क्या है? - + Choose a VPN protocol एक वीपीएन प्रोटोकॉल चुनें - + Continue जारी रखना - + Skip setup सेटअप छोड़ें @@ -2054,38 +2575,38 @@ Already installed containers were found on the server. All installed containers PageSetupWizardInstalling - - + + Usually it takes no more than 5 minutes आमतौर पर इसमें 5 मिनट से अधिक समय नहीं लगता है - + The server has already been added to the application सर्वर को पहले ही एप्लिकेशन में जोड़ा जा चुका है - + Amnezia has detected that your server is currently Amnezia ने पता लगाया है कि आपका सर्वर वर्तमान में है - + busy installing other software. Amnezia installation अन्य सॉफ़्टवेयर स्थापित करने में व्यस्त। भूलने की बीमारी की स्थापना - + Cancel installation स्थापना रद्द करें - + will pause until the server finishes installing other software जब तक सर्वर अन्य सॉफ़्टवेयर इंस्टॉल करना समाप्त नहीं कर लेता तब तक रुकेगा - + Installing स्थापित कर रहा है @@ -2093,37 +2614,37 @@ Already installed containers were found on the server. All installed containers PageSetupWizardProtocolSettings - + Installing %1 %1 स्थापित किया जा रहा है - + More detailed अधिक विवरण - + Close बंद करना - + Network protocol नेटवर्क प्रोटोकॉल - + Port منفذ - + Install स्थापित करना - + The port must be in the range of 1 to 65535 @@ -2131,12 +2652,12 @@ Already installed containers were found on the server. All installed containers PageSetupWizardProtocols - + VPN protocol VPN प्रोटोकॉल - + Choose the one with the highest priority for you. Later, you can install other protocols and additional services, such as DNS proxy and SFTP. वह चुनें जो आपके लिए सर्वोच्च प्राथमिकता हो। बाद में, आप अन्य प्रोटोकॉल और अतिरिक्त सेवाएँ, जैसे DNS प्रॉक्सी और SFTP स्थापित कर सकते हैं. @@ -2144,7 +2665,7 @@ Already installed containers were found on the server. All installed containers PageSetupWizardQrReader - + Point the camera at the QR code and hold for a couple of seconds. कैमरे को QR कोड पर रखें और कुछ सेकंड के लिए रोककर रखें. @@ -2152,60 +2673,55 @@ Already installed containers were found on the server. All installed containers PageSetupWizardStart - Settings restored from backup file - बैकअप फ़ाइल से सेटिंग्स पुनर्स्थापित की गईं + बैकअप फ़ाइल से सेटिंग्स पुनर्स्थापित की गईं - Free service for creating a personal VPN on your server. - आपके सर्वर पर व्यक्तिगत वीपीएन बनाने के लिए निःशुल्क सेवा. + आपके सर्वर पर व्यक्तिगत वीपीएन बनाने के लिए निःशुल्क सेवा. - Helps you access blocked content without revealing your privacy, even to VPN providers. - आपकी गोपनीयता को उजागर किए बिना, यहां तक ​​कि वीपीएन प्रदाताओं को भी, अवरुद्ध सामग्री तक पहुंचने में आपकी सहायता करता है. + आपकी गोपनीयता को उजागर किए बिना, यहां तक ​​कि वीपीएन प्रदाताओं को भी, अवरुद्ध सामग्री तक पहुंचने में आपकी सहायता करता है. - I have the data to connect - मेरे पास कनेक्ट करने के लिए डेटा है + मेरे पास कनेक्ट करने के लिए डेटा है - I have nothing - मेरे पास कुछ नहीं है + मेरे पास कुछ नहीं है - - https://amnezia.org/instructions/0_starter-guide - + + Let's get started + PageSetupWizardTextKey - + Connection key कनेक्शन कुंजी - + A line that starts with vpn://... एक लाइन जो vpn://... से शुरू होती है... - + Key चाबी - + Insert डालना - + Continue जारी रखना @@ -2213,32 +2729,32 @@ Already installed containers were found on the server. All installed containers PageSetupWizardViewConfig - + New connection नया कनेक्शन - + Collapse content सामग्री संक्षिप्त करें - + Show content सामग्री दिखाओ - + Enable WireGuard obfuscation. It may be useful if WireGuard is blocked on your provider. वायरगार्ड अस्पष्टीकरण सक्षम करें. यदि आपके प्रदाता पर वायरगार्ड अवरुद्ध है तो यह उपयोगी हो सकता है. - + Use connection codes only from sources you trust. Codes from public sources may have been created to intercept your data. केवल उन स्रोतों से कनेक्शन कोड का उपयोग करें जिन पर आपको भरोसा है। हो सकता है कि आपके डेटा को इंटरसेप्ट करने के लिए सार्वजनिक स्रोतों से कोड बनाए गए हों. - + Connect कनेक्ट @@ -2246,37 +2762,37 @@ Already installed containers were found on the server. All installed containers PageShare - + Save OpenVPN config OpenVPN कॉन्फ़िगरेशन सहेजें - + Save WireGuard config वायरगार्ड कॉन्फ़िगरेशन सहेजें - + Save AmneziaWG config AmneziaWG कॉन्फ़िगरेशन सहेजें - + Save Shadowsocks config शैडोसॉक्स कॉन्फ़िगरेशन सहेजें - + Save Cloak config क्लोक कॉन्फ़िगरेशन सहेजें - + Save XRay config एक्सरे कॉन्फिगरेशन सहेजें - + For the AmneziaVPN app AmneziaVPN ऐप के लिए @@ -2285,78 +2801,78 @@ Already installed containers were found on the server. All installed containers OpenVpn मूल स्वरूप - + WireGuard native format वायरगार्ड मूल प्रारूप - + AmneziaWG native format AmneziaWG मूल प्रारूप - + Shadowsocks native format शैडोसॉक्स मूल प्रारूप - + Cloak native format लबादा देशी स्वरूप - + XRay native format एक्सरे देशी प्रारूप - + Share VPN Access VPN एक्सेस साझा करें - + Share full access to the server and VPN सर्वर और वीपीएन तक पूर्ण पहुंच साझा करें - + Use for your own devices, or share with those you trust to manage the server. अपने स्वयं के उपकरणों के लिए उपयोग करें, या सर्वर को प्रबंधित करने के लिए उन लोगों के साथ साझा करें जिन पर आप भरोसा करते हैं. - - + + Users उपयोगकर्ताओं - + Share VPN access without the ability to manage the server सर्वर को प्रबंधित करने की क्षमता के बिना वीपीएन एक्सेस साझा करें - + Search खोज - + Creation date: %1 निर्माण दिनांक: %1 - + Latest handshake: %1 नवीनतम हाथ मिलाना: %1 - + Data received: %1 प्राप्त डेटा: %1 - + Data sent: %1 डेटा भेजा गया: %1 @@ -2365,96 +2881,96 @@ Already installed containers were found on the server. All installed containers निर्माण तिथि: - + Rename नाम बदलें - + Client name ग्राहक नाम - + Save सहेजें - + Revoke निरस्त करें - + Revoke the config for a user - %1? किसी उपयोक्ता के लिए कॉन्फ़िगरेशन निरस्त करें - %1? - + The user will no longer be able to connect to your server. उपयोगकर्ता अब आपके सर्वर से कनेक्ट नहीं हो पाएगा. - + Continue जारी रखना - + Cancel रद्द करना - + Connection कनेक्शन - - + + Server सर्वर - + File with connection settings to कनेक्शन सेटिंग्स वाली फ़ाइल - - + + Protocol शिष्टाचार - + Connection to कनेक्शन के लिए - + Config revoked कॉन्फ़िगरेशन निरस्त कर दिया गया - + OpenVPN native format - + User name उपयोगकर्ता नाम - - + + Connection format कनेक्शन प्रारूप - - + + Share शेयर करना @@ -2462,50 +2978,55 @@ Already installed containers were found on the server. All installed containers PageShareFullAccess - + Full access to the server and VPN सर्वर और वीपीएन तक पूर्ण पहुंच - + We recommend that you use full access to the server only for your own additional devices. हम अनुशंसा करते हैं कि आप सर्वर तक पूर्ण पहुंच का उपयोग केवल अपने अतिरिक्त उपकरणों के लिए करें. - + If you share full access with other people, they can remove and add protocols and services to the server, which will cause the VPN to work incorrectly for all users. यदि आप अन्य लोगों के साथ पूर्ण पहुंच साझा करते हैं, तो वे सर्वर पर प्रोटोकॉल और सेवाओं को हटा और जोड़ सकते हैं, जिससे वीपीएन सभी उपयोगकर्ताओं के लिए गलत तरीके से काम करेगा. - + Server सर्वर - + Accessing एक्सेस करना - + File with accessing settings to एक्सेस सेटिंग्स वाली फ़ाइल - + Share शेयर करना - + + Access error! + प्रवेश त्रुटि! + + + Connection to के लिए कनेक्शन - + File with connection settings to कनेक्शन सेटिंग्स वाली फ़ाइल @@ -2513,15 +3034,25 @@ Already installed containers were found on the server. All installed containers PageStart - + Logging was disabled after 14 days, log files were deleted 14 दिनों के बाद लॉगिंग अक्षम कर दी गई, लॉग फ़ाइलें हटा दी गईं + + + Settings restored from backup file + बैकअप फ़ाइल से सेटिंग्स पुनर्स्थापित की गईं + + + + Logging is enabled. Note that logs will be automaticallydisabled after 14 days, and all log files will be deleted. + + PopupType - + Close बंद करना @@ -2555,12 +3086,12 @@ Already installed containers were found on the server. All installed containers पासवर्ड नहीं मिला - + Could not open keystore कीस्टोर नहीं खुल सका - + Could not remove private key from keystore कीस्टोर से निजी कुंजी नहीं हटाई जा सकी @@ -2736,27 +3267,27 @@ Already installed containers were found on the server. All installed containers कीस्टोर नहीं खुल सका - + Could not create private key generator निजी कुंजी जेनरेटर नहीं बनाया जा सका - + Could not generate new private key नई निजी कुंजी उत्पन्न नहीं हो सकी - + Could not retrieve private key from keystore कीस्टोर से निजी कुंजी पुनर्प्राप्त नहीं की जा सकी - + Could not create encryption cipher एन्क्रिप्शन सिफर नहीं बनाया जा सका - + Could not encrypt data डेटा एन्क्रिप्ट नहीं किया जा सका @@ -2892,7 +3423,12 @@ Already installed containers were found on the server. All installed containers - + + Missing AGW public key + + + + ErrorCode: %1. ErrorCode: %1. @@ -2957,37 +3493,37 @@ Already installed containers were found on the server. All installed containers कॉन्फ़िगरेशन में सर्वर से कनेक्ट करने के लिए कोई कंटेनर और क्रेडेंशियल नहीं है - + QFile error: The file could not be opened Qफ़ाइल त्रुटि: फ़ाइल खोली नहीं जा सकी - + QFile error: An error occurred when reading from the file Qफ़ाइल त्रुटि: फ़ाइल से पढ़ते समय एक त्रुटि उत्पन्न हुई - + QFile error: The file could not be accessed Qफ़ाइल त्रुटि: फ़ाइल तक नहीं पहुंचा जा सका - + QFile error: An unspecified error occurred Qफ़ाइल त्रुटि: एक अनिर्दिष्ट त्रुटि उत्पन्न हुई - + QFile error: A fatal error occurred Qफ़ाइल त्रुटि: एक घातक त्रुटि उत्पन्न हुई - + QFile error: The operation was aborted Qफ़ाइल त्रुटि: ऑपरेशन निरस्त कर दिया गया था - + Internal error आंतरिक त्रुटि @@ -3427,7 +3963,7 @@ While it offers a blend of security, stability, and speed, it's essential t SelectLanguageDrawer - + Choose language भाषा चुनें @@ -3435,13 +3971,13 @@ While it offers a blend of security, stability, and speed, it's essential t Settings - + Server #1 सर्वर #1 - - + + Server सर्वर @@ -3449,12 +3985,12 @@ While it offers a blend of security, stability, and speed, it's essential t SettingsController - + Backup file is corrupted बैकअप फ़ाइल दूषित है - + All settings have been reset to default values सभी सेटिंग्स को डिफ़ॉल्ट मानों पर रीसेट कर दिया गया है @@ -3462,39 +3998,39 @@ While it offers a blend of security, stability, and speed, it's essential t ShareConnectionDrawer - - + + Save AmneziaVPN config AmneziaVPN कॉन्फ़िगरेशन सहेजें - + Share शेयर करना - + Copy कॉपी - - + + Copied कॉपी किया गया - + Copy config string कॉन्फिग स्ट्रिंग कॉपी करें - + Show connection settings कनेक्शन सेटिंग दिखाएं - + To read the QR code in the Amnezia app, select "Add server" → "I have data to connect" → "QR code, key or settings file" एमनेज़िया ऐप में क्यूआर कोड पढ़ने के लिए, "सर्वर जोड़ें" → "मेरे पास कनेक्ट करने के लिए डेटा है" → "क्यूआर कोड, कुंजी या सेटिंग्स फ़ाइल" चुनें। @@ -3578,7 +4114,7 @@ While it offers a blend of security, stability, and speed, it's essential t TextFieldWithHeaderType - + The field can't be empty फ़ील्ड खाली नहीं हो सकती @@ -3586,7 +4122,7 @@ While it offers a blend of security, stability, and speed, it's essential t VpnConnection - + Mbps @@ -3637,7 +4173,7 @@ While it offers a blend of security, stability, and speed, it's essential t amnezia::ContainerProps - + Low कम @@ -3650,17 +4186,17 @@ While it offers a blend of security, stability, and speed, it's essential t चरम - + High - + I just want to increase the level of my privacy. मैं बस अपनी गोपनीयता का स्तर बढ़ाना चाहता हूं. - + I want to bypass censorship. This option recommended in most cases. मैं सेंसरशिप को दरकिनार करना चाहता हूं। अधिकांश मामलों में इस विकल्प की अनुशंसा की जाती है. @@ -3672,12 +4208,12 @@ While it offers a blend of security, stability, and speed, it's essential t main2 - + Private key passphrase निजी कुंजी पासफ़्रेज़ - + Save सहेजें diff --git a/client/translations/amneziavpn_my_MM.ts b/client/translations/amneziavpn_my_MM.ts index 2e4cd920..3e964cc9 100644 --- a/client/translations/amneziavpn_my_MM.ts +++ b/client/translations/amneziavpn_my_MM.ts @@ -1,96 +1,149 @@ + + ApiServicesModel + + + Classic VPN for comfortable work, downloading large files and watching videos. Works for any sites. Speed up to %1 MBit/s + သက်တောင့်သက်သာအလုပ်လုပ်နိုင်ဖို့အတွက်နှင့် ကြီးမားသောဖိုင်များကိုဒေါင်းလုဒ်လုပ်ခြင်းနှင့် ဗီဒီယိုများကြည့်ရှုခြင်းတို့အတွက် အသုံးပြုနိုင်သော VPN ဖြစ်ပါတယ်။ မည်သည့်ဆိုက်များအတွက်မဆိုအလုပ်လုပ်ပြီး လိုင်းအရှိန် %1 MBit/s အထိအသုံးပြုနိုင်ပါတယ်။ + + + + VPN to access blocked sites in regions with high levels of Internet censorship. + အင်တာနက် ဆင်ဆာဖြတ်တောက်မှု မြင့်မားသော ဒေသများရှိ ပိတ်ဆို့ထားသော ဆိုက်များကို ဝင်ရောက်ရန် VPN။. + + + + <p><a style="color: #EB5757;">Not available in your region. If you have VPN enabled, disable it, return to the previous screen, and try again.</a> + + + + + Amnezia Premium - A classic VPN for comfortable work, downloading large files, and watching videos in high resolution. It works for all websites, even in countries with the highest level of internet censorship. + Amnezia Premium - သက်တောင့်သက်သာအလုပ်လုပ်နိုင်ဖို့အတွက်နှင့် ကြီးမားသောဖိုင်များကိုဒေါင်းလုဒ်လုပ်ခြင်းနှင့် ဗီဒီယိုများကိုကြည်လင်ပြတ်သားစွာကြည့်ရှုခြင်းတို့အတွက် အသုံးပြုနိုင်သော VPN ဖြစ်ပါတယ်။ အင်တာနက်ဆင်ဆာဖြတ်မှု အဆင့်အမြင့်ဆုံးနိုင်ငံများတွင်ပင် မည်သည့်ဆိုက်များအတွက်မဆို အလုပ်လုပ်ပါသည်။. + + + + Amnezia Free is a free VPN to bypass blocking in countries with high levels of internet censorship + Amnezia Free သည် အင်တာနက်ဆင်ဆာဖြတ်တောက်မှု မြင့်မားသောနိုင်ငံများတွင် ပိတ်ဆို့ခြင်းကို ကျော်ဖြတ်ရန်အတွက် အခမဲ့ VPN တစ်ခုဖြစ်ပါသည်။ + + + + %1 MBit/s + %1 MBit/s + + + + %1 days + %1 ရက် + + + + VPN will open only popular sites blocked in your region, such as Instagram, Facebook, Twitter and others. Other sites will be opened from your real IP address, <a href="%1/free" style="color: #FBB26A;">more details on the website.</a> + ဤ VPN သည် သင့်ဒေသရှိ Instagram၊ Facebook၊ Twitter နှင့် အခြားသော လူကြိုက်များသော ဆိုက်များကိုသာ ဖွင့်ပေးပါမည်။ အခြားဝဘ်ဆိုက်များကိုမူ သင်၏ IP လိပ်စာအစစ်အမှန်ဖြင့်သာ ဖွင့်ပေးပါမည်၊ <a href="%1/free" style="color: #FBB26A;">နောက်ထပ်အသေးစိတ်အချက်အလက်များကို ဝဘ်ဆိုဒ်ပေါ်တွင်ကြည့်ရန်</a> + + + + Free + အခမဲ့ + + + + %1 $/month + %1 $/တစ်လ + + AppSplitTunnelingController Application added: %1 - + အပလီကေးရှင်းထည့်ပြီးပါပြီ: %1 The application has already been added - + အပလီကေးရှင်းကို ထည့်သွင်းသားဖြစ်သည် The selected applications have been added - + ရွေးချယ်ထားသောအပလီကေးရှင်းများကို ထည့်သွင်းပြီးပါပြီ Application removed: %1 - + အပလီကေးရှင်းကို ဖယ်ရှားလိုက်သည်: %1 ConnectButton - + Unable to disconnect during configuration preparation - + Configuration ပြင်ဆင်ခြင်းလုပ်ဆောင်နေချိန်အတွင်း ချိတ်ဆက်မှုဖြတ်တောက်၍မရပါ ConnectionController - + VPN Protocols is not installed. Please install VPN container at first VPN ပရိုတိုကောများကို မထည့်သွင်းရသေးပါ။ ကျေးဇူးပြု၍ VPN ကွန်တိန်နာကို အရင်ထည့်သွင်းပါ။ - + Connecting... ချိတ်ဆက်နေပါပြီ... - + Connected ချိတ်ဆက်ပြီးသွားပါပြီ - + Preparing... - + ပြင်ဆင်နေသည်... - + Settings updated successfully, reconnnection... ဆက်တင်များကို အောင်မြင်စွာ အပ်ဒိတ်လုပ်ပြီးပါပြီ၊ ပြန်လည်ချိတ်ဆက်နေပါသည်... - + Settings updated successfully - ဆက်တင်များကို အောင်မြင်စွာ အပ်ဒိတ်လုပ်ပြီးပါပြီ။ + ဆက်တင်များကို အောင်မြင်စွာ အပ်ဒိတ်လုပ်ပြီးပါပြီ - + The selected protocol is not supported on the current platform - ရွေးချယ်ထားသော ပရိုတိုကောကို လက်ရှိပလက်ဖောင်းပေါ်တွင် အ‌ထောက်အပံ့မပေးထားပါ။ + ရွေးချယ်ထားသော ပရိုတိုကောကို လက်ရှိပလက်ဖောင်းပေါ်တွင် အ‌ထောက်အပံ့မပေးထားပါ - + unable to create configuration - + configuration ဖန်တီး၍မရပါ - + Reconnecting... ပြန်လည်ချိတ်ဆက်နေပါသည်... - - - + + + Connect ချိတ်ဆက်မည် - + Disconnecting... အဆက်အသွယ်ဖြတ်နေပါသည်... @@ -100,17 +153,17 @@ Add new connection - ချိတ်ဆက်မှုအသစ်ထည့်သွင်းပါ။ + ချိတ်ဆက်မှုအသစ်ထည့်သွင်းမည် Configure your server - သင်၏ဆာဗာကို စီစဉ်ချိန်ညှိပါ။ + သင်၏ဆာဗာကို စီစဉ်ချိန်ညှိမည် Open config file, key or QR code - config ဖိုင်၊ key သို့မဟုတ် QR ကုဒ်ကို ဖွင့်ပါ။ + config ဖိုင်၊ key သို့မဟုတ် QR ကုဒ်ကို ဖွင့်မည် @@ -131,7 +184,7 @@ &Paste - + &SelectAll &SelectAll @@ -139,9 +192,8 @@ ExportController - Access error! - အသုံးပြုခွင့်တွင်အမှားပါနေပါသည်! + အသုံးပြုခွင့်တွင်အမှားပါနေပါသည်! @@ -151,10 +203,6 @@ Unable change protocol while there is an active connection လက်ရှိချိတ်ဆက်မှုတစ်ခုရှိနေချိန်တွင် ပရိုတိုကောကို ပြောင်းလဲ၍မရပါ။ - - The selected protocol is not supported on the current platform - ရွေးချယ်ထားသော ပရိုတိုကောကို လက်ရှိပလက်ဖောင်းပေါ်တွင် အ‌ထောက်အပံ့မပေးထားပါ။ - HomeSplitTunnelingDrawer @@ -208,108 +256,128 @@ Can't be disabled for current server Unable to open file - + ဖိုင်ကိုဖွင့်၍မရပါ - - + + Invalid configuration file - + Configuration ဖိုင် မမှန်ကန်ပါ - + Scanned %1 of %2. %2 ၏ %1 ကို စကင်န်ဖတ်ထားသည်. - + In the imported configuration, potentially dangerous lines were found: - + တင်သွင်းသည့် configuration တွင်၊ အန္တရာယ်ရှိနိုင်သည့်စာလိုင်းများကို တွေ့ရှိခဲ့သည်: InstallController - + %1 installed successfully. %1 ကို အောင်မြင်စွာ ထည့်သွင်းပြီးပါပြီ. - + %1 is already installed on the server. %1 ကို ဆာဗာတွင် ထည့်သွင်းပြီးဖြစ်သည်. - + Added containers that were already installed on the server ဆာဗာတွင် ထည့်သွင်းပြီးသား ကွန်တိန်နာများကို ပေါင်းထည့်ပြီးပါပြီ။ - + Already installed containers were found on the server. All installed containers have been added to the application ထည့်သွင်းပြီးသား ကွန်တိန်နာများကို ဆာဗာပေါ်တွင် တွေ့ရှိခဲ့သည်။ ထည့်သွင်းထားသည့် ကွန်တိန်နာအားလုံးကို အပလီကေးရှင်းထဲသို့ ပေါင်းထည့်ပြီးပါပြီ။ - + Settings updated successfully ဆက်တင်များကို အောင်မြင်စွာ အပ်ဒိတ်လုပ်ပြီးပါပြီ။ - + Server '%1' was rebooted ဆာဗာ '%1' ကို ပြန်လည်စတင်ခဲ့သည်။ - + Server '%1' was removed ဆာဗာ '%1' ကို ဖယ်ရှားခဲ့သည်။ - + All containers from server '%1' have been removed ဆာဗာ '%1' မှ ကွန်တိန်နာအားလုံးကို ဖယ်ရှားလိုက်ပါပြီ။ - + %1 has been removed from the server '%2' %1 ကို ဆာဗာ '%2' မှ ဖယ်ရှားလိုက်ပါပြီ - + + Api config removed + Api config ကိုဖယ်ရှားလိုက်သည် + + + %1 cached profile cleared - + ကက်ရှ်လုပ်ထားတဲ့ ပရိုဖိုင် %1 ခုကို ရှင်းပြီးပါပြီ - + Please login as the user - အသုံးပြုသူအဖြစ် log in ဝင်ရောက်ပါ။ + အသုံးပြုသူအဖြစ် log in ဝင်ရောက်ပါ - + Server added successfully - ဆာဗာကို အောင်မြင်စွာ ထည့်သွင်းပြီးပါပြီ။ + ဆာဗာကို အောင်မြင်စွာ ထည့်သွင်းပြီးပါပြီ + + + + %1 installed successfully. + %1 ခုကို အောင်မြင်စွာ ထည့်သွင်းပြီးပါပြီ. + + + + API config reloaded + API config ကို ပြန်လည်စတင်လိုက်ပါပြီ + + + + Successfully changed the country of connection to %1 + ချိတ်ဆက်မှုနိုင်ငံကို %1 သို့ အောင်မြင်စွာ ပြောင်းလဲလိုက်ပါပြီ InstalledAppsDrawer - + Choose application - + အပလီကေးရှင်းရွေးမည် - + application name - + အပလီကေးရှင်းအမည် - + Add selected - + ရွေးချယ်ထားသည်များကိုထည့်မည် @@ -322,7 +390,7 @@ Already installed containers were found on the server. All installed containers Write key failed: %1 - key ရေးမှု မအောင်မြင်ပါ: %1 + key ရေးသားမှု မအောင်မြင်ပါ: %1 @@ -362,341 +430,423 @@ Already installed containers were found on the server. All installed containers PageDeinstalling - + Removing services from %1 ဝန်ဆောင်မှုများကို %1 မှ ဖယ်ရှားနေပါသည်။ - + Usually it takes no more than 5 minutes - များသောအားဖြင့် 5 မိနစ်ထက်မပိုပါ။ + များသောအားဖြင့် 5 မိနစ်ထက်ပိုမကြာပါ + + + + PageDevMenu + + + Gateway endpoint + Gateway အဆုံးမှတ် + + + + Dev gateway environment + PageHome - + Logging enabled - + Logging ဖွင့်ထားပါသည် - + Split tunneling enabled - split tunnelling ဖွင့်ထားပါသည်။ + split tunnelling ဖွင့်ထားပါသည် - + Split tunneling disabled - split tunnelling ပိတ်ထားပါသည်။ + split tunnelling ပိတ်ထားပါသည် - + VPN protocol VPN ပရိုတိုကော - + Servers ဆာဗာများ - + Unable change server while there is an active connection - လက်ရှိချိတ်ဆက်မှုတစ်ခုရှိနေချိန်တွင် ဆာဗာကို ပြောင်းလဲ၍မရပါ။ + လက်ရှိချိတ်ဆက်မှုတစ်ခုရှိနေချိန်တွင် ဆာဗာကို ပြောင်းလဲ၍မရပါ + + + + PageProtocolAwgClientSettings + + + AmneziaWG settings + AmneziaWG ဆက်တင်များ + + + + MTU + MTU + + + + Server settings + + + + + Port + Port + + + + Save + သိမ်းဆည်းမည် + + + + Save settings? + ဆက်တင်များကို သိမ်းဆည်းမည်လား? + + + + Only the settings for this device will be changed + + + + + Continue + ဆက်လက်လုပ်ဆောင်မည် + + + + Cancel + ပယ်ဖျက်မည် + + + + Unable change settings while there is an active connection + လက်ရှိချိတ်ဆက်မှုတစ်ခုရှိနေချိန်တွင် ဆက်တင်များကို ပြောင်းလဲ၍မရပါ PageProtocolAwgSettings - + AmneziaWG settings AmneziaWG ဆက်တင်များ - + Port Port - MTU - + MTU - Remove AmneziaWG - AmneziaWG ကို ဖယ်ရှားမည်။ - - - Remove AmneziaWG from server? - AmneziaWG ကို ဆာဗာမှ ဖယ်ရှားမည်လား? - - - + All users with whom you shared a connection with will no longer be able to connect to it. - သင့်တွင် သင့်ကိုမည်သည့် ချိတ်ဆက်ထားသော အသုံးပြုသူများသည် အကြောင်းအရာသို့ ဆက်သွယ်ရန် မရနိုင်ပါ။ + သင်နှင့်အတူချိတ်ဆက်မှုတစ်ခုကို မျှဝေထားသည့် အသုံးပြုသူအားလုံး ချိတ်ဆက်နိုင်တော့မည်မဟုတ်ပါ. - + Save သိမ်းဆည်းမည် - + + Jc - Junk packet count + Jc - Junk packet အရေအတွက် + + + + Jmin - Junk packet minimum size + Jmin - Junk packet အသေးငယ်ဆုံးလက်ခံနိုင်မှုအရွယ်အစား + + + + Jmax - Junk packet maximum size + Jmax - Junk packet အကြီးဆုံးလက်ခံနိုင်မှုအရွယ်အစား + + + + S1 - Init packet junk size + S1 - Init packet junk အရွယ်အစား + + + + S2 - Response packet junk size + S2 - Response packet junk အရွယ်အစား + + + + H1 - Init packet magic header + H1 - Init packet magic header + + + + H2 - Response packet magic header + H2 - Response packet magic header + + + + H4 - Transport packet magic header + H4 - Transport packet magic header + + + + H3 - Underload packet magic header + H3 - Underload packet magic header + + + The values of the H1-H4 fields must be unique - + H1-H4 အကွက်များ၏ တန်ဖိုးများသည် အခြားတန်ဖိုးများနှင့်မတူ တမူထူးခြားနေရပါမည် - + The value of the field S1 + message initiation size (148) must not equal S2 + message response size (92) - + အကွက် S1 + မက်ဆေ့ချ် စတင်ခြင်း အရွယ်အစား (148) ၏ တန်ဖိုးသည် S2 + မက်ဆေ့ချ် တုံ့ပြန်မှု အရွယ်အစား (92) နှင့် မညီမျှရပါ - + Save settings? - သိမ်းဆည်းမည်လား။ + ဆက်တင်များကို သိမ်းဆည်းမည်လား? - + Continue ဆက်လက်လုပ်ဆောင်မည် - + Cancel ပယ်ဖျက်မည် - + Unable change settings while there is an active connection - + လက်ရှိချိတ်ဆက်မှုတစ်ခုရှိနေချိန်တွင် ဆက်တင်များကို ပြောင်းလဲ၍မရပါ PageProtocolCloakSettings - + Cloak settings ဖုံးကွယ်အသွင်ယူမှု ဆက်တင်များ - + Disguised as traffic from traffic အဖြစ် အသွင်ယူထားသည် - + Port Port - + Cipher စာဝှက် - + Save သိမ်းဆည်းမည် - + Unable change settings while there is an active connection - + လက်ရှိချိတ်ဆက်မှုတစ်ခုရှိနေချိန်တွင် ဆက်တင်များကို ပြောင်းလဲ၍မရပါ PageProtocolOpenVpnSettings - + OpenVPN settings OpenVPN ဆက်တင်များ - + VPN address subnet VPN လိပ်စာ ကွန်ရက်ခွဲ - + Network protocol ကွန်ယက် ပရိုတိုကော - + Port Port - + Auto-negotiate encryption အလိုအလျောက် ညှိနှိုင်း ကုဒ်ဝှက်ခြင်း - + Hash Hash - + SHA512 SHA512 - + SHA384 SHA384 - + SHA256 SHA256 - + SHA3-512 SHA3-512 - + SHA3-384 SHA3-384 - + SHA3-256 SHA3-256 - + whirlpool whirlpool - + BLAKE2b512 BLAKE2b512 - + BLAKE2s256 BLAKE2s256 - + SHA1 SHA1 - + Cipher စာဝှက် - + AES-256-GCM AES-256-GCM - + AES-192-GCM AES-192-GCM - + AES-128-GCM AES-128-GCM - + AES-256-CBC AES-256-CBC - + AES-192-CBC AES-192-CBC - + AES-128-CBC AES-128-CBC - + ChaCha20-Poly1305 ChaCha20-Poly1305 - + ARIA-256-CBC ARIA-256-CBC - + CAMELLIA-256-CBC CAMELLIA-256-CBC - + none none - + TLS auth TLS auth - + Block DNS requests outside of VPN VPN ပြင်ပရှိ DNS တောင်းဆိုမှုများကို ပိတ်ပင်မည်။ - + Additional client configuration commands ထပ်တိုး client ဖွဲ့စည်းမှုဆိုင်ရာ ညွှန်ကြားချက်များ - - + + Commands: အမိန့်ပေးခိုင်းစေချက်များ: - + Additional server configuration commands ထပ်တိုး ဆာဗာ ဖွဲ့စည်းမှုဆိုင်ရာ ညွှန်ကြားချက်များ - + Unable change settings while there is an active connection - + လက်ရှိချိတ်ဆက်မှုတစ်ခုရှိနေချိန်တွင် ဆက်တင်များကို ပြောင်းလဲ၍မရပါ - Remove OpenVPN - AmneziaWG ကို ဖယ်ရှားမည်။ - - - Remove OpenVPN from server? - AmneziaWG ကို ဆာဗာမှ ဖယ်ရှားမည်လား? - - - All users with whom you shared a connection with will no longer be able to connect to it. - သင့်တွင် သင့်ကိုမည်သည့် ချိတ်ဆက်ထားသော အသုံးပြုသူများသည် အကြောင်းအရာသို့ ဆက်သွယ်ရန် မရနိုင်ပါ။ - - - Continue - ဆက်လက်လုပ်ဆောင်မည် - - - Cancel - ပယ်ဖျက်မည် - - - + Save သိမ်းဆည်းမည် @@ -704,46 +854,42 @@ Already installed containers were found on the server. All installed containers PageProtocolRaw - + settings ဆက်တင်များ - + Show connection options ချိတ်ဆက်မှုရွေးချယ်စရာများကို ပြပါ။ - + Connection options %1 ချိတ်ဆက်မှုရွေးချယ်စရာများ %1 - + Remove ဖယ်ရှားမည် - + Remove %1 from server? %1 ကို ဆာဗာမှ ဖယ်ရှားမည်လား? - - - All users with whom you shared a connection with will no longer be able to connect to it. - သင့်တွင် သင့်ကိုမည်သည့် ချိတ်ဆက်ထားသော အသုံးပြုသူများသည် အကြောင်းအရာသို့ ဆက်သွယ်ရန် မရနိုင်ပါ။ - - - All users who you shared a connection with will no longer be able to connect to it. - Все пользователи, с которыми вы поделились этим VPN-протоколом, больше не смогут к нему подключаться. - + All users with whom you shared a connection with will no longer be able to connect to it. + သင်နှင့်အတူချိတ်ဆက်မှုတစ်ခုကို မျှဝေထားသည့် အသုံးပြုသူအားလုံး ချိတ်ဆက်နိုင်တော့မည်မဟုတ်ပါ. + + + Continue ဆက်လက်လုပ်ဆောင်မည် - + Cancel ပယ်ဖျက်မည် @@ -751,64 +897,128 @@ Already installed containers were found on the server. All installed containers PageProtocolShadowSocksSettings - + Shadowsocks settings Shadowsocks ဆက်တင်များ - + Port Port - + Cipher စာဝှက် - + Save သိမ်းဆည်းမည် - + Unable change settings while there is an active connection + လက်ရှိချိတ်ဆက်မှုတစ်ခုရှိနေချိန်တွင် ဆက်တင်များကို ပြောင်းလဲ၍မရပါ + + + + PageProtocolWireGuardClientSettings + + + WG settings + WG ဆက်တင်များ + + + + MTU + MTU + + + + Server settings + + + Port + Port + + + + Save + သိမ်းဆည်းမည် + + + + Save settings? + ဆက်တင်များကို သိမ်းဆည်းမည်လား? + + + + Only the settings for this device will be changed + + + + + Continue + ဆက်လက်လုပ်ဆောင်မည် + + + + Cancel + ပယ်ဖျက်မည် + + + + Unable change settings while there is an active connection + လက်ရှိချိတ်ဆက်မှုတစ်ခုရှိနေချိန်တွင် ဆက်တင်များကို ပြောင်းလဲ၍မရပါ + PageProtocolWireGuardSettings - + WG settings - + WG ဆက်တင်များ - + Port - Port + Port - - MTU - + + Save settings? + ဆက်တင်များကို သိမ်းဆည်းမည်လား? - - Unable change settings while there is an active connection - + + All users with whom you shared a connection with will no longer be able to connect to it. + သင်နှင့်အတူချိတ်ဆက်မှုတစ်ခုကို မျှဝေထားသည့် အသုံးပြုသူအားလုံး ချိတ်ဆက်နိုင်တော့မည်မဟုတ်ပါ. - All users with whom you shared a connection will no longer be able to connect to it. - သင်နှင့်အတူချိတ်ဆက်မှုတစ်ခုကို မျှဝေထားသည့် အသုံးပြုသူအားလုံး ဤချိတ်ဆက်မှုကိုချိတ်ဆက်နိုင်တော့မည်မဟုတ်ပါ. + + Continue + ဆက်လက်လုပ်ဆောင်မည် + Cancel - ပယ်ဖျက်မည် + ပယ်ဖျက်မည် - + MTU + MTU + + + + Unable change settings while there is an active connection + လက်ရှိချိတ်ဆက်မှုတစ်ခုရှိနေချိန်တွင် ဆက်တင်များကို ပြောင်းလဲ၍မရပါ + + + Save သိမ်းဆည်းမည် @@ -816,323 +1026,281 @@ Already installed containers were found on the server. All installed containers PageProtocolXraySettings - + XRay settings - + XRay ဆက်တင်များ - + Disguised as traffic from - traffic အဖြစ် အသွင်ယူထားသည် + traffic အဖြစ် အသွင်ယူထားသည် - + Save - သိမ်းဆည်းမည် + သိမ်းဆည်းမည် - + Unable change settings while there is an active connection - - - - - PageServerContainers - - Continue - Продолжить + လက်ရှိချိတ်ဆက်မှုတစ်ခုရှိနေချိန်တွင် ဆက်တင်များကို ပြောင်းလဲ၍မရပါ PageServiceDnsSettings - + A DNS service is installed on your server, and it is only accessible via VPN. DNS ဝန်ဆောင်မှုကို သင့်ဆာဗာတွင် ထည့်သွင်းထားပြီးဖြစ်ပြီး ၎င်းကို VPN မှတစ်ဆင့်သာ အသုံးပြုနိုင်သည်. - + The DNS address is the same as the address of your server. You can configure DNS in the settings, under the connections tab. DNS လိပ်စာသည် သင့်ဆာဗာလိပ်စာနှင့် အတူတူပင်ဖြစ်ပါသည်။ ချိတ်ဆက်မှုတက်ဘ်အောက်ရှိ ဆက်တင်များတွင် DNS ကို ပြင်ဆင်ချိန်ညှိနိုင်ပါသည်. - + Remove ဖယ်ရှားမည် - + Remove %1 from server? %1 ကို ဆာဗာမှ ဖယ်ရှားမည်လား? - + Continue ဆက်လက်လုပ်ဆောင်မည် - + Cancel ပယ်ဖျက်မည် - + Cannot remove AmneziaDNS from running server - + AmneziaDNS ကို လည်ပတ်နေသည့်ဆာဗာမှ ဖယ်ရှား၍မရပါ PageServiceSftpSettings - + Settings updated successfully ဆက်တင်များကို အောင်မြင်စွာ အပ်ဒိတ်လုပ်ပြီးပါပြီ။ - + SFTP settings SFTP ဆက်တင်များ - + Host Host - - - - + + + + Copied ကူးယူပြီးပါပြီ - + Port Port - + User name အသုံးပြုသူနာမည် - + Password စကားဝှက် - + Mount folder on device ဖိုင်တွဲကို စက်တွင် တပ်ဆင်မည်။ - + In order to mount remote SFTP folder as local drive, perform following steps: <br> အဝေးမှ SFTP ဖိုင်တွဲကို စက်တွင်း drive အဖြစ် တပ်ဆင်ရန်အတွက် အောက်ပါအဆင့်များကို လုပ်ဆောင်ပါ: <br> - - + + <br>1. Install the latest version of <br>၁။ နောက်ဆုံးထွက်ဗားရှင်းကို ထည့်သွင်းမည် - - + + <br>2. Install the latest version of <br>၂။ နောက်ဆုံးထွက်ဗားရှင်းကို ထည့်သွင်းမည် - + Detailed instructions အသေးစိတ်ညွှန်ကြားချက်များ - - - Remove SFTP and all data stored there - SFTP ဖယ်ရှားပါ - - - - Remove SFTP and all data stored there? - SFTP နှင့် ထိုနေရာတွင် သိမ်းဆည်းထားသည့် ဒေတာအားလုံးကို ဖယ်ရှားမည်လား? - - - - Continue - ဆက်လက်လုပ်ဆောင်မည် - - - - Cancel - ပယ်ဖျက်မည် - PageServiceSocksProxySettings - + Settings updated successfully - ဆက်တင်များကို အောင်မြင်စွာ အပ်ဒိတ်လုပ်ပြီးပါပြီ။ + ဆက်တင်များကို အောင်မြင်စွာ အပ်ဒိတ်လုပ်ပြီးပါပြီ - - + + SOCKS5 settings - + SOCKS5 ဆက်တင်များ - + Host - Host + Host - - - - + + + + Copied - ကူးယူပြီးပါပြီ + ကူးယူပြီးပါပြီ - - + + Port - Port + Port - + User name - အသုံးပြုသူနာမည် + အသုံးပြုသူနာမည် - - + + Password - စကားဝှက် + စကားဝှက် - + Username - + အသုံးပြုသူနာမည် - - + + Change connection settings - + ချက်ဆက်မှုဆက်တင်များကို ပြောင်းလဲမည် - + The port must be in the range of 1 to 65535 - + Port သည် 1 မှ 65535 အတွင်း ဖြစ်ရမည် - + Password cannot be empty - + စကားဝှက် သည် ဗလာမဖြစ်ရပါ - + Username cannot be empty - + အသုံးပြုသူနာမည် သည် ဗလာမဖြစ်ရပါ PageServiceTorWebsiteSettings - + Settings updated successfully ဆက်တင်များကို အောင်မြင်စွာ အပ်ဒိတ်လုပ်ပြီးပါပြီ။ - + Tor website settings Tor ဝဘ်ဆိုက်ဆက်တင်များ - + Website address ဝဘ်ဆိုဒ်လိပ်စာ - + Copied ကူးယူပြီးပါပြီ - + Use <a href="https://www.torproject.org/download/" style="color: #FBB26A;">Tor Browser</a> to open this URL. ဤ URL ကိုဖွင့်ရန် <a href="https://www.torproject.org/download/" style="color: #FBB26A;">Tor Browser</a> ကို အသုံးပြုပါ. - + After creating your onion site, it takes a few minutes for the Tor network to make it available for use. သင်၏ onion ဆိုက်ကို ဖန်တီးပြီးနောက်၊ Tor ကွန်ရက်က ၄င်းကိုအသုံးပြုနိုင်အောင်ပြုလုပ်‌ပေးရန် မိနစ်အနည်းငယ်အချိန်ယူသည်. - + When configuring WordPress set the this onion address as domain. WordPress ကို ချိန်ညှိသည့်အခါ ဤ onion လိပ်စာကို domain အဖြစ် သတ်မှတ်ပါ. - - - Remove website - ဝဘ်ဆိုက်ကိုဖယ်ရှားမည် - - - - The site with all data will be removed from the tor network. - ဒေတာအားလုံးပါသည့် ဆိုက်ကို tor ကွန်ရက်မှ ဖယ်ရှားပါမည်. - - - - Continue - ဆက်လက်လုပ်ဆောင်မည် - - - - Cancel - ပယ်ဖျက်မည် - PageSettings - + Settings ဆက်တင်များ - + Servers ဆာဗာများ - + Connection ချိတ်ဆက်မှု - + Application အပလီကေးရှင်း - + Backup backup ယူမည် - + About AmneziaVPN AmneziaVPN အကြောင်း + Dev console + ဒက်ဗယ်လော်ပါ console + + + Close application အပလီကေးရှင်းကို ပိတ်မည် @@ -1140,246 +1308,325 @@ Already installed containers were found on the server. All installed containers PageSettingsAbout - + Support Amnezia Amnezia ကိုကူညီပံ့ပိုးမည် - + Amnezia is a free and open-source application. You can support the developers if you like it. - Amnezia သည် အခမဲ့ဖြစ်ပြီး open-source application တစ်ခုဖြစ်သည်။ သင်နှစ်သက်ပါက developer များကို ပံ့ပိုးနိုင်ပါသည်။ + Amnezia သည် အခမဲ့ open-source application တစ်ခုဖြစ်သည်။ သင်နှစ်သက်ပါက developer များကို ပံ့ပိုးနိုင်ပါသည်. - + Contacts ဆက်သွယ်ရန်လိပ်စာများ - + Telegram group Telegram ဂရု - + To discuss features feature များကိုဆွေးနွေးရန် - + https://t.me/amnezia_vpn_en https://t.me/amnezia_vpn - Mail - မေးလ် + မေးလ် + support@amnezia.org + + + + For reviews and bug reports သုံးသပ်ချက်များနှင့် ချွတ်ယွင်းချက်အစီရင်ခံစာများအတွက် - + + Copied + ကူးယူပြီးပါပြီ + + + GitHub GitHub - + https://github.com/amnezia-vpn/amnezia-client https://github.com/amnezia-vpn/amnezia-client - + Website ဝဘ်ဆိုက် - - https://amnezia.org - https://amnezia.org - - - + Software version: %1 ဆော့ဖ်ဝဲဗားရှင်း: %1 - + Check for updates အပ်ဒိတ်များရှိမရှိ စစ်ဆေးမည် - + Privacy Policy ကိုယ်ရေးအချက်အလက်မူဝါဒ + + PageSettingsApiServerInfo + + + For the region + ဒေသအတွက် + + + + Price + စျေးနှုန်း + + + + Work period + အလုပ်လုပ်မည့်ကာလ + + + + Speed + မြန်နှုန်း + + + + Support tag + ကူညီပံ့ပိုးမှု tag + + + + Copied + ကူးယူပြီးပါပြီ + + + + Reload API config + API config ကို ပြန်လည်စတင်မည် + + + + Reload API config? + API config ကို ပြန်လည်စတင်မည်လား? + + + + + Continue + ဆက်လက်လုပ်ဆောင်မည် + + + + + Cancel + ပယ်ဖျက်မည် + + + + Cannot reload API config during active connection + ချိတ်ဆက်မှုရှိနေချိန်အတွင်း API config ကို ပြန်လည်စတင်၍မရပါ + + + + Remove from application + အပလီကေးရှင်းမှဖယ်ရှားမည် + + + + Remove from application? + အပလီကေးရှင်းမှဖယ်ရှားမည်လား? + + + + Cannot remove server during active connection + ချိတ်ဆက်မှုရှိနေချိန်အတွင်း ဆာဗာကို ဖယ်ရှား၍မရပါ + + PageSettingsAppSplitTunneling - + Cannot change split tunneling settings during active connection - လက်ရှိချိတ်ဆက်မှုတစ်ခုရှိနေချိန်တွင် split tunneling ဆက်တင်များကို ပြောင်းလဲ၍မရပါ + လက်ရှိချိတ်ဆက်မှုတစ်ခုရှိနေချိန်တွင် split tunneling ဆက်တင်များကို ပြောင်းလဲ၍မရပါ - + Only the apps from the list should have access via VPN - + စာရင်းတွင်းပါဝင်သောအက်ပ်များသာလျှင် VPN မှတစ်ဆင့် ဝင်ရောက်ခွင့်ရှိလိမ့်မည်ဖြစ်သည် - + Apps from the list should not have access via VPN - + စာရင်းတွင်းပါဝင်သောအက်ပ်များကို VPN မှတစ်ဆင့် ဝင်ရောက်ခွင့်ရရှိလိမ့်မည်မဟုတ်ပေ - + App split tunneling - + App split tunneling - + Mode - Mode - - - - Remove - ဖယ်ရှားမည် + Mode - Continue - + Remove + ဖယ်ရှားမည် + Continue + ဆက်လက်လုပ်ဆောင်မည် + + + Cancel - ပယ်ဖျက်မည် + ပယ်ဖျက်မည် - + application name - - - - - Open executable file - + အပလီကေးရှင်းအမည် + Open executable file + စီမံလုပ်ဆောင်နိုင်မှုဖိုင်ကိုဖွင့်မည် + + + Executable files (*.*) - + စီမံလုပ်ဆောင်နိုင်မှုဖိုင်များ (*.*) PageSettingsApplication - + Application အပလီကေးရှင်း - + Allow application screenshots အပလီကေးရှင်းကို screenshot ရိုက်ရန်ခွင့်ပြုမည် - + Enable notifications - + နိုတီများဖွင့်မည် - + Enable notifications to show the VPN state in the status bar - + စတေးတပ်ဘားတွင် VPN အခြေအနေကိုပြသရန် နိုတီများကို ဖွင့်မည် - + Auto start အလိုအ‌လျှောက်စတင်မည် - + Launch the application every time the device is starts စက်စတင်ချိန်တိုင်း အပလီကေးရှင်းကို စတင်မည် - + Auto connect အလိုအ‌လျှောက်ချိတ်ဆက်မည် - + Connect to VPN on app start အက်ပ်စတင်ချိန်တွင် VPN သို့ ချိတ်ဆက်မည် - + Start minimized အက်ပ်စတင်သည့်အခါ minimized ထားပြီးစတင်မည် - + Launch application minimized - အက်ပ်စတင်သည့်အခါ minimized ထားပြီးစတင်မည် + အက်ပ်ဖွင့်သည့်အခါ minimized ထားပြီးဖွင့်မည် - + Language ဘာသာစကား - + Logging - လော့ဂ်အင် + Logging - + Enabled ဖွင့်ထားပါသည် - + Disabled ပိတ်ထားပါသည် - + Reset settings and remove all data from the application ဆက်တင်များနဂိုတိုင်းထားပြီး အပလီကေးရှင်းမှဒေတာအားလုံးဖယ်ရှားမည် - + Reset settings and remove all data from the application? ဆက်တင်များကို ပြန်လည်သတ်မှတ်ပြီး အပလီကေးရှင်းမှ ဒေတာအားလုံးကို ဖယ်ရှားမည်လား? - + All settings will be reset to default. All installed AmneziaVPN services will still remain on the server. - ဆက်တင်အားလုံးကို မူရင်းအတိုင်း ပြန်လည်သတ်မှတ်ပါမည်. ထည့်သွင်းထားသော AmneziaVPN ဝန်ဆောင်မှုများအားလုံးသည် ဆာဗာပေါ်တွင် ဆက်လက်ရှိနေမည်ဖြစ်သည်. + ဆက်တင်အားလုံးကို မူရင်းအတိုင်း ပြန်လည်သတ်မှတ်ပါမည်။ ထည့်သွင်းထားသော AmneziaVPN ဝန်ဆောင်မှုများအားလုံးသည် ဆာဗာပေါ်တွင် ဆက်လက်ရှိနေမည်ဖြစ်သည်။. - + Continue ဆက်လက်လုပ်ဆောင်မည် - + Cancel ပယ်ဖျက်မည် - + Cannot reset settings during active connection - + ချိတ်ဆက်မှုရှိနေချိန်အတွင်း ဆက်တင်များကို မူရင်းအတိုင်း ပြန်လည်သတ်မှတ်၍မရပါ PageSettingsBackup - + Settings restored from backup file ဆက်တင်များကို အရန်ဖိုင်မှ ပြန်လည်ရယူပြီးပါပြီ @@ -1396,43 +1643,43 @@ Already installed containers were found on the server. All installed containers The backup will contain your passwords and private keys for all servers added to AmneziaVPN. Keep this information in a secure place. - မိတ္တူတွင် AmneziaVPN သို့ ထည့်ထားသော ဆာဗာအားလုံးအတွက် သင့်စကားဝှက်များနှင့် လျှို့ဝှက်သော့များ ပါဝင်ပါမည်။ ဤအချက်အလက်ကို လုံခြုံသောနေရာတွင် ထားပါ။ + အရံဖိုင်တွင် AmneziaVPN သို့ ထည့်ထားသော ဆာဗာအားလုံးအတွက် သင့်စကားဝှက်များနှင့် လျှို့ဝှက်သော့များ ပါဝင်ပါမည်။ ဤအချက်အလက်ကို လုံခြုံသောနေရာတွင် ထားပါ။. Make a backup - အရန်ဖိုင်တစ်ခု ပြုလုပ်မည် + အရံဖိုင်တစ်ခု ပြုလုပ်မည် Save backup file - အရန်ဖိုင်ကို သိမ်းဆည်းမည် + အရံဖိုင်ကို သိမ်းဆည်းမည် Backup files (*.backup) - ဖိုင်များကိုအရန်သိမ်းဆည်းမည် (*.backup) + အရံဖိုင်များ (*.backup) Backup file saved - ဖိုင်များကိုအရန်သိမ်းဆည်းပြီးပါပြီ + အရံဖိုင်ကိုသိမ်းဆည်းပြီးပါပြီ Restore from backup - အရန်သိမ်းထားသည့်ဖိုင်မှ ပြန်လည်ရယူမည် + အရံဖိုင်မှ ပြန်လည်ရယူမည် Open backup file - အရန်သိမ်းထားသည့်ဖိုင်ကို ဖွင့်မည် + အရံဖိုင်ကို ဖွင့်မည် Import settings from a backup file? - ဆက်တင်များကို အရန်ဖိုင်တစ်ခုမှ ပြန်လည်တင်သွင်းမည်လား? + ဆက်တင်များကို အရံဖိုင်တစ်ခုမှ ပြန်လည်တင်သွင်းမည်လား? @@ -1452,68 +1699,68 @@ Already installed containers were found on the server. All installed containers Cannot restore backup settings during active connection - + ချိတ်ဆက်မှုရှိနေချိန်အတွင်း အရံဆက်တင်များကို ပြန်လည်ရယူ၍မရပါ PageSettingsConnection - + Connection ချိတ်ဆက်မှု - + Use AmneziaDNS AmneziaDNS ကို အသုံးပြုမည် - + If AmneziaDNS is installed on the server အကယ်၍ AmneziaDNS ကို ဆာဗာတွင် ထည့်သွင်းထားလျှင် - + DNS servers DNS ဆာဗာများ - + When AmneziaDNS is not used or installed AmneziaDNS ကို အသုံးမပြု သို့မဟုတ် ထည့်သွင်းခြင်းမပြုသည့်အခါ - + Allows you to use the VPN only for certain Apps အချို့သောအက်ပ်များအတွက်သာ VPN ကို အသုံးပြုခွင့်ပေးသည် - - - KillSwitch - - + KillSwitch + KillSwitch + + + Disables your internet if your encrypted VPN connection drops out for any reason. - + အကြောင်းတစ်ခုခုကြောင့် VPN ချိတ်ဆက်မှု ပျက်သွားပါက သင့်အင်တာနက်ကို ချက်ချင်းရပ်ဆိုင်းပေးသည်. - + Cannot change killSwitch settings during active connection - + လက်ရှိချိတ်ဆက်မှုတစ်ခုရှိနေချိန်တွင် killSwitch ဆက်တင်များကို ပြောင်းလဲ၍မရပါ - + Site-based split tunneling ဝက်ဆိုဒ်အခြေပြု split tunneling - + Allows you to select which sites you want to access through the VPN VPN မှတဆင့် သင်ဝင်ရောက်လိုသည့်ဆိုဒ်များကို ရွေးချယ်စေနိုင်သည် - + App-based split tunneling App အခြေပြု split tunneling @@ -1521,62 +1768,62 @@ Already installed containers were found on the server. All installed containers PageSettingsDns - + Default server does not support custom DNS - မူရင်းဆာဗာသည် စိတ်ကြိုက် DNS ကို အထောက်အပံ့မပေးပါ + မူရင်းဆာဗာသည် စိတ်ကြိုက်ထားနိုင်သည့် DNS ကို အထောက်အပံ့မပေးပါ - + DNS servers DNS ဆာဗာများ - + If AmneziaDNS is not used or installed AmneziaDNS ကို အသုံးမပြု သို့မဟုတ် ထည့်သွင်းခြင်းမပြုသည့်အခါ - + Primary DNS Primary DNS - + Secondary DNS Secondary DNS - + Restore default မူရင်းအတိုင်းပြန်လည်ထားရှိမည် - + Restore default DNS settings? မူရင်း DNS ဆက်တင်များကို ပြန်လည်ရယူလိုပါသလား? - + Continue ဆက်လက်လုပ်ဆောင်မည် - + Cancel ပယ်ဖျက်မည် - + Settings have been reset ဆက်တင်များကို ပြန်လည်သတ်မှတ်ပြီးပါပြီ - + Save သိမ်းဆည်းမည် - + Settings saved ဆက်တင်များကို သိမ်းဆည်းပြီးပြီ @@ -1584,73 +1831,109 @@ Already installed containers were found on the server. All installed containers PageSettingsLogging - Logging is enabled. Note that logs will be automatically disabled after 14 days, and all log files will be deleted. - + Logging ကို ဖွင့်ထားသည်။ မှတ်တမ်းများကို ၁၄ ရက်အကြာတွင် အလိုအလျောက်ပိတ်ထားမည်ဖြစ်ပြီး မှတ်တမ်းဖိုင်များအားလုံး ပျက်သွားမည်ဖြစ်ကြောင်း သတိပြုပါ။. - + Logging - လော့ဂ်အင် + Logging - + Enabling this function will save application's logs automatically. By default, logging functionality is disabled. Enable log saving in case of application malfunction. - ဤလုပ်ဆောင်ချက်ကို ဖွင့်ခြင်းဖြင့် အပလီကေးရှင်း၏ မှတ်တမ်းများကို အလိုအလျောက် သိမ်းဆည်းပေးမည် ဖြစ်ပြီး မူရင်းအတိုင်း၊ မှတ်တမ်းလုပ်ဆောင်ချက်ကို ပိတ်ထားသည်။ အပလီကေးရှင်းချို့ယွင်းချက်ရှိသောအခါ မှတ်တမ်းသိမ်းဆည်းခြင်းကို ဖွင့်ပါ။ + ဤလုပ်ဆောင်ချက်ကို ဖွင့်ခြင်းဖြင့် အပလီကေးရှင်း၏ မှတ်တမ်းများကို အလိုအလျောက် သိမ်းဆည်းပေးမည် ဖြစ်သည်။ ပုံမှန်အတိုင်းဆိုလျှင် Logging လုပ်ဆောင်ချက်ကို ပိတ်ထားမည်ဖြစ်သည်။ အပလီကေးရှင်းချို့ယွင်းချက်ရှိခဲ့ပါသော် မှတ်တမ်းကိုပြန်လည်ကြည့်ရှုနိုင်ရန် မှတ်တမ်းသိမ်းဆည်းမှုကို ဖွင့်ထားလိုက်ပါ။. - Save logs - မှတ်တမ်းများကိုသိမ်းဆည်းမည် + မှတ်တမ်းများကိုသိမ်းဆည်းမည် - Open folder with logs - မှတ်တမ်းများဖြင့် ဖိုင်တွဲကိုဖွင့်မည် + မှတ်တမ်းများရှိသောဖိုင်တွဲကိုဖွင့်မည် - + + Save သိမ်းဆည်းမည် - + + Logs files (*.log) မှတ်တမ်းဖိုင်များ (*.log) မှတ်တမ်းဖိုင်များ (*.log) - + + Logs file saved မှတ်တမ်းဖိုင်များသိမ်းဆည်းပြီးပါပြီ - Save logs to file - မှတ်တမ်းများကို ဖိုင်တွင်သိမ်းဆည်းမည် + မှတ်တမ်းများကို ဖိုင်တွင်သိမ်းဆည်းမည် - + + Enable logs + + + + Clear logs? မှတ်တမ်းများရှင်းလင်းမည်လား? - + Continue ဆက်လက်လုပ်ဆောင်မည် - + Cancel ပယ်ဖျက်မည် - + Logs have been cleaned up မှတ်တမ်းများကို ရှင်းလင်းပြီးပါပြီ - + + Client logs + + + + + AmneziaVPN logs + + + + + + Open logs folder + + + + + + Export logs + + + + + Service logs + + + + + AmneziaVPN-service logs + + + + Clear logs မှတ်တမ်းများရှင်းလင်းမည် @@ -1658,24 +1941,12 @@ Already installed containers were found on the server. All installed containers PageSettingsServerData - + All installed containers have been added to the application ထည့်သွင်းထားသည့် ကွန်တိန်နာအားလုံးကို အပလီကေးရှင်းသို့ ပေါင်းထည့်လိုက်ပြီ - Clear Amnezia cache - Amnezia ကက်ရှ်ဖိုင်များကို ရှင်းလင်းမည် - - - May be needed when changing other settings - အခြားဆက်တင်များကို ပြောင်းလဲသည့်အခါ လိုအပ်နိုင်သည် - - - Clear cached profiles? - ကက်ရှ်ပရိုဖိုင်များကို ရှင်းမည်လား? - - - + No new installed containers found အသစ်ထည့်သွင်းထားသော ကွန်တိန်နာများ မတွေ့ရှိပါ @@ -1684,104 +1955,104 @@ Already installed containers were found on the server. All installed containers - - - - - - Continue - ဆက်လက်လုပ်ဆောင်မည် - + Continue + ဆက်လက်လုပ်ဆောင်မည် + + + + + + Cancel ပယ်ဖျက်မည် - + Check the server for previously installed Amnezia services ယခင်က ထည့်သွင်းထားသော Amnezia ဝန်ဆောင်မှုများရှိမရှိ ဆာဗာကို စစ်ဆေးမည် - + Add them to the application if they were not displayed ဖော်ဆောင်ပြသခြင်းမရှိပါက ၎င်းတို့ကို အပလီကေးရှင်းထဲသို့ ထည့်မည် - + Reboot server ဆာဗာကို ပြန်လည်စတင်မည် - + Do you want to reboot the server? ဆာဗာကို ပြန်လည်စတင်ချင်ပါသလား? - + The reboot process may take approximately 30 seconds. Are you sure you wish to proceed? ပြန်လည်စတင်သည့် လုပ်ငန်းစဉ်သည် စက္ကန့် 30 ခန့် ကြာနိုင်သည်. ဆက်လက်လုပ်ဆောင်လိုပါသလား? - + Cannot reboot server during active connection - + ချိတ်ဆက်မှုရှိနေချိန်အတွင်း ဆာဗာကို ပြန်လည်စတင်၍မရပါ - + Do you want to remove the server from application? ဆာဗာကို အပလီကေးရှင်းမှဖယ်ရှားချင်ပါသလား? - + Cannot remove server during active connection - + ချိတ်ဆက်မှုရှိနေချိန်အတွင်း ဆာဗာကို ဖယ်ရှား၍မရပါ - + Do you want to clear server from Amnezia software? ဆာဗာကို Amnezia ဆော့ဖ်ဝဲလ်မှ ရှင်းလင်းလိုပါသလား? - + All users whom you shared a connection with will no longer be able to connect to it. - သင်ချိတ်ဆက်မှုတစ်ခုနှင့် မျှဝေထားသည့် အသုံးပြုသူအားလုံး ၎င်းကို ချိတ်ဆက်နိုင်တော့မည်မဟုတ်ပါ။ + သင်၏ချိတ်ဆက်မှကို မျှဝေထားသည့် အသုံးပြုသူအားလုံး ချိတ်ဆက်နိုင်တော့မည်မဟုတ်ပါ. - + Cannot clear server from Amnezia software during active connection - + လက်ရှိချိတ်ဆက်မှုတစ်ခုရှိနေချိန်တွင် ဆာဗာကို Amnezia ဆော့ဖ်ဝဲလ်မှ ရှင်းလင်း၍မရပါ - + Reset API config API config ကို ပြန်လည်သတ်မှတ်မည် - + Do you want to reset API config? API config ကို ပြန်လည်သတ်မှတ်ချင်ပါသလား? - + Cannot reset API config during active connection - + လက်ရှိချိတ်ဆက်မှုတစ်ခုရှိနေချိန်တွင် API config ကို ပြန်လည်သတ်မှတ်၍မရပါ - + Remove server from application ဆာဗာကို အပလီကေးရှင်းမှဖယ်ရှားမည် - + All installed AmneziaVPN services will still remain on the server. ထည့်သွင်းထားသော AmneziaVPN ဝန်ဆောင်မှုများအားလုံးသည် ဆာဗာပေါ်တွင် ဆက်လက်ရှိနေမည်ဖြစ်သည်. - + Clear server from Amnezia software ဆာဗာကို Amnezia ဆော့ဖ်ဝဲလ်မှ ရှင်းလင်းမည် @@ -1789,27 +2060,27 @@ Already installed containers were found on the server. All installed containers PageSettingsServerInfo - + Server name ဆာဗာအမည် - + Save သိမ်းဆည်းမည် - + Protocols ပရိုတိုကောများ - + Services ဝန်ဆောင်မှုများ - + Management စီမံခန့်ခွဲမှု @@ -1817,59 +2088,83 @@ Already installed containers were found on the server. All installed containers PageSettingsServerProtocol - + settings ဆက်တင်များ - Clear %1 profile - + %1 ပရိုဖိုင်ကို ရှင်းလင်းမည် - + Clear %1 profile? - + %1 ပရိုဖိုင်ကို ရှင်းလင်းမည်လား? - + - + Unable to clear %1 profile while there is an active connection - + လက်ရှိချိတ်ဆက်မှုတစ်ခုရှိနေချိန်တွင် %1 ပရိုဖိုင်ကို ရှင်းလင်း၍မရပါ - + Remove ဖယ်ရှားမည် - + Remove %1 from server? %1 ကို ဆာဗာမှ ဖယ်ရှားမည်လား? - + All users with whom you shared a connection will no longer be able to connect to it. သင်နှင့်အတူချိတ်ဆက်မှုတစ်ခုကို မျှဝေထားသည့် အသုံးပြုသူအားလုံး ဤချိတ်ဆက်မှုကိုချိတ်ဆက်နိုင်တော့မည်မဟုတ်ပါ. - + Cannot remove active container - + Active container ကိုဖယ်ရှား၍မရပါ - - + + Continue ဆက်လက်လုပ်ဆောင်မည် - - + + connection settings + + + + + Click the "connect" button to create a connection configuration + + + + + server settings + + + + + Clear profile + + + + + The connection configuration will be deleted for this device only + + + + + Cancel ပယ်ဖျက်မည် @@ -1877,7 +2172,7 @@ Already installed containers were found on the server. All installed containers PageSettingsServersList - + Servers ဆာဗာများ @@ -1885,209 +2180,312 @@ Already installed containers were found on the server. All installed containers PageSettingsSplitTunneling - + Default server does not support split tunneling function မူရင်းဆာဗာသည် split tunneling လုပ်ဆောင်ချက်ကို အထောက်အပံ့မပေးပါ - + Addresses from the list should not be accessed via VPN စာရင်းတွင်ဖော်ပြထားသောလိပ်စာများကို VPN ဖြင့် ဝင်ရောက်ခြင်းပြုနိုင်လိမ့်မည် မဟုတ်ပေ - + Split tunneling Split tunneling - + Mode Mode - + Remove ဖယ်ရှားမည် - + Continue ဆက်လက်လုပ်ဆောင်မည် - + Cancel ပယ်ဖျက်မည် - + Import / Export Sites ဆိုက်များ သွင်း/ထုတ်မည် - + Only the sites listed here will be accessed through the VPN ဤနေရာတွင်ဖော်ပြထားသောဆိုက်များကိုသာ VPN မှတဆင့်ဝင်ရောက်ပါမည် - + Cannot change split tunneling settings during active connection လက်ရှိချိတ်ဆက်မှုတစ်ခုရှိနေချိန်တွင် split tunneling ဆက်တင်များကို ပြောင်းလဲ၍မရပါ - + website or IP ဝဘ်ဆိုက် သို့မဟုတ် IP - + Import တင်သွင်းမည် - + Save site list ဆိုက်စာရင်းကို သိမ်းဆည်းမည် - + Save sites ဆိုက်များသိမ်းဆည်းမည် - - - + + + Sites files (*.json) ဆိုက်ဖိုင်များ (*.json) - + Import a list of sites ဆိုက်စာရင်းတစ်ခု တင်သွင်းမည် - + Replace site list ဆိုက်စာရင်းကို အစားထိုးမည် - - + + Open sites file ဆိုက်ဖိုင်များ ဖွင့်မည် - + Add imported sites to existing ones တင်သွင်းထားသော ဆိုက်များကို ရှိပြီးသားဆိုက်များထဲသို့ ထည့်မည် + + PageSetupWizardApiServiceInfo + + + For the region + ဒေသအတွက် + + + + Price + စျေးနှုန်း + + + + Work period + အလုပ်လုပ်မည့်ကာလ + + + + Speed + မြန်နှုန်း + + + + Features + Feature များ + + + + Connect + ချိတ်ဆက်မည် + + + + PageSetupWizardApiServicesList + + + VPN by Amnezia + Amnezia မှ VPN + + + + Choose a VPN service that suits your needs. + သင့်လိုအပ်ချက်များနှင့် ကိုက်ညီသော VPN ဝန်ဆောင်မှုကို ရွေးချယ်ပါ. + + PageSetupWizardConfigSource - - Server connection - ဆာဗာချိတ်ဆက်မှု - - - Do not use connection code from public sources. It may have been created to intercept your data. - -It's okay as long as it's from someone you trust. - အများသူငှာအသုံးပြုသည့် ရင်းမြစ်များမှ ချိတ်ဆက်ကုဒ်ကို မသုံးပါနှင့်.အဆိုပါကုဒ်များသည် သင့်ဒေတာကို ကြားဖြတ်ရယူရန် ဖန်တီးထားခြင်းဖြစ်နိုင်သည်. - -သင်ယုံကြည်ရတဲ့သူတစ်ယောက်ဆီမှ ရရှိတဲ့ကုဒ်ဖြစ်နေသရွေ့တော့ အဆင်ပြေပါသည်. - - - - Do not use connection codes from untrusted sources, as they may be created to intercept your data. - သင့်ဒေတာကို ကြားဖြတ်ရန် ဖန်တီးထားနိုင်သောကြောင့် မယုံကြည်ရသော ရင်းမြစ်များမှ ချိတ်ဆက်ကုဒ်များကို မသုံးပါနှင့်။ - - - - What do you have? - သင့်တွင်ဘာရှိပါသလဲ? - - - + File with connection settings ချိတ်ဆက်မှုဆက်တင်များပါဝင်သောဖိုင် - - File with connection settings or backup - ချိတ်ဆက်မှုဆက်တင်များ သို့မဟုတ် အရန်သိမ်းဆည်းထားမှုပါဝင်သောဖိုင် + + Connection + ချိတ်ဆက်မှု - + + Settings + ဆက်တင်များ + + + + Enable logs + + + + + Insert the key, add a configuration file or scan the QR-code + Key ကိုထည့်မည်၊ ဖွဲ့စည်းမှုဖိုင်တစ်ခုကိုထည့်မည် သို့မဟုတ် QR-ကုဒ်ကို စကင်န်ဖတ်မည် + + + + Insert key + Key ကိုထည့်သွင်းမည် + + + + Insert + ထည့်သွင်းမည် + + + + Continue + ဆက်လက်လုပ်ဆောင်မည် + + + + Other connection options + အခြားချိတ်ဆက်မှုရွေးချယ်စရာများ + + + + VPN by Amnezia + Amnezia မှ VPN + + + + Connect to classic paid and free VPN services from Amnezia + Amnezia မှ အခပေးနှင့် အခမဲ့ မူလ VPN ဝန်ဆောင်မှုများသို့ ချိတ်ဆက်မည် + + + + Self-hosted VPN + ကိုယ်တိုင် host လုပ်ထားသော VPN + + + + Configure Amnezia VPN on your own server + Amnezia VPN ကို သင်၏ကိုယ်ပိုင်ဆာဗာပေါ်တွင် စီစဥ်ချိန်ညှိမည် + + + + Restore from backup + အရံဖိုင်မှ ပြန်လည်ရယူမည် + + + + Open backup file + အရံဖိုင်ကို ဖွင့်မည် + + + + Backup files (*.backup) + အရံဖိုင်များ (*.backup) + + + Open config file config ဖိုင်ကိုဖွင့်မည် - + QR code QR-ကုဒ် - - Key as text - Key ကိုစာသားအဖြစ် + + I have nothing + ကျွန်ုပ်တွင်ဘာမှမရှိပါ PageSetupWizardCredentials - + Server IP address [:port] ဆာဗာ IP လိပ်စာ [:port] - + Continue ဆက်လက်လုပ်ဆောင်မည် - + Enter the address in the format 255.255.255.255:88 လိပ်စာကို 255.255.255.255:88 ဖော်မတ်ဖြင့် ထည့်ပါ - + Configure your server - သင်၏ဆာဗာကို စီစဉ်ချိန်ညှိပါ။ + သင်၏ဆာဗာကို စီစဉ်ချိန်ညှိမည် - + 255.255.255.255:22 255.255.255.255:22 - + SSH Username SSH အသုံးပြုသူအမည် - + Password or SSH private key စကားဝှက် သိုမဟုတ် SSH private key - + All data you enter will remain strictly confidential and will not be shared or disclosed to the Amnezia or any third parties သင်ထည့်သွင်းသည့်ဒေတာအားလုံးကို တင်းကြပ်လုံခြုံစွာလျှို့ဝှက်ထားမည်ဖြစ်ပြီး Amnezia သို့မဟုတ် မည်သည့်ပြင်ပအဖွဲ့အစည်းကိုမျှ မျှဝေမည် သို့မဟုတ် ထုတ်ဖော်မည်မဟုတ်ပါ - + + How to run your VPN server + သင်၏ဆာဗာကို လည်ပတ်ပုံလည်ပတ်နည်း + + + + Where to get connection data, step-by-step instructions for buying a VPS + ချိတ်ဆက်မှုဒေတာကို ဘယ်မှာရနိုင်မလဲ၊ VPS ဝယ်ယူပုံဝယ်ယူနည်းအတွက် အဆင့်ဆင့် ညွှန်ကြားချက်များ + + + Ip address cannot be empty IP လိပ်စာသည် ဗလာမဖြစ်ရပါ - + Login cannot be empty လော့ဂ်အင်အချက်အလက်သည် ဗလာမဖြစ်ရပါ - + Password/private key cannot be empty စကားဝှက်/private key သည် ဗလာမဖြစ်ရပါ @@ -2095,22 +2493,22 @@ It's okay as long as it's from someone you trust. PageSetupWizardEasy - + What is the level of internet control in your region? သင့်ဒေသရှိ အင်တာနက်ထိန်းချုပ်မှုအဆင့်က ဘယ်လောက်ရှိပါသလဲ? - + Choose a VPN protocol - VPN ပရိုတိုကောကို ရွေးပါ။ + VPN ပရိုတိုကောကို ရွေးပါ - + Skip setup - စနစ်ထည့်သွင်းမှုကို ကျော်သွားပါ။ + စနစ်ထည့်သွင်းမှုကို ကျော်မည် - + Continue ဆက်လက်လုပ်ဆောင်မည် @@ -2118,97 +2516,97 @@ It's okay as long as it's from someone you trust. PageSetupWizardInstalling - + The server has already been added to the application ဆာဗာကို အပလီကေးရှင်းတွင် ထည့်သွင်းပြီးပါပြီ - + Amnezia has detected that your server is currently Amnezia သည် သင့်ဆာဗာက - + busy installing other software. Amnezia installation အခြားဆော့ဖ်ဝဲကို ထည့်သွင်းနေသောကြောင့် အလုပ်ရှုပ်နေကြောင်းထောက်လှန်းမိပါသည်. Amnezia ထည့်သွင်းခြင်းလုပ်ငန်းစဥ် - + will pause until the server finishes installing other software ဆာဗာကို အခြားဆော့ဖ်ဝဲကို ထည့်သွင်းခြင်း မပြီးမချင်း ခေတ္တရပ်ထားပါမည် - + Installing ထည့်သွင်းနေသည် - + Cancel installation ထည့်သွင်းမှုကို ပယ်ဖျက်မည် - - + + Usually it takes no more than 5 minutes - များသောအားဖြင့် 5 မိနစ်ထက်မပိုပါ + များသောအားဖြင့် 5 မိနစ်ထက်ပိုမကြာပါ PageSetupWizardProtocolSettings - + Installing %1 - ထည့်သွင်းနေသည် %1 + %1 ကိုထည့်သွင်းနေသည် - + More detailed ပိုမိုအသေးစိတ် - + Close ပိတ်မည် - + Network protocol ကွန်ရက်ပရိုတိုကော - + Port Port - + Install ထည်သွင်းမည် - + The port must be in the range of 1 to 65535 - + Port သည် 1 မှ 65535 အတွင်း ဖြစ်ရမည် PageSetupWizardProtocols - + VPN protocol VPN ပရိုတိုကော - + Choose the one with the highest priority for you. Later, you can install other protocols and additional services, such as DNS proxy and SFTP. - သင့်အတွက် ဦးစားပေးအဖြစ်ဆုံးကို ရွေးချယ်ပါ. နောက်ပိုင်းတွင်၊ သင်သည် DNS proxy နှင့် SFTP ကဲ့သို့သော အခြားပရိုတိုကောများနှင့် ထပ်ဆောင်းဝန်ဆောင်မှုများကို ထည့်သွင်းနိုင်သည်. + သင့်အတွက် ဦးစားပေးအဖြစ်ဆုံးကို ရွေးချယ်ပါ။ နောက်ပိုင်းတွင် DNS proxy နှင့် SFTP ကဲ့သို့သော အခြားပရိုတိုကောများနှင့် ထပ်ဆောင်းဝန်ဆောင်မှုများကို ထည့်သွင်းနိုင်သည်။. PageSetupWizardQrReader - + Point the camera at the QR code and hold for a couple of seconds. ကင်မရာနှင့် QR ကုဒ်ကို ချိန်ပြီး စက္ကန့်အနည်းငယ်လောက် ငြိမ်ထားပေးပါ. @@ -2216,60 +2614,35 @@ It's okay as long as it's from someone you trust. PageSetupWizardStart - - Settings restored from backup file - ဆက်တင်များကို အရန်သိမ်းဆည်းထားသောဖိုင်မှ ပြန်လည်ရယူပြီးပါပြီ - - - - Free service for creating a personal VPN on your server. - သင့်ဆာဗာပေါ်တွင် ကိုယ်ပိုင် VPN ဖန်တီးရန်အတွက် အခမဲ့ဝန်ဆောင်မှု. - - - - Helps you access blocked content without revealing your privacy, even to VPN providers. - အခြား VPN ဝန်ဆောင်မှုများကိုပင် သင်၏ privacy ကိုမဖော်ပြဘဲ ပိတ်ဆို့ထားသော အကြောင်းအရာများကို သင်ဝင်ရောက်ကြည့်ရှုနိုင်ရန် အကူအညီပေးပါသည်. - - - - I have the data to connect - ကျွန်ုပ်တွင်ချိတ်ဆက်ဖို့အတွက်ဒေတာရှိသည် - - - - I have nothing - ကျွန်ုပ်တွင်ဘာမှမရှိပါ - - - - https://amnezia.org/instructions/0_starter-guide - https://amnezia.org/instructions/0_starter-guide + + Let's get started + စတင်လိုက်ကြရအောင် PageSetupWizardTextKey - + Connection key ချိန်ဆက်မှု key - + A line that starts with vpn://... vpn://... ဖြင့် စတင်သော စာကြောင်း... - + Key Key - + Insert ထည်သွင်းမည် - + Continue ဆက်လက်လုပ်ဆောင်မည် @@ -2277,32 +2650,32 @@ It's okay as long as it's from someone you trust. PageSetupWizardViewConfig - + New connection ချိတ်ဆက်မှုအသစ် - + Collapse content အကြောင်းအရာများကိုဖြန့်ချမည် - + Show content အကြောင်းအရာများကိုပြမည် - + Enable WireGuard obfuscation. It may be useful if WireGuard is blocked on your provider. - + WireGuard obfuscation ကိုဖွင့်ထားပါ။ အကယ်၍ သင်၏အင်တာနက်ဝန်ဆောင်မှုပေးသောကုမ္ပဏီက WireGuard ပိတ်ဆို့ထားသော် ၎င်းကိုဖွင့်ထားခြင်းအားဖြင့်အသုံးဝင်နိုင်သည်။. - + Use connection codes only from sources you trust. Codes from public sources may have been created to intercept your data. - သင်ယုံကြည်ရသော ရင်းမြစ်များမှသာ ချိတ်ဆက်ကုဒ်များကို အသုံးပြုပါ။ သင့်ဒေတာကို ကြားဖြတ်ရန် အများသူငှာ ရင်းမြစ်များမှ ကုဒ်များကို ဖန်တီးထားသည်။ + သင်ယုံကြည်ရသော ရင်းမြစ်များမှရရှိသော ချိတ်ဆက်ကုဒ်များကိုသာ အသုံးပြုပါ။ လူတိုင်းဝင်ရောက်ရယူနေနိုင်သော ရင်းမြစ်များမှကုဒ်များသည် သင့်ဒေတာကို ကြားဖြတ်ရယူရန် ဖန်တီးထားသောကုဒ်များဖြစ်နေနိုင်သည်။. - + Connect ချိတ်ဆက်မည် @@ -2310,211 +2683,207 @@ It's okay as long as it's from someone you trust. PageShare - + OpenVPN native format OpenVPN မူရင်းဖောမတ် - + WireGuard native format WireGuard မူရင်းဖော်မတ် - + Connection ချိတ်ဆက်မှု - - + + Server ဆာဗာ - + Config revoked Config ကိုပြန်ရုပ်သိမ်းလိုက်ပါပြီ - + Connection to ဤဆာဗာသို့ချိတ်ဆက်မှု - + File with connection settings to ဤဆာဗာနှင့်ချိတ်ဆက်မှု ဆက်တင်များပါရှိသော ဖိုင် - + Save OpenVPN config OpenVPN config ကိုသိမ်းဆည်းမည် - + Save WireGuard config WireGuard config ကိုသိမ်းဆည်းမည် - + Save AmneziaWG config AmneziaWG config ကိုသိမ်းဆည်းမည် - + Save Shadowsocks config Shadowsocks config ကိုသိမ်းဆည်းမည် - + Save Cloak config Cloak config ကိုသိမ်းဆည်းမည် - + Save XRay config - + XRay config ကိုသိမ်းဆည်းမည် - + For the AmneziaVPN app AmneziaVPN အက်ပ်အတွက် - + AmneziaWG native format AmneziaWG မူရင်းဖော်မတ် - + Shadowsocks native format Shadowsocks မူရင်းဖောမတ် - + Cloak native format Cloak မူရင်းဖော်မတ် - + XRay native format - + XRay မူရင်းဖော်မတ် - + Share VPN Access VPN အသုံးပြုခွင့်ကိုမျှဝေမည် - + Share full access to the server and VPN ဆာဗာနှင့် VPN သို့ အပြည့်အဝဝင်ရောက်ခွင့်ကို မျှဝေမည် - + Use for your own devices, or share with those you trust to manage the server. သင့်ကိုယ်ပိုင်စက်ပစ္စည်းများအတွက် အသုံးပြုရန် သို့မဟုတ် ဆာဗာကို စီမံခန့်ခွဲရန် သင်ယုံကြည်ရသူများနှင့် မျှဝေရန်. - - + + Users အသုံးပြုသူများ - + User name အသုံးပြုသူနာမည် - + Search ရှာဖွေမည် - + Creation date: %1 - + ဖန်တီးပြုလုပ်သည့်ရက်စွဲ: %1 - + Latest handshake: %1 - + နောက်ဆုံး handshake လုပ်ခြင်း: %1 - + Data received: %1 - + လက်ခံရရှိသည့်ဒေတာ: %1 - + Data sent: %1 - + ပေးပို့လိုက်သည့်ဒေတာ: %1 - Creation date: - ဖန်တီးပြုလုပ်သည့်ရက်စွဲ: - - - + Rename အမည်ပြောင်းမည် - + Client name ကလိုင်းရင့်အမည် - + Save သိမ်းဆည်းမည် - + Revoke ပြန်ရုပ်သိမ်းမည် - + Revoke the config for a user - %1? အသုံးပြုသူ %1 အတွက် config ကို ပြန်လည်ရုပ်သိမ်းမည်လား? - + The user will no longer be able to connect to your server. ဤအသုံးပြုသူသည် သင့်ဆာဗာသို့ ချိတ်ဆက်နိုင်တော့မည်မဟုတ်ပါ. - + Continue ဆက်လက်လုပ်ဆောင်မည် - + Cancel ပယ်ဖျက်မည် - + Share VPN access without the ability to manage the server ဆာဗာကို စီမံခန့်ခွဲနိုင်စွမ်းမပါရှိဘဲ VPN အသုံးပြုခွင့်ကို မျှဝေမည် - - + + Protocol ပရိုတိုကော - - + + Connection format ချိတ်ဆက်မှုဖောမတ် - - + + Share မျှဝေမည် @@ -2522,50 +2891,55 @@ It's okay as long as it's from someone you trust. PageShareFullAccess - + Full access to the server and VPN ဆာဗာနှင့် VPN ကို အပြည့်အဝဝင်ရောက်ခွင့် - + We recommend that you use full access to the server only for your own additional devices. သင့်ကိုယ်ပိုင်အပိုပစ္စည်းများအတွက်သာ ဆာဗာသို့ အပြည့်အဝဝင်ရောက်ခွင့်ကို အသုံးပြုရန် ကျွန်ုပ်တို့ အကြံပြုပါသည်. - + If you share full access with other people, they can remove and add protocols and services to the server, which will cause the VPN to work incorrectly for all users. သင်သည် အခြားသူများနှင့် အပြည့်အဝဝင်ရောက်ခွင့်ကို မျှဝေပါက၊ ၎င်းတို့သည် ပရိုတိုကောများနှင့် ဝန်ဆောင်မှုများကို ဆာဗာသို့ထည့်သွင်းခြင်း ဆာဗာမှဖယ်ရှားခြင်းများ ပြုလုပ်နိုင်သောကြောင့် အသုံးပြုသူများအားလုံးအတွက် VPN မှားယွင်းစွာ လုပ်ဆောင်ခြင်းများဖြစ်စေနိုင်ပါသည်. - + Server ဆာဗာ - + Accessing ဝင်ရောက်နေသည် - + File with accessing settings to ဤဆာဗာနှင့်ဝင်ရောက်နိုင်မှု ဆက်တင်များပါရှိသော ဖိုင် - + Share မျှဝေမည် - + + Access error! + အသုံးပြုခွင့်တွင်အမှားပါနေပါသည်! + + + Connection to ဤဆာဗာသို့ချိတ်ဆက်မှု - + File with connection settings to ဤဆာဗာနှင့်ချိတ်ဆက်မှု ဆက်တင်များပါရှိသော ဖိုင် @@ -2573,15 +2947,25 @@ It's okay as long as it's from someone you trust. PageStart - + Logging was disabled after 14 days, log files were deleted + ၁၄ ရက်အကြာတွင် Logging ကို ပိတ်ခဲ့သည်၊ မှတ်တမ်းဖိုင်များကို ဖျက်ပစ်လိုက်ပြီဖြစ်သည် + + + + Settings restored from backup file + ဆက်တင်များကို အရံဖိုင်မှ ပြန်လည်ရယူပြီးပါပြီ + + + + Logging is enabled. Note that logs will be automaticallydisabled after 14 days, and all log files will be deleted. PopupType - + Close ပိတ်မည် @@ -2615,12 +2999,12 @@ It's okay as long as it's from someone you trust. စကားဝှက်ကို ရှာမတွေ့ပါ - + Could not open keystore keystore ကို ဖွင့်၍မရပါ - + Could not remove private key from keystore Key store မှ ကိုယ်ပိုင် key ကို ဖယ်ရှား၍မရပါ @@ -2796,27 +3180,27 @@ It's okay as long as it's from someone you trust. keystore ကို ဖွင့်၍မရပါ - + Could not create private key generator ကိုယ်ပိုင် key ဖန်တီးမှုစက်ကိုမဖန်တီးနိုင်ပါ - + Could not generate new private key ကိုယ်ပိုင် key အသစ် မထုတ်ပေးနိုင်ပါ - + Could not retrieve private key from keystore Key store မှ ကိုယ်ပိုင် key ကို ထုတ်ယူ၍မရပါ - + Could not create encryption cipher ကုတ်ဝှက်ဖြည်ခြင်းဖန်တီး၍မရပါ - + Could not encrypt data ဒေတာကို ကုတ်ဝှက်၍မရပါ @@ -2899,58 +3283,6 @@ It's okay as long as it's from someone you trust. Timeout connecting to server ဆာဗာသို့ ချိတ်ဆက်ခြင်း အချိန်ကုန်သွားသည် - - Sftp error: End-of-file encountered - Sftp မှားယွင်းမှု: ဖိုင်အဆုံးသတ်ကို ကြုံတွေ့ခဲ့ရသည် - - - Sftp error: File does not exist - Sftp မှားယွင်းမှု: ဖိုင်မရှိပါ - - - Sftp error: Permission denied - Sftp မှားယွင်းမှု: ခွင့်ပြုချက် ငြင်းဆိုခံလိုက်ရပါသည် - - - Sftp error: Generic failure - Sftp မှားယွင်းမှု: ယေဘုယ မအောင်မြင်ခြင်း - - - Sftp error: Garbage received from server - မှားယွင်းမှု: ဆာဗာမှ အမှိုက်များကို လက်ခံရရှိခဲ့သည် - - - Sftp error: No connection has been set up - Sftp မှားယွင်းမှု: ချိတ်ဆက်မှု မသတ်မှတ်ရသေးပါ - - - Sftp error: There was a connection, but we lost it - Sftp မှားယွင်းမှု: ချိတ်ဆက်မှုတစ်ခုရှိခဲ့သော်လည်း ဆုံးရှုံးသွားခဲ့ပါသည် - - - Sftp error: Operation not supported by libssh yet - Sftp အမှား: လုပ်ဆောင်ချက်ကို libssh မှ မထောက်ပံ့သေးပါ - - - Sftp error: Invalid file handle - Sftp မှားယွင်းမှု: ဖိုင်ကိုင်တွယ်မှု မမှန်ကန်ပါ - - - Sftp error: No such file or directory path exists - Sftp မှားယွင်းမှု: ဤဖိုင်အမျိုးအစား သို့မဟုတ် လမ်းညွှန်လမ်းကြောင်းမျိုး မရှိပါ - - - Sftp error: An attempt to create an already existing file or directory has been made - Sftp မှားယွင်းမှု: ရှိပြီးသား ဖိုင် သို့မဟုတ် လမ်းညွှန်ကို ဖန်တီးရန် ကြိုးပမ်းမှုတစ်ခု ပြုလုပ်ပြီးဖြစ်သည် - - - Sftp error: Write-protected filesystem - Sftp မှားယွင်းမှု: ရေးသားခြင်းမှကာကွယ်ထားသော ဖိုင်စနစ် - - - Sftp error: No media was in remote drive - Sftp မှားယွင်းမှု: မီဒီယာသည် အဝေးမှ drive ထဲတွင် မရှိခဲ့ပါ - The config does not contain any containers and credentials for connecting to the server @@ -2967,7 +3299,7 @@ It's okay as long as it's from someone you trust. ဤ config ကို အပလီကေးရှင်းထဲသို့ ထည့်သွင်းပြီးဖြစ်သည် - + ErrorCode: %1. မှားယွင်းမှုကုတ်: %1. @@ -2979,17 +3311,17 @@ It's okay as long as it's from someone you trust. Background service is not running - + နောက်ခံဝန်ဆောင်မှု လည်ပတ်နေခြင်းမရှိပါ Server error: Packet manager error - + ဆာဗာ မှားယွင်းမှု: Packet Manager မှားယွင်းမှု SCP error: Generic failure - + SCP မှားယွင်းမှု: ယေဘုယ မအောင်မြင်ခြင်း @@ -3044,50 +3376,55 @@ It's okay as long as it's from someone you trust. In the response from the server, an empty config was received - + ဆာဗာမှ တုံ့ပြန်မှုတွင်၊ config အလွတ်တစ်ခုကို လက်ခံရရှိခဲ့သည် SSL error occurred - + SSL မှားယွင်းမှုဖြစ်သွားသည် Server response timeout on api request - + Api တောင်းဆိုမှုတွင် ဆာဗာတုံ့ပြန်မှု အချိန်ကုန်သွားသည် - - QFile error: The file could not be opened - + + Missing AGW public key + AGW public key ပျောက်ဆုံးနေသည် - QFile error: An error occurred when reading from the file - + QFile error: The file could not be opened + QFile မှားယွင်းမှု: ဖိုင်ကို ဖွင့်၍မရပါ - QFile error: The file could not be accessed - + QFile error: An error occurred when reading from the file + QFile မှားယွင်းမှု: ဖိုင်ကိုဖတ်နေစဥ်အတွင်း မှားယွင်းမှုဖြစ်သွားသည် - QFile error: An unspecified error occurred - + QFile error: The file could not be accessed + QFile မှားယွင်းမှု: ဖိုင်ကို ဝင်၍မရပါ - QFile error: A fatal error occurred - + QFile error: An unspecified error occurred + QFile မှားယွင်းမှု: သတ်မှတ်မထားသော မှားယွင်းမှုတစ်ခု ဖြစ်ပွားခဲ့သည် - QFile error: The operation was aborted - + QFile error: A fatal error occurred + QFile မှားယွင်းမှု: ကြီးမားသော မှားယွင်းမှုတစ်ခု ဖြစ်ပွားခဲ့သည် - + + QFile error: The operation was aborted + QFile မှားယွင်းမှု: လုပ်ငန်းစဥ်ကို ဖျက်သိမ်းလိုက်ရသည် + + + Internal error စက်တွင်းဖြစ်သော မှားယွင်းမှု @@ -3109,12 +3446,12 @@ It's okay as long as it's from someone you trust. XRay with REALITY - Suitable for countries with the highest level of internet censorship. Traffic masking as web traffic at the TLS level, and protection against detection by active probing methods. - + REALITY ပါဝင်သော XRay - အင်တာနက်ဆင်ဆာဖြတ်တောက်မှုအပြင်းထန်ဆုံးနိုင်ငံများအတွက် သင့်လျော်သည်။ Web traffic အဖြစ် အသွားအလာကို TLS အဆင့်ဖြင့် ဖုံးကွယ်ပေးထားခြင်း၊ Active probing နည်းလမ်းများဖြင့် ထောက်လှမ်းခံရခြင်းမှ ကာကွယ်ပေးခြင်းများ။. IKEv2/IPsec - Modern stable protocol, a bit faster than others, restores connection after signal loss. It has native support on the latest versions of Android and iOS. - + IKEv2/IPsec - ခေတ်မီပြီးတည်ငြိမ်သော ပရိုတိုကော၊ အခြားပရိုတိုကောများထက် အနည်းငယ်ပိုမြန်သည်၊ Signal ဆုံးရှုံးပြီးနောက် ချိတ်ဆက်မှုကို ပြန်လည်ရယူနိုင်သည်။ Android နှင့် iOS ၏ နောက်ဆုံးဗားရှင်းများတွင် native ပံ့ပိုးမှုရရှိသည်။. @@ -3187,7 +3524,10 @@ WireGuard သည် ၎င်း၏ ကွဲပြားသော packet လက It uniquely identifies censors during the TLS handshake phase, seamlessly operating as a proxy for legitimate clients while diverting censors to genuine websites like google.com, thus presenting an authentic TLS certificate and data. This advanced capability differentiates REALITY from similar technologies by its ability to disguise web traffic as coming from random, legitimate sites without the need for specific configurations. Unlike older protocols such as VMess, VLESS, and the XTLS-Vision transport, REALITY's innovative "friend or foe" recognition at the TLS handshake enhances security and circumvents detection by sophisticated DPI systems employing active probing techniques. This makes REALITY a robust solution for maintaining internet freedom in environments with stringent censorship. - + The REALITY protocol, a pioneering development by the creators of XRay, is specifically designed to counteract the highest levels of internet censorship through its novel approach to evasion. +It uniquely identifies censors during the TLS handshake phase, seamlessly operating as a proxy for legitimate clients while diverting censors to genuine websites like google.com, thus presenting an authentic TLS certificate and data. +This advanced capability differentiates REALITY from similar technologies by its ability to disguise web traffic as coming from random, legitimate sites without the need for specific configurations. +Unlike older protocols such as VMess, VLESS, and the XTLS-Vision transport, REALITY's innovative "friend or foe" recognition at the TLS handshake enhances security and circumvents detection by sophisticated DPI systems employing active probing techniques. This makes REALITY a robust solution for maintaining internet freedom in environments with stringent censorship. @@ -3246,10 +3586,6 @@ IKEv2 သည် လုံခြုံရေး၊ တည်ငြိမ်မှ AmneziaWG - Special protocol from Amnezia, based on WireGuard. It's fast like WireGuard, but very resistant to blockages. Recommended for regions with high levels of censorship. AmneziaWG - WireGuard ကိုအခြေခံထားသော Amnezia မှ အထူးပရိုတိုကော. ၎င်းသည် WireGuard ကဲ့သို့မြန်ဆန်သော်ပြီး ပိတ်ဆို့ခြင်းများကိုလည်း ခံနိုင်ရည်ရှိပါသည်. ဆင်ဆာဖြတ်တောက်မှု မြင့်မားသော ဒေသများတွင်အသုံးပြုရန် အကြံပြုပါသည်. - - IKEv2/IPsec - Modern stable protocol, a bit faster than others, restores connection after signal loss. - IKEv2/IPsec - ခေတ်မီတည်ငြိမ်သောပရိုတိုကော၊ အခြားအရာများထက်အနည်းငယ်ပိုမြန်သည်၊ signal ပျောက်ဆုံးပြီးနောက် ချိတ်ဆက်မှုကို ပြန်လည်ရယူပေးသည်. - Deploy a WordPress site on the Tor network in two clicks. @@ -3344,7 +3680,7 @@ For more detailed information, you can SOCKS5 proxy server - + SOCKS5 proxy ဆာဗာ @@ -3404,139 +3740,139 @@ For more detailed information, you can vmess:// url is invalid - + vmess:// url သည် မမှန်ကန်ပါ Invalid streamSettings protocol: - + မမှန်ကန်သော streamSettings ပရိုတိုကော: Unknown transport method: - + အမည်မသိ သယ်ယူပို့ဆောင်ရေးနည်းလမ်း: VMess string should start with 'vmess://' - + VMess စာကြောင်းသည် 'vmess://' ဖြင့် စတင်သည် VMess string should be a valid base64 string - + VMess စာကြောင်း သည် မှန်ကန်သော base64 စာကြောင်း ဖြစ်ရမည် JSON should not be empty - + JSON သည် ဗလာမဖြစ်ရပါ VLESS link should start with vless:// - + VLESS စာကြောင်းသည် 'vless://' ဖြင့် စတင်သည် link parse failed: %1 - + လင့်ခ်ခွဲခြမ်းစိတ်ဖြာမှု မအောင်မြင်ပါ: %1 empty host - + Host ဗလာဖြစ်နေသည် missing port - + Port ပျောက်ဆုံးနေသည် missing uuid - + uuid ပျောက်ဆုံးနေသည် Invalid ssd link: json: field %1 must exist - + မမှန်ကန်သော ssd လင့်ခ်: json: အကွက် %1 ရှိရပါမည် Invalid ssd link: json: field %1 must be valid port number - + မမှန်ကန်သော ssd လင့်ခ်: json: အကွက် %1 သည် မှန်ကန်သော port နံပါတ် ဖြစ်ရပါမည် Invalid ssd link: json: field %1 must be of type 'string' - + မမှန်ကန်သော ssd လင့်ခ်: json: အကွက် %1 သည် 'စာကြောင်း' အမျိုးအစား ဖြစ်ရမည် Invalid ssd link: json: field %1 must be an array - + မမှန်ကန်သော ssd လင့်ခ်: json: အကွက် %1 သည် array တစ်ခု ဖြစ်ရမည် Skipping invalid ssd server: server must be an object - + မမှန်ကန်သော ssd ဆာဗာကို ကျော်သွားသည်: ဆာဗာသည် object တစ်ခု ဖြစ်ရပါမည် Skipping invalid ssd server: missing required field %1 - + မမှန်ကန်သော ssd ဆာဗာကို ကျော်သွားသည်: လိုအပ်သောအကွက် %1 ပျောက်ဆုံးနေပါသည် Skipping invalid ssd server: field %1 should be of type 'string' - + မမှန်ကန်သော ssd ဆာဗာကို ကျော်သွားသည်: အကွက် %1 သည် 'စာကြောင်း' အမျိုးအစား ဖြစ်ရမည် Invalid ssd link: should begin with ssd:// - + မမှန်ကန်သော ssd လင့်ခ်: ssd:// ဖြင့် စတင်ရမည် Invalid ssd link: base64 parse failed - + မမှန်ကန်သော ssd လင့်ခ်: base64 ခွဲခြမ်းစိတ်ဖြာမှု မအောင်မြင်ပါ Invalid ssd link: json parse failed - + မမှန်ကန်သော ssd လင့်ခ်: json ခွဲခြမ်းစိတ်ဖြာမှု မအောင်မြင်ပါ Invalid ssd link: rc4-md5 encryption is not supported by v2ray-core - + မမှန်ကန်သော ssd လင့်ခ်: rc4-md5 ကုဒ်ဝှက်ခြင်းကို v2ray-core က မပံ့ပိုးပေးပါ SS URI is too short - + SS URI တိုလွန်းသည် Can't find the colon separator between method and password - + Method နှင့် စကားဝှက်ကြားရှိ colon seperator ကို ရှာမတွေ့ပါ Can't find the at separator between password and hostname - + စကားဝှက်နှင့် hostname ကြား at seperator ကို ရှာမတွေ့ပါ Can't find the colon separator between hostname and port - + Hostname နှင့် port ကြားရှိ colon separator ကို ရှာမတွေ့ပါ SelectLanguageDrawer - + Choose language ဘာသာစကားကို ရွေးချယ်ပါ @@ -3544,13 +3880,13 @@ For more detailed information, you can Settings - + Server #1 ဆာဗာ #1 - - + + Server ဆာဗာ @@ -3558,56 +3894,52 @@ For more detailed information, you can SettingsController - + All settings have been reset to default values ဆက်တင်အားလုံးကို မူရင်းတန်ဖိုးများအဖြစ် ပြန်လည်သတ်မှတ်ထားသည် - Cached profiles cleared - ကက်ရှ်ပရိုဖိုင်များကို ရှင်းလင်းပြီးပါပြီ - - - + Backup file is corrupted - အရန်သိမ်းထားသည့်ဖိုင်ပျက်ဆီးနေသည် + အရံဖိုင်ပျက်ဆီးနေသည် ShareConnectionDrawer - - + + Save AmneziaVPN config AmneziaWG config ကိုသိမ်းဆည်းမည် - + Share မျှဝေမည် - + Copy ကူးယူမည် - - + + Copied ကူးယူပြီးပါပြီ - + Copy config string config string ကိုကူးယူမည် - + Show connection settings ချိတ်ဆက်မှုဆက်တင်များကို ပြပါ - + To read the QR code in the Amnezia app, select "Add server" → "I have data to connect" → "QR code, key or settings file" Amnezia အက်ပ်ရှိ QR ကုဒ်ကိုဖတ်ရန်အတွက်အောက်ပါအတိုင်း ရွေးချယ်ပါ "ဆာဗာထည့်ရန်" → "ချိတ်ဆက်ရန် ဒေတာရှိသည်" → "QR ကုဒ်၊ key သို့မဟုတ် ဆက်တင်ဖိုင်" @@ -3691,7 +4023,7 @@ For more detailed information, you can TextFieldWithHeaderType - + The field can't be empty ဖြည့်သွင်းရမည့်နေရာသည် အလွတ်မဖြစ်ရပါ @@ -3699,7 +4031,7 @@ For more detailed information, you can VpnConnection - + Mbps Mbps @@ -3750,43 +4082,35 @@ For more detailed information, you can amnezia::ContainerProps - + Low Low - + High - Medium သို့မဟုတ် High + High - Extreme - Extreme - - - + I just want to increase the level of my privacy. ကျွန်ုပ်၏ကိုယ်ရေးကိုယ်တာလုံခြုံမှုအဆင့်ကို မြှင့်တင်လိုပါသည်. - + I want to bypass censorship. This option recommended in most cases. ဆင်ဆာဖြတ်တောက်ခြင်းကို ကျော်ဖြတ်ချင်ပါသည်. ဤရွေးချယ်မှုကို ကိစ္စအများစုအတွက် အကြံပြုထားသည်. - - Most VPN protocols are blocked. Recommended if other options are not working. - VPN ပရိုတိုကောအများစုကို ပိတ်ဆို့ထားသည်. အခြားရွေးချယ်စရာများ အလုပ်မလုပ်ပါက အသုံးပြုရန်အကြံပြုထားသည်. - main2 - + Private key passphrase ကိုယ်ပိုင် key စကားဝှက် - + Save သိမ်းဆည်းမည် diff --git a/client/translations/amneziavpn_ru_RU.ts b/client/translations/amneziavpn_ru_RU.ts index e7462ac4..2fb21259 100644 --- a/client/translations/amneziavpn_ru_RU.ts +++ b/client/translations/amneziavpn_ru_RU.ts @@ -1,6 +1,59 @@ + + ApiServicesModel + + + Classic VPN for comfortable work, downloading large files and watching videos. Works for any sites. Speed up to %1 MBit/s + Классический VPN для комфортной работы, загрузки больших файлов и просмотра видео. Работает для любых сайтов. Скорость до %1 Мбит/с + + + + VPN to access blocked sites in regions with high levels of Internet censorship. + VPN для доступа к заблокированным сайтам в регионах с высоким уровнем интернет-цензуры. + + + + <p><a style="color: #EB5757;">Not available in your region. If you have VPN enabled, disable it, return to the previous screen, and try again.</a> + + + + + Amnezia Premium - A classic VPN for comfortable work, downloading large files, and watching videos in high resolution. It works for all websites, even in countries with the highest level of internet censorship. + Amnezia Premium — классический VPN для комфортной работы, загрузки больших файлов и просмотра видео в высоком разрешении. Работает на всех сайтах, даже в странах с самым высоким уровнем интернет-цензуры. + + + + Amnezia Free is a free VPN to bypass blocking in countries with high levels of internet censorship + Amnezia Free - это бесплатный VPN для обхода блокировок в странах с высоким уровнем интернет-цензуры + + + + %1 MBit/s + + + + + %1 days + %1 дней + + + + VPN will open only popular sites blocked in your region, such as Instagram, Facebook, Twitter and others. Other sites will be opened from your real IP address, <a href="%1/free" style="color: #FBB26A;">more details on the website.</a> + Через VPN будут открываться только популярные сайты, заблокированные в вашем регионе, такие как Instagram, Facebook, Twitter и другие. Остальные сайты будут открываться с вашего реального IP-адреса, <a href="%1/free" style="color: #FBB26A;">подробности на сайте.</a> + + + + Free + Бесплатно + + + + %1 $/month + %1 $/месяц + + AppSplitTunnelingController @@ -27,7 +80,7 @@ ConnectButton - + Unable to disconnect during configuration preparation Невозможно отключиться во время подготовки конфигурации @@ -35,62 +88,62 @@ ConnectionController - + VPN Protocols is not installed. Please install VPN container at first VPN-протоколы не установлены. Пожалуйста, установите протокол - + Connecting... Подключение... - + Connected Подключено - + Preparing... Подготовка... - + Settings updated successfully, reconnnection... Настройки успешно обновлены, переподключение... - + Settings updated successfully Настройки успешно обновлены - + The selected protocol is not supported on the current platform Выбранный протокол не поддерживается на данном устройстве - + unable to create configuration не удалось создать конфигурацию - + Reconnecting... Переподключение... - - - + + + Connect Подключиться - + Disconnecting... Отключение... @@ -131,7 +184,7 @@ Вставить - + &SelectAll Выбрать всё @@ -139,9 +192,8 @@ ExportController - Access error! - Ошибка доступа! + Ошибка доступа! @@ -211,18 +263,18 @@ Can't be disabled for current server Невозможно открыть файл - - + + Invalid configuration file Неверный файл конфигурации - + Scanned %1 of %2. Отсканировано %1 из %2. - + In the imported configuration, potentially dangerous lines were found: В импортированной конфигурации были обнаружены потенциально опасные строки: @@ -230,84 +282,104 @@ Can't be disabled for current server InstallController - + %1 installed successfully. %1 успешно установлен. - + %1 is already installed on the server. %1 уже установлен на сервер. - + Added containers that were already installed on the server Добавлены сервисы и протоколы, которые были ранее установлены на сервер - + Already installed containers were found on the server. All installed containers have been added to the application На сервере обнаружены установленные протоколы и сервисы. Все они были добавлены в приложение - + Settings updated successfully Настройки успешно обновлены - + Server '%1' was rebooted Сервер '%1' был перезагружен - + Server '%1' was removed Сервер '%1' был удален - + All containers from server '%1' have been removed Все протоколы и сервисы были удалены с сервера '%1' - + %1 has been removed from the server '%2' %1 был удален с сервера '%2' - + + Api config removed + Конфигурация API удалена + + + %1 cached profile cleared %1 закэшированный профиль очищен - + Please login as the user Пожалуйста, войдите в систему от имени пользователя - + Server added successfully Сервер успешно добавлен + + + %1 installed successfully. + %1 успешно установлен. + + + + API config reloaded + Конфигурация API перезагружена + + + + Successfully changed the country of connection to %1 + Изменение страны подключения на %1 + InstalledAppsDrawer - + Choose application Выберите приложение - + application name название приложения - + Add selected Добавить выбранные @@ -362,65 +434,130 @@ Already installed containers were found on the server. All installed containers PageDeinstalling - + Removing services from %1 Удаление сервисов c %1 - + Usually it takes no more than 5 minutes Обычно это занимает не более 5 минут + + PageDevMenu + + + Gateway endpoint + + + + + Dev gateway environment + + + PageHome - + Logging enabled Логирование включено - + Split tunneling enabled Раздельное туннелирование включено - + Split tunneling disabled Раздельное туннелирование выключено - + VPN protocol VPN-протокол - + Servers Серверы - + Unable change server while there is an active connection Невозможно изменить сервер во время активного соединения + + PageProtocolAwgClientSettings + + + AmneziaWG settings + Настройки AmneziaWG + + + + MTU + MTU + + + + Server settings + + + + + Port + Порт + + + + Save + Сохранить + + + + Save settings? + Сохранить настройки? + + + + Only the settings for this device will be changed + + + + + Continue + Продолжить + + + + Cancel + Отменить + + + + Unable change settings while there is an active connection + Невозможно изменить настройки во время активного соединения + + PageProtocolAwgSettings - + AmneziaWG settings Настройки AmneziaWG - + Port Порт - MTU - MTU + MTU Remove AmneziaWG @@ -431,42 +568,87 @@ Already installed containers were found on the server. All installed containers Удалить AmneziaWG с сервера? - + All users with whom you shared a connection with will no longer be able to connect to it. Все пользователи, с которыми вы поделились конфигурацией вашего VPN, больше не смогут к нему подключаться. - + Save Сохранить - + + Jc - Junk packet count + + + + + Jmin - Junk packet minimum size + + + + + Jmax - Junk packet maximum size + + + + + S1 - Init packet junk size + + + + + S2 - Response packet junk size + + + + + H1 - Init packet magic header + + + + + H2 - Response packet magic header + + + + + H4 - Transport packet magic header + + + + + H3 - Underload packet magic header + + + + The values of the H1-H4 fields must be unique Значения в полях H1-H4 должны быть уникальными - + The value of the field S1 + message initiation size (148) must not equal S2 + message response size (92) Значение в поле S1 + размер инициации сообщения (148) не должно равняться значению в поле S2 + размер ответа на сообщение (92) - + Save settings? Сохранить настройки? - + Continue Продолжить - + Cancel Отменить - + Unable change settings while there is an active connection Невозможно изменить настройки во время активного соединения @@ -474,33 +656,33 @@ Already installed containers were found on the server. All installed containers PageProtocolCloakSettings - + Cloak settings Настройки Cloak - + Disguised as traffic from Замаскировать трафик под - + Port Порт - + Cipher Шифрование - + Save Сохранить - + Unable change settings while there is an active connection Невозможно изменить настройки во время активного соединения @@ -508,170 +690,170 @@ Already installed containers were found on the server. All installed containers PageProtocolOpenVpnSettings - + OpenVPN settings Настройки OpenVPN - + VPN address subnet Подсеть VPN-адресов - + Network protocol Сетевой протокол - + Port Порт - + Auto-negotiate encryption Шифрование с автоматическим согласованием - + Hash Хэш - + SHA512 SHA512 - + SHA384 SHA384 - + SHA256 SHA256 - + SHA3-512 SHA3-512 - + SHA3-384 SHA3-384 - + SHA3-256 SHA3-256 - + whirlpool whirlpool - + BLAKE2b512 BLAKE2b512 - + BLAKE2s256 BLAKE2s256 - + SHA1 SHA1 - + Cipher Шифрование - + AES-256-GCM AES-256-GCM - + AES-192-GCM AES-192-GCM - + AES-128-GCM AES-128-GCM - + AES-256-CBC AES-256-CBC - + AES-192-CBC AES-192-CBC - + AES-128-CBC AES-128-CBC - + ChaCha20-Poly1305 ChaCha20-Poly1305 - + ARIA-256-CBC ARIA-256-CBC - + CAMELLIA-256-CBC CAMELLIA-256-CBC - + none none - + TLS auth TLS авторизация - + Block DNS requests outside of VPN Блокировать DNS-запросы за пределами VPN - + Additional client configuration commands Дополнительные команды конфигурации клиента - - + + Commands: Команды: - + Additional server configuration commands Дополнительные команды конфигурации сервера - + Unable change settings while there is an active connection Невозможно изменить настройки во время активного соединения @@ -696,7 +878,7 @@ Already installed containers were found on the server. All installed containers Отменить - + Save Сохранить @@ -704,32 +886,32 @@ Already installed containers were found on the server. All installed containers PageProtocolRaw - + settings настройки - + Show connection options Показать параметры подключения - + Connection options %1 Параметры подключения %1 - + Remove Удалить - + Remove %1 from server? Удалить %1 с сервера? - + All users with whom you shared a connection with will no longer be able to connect to it. Все пользователи, с которыми вы поделились конфигурацией вашего VPN, больше не смогут к нему подключаться. @@ -738,12 +920,12 @@ Already installed containers were found on the server. All installed containers Все пользователи, с которыми вы поделились этим VPN-протоколом, больше не смогут к нему подключаться. - + Continue Продолжить - + Cancel Отменить @@ -751,51 +933,113 @@ Already installed containers were found on the server. All installed containers PageProtocolShadowSocksSettings - + Shadowsocks settings Настройки Shadowsocks - + Port Порт - + Cipher Шифрование - + Save Сохранить - + Unable change settings while there is an active connection Невозможно изменить настройки во время активного соединения + + PageProtocolWireGuardClientSettings + + + WG settings + Настройки WG + + + + MTU + MTU + + + + Server settings + + + + + Port + Порт + + + + Save + Сохранить + + + + Save settings? + Сохранить настройки? + + + + Only the settings for this device will be changed + + + + + Continue + Продолжить + + + + Cancel + Отменить + + + + Unable change settings while there is an active connection + Невозможно изменить настройки во время активного соединения + + PageProtocolWireGuardSettings - + WG settings Настройки WG - + Port Порт - - MTU - MTU + + Save settings? + Сохранить настройки? - + + All users with whom you shared a connection with will no longer be able to connect to it. + Все пользователи, с которыми вы поделились конфигурацией вашего VPN, больше не смогут к нему подключаться. + + + MTU + MTU + + + Unable change settings while there is an active connection Невозможно изменить настройки во время активного соединения @@ -812,15 +1056,17 @@ Already installed containers were found on the server. All installed containers Все пользователи, с которыми вы поделились конфигурацией вашего VPN, больше не смогут к нему подключаться. + Continue - Продолжить + Продолжить + Cancel - Отменить + Отменить - + Save Сохранить @@ -828,22 +1074,22 @@ Already installed containers were found on the server. All installed containers PageProtocolXraySettings - + XRay settings Настройки XRay - + Disguised as traffic from Замаскировать трафик под - + Save Сохранить - + Unable change settings while there is an active connection Невозможно изменить настройки во время активного соединения @@ -858,39 +1104,39 @@ Already installed containers were found on the server. All installed containers PageServiceDnsSettings - + A DNS service is installed on your server, and it is only accessible via VPN. На вашем сервере установлен DNS-сервис, доступ к нему возможен только через VPN. - + The DNS address is the same as the address of your server. You can configure DNS in the settings, under the connections tab. Адрес DNS совпадает с адресом вашего сервера. Настроить DNS можно во вкладке "Соединение" настроек приложения. - + Remove Удалить - + Remove %1 from server? Удалить %1 с сервера? - + Continue Продолжить - + Cancel Отменить - + Cannot remove AmneziaDNS from running server Невозможно удалить AmneziaDNS с работающего сервера @@ -898,157 +1144,153 @@ Already installed containers were found on the server. All installed containers PageServiceSftpSettings - + Settings updated successfully Настройки успешно обновлены - + SFTP settings Настройки SFTP - + Host Хост - - - - + + + + Copied Скопировано - + Port Порт - + User name Имя пользователя - + Password Пароль - + Mount folder on device Смонтировать папку на устройстве - + In order to mount remote SFTP folder as local drive, perform following steps: <br> Чтобы смонтировать SFTP-папку как локальный диск, выполните следующие действия: <br> - - + + <br>1. Install the latest version of <br>1. Установите последнюю версию - - + + <br>2. Install the latest version of <br>2. Установите последнюю версию - + Detailed instructions Подробные инструкции - Remove SFTP and all data stored there - Удалить SFTP-хранилище со всеми данными + Удалить SFTP-хранилище со всеми данными - Remove SFTP and all data stored there? - Удалить SFTP-хранилище и все хранящиеся там данные? + Удалить SFTP-хранилище и все хранящиеся там данные? - Continue - Продолжить + Продолжить - Cancel - Отменить + Отменить PageServiceSocksProxySettings - + Settings updated successfully Настройки успешно обновлены - - + + SOCKS5 settings Настройки SOCKS5 - + Host Хост - - - - + + + + Copied Скопировано - - + + Port Порт - + User name Имя пользователя - - + + Password Пароль - + Username Имя пользователя - - + + Change connection settings Изменить настройки соединения - + The port must be in the range of 1 to 65535 Порт должен быть в диапазоне от 1 до 65535 - + Password cannot be empty Пароль не может быть пустым - + Username cannot be empty Имя пользователя не может быть пустым @@ -1056,95 +1298,96 @@ Already installed containers were found on the server. All installed containers PageServiceTorWebsiteSettings - + Settings updated successfully Настройки успешно обновлены - + Tor website settings Настройки сайта в сети Тоr - + Website address Адрес сайта - + Copied Скопировано - + Use <a href="https://www.torproject.org/download/" style="color: #FBB26A;">Tor Browser</a> to open this URL. Используйте <a href="https://www.torproject.org/download/" style="color: #FBB26A;">Tor Browser</a> для открытия этой ссылки. - + After creating your onion site, it takes a few minutes for the Tor network to make it available for use. Через несколько минут после установки ваш onion-сайт станет доступен в сети Tor. - + When configuring WordPress set the this onion address as domain. При настройке WordPress укажите этот onion-адрес в качестве домена. - Remove website - Удалить сайт + Удалить сайт - The site with all data will be removed from the tor network. - Сайт со всеми данными будет удален из сети Tor. + Сайт со всеми данными будет удален из сети Tor. - Continue - Продолжить + Продолжить - Cancel - Отменить + Отменить PageSettings - + Settings Настройки - + Servers Серверы - + Connection Соединение - + Application Приложение - + Backup Резервное копирование - + About AmneziaVPN Об AmneziaVPN + Dev console + + + + Close application Закрыть приложение @@ -1152,7 +1395,7 @@ Already installed containers were found on the server. All installed containers PageSettingsAbout - + Support Amnezia Поддержите Amnezia @@ -1161,130 +1404,213 @@ Already installed containers were found on the server. All installed containers Показать другие способы на GitHub - + Amnezia is a free and open-source application. You can support the developers if you like it. Amnezia — это бесплатное приложение с открытым исходным кодом. Поддержите разработчиков, если оно вам нравится. - + Contacts Контакты - + Telegram group Группа в Telegram - + To discuss features Для обсуждения возможностей - + https://t.me/amnezia_vpn_en https://t.me/amnezia_vpn - - Mail - Почта + + support@amnezia.org + - + Mail + Почта + + + For reviews and bug reports Для отзывов и сообщений об ошибках - + + Copied + Скопировано + + + GitHub GitHub - + https://github.com/amnezia-vpn/amnezia-client https://github.com/amnezia-vpn/amnezia-client - + Website Веб-сайт - https://amnezia.org - https://amnezia.org + https://amnezia.org - + Software version: %1 Версия ПО: %1 - + Check for updates Проверить обновления - + Privacy Policy Политика конфиденциальности - PageSettingsAppSplitTunneling + PageSettingsApiServerInfo - - Cannot change split tunneling settings during active connection - Невозможно изменить настройки раздельного туннелирования во время активного соединения + + For the region + Для региона - - Only the apps from the list should have access via VPN - Только приложения из списка должны работать через VPN + + Price + Цена - - Apps from the list should not have access via VPN - Приложения из списка не должны работать через VPN + + Work period + Период работы - - App split tunneling - Раздельное туннелирование приложений + + Speed + Скорость - - Mode - Режим + + Support tag + - - Remove - Удалить + + Copied + Скопировано - + + Reload API config + Перезагрузить конфигурацию API + + + + Reload API config? + Перезагрузить конфигурацию API? + + + + Continue Продолжить - + + Cancel Отменить - + + Cannot reload API config during active connection + Невозможно перзагрузить API конфигурацию при активном соединении + + + + Remove from application + Удалить из приложения + + + + Remove from application? + Удалить из приложения? + + + + Cannot remove server during active connection + Невозможно удалить сервер во время активного соединения + + + + PageSettingsAppSplitTunneling + + + Cannot change split tunneling settings during active connection + Невозможно изменить настройки раздельного туннелирования во время активного соединения + + + + Only the apps from the list should have access via VPN + Только приложения из списка должны работать через VPN + + + + Apps from the list should not have access via VPN + Приложения из списка не должны работать через VPN + + + + App split tunneling + Раздельное туннелирование приложений + + + + Mode + Режим + + + + Remove + Удалить + + + + Continue + Продолжить + + + + Cancel + Отменить + + + application name название приложения - + Open executable file Открыть исполняемый файл - + Executable files (*.*) Исполняемые файлы (*.*) @@ -1292,102 +1618,102 @@ Already installed containers were found on the server. All installed containers PageSettingsApplication - + Application Приложение - + Allow application screenshots Разрешить скриншоты приложения - + Auto start Автозапуск - + Launch the application every time the device is starts Запускать приложение при загрузке устройства - + Auto connect Автоподключение - + Connect to VPN on app start Подключаться к VPN при запуске приложения - + Start minimized Запускать в свернутом виде - + Launch application minimized Запускать приложение в свернутом виде - + Language Язык - + Enable notifications Включить уведомления - + Enable notifications to show the VPN state in the status bar Включить уведомления для отображения статуса VPN в строке состояния - + Logging Логирование - + Enabled Включено - + Disabled Отключено - + Reset settings and remove all data from the application Сбросить настройки и удалить все данные из приложения - + Reset settings and remove all data from the application? Сбросить настройки и удалить все данные из приложения? - + All settings will be reset to default. All installed AmneziaVPN services will still remain on the server. Все настройки будут сброшены до значений по умолчанию. Все установленные сервисы AmneziaVPN останутся на сервере. - + Continue Продолжить - + Cancel Отменить - + Cannot reset settings during active connection Невозможно сбросить настройки во время активного соединения @@ -1399,7 +1725,7 @@ Already installed containers were found on the server. All installed containers Резервное копирование - + Settings restored from backup file Настройки восстановлены из файла резервной копии @@ -1482,7 +1808,7 @@ Already installed containers were found on the server. All installed containers PageSettingsConnection - + Connection Соединение @@ -1495,57 +1821,57 @@ Already installed containers were found on the server. All installed containers Подключение к VPN при запуске приложения - + Use AmneziaDNS Использовать AmneziaDNS - + If AmneziaDNS is installed on the server Если AmneziaDNS установлен на сервере - + DNS servers DNS-серверы - + When AmneziaDNS is not used or installed Когда AmneziaDNS не используется или не установлен - + Allows you to use the VPN only for certain Apps Позволяет использовать VPN только для определенных приложений - + KillSwitch - Аварийный выключатель + KillSwitch - + Disables your internet if your encrypted VPN connection drops out for any reason. Отключает ваше интернет-соединение, если ваше зашифрованное VPN-соединение по какой-либо причине прерывается. - + Cannot change killSwitch settings during active connection Невозможно изменить настройки аварийного выключателя во время активного соединения - + Site-based split tunneling Раздельное туннелирование сайтов - + Allows you to select which sites you want to access through the VPN Позволяет выбирать, к каким сайтам подключаться через VPN - + App-based split tunneling Раздельное туннелирование приложений @@ -1557,12 +1883,12 @@ Already installed containers were found on the server. All installed containers PageSettingsDns - + Default server does not support custom DNS Сервер по умолчанию не поддерживает пользовательские DNS - + DNS servers DNS-серверы @@ -1571,52 +1897,52 @@ Already installed containers were found on the server. All installed containers Когда AmneziaDNS не используется или не установлен - + If AmneziaDNS is not used or installed Если AmneziaDNS не используется или не установлен - + Primary DNS Первичный DNS - + Secondary DNS Вторичный DNS - + Restore default Восстановить по умолчанию - + Restore default DNS settings? Восстановить настройки DNS по умолчанию? - + Continue Продолжить - + Cancel Отменить - + Settings have been reset Настройки сброшены - + Save Сохранить - + Settings saved Настройки сохранены @@ -1624,72 +1950,108 @@ Already installed containers were found on the server. All installed containers PageSettingsLogging - Logging is enabled. Note that logs will be automatically disabled after 14 days, and all log files will be deleted. - Логирование включено. Обратите внимание, что логирование будет автоматически отключено через 14 дней, и все логи будут удалены. + Логирование включено. Обратите внимание, что логирование будет автоматически отключено через 14 дней, и все логи будут удалены. - + Logging Логирование - + Enabling this function will save application's logs automatically. By default, logging functionality is disabled. Enable log saving in case of application malfunction. Включение этой функции позволяет сохранять логи на вашем устройстве. По умолчанию она отключена. Включите сохранение логов в случае сбоев в работе приложения. - Save logs - Сохранять логи + Сохранять логи - Open folder with logs - Открыть папку с логами + Открыть папку с логами - + + Save Сохранить - + + Logs files (*.log) Файлы логов (*.log) - + + Logs file saved Файл с логами сохранен - Save logs to file - Сохранить логи в файл + Сохранить логи в файл - + + Enable logs + + + + Clear logs? Очистить логи? - + Continue Продолжить - + Cancel Отменить - + Logs have been cleaned up Логи очищены - + + Client logs + + + + + AmneziaVPN logs + + + + + + Open logs folder + + + + + + Export logs + + + + + Service logs + + + + + AmneziaVPN-service logs + + + + Clear logs Очистить логи @@ -1697,7 +2059,7 @@ Already installed containers were found on the server. All installed containers PageSettingsServerData - + All installed containers have been added to the application Все установленные протоколы и сервисы были добавлены в приложение @@ -1714,7 +2076,7 @@ Already installed containers were found on the server. All installed containers Удалить кэш Amnezia? - + No new installed containers found Новые установленные протоколы и сервисы не обнаружены @@ -1723,94 +2085,94 @@ Already installed containers were found on the server. All installed containers - - - - - - Continue - Продолжить - + Continue + Продолжить + + + + + + Cancel Отменить - + Check the server for previously installed Amnezia services Проверить сервер на наличие ранее установленных сервисов Amnezia - + Add them to the application if they were not displayed Добавить их в приложение, если они не отображаются - + Reboot server Перезагрузить сервер - + Do you want to reboot the server? Вы уверены, что хотите перезагрузить сервер? - + The reboot process may take approximately 30 seconds. Are you sure you wish to proceed? Процесс перезагрузки может занять около 30 секунд. Вы уверены, что хотите продолжить? - + Cannot reboot server during active connection Невозможно перезагрузить сервер во время активного соединения - + Do you want to remove the server from application? Вы уверены, что хотите удалить сервер из приложения? - + Cannot remove server during active connection Невозможно удалить сервер во время активного соединения - + Do you want to clear server from Amnezia software? Вы хотите очистить сервер от всех сервисов Amnezia? - + All users whom you shared a connection with will no longer be able to connect to it. Все пользователи, с которыми вы поделились конфигурацией вашего VPN, больше не смогут к нему подключаться. - + Cannot clear server from Amnezia software during active connection Невозможно очистить сервер от сервисов Amnezia во время активного соединения - + Reset API config Сбросить конфигурацию API - + Do you want to reset API config? Вы хотите сбросить конфигурацию API? - + Cannot reset API config during active connection Невозможно сбросить конфигурацию API во время активного соединения - + Remove server from application Удалить сервер из приложения @@ -1819,12 +2181,12 @@ Already installed containers were found on the server. All installed containers Удалить сервер? - + All installed AmneziaVPN services will still remain on the server. Все установленные сервисы и протоколы Amnezia останутся на сервере. - + Clear server from Amnezia software Очистить сервер от протоколов и сервисов Amnezia @@ -1840,27 +2202,27 @@ Already installed containers were found on the server. All installed containers PageSettingsServerInfo - + Server name Имя сервера - + Save Сохранить - + Protocols Протоколы - + Services Сервисы - + Management Управление @@ -1872,17 +2234,16 @@ Already installed containers were found on the server. All installed containers PageSettingsServerProtocol - + settings настройки - Clear %1 profile - Очистить профиль %1 + Очистить профиль %1 - + Clear %1 profile? Очистить профиль %1? @@ -1892,27 +2253,52 @@ Already installed containers were found on the server. All installed containers - + + connection settings + + + + + Click the "connect" button to create a connection configuration + + + + + server settings + + + + + Clear profile + + + + + The connection configuration will be deleted for this device only + + + + Unable to clear %1 profile while there is an active connection Невозможно очистить профиль %1 во время активного соединения - + Remove Удалить - + Remove %1 from server? Удалить %1 с сервера? - + All users with whom you shared a connection will no longer be able to connect to it. Все пользователи, с которыми вы поделились конфигурацией вашего VPN, больше не смогут к нему подключаться. - + Cannot remove active container Невозможно удалить активный контейнер @@ -1921,14 +2307,14 @@ Already installed containers were found on the server. All installed containers Все пользователи, с которыми вы поделились VPN, больше не смогут к нему подключаться. - - + + Continue Продолжить - - + + Cancel Отменить @@ -1936,7 +2322,7 @@ Already installed containers were found on the server. All installed containers PageSettingsServersList - + Servers Серверы @@ -1944,7 +2330,7 @@ Already installed containers were found on the server. All installed containers PageSettingsSplitTunneling - + Default server does not support split tunneling function Сервер по умолчанию не поддерживает раздельное туннелирование @@ -1953,32 +2339,32 @@ Already installed containers were found on the server. All installed containers Только адреса из списка должны открываться через VPN - + Addresses from the list should not be accessed via VPN Адреса из списка не должны открываться через VPN - + Split tunneling Раздельное туннелирование - + Mode Режим - + Remove Удалить - + Continue Продолжить - + Cancel Отменить @@ -1987,75 +2373,120 @@ Already installed containers were found on the server. All installed containers Сайт или IP - + Import / Export Sites Импорт/экспорт сайтов - + Only the sites listed here will be accessed through the VPN Только адреса из списка должны открываться через VPN - + Cannot change split tunneling settings during active connection Невозможно изменить настройки раздельного туннелирования во время активного соединения - + website or IP веб-сайт или IP - + Import Импорт - + Save site list Сохранить список сайтов - + Save sites Сохранить сайты - - - + + + Sites files (*.json) Файлы сайтов (*.json) - + Import a list of sites Импортировать список с сайтами - + Replace site list Заменить список с сайтами - - + + Open sites file Открыть список с сайтами - + Add imported sites to existing ones Добавить импортированные сайты к существующим + + PageSetupWizardApiServiceInfo + + + For the region + Для региона + + + + Price + Цена + + + + Work period + Период работы + + + + Speed + Скорость + + + + Features + Особенности + + + + Connect + Подключиться + + + + PageSetupWizardApiServicesList + + + VPN by Amnezia + VPN от Amnezia + + + + Choose a VPN service that suits your needs. + Выберите VPN-сервис, который подходит именно вам. + + PageSetupWizardConfigSource - Server connection - Подключение к серверу + Подключение к серверу Do not use connection code from public sources. It may have been created to intercept your data. @@ -2066,39 +2497,115 @@ It's okay as long as it's from someone you trust. Всё в порядке, если кодом поделился пользователь, которому вы доверяете. - Do not use connection codes from untrusted sources, as they may be created to intercept your data. - Не используйте коды подключения из ненадежных источников, так как они могут быть созданы для перехвата ваших данных. + Не используйте коды подключения из ненадежных источников, так как они могут быть созданы для перехвата ваших данных. - What do you have? - Что у вас есть? + Что у вас есть? - + File with connection settings Файл с настройками подключения - File with connection settings or backup - Файл с настройками подключения или резервной копией + Файл с настройками подключения или резервной копией - + + Connection + Соединение + + + + Settings + Настройки + + + + Enable logs + + + + + Insert the key, add a configuration file or scan the QR-code + Вставьте ключ, добавьте файл конфигурации или отсканируйте QR-код + + + + Insert key + Вставьте ключ + + + + Insert + Вставить + + + + Continue + Продолжить + + + + Other connection options + Другие варианты подключения + + + + VPN by Amnezia + VPN от Amnezia + + + + Connect to classic paid and free VPN services from Amnezia + Подключайтесь к классическим платным и бесплатным VPN-сервисам от Amnezia + + + + Self-hosted VPN + Self-hosted VPN + + + + Configure Amnezia VPN on your own server + Настроить VPN на собственном сервере + + + + Restore from backup + Восстановить из резервной копии + + + + Open backup file + Открыть резервную копию + + + + Backup files (*.backup) + Файлы резервных копий (*.backup) + + + Open config file Открыть файл с конфигурацией - + QR code QR-код - + + I have nothing + У меня ничего нет + + Key as text - Ключ в виде текста + Ключ в виде текста @@ -2108,7 +2615,7 @@ It's okay as long as it's from someone you trust. Подключение к серверу - + Server IP address [:port] IP-адрес[:порт] сервера @@ -2121,7 +2628,7 @@ It's okay as long as it's from someone you trust. Password / SSH private key - + Continue Продолжить @@ -2131,7 +2638,7 @@ and will not be shared or disclosed to the Amnezia or any third parties Все данные, которые вы вводите, останутся строго конфиденциальными и не будут переданы или раскрыты Amnezia или каким-либо третьим лицам - + Enter the address in the format 255.255.255.255:88 Введите адрес в формате 255.255.255.255:88 @@ -2140,42 +2647,52 @@ and will not be shared or disclosed to the Amnezia or any third parties Login to connect via SSH - + Configure your server Настроить ваш сервер - + 255.255.255.255:22 255.255.255.255:22 - + SSH Username Имя пользователя SSH - + Password or SSH private key Пароль или закрытый ключ SSH - + All data you enter will remain strictly confidential and will not be shared or disclosed to the Amnezia or any third parties Все данные, которые вы вводите, останутся строго конфиденциальными и не будут переданы или раскрыты Amnezia или каким-либо третьим лицам - + + How to run your VPN server + Как создать VPN на собственном сервере + + + + Where to get connection data, step-by-step instructions for buying a VPS + Где взять данные для подключения, пошаговые инстуркции по покупке VPS + + + Ip address cannot be empty Поле с IP-адресом не может быть пустым - + Login cannot be empty Поле с логином не может быть пустым - + Password/private key cannot be empty Поле с паролем/закрытым ключом не может быть пустым @@ -2183,17 +2700,17 @@ and will not be shared or disclosed to the Amnezia or any third parties PageSetupWizardEasy - + What is the level of internet control in your region? Какой уровень контроля над интернетом в вашем регионе? - + Choose a VPN protocol Выберите VPN-протокол - + Skip setup Пропустить настройку @@ -2206,7 +2723,7 @@ and will not be shared or disclosed to the Amnezia or any third parties Выбрать VPN-протокол - + Continue Продолжить @@ -2218,38 +2735,38 @@ and will not be shared or disclosed to the Amnezia or any third parties PageSetupWizardInstalling - + The server has already been added to the application Сервер уже был добавлен в приложение - + Amnezia has detected that your server is currently Amnezia обнаружила, что ваш сервер в настоящее время - + busy installing other software. Amnezia installation занят установкой других протоколов или сервисов. Установка Amnezia - + will pause until the server finishes installing other software будет приостановлена до тех пор, пока сервер не завершит установку другого ПО - + Installing Установка - + Cancel installation Отменить установку - - + + Usually it takes no more than 5 minutes Обычно это занимает не более 5 минут @@ -2257,37 +2774,37 @@ and will not be shared or disclosed to the Amnezia or any third parties PageSetupWizardProtocolSettings - + Installing %1 Устанавливается %1 - + More detailed Подробнее - + Close Закрыть - + Network protocol Сетевой протокол - + Port Порт - + Install Установить - + The port must be in the range of 1 to 65535 Порт должен быть в диапазоне от 1 до 65535 @@ -2295,12 +2812,12 @@ and will not be shared or disclosed to the Amnezia or any third parties PageSetupWizardProtocols - + VPN protocol VPN-протокол - + Choose the one with the highest priority for you. Later, you can install other protocols and additional services, such as DNS proxy and SFTP. Выберите протокол, который вам больше подходит. В дальнейшем можно установить другие протоколы и дополнительные сервисы, такие как DNS-прокси и SFTP. @@ -2308,7 +2825,7 @@ and will not be shared or disclosed to the Amnezia or any third parties PageSetupWizardQrReader - + Point the camera at the QR code and hold for a couple of seconds. Наведите камеру на QR-код и удерживайте ее в течение нескольких секунд. @@ -2316,60 +2833,59 @@ and will not be shared or disclosed to the Amnezia or any third parties PageSetupWizardStart - Settings restored from backup file - Настройки восстановлены из резервной копии + Настройки восстановлены из резервной копии - Free service for creating a personal VPN on your server. - Простое и бесплатное приложение для запуска собственного VPN на своем сервере. + Простое и бесплатное приложение для запуска собственного VPN на своем сервере. - Helps you access blocked content without revealing your privacy, even to VPN providers. - Помогает получить доступ к заблокированному контенту, не раскрывая вашу конфиденциальность даже провайдерам VPN. + Помогает получить доступ к заблокированному контенту, не раскрывая вашу конфиденциальность даже провайдерам VPN. - I have the data to connect - У меня есть данные для подключения + У меня есть данные для подключения - I have nothing - У меня ничего нет + У меня ничего нет - https://amnezia.org/instructions/0_starter-guide - https://amnezia.org/ru/starter-guide + https://amnezia.org/ru/starter-guide + + + + Let's get started + Приступим PageSetupWizardTextKey - + Connection key Ключ для подключения - + A line that starts with vpn://... Строка, которая начинается с vpn://... - + Key Ключ - + Insert Вставить - + Continue Продолжить @@ -2377,7 +2893,7 @@ and will not be shared or disclosed to the Amnezia or any third parties PageSetupWizardViewConfig - + New connection Новое соединение @@ -2386,27 +2902,27 @@ and will not be shared or disclosed to the Amnezia or any third parties Не используйте код подключения из публичных источников. Его могли создать, чтобы перехватить ваши данные. - + Collapse content Свернуть - + Show content Показать - + Enable WireGuard obfuscation. It may be useful if WireGuard is blocked on your provider. Включить обфускацию WireGuard. Это может быть полезно, если WireGuard блокируется вашим провайдером. - + Use connection codes only from sources you trust. Codes from public sources may have been created to intercept your data. Используйте файлы конфигурации только из тех источников, которым вы доверяете. Файлы из общедоступных источников могли быть созданы с целью перехвата ваших личных данных. - + Connect Подключиться @@ -2414,12 +2930,12 @@ and will not be shared or disclosed to the Amnezia or any third parties PageShare - + OpenVPN native format Оригинальный формат OpenVPN - + WireGuard native format Оригинальный формат WireGuard @@ -2428,7 +2944,7 @@ and will not be shared or disclosed to the Amnezia or any third parties VPN-Доступ - + Connection Соединение @@ -2441,8 +2957,8 @@ and will not be shared or disclosed to the Amnezia or any third parties Доступ к управлению сервером. Пользователь, с которым вы делитесь полным доступом к соединению, сможет добавлять и удалять ваши протоколы и службы на сервере, а также изменять настройки. - - + + Server Сервер @@ -2451,123 +2967,123 @@ and will not be shared or disclosed to the Amnezia or any third parties Доступ - + Config revoked Конфигурация отозвана - + Connection to Подключение к - + File with connection settings to Файл с настройками подключения к - + Save OpenVPN config Сохранить конфигурацию OpenVPN - + Save WireGuard config Сохранить конфигурацию WireGuard - + Save AmneziaWG config Сохранить конфигурацию AmneziaWG - + Save Shadowsocks config Сохранить конфигурацию Shadowsocks - + Save Cloak config Сохранить конфигурацию Cloak - + Save XRay config Сохранить конфигурацию XRay - + For the AmneziaVPN app Для приложения AmneziaVPN - + AmneziaWG native format Оригинальный формат AmneziaWG - + Shadowsocks native format Оригинальный формат Shadowsocks - + Cloak native format Оригинальный формат Cloak - + XRay native format Оригинальный формат XRay - + Share VPN Access Поделиться VPN - + Share full access to the server and VPN Поделиться полным доступом к серверу и VPN - + Use for your own devices, or share with those you trust to manage the server. Используйте для собственных устройств или передайте управление сервером тем, кому вы доверяете. - - + + Users Пользователи - + User name Имя пользователя - + Search Поиск - + Creation date: %1 Дата создания: %1 - + Latest handshake: %1 Последнее рукопожатие: %1 - + Data received: %1 Получено данных: %1 - + Data sent: %1 Отправлено данных: %1 @@ -2576,42 +3092,42 @@ and will not be shared or disclosed to the Amnezia or any third parties Дата создания: - + Rename Переименовать - + Client name Имя клиента - + Save Сохранить - + Revoke Отозвать - + Revoke the config for a user - %1? Отозвать конфигурацию для пользователя - %1? - + The user will no longer be able to connect to your server. Пользователь больше не сможет подключаться к вашему серверу. - + Continue Продолжить - + Cancel Отменить @@ -2620,25 +3136,25 @@ and will not be shared or disclosed to the Amnezia or any third parties Полный доступ - + Share VPN access without the ability to manage the server Поделиться доступом к VPN без возможности управления сервером - - + + Protocol Протокол - - + + Connection format Формат подключения - - + + Share Поделиться @@ -2646,50 +3162,55 @@ and will not be shared or disclosed to the Amnezia or any third parties PageShareFullAccess - + Full access to the server and VPN Полный доступ к серверу и VPN - + We recommend that you use full access to the server only for your own additional devices. Мы рекомендуем использовать полный доступ к серверу только для собственных устройств. - + If you share full access with other people, they can remove and add protocols and services to the server, which will cause the VPN to work incorrectly for all users. Если вы поделитесь полным доступом с другими людьми, то они смогут удалять и добавлять протоколы и сервисы на сервер, что приведет к некорректной работе VPN для всех пользователей. - + Server Сервер - + Accessing Доступ - + File with accessing settings to Файл с настройками доступа к - + Share Поделиться - + + Access error! + Ошибка доступа! + + + Connection to Подключение к - + File with connection settings to Файл с настройками подключения к @@ -2697,15 +3218,25 @@ and will not be shared or disclosed to the Amnezia or any third parties PageStart - + Logging was disabled after 14 days, log files were deleted Логирование было отключено по прошествии 14 дней, файлы логов были удалены. + + + Settings restored from backup file + Настройки восстановлены из бэкап файла + + + + Logging is enabled. Note that logs will be automaticallydisabled after 14 days, and all log files will be deleted. + + PopupType - + Close Закрыть @@ -2739,12 +3270,12 @@ and will not be shared or disclosed to the Amnezia or any third parties Пароль не найден - + Could not open keystore Не удалось открыть хранилище ключей - + Could not remove private key from keystore Не удалось удалить закрытый ключ из хранилища ключей @@ -2920,27 +3451,27 @@ and will not be shared or disclosed to the Amnezia or any third parties Не удалось открыть хранилище ключей - + Could not create private key generator Не удалось создать генератор закрытых ключей - + Could not generate new private key Не удалось сгенерировать новый закрытый ключ - + Could not retrieve private key from keystore Не удалось получить закрытый ключ из хранилища ключей - + Could not create encryption cipher Не удалось создать шифр шифрования - + Could not encrypt data Не удалось зашифровать данные @@ -3104,7 +3635,7 @@ and will not be shared or disclosed to the Amnezia or any third parties Данная конфигурация уже была добавлена в приложение - + ErrorCode: %1. Код ошибки: %1. @@ -3183,37 +3714,42 @@ and will not be shared or disclosed to the Amnezia or any third parties Тайм-аут ответа сервера на запрос API - + + Missing AGW public key + + + + QFile error: The file could not be opened Ошибка QFile: не удалось открыть файл - + QFile error: An error occurred when reading from the file Ошибка QFile: произошла ошибка при чтении из файла - + QFile error: The file could not be accessed Ошибка QFile: не удалось получить доступ к файлу - + QFile error: An unspecified error occurred Ошибка QFile: произошла неизвестная ошибка - + QFile error: A fatal error occurred Ошибка QFile: произошла фатальная ошибка - + QFile error: The operation was aborted Ошибка QFile: операция была прервана - + Internal error Внутренняя ошибка @@ -3750,7 +4286,7 @@ This means that AmneziaWG keeps the fast performance of the original while addin SelectLanguageDrawer - + Choose language Выберите язык @@ -3758,13 +4294,13 @@ This means that AmneziaWG keeps the fast performance of the original while addin Settings - + Server #1 Сервер #1 - - + + Server Сервер @@ -3772,7 +4308,7 @@ This means that AmneziaWG keeps the fast performance of the original while addin SettingsController - + All settings have been reset to default values Все настройки сброшены до значений по умолчанию @@ -3781,7 +4317,7 @@ This means that AmneziaWG keeps the fast performance of the original while addin Закэшированные профили очищены - + Backup file is corrupted Файл резервной копии поврежден @@ -3789,39 +4325,39 @@ This means that AmneziaWG keeps the fast performance of the original while addin ShareConnectionDrawer - - + + Save AmneziaVPN config Сохранить конфигурацию AmneziaVPN - + Share Поделиться - + Copy Скопировать - - + + Copied Скопировано - + Copy config string Скопировать строку конфигурации - + Show connection settings Показать настройки подключения - + To read the QR code in the Amnezia app, select "Add server" → "I have data to connect" → "QR code, key or settings file" Для считывания QR-кода в приложении Amnezia выберите "Добавить сервер" → "У меня есть данные для подключения" → "Открыть файл конфигурации, ключ или QR-код" @@ -3905,7 +4441,7 @@ This means that AmneziaWG keeps the fast performance of the original while addin TextFieldWithHeaderType - + The field can't be empty Поле не может быть пустым @@ -3913,7 +4449,7 @@ This means that AmneziaWG keeps the fast performance of the original while addin VpnConnection - + Mbps Мбит/с @@ -3964,12 +4500,12 @@ This means that AmneziaWG keeps the fast performance of the original while addin amnezia::ContainerProps - + Low Низкий - + High Высокий @@ -3978,12 +4514,12 @@ This means that AmneziaWG keeps the fast performance of the original while addin Экстремальный - + I just want to increase the level of my privacy. Я просто хочу повысить уровень своей приватности. - + I want to bypass censorship. This option recommended in most cases. Я хочу обойти блокировки. Этот вариант рекомендуется в большинстве случаев. @@ -4011,12 +4547,12 @@ This means that AmneziaWG keeps the fast performance of the original while addin main2 - + Private key passphrase Парольная фраза для закрытого ключа - + Save Сохранить diff --git a/client/translations/amneziavpn_uk_UA.ts b/client/translations/amneziavpn_uk_UA.ts index 8979533e..c7195119 100644 --- a/client/translations/amneziavpn_uk_UA.ts +++ b/client/translations/amneziavpn_uk_UA.ts @@ -24,96 +24,149 @@ VPN Підключено + + ApiServicesModel + + + Classic VPN for comfortable work, downloading large files and watching videos. Works for any sites. Speed up to %1 MBit/s + Звичайний VPN для комфортної роботи, завантаження великих файлів та перегляду відео. Працює для будь-яких сайтів. Швидкість до %1 MBit/s + + + + VPN to access blocked sites in regions with high levels of Internet censorship. + VPN для доступу до заблокованих сайтів у регіонах з високим рівнем інтернет-цензури. + + + + <p><a style="color: #EB5757;">Not available in your region. If you have VPN enabled, disable it, return to the previous screen, and try again.</a> + + + + + Amnezia Premium - A classic VPN for comfortable work, downloading large files, and watching videos in high resolution. It works for all websites, even in countries with the highest level of internet censorship. + Amnezia Premium - звичайний VPN для комфортної роботи, завантаження великих файлів та перегляду відео у високій роздільній здатності. Працює для всіх вебсайтів, навіть у країнах з найвищим рівнем інтернет-цензури. + + + + Amnezia Free is a free VPN to bypass blocking in countries with high levels of internet censorship + Amnezia Free — це безкоштовний VPN для обходу блокувань у країнах з високим рівнем інтернет-цензури + + + + %1 MBit/s + %1 MBit/s + + + + %1 days + %1 днів + + + + VPN will open only popular sites blocked in your region, such as Instagram, Facebook, Twitter and others. Other sites will be opened from your real IP address, <a href="%1/free" style="color: #FBB26A;">more details on the website.</a> + Лише популярні сайти, які заблоковані у вашому регіоні, будуть відкриватись за допомогою VPN підключення (Instagram, Facebook, Twitter та ін.). Звичайні сайти будуть відкриватися без використання VPN, <a href="%1/free" style="color: #FBB26A;">більш детально на нашому сайті.</a> + + + + Free + Безкоштовно + + + + %1 $/month + %1 $/місяць + + AppSplitTunnelingController Application added: %1 - + Застосунок додано: %1 The application has already been added - + Застосунок вже додано The selected applications have been added - + Вибрані застосунки додані Application removed: %1 - + Застосунок видалено: %1 ConnectButton - + Unable to disconnect during configuration preparation - + Неможливо відключитися під час підготовки конфігурації ConnectionController - + VPN Protocols is not installed. Please install VPN container at first VPN протоколи не встановлено. Будь-ласка, встановіть VPN контейнер - + unable to create configuration - + Неможливо створити конфігурацію - + Connecting... Підключення... - + Connected Підключено - + Preparing... - + Підготовка... - + Settings updated successfully, reconnnection... Налаштування оновлено, підключення... - + Settings updated successfully - Налаштування оновлено. + Налаштування оновлено - + The selected protocol is not supported on the current platform - Вибраний протокол не підтримується на цьому пристрої + Вибраний протокол не підтримується на цьому пристрої - + Reconnecting... Перепідключення... - - - + + + Connect Підключитись - + Disconnecting... Відключаємось... @@ -154,7 +207,7 @@ &Вставити - + &SelectAll &Вибрати все @@ -162,9 +215,8 @@ ExportController - Access error! - Помилка доступу! + Помилка доступу! @@ -205,7 +257,7 @@ Enabled Can't be disabled for current server Увімкнено. -Не може бути вимкнено для даного сервера. +Не може бути вимкнено для даного сервера @@ -235,107 +287,127 @@ Can't be disabled for current server Unable to open file - + Неможливо відкрити файл - - + + Invalid configuration file - + Недійсний файл конфігурації - + Scanned %1 of %2. Відскановано %1 з %2. - + In the imported configuration, potentially dangerous lines were found: - + У імпортованій конфігурації знайдено потенційно небезпечні рядки: InstallController - + %1 installed successfully. %1 встановлено. - + %1 is already installed on the server. %1 вже встановлено на сервері. - + Added containers that were already installed on the server Додані сервіси і протоколи, які були раніше встановлені на сервері - + Already installed containers were found on the server. All installed containers have been added to the application На сервері знайдені сервіси та протоколи, всі вони додані в застосунок - + Settings updated successfully Налаштування оновлено - + Server '%1' was rebooted Сервер '%1' перезавантажено - + Server '%1' was removed Сервер '%1' був видалений - + All containers from server '%1' have been removed Всі сервіси та протоколи були видалені з сервера '%1' - + %1 has been removed from the server '%2' %1 був видалений з сервера '%2' - - %1 cached profile cleared - + + Api config removed + Конфігурацію API видалено - + + %1 cached profile cleared + Кешований профіль %1 очищено + + + Please login as the user Буль-ласка, увійдіть в систему від імені користувача - + Server added successfully Сервер додано + + + %1 installed successfully. + %1 встановлено успішно. + + + + API config reloaded + Конфігурацію API перезавантажено + + + + Successfully changed the country of connection to %1 + Успішно змінено країну підключення на %1 + InstalledAppsDrawer - + Choose application - + Виберіть застосунок - + application name - + назва застосунку - + Add selected - + Додати вибране @@ -388,96 +460,202 @@ Already installed containers were found on the server. All installed containers PageDeinstalling - + Removing services from %1 Видалення сервісів з %1 - + Usually it takes no more than 5 minutes Зазвичай, це займає не більше 5 хвилин - PageHome + PageDevMenu - - Logging enabled + + Gateway endpoint - + + Dev gateway environment + + + + + PageHome + + + Logging enabled + Логування увімкнено + + + Split tunneling enabled - Роздільне тунелювання увімкнено + Роздільне тунелювання увімкнено - + Split tunneling disabled - Роздільне тунелювання вимкнено + Роздільне тунелювання вимкнено - + VPN protocol VPN протокол - + Servers Сервери - + Unable change server while there is an active connection Не можна змінити сервер при активному підключенні - PageProtocolAwgSettings + PageProtocolAwgClientSettings - + AmneziaWG settings - налаштування AmneziaWG + налаштування AmneziaWG - - Port - Порт - - - + MTU + MTU + + + + Server settings - + + Port + Порт + + + Save Зберегти - - The values of the H1-H4 fields must be unique - - - - - The value of the field S1 + message initiation size (148) must not equal S2 + message response size (92) - - - - + Save settings? + Зберегти налаштування? + + + + Only the settings for this device will be changed - - All users with whom you shared a connection with will no longer be able to connect to it. - + + Continue + Продовжити - + + Cancel + Відмінити + + + Unable change settings while there is an active connection + Неможливо змінити налаштування, поки є активне підключення + + + + PageProtocolAwgSettings + + + AmneziaWG settings + налаштування AmneziaWG + + + + Port + Порт + + + + Jc - Junk packet count + + + Jmin - Junk packet minimum size + + + + + Jmax - Junk packet maximum size + + + + + S1 - Init packet junk size + + + + + S2 - Response packet junk size + + + + + H1 - Init packet magic header + + + + + H2 - Response packet magic header + + + + + H4 - Transport packet magic header + + + + + H3 - Underload packet magic header + + + + + Save + Зберегти + + + + The values of the H1-H4 fields must be unique + Значення полів H1-H4 мають бути унікальними + + + + The value of the field S1 + message initiation size (148) must not equal S2 + message response size (92) + Значення поля S1 + розмір повідомлення ініціалізації (148) не має бути рівним значенню S2 + розмір повідомлення відповіді (92) + + + + Save settings? + Зберегти налаштування? + + + + All users with whom you shared a connection with will no longer be able to connect to it. + Усі користувачі, з якими ви поділилися підключенням, більше не зможуть підключитися до нього. + + + + Unable change settings while there is an active connection + Неможливо змінити налаштування, поки є активне підключення + Remove AmneziaWG Видалити AmneziaWG @@ -495,12 +673,12 @@ Already installed containers were found on the server. All installed containers Користувачі, з якими ви поділились цим протоколм, більше не зможуть до нього підключитись. - + Continue Продовжити - + Cancel Відмінити @@ -512,35 +690,35 @@ Already installed containers were found on the server. All installed containers PageProtocolCloakSettings - + Cloak settings Налаштування Cloak - + Disguised as traffic from Замаскувати трафік під - + Port Порт - + Cipher Шифрування - + Save - Зберегти + Зберегти - + Unable change settings while there is an active connection - + Неможливо змінити налаштування, поки є активне підключення Save and Restart Amnezia @@ -550,7 +728,7 @@ Already installed containers were found on the server. All installed containers PageProtocolOpenVpnSettings - + OpenVPN settings налаштування OpenVPN @@ -559,172 +737,172 @@ Already installed containers were found on the server. All installed containers Підмережа для VPN - + VPN address subnet - + VPN address subnet - + Network protocol Мережевий притокол - + Port Порт - + Auto-negotiate encryption Автоматично отримувати шифрування - + Hash Хеш - + SHA512 SHA512 - + SHA384 SHA384 - + SHA256 SHA256 - + SHA3-512 SHA3-512 - + SHA3-384 SHA3-384 - + SHA3-256 SHA3-256 - + whirlpool whirlpool - + BLAKE2b512 BLAKE2b512 - + BLAKE2s256 BLAKE2s256 - + SHA1 SHA1 - + Cipher Шифрування - + AES-256-GCM AES-256-GCM - + AES-192-GCM AES-192-GCM - + AES-128-GCM AES-128-GCM - + AES-256-CBC AES-256-CBC - + AES-192-CBC AES-192-CBC - + AES-128-CBC AES-128-CBC - + ChaCha20-Poly1305 ChaCha20-Poly1305 - + ARIA-256-CBC ARIA-256-CBC - + CAMELLIA-256-CBC CAMELLIA-256-CBC - + none none - + TLS auth TLS авторизація - + Block DNS requests outside of VPN Блокувати DNS запити за межами VPN тунеля - + Additional client configuration commands Додаткові команди конфігурації клієнта - - + + Commands: Команди: - + Additional server configuration commands Додаткові команти конфігурації сервера - + Save - Зберегти + Зберегти - + Unable change settings while there is an active connection - + Неможливо змінити налаштування, поки є активне підключення Remove OpenVPN @@ -758,34 +936,34 @@ Already installed containers were found on the server. All installed containers PageProtocolRaw - + settings налаштування - + Show connection options Показати параметри підключення - + Connection options %1 Параметри підключення %1 - + Remove Видалити - + Remove %1 from server? Видалити %1 з сервера? - + All users with whom you shared a connection with will no longer be able to connect to it. - + Усі користувачі, з якими ви поділилися підключенням, більше не зможуть підключитися до нього. All users with whom you shared a connection will no longer be able to connect to it. @@ -796,12 +974,12 @@ Already installed containers were found on the server. All installed containers Користувачі, з якими ви поділились цим протоколм, більше не зможуть до нього підключитись. - + Continue Продовжити - + Cancel Відмінити @@ -809,30 +987,30 @@ Already installed containers were found on the server. All installed containers PageProtocolShadowSocksSettings - + Shadowsocks settings Налаштування Shadowsocks - + Port Порт - + Cipher Шифрування - + Save - Зберегти + Зберегти - + Unable change settings while there is an active connection - + Неможливо змінити налаштування, поки є активне підключення Save and Restart Amnezia @@ -840,54 +1018,126 @@ Already installed containers were found on the server. All installed containers - PageProtocolWireGuardSettings + PageProtocolWireGuardClientSettings - + WG settings - + + MTU + MTU + + + + Server settings + + + + Port Порт - - MTU - - - - + Save Зберегти - - Unable change settings while there is an active connection + + Save settings? + Зберегти налаштування? + + + + Only the settings for this device will be changed + + + Continue + Продовжити + + + + Cancel + Відмінити + + + + Unable change settings while there is an active connection + Неможливо змінити налаштування, поки є активне підключення + + + + PageProtocolWireGuardSettings + + + WG settings + + + + + Port + Порт + + + MTU + MTU + + + + Save + Зберегти + + + + Save settings? + Зберегти налаштування? + + + + All users with whom you shared a connection with will no longer be able to connect to it. + Усі користувачі, з якими ви поділилися підключенням, більше не зможуть підключитися до нього. + + + + Continue + Продовжити + + + + Cancel + Відмінити + + + + Unable change settings while there is an active connection + Неможливо змінити налаштування, поки є активне підключення + PageProtocolXraySettings - + XRay settings - + Налаштування XRay - + Disguised as traffic from - Замаскувати трафік під + Замаскувати трафік під - + Save - Зберегти + Зберегти - + Unable change settings while there is an active connection - + Неможливо змінити налаштування, поки є активне підключення @@ -900,70 +1150,70 @@ Already installed containers were found on the server. All installed containers PageServiceDnsSettings - + A DNS service is installed on your server, and it is only accessible via VPN. На вашому сервері встановлено DNS-сервіс, доступ до нього можливо тільки через VPN. - + The DNS address is the same as the address of your server. You can configure DNS in the settings, under the connections tab. - Адреса DNS сервера співпадає з адресою вашого сервера. Налаштувати DNS можливо на вкладці "Підключення" налаштувань застосунку + Адреса DNS сервера співпадає з адресою вашого сервера. Налаштувати DNS можливо на вкладці "Підключення" налаштувань застосунку. - + Remove Видалити - + Remove %1 from server? Видалити %1 з сервера? - + Continue Продовжити - + Cancel Відмінити - + Cannot remove AmneziaDNS from running server - + Не вдається видалити AmneziaDNS з працюючого сервера PageServiceSftpSettings - + Settings updated successfully Налаштування оновлено - + SFTP settings Налаштування SFTP - + Host Хост - - - - + + + + Copied Скопійовано - + Port Порт @@ -972,167 +1222,163 @@ Already installed containers were found on the server. All installed containers Логін - + User name - Імя користувача + Імя користувача - + Password Пароль - + Mount folder on device Змонтувати папку з вашого пристрою - + In order to mount remote SFTP folder as local drive, perform following steps: <br> - Для того щоб додати SFTP-папку, як локальний диск на вашому пристрої, виконайте наступні дії: <br> - - - - - <br>1. Install the latest version of - <br>1. Встановіть останню версію + Для того щоб додати SFTP-папку, як локальний диск на вашому пристрої, виконайте наступні дії: <br> + <br>1. Install the latest version of + <br>1. Встановіть останню версію + + + + <br>2. Install the latest version of <br>2. Встановіть останню версію - + Detailed instructions Детальні інструкції - Remove SFTP and all data stored there - Видалити SFTP-сховище з усіма даними + Видалити SFTP-сховище з усіма даними - Remove SFTP and all data stored there? - Видалити SFTP-сховище з усіма даними які там зберігаються? + Видалити SFTP-сховище з усіма даними які там зберігаються? - Continue - Продовжити + Продовжити - Cancel - Відмінити + Відмінити PageServiceSocksProxySettings - + Settings updated successfully - + Налаштування успішно оновлено - - + + SOCKS5 settings - + Налаштування SOCKS5 - + Host - Хост + Хост - - - - + + + + Copied - Скопійовано + Скопійовано - - + + Port - Порт + Порт - + User name - + User name - - + + Password - Пароль + Пароль - + Username - + Username - - + + Change connection settings - + Змінити налаштування підключення - + The port must be in the range of 1 to 65535 - + Порт повинен бути в межах від 1 до 65535 - + Password cannot be empty - + Пароль не може бути порожнім - + Username cannot be empty - + Ім'я користувача не може бути порожнім PageServiceTorWebsiteSettings - + Settings updated successfully Налаштування оновлено - + Tor website settings Налаштування сайту в мережі Тоr - + Website address Адреса сайту - + Copied Скопійовано - + Use <a href="https://www.torproject.org/download/" style="color: #FBB26A;">Tor Browser</a> to open this URL. - Використовуйте <a href="https://www.torproject.org/download/" style="color: #FBB26A;">Tor Browser</a> для відкриття цього посилання. + Використовуйте <a href="https://www.torproject.org/download/" style="color: #FBB26A;">Tor Browser</a> для відкриття цього посилання. - + After creating your onion site, it takes a few minutes for the Tor network to make it available for use. - Через кілька хвилин після встановлення ваш сайт Onion стане доступним у мережі Tor. + Через кілька хвилин після встановлення ваш сайт Onion стане доступним у мережі Tor. - + When configuring WordPress set the this onion address as domain. При налаштуванні WordPress, вкажіть цей Onion в якості домена. @@ -1141,60 +1387,61 @@ Already installed containers were found on the server. All installed containers При налаштуванні WordPress, вкажіть цей Onion в якості домена. - Remove website - Видалити сайт + Видалити сайт - The site with all data will be removed from the tor network. - Сайт з усіма даними буде видалено з мережі Tor. + Сайт з усіма даними буде видалено з мережі Tor. - Continue - Продовжити + Продовжити - Cancel - Відмінити + Відмінити PageSettings - + Settings Налаштування - + Servers Сервери - + Connection Підключення - + Application Застосунок - + Backup Резервне копіювання - + About AmneziaVPN Про AmneziaVPN + Dev console + + + + Close application Закрити застосунок @@ -1206,7 +1453,7 @@ Already installed containers were found on the server. All installed containers Підтримайте проект донатом - + Support Amnezia Підтримайте Amnezia @@ -1231,235 +1478,318 @@ Already installed containers were found on the server. All installed containers Показати інші способи на Github - + Amnezia is a free and open-source application. You can support the developers if you like it. - + Amnezia — це безкоштовний додаток з відкритим кодом. Якщо вам подобається цей додаток, ви можете підтримати розробників. - + Contacts Контакти - + Telegram group Група в Telegram - + To discuss features Для дискусій - + https://t.me/amnezia_vpn_en https://t.me/amnezia_vpn - - Mail - Пошта + + support@amnezia.org + - + Mail + Пошта + + + For reviews and bug reports Для відгуків і повідомлень про помилки - + + Copied + Скопійовано + + + GitHub GitHub - + https://github.com/amnezia-vpn/amnezia-client https://github.com/amnezia-vpn/amnezia-client - + Website Веб-сайт - https://amnezia.org - https://amnezia.org + https://amnezia.org - + Software version: %1 Версія ПЗ: %1 - + Check for updates Перевірити оновлення - + Privacy Policy - + Політика конфіденційності + + + + PageSettingsApiServerInfo + + + For the region + Для регіону + + + + Price + Ціна + + + + Work period + Період роботи + + + + Speed + Швидкість + + + + Support tag + + + + + Copied + Скопійовано + + + + Reload API config + Перезавантажити конфігурацію API + + + + Reload API config? + Перезавантажити конфігурацію API? + + + + + Continue + Продовжити + + + + + Cancel + Відмінити + + + + Cannot reload API config during active connection + Неможливо перезавантажити конфігурацію API під час активного підключення + + + + Remove from application + Видалити з додатку + + + + Remove from application? + Видалити з додатку? + + + + Cannot remove server during active connection + Неможливо видалити сервер під час активного підключення PageSettingsAppSplitTunneling - + Cannot change split tunneling settings during active connection - Не можна змінити налаштування роздільного тунелювання при підключеному VPN + Не можна змінити налаштування роздільного тунелювання при підключеному VPN - + Only the apps from the list should have access via VPN - + Доступ через VPN мають лише програми зі списку - + Apps from the list should not have access via VPN - + Програми зі списку не мають доступ через VPN - + App split tunneling - + Split tunneling для додатка - + Mode - Режим - - - - Remove - Видалити + Режим - Continue - Продовжити + Remove + Видалити + Continue + Продовжити + + + Cancel - Відмінити + Відмінити - + application name - - - - - Open executable file - + назва додатка + Open executable file + Відкрити виконуваний файл + + + Executable files (*.*) - + Виконувані файли (*.*) PageSettingsApplication - + Application Застосунок - + Allow application screenshots - Дозволити скріншоти в застосунку + Дозволити скріншоти у застосунку - + Enable notifications - + Увімкнути сповіщення - + Enable notifications to show the VPN state in the status bar - + Увімкнути сповіщення (показує стан VPN у статус барі) - + Auto start - Автозапуск + Автозапуск - + Launch the application every time the device is starts - Запускати застосунок при старті + Запускати застосунок при старті - + Auto connect - Автопідключення + Автопідключення - + Connect to VPN on app start - Підключення до VPN при старті застосунку + Підключення до VPN при старті застосунку - + Start minimized Запускати в згорнутому вигляді - + Launch application minimized Запускати застосунок в згорнутому вигляді - + Language Мова - + Logging Логування - + Enabled Увімкнено - + Disabled Вимкнено - + Reset settings and remove all data from the application Скинути налаштування і видалити всі дані із застосунку - + Reset settings and remove all data from the application? Скинути налаштування і видалити всі дані із застосунку? - + All settings will be reset to default. All installed AmneziaVPN services will still remain on the server. Всі дані із застосунку будуть видалені, всі встановлені сервіси AmneziaVPN залишаться на сервері. - + Continue Продовжити - + Cancel Відмінити - + Cannot reset settings during active connection - + Неможливо скинути налаштування під час активного підключення @@ -1469,7 +1799,7 @@ Already installed containers were found on the server. All installed containers Резервне копіювання - + Settings restored from backup file Відновлення налаштувань із бекап файлу @@ -1480,17 +1810,17 @@ Already installed containers were found on the server. All installed containers Back up your configuration - + Резервне копіювання вашої конфігурації You can save your settings to a backup file to restore them the next time you install the application. - Ви можете зберегти свої налаштування у бекап файл (резервну копію), щоб відновити їх під час наступного встановлення програми + Ви можете зберегти свої налаштування у бекап файл (резервну копію), щоб відновити їх під час наступного встановлення програми. The backup will contain your passwords and private keys for all servers added to AmneziaVPN. Keep this information in a secure place. - + Резервна копія міститиме ваші паролі та приватні ключі для всіх серверів, доданих до AmneziaVPN. Зберігайте цю інформацію у безпечному місці. @@ -1546,13 +1876,13 @@ Already installed containers were found on the server. All installed containers Cannot restore backup settings during active connection - + Неможливо відновити резервну копію налаштувань під час активного підключення PageSettingsConnection - + Connection З'єднання @@ -1565,57 +1895,57 @@ Already installed containers were found on the server. All installed containers Підключення до VPN при старті застосунку - + Use AmneziaDNS Використовувати AmneziaDNS - + If AmneziaDNS is installed on the server Якщо він встановлений на сервері - + DNS servers DNS сервер - + When AmneziaDNS is not used or installed - Ці адреси будуть використовуватись коли вимкнений AmneziaDNS + Ці адреси будуть використовуватись коли вимкнений AmneziaDNS - + Allows you to use the VPN only for certain Apps - Дозволяє використовувати VPN тільки для вибраних застосунків - - - - KillSwitch - + Дозволяє використовувати VPN тільки для вибраних застосунків + KillSwitch + KillSwitch + + + Disables your internet if your encrypted VPN connection drops out for any reason. - + Вимикає ваш інтернет, якщо ваше захищене VPN-підключення зникає з будь-якої причини. - + Cannot change killSwitch settings during active connection - + Неможливо змінити налаштування killSwitch під час активного підключення - + Site-based split tunneling Роздільне тунелювання сайтів - + Allows you to select which sites you want to access through the VPN Дозволяє доступ до одних сайтів через VPN, а для інших в обхід VPN - + App-based split tunneling Роздільне VPN-тунелювання застосунків @@ -1627,12 +1957,12 @@ Already installed containers were found on the server. All installed containers PageSettingsDns - + Default server does not support custom DNS - Сервер за замовчуванням не підтримує користувацький DNS + Сервер за замовчуванням не підтримує користувацький DNS - + DNS servers DNS сервер @@ -1641,52 +1971,52 @@ Already installed containers were found on the server. All installed containers Ці адреси будуть використовуватись, коли вимкнено або не встановлено AmneziaDNS - + If AmneziaDNS is not used or installed - Якщо AmneziaDNS вимкнено або не встановлено + Якщо AmneziaDNS вимкнено або не встановлено - + Primary DNS Основний DNS - + Secondary DNS Допоміжний DNS - + Restore default Відновити за замовчуванням - + Restore default DNS settings? Відновити налаштування DNS за замовчуванням? - + Continue Продовжити - + Cancel Відмінити - + Settings have been reset Налаштування скинуті - + Save Зберегти - + Settings saved Зберегти налаштування @@ -1694,72 +2024,108 @@ Already installed containers were found on the server. All installed containers PageSettingsLogging - Logging is enabled. Note that logs will be automatically disabled after 14 days, and all log files will be deleted. - + Логування увімкнене. Зверніть увагу, що логування буде автоматично вимкнене через 14 днів, а всі файли журналів будуть видалені. - + Logging Логування - + Enabling this function will save application's logs automatically. By default, logging functionality is disabled. Enable log saving in case of application malfunction. - + Увімкнення цієї функції автоматично зберігатиме журнали додатка. За замовчуванням функція логування вимкнена. Увімкніть збереження журналів у випадку збою додатка. - Save logs - Зберегти логи + Зберегти логи - Open folder with logs - Відкрити папку з логами + Відкрити папку з логами - + + Save Зберегти - + + Logs files (*.log) Logs files (*.log) - + + Logs file saved Файл з логами збережено - Save logs to file - Зберегти логи в файл + Зберегти логи в файл - + + Enable logs + + + + Clear logs? Очистити логи? - + Continue Продовжити - + Cancel Відмінити - + Logs have been cleaned up Логи видалено - + + Client logs + + + + + AmneziaVPN logs + + + + + + Open logs folder + + + + + + Export logs + + + + + Service logs + + + + + AmneziaVPN-service logs + + + + Clear logs Видалити логи @@ -1767,7 +2133,7 @@ Already installed containers were found on the server. All installed containers PageSettingsServerData - + All installed containers have been added to the application Всі встановлені протоколи та сервіси були додані в застосунок @@ -1784,7 +2150,7 @@ Already installed containers were found on the server. All installed containers Видалити кеш Amnezia? - + No new installed containers found Нові встановлені протоколи і сервіси не виявлені @@ -1793,105 +2159,105 @@ Already installed containers were found on the server. All installed containers - - - - - - Continue - Продовжити - + Continue + Продовжити + + + + + + Cancel Відмінити - + Check the server for previously installed Amnezia services Проверить сервер на наличие ранее установленных сервисов Amnezia - + Add them to the application if they were not displayed Додати їх в застосунок, якщо вони не були відображені - + Reboot server - Перезавантажити сервер - - - - Do you want to reboot the server? - Ви впевнені, що хочете перезавантажити сервер? + Перезавантажити сервер + Do you want to reboot the server? + Ви впевнені, що хочете перезавантажити сервер? + + + The reboot process may take approximately 30 seconds. Are you sure you wish to proceed? - Процес перезавантаження може зайняти близько 30 сек. Ви впевені, що хочете продовжити? + Процес перезавантаження може зайняти близько 30 сек. Ви впевені, що хочете продовжити? - + Cannot reboot server during active connection - + Неможливо перезавантажити сервер під час активного підключення - + Remove server from application - + Видалити сервер з додатка - + Do you want to remove the server from application? - Ви впевнені, що хочете видалити сервер із застосунку? + Ви впевнені, що хочете видалити сервер із застосунку? - + Cannot remove server during active connection - + Неможливо видалити сервер під час активного підключення - + Clear server from Amnezia software - - - - - Do you want to clear server from Amnezia software? - + Очистити сервер від програмного забезпечення Amnezia + Do you want to clear server from Amnezia software? + Ви дійсно хочете очистити сервер від програмного забезпечення Amnezia? + + + All users whom you shared a connection with will no longer be able to connect to it. - + Усі користувачі, з якими ви поділилися підключенням, більше не зможуть підключитися до нього. - + Cannot clear server from Amnezia software during active connection - + Неможливо очистити сервер від програмного забезпечення Amnezia під час активного підключення - + Cannot reset API config during active connection - + Неможливо скинути конфігурацію API під час активного підключення Do you want to clear server Amnezia-installed services? Ви хочете очистити сервер від сервісів Amnezia? - + Reset API config Скинути API конфігурацію - + Do you want to reset API config? - Ви хочете скинути API конфігурацію + Ви хочете скинути API конфігурацію? Remove this server from the app @@ -1902,7 +2268,7 @@ Already installed containers were found on the server. All installed containers Видалити сервер із застосунку? - + All installed AmneziaVPN services will still remain on the server. Всі встановлені сервіси та протоколи Amnezia все ще залишаться на сервері. @@ -1922,29 +2288,29 @@ Already installed containers were found on the server. All installed containers PageSettingsServerInfo - + Server name Імя сервера - + Save Зберегти - + Protocols Протоколи - + Services Сервіси - + Management - + Управління Data @@ -1954,29 +2320,53 @@ Already installed containers were found on the server. All installed containers PageSettingsServerProtocol - + settings Налаштування - Clear %1 profile + Очистити профіль %1 + + + + connection settings - + + Click the "connect" button to create a connection configuration + + + + + server settings + + + + + Clear profile + + + + Clear %1 profile? + Очистити профіль %1? + + + + The connection configuration will be deleted for this device only - + Unable to clear %1 profile while there is an active connection - + Неможливо очистити профіль %1 під час активного підключення - + Cannot remove active container - + Неможливо видалити активний контейнер @@ -1984,17 +2374,17 @@ Already installed containers were found on the server. All installed containers - + Remove Видалити - + Remove %1 from server? Видалити %1 з сервера? - + All users with whom you shared a connection will no longer be able to connect to it. Користувачі, з якими ви поділились цим протоколм, більше не зможуть до нього підключитись. @@ -2003,14 +2393,14 @@ Already installed containers were found on the server. All installed containers Користувачі, з якими ви поділились цим протоколм, більше не зможуть до нього підключитись. - - + + Continue Продовжити - - + + Cancel Відмінити @@ -2018,7 +2408,7 @@ Already installed containers were found on the server. All installed containers PageSettingsServersList - + Servers Сервери @@ -2030,32 +2420,32 @@ Already installed containers were found on the server. All installed containers Тільки адреси із списку мають відкриватись через VPN - + Addresses from the list should not be accessed via VPN Адреси із списку не повинні відкриватись через VPN - + Split tunneling Роздільне VPN-тунелювання - + Mode Режим - + Remove Видалити - + Continue Продовжити - + Cancel Відмінити @@ -2064,80 +2454,125 @@ Already installed containers were found on the server. All installed containers Сайт чи IP - + Import / Export Sites Імпорт / Експорт Сайтів - + Only the sites listed here will be accessed through the VPN Тільки адреси зі списку повинні відкриватись через VPN - + Cannot change split tunneling settings during active connection - Не можна змінити налаштування роздільного тунелювання при підключеному VPN + Не можна змінити налаштування роздільного тунелювання при підключеному VPN - + Default server does not support split tunneling function - + - + website or IP - вебсайт або IP + вебсайт або IP - + Import Імпорт - + Save site list Зберегти список сайтів - + Save sites Зберегти - - - + + + Sites files (*.json) Sites files (*.json) - + Import a list of sites Імпортувати список із сайтами - + Replace site list Замінити список із сайтами - - + + Open sites file Відкрити список із сайтами - + Add imported sites to existing ones Додати імпортовані сайти до існуючих + + PageSetupWizardApiServiceInfo + + + For the region + Для регіону + + + + Price + Ціна + + + + Work period + Період роботи + + + + Speed + Швидкість + + + + Features + Особливості + + + + Connect + Підключитись + + + + PageSetupWizardApiServicesList + + + VPN by Amnezia + VPN від Amnezia + + + + Choose a VPN service that suits your needs. + Виберіть VPN-сервіс, який відповідає вашим потребам. + + PageSetupWizardConfigSource - Server connection - Підключення до сервера + Підключення до сервера Do not use connection code from public sources. It may have been created to intercept your data. @@ -2148,39 +2583,115 @@ It's okay as long as it's from someone you trust. Все в порядку, якщо ви використовуєте код, яким поділився користувач, якому ви довіряєте. - Do not use connection codes from untrusted sources, as they may be created to intercept your data. - Не використовуйте код підключення з загальнодоступних джерел. Можливо, його було створено для перехоплення ваших даних. + Не використовуйте код підключення з загальнодоступних джерел. Можливо, його було створено для перехоплення ваших даних. - What do you have? - Виберіть що у вас є + Виберіть що у вас є - + File with connection settings Файл з налаштуваннями підключення - File with connection settings or backup - Файл з налаштуваннями підключення або бекап + Файл з налаштуваннями підключення або бекап - + + Connection + Підключення + + + + Settings + Налаштування + + + + Enable logs + + + + + Insert the key, add a configuration file or scan the QR-code + Вставте ключ, додайте файл конфігурації або відскануйте QR-код + + + + Insert key + Вставити ключ + + + + Insert + Вставити + + + + Continue + Продовжити + + + + Other connection options + Інші параметри підключення + + + + VPN by Amnezia + VPN від Amnezia + + + + Connect to classic paid and free VPN services from Amnezia + Підключайтеся до звичайних платних та безкоштовних VPN-сервісів від Amnezia + + + + Self-hosted VPN + Self-hosted VPN + + + + Configure Amnezia VPN on your own server + Налаштуйте Amnezia VPN на власному сервері + + + + Restore from backup + Відновити із бекапа + + + + Open backup file + Відкрити бекап файл + + + + Backup files (*.backup) + Файли резервної копії (*.backup) + + + Open config file Відкрити файл з конфігурацією - + QR code QR-код - + + I have nothing + У мене нічого нема + + Key as text - Ключ у вигляді тексту + Ключ у вигляді тексту @@ -2190,7 +2701,7 @@ It's okay as long as it's from someone you trust. Підключення до сервера - + Server IP address [:port] Server IP address [:port] @@ -2203,7 +2714,7 @@ It's okay as long as it's from someone you trust. Password / SSH private key - + Continue Продовжити @@ -2214,7 +2725,7 @@ and will not be shared or disclosed to the Amnezia or any third parties і не будуть передані чи розголошені Amnezia або будь-яким третім особам - + Enter the address in the format 255.255.255.255:88 Введіть адресу в форматі 255.255.255.255:88 @@ -2223,42 +2734,52 @@ and will not be shared or disclosed to the Amnezia or any third parties Login to connect via SSH - + Configure your server Налаштувати свій сервер - + 255.255.255.255:22 - + 255.255.255.255:22 - + SSH Username - + SSH Username - + Password or SSH private key - + Пароль або SSH ключ - + All data you enter will remain strictly confidential and will not be shared or disclosed to the Amnezia or any third parties - Усі дані, які ви вводите, залишатимуться суворо конфіденційними та не будуть передані чи розголошені Amnezia або будь-яким третім особам + Усі дані, які ви вводите, залишатимуться суворо конфіденційними та не будуть передані чи розголошені Amnezia або будь-яким третім особам - + + How to run your VPN server + Як запустити ваш VPN-сервер + + + + Where to get connection data, step-by-step instructions for buying a VPS + Де отримати дані для підключення: покрокові інструкції з придбання VPS + + + Ip address cannot be empty Поле IP address не може бути пустим - + Login cannot be empty Поле Login не може бути пустим - + Password/private key cannot be empty Поле Password/Private key не може бути пустим @@ -2266,19 +2787,19 @@ and will not be shared or disclosed to the Amnezia or any third parties PageSetupWizardEasy - + What is the level of internet control in your region? Який рівень контроля над інтернетом у вашому регіоні? - + Choose a VPN protocol - + Виберіть протокол VPN - + Skip setup - + Пропустити налаштування Set up a VPN yourself @@ -2289,7 +2810,7 @@ and will not be shared or disclosed to the Amnezia or any third parties Вибрати VPN-протокол - + Continue Продовжити @@ -2301,7 +2822,7 @@ and will not be shared or disclosed to the Amnezia or any third parties PageSetupWizardInstalling - + The server has already been added to the application Сервер уже додано в застосунок @@ -2314,33 +2835,33 @@ and will not be shared or disclosed to the Amnezia or any third parties зайнятий встановленням інших протоколів та сервісів. Встановлення Amnezia - + Amnezia has detected that your server is currently Amnezia виявила, що сервер - + busy installing other software. Amnezia installation зайнятий встановленням інших протоколів та сервісів. Встановлення Amnezia - + will pause until the server finishes installing other software буде призупинено, поки сервер не завершить встановлення - + Installing Встановлення - + Cancel installation - Відмінити встановлення + Відмінити встановлення - - + + Usually it takes no more than 5 minutes Зазвичай, займає не більше 5 хвилин @@ -2348,50 +2869,50 @@ and will not be shared or disclosed to the Amnezia or any third parties PageSetupWizardProtocolSettings - + Installing %1 Встановити %1 - + More detailed Детальніше - + Close Закрити - + Network protocol Мережевий протокол - + Port Порт - + Install Встановити - + The port must be in the range of 1 to 65535 - + Порт повинен бути в межах від 1 до 65535 PageSetupWizardProtocols - + VPN protocol VPN протокол - + Choose the one with the highest priority for you. Later, you can install other protocols and additional services, such as DNS proxy and SFTP. Виберіть протокол, який вам більше підходить. Пізніше можна встановити інші протоколи і додаткові сервіси, такі як DNS-проксі, TOR-сайт и SFTP. @@ -2399,68 +2920,63 @@ and will not be shared or disclosed to the Amnezia or any third parties PageSetupWizardQrReader - + Point the camera at the QR code and hold for a couple of seconds. - Наведіть камеру на QR-код і утримуйте її протягом декількох секунд. + Наведіть камеру на QR-код і утримуйте її протягом декількох секунд. PageSetupWizardStart - Settings restored from backup file - Відновлення налаштувань із бекап файлу + Відновлення налаштувань із бекап файлу - Free service for creating a personal VPN on your server. - Простий і безкоштовний застосунок для запуска self-hosted VPN з високими вимогами до приватності. + Простий і безкоштовний застосунок для запуска self-hosted VPN з високими вимогами до приватності. - Helps you access blocked content without revealing your privacy, even to VPN providers. - Допомагає отримати доступ до заблокованого вмісту, не повідомляючи про вашу конфіденційність, навіть постачальникам VPN. + Допомагає отримати доступ до заблокованого вмісту, не повідомляючи про вашу конфіденційність, навіть постачальникам VPN. - I have the data to connect - У мене є дані для підключення + У мене є дані для підключення - I have nothing - У мене нічого нема + У мене нічого нема - - https://amnezia.org/instructions/0_starter-guide - + + Let's get started + Почнемо PageSetupWizardTextKey - + Connection key Ключ для підключення - + A line that starts with vpn://... Стрічка, яка починається з vpn://... - + Key Ключ - + Insert Вставити - + Continue Продовжити @@ -2468,7 +2984,7 @@ and will not be shared or disclosed to the Amnezia or any third parties PageSetupWizardViewConfig - + New connection Нове підключення @@ -2481,27 +2997,27 @@ and will not be shared or disclosed to the Amnezia or any third parties Не використовуйте код підключення з загальнодоступних джерел. Він може бути створений для перехоплення ваших даних. - + Collapse content Згорнути - + Show content Показати вміст ключа - + Enable WireGuard obfuscation. It may be useful if WireGuard is blocked on your provider. - + Увімкніть обфускацію WireGuard. Це може бути корисним, якщо WireGuard заблокований у вашого провайдера. - + Use connection codes only from sources you trust. Codes from public sources may have been created to intercept your data. - + Використовуйте коди підключення тільки з джерел, яким ви довіряєте. Коди з публічних джерел можуть бути створені для перехоплення ваших даних. - + Connect Підключитись @@ -2509,12 +3025,12 @@ and will not be shared or disclosed to the Amnezia or any third parties PageShare - + OpenVPN native format OpenVPN нативний формат - + WireGuard native format WireGuard нативний формат @@ -2523,7 +3039,7 @@ and will not be shared or disclosed to the Amnezia or any third parties VPN-Доступ - + Connection З'єднання @@ -2536,8 +3052,8 @@ and will not be shared or disclosed to the Amnezia or any third parties Доступ до керування сервером. Користувач, з яким ви ділитесь повним доступом до підключення, зможе додавати та видаляти протоколи і служби на сервері, а також змінювати налаштування. - - + + Server Сервер @@ -2546,194 +3062,194 @@ and will not be shared or disclosed to the Amnezia or any third parties Доступ - + Config revoked - Кофігурацію відкликано + Кофігурацію відкликано - + Connection to Підключення до - + File with connection settings to Файл з налаштуванням доступу до - + Save OpenVPN config Зберегти OpenVPN конфігурацію - + Save WireGuard config Збергти WireGuard конфігурацію - + Save AmneziaWG config - Зберегти AmneziaWG конфігурацію + Зберегти AmneziaWG конфігурацію - + Save Shadowsocks config - Зберегти конфігурацію Shadowsocks + Зберегти конфігурацію Shadowsocks - + Save Cloak config - Зберегти конфігурацію Cloak + Зберегти конфігурацію Cloak - + Save XRay config - + Зберегти конфігурацію XRay - + For the AmneziaVPN app Для AmneziaVPN - + AmneziaWG native format - нативний формат AmneziaWG + нативний формат AmneziaWG - + Shadowsocks native format - Shadowsocks нативний формат + Shadowsocks нативний формат - + Cloak native format - Cloak нативний формат + Cloak нативний формат - + XRay native format - + XRay нативний формат - + Share VPN Access Поділитись VPN з'єднанням - + Share full access to the server and VPN - Поділитись повним доступом до серверу + Поділитись повним доступом до серверу - + Use for your own devices, or share with those you trust to manage the server. - Використовуйте для власних пристроїв або передайте керування сервером тим, кому довіряєте. + Використовуйте для власних пристроїв або передайте керування сервером тим, кому довіряєте. - - + + Users - Користувачі + Користувачі - + User name - Ім'я користувача + Ім'я користувача - + Search - Пошук + Пошук - + Creation date: %1 - + Дата створення: %1 - + Latest handshake: %1 - + Останнє з'єднання: %1 - + Data received: %1 - + Отримано даних: %1 - + Data sent: %1 - + Відправлено даних: %1 Creation date: Дата створення: - + Rename - Перейменувати + Перейменувати - + Client name - + Назва клієнта - + Save - Зберегти - - - - Revoke - Відкликати - - - - Revoke the config for a user - %1? - Відкликати доступ для користувача - %1? - - - - The user will no longer be able to connect to your server. - Користувач більше не зможе підключатись до вашого сервера + Зберегти - Continue - Продовжити + Revoke + Відкликати - + + Revoke the config for a user - %1? + Відкликати доступ для користувача - %1? + + + + The user will no longer be able to connect to your server. + Користувач більше не зможе підключатись до вашого сервера + + + + Continue + Продовжити + + + Cancel - Відмінити + Відмінити Full access Повний доступ - + Share VPN access without the ability to manage the server Поділитись доступом до VPN, без можливості керування сервером - - + + Protocol Протокол - - + + Connection format Формат підключення - - + + Share Поділитись @@ -2741,65 +3257,80 @@ and will not be shared or disclosed to the Amnezia or any third parties PageShareFullAccess - + Full access to the server and VPN - Повний доступ до серверу та VPN - - - - We recommend that you use full access to the server only for your own additional devices. - - Ми рекомендуємо використовувати повний доступ тілки для власних пристроїв. + Повний доступ до серверу та VPN + We recommend that you use full access to the server only for your own additional devices. + + Ми рекомендуємо використовувати повний доступ тілки для власних пристроїв. + + + If you share full access with other people, they can remove and add protocols and services to the server, which will cause the VPN to work incorrectly for all users. - Якщо ви ділитеся повним доступом з іншими людьми, вони можуть видаляти та додавати протоколи та служби на сервер, що призведе до некоректної роботи VPN для всіх користувачів. + Якщо ви ділитеся повним доступом з іншими людьми, вони можуть видаляти та додавати протоколи та служби на сервер, що призведе до некоректної роботи VPN для всіх користувачів. - + Server - Сервер - - - - Accessing - Доступ + Сервер + Accessing + Доступ + + + File with accessing settings to - Файл з налаштуваннями доступу до + Файл з налаштуваннями доступу до - + Share - Поділитись + Поділитись - + + Access error! + Помилка доступу! + + + Connection to - Підключення до + Підключення до - + File with connection settings to - Файл з налаштуванням доступу до + Файл з налаштуванням доступу до PageStart - + Logging was disabled after 14 days, log files were deleted + Логування було вимкнене через 14 днів, файли журналів були видалені + + + + Settings restored from backup file + Відновлення налаштувань із бекап файлу + + + + Logging is enabled. Note that logs will be automaticallydisabled after 14 days, and all log files will be deleted. PopupType - + Close Закрити @@ -2833,12 +3364,12 @@ and will not be shared or disclosed to the Amnezia or any third parties Пароль не знайдено - + Could not open keystore Could not open keystore - + Could not remove private key from keystore Could not remove private key from keystore @@ -3014,27 +3545,27 @@ and will not be shared or disclosed to the Amnezia or any third parties Could not open keystore - + Could not create private key generator Could not create private key generator - + Could not generate new private key Could not generate new private key - + Could not retrieve private key from keystore Could not retrieve private key from keystore - + Could not create encryption cipher Could not create encryption cipher - + Could not encrypt data Could not encrypt data @@ -3200,7 +3731,7 @@ and will not be shared or disclosed to the Amnezia or any third parties Ця конфігурація вже була додана в застосунок - + ErrorCode: %1. @@ -3279,37 +3810,42 @@ and will not be shared or disclosed to the Amnezia or any third parties - - QFile error: The file could not be opened + + Missing AGW public key - QFile error: An error occurred when reading from the file + QFile error: The file could not be opened - QFile error: The file could not be accessed + QFile error: An error occurred when reading from the file - QFile error: An unspecified error occurred + QFile error: The file could not be accessed - QFile error: A fatal error occurred + QFile error: An unspecified error occurred + QFile error: A fatal error occurred + + + + QFile error: The operation was aborted - + Internal error Internal error @@ -3321,22 +3857,22 @@ and will not be shared or disclosed to the Amnezia or any third parties Shadowsocks - masks VPN traffic, making it similar to normal web traffic, but it may be recognized by analysis systems in some highly censored regions. - Shadowsocks - маскує VPN-трафік під звичайний веб-трафік, але розпізнається системами аналізу трафіка в деяких регіонах з високим рівнем цензури. + Shadowsocks - маскує VPN-трафік під звичайний веб-трафік, але розпізнається системами аналізу трафіка в деяких регіонах з високим рівнем цензури. OpenVPN over Cloak - OpenVPN with VPN masquerading as web traffic and protection against active-probing detection. Ideal for bypassing blocking in regions with the highest levels of censorship. - OpenVPN over Cloak - OpenVPN з маскуванням VPN під HTTPS трафік і захистом від active-probing. Підходить для регіонів з самим високим рівнем цензури. + OpenVPN over Cloak - OpenVPN з маскуванням VPN під HTTPS трафік і захистом від active-probing. Підходить для регіонів з самим високим рівнем цензури. IKEv2/IPsec - Modern stable protocol, a bit faster than others, restores connection after signal loss. It has native support on the latest versions of Android and iOS. - + IKEv2/IPsec — сучасний стабільний протокол, який дещо швидший за інші та відновлює підключення після втрати сигналу. Має нативну підтримку на останніх версіях Android та iOS. Create a file vault on your server to securely store and transfer files. - Створіть на сервері файлове сховище для безпечного зберігання та передачі файлів. + Створіть на сервері файлове сховище для безпечного зберігання та передачі файлів. @@ -3358,7 +3894,24 @@ If there is a extreme level of Internet censorship in your region, we advise you * Not recognised by DPI analysis systems * Works over TCP network protocol, 443 port. - + Це комбінація протоколу OpenVPN та плагіна Cloak, розроблена спеціально для захисту від блокувань. + +OpenVPN забезпечує безпечне VPN-підключення шляхом шифрування всього інтернет-трафіку між клієнтом і сервером. + +Cloak захищає OpenVPN від виявлення та блокування. + +Cloak може змінювати метадані пакетів так, що повністю маскує VPN-трафік як звичайний веб-трафік і також захищає VPN від виявлення за допомогою активного сканування. Це робить його дуже стійким до виявлення. + +Одразу після отримання першого пакета даних Cloak аутентифікує вхідне підключення. Якщо аутентифікація не вдається, плагін маскує сервер як фальшивий вебсайт, і ваш VPN стає невидимим для систем аналізу. + +Якщо у вашому регіоні екстремальний рівень інтернет-цензури, ми радимо використовувати тільки OpenVPN через Cloak з самого початку роботи з додатком. + + Доступний в AmneziaVPN на всіх платформах + Високе споживання енергії на мобільних пристроях + Гнучкі налаштування + Не розпізнається системами аналізу DPI + Працює через TCP мережевий протокол, порт 443. + @@ -3371,7 +3924,16 @@ WireGuard is very susceptible to blocking due to its distinct packet signatures. * Minimum number of settings * Easily recognised by DPI analysis systems, susceptible to blocking * Works over UDP network protocol. - + Відносно новий популярний VPN-протокол з спрощеною архітектурою. +WireGuard забезпечує стабільне VPN-підключення та високу продуктивність на всіх пристроях. Він використовує жорстко закодовані налаштування шифрування. Порівняно з OpenVPN, WireGuard має нижчу затримку та кращу пропускну здатність передачі даних. + +WireGuard дуже чутливий до блокувань через свої чіткі підписи пакетів. На відміну від деяких інших VPN-протоколів, які використовують техніки обфускації, постійні шаблони підписів пакетів WireGuard легше ідентифікуються та можуть бути заблоковані просунутими системами глибокого аналізу пакетів (DPI) та іншими інструментами моніторингу мережі. + +* Доступний в AmneziaVPN на всіх платформах +* Низьке споживання енергії +* Мінімальна кількість налаштувань +* Легко розпізнається системами аналізу DPI, схильний до блокування +* Працює через UDP мережевий протокол. @@ -3379,7 +3941,10 @@ WireGuard is very susceptible to blocking due to its distinct packet signatures. It uniquely identifies censors during the TLS handshake phase, seamlessly operating as a proxy for legitimate clients while diverting censors to genuine websites like google.com, thus presenting an authentic TLS certificate and data. This advanced capability differentiates REALITY from similar technologies by its ability to disguise web traffic as coming from random, legitimate sites without the need for specific configurations. Unlike older protocols such as VMess, VLESS, and the XTLS-Vision transport, REALITY's innovative "friend or foe" recognition at the TLS handshake enhances security and circumvents detection by sophisticated DPI systems employing active probing techniques. This makes REALITY a robust solution for maintaining internet freedom in environments with stringent censorship. - + Протокол **REALITY**, сучасна розробка XRay. Спеціально розроблений для протидії найвищим рівням інтернет-цензури завдяки новому підходу до маскування. +REALITY унікально ідентифікує цензорів під час фази TLS-handshake, працюючи як проксі для VPN клієнтів, при цьому перенаправляючи цензорів на справжні вебсайти, такі як google.com, надаючи справжній TLS-сертифікат та інші дані. +Цей функціонал, відрізняє REALITY від подібних технологій, своєю здатністю маскувати веб-трафік у такий такий, що походить із випадкових справжніх сайтів без необхідності спеціальних налаштувань. +На відміну від старіших протоколів, таких як VMess, VLESS та XTLS-Vision transport, продвиуте розпізнавання "Свій — Чужий" REALITY під час TLS-handshake підвищує безпеку та протидіє виявленню складними системами DPI, що використовують активні техніки аналізу. Це робить REALITY надійним рішенням для підтримання інтернет-свободи в середовищах з жорсткою цензурою. @@ -3441,7 +4006,7 @@ While it offers a blend of security, stability, and speed, it's essential t XRay with REALITY - Suitable for countries with the highest level of internet censorship. Traffic masking as web traffic at the TLS level, and protection against detection by active probing methods. - + XRay with REALITY — підходить для країн з найвищим рівнем інтернет-цензури. Маскування трафіку під веб-трафік на рівні TLS. Захист від виявлення активними методами сканування (active-probing). IKEv2/IPsec - Modern stable protocol, a bit faster than others, restores connection after signal loss. @@ -3501,7 +4066,14 @@ It employs its unique security protocol, leveraging the strength of SSL/TLS for For more detailed information, you can find it in the support section under "Create SFTP file storage." - + Після встановлення Amnezia створить + + файл-сховище на вашому сервері. Ви зможете отримати + доступ до нього за допомогою FileZilla та інших SFTP-клієнтів, +а також змонтувати диск на вашому пристрої для безпосереднього доступу до нього. + +Для більш детальної інформації зверніться + до розділу підтримки під заголовком «Створення SFTP файл-сховища». This is a combination of the OpenVPN protocol and the Cloak plugin designed specifically for blocking protection. @@ -3599,7 +4171,7 @@ This means that AmneziaWG keeps the fast performance of the original while addin SOCKS5 proxy server - + SOCKS5 proxy server @@ -3791,7 +4363,7 @@ This means that AmneziaWG keeps the fast performance of the original while addin SelectLanguageDrawer - + Choose language Выберите язык @@ -3799,13 +4371,13 @@ This means that AmneziaWG keeps the fast performance of the original while addin Settings - + Server #1 Server #1 - - + + Server Server @@ -3813,7 +4385,7 @@ This means that AmneziaWG keeps the fast performance of the original while addin SettingsController - + All settings have been reset to default values Всі налаштування були скинуті до значення "По замовчуванню" @@ -3822,7 +4394,7 @@ This means that AmneziaWG keeps the fast performance of the original while addin Кеш профілю очищено - + Backup file is corrupted Backup файл пошкодженно @@ -3830,39 +4402,39 @@ This means that AmneziaWG keeps the fast performance of the original while addin ShareConnectionDrawer - - + + Save AmneziaVPN config Зберегти config AmneziaVPN - + Share Поділитись - + Copy Скопіювати - - + + Copied Скопійовано - + Copy config string - Скопіювати стрічку конфігурації + Скопіювати стрічку конфігурації - + Show connection settings - Показати налаштування підключення + Показати налаштування підключення - + To read the QR code in the Amnezia app, select "Add server" → "I have data to connect" → "QR code, key or settings file" Для зчитування QR-коду в застосунку Amnezia виберіть "Додати сервер" → "У мене є дані підключенн" → "QR-код, ключ чи файл налаштувань" @@ -3946,7 +4518,7 @@ This means that AmneziaWG keeps the fast performance of the original while addin TextFieldWithHeaderType - + The field can't be empty Поле не може бути пустим @@ -3954,7 +4526,7 @@ This means that AmneziaWG keeps the fast performance of the original while addin VpnConnection - + Mbps Mbps @@ -4005,12 +4577,12 @@ This means that AmneziaWG keeps the fast performance of the original while addin amnezia::ContainerProps - + Low Низький - + High Високий @@ -4019,12 +4591,12 @@ This means that AmneziaWG keeps the fast performance of the original while addin Екстремальний - + I just want to increase the level of my privacy. Я просто хочу підвищити свій рівень безпеки в інтернеті. - + I want to bypass censorship. This option recommended in most cases. Я хочу обійти блокування. Цей варіант рекомендується в більшості випадків. @@ -4052,12 +4624,12 @@ This means that AmneziaWG keeps the fast performance of the original while addin main2 - + Private key passphrase Пароль для особистого ключа - + Save Зберегти diff --git a/client/translations/amneziavpn_ur_PK.ts b/client/translations/amneziavpn_ur_PK.ts index 05d06466..cf445bfa 100644 --- a/client/translations/amneziavpn_ur_PK.ts +++ b/client/translations/amneziavpn_ur_PK.ts @@ -1,6 +1,59 @@ + + ApiServicesModel + + + Classic VPN for comfortable work, downloading large files and watching videos. Works for any sites. Speed up to %1 MBit/s + + + + + VPN to access blocked sites in regions with high levels of Internet censorship. + + + + + <p><a style="color: #EB5757;">Not available in your region. If you have VPN enabled, disable it, return to the previous screen, and try again.</a> + + + + + Amnezia Premium - A classic VPN for comfortable work, downloading large files, and watching videos in high resolution. It works for all websites, even in countries with the highest level of internet censorship. + + + + + Amnezia Free is a free VPN to bypass blocking in countries with high levels of internet censorship + + + + + %1 MBit/s + + + + + %1 days + + + + + VPN will open only popular sites blocked in your region, such as Instagram, Facebook, Twitter and others. Other sites will be opened from your real IP address, <a href="%1/free" style="color: #FBB26A;">more details on the website.</a> + + + + + Free + + + + + %1 $/month + + + AppSplitTunnelingController @@ -27,7 +80,7 @@ ConnectButton - + Unable to disconnect during configuration preparation تشکیل کی تیاری کے دوران منقطع ہونا ممکن نہیں ہے @@ -35,61 +88,61 @@ ConnectionController - - - + + + Connect جوڑنا - + The selected protocol is not supported on the current platform منتخب کردہ پروٹوکول موجودہ پلیٹ فارم پر تعاون یافتہ نہیں ہے - + VPN Protocols is not installed. Please install VPN container at first وی پی این پروٹوکول انسٹال نہیں ہے,براہ کرم پہلےوی پی این کنٹینر انسٹال کریں - + unable to create configuration تشکیل تیار کرنے میں ناکام - + Connecting... جوڑاجارھاھے.... - + Connected جوڑاجارھاھے - + Reconnecting... دوبارہ جوڑنےکی کوشش... - + Disconnecting... منقطع کرنا... - + Preparing... تیاری کیا جا رہا ہے... - + Settings updated successfully, reconnnection... ترتیب ک ھوگی،دوبارہ جوڑنےکی کوشش... - + Settings updated successfully دوبارہ ترتیب تاذہ کامیاب @@ -130,7 +183,7 @@ چ&سپاںکریں - + &SelectAll &تمام منتخب کریں @@ -138,9 +191,8 @@ ExportController - Access error! - رساءی ناممکن! + رساءی ناممکن! @@ -205,18 +257,18 @@ Can't be disabled for current server فائل کو کھولنے سے قاصر ہے - - + + Invalid configuration file غلط کنفیگریشن فائل - + Scanned %1 of %2. سکین%1 کی%2. - + In the imported configuration, potentially dangerous lines were found: @@ -224,84 +276,104 @@ Can't be disabled for current server InstallController - + %1 installed successfully. %1 کامیابی سےنصب. - + %1 is already installed on the server. %1 پہلے ہی سرور پر انسٹال ہے. - + Added containers that were already installed on the server وہ کنٹینرز شامل کیے گئے جو پہلے سے سرور پر نصب تھے - + Already installed containers were found on the server. All installed containers have been added to the application سرور پر پہلے سے نصب کنٹینرز پائے گئے۔ تمام نصب کنٹینرز کو ایپلی کیشن میں شامل کر دیا گیا ہے - + Settings updated successfully ترتیب کامیابی کے ساتھ اپ ڈیٹ ہو گئی - + Server '%1' was rebooted سرور %1 دوبارہ چالو کیا گیا تھا - + Server '%1' was removed سرور %1 ہٹا دیا گیا تھا - + All containers from server '%1' have been removed سرور '%1' سے تمام کنٹینرز ہٹا دیے گئے ہیں - + %1 has been removed from the server '%2' سرور '%2' سے %1 ہٹا دیا گیا ہے - + + Api config removed + + + + %1 cached profile cleared %1 کیش کردہ پروفائل ختم کر دی گئی - + Please login as the user براہ کرم صارف کے طور پر لاگ ان کریں - + Server added successfully سرور کامیابی سے شامل کیا گیا + + + %1 installed successfully. + + + + + API config reloaded + + + + + Successfully changed the country of connection to %1 + + InstalledAppsDrawer - + Choose application ایپلیکیشن کو منتخب کریں - + application name ایپلیکیشن کا نام - + Add selected ایپلیکیشن کا نام @@ -358,103 +430,213 @@ Already installed containers were found on the server. All installed containers PageDeinstalling - + Removing services from %1 سروسز کو %1 سے ہٹایا جا رہا ہے - + Usually it takes no more than 5 minutes عام طور پر اس میں 5 منٹ سے زیادہ نہیں لگتا ہے + + PageDevMenu + + + Gateway endpoint + + + + + Dev gateway environment + + + PageHome - + Logging enabled لاگنگ فعال ہے - + Split tunneling enabled سپلٹ ٹنلنگ فعال ہے - + Split tunneling disabled سپلٹ ٹنلنگ غیر فعال ہے - + VPN protocol وی پی این پروٹوکول - + Servers سرور - + Unable change server while there is an active connection فعال کنکشن موجود ہونے کی وجہ سے سرور تبدیل کرنے میں ناکام ہیں + + PageProtocolAwgClientSettings + + + AmneziaWG settings + امنیزیا وی جی کی ترتیبات + + + + MTU + ام ٹی یو + + + + Server settings + + + + + Port + پورٹ + + + + Save + + + + + Save settings? + ترتیبات محفوظ کریں? + + + + Only the settings for this device will be changed + + + + + Continue + + + + + Cancel + + + + + Unable change settings while there is an active connection + جب ایک فعال کنکشن موجود ہو تو ترتیبات کو تبدیل نہیں کیا جا سکتا + + PageProtocolAwgSettings - + AmneziaWG settings امنیزیا وی جی کی ترتیبات - + Port پورٹ - MTU - ام ٹی یو + ام ٹی یو - + All users with whom you shared a connection with will no longer be able to connect to it. آپ جن لوگوں کے ساتھ آپ نے اس کنکشن کا اشتراک کیا تھا، وہ اس سے مزید جڑ نہیں سکیں گے۔ - + Save محفوظ کریں - + + Jc - Junk packet count + + + + + Jmin - Junk packet minimum size + + + + + Jmax - Junk packet maximum size + + + + + S1 - Init packet junk size + + + + + S2 - Response packet junk size + + + + + H1 - Init packet magic header + + + + + H2 - Response packet magic header + + + + + H4 - Transport packet magic header + + + + + H3 - Underload packet magic header + + + + The values of the H1-H4 fields must be unique H1 تا H4 فیلڈز کی قیمتیں مخصوص ہونی چاہیے - + The value of the field S1 + message initiation size (148) must not equal S2 + message response size (92) S1 + پیغام شروع کار (148) کے فیلڈ کی قیمت S2 + پیغام جواب (92) کے سائز کے برابر نہیں ہونی چاہئے - + Save settings? ترتیبات محفوظ کریں? - + Continue جاری رکھیں - + Cancel منسوخ کریں - + Unable change settings while there is an active connection جب ایک فعال کنکشن موجود ہو تو ترتیبات کو تبدیل نہیں کیا جا سکتا @@ -462,33 +644,33 @@ Already installed containers were found on the server. All installed containers PageProtocolCloakSettings - + Cloak settings پوشیدہ ترتیب - + Disguised as traffic from کے طور پر ٹریفک کی طرح - + Port پورٹ - + Cipher رمز - + Save محفوظ کریں - + Unable change settings while there is an active connection جب ایک فعال کنکشن موجود ہو تو ترتیبات کو تبدیل نہیں کیا جا سکتا @@ -496,175 +678,175 @@ Already installed containers were found on the server. All installed containers PageProtocolOpenVpnSettings - + OpenVPN settings اوپن وی پی این ترتیبات - + VPN address subnet وی پی این ایڈریس سب نیٹ - + Network protocol نیٹ ورک پروٹوکول - + Port پورٹ - + Auto-negotiate encryption خود کار مذاکرتی رمزنگاری - + Hash ہیش - + SHA512 - + SHA384 - + SHA256 - + SHA3-512 - + SHA3-384 - + SHA3-256 - + whirlpool بھنور - + BLAKE2b512 - + BLAKE2s256 - + SHA1 - + Cipher رمز - + AES-256-GCM - + AES-192-GCM - + AES-128-GCM - + AES-256-CBC - + AES-192-CBC - + AES-128-CBC - + ChaCha20-Poly1305 - + ARIA-256-CBC - + CAMELLIA-256-CBC - + none کوئی نہیں - + TLS auth TLS توثیق - + Block DNS requests outside of VPN وی پی این کے باہر DNS درخواستوں کو بلاک کریں - + Additional client configuration commands مزید کلائنٹ ترتیباتی احکامات - - + + Commands: احکامات: - + Additional server configuration commands اضافی سرور کنفیگریشن احکامات - + Unable change settings while there is an active connection جب ایک فعال کنکشن موجود ہو تو ترتیبات کو تبدیل نہیں کیا جا سکتا - + Save احفظ @@ -672,42 +854,42 @@ Already installed containers were found on the server. All installed containers PageProtocolRaw - + settings ترتیبات - + Show connection options کنکشن کے اختیارات دکھائیں - + Connection options %1 کنکشن کے اختیارات %1 - + Remove ہٹائیں - + Remove %1 from server? سرور سے %1 کو ہٹائیں؟ - + All users with whom you shared a connection with will no longer be able to connect to it. آپ جن لوگوں کے ساتھ آپ نے ایک کنکشن شیئر کیا تھا، وہ اب اس سے مزید جڑ نہیں سکیں گے. - + Continue جاری رکھیں - + Cancel منسوخ کریں @@ -715,56 +897,128 @@ Already installed containers were found on the server. All installed containers PageProtocolShadowSocksSettings - + Shadowsocks settings شیڈو ساکس ترتیبات - + Port پورٹ - + Cipher رمز - + Save محفوظ کریں - + Unable change settings while there is an active connection جب ایک فعال کنکشن موجود ہو تو ترتیبات کو تبدیل نہیں کیا جا سکتا + + PageProtocolWireGuardClientSettings + + + WG settings + وائر گارڈ ترتیبات + + + + MTU + ام ٹی یو + + + + Server settings + + + + + Port + پورٹ + + + + Save + + + + + Save settings? + ترتیبات محفوظ کریں? + + + + Only the settings for this device will be changed + + + + + Continue + + + + + Cancel + + + + + Unable change settings while there is an active connection + جب ایک فعال کنکشن موجود ہو تو ترتیبات کو تبدیل نہیں کیا جا سکتا + + PageProtocolWireGuardSettings - + WG settings وائر گارڈ ترتیبات - + Port پورٹ - - MTU - ام ٹی یو + + Save settings? + ترتیبات محفوظ کریں? - + + All users with whom you shared a connection with will no longer be able to connect to it. + + + + + Continue + + + + + Cancel + + + + MTU + ام ٹی یو + + + Unable change settings while there is an active connection جب ایک فعال کنکشن موجود ہو تو ترتیبات کو تبدیل نہیں کیا جا سکتا - + Save محفوظ کریں @@ -772,22 +1026,22 @@ Already installed containers were found on the server. All installed containers PageProtocolXraySettings - + XRay settings XRay کی ترتیبات - + Disguised as traffic from کے طور پر ٹریفک کی طرح - + Save محفوظ - + Unable change settings while there is an active connection جب ایک فعال کنکشن موجود ہو تو ترتیبات کو تبدیل نہیں کیا جا سکتا @@ -795,39 +1049,39 @@ Already installed containers were found on the server. All installed containers PageServiceDnsSettings - + A DNS service is installed on your server, and it is only accessible via VPN. ایک DNS سروس آپ کے سرور پر انسٹال کی گئی ہے، اور صرف VPN کے ذریعے یہ قابل رسائی ہے. - + The DNS address is the same as the address of your server. You can configure DNS in the settings, under the connections tab. ایڈریس وہی ہے جو آپ کے سرور کا پتہ ہے۔ آپ کنکشنز ٹیب کے نیچے سیٹنگز میں DNS کنفیگر کر سکتے ہیں. - + Remove ہٹائیں - + Remove %1 from server? سرور سے %1 کو ہٹا دیں? - + Cannot remove AmneziaDNS from running server آمنیزیا ڈی این ایس کو چل رہے سرور سے ہٹا نہیں سکتے - + Continue جاری رہے - + Cancel منسوخ کریں @@ -835,161 +1089,157 @@ Already installed containers were found on the server. All installed containers PageServiceSftpSettings - + Settings updated successfully ترتیبات کامیابی سے اپ ڈیٹ ہوگئیں - + SFTP settings ایس ایف ٹی پی ترتیبات - + Host The term "Host" in the context of SFTP (Secure File Transfer Protocol) can be translated into Urdu as: میزبان - - - - + + + + Copied نقل کر دیا گیا - + Port پورٹ - + User name صارف کا نام - + Password پاس ورڈ - + Mount folder on device آلے پر فولڈر ماؤنٹ کریں - + In order to mount remote SFTP folder as local drive, perform following steps: <br> ریموٹ SFTP فولڈر کو لوکل ڈرائیو کے طور پر ماؤنٹ کرنے کے لیے، درج ذیل اقدامات کریں - - + + <br>1. Install the latest version of <br>1کا تازہ ترین ورژن انسٹال کریں - - + + <br>2. Install the latest version of .<br>2کا تازہ ترین ورژن انسٹال کریں ۔ - + Detailed instructions تفصیلی ہدایات - Remove SFTP and all data stored there - کو ہٹا دیں اور وہاں ذخیرہ شدہ تمام ڈیٹا کو ختم کر دیں + کو ہٹا دیں اور وہاں ذخیرہ شدہ تمام ڈیٹا کو ختم کر دیں - Remove SFTP and all data stored there? - SFTP اور وہاں ذخیرہ کردہ تمام ڈیٹا کو ہٹائیں؟ + SFTP اور وہاں ذخیرہ کردہ تمام ڈیٹا کو ہٹائیں؟ - Continue - جاری رہے + جاری رہے - Cancel - منسوخ کریں + منسوخ کریں PageServiceSocksProxySettings - + Settings updated successfully - - + + SOCKS5 settings - + Host The term "Host" in the context of SFTP (Secure File Transfer Protocol) can be translated into Urdu as: میزبان - - - - + + + + Copied - - + + Port پورٹ - + User name صارف کا نام - - + + Password پاس ورڈ - + Username - - + + Change connection settings - + The port must be in the range of 1 to 65535 - + Password cannot be empty - + Username cannot be empty @@ -997,95 +1247,96 @@ Already installed containers were found on the server. All installed containers PageServiceTorWebsiteSettings - + Settings updated successfully ترتیبات کامیابی سے اپ ڈیٹ ہوگئی ہیں - + Tor website settings ویب سائٹ کی ترتیبات - + Website address ویب سائٹ کا پتہ - + Copied نقل کر لیا گیا - + Use <a href="https://www.torproject.org/download/" style="color: #FBB26A;">Tor Browser</a> to open this URL. - + After creating your onion site, it takes a few minutes for the Tor network to make it available for use. اپنی اونین ویب سائٹ بنانے کے بعد، ٹور نیٹ ورک کو اسے دستیاب کرنے میں کچھ منٹ لگ سکتے ہیں۔ - + When configuring WordPress set the this onion address as domain. وورڈپریس کو ترتیب دیتے وقت، اس انیون ایڈریس کو ڈومین کے طور پر مقرر کریں. - Remove website - ویب سائٹ کو ہٹا دیں + ویب سائٹ کو ہٹا دیں - The site with all data will be removed from the tor network. - تمام ڈیٹا والی سائٹ کو ٹور نیٹ ورک سے ہٹا دیا جائے گا. + تمام ڈیٹا والی سائٹ کو ٹور نیٹ ورک سے ہٹا دیا جائے گا. - Continue - جاری رکھیں + جاری رکھیں - Cancel - منسوخ کریں + منسوخ کریں PageSettings - + Settings ترتیبات - + Servers سرور - + Connection کنکشن - + Application ایپلیکیشن - + Backup بیک اپ - + About AmneziaVPN AmneziaVPN کے بارے میں + Dev console + + + + Close application براہ کرم ایپلیکیشن بند کریں @@ -1093,85 +1344,164 @@ Already installed containers were found on the server. All installed containers PageSettingsAbout - + Support Amnezia Amnezia کی حمایت کریں - + Amnezia is a free and open-source application. You can support the developers if you like it. ایمنیزیا ایک مفت اور آزاد سورس ایپلیکیشن ہے۔ آپ اگر اسے پسند کریں تو ڈویلپرز کی حمایت کرسکتے ہیں. - + Contacts رابطے - + Telegram group ٹیلیگرام گروپ - + To discuss features "فیچرز" پر گفتگو کرنے کے لئے - + https://t.me/amnezia_vpn_en - Mail - میل + میل + support@amnezia.org + + + + For reviews and bug reports جائزہ اور بگ رپورٹس کے لئے - + + Copied + + + + GitHub گِٹ ہَب - + https://github.com/amnezia-vpn/amnezia-client https://github.com/amnezia-vpn/amnezia-client - + Website ویب سائٹ - - https://amnezia.org - - - - + Software version: %1 سافٹ ویئر ورژن: %1 - + Check for updates اپ ڈیٹس چیک کریں - + Privacy Policy رازداری کی پالیسی + + PageSettingsApiServerInfo + + + For the region + + + + + Price + + + + + Work period + + + + + Speed + + + + + Support tag + + + + + Copied + + + + + Reload API config + + + + + Reload API config? + + + + + + Continue + + + + + + Cancel + + + + + Cannot reload API config during active connection + + + + + Remove from application + + + + + Remove from application? + + + + + Cannot remove server during active connection + چالو کنکشن کے دوران سرور کو ہٹایا نہیں جا سکتا + + PageSettingsAppSplitTunneling - + Cannot change split tunneling settings during active connection فعال کنکشن کے دوران سپلٹ ٹنلنگ کی ترتیبات تبدیل نہیں کی جا سکتیں @@ -1184,52 +1514,52 @@ Already installed containers were found on the server. All installed containers فہرست میں شامل ایپ کو وی پی این کے ذریعے دسترس نہیں کیا جائے گا - + Only the apps from the list should have access via VPN - + Apps from the list should not have access via VPN - + App split tunneling ایپ اسپلٹ ٹنلنگ - + Mode موڈ - + Remove ہٹائیں - + Continue جاری رکھیں - + Cancel منسوخ - + application name ایپ کا نام - + Open executable file قابل اجراء فائل کو کھولیں - + Executable files (*.*) قابل اجراء فائل (*.*) @@ -1237,102 +1567,102 @@ Already installed containers were found on the server. All installed containers PageSettingsApplication - + Application ایپلیکیشن - + Allow application screenshots ایپلیکیشن میں تصویریں لینے کی اجازت دیں - + Enable notifications - + Enable notifications to show the VPN state in the status bar - + Auto start خود کار شروع - + Launch the application every time the device is starts جب بھی آلہ چلائے، ایپلیکیشن کو لانچ کریں - + Auto connect خودکار منسلک - + Connect to VPN on app start ایپ شروع ہونے پر VPN سے جڑیں - + Start minimized کمینائز شروع کریں - + Launch application minimized ایپلیکیشن کو کمینائز کر کے لانچ کریں - + Language زبان - + Logging لاگنگ - + Enabled فعال - + Disabled غیر فعال - + Reset settings and remove all data from the application ترتیبات کو دوبارہ ترتیب کریں اور ایپلیکیشن سے تمام ڈیٹا کو ختم کریں - + Reset settings and remove all data from the application? ترتیبات کو دوبارہ ترتیب دیں اور ایپلیکیشن سے تمام ڈیٹا کو ہٹا دیں؟ - + All settings will be reset to default. All installed AmneziaVPN services will still remain on the server. تمام ترتیبات کو معمولی حالت پر لوٹایا جائے گا۔ سب انسٹال کیے گئے امنیزیا وی پی این سروسزسرورپرموجودرہیںگی. - + Continue جاری رکھیں - + Cancel منسوخ - + Cannot reset settings during active connection چالو کنکشن کے دوران ترتیبات کو دوبارہ ترتیب نہیں دی جا سکتی @@ -1340,7 +1670,7 @@ Already installed containers were found on the server. All installed containers PageSettingsBackup - + Settings restored from backup file ترتیبات بیک اپ فائل سے بحال کردی گئی ہیں @@ -1419,62 +1749,62 @@ Already installed containers were found on the server. All installed containers PageSettingsConnection - + Connection کنکشن - + When AmneziaDNS is not used or installed ایمنیزیا ڈی این ایس کو استعمال نہیں کیا گیا ہو یا اسے انسٹال نہیں کیا گیاہے - + Allows you to use the VPN only for certain Apps آپ کو صرف مخصوص ایپلیکیشنز کے لئے وی پی این استعمال کرنے کی اجازت دیتا ہے - + Use AmneziaDNS AmneziaDNS استعمال کریں - + If AmneziaDNS is installed on the server اگر سرور پر AmneziaDNS انسٹال کیا گیا ہو تو - + DNS servers ڈی این ایس سرور - + Site-based split tunneling سائٹ کے بنیادی سپلٹ ٹنلنگ - + Allows you to select which sites you want to access through the VPN آپ کو یہ امکان فراہم کرتا ہے کہ آپ وی پی این کے ذریعہ کس سائٹ کو دسترس دینا چاہتے ہیں وہ منتخب کریں - + App-based split tunneling ایپ کے بنیاد پر سپلٹ ٹنلنگ - + KillSwitch - + Disables your internet if your encrypted VPN connection drops out for any reason. - + Cannot change killSwitch settings during active connection @@ -1482,62 +1812,62 @@ Already installed containers were found on the server. All installed containers PageSettingsDns - + Default server does not support custom DNS افتراضی سرور کا مخصوص DNS کو سپورٹ نہیں کرتا ہے - + DNS servers ڈی این ایس سرور - + If AmneziaDNS is not used or installed اگر AmneziaDNS استعمال نہیں کیا گیا ہو یا انسٹال نہیں کیا گیا ہو تو - + Primary DNS اولین DNS - + Secondary DNS ثانوی DNS - + Restore default اصل حالت کو بحال کریں - + Restore default DNS settings? اصل DNS ترتیبات کو بحال کریں؟ - + Continue براہ کرم جاری رکھیں - + Cancel منسوخ - + Settings have been reset ترتیبات کو دوبارہ ترتیب دیا گیا ہے - + Save محفوظ - + Settings saved ترتیبات محفوظ ہوگئیں @@ -1545,72 +1875,108 @@ Already installed containers were found on the server. All installed containers PageSettingsLogging - Logging is enabled. Note that logs will be automatically disabled after 14 days, and all log files will be deleted. - لاگنگ فعال ہے۔ یاد رہے کہ لاگوں کو 14 دنوں کے بعد خود بخود غیر فعال کر دیا جائے گا، اور تمام لاگ فائلیں حذف کردی جائیں گی. + لاگنگ فعال ہے۔ یاد رہے کہ لاگوں کو 14 دنوں کے بعد خود بخود غیر فعال کر دیا جائے گا، اور تمام لاگ فائلیں حذف کردی جائیں گی. - + Logging لاگنگ - + Enabling this function will save application's logs automatically. By default, logging functionality is disabled. Enable log saving in case of application malfunction. اس فعل کو فعال کرنے سے، ایپلیکیشن کے لاگ خود بخود محفوظ ہوجائیں گے۔ پہلے سے، لاگنگ کی فعالیت غیر فعال ہوتی ہے۔ اگر ایپلیکیشن میں کوئی خرابی ہو، تو لاگ کو بچانا فعال کریں. - Save logs - لاگوں کو محفوظ کریں + لاگوں کو محفوظ کریں - Open folder with logs - فائلوں کے فولڈر کو کھولیں + فائلوں کے فولڈر کو کھولیں - + + Save محفوظ - + + Logs files (*.log) لاگ فائلیں (*.log) - + + Logs file saved لاگ فائل محفوظ ہوگئی - Save logs to file - لاگوں کو فائل میں محفوظ کریں + لاگوں کو فائل میں محفوظ کریں - + + Enable logs + + + + Clear logs? کیا آپ لاگوں کو صاف کرنا چاہتے ہیں؟ - + Continue براہ کرم جاری رکھیں - + Cancel منسوخ - + Logs have been cleaned up تم مسح السجلاتلاگوں کو صاف کر دیا گیا ہے - + + Client logs + + + + + AmneziaVPN logs + + + + + + Open logs folder + + + + + + Export logs + + + + + Service logs + + + + + AmneziaVPN-service logs + + + + Clear logs لاگوں کو صاف کریں @@ -1618,22 +1984,22 @@ Already installed containers were found on the server. All installed containers PageSettingsServerData - + All installed containers have been added to the application تمام انسٹال شدہ کنٹینرز کو ایپلیکیشن میں شامل کر دیا گیا ہے - + No new installed containers found کوئی نئے انسٹال شدہ کنٹینرز نہیں ملے - + Do you want to reboot the server? کیا آپ سرور کو دوبارہ چالو کرنا چاہتے ہیں؟ - + Do you want to clear server from Amnezia software? هل تريد حذف الخادم من Amnezia?کیا آپ سرور کو Amnezia سافٹ ویئر سے صاف کرنا چاہتے ہیں؟ @@ -1642,94 +2008,94 @@ Already installed containers were found on the server. All installed containers - - - - - - Continue - براہ کرم جاری رکھیں - + Continue + براہ کرم جاری رکھیں + + + + + + Cancel منسوخ - + Check the server for previously installed Amnezia services سرور پر پہلے سے انسٹال کی گئی Amnezia سروسز کو چیک کریں - + Add them to the application if they were not displayed اگر وہ دکھایا نہیں گیا تو انہیں ایپلیکیشن میں شامل کریں - + Reboot server سرور کو دوبارہ چالو کریں - + The reboot process may take approximately 30 seconds. Are you sure you wish to proceed? ریبوٹ کا عمل تقریباً 30 سیکنڈ لے سکتا ہے۔ کیا آپ براہ کرم جاری رکھنا چاہتے ہیں؟ - + Cannot reboot server during active connection چالو کنکشن کے دوران سرور کو دوبارہ چالو نہیں کیا جا سکتا - + Remove server from application ایپلیکیشن سے سرور کو ہٹا دیں - + Do you want to remove the server from application? کیا آپ ایپلیکیشن سے سرور کو ہٹانا چاہتے ہیں؟ - + Cannot remove server during active connection چالو کنکشن کے دوران سرور کو ہٹایا نہیں جا سکتا - + All users whom you shared a connection with will no longer be able to connect to it. آپ نے اپنی کنکشن کا اشتراک دینے والے تمام صارفین کو اس سے جڑنے کی اجازت نہیں ہوگی. - + Cannot clear server from Amnezia software during active connection چالو کنکشن کے دوران سرور کو ایمنیزیا سافٹ ویئر سے صاف کرنا ممکن نہیں - + Reset API config API کونفیگ کو دوبارہ ترتیب دیں - + Do you want to reset API config? کیا آپ API کونفیگ کو دوبارہ ترتیب دینا چاہتے ہیں؟ - + Cannot reset API config during active connection چالو کنکشن کے دوران API ترتیبات کو دوبارہ ترتیب نہیں دی جا سکتی - + All installed AmneziaVPN services will still remain on the server. سرور پر تمام انسٹال شدہ AmneziaVPN سروسز محفوظ رہیں گے. - + Clear server from Amnezia software Amnezia سافٹ ویئر کو سرور سے صاف کریں @@ -1737,27 +2103,27 @@ Already installed containers were found on the server. All installed containers PageSettingsServerInfo - + Server name سرور کا نام - + Save محفوظ - + Protocols پروٹوکولات - + Services خدمات - + Management مینجمنٹ @@ -1765,27 +2131,26 @@ Already installed containers were found on the server. All installed containers PageSettingsServerProtocol - + settings ترتیبات - Clear %1 profile - %1 پروفائل کو صاف کریں + %1 پروفائل کو صاف کریں - + Clear %1 profile? کیا آپ واقعی %1 پروفائل کو صاف کرنا چاہتے ہیں؟ - + Unable to clear %1 profile while there is an active connection فعال کنکشن کے دوران %1 پروفائل کو صاف نہیں کیا جا سکتا - + Cannot remove active container فعال کنٹینر کو ہٹانا ممکن نہیں @@ -1795,29 +2160,54 @@ Already installed containers were found on the server. All installed containers - + Remove ہٹائیں - + All users with whom you shared a connection will no longer be able to connect to it. آپ نے جن کے ساتھ کنکشن شئیر کیا تھا، ان تمام صارفین کو اس سے جڑنے کی اجازت نہیں ہوگی. - + Remove %1 from server? کیا آپ سرور سے %1 کو ہٹانا چاہتے ہیں؟ - - + + connection settings + + + + + Click the "connect" button to create a connection configuration + + + + + server settings + + + + + Clear profile + + + + + The connection configuration will be deleted for this device only + + + + + Continue براہ کرم جاری رکھیں - - + + Cancel منسوخ @@ -1825,7 +2215,7 @@ Already installed containers were found on the server. All installed containers PageSettingsServersList - + Servers سرور @@ -1833,201 +2223,332 @@ Already installed containers were found on the server. All installed containers PageSettingsSplitTunneling - + Default server does not support split tunneling function افتراضی سرور سپلٹ ٹنلنگ فعال نہیں کرتا - + Addresses from the list should not be accessed via VPN اس فہرست سے پتوں کا وی پی این کے ذریعے دسترس حاصل نہیں کیا جانا چاہئے - + Split tunneling اسپلٹ ٹنلنگ - + Mode موڈ - + Remove ہٹائیں - + Continue براہ کرم جاری رکھیں - + Cancel منسوخ - + Only the sites listed here will be accessed through the VPN صرف یہاں درج کردہ سائٹس وی پی این کے ذریعے دسترس حاصل کریں گی - + Cannot change split tunneling settings during active connection فعال کنکشن کے دوران سپلٹ ٹنلنگ کی ترتیبات تبدیل نہیں کی جا سکتیں - + website or IP ویب سائٹ یا آئی پی - + Import / Export Sites سائٹس درآمد / برآمد - + Import درآمد - + Save site list سائٹ کی فہرست کو محفوظ کریں - + Save sites سائٹس کو محفوظ کریں - - - + + + Sites files (*.json) سائٹس فائلیں (*.json) - + Import a list of sites ایک فہرست کو درآمد کریں - + Replace site list سائٹ کی فہرست کو بدلیں - - + + Open sites file سائٹس فائل کو کھولیں - + Add imported sites to existing ones آمدہ سائٹس کو موجودہ میں شامل کریں + + PageSetupWizardApiServiceInfo + + + For the region + + + + + Price + + + + + Work period + + + + + Speed + + + + + Features + + + + + Connect + + + + + PageSetupWizardApiServicesList + + + VPN by Amnezia + + + + + Choose a VPN service that suits your needs. + + + PageSetupWizardConfigSource - Server connection - سرور کنکشن + سرور کنکشن - Do not use connection codes from untrusted sources, as they may be created to intercept your data. - غیر معتبر ماخذ سے کنکشن کوڈ استعمال نہ کریں، کیونکہ یہ آپ کے ڈیٹا کو منسلک کرنے کے لئے تخلیق کیا گیا ہوسکتا ہے. + غیر معتبر ماخذ سے کنکشن کوڈ استعمال نہ کریں، کیونکہ یہ آپ کے ڈیٹا کو منسلک کرنے کے لئے تخلیق کیا گیا ہوسکتا ہے. - What do you have? - آپ کو کس میں مدد چاہیے؟ + آپ کو کس میں مدد چاہیے؟ - File with connection settings or backup - کنکشن کی ترتیبات یا بیک اپ والی فائل + کنکشن کی ترتیبات یا بیک اپ والی فائل - + + Connection + کنکشن + + + + Settings + ترتیبات + + + + Enable logs + + + + + Insert the key, add a configuration file or scan the QR-code + + + + + Insert key + + + + + Insert + داخل کریں + + + + Continue + + + + + Other connection options + + + + + VPN by Amnezia + + + + + Connect to classic paid and free VPN services from Amnezia + + + + + Self-hosted VPN + + + + + Configure Amnezia VPN on your own server + + + + + Restore from backup + بیک اپ سے بحال کریں + + + + Open backup file + بیک اپ فائل کو کھولیں + + + + Backup files (*.backup) + بیک اپ فائلیں (*.backup) + + + File with connection settings کنکشن کی ترتیبات والی فائل - + Open config file کنفیگ فائل کو کھولیں - + QR code QR کوڈ - + + I have nothing + میرے پاس کچھ نہیں ہے + + Key as text - متن کے طور پر کلید + متن کے طور پر کلید PageSetupWizardCredentials - + Configure your server اپنے سرور کو ترتیب دیں - + Server IP address [:port] سرور آئی پی پتہ [:پورٹ] - + Continue براہ کرم جاری رکھیں - + All data you enter will remain strictly confidential and will not be shared or disclosed to the Amnezia or any third parties آپ جو ڈیٹا داخل کریں گے وہ بالکل خفیہ رہے گا اور نہ تو امنیزیا یا کسی تیسری شخصیت کے ساتھ اشتراک کیا جائے گا - + 255.255.255.255:22 - + SSH Username ایس ایس ایچ صارف نام - + Password or SSH private key پاس ورڈ یا SSH نجی کلید - + + How to run your VPN server + + + + + Where to get connection data, step-by-step instructions for buying a VPS + + + + Ip address cannot be empty آئی پی پتہ خالی نہیں ہو سکتا - + Enter the address in the format 255.255.255.255:88 ایڈریس درج کریں فارمیٹ 255.255.255.255:88 - + Login cannot be empty لاگ ان نام خالی نہیں ہو سکتا - + Password/private key cannot be empty پاس ورڈ یا نجی کلید خالی نہیں ہو سکتی @@ -2035,22 +2556,22 @@ Already installed containers were found on the server. All installed containers PageSetupWizardEasy - + What is the level of internet control in your region? آپ کے علاقے میں انٹرنیٹ کنٹرول کا سطح کیا ہے؟ - + Choose a VPN protocol ایک VPN پروٹوکول کا انتخاب کریں - + Skip setup ترتیب چھوڑیں - + Continue جاری رکھیں @@ -2058,38 +2579,38 @@ Already installed containers were found on the server. All installed containers PageSetupWizardInstalling - - + + Usually it takes no more than 5 minutes عموماً یہ 5 منٹ سے زیادہ نہیں لیتا - + The server has already been added to the application سرور پہلے ہی ایپلیکیشن میں شامل کر دیا گیا ہے - + Amnezia has detected that your server is currently ایمنیزیا نے دریافت کیا ہے کہ آپ کا سرور موجودہ - + busy installing other software. Amnezia installation مصروف ہے اور دوسرے سافٹ ویئر کی انسٹالیشن کر رہا ہے - + Cancel installation انسٹالیشن منسوخ - + will pause until the server finishes installing other software دوسرے سافٹ ویئر کی انسٹالیشن ختم ہونے تک انتظار کرے گا - + Installing انسٹال ہو رہی ہے @@ -2097,37 +2618,37 @@ Already installed containers were found on the server. All installed containers PageSetupWizardProtocolSettings - + Installing %1 %1 کی انسٹالیشن - + More detailed مزید تفصیلات والا - + Close بند - + Network protocol نیٹ ورک پروٹوکول - + Port پورٹ - + Install انسٹال - + The port must be in the range of 1 to 65535 @@ -2135,12 +2656,12 @@ Already installed containers were found on the server. All installed containers PageSetupWizardProtocols - + VPN protocol وی پی این پروٹوکول - + Choose the one with the highest priority for you. Later, you can install other protocols and additional services, such as DNS proxy and SFTP. آپ کے لئے سب سے زیادہ اہم پروٹوکول کا انتخاب کریں۔ بعد میں، آپ دوسرے پروٹوکول اور اضافی خدمات، جیسے DNS پراکسی اور SFTP، انسٹال کر سکتے ہیں۔ @@ -2148,7 +2669,7 @@ Already installed containers were found on the server. All installed containers PageSetupWizardQrReader - + Point the camera at the QR code and hold for a couple of seconds. کیمرے کو QR کوڈ پر موجود کریں اور کچھ سیکنڈ کے لئے رکھیں. @@ -2156,60 +2677,55 @@ Already installed containers were found on the server. All installed containers PageSetupWizardStart - Settings restored from backup file - ترتیبات بیک اپ فائل سے بحال کردی گئی ہیں + ترتیبات بیک اپ فائل سے بحال کردی گئی ہیں - Free service for creating a personal VPN on your server. - آپ کے سرور پر ایک ذاتی وی پی این بنانے کے لئے مفت خدمات. + آپ کے سرور پر ایک ذاتی وی پی این بنانے کے لئے مفت خدمات. - Helps you access blocked content without revealing your privacy, even to VPN providers. - آپ کو ریاست کردہ مواد تک رسائی فراہم کرتا ہے بغیر آپ کے خصوصیت کو وی پی این فراہم کرنے والوں تک بھی ظاہر نہیں کرتا. + آپ کو ریاست کردہ مواد تک رسائی فراہم کرتا ہے بغیر آپ کے خصوصیت کو وی پی این فراہم کرنے والوں تک بھی ظاہر نہیں کرتا. - I have the data to connect - میرے پاس اس کنکشن کے لئے ڈیٹا موجود ہے + میرے پاس اس کنکشن کے لئے ڈیٹا موجود ہے - I have nothing - میرے پاس کچھ نہیں ہے + میرے پاس کچھ نہیں ہے - - https://amnezia.org/instructions/0_starter-guide - + + Let's get started + PageSetupWizardTextKey - + Connection key کنکشن کی کلید - + A line that starts with vpn://... ایک لائن جو vpn:// سے شروع ہوتی ہے... - + Key کلید - + Insert داخل کریں - + Continue جاری رہنے دیں @@ -2217,32 +2733,32 @@ Already installed containers were found on the server. All installed containers PageSetupWizardViewConfig - + New connection نیا کنکشن - + Collapse content مواد کو غیر فعال کریں - + Show content مواد دکھائیں - + Enable WireGuard obfuscation. It may be useful if WireGuard is blocked on your provider. وائر گارڈ کی غلط شناخت کو بروئے کار لانے کے لئے وائر گارڈ غلط شناخت کو فعال کریں۔ آپ کے پرووائیڈر پر وائر گارڈ بند ہونے کی صورت میں یہ کار آمد ہو سکتی ہے۔ - + Use connection codes only from sources you trust. Codes from public sources may have been created to intercept your data. صرف ان ماخذ سے کنکشن کوڈ استعمال کریں جن پر آپ کو اعتماد ہو۔ عوامی ماخذوں سے کوڈز آپ کے ڈیٹا کو منسلک کرنے کے لیے بنائے گئے ہو سکتے ہیں. - + Connect کنکٹ @@ -2250,37 +2766,37 @@ Already installed containers were found on the server. All installed containers PageShare - + Save OpenVPN config اوپن وی پی این کی ترتیبات کو محفوظ کریں - + Save WireGuard config وائر گارڈ کی ترتیبات کو محفوظ کریں - + Save AmneziaWG config ایمنیزیا ڈبلیو جی کی ترتیبات کو محفوظ کریں - + Save Shadowsocks config شیڈو ساکس کی ترتیبات کو محفوظ کریں - + Save Cloak config چادر کی ترتیبات کو محفوظ کریں - + Save XRay config "XRay کنفیگ کو محفوظ کریں - + For the AmneziaVPN app AmneziaVPN ایپ کے لئے @@ -2289,78 +2805,78 @@ Already installed containers were found on the server. All installed containers OpenVPN کا اصل فارمیٹ - + WireGuard native format وائر گارڈ کا اصل فارمیٹ - + AmneziaWG native format ایمنیزیا ڈبلیو جی کا اصل فارمیٹ - + Shadowsocks native format شیڈو ساکس کا اصل فارمیٹ - + Cloak native format Cloak کا اصل فارمیٹ - + XRay native format ایکس رے کا نیٹویٹ فارمیٹ - + Share VPN Access VPN دسترسی شیئر - + Share full access to the server and VPN سرور اور وی پی این کے لئے مکمل دسترسی کو شیئر کریں - + Use for your own devices, or share with those you trust to manage the server. اپنی خود کی ڈیوائسز کے لئے استعمال کریں، یا ان لوگوں کے ساتھ شیئر کریں جن پر آپ کا بھروسہ ہو کہ وہ سرور کو منظم کر سکیں. - - + + Users صارفین - + Share VPN access without the ability to manage the server سرور کو منظم کرنے کی صلاحیت کے بغیر وی پی این کی دسترسی شیئر - + Search تلاش - + Creation date: %1 - + Latest handshake: %1 - + Data received: %1 - + Data sent: %1 @@ -2369,96 +2885,96 @@ Already installed containers were found on the server. All installed containers تخلیق کی تاریخ: - + Rename نام تبدیل - + Client name کلائنٹ کا نام - + Save محفوظ - + Revoke واپس لین - + Revoke the config for a user - %1? کیا آپ مستعمل کے لئے کنفیگ کو واپس لینا چاہتے ہیں - %1؟ - + The user will no longer be able to connect to your server. صارف آپ کے سرور سے متصل ہونے کا اختیار نہیں رہے گا. - + Continue جاری رکھیں - + Cancel منسوخ - + Connection کنکشن - - + + Server سرور - + File with connection settings to کنکشن کی ترتیبات کی فائل - - + + Protocol پروٹوکول - + Connection to کنکشن کو - + Config revoked کنفیگ منسوخ - + OpenVPN native format - + User name صارف کا نام - - + + Connection format کنکشن فارمیٹ - - + + Share شیئر @@ -2466,50 +2982,55 @@ Already installed containers were found on the server. All installed containers PageShareFullAccess - + Full access to the server and VPN سرور اور وی پی این کی مکمل رسائی - + We recommend that you use full access to the server only for your own additional devices. ہم آپ کو سرور کا مکمل رسائی صرف اپنی اضافی ڈیوائسز کے لئے استعمال کرنے کی تجویز دیتے ہیں. - + If you share full access with other people, they can remove and add protocols and services to the server, which will cause the VPN to work incorrectly for all users. "اگر آپ دوسروں کے ساتھ مکمل رسائی شیئر کریں تو وہ سرور پروٹوکول اور خدمات کو ہٹا سکتے ہیں اور شامل کر سکتے ہیں، جس سے وی پی این تمام صارفین کے لئے غلط کام کرے گا. - + Server سرور - + Accessing رسائی - + File with accessing settings to ترتیبات کے ساتھ دسترسی کی فائل - + Share شیئر - + + Access error! + رساءی ناممکن! + + + Connection to کنکشن کو - + File with connection settings to کنکشن کی ترتیبات کی فائل @@ -2517,15 +3038,25 @@ Already installed containers were found on the server. All installed containers PageStart - + Logging was disabled after 14 days, log files were deleted لاگنگ کو 14 دنوں کے بعد غیر فعال کر دیا گیا، لاگ فائلوں کو حذف کر دیا گیا + + + Settings restored from backup file + ترتیبات بیک اپ فائل سے بحال کردی گئی ہیں + + + + Logging is enabled. Note that logs will be automaticallydisabled after 14 days, and all log files will be deleted. + + PopupType - + Close بند @@ -2559,12 +3090,12 @@ Already installed containers were found on the server. All installed containers پاس ورڈ نہیں ملا - + Could not open keystore کی اسٹور کھولا نہیں جا سکا - + Could not remove private key from keystore خصوصی کلید کو کی اسٹور سے ہٹانا نہیں ہو سکا @@ -2740,27 +3271,27 @@ Already installed containers were found on the server. All installed containers کی اسٹور کھولنے میں ناکام - + Could not create private key generator پرائیویٹ کلید جنریٹر تخلیق نہیں کیا - + Could not generate new private key نیا نجی کلید تخلیق نہیں کیا جا سکا - + Could not retrieve private key from keystore کی اسٹور سے نجی کلید حاصل نہیں کیا - + Could not create encryption cipher تشکیل تشکیل نہیں کر سکا - + Could not encrypt data ڈیٹا کو محفوظ کرنے میں ناکام @@ -2871,7 +3402,7 @@ Already installed containers were found on the server. All installed containers یہ تشکیل پہلے ہی ایپلی کیشن میں شامل کی جا چکی ہے - + ErrorCode: %1. ایرر کوڈ: %1. @@ -2961,37 +3492,42 @@ Already installed containers were found on the server. All installed containers - + + Missing AGW public key + + + + QFile error: The file could not be opened QFile کی خرابی: فائل کو نہیں کھولا جا سکا - + QFile error: An error occurred when reading from the file کیو فائل کی خرابی: فائل سے پڑھتے وقت ایک خرابی پیش آگئی - + QFile error: The file could not be accessed QFile کی خرابی: فائل تک رسائی نہیں ہو سکی - + QFile error: An unspecified error occurred کیو فائل میں خرابی: ایک غیر متعینہ خرابی پیش آگئی - + QFile error: A fatal error occurred کیو فائل میں خرابی: ایک مہلک خرابی پیش آگئی - + QFile error: The operation was aborted کیو فائل کی خرابی: آپریشن روک دیا گیا تھا - + Internal error داخلی خامی @@ -3373,7 +3909,7 @@ While it offers a blend of security, stability, and speed, it's essential t SelectLanguageDrawer - + Choose language زبان کا انتخاب کریں @@ -3381,13 +3917,13 @@ While it offers a blend of security, stability, and speed, it's essential t Settings - + Server #1 سرور نمبر 1 - - + + Server سرور @@ -3395,12 +3931,12 @@ While it offers a blend of security, stability, and speed, it's essential t SettingsController - + Backup file is corrupted بیک اپ فائل خراب ہو گئی ہے - + All settings have been reset to default values تمام ترتیبات کو ڈیفالٹ اقدار پر دوبارہ ترتیب دیا گیا ہے @@ -3408,39 +3944,39 @@ While it offers a blend of security, stability, and speed, it's essential t ShareConnectionDrawer - - + + Save AmneziaVPN config AmneziaVPN ترتیب کو محفوظ کریں - + Share بانٹیں - + Copy کاپی - - + + Copied کاپی - + Copy config string تشکیل سٹرنگ کو کاپی کریں - + Show connection settings کنکشن کی ترتیبات دکھائیں - + To read the QR code in the Amnezia app, select "Add server" → "I have data to connect" → "QR code, key or settings file" ایمنیزیا ایپ میں QR کوڈ پڑھنے کے لیے، "سرور شامل کریں" → "میرے پاس جوڑنے کے لیے ڈیٹا ہے" → "QR کوڈ، کلید یا سیٹنگ فائل" کو منتخب کریں @@ -3524,7 +4060,7 @@ While it offers a blend of security, stability, and speed, it's essential t TextFieldWithHeaderType - + The field can't be empty یہ فیلڈ خالی نہیں ہو سکتا @@ -3532,7 +4068,7 @@ While it offers a blend of security, stability, and speed, it's essential t VpnConnection - + Mbps ایم بی پی ایس @@ -3583,7 +4119,7 @@ While it offers a blend of security, stability, and speed, it's essential t amnezia::ContainerProps - + Low کم @@ -3596,17 +4132,17 @@ While it offers a blend of security, stability, and speed, it's essential t انتہائی - + High - + I just want to increase the level of my privacy. میں صرف اپنی خصوصیت کا سطح بڑھانا چاہتا ہوں. - + I want to bypass censorship. This option recommended in most cases. میں سانسر شدگی سے چھٹکارا حاصل کرنا چاہتا ہوں۔ یہ اختیار بیشتر صورتوں میں تجویز کیا جاتا ہے. @@ -3618,12 +4154,12 @@ While it offers a blend of security, stability, and speed, it's essential t main2 - + Private key passphrase نجی کلید پاس فریز - + Save محفوظ کریں diff --git a/client/translations/amneziavpn_zh_CN.ts b/client/translations/amneziavpn_zh_CN.ts index f984eddf..39b6bee0 100644 --- a/client/translations/amneziavpn_zh_CN.ts +++ b/client/translations/amneziavpn_zh_CN.ts @@ -1,6 +1,59 @@ + + ApiServicesModel + + + Classic VPN for comfortable work, downloading large files and watching videos. Works for any sites. Speed up to %1 MBit/s + + + + + VPN to access blocked sites in regions with high levels of Internet censorship. + + + + + <p><a style="color: #EB5757;">Not available in your region. If you have VPN enabled, disable it, return to the previous screen, and try again.</a> + + + + + Amnezia Premium - A classic VPN for comfortable work, downloading large files, and watching videos in high resolution. It works for all websites, even in countries with the highest level of internet censorship. + + + + + Amnezia Free is a free VPN to bypass blocking in countries with high levels of internet censorship + + + + + %1 MBit/s + + + + + %1 days + + + + + VPN will open only popular sites blocked in your region, such as Instagram, Facebook, Twitter and others. Other sites will be opened from your real IP address, <a href="%1/free" style="color: #FBB26A;">more details on the website.</a> + + + + + Free + + + + + %1 $/month + + + AppSplitTunnelingController @@ -27,7 +80,7 @@ ConnectButton - + Unable to disconnect during configuration preparation @@ -35,61 +88,61 @@ ConnectionController - - - + + + Connect 连接 - + VPN Protocols is not installed. Please install VPN container at first 请先安装VPN协议 - + Connecting... 连接中 - + Connected 已连接 - + Reconnecting... 重连中 - + Disconnecting... 断开中 - + Preparing... - + Settings updated successfully, reconnnection... 配置已更新, 重连中... - + Settings updated successfully 配置更新成功 - + The selected protocol is not supported on the current platform 当前平台不支持所选协议 - + unable to create configuration @@ -130,7 +183,7 @@ 粘贴 - + &SelectAll 全选 @@ -138,9 +191,8 @@ ExportController - Access error! - 访问错误 + 访问错误 @@ -210,18 +262,18 @@ Can't be disabled for current server - - + + Invalid configuration file - + Scanned %1 of %2. 扫描 %1 of %2. - + In the imported configuration, potentially dangerous lines were found: @@ -237,58 +289,78 @@ Can't be disabled for current server 已安装在服务器上 - + %1 installed successfully. %1 安装成功。 - + %1 is already installed on the server. 服务器上已经安装 %1。 - + Added containers that were already installed on the server 添加已安装在服务器上的容器 - + Already installed containers were found on the server. All installed containers have been added to the application 在服务上发现已经安装协议并添加至应用 - + Settings updated successfully 配置更新成功 - + Server '%1' was rebooted 服务器 '%1' 已重新启动 - + Server '%1' was removed 已移除服务器 '%1' - + All containers from server '%1' have been removed 服务器 '%1' 的所有容器已移除 - + %1 has been removed from the server '%2' %1 已从服务器 '%2' 上移除 - + + Api config removed + + + + %1 cached profile cleared + + + %1 installed successfully. + + + + + API config reloaded + + + + + Successfully changed the country of connection to %1 + + 1% has been removed from the server '%2' %1 已从服务器 '%2' 上移除 @@ -306,12 +378,12 @@ Already installed containers were found on the server. All installed containers 协议已从 - + Please login as the user 请以用户身份登录 - + Server added successfully 增加服务器成功 @@ -319,17 +391,17 @@ Already installed containers were found on the server. All installed containers InstalledAppsDrawer - + Choose application - + application name - + Add selected @@ -384,66 +456,127 @@ Already installed containers were found on the server. All installed containers PageDeinstalling - + Removing services from %1 正从 %1 移除服务 - + Usually it takes no more than 5 minutes 大约5分钟之内完成 + + PageDevMenu + + + Gateway endpoint + + + + + Dev gateway environment + + + PageHome - + Logging enabled - + Split tunneling enabled 用户分隔隧道已启用 - + Split tunneling disabled 分隔隧道已禁用 - + VPN protocol VPN协议 - + Servers 服务器 - + Unable change server while there is an active connection 已建立连接时无法更改服务器配置 + + PageProtocolAwgClientSettings + + + AmneziaWG settings + AmneziaWG 配置 + + + + MTU + + + + + Server settings + + + + + Port + 端口 + + + + Save + 保存 + + + + Save settings? + 保存设置? + + + + Only the settings for this device will be changed + + + + + Continue + 继续 + + + + Cancel + 取消 + + + + Unable change settings while there is an active connection + + + PageProtocolAwgSettings - + AmneziaWG settings AmneziaWG 配置 - + Port 端口 - - - MTU - - Remove AmneziaWG 移除AmneziaWG @@ -453,42 +586,87 @@ Already installed containers were found on the server. All installed containers 从服务上移除AmneziaWG? - + All users with whom you shared a connection with will no longer be able to connect to it. 与您共享连接的所有用户将无法再连接到该连接。 - + Save 保存 - + + Jc - Junk packet count + + + + + Jmin - Junk packet minimum size + + + + + Jmax - Junk packet maximum size + + + + + S1 - Init packet junk size + + + + + S2 - Response packet junk size + + + + + H1 - Init packet magic header + + + + + H2 - Response packet magic header + + + + + H4 - Transport packet magic header + + + + + H3 - Underload packet magic header + + + + The values of the H1-H4 fields must be unique - + The value of the field S1 + message initiation size (148) must not equal S2 + message response size (92) - + Save settings? 保存设置? - + Continue 继续 - + Cancel 取消 - + Unable change settings while there is an active connection @@ -496,33 +674,33 @@ Already installed containers were found on the server. All installed containers PageProtocolCloakSettings - + Cloak settings Cloak 配置 - + Disguised as traffic from 伪装流量为 - + Port 端口 - + Cipher 加密算法 - + Save 保存 - + Unable change settings while there is an active connection @@ -530,170 +708,170 @@ Already installed containers were found on the server. All installed containers PageProtocolOpenVpnSettings - + OpenVPN settings OpenVPN 配置 - + VPN address subnet VPN 地址子网 - + Network protocol 网络协议 - + Port 端口 - + Auto-negotiate encryption 自定义加密方式 - + Hash - + SHA512 - + SHA384 - + SHA256 - + SHA3-512 - + SHA3-384 - + SHA3-256 - + whirlpool - + BLAKE2b512 - + BLAKE2s256 - + SHA1 - + Cipher - + AES-256-GCM - + AES-192-GCM - + AES-128-GCM - + AES-256-CBC - + AES-192-CBC - + AES-128-CBC - + ChaCha20-Poly1305 - + ARIA-256-CBC - + CAMELLIA-256-CBC - + none - + TLS auth TLS认证 - + Block DNS requests outside of VPN 阻止VPN外的DNS请求 - + Additional client configuration commands 附加客户端配置命令 - - + + Commands: 命令: - + Additional server configuration commands 附加服务器端配置命令 - + Unable change settings while there is an active connection @@ -710,7 +888,7 @@ Already installed containers were found on the server. All installed containers 与您共享连接的所有用户将无法再连接到该连接。 - + Save 保存 @@ -730,12 +908,12 @@ Already installed containers were found on the server. All installed containers PageProtocolRaw - + settings 配置 - + Show connection options 显示连接选项 @@ -744,22 +922,22 @@ Already installed containers were found on the server. All installed containers 连接选项 - + Connection options %1 %1 连接选项 - + Remove 移除 - + Remove %1 from server? 从服务器移除 %1 ? - + All users with whom you shared a connection with will no longer be able to connect to it. 与您共享连接的所有用户将无法再连接到该连接。 @@ -772,12 +950,12 @@ Already installed containers were found on the server. All installed containers 与您共享连接的所有用户将无法再连接到此链接 - + Continue 继续 - + Cancel 取消 @@ -785,28 +963,81 @@ Already installed containers were found on the server. All installed containers PageProtocolShadowSocksSettings - + Shadowsocks settings Shadowsocks 配置 - + Port 端口 - + Cipher 加密算法 - + Save 保存 - + + Unable change settings while there is an active connection + + + + + PageProtocolWireGuardClientSettings + + + WG settings + + + + + MTU + + + + + Server settings + + + + + Port + 端口 + + + + Save + 保存 + + + + Save settings? + 保存设置? + + + + Only the settings for this device will be changed + + + + + Continue + 继续 + + + + Cancel + 取消 + + + Unable change settings while there is an active connection @@ -814,22 +1045,27 @@ Already installed containers were found on the server. All installed containers PageProtocolWireGuardSettings - + WG settings - + Port 端口 - - MTU - + + Save settings? + 保存设置? - + + All users with whom you shared a connection with will no longer be able to connect to it. + 与您共享连接的所有用户将无法再连接到该连接。 + + + Unable change settings while there is an active connection @@ -838,15 +1074,17 @@ Already installed containers were found on the server. All installed containers 与您共享连接的所有用户将无法再连接到该连接。 + Continue - 继续 + 继续 + Cancel - 取消 + 取消 - + Save 保存 @@ -854,22 +1092,22 @@ Already installed containers were found on the server. All installed containers PageProtocolXraySettings - + XRay settings - + Disguised as traffic from 伪装流量为 - + Save 保存 - + Unable change settings while there is an active connection @@ -877,29 +1115,29 @@ Already installed containers were found on the server. All installed containers PageServiceDnsSettings - + A DNS service is installed on your server, and it is only accessible via VPN. 您的服务器已安装DNS服务,仅能通过VPN访问。 - + The DNS address is the same as the address of your server. You can configure DNS in the settings, under the connections tab. 其地址与您的服务器地址相同。您可以在 设置 连接 中进行配置。 - + Remove 移除 - + Remove %1 from server? 从服务器移除 %1 ? - + Cannot remove AmneziaDNS from running server @@ -908,12 +1146,12 @@ Already installed containers were found on the server. All installed containers 从服务器 - + Continue 继续 - + Cancel 取消 @@ -921,157 +1159,153 @@ Already installed containers were found on the server. All installed containers PageServiceSftpSettings - + Settings updated successfully 配置更新成功 - + SFTP settings SFTP 配置 - + Host 主机 - - - - + + + + Copied 拷贝 - + Port 端口 - + User name 用户名 - + Password 密码 - + Mount folder on device 挂载文件夹 - + In order to mount remote SFTP folder as local drive, perform following steps: <br> 为将远程 SFTP 文件夹挂载到本地,请执行以下步骤: <br> - - + + <br>1. Install the latest version of <br>1. 安装最新版的 - - + + <br>2. Install the latest version of <br>2. 安装最新版的 - + Detailed instructions 详细说明 - Remove SFTP and all data stored there - 移除SFTP和其本地所有数据 + 移除SFTP和其本地所有数据 - Remove SFTP and all data stored there? - 移除SFTP和其本地所有数据? + 移除SFTP和其本地所有数据? - Continue - 继续 + 继续 - Cancel - 取消 + 取消 PageServiceSocksProxySettings - + Settings updated successfully 配置更新成功 - - + + SOCKS5 settings - + Host 主机 - - - - + + + + Copied - - + + Port 端口 - + User name 用户名 - - + + Password 密码 - + Username - - + + Change connection settings - + The port must be in the range of 1 to 65535 - + Password cannot be empty - + Username cannot be empty @@ -1079,95 +1313,96 @@ Already installed containers were found on the server. All installed containers PageServiceTorWebsiteSettings - + Settings updated successfully 配置更新成功 - + Tor website settings Tor网站配置 - + Website address 网址 - + Copied 已拷贝 - + Use <a href="https://www.torproject.org/download/" style="color: #FBB26A;">Tor Browser</a> to open this URL. 用 <a href="https://www.torproject.org/download/" style="color: #FBB26A;">Tor 浏览器</a> 打开上面网址. - + After creating your onion site, it takes a few minutes for the Tor network to make it available for use. 创建您的洋葱网站后,需要几分钟时间,才能使其在Tor网络上可用 - + When configuring WordPress set the this onion address as domain. 配置 WordPress 时,将此洋葱地址设置为域。 - Remove website - 移除网站 + 移除网站 - The site with all data will be removed from the tor network. - 网站及其所有数据将从 Tor 网络中删除 + 网站及其所有数据将从 Tor 网络中删除 - Continue - 继续 + 继续 - Cancel - 取消 + 取消 PageSettings - + Settings 设置 - + Servers 服务器 - + Connection 连接 - + Application 应用 - + Backup 备份 - + About AmneziaVPN 关于 + Dev console + + + + Close application 关闭应用 @@ -1181,135 +1416,214 @@ And if you don't like the app, all the more support it - the donation will 如果您不喜欢,请捐助支持我们改进它。 - + Support Amnezia 支持Amnezia - + Amnezia is a free and open-source application. You can support the developers if you like it. Amnezia 是一款免费的开源应用程序。 如果您喜欢的话可以支持开发者。 - + Contacts 联系方式 - + Telegram group 电报群 - + To discuss features 用于功能讨论 - + https://t.me/amnezia_vpn_en - Mail - 邮件 + 邮件 + support@amnezia.org + + + + For reviews and bug reports 用于评论和提交软件的缺陷 - + + Copied + + + + GitHub GitHub - + https://github.com/amnezia-vpn/amnezia-client https://github.com/amnezia-vpn/amnezia-client - + Website 官网 - - https://amnezia.org - - - - + Software version: %1 软件版本: %1 - + Check for updates 检查更新 - + Privacy Policy 隐私政策 - PageSettingsAppSplitTunneling + PageSettingsApiServerInfo - - Cannot change split tunneling settings during active connection - 无法在活动连接期间更改分割隧道设置 - - - - Only the apps from the list should have access via VPN + + For the region - - Apps from the list should not have access via VPN + + Price - - App split tunneling + + Work period - - Mode - 规则 - - - - Remove + + Speed - + + Support tag + + + + + Copied + + + + + Reload API config + + + + + Reload API config? + + + + + Continue 继续 - + + Cancel 取消 - + + Cannot reload API config during active connection + + + + + Remove from application + + + + + Remove from application? + + + + + Cannot remove server during active connection + + + + + PageSettingsAppSplitTunneling + + + Cannot change split tunneling settings during active connection + 无法在活动连接期间更改分割隧道设置 + + + + Only the apps from the list should have access via VPN + + + + + Apps from the list should not have access via VPN + + + + + App split tunneling + + + + + Mode + 规则 + + + + Remove + + + + + Continue + 继续 + + + + Cancel + 取消 + + + application name - + Open executable file - + Executable files (*.*) @@ -1317,27 +1631,27 @@ And if you don't like the app, all the more support it - the donation will PageSettingsApplication - + Application 应用 - + Allow application screenshots 允许截屏 - + Enable notifications - + Enable notifications to show the VPN state in the status bar - + Auto start 自动运行 @@ -1350,77 +1664,77 @@ And if you don't like the app, all the more support it - the donation will 启动时自动运行运用程序 - + Launch the application every time the device is starts 每次设备启动时启动应用程序 - + Auto connect 自动连接 - + Connect to VPN on app start 应用开启时连接VPN - + Start minimized 最小化 - + Launch application minimized 开启应用软件时窗口最小化 - + Language 语言 - + Logging 日志 - + Enabled 开启 - + Disabled 禁用 - + Reset settings and remove all data from the application 重置并清理应用的所有数据 - + Reset settings and remove all data from the application? 重置并清理应用的所有数据? - + All settings will be reset to default. All installed AmneziaVPN services will still remain on the server. 所有配置恢复为默认值。服务器已安装的AmneziaVPN服务将被保留。 - + Continue 继续 - + Cancel 取消 - + Cannot reset settings during active connection @@ -1428,7 +1742,7 @@ And if you don't like the app, all the more support it - the donation will PageSettingsBackup - + Settings restored from backup file 从备份文件还原配置 @@ -1511,32 +1825,32 @@ And if you don't like the app, all the more support it - the donation will PageSettingsConnection - + Connection 连接 - + When AmneziaDNS is not used or installed 当未使用或未安装AmneziaDNS时 - + Allows you to use the VPN only for certain Apps 只允许在某些应用程序中使用 VPN - + KillSwitch - + Disables your internet if your encrypted VPN connection drops out for any reason. - + Cannot change killSwitch settings during active connection @@ -1545,17 +1859,17 @@ And if you don't like the app, all the more support it - the donation will 使用AmneziaDNS,如其已安装在服务器上 - + Use AmneziaDNS 使用AmneziaDNS - + If AmneziaDNS is installed on the server 如果已在服务器安装AmneziaDNS - + DNS servers DNS服务器 @@ -1564,17 +1878,17 @@ And if you don't like the app, all the more support it - the donation will 如果未使用或未安装AmneziaDNS - + Site-based split tunneling 基于网站的隧道分离 - + Allows you to select which sites you want to access through the VPN 配置想要通过VPN访问网站 - + App-based split tunneling 基于应用的隧道分离 @@ -1598,62 +1912,62 @@ And if you don't like the app, all the more support it - the donation will PageSettingsDns - + Default server does not support custom DNS 默认服务器不支持自定义 DNS - + DNS servers DNS服务器 - + If AmneziaDNS is not used or installed 如果未使用或未安装AmneziaDNS - + Primary DNS 首选 DNS - + Secondary DNS 备用 DNS - + Restore default 恢复默认配置 - + Restore default DNS settings? 是否恢复默认DNS配置? - + Continue 继续 - + Cancel 取消 - + Settings have been reset 已重置 - + Save 保存 - + Settings saved 配置已保存 @@ -1661,72 +1975,104 @@ And if you don't like the app, all the more support it - the donation will PageSettingsLogging - - Logging is enabled. Note that logs will be automatically disabled after 14 days, and all log files will be deleted. - - - - + Logging 日志 - + Enabling this function will save application's logs automatically. By default, logging functionality is disabled. Enable log saving in case of application malfunction. 默认情况下,日志功能是禁用的。如果应用程序出现故障,则启用日志保存功能。 - Save logs - 记录日志 + 记录日志 - Open folder with logs - 打开日志文件夹 + 打开日志文件夹 - + + Save 保存 - + + Logs files (*.log) - + + Logs file saved 日志文件已保存 - Save logs to file - 保存日志到文件 + 保存日志到文件 - + + Enable logs + + + + Clear logs? 清理日志? - + Continue 继续 - + Cancel 取消 - + Logs have been cleaned up 日志已清理 - + + Client logs + + + + + AmneziaVPN logs + + + + + + Open logs folder + + + + + + Export logs + + + + + Service logs + + + + + AmneziaVPN-service logs + + + + Clear logs 清理日志 @@ -1734,12 +2080,12 @@ And if you don't like the app, all the more support it - the donation will PageSettingsServerData - + All installed containers have been added to the application 所有已安装的容器,已被添加到应用软件 - + No new installed containers found 未发现新安装的容器 @@ -1756,12 +2102,12 @@ And if you don't like the app, all the more support it - the donation will 清除缓存? - + Do you want to reboot the server? 您想重新启动服务器吗? - + Do you want to clear server from Amnezia software? 您要清除服务器上的Amnezia软件吗? @@ -1770,84 +2116,84 @@ And if you don't like the app, all the more support it - the donation will - - - - - - Continue - 继续 - + Continue + 继续 + + + + + + Cancel 取消 - + Check the server for previously installed Amnezia services 检查服务器上,是否存在之前安装的 Amnezia 服务 - + Add them to the application if they were not displayed 如果存在且未显示,则添加到应用软件 - + Reboot server 重新启动服务器 - + The reboot process may take approximately 30 seconds. Are you sure you wish to proceed? 重新启动过程可能需要大约30秒。您确定要继续吗? - + Cannot reboot server during active connection - + Remove server from application 移除本地服务器信息 - + Do you want to remove the server from application? 您想要从应用程序中移除服务器吗? - + Cannot remove server during active connection - + All users whom you shared a connection with will no longer be able to connect to it. 与您共享连接的所有用户将无法再连接到该连接。 - + Cannot clear server from Amnezia software during active connection - + Reset API config 重置 API 配置 - + Do you want to reset API config? 您想重置 API 配置吗? - + Cannot reset API config during active connection @@ -1856,12 +2202,12 @@ And if you don't like the app, all the more support it - the donation will 移除本地服务器信息? - + All installed AmneziaVPN services will still remain on the server. 所有已安装的 AmneziaVPN 服务仍将保留在服务器上。 - + Clear server from Amnezia software 清理Amnezia中服务器信息 @@ -1877,27 +2223,27 @@ And if you don't like the app, all the more support it - the donation will PageSettingsServerInfo - + Server name 服务器名 - + Save 保存 - + Protocols 协议 - + Services 服务 - + Management 管理 @@ -1909,42 +2255,62 @@ And if you don't like the app, all the more support it - the donation will PageSettingsServerProtocol - + settings 配置 - - Clear %1 profile - - - - + Clear %1 profile? + + + + + connection settings - + + Click the "connect" button to create a connection configuration + + + + + server settings + + + + + Clear profile + + + + + The connection configuration will be deleted for this device only + + + + Unable to clear %1 profile while there is an active connection - + Remove 移除 - + All users with whom you shared a connection will no longer be able to connect to it. 与您共享连接的所有用户将无法再连接到该连接。 - + Cannot remove active container @@ -1957,7 +2323,7 @@ And if you don't like the app, all the more support it - the donation will 从服务器 - + Remove %1 from server? 从服务器移除 %1 ? @@ -1966,14 +2332,14 @@ And if you don't like the app, all the more support it - the donation will 与您共享连接的所有用户将无法再连接到此链接 - - + + Continue 继续 - - + + Cancel 取消 @@ -1981,7 +2347,7 @@ And if you don't like the app, all the more support it - the donation will PageSettingsServersList - + Servers 服务器 @@ -2001,7 +2367,7 @@ And if you don't like the app, all the more support it - the donation will 网站级VPN分流 - + Default server does not support split tunneling function 默认服务器不支持分离隧道功能 @@ -2010,32 +2376,32 @@ And if you don't like the app, all the more support it - the donation will 仅使用VPN访问 - + Addresses from the list should not be accessed via VPN 不使用VPN访问 - + Split tunneling 隧道分离 - + Mode 规则 - + Remove 移除 - + Continue 继续 - + Cancel 取消 @@ -2048,75 +2414,120 @@ And if you don't like the app, all the more support it - the donation will 导入/导出网站 - + Cannot change split tunneling settings during active connection 无法在活动连接期间更改分割隧道设置 - + Only the sites listed here will be accessed through the VPN 只有这里列出的网站将通过VPN访问 - + website or IP 网站或IP - + Import / Export Sites 导入/导出网站 - + Import 导入 - + Save site list 保存网址 - + Save sites 保存网址 - - - + + + Sites files (*.json) - + Import a list of sites 导入网址列表 - + Replace site list 替换网址列表 - - + + Open sites file 打开网址文件 - + Add imported sites to existing ones 将导入的网址添加到现有网址中 + + PageSetupWizardApiServiceInfo + + + For the region + + + + + Price + + + + + Work period + + + + + Speed + + + + + Features + + + + + Connect + 连接 + + + + PageSetupWizardApiServicesList + + + VPN by Amnezia + + + + + Choose a VPN service that suits your needs. + + + PageSetupWizardConfigSource - Server connection - 服务器连接 + 服务器连接 Do not use connection code from public sources. It may have been created to intercept your data. @@ -2126,39 +2537,115 @@ It's okay as long as it's from someone you trust. 请确保连接码来源可信。 - Do not use connection codes from untrusted sources, as they may be created to intercept your data. - 请勿使用来自不受信任来源的连接代码,因为它们可能是为了拦截您的数据而创建的。 + 请勿使用来自不受信任来源的连接代码,因为它们可能是为了拦截您的数据而创建的。 - What do you have? - 你用什么方式创建连接? + 你用什么方式创建连接? - File with connection settings or backup - 包含连接配置或备份的文件 + 包含连接配置或备份的文件 - + + Connection + 连接 + + + + Settings + 设置 + + + + Enable logs + + + + + Insert the key, add a configuration file or scan the QR-code + + + + + Insert key + + + + + Insert + 插入 + + + + Continue + 继续 + + + + Other connection options + + + + + VPN by Amnezia + + + + + Connect to classic paid and free VPN services from Amnezia + + + + + Self-hosted VPN + + + + + Configure Amnezia VPN on your own server + + + + + Restore from backup + 从备份还原 + + + + Open backup file + 打开备份文件 + + + + Backup files (*.backup) + + + + File with connection settings 包含连接配置的文件 - + Open config file 打开配置文件 - + QR code 二维码 - + + I have nothing + 我没有 + + Key as text - 授权码文本 + 授权码文本 @@ -2168,12 +2655,12 @@ It's okay as long as it's from someone you trust. 连接服务器 - + Configure your server 配置服务器 - + Server IP address [:port] 服务器IP [:端口] @@ -2186,12 +2673,12 @@ It's okay as long as it's from someone you trust. 密码 或 私钥 - + Continue 继续 - + All data you enter will remain strictly confidential and will not be shared or disclosed to the Amnezia or any third parties 您输入的所有数据将严格保密,不会与 Amnezia 或任何第三方共享或披露 @@ -2202,37 +2689,47 @@ and will not be shared or disclosed to the Amnezia or any third parties 不会向 Amnezia 或任何第三方分享或披露 - + 255.255.255.255:22 - + SSH Username SSH 用户名 - + Password or SSH private key 密码或 SSH 私钥 - + + How to run your VPN server + + + + + Where to get connection data, step-by-step instructions for buying a VPS + + + + Ip address cannot be empty IP不能为空 - + Enter the address in the format 255.255.255.255:88 按照这种格式输入 255.255.255.255:88 - + Login cannot be empty 账号不能为空 - + Password/private key cannot be empty 密码或私钥不能为空 @@ -2240,17 +2737,17 @@ and will not be shared or disclosed to the Amnezia or any third parties PageSetupWizardEasy - + What is the level of internet control in your region? 您所在地区的互联网管控力度如何? - + Choose a VPN protocol 选择 VPN 协议 - + Skip setup 跳过设置 @@ -2263,7 +2760,7 @@ and will not be shared or disclosed to the Amnezia or any third parties 我想选择VPN协议 - + Continue 继续 @@ -2275,28 +2772,28 @@ and will not be shared or disclosed to the Amnezia or any third parties PageSetupWizardInstalling - - + + Usually it takes no more than 5 minutes 通常不超过5分钟 - + The server has already been added to the application 服务器已添加到应用软件中 - + Amnezia has detected that your server is currently Amnezia 检测到您的服务器当前 - + busy installing other software. Amnezia installation 正安装其他软件。Amnezia安装 - + Cancel installation 取消安装 @@ -2309,12 +2806,12 @@ and will not be shared or disclosed to the Amnezia or any third parties 正安装其他软件。Amnezia安装 - + will pause until the server finishes installing other software 将暂停,直到其他软件安装完成。 - + Installing 安装中 @@ -2322,37 +2819,37 @@ and will not be shared or disclosed to the Amnezia or any third parties PageSetupWizardProtocolSettings - + Installing %1 正在安装 %1 - + More detailed 更多细节 - + Close 关闭 - + Network protocol 网络协议 - + Port 端口 - + Install 安装 - + The port must be in the range of 1 to 65535 @@ -2360,12 +2857,12 @@ and will not be shared or disclosed to the Amnezia or any third parties PageSetupWizardProtocols - + VPN protocol VPN 协议 - + Choose the one with the highest priority for you. Later, you can install other protocols and additional services, such as DNS proxy and SFTP. 选择你认为优先级最高的一项。稍后,您可以安装其他协议和附加服务,例如 DNS 代理和 SFTP。 @@ -2373,7 +2870,7 @@ and will not be shared or disclosed to the Amnezia or any third parties PageSetupWizardQrReader - + Point the camera at the QR code and hold for a couple of seconds. 将相机对准二维码并按住几秒钟 @@ -2381,60 +2878,55 @@ and will not be shared or disclosed to the Amnezia or any third parties PageSetupWizardStart - Settings restored from backup file - 从备份文件还原配置 + 从备份文件还原配置 - Free service for creating a personal VPN on your server. - 在您的服务器上架设私人免费VPN服务。 + 在您的服务器上架设私人免费VPN服务。 - Helps you access blocked content without revealing your privacy, even to VPN providers. - 帮助您访问受限内容,保护您的隐私,即使是VPN提供商也无法获取。 + 帮助您访问受限内容,保护您的隐私,即使是VPN提供商也无法获取。 - I have the data to connect - 我有连接配置 + 我有连接配置 - I have nothing - 我没有 + 我没有 - - https://amnezia.org/instructions/0_starter-guide - + + Let's get started + PageSetupWizardTextKey - + Connection key 连接授权码 - + A line that starts with vpn://... 以 vpn://... 开始的行 - + Key 授权码 - + Insert 插入 - + Continue 继续 @@ -2442,7 +2934,7 @@ and will not be shared or disclosed to the Amnezia or any third parties PageSetupWizardViewConfig - + New connection 新连接 @@ -2451,27 +2943,27 @@ and will not be shared or disclosed to the Amnezia or any third parties 请勿使用公共来源的连接码。它可以被创建来拦截您的数据。 - + Collapse content 折叠内容 - + Show content 显示内容 - + Enable WireGuard obfuscation. It may be useful if WireGuard is blocked on your provider. - + Use connection codes only from sources you trust. Codes from public sources may have been created to intercept your data. 只使用您信任的来源提供的连接代码。公共来源的代码可能是为了拦截您的数据而创建的。 - + Connect 连接 @@ -2479,118 +2971,118 @@ and will not be shared or disclosed to the Amnezia or any third parties PageShare - + Save OpenVPN config 保存OpenVPN配置 - + Save WireGuard config 保存WireGuard配置 - + Save AmneziaWG config 保存 AmneziaWG 配置 - + Save Shadowsocks config 保存 Shadowsocks 配置 - + Save Cloak config 保存斗篷配置 - + Save XRay config - + For the AmneziaVPN app AmneziaVPN 应用 - + OpenVPN native format OpenVPN原生格式 - + WireGuard native format WireGuard原生格式 - + AmneziaWG native format AmneziaWG 本地格式 - + Shadowsocks native format Shadowsocks原生格式 - + Cloak native format Cloak原生格式 - + XRay native format - + Share VPN Access 共享 VPN 访问 - + Share full access to the server and VPN 共享服务器和VPN的完全访问权限 - + Use for your own devices, or share with those you trust to manage the server. 用于您自己的设备,或与您信任的人共享以管理服务器. - - + + Users 用户 - + Share VPN access without the ability to manage the server 共享 VPN 访问,无需管理服务器 - + Search 搜索 - + Creation date: %1 - + Latest handshake: %1 - + Data received: %1 - + Data sent: %1 @@ -2599,42 +3091,42 @@ and will not be shared or disclosed to the Amnezia or any third parties 创建日期: - + Rename 重新命名 - + Client name 客户名称 - + Save 保存 - + Revoke 撤销 - + Revoke the config for a user - %1? 撤销用户的配置- %1? - + The user will no longer be able to connect to your server. 该用户将无法再连接到您的服务器. - + Continue 继续 - + Cancel 取消 @@ -2647,7 +3139,7 @@ and will not be shared or disclosed to the Amnezia or any third parties 访问VPN - + Connection 连接 @@ -2676,8 +3168,8 @@ and will not be shared or disclosed to the Amnezia or any third parties 服务器 - - + + Server 服务器 @@ -2690,7 +3182,7 @@ and will not be shared or disclosed to the Amnezia or any third parties 访问配置文件的内容为: - + File with connection settings to 连接配置文件的内容为: @@ -2699,35 +3191,35 @@ and will not be shared or disclosed to the Amnezia or any third parties 协议 - - + + Protocol 协议 - + Connection to 连接到 - + Config revoked 配置已撤销 - + User name 用户名 - - + + Connection format 连接格式 - - + + Share 共享 @@ -2735,50 +3227,55 @@ and will not be shared or disclosed to the Amnezia or any third parties PageShareFullAccess - + Full access to the server and VPN 对服务器和VPN的完全访问权限 - + We recommend that you use full access to the server only for your own additional devices. 我们建议您仅为自己的附加设备使用服务器的完全访问权限. - + If you share full access with other people, they can remove and add protocols and services to the server, which will cause the VPN to work incorrectly for all users. 如果您与其他人共享完全访问权限,他们可以从服务器中删除和添加协议和服务,这将导致VPN对所有用户的工作出现问题。 - + Server 服务器 - + Accessing 访问 - + File with accessing settings to 访问配置文件的内容为 - + Share 共享 - + + Access error! + 访问错误 + + + Connection to 连接到 - + File with connection settings to 连接配置文件的内容为 @@ -2786,15 +3283,25 @@ and will not be shared or disclosed to the Amnezia or any third parties PageStart - + Logging was disabled after 14 days, log files were deleted + + + Settings restored from backup file + 从备份文件还原配置 + + + + Logging is enabled. Note that logs will be automaticallydisabled after 14 days, and all log files will be deleted. + + PopupType - + Close 关闭 @@ -2828,12 +3335,12 @@ and will not be shared or disclosed to the Amnezia or any third parties 未发现密码 - + Could not open keystore 无法打开密钥库 - + Could not remove private key from keystore 无法从密钥库中删除私钥 @@ -3009,27 +3516,27 @@ and will not be shared or disclosed to the Amnezia or any third parties 无法打开密钥库 - + Could not create private key generator 无法创建私钥生成器 - + Could not generate new private key 无法生成新的私钥 - + Could not retrieve private key from keystore 无法从密钥库检索私钥 - + Could not create encryption cipher 无法创建加密密码 - + Could not encrypt data 无法加密数据 @@ -3222,37 +3729,42 @@ and will not be shared or disclosed to the Amnezia or any third parties - - QFile error: The file could not be opened + + Missing AGW public key - QFile error: An error occurred when reading from the file + QFile error: The file could not be opened - QFile error: The file could not be accessed + QFile error: An error occurred when reading from the file - QFile error: An unspecified error occurred + QFile error: The file could not be accessed - QFile error: A fatal error occurred + QFile error: An unspecified error occurred + QFile error: A fatal error occurred + + + + QFile error: The operation was aborted - + ErrorCode: %1. 错误代码: %1. @@ -3320,7 +3832,7 @@ and will not be shared or disclosed to the Amnezia or any third parties 该配置不包含任何用于连接到服务器的容器和凭据。 - + Internal error @@ -3833,7 +4345,7 @@ While it offers a blend of security, stability, and speed, it's essential t SelectLanguageDrawer - + Choose language 选择语言 @@ -3841,13 +4353,13 @@ While it offers a blend of security, stability, and speed, it's essential t Settings - + Server #1 - - + + Server 服务器 @@ -3855,12 +4367,12 @@ While it offers a blend of security, stability, and speed, it's essential t SettingsController - + Backup file is corrupted 备份文件已损坏 - + All settings have been reset to default values 所配置恢复为默认值 @@ -3872,34 +4384,34 @@ While it offers a blend of security, stability, and speed, it's essential t ShareConnectionDrawer - - + + Save AmneziaVPN config 保存配置 - + Share 共享 - + Copy 拷贝 - - + + Copied 已拷贝 - + Copy config string 复制配置字符串 - + Show connection settings 显示连接配置 @@ -3908,7 +4420,7 @@ While it offers a blend of security, stability, and speed, it's essential t 展示内容 - + To read the QR code in the Amnezia app, select "Add server" → "I have data to connect" → "QR code, key or settings file" 要应用二维码到 Amnezia,请底部工具栏点击“+”→“连接方式”→“二维码、授权码或配置文件” @@ -3992,7 +4504,7 @@ While it offers a blend of security, stability, and speed, it's essential t TextFieldWithHeaderType - + The field can't be empty 输入不能为空 @@ -4000,7 +4512,7 @@ While it offers a blend of security, stability, and speed, it's essential t VpnConnection - + Mbps @@ -4051,12 +4563,12 @@ While it offers a blend of security, stability, and speed, it's essential t amnezia::ContainerProps - + Low - + High 中或高 @@ -4065,12 +4577,12 @@ While it offers a blend of security, stability, and speed, it's essential t 极度 - + I just want to increase the level of my privacy. 只是想提高隐私保护级别。 - + I want to bypass censorship. This option recommended in most cases. 想要绕过审查制度。大多数情况下推荐使用此选项。 @@ -4098,12 +4610,12 @@ While it offers a blend of security, stability, and speed, it's essential t main2 - + Private key passphrase 私钥密码 - + Save 保存 diff --git a/client/ui/controllers/connectionController.cpp b/client/ui/controllers/connectionController.cpp index 76c352f4..c7f95000 100644 --- a/client/ui/controllers/connectionController.cpp +++ b/client/ui/controllers/connectionController.cpp @@ -8,6 +8,7 @@ #include #include "core/controllers/vpnConfigurationController.h" +#include "core/enums/apiEnums.h" #include "version.h" ConnectionController::ConnectionController(const QSharedPointer &serversModel, @@ -16,7 +17,6 @@ ConnectionController::ConnectionController(const QSharedPointer &s const QSharedPointer &vpnConnection, const std::shared_ptr &settings, QObject *parent) : QObject(parent), - m_apiController(this), m_serversModel(serversModel), m_containersModel(containersModel), m_clientManagementModel(clientManagementModel), @@ -27,33 +27,39 @@ ConnectionController::ConnectionController(const QSharedPointer &s connect(this, &ConnectionController::connectToVpn, m_vpnConnection.get(), &VpnConnection::connectToVpn, Qt::QueuedConnection); connect(this, &ConnectionController::disconnectFromVpn, m_vpnConnection.get(), &VpnConnection::disconnectFromVpn, Qt::QueuedConnection); - connect(&m_apiController, &ApiController::configUpdated, this, - static_cast(&ConnectionController::openConnection)); - connect(&m_apiController, qOverload(&ApiController::errorOccurred), this, qOverload(&ConnectionController::connectionErrorOccurred)); + connect(this, &ConnectionController::configFromApiUpdated, this, &ConnectionController::continueConnection); m_state = Vpn::ConnectionState::Disconnected; } void ConnectionController::openConnection() { -#if !defined(Q_OS_ANDROID) && !defined(Q_OS_IOS) - if (!Utils::processIsRunning(Utils::executable(SERVICE_NAME, false), true)) - { - emit connectionErrorOccurred(ErrorCode::AmneziaServiceNotRunning); - return; - } -#endif +// #if !defined(Q_OS_ANDROID) && !defined(Q_OS_IOS) +// if (!Utils::processIsRunning(Utils::executable(SERVICE_NAME, false), true)) +// { +// emit connectionErrorOccurred(ErrorCode::AmneziaServiceNotRunning); +// return; +// } +// #endif int serverIndex = m_serversModel->getDefaultServerIndex(); QJsonObject serverConfig = m_serversModel->getServerConfig(serverIndex); + auto configVersion = serverConfig.value(config_key::configVersion).toInt(); emit m_vpnConnection->connectionStateChanged(Vpn::ConnectionState::Preparing); - if (serverConfig.value(config_key::configVersion).toInt() + if (configVersion == ApiConfigSources::Telegram && !m_serversModel->data(serverIndex, ServersModel::Roles::HasInstalledContainers).toBool()) { - m_apiController.updateServerConfigFromApi(m_settings->getInstallationUuid(true), serverIndex, serverConfig); + emit updateApiConfigFromTelegram(); + } else if (configVersion && m_serversModel->isApiKeyExpired(serverIndex)) { + qDebug() << "attempt to update api config by end_date event"; + if (configVersion == ApiConfigSources::Telegram) { + emit updateApiConfigFromTelegram(); + } else { + emit updateApiConfigFromGateway(); + } } else { - openConnection(false, serverConfig, serverIndex); + continueConnection(); } } @@ -185,12 +191,11 @@ bool ConnectionController::isProtocolConfigExists(const QJsonObject &containerCo return true; } -void ConnectionController::openConnection(const bool updateConfig, const QJsonObject &config, const int serverIndex) +void ConnectionController::continueConnection() { - // Update config for this server as it was received from API - if (updateConfig) { - m_serversModel->editServer(config, serverIndex); - } + int serverIndex = m_serversModel->getDefaultServerIndex(); + QJsonObject serverConfig = m_serversModel->getServerConfig(serverIndex); + auto configVersion = serverConfig.value(config_key::configVersion).toInt(); if (!m_serversModel->data(serverIndex, ServersModel::Roles::HasInstalledContainers).toBool()) { emit noInstalledContainers(); @@ -223,7 +228,7 @@ void ConnectionController::openConnection(const bool updateConfig, const QJsonOb auto dns = m_serversModel->getDnsPair(serverIndex); - auto vpnConfiguration = vpnConfigurationController.createVpnConfiguration(dns, config, containerConfig, container, errorCode); + auto vpnConfiguration = vpnConfigurationController.createVpnConfiguration(dns, serverConfig, containerConfig, container, errorCode); if (errorCode != ErrorCode::NoError) { emit connectionErrorOccurred(tr("unable to create configuration")); return; diff --git a/client/ui/controllers/connectionController.h b/client/ui/controllers/connectionController.h index bc8f7e2f..25d4d74a 100644 --- a/client/ui/controllers/connectionController.h +++ b/client/ui/controllers/connectionController.h @@ -1,7 +1,6 @@ #ifndef CONNECTIONCONTROLLER_H #define CONNECTIONCONTROLLER_H -#include "core/controllers/apiController.h" #include "protocols/vpnprotocol.h" #include "ui/models/clientManagementModel.h" #include "ui/models/containers_model.h" @@ -58,13 +57,15 @@ signals: void connectButtonClicked(); void preparingConfig(); + void updateApiConfigFromGateway(); + void updateApiConfigFromTelegram(); + void configFromApiUpdated(); + private: Vpn::ConnectionState getCurrentConnectionState(); bool isProtocolConfigExists(const QJsonObject &containerConfig, const DockerContainer container); - void openConnection(const bool updateConfig, const QJsonObject &config, const int serverIndex); - - ApiController m_apiController; + void continueConnection(); QSharedPointer m_serversModel; QSharedPointer m_containersModel; diff --git a/client/ui/controllers/exportController.cpp b/client/ui/controllers/exportController.cpp index a5605674..2690b5b1 100644 --- a/client/ui/controllers/exportController.cpp +++ b/client/ui/controllers/exportController.cpp @@ -10,9 +10,6 @@ #include "core/controllers/vpnConfigurationController.h" #include "systemController.h" -#ifdef Q_OS_ANDROID - #include "platforms/android/android_utils.h" -#endif #include "qrcodegen.hpp" ExportController::ExportController(const QSharedPointer &serversModel, const QSharedPointer &containersModel, @@ -24,12 +21,6 @@ ExportController::ExportController(const QSharedPointer &serversMo m_clientManagementModel(clientManagementModel), m_settings(settings) { -#ifdef Q_OS_ANDROID - m_authResultNotifier.reset(new AuthResultNotifier); - m_authResultReceiver.reset(new AuthResultReceiver(m_authResultNotifier)); - connect(m_authResultNotifier.get(), &AuthResultNotifier::authFailed, this, [this]() { emit exportErrorOccurred(tr("Access error!")); }); - connect(m_authResultNotifier.get(), &AuthResultNotifier::authSuccessful, this, &ExportController::generateFullAccessConfig); -#endif } void ExportController::generateFullAccessConfig() @@ -63,26 +54,6 @@ void ExportController::generateFullAccessConfig() emit exportConfigChanged(); } -#if defined(Q_OS_ANDROID) -void ExportController::generateFullAccessConfigAndroid() -{ - /* We use builtin keyguard for ssh key export protection on Android */ - QJniObject activity = AndroidUtils::getActivity(); - auto appContext = activity.callObjectMethod("getApplicationContext", "()Landroid/content/Context;"); - if (appContext.isValid()) { - auto intent = QJniObject::callStaticObjectMethod("org/amnezia/vpn/AuthHelper", "getAuthIntent", - "(Landroid/content/Context;)Landroid/content/Intent;", appContext.object()); - if (intent.isValid()) { - if (intent.object() != nullptr) { - QtAndroidPrivate::startActivity(intent.object(), 1, m_authResultReceiver.get()); - } - } else { - generateFullAccessConfig(); - } - } -} -#endif - void ExportController::generateConnectionConfig(const QString &clientName) { clearPreviousConfig(); @@ -133,7 +104,7 @@ ErrorCode ExportController::generateNativeConfig(const DockerContainer container int serverIndex = m_serversModel->getProcessedServerIndex(); ServerCredentials credentials = m_serversModel->getServerCredentials(serverIndex); auto dns = m_serversModel->getDnsPair(serverIndex); - bool isApiConfig = qvariant_cast(m_serversModel->data(serverIndex, ServersModel::IsServerFromApiRole)); + bool isApiConfig = qvariant_cast(m_serversModel->data(serverIndex, ServersModel::IsServerFromTelegramApiRole)); QJsonObject containerConfig = m_containersModel->getContainerConfig(container); containerConfig.insert(config_key::container, ContainerProps::containerToString(container)); diff --git a/client/ui/controllers/exportController.h b/client/ui/controllers/exportController.h index 023f22cf..b031ea39 100644 --- a/client/ui/controllers/exportController.h +++ b/client/ui/controllers/exportController.h @@ -6,9 +6,6 @@ #include "ui/models/clientManagementModel.h" #include "ui/models/containers_model.h" #include "ui/models/servers_model.h" -#ifdef Q_OS_ANDROID - #include "platforms/android/authResultReceiver.h" -#endif class ExportController : public QObject { @@ -25,9 +22,6 @@ public: public slots: void generateFullAccessConfig(); -#if defined(Q_OS_ANDROID) - void generateFullAccessConfigAndroid(); -#endif void generateConnectionConfig(const QString &clientName); void generateOpenVpnConfig(const QString &clientName); void generateWireGuardConfig(const QString &clientName); @@ -74,11 +68,6 @@ private: QString m_config; QString m_nativeConfigString; QList m_qrCodes; - -#ifdef Q_OS_ANDROID - QSharedPointer m_authResultNotifier; - QSharedPointer m_authResultReceiver; -#endif }; #endif // EXPORTCONTROLLER_H diff --git a/client/ui/controllers/importController.cpp b/client/ui/controllers/importController.cpp index 60a90e4e..168e3564 100644 --- a/client/ui/controllers/importController.cpp +++ b/client/ui/controllers/importController.cpp @@ -4,12 +4,12 @@ #include #include #include -#include #include +#include -#include "utilities.h" -#include "core/serialization/serialization.h" #include "core/errorstrings.h" +#include "core/serialization/serialization.h" +#include "utilities.h" #ifdef Q_OS_ANDROID #include "platforms/android/android_controller.h" @@ -84,7 +84,7 @@ bool ImportController::extractConfigFromFile(const QString &fileName) return extractConfigFromData(data); } - emit importErrorOccurred(tr("Unable to open file"), false); + emit importErrorOccurred(ErrorCode::ImportOpenConfigError, false); return false; } @@ -96,36 +96,40 @@ bool ImportController::extractConfigFromData(QString data) if (config.startsWith("vless://")) { m_configType = ConfigTypes::Xray; - m_config = extractXrayConfig(Utils::JsonToString(serialization::vless::Deserialize(config, &prefix, &errormsg), - QJsonDocument::JsonFormat::Compact), prefix); + m_config = extractXrayConfig( + Utils::JsonToString(serialization::vless::Deserialize(config, &prefix, &errormsg), QJsonDocument::JsonFormat::Compact), + prefix); return m_config.empty() ? false : true; } if (config.startsWith("vmess://") && config.contains("@")) { m_configType = ConfigTypes::Xray; - m_config = extractXrayConfig(Utils::JsonToString(serialization::vmess_new::Deserialize(config, &prefix, &errormsg), - QJsonDocument::JsonFormat::Compact), prefix); + m_config = extractXrayConfig( + Utils::JsonToString(serialization::vmess_new::Deserialize(config, &prefix, &errormsg), QJsonDocument::JsonFormat::Compact), + prefix); return m_config.empty() ? false : true; } if (config.startsWith("vmess://")) { m_configType = ConfigTypes::Xray; - m_config = extractXrayConfig(Utils::JsonToString(serialization::vmess::Deserialize(config, &prefix, &errormsg), - QJsonDocument::JsonFormat::Compact), prefix); + m_config = extractXrayConfig( + Utils::JsonToString(serialization::vmess::Deserialize(config, &prefix, &errormsg), QJsonDocument::JsonFormat::Compact), + prefix); return m_config.empty() ? false : true; } if (config.startsWith("trojan://")) { m_configType = ConfigTypes::Xray; - m_config = extractXrayConfig(Utils::JsonToString(serialization::trojan::Deserialize(config, &prefix, &errormsg), - QJsonDocument::JsonFormat::Compact), prefix); + m_config = extractXrayConfig( + Utils::JsonToString(serialization::trojan::Deserialize(config, &prefix, &errormsg), QJsonDocument::JsonFormat::Compact), + prefix); return m_config.empty() ? false : true; } if (config.startsWith("ss://") && !config.contains("plugin=")) { m_configType = ConfigTypes::ShadowSocks; - m_config = extractXrayConfig(Utils::JsonToString(serialization::ss::Deserialize(config, &prefix, &errormsg), - QJsonDocument::JsonFormat::Compact), prefix); + m_config = extractXrayConfig( + Utils::JsonToString(serialization::ss::Deserialize(config, &prefix, &errormsg), QJsonDocument::JsonFormat::Compact), prefix); return m_config.empty() ? false : true; } @@ -173,6 +177,7 @@ bool ImportController::extractConfigFromData(QString data) } case ConfigTypes::Amnezia: { m_config = QJsonDocument::fromJson(config.toUtf8()).object(); + processAmneziaConfig(m_config); if (!m_config.empty()) { checkForMaliciousStrings(m_config); return true; @@ -183,12 +188,12 @@ bool ImportController::extractConfigFromData(QString data) if (!m_serversModel->getServersCount()) { emit restoreAppConfig(config.toUtf8()); } else { - emit importErrorOccurred(tr("Invalid configuration file"), false); + emit importErrorOccurred(ErrorCode::ImportInvalidConfigError, false); } break; } case ConfigTypes::Invalid: { - emit importErrorOccurred(tr("Invalid configuration file"), false); + emit importErrorOccurred(ErrorCode::ImportInvalidConfigError, false); break; } } @@ -237,24 +242,26 @@ void ImportController::processNativeWireGuardConfig() auto containers = m_config.value(config_key::containers).toArray(); if (!containers.isEmpty()) { auto container = containers.at(0).toObject(); - auto containerConfig = container.value(ContainerProps::containerTypeToString(DockerContainer::WireGuard)).toObject(); - auto protocolConfig = QJsonDocument::fromJson(containerConfig.value(config_key::last_config).toString().toUtf8()).object(); + auto serverProtocolConfig = container.value(ContainerProps::containerTypeToString(DockerContainer::WireGuard)).toObject(); + auto clientProtocolConfig = QJsonDocument::fromJson(serverProtocolConfig.value(config_key::last_config).toString().toUtf8()).object(); - QString junkPacketCount = QString::number(QRandomGenerator::global()->bounded(3, 10)); - QString junkPacketMinSize = QString::number(50); - QString junkPacketMaxSize = QString::number(1000); - protocolConfig[config_key::junkPacketCount] = junkPacketCount; - protocolConfig[config_key::junkPacketMinSize] = junkPacketMinSize; - protocolConfig[config_key::junkPacketMaxSize] = junkPacketMaxSize; - protocolConfig[config_key::initPacketJunkSize] = "0"; - protocolConfig[config_key::responsePacketJunkSize] = "0"; - protocolConfig[config_key::initPacketMagicHeader] = "1"; - protocolConfig[config_key::responsePacketMagicHeader] = "2"; - protocolConfig[config_key::underloadPacketMagicHeader] = "3"; - protocolConfig[config_key::transportPacketMagicHeader] = "4"; + QString junkPacketCount = QString::number(QRandomGenerator::global()->bounded(2, 5)); + QString junkPacketMinSize = QString::number(10); + QString junkPacketMaxSize = QString::number(50); + clientProtocolConfig[config_key::junkPacketCount] = junkPacketCount; + clientProtocolConfig[config_key::junkPacketMinSize] = junkPacketMinSize; + clientProtocolConfig[config_key::junkPacketMaxSize] = junkPacketMaxSize; + clientProtocolConfig[config_key::initPacketJunkSize] = "0"; + clientProtocolConfig[config_key::responsePacketJunkSize] = "0"; + clientProtocolConfig[config_key::initPacketMagicHeader] = "1"; + clientProtocolConfig[config_key::responsePacketMagicHeader] = "2"; + clientProtocolConfig[config_key::underloadPacketMagicHeader] = "3"; + clientProtocolConfig[config_key::transportPacketMagicHeader] = "4"; - containerConfig[config_key::last_config] = QString(QJsonDocument(protocolConfig).toJson()); - container["wireguard"] = containerConfig; + clientProtocolConfig[config_key::isObfuscationEnabled] = true; + + serverProtocolConfig[config_key::last_config] = QString(QJsonDocument(clientProtocolConfig).toJson()); + container["wireguard"] = serverProtocolConfig; containers.replace(0, container); m_config[config_key::containers] = containers; } @@ -353,20 +360,19 @@ QJsonObject ImportController::extractWireGuardConfig(const QString &data) QJsonObject lastConfig; lastConfig[config_key::config] = data; - const static QRegularExpression hostNameAndPortRegExp("Endpoint = (.*):([0-9]*)"); - QRegularExpressionMatch hostNameAndPortMatch = hostNameAndPortRegExp.match(data); + auto url { QUrl::fromUserInput(configMap.value("Endpoint")) }; QString hostName; QString port; - if (hostNameAndPortMatch.hasCaptured(1)) { - hostName = hostNameAndPortMatch.captured(1); + if (!url.host().isEmpty()) { + hostName = url.host(); } else { - qDebug() << "Key parameter 'Endpoint' is missing"; + qDebug() << "Key parameter 'Endpoint' is missing or has an invalid format"; emit importErrorOccurred(ErrorCode::ImportInvalidConfigError, false); return QJsonObject(); } - if (hostNameAndPortMatch.hasCaptured(2)) { - port = hostNameAndPortMatch.captured(2); + if (url.port() != -1) { + port = QString::number(url.port()); } else { port = protocols::wireguard::defaultPort; } @@ -395,7 +401,11 @@ QJsonObject ImportController::extractWireGuardConfig(const QString &data) lastConfig[config_key::mtu] = configMap.value("MTU"); } - QJsonArray allowedIpsJsonArray = QJsonArray::fromStringList(configMap.value("AllowedIPs").split(",")); + if (!configMap.value("PersistentKeepalive").isEmpty()) { + lastConfig[config_key::persistent_keep_alive] = configMap.value("PersistentKeepalive"); + } + + QJsonArray allowedIpsJsonArray = QJsonArray::fromStringList(configMap.value("AllowedIPs").split(", ")); lastConfig[config_key::allowed_ips] = allowedIpsJsonArray; @@ -419,6 +429,12 @@ QJsonObject ImportController::extractWireGuardConfig(const QString &data) m_configType = ConfigTypes::Awg; } + if (!configMap.value("MTU").isEmpty()) { + lastConfig[config_key::mtu] = configMap.value("MTU"); + } else { + lastConfig[config_key::mtu] = protocolName == "awg" ? protocols::awg::defaultMtu : protocols::wireguard::defaultMtu; + } + QJsonObject wireguardConfig; wireguardConfig[config_key::last_config] = QString(QJsonDocument(lastConfig).toJson()); wireguardConfig[config_key::isThirdPartyConfig] = true; @@ -488,7 +504,7 @@ QJsonObject ImportController::extractXrayConfig(const QString &data, const QStri if (m_configType == ConfigTypes::ShadowSocks) { config[config_key::defaultContainer] = "amnezia-ssxray"; } else { - config[config_key::defaultContainer] = "amnezia-xray"; + config[config_key::defaultContainer] = "amnezia-xray"; } if (description.isEmpty()) { config[config_key::description] = m_settings->nextAvailableServerName(); @@ -646,3 +662,28 @@ void ImportController::checkForMaliciousStrings(const QJsonObject &serverConfig) } } } + +void ImportController::processAmneziaConfig(QJsonObject &config) +{ + auto containers = config.value(config_key::containers).toArray(); + for (auto i = 0; i < containers.size(); i++) { + auto container = containers.at(i).toObject(); + auto dockerContainer = ContainerProps::containerFromString(container.value(config_key::container).toString()); + if (dockerContainer == DockerContainer::Awg || dockerContainer == DockerContainer::WireGuard) { + auto containerConfig = container.value(ContainerProps::containerTypeToString(dockerContainer)).toObject(); + auto protocolConfig = containerConfig.value(config_key::last_config).toString(); + if (protocolConfig.isEmpty()) { + return; + } + + QJsonObject jsonConfig = QJsonDocument::fromJson(protocolConfig.toUtf8()).object(); + jsonConfig[config_key::mtu] = dockerContainer == DockerContainer::Awg ? protocols::awg::defaultMtu : protocols::wireguard::defaultMtu; + + containerConfig[config_key::last_config] = QString(QJsonDocument(jsonConfig).toJson()); + + container[ContainerProps::containerTypeToString(dockerContainer)] = containerConfig; + containers.replace(i, container); + config.insert(config_key::containers, containers); + } + } +} diff --git a/client/ui/controllers/importController.h b/client/ui/controllers/importController.h index ea1ba6b0..05e320a5 100644 --- a/client/ui/controllers/importController.h +++ b/client/ui/controllers/importController.h @@ -54,7 +54,6 @@ public slots: signals: void importFinished(); - void importErrorOccurred(const QString &errorMessage, bool goToPageHome); void importErrorOccurred(ErrorCode errorCode, bool goToPageHome); void qrDecodingFinished(); @@ -68,6 +67,8 @@ private: void checkForMaliciousStrings(const QJsonObject &protocolConfig); + void processAmneziaConfig(QJsonObject &config); + #if defined Q_OS_ANDROID || defined Q_OS_IOS void stopDecodingQr(); #endif diff --git a/client/ui/controllers/installController.cpp b/client/ui/controllers/installController.cpp index 514091d4..31aa1fb1 100644 --- a/client/ui/controllers/installController.cpp +++ b/client/ui/controllers/installController.cpp @@ -7,6 +7,7 @@ #include #include +#include "core/controllers/apiController.h" #include "core/controllers/serverController.h" #include "core/controllers/vpnConfigurationController.h" #include "core/networkUtilities.h" @@ -15,14 +16,24 @@ #include "ui/models/protocols/wireguardConfigModel.h" #include "utilities.h" -#ifdef Q_OS_IOS - #include -#endif - namespace { Logger logger("ServerController"); + namespace configKey + { + constexpr char serviceInfo[] = "service_info"; + constexpr char serviceType[] = "service_type"; + constexpr char serviceProtocol[] = "service_protocol"; + constexpr char userCountryCode[] = "user_country_code"; + + constexpr char serverCountryCode[] = "server_country_code"; + constexpr char serverCountryName[] = "server_country_name"; + constexpr char availableCountries[] = "available_countries"; + + constexpr char apiConfig[] = "api_config"; + } + #ifdef Q_OS_WINDOWS QString getNextDriverLetter() { @@ -52,12 +63,14 @@ namespace InstallController::InstallController(const QSharedPointer &serversModel, const QSharedPointer &containersModel, const QSharedPointer &protocolsModel, const QSharedPointer &clientManagementModel, - const std::shared_ptr &settings, QObject *parent) + const QSharedPointer &apiServicesModel, const std::shared_ptr &settings, + QObject *parent) : QObject(parent), m_serversModel(serversModel), m_containersModel(containersModel), m_protocolModel(protocolsModel), m_clientManagementModel(clientManagementModel), + m_apiServicesModel(apiServicesModel), m_settings(settings) { } @@ -85,9 +98,9 @@ void InstallController::install(DockerContainer container, int port, TransportPr containerConfig.insert(config_key::transport_proto, ProtocolProps::transportProtoToString(transportProto, protocol)); if (container == DockerContainer::Awg) { - QString junkPacketCount = QString::number(QRandomGenerator::global()->bounded(3, 10)); - QString junkPacketMinSize = QString::number(50); - QString junkPacketMaxSize = QString::number(1000); + QString junkPacketCount = QString::number(QRandomGenerator::global()->bounded(2, 5)); + QString junkPacketMinSize = QString::number(10); + QString junkPacketMaxSize = QString::number(50); int s1 = QRandomGenerator::global()->bounded(15, 150); int s2 = QRandomGenerator::global()->bounded(15, 150); @@ -432,7 +445,7 @@ ErrorCode InstallController::getAlreadyInstalledContainers(const ServerCredentia containerConfig.insert(config_key::password, password); } else if (protocol == Proto::Socks5Proxy) { QString proxyConfig = serverController->getTextFileFromContainer(container, credentials, - protocols::socks5Proxy::proxyConfigPath, errorCode); + protocols::socks5Proxy::proxyConfigPath, errorCode); const static QRegularExpression usernameAndPasswordRegExp("users (\\w+):CL:(\\w+)"); QRegularExpressionMatch usernameAndPasswordMatch = usernameAndPasswordRegExp.match(proxyConfig); @@ -591,25 +604,8 @@ void InstallController::removeProcessedContainer() void InstallController::removeApiConfig(const int serverIndex) { - auto serverConfig = m_serversModel->getServerConfig(serverIndex); - -#ifdef Q_OS_IOS - QString vpncName = QString("%1 (%2) %3") - .arg(serverConfig[config_key::description].toString()) - .arg(serverConfig[config_key::hostName].toString()) - .arg(serverConfig[config_key::vpnproto].toString()); - - AmneziaVPN::removeVPNC(vpncName.toStdString()); -#endif - - serverConfig.remove(config_key::dns1); - serverConfig.remove(config_key::dns2); - serverConfig.remove(config_key::containers); - serverConfig.remove(config_key::hostName); - - serverConfig.insert(config_key::defaultContainer, ContainerProps::containerToString(DockerContainer::None)); - - m_serversModel->editServer(serverConfig, serverIndex); + m_serversModel->removeApiConfig(serverIndex); + emit apiConfigRemoved(tr("Api config removed")); } void InstallController::clearCachedProfile(QSharedPointer serverController) @@ -772,7 +768,7 @@ bool InstallController::checkSshConnection(QSharedPointer serv } else { if (output.contains(tr("Please login as the user"))) { output.replace("\n", ""); - emit installationErrorOccurred(output); + emit wrongInstallationUser(output); return false; } } @@ -801,6 +797,110 @@ void InstallController::addEmptyServer() emit installServerFinished(tr("Server added successfully")); } +bool InstallController::fillAvailableServices() +{ + ApiController apiController(m_settings->getGatewayEndpoint(), m_settings->isDevGatewayEnv()); + + QByteArray responseBody; + ErrorCode errorCode = apiController.getServicesList(responseBody); + if (errorCode != ErrorCode::NoError) { + emit installationErrorOccurred(errorCode); + return false; + } + + QJsonObject data = QJsonDocument::fromJson(responseBody).object(); + m_apiServicesModel->updateModel(data); + return true; +} + +bool InstallController::installServiceFromApi() +{ + if (m_serversModel->isServerFromApiAlreadyExists(m_apiServicesModel->getCountryCode(), m_apiServicesModel->getSelectedServiceType(), + m_apiServicesModel->getSelectedServiceProtocol())) { + emit installationErrorOccurred(ErrorCode::ApiConfigAlreadyAdded); + return false; + } + + ApiController apiController(m_settings->getGatewayEndpoint(), m_settings->isDevGatewayEnv()); + QJsonObject serverConfig; + + ErrorCode errorCode = apiController.getConfigForService(m_settings->getInstallationUuid(true), m_apiServicesModel->getCountryCode(), + m_apiServicesModel->getSelectedServiceType(), + m_apiServicesModel->getSelectedServiceProtocol(), "", serverConfig); + if (errorCode != ErrorCode::NoError) { + emit installationErrorOccurred(errorCode); + return false; + } + + auto serviceInfo = m_apiServicesModel->getSelectedServiceInfo(); + QJsonObject apiConfig = serverConfig.value(configKey::apiConfig).toObject(); + apiConfig.insert(configKey::serviceInfo, serviceInfo); + apiConfig.insert(configKey::userCountryCode, m_apiServicesModel->getCountryCode()); + apiConfig.insert(configKey::serviceType, m_apiServicesModel->getSelectedServiceType()); + apiConfig.insert(configKey::serviceProtocol, m_apiServicesModel->getSelectedServiceProtocol()); + + serverConfig.insert(configKey::apiConfig, apiConfig); + + m_serversModel->addServer(serverConfig); + emit installServerFromApiFinished(tr("%1 installed successfully.").arg(m_apiServicesModel->getSelectedServiceName())); + return true; +} + +bool InstallController::updateServiceFromApi(const int serverIndex, const QString &newCountryCode, const QString &newCountryName, + bool reloadServiceConfig) +{ + ApiController apiController(m_settings->getGatewayEndpoint(), m_settings->isDevGatewayEnv()); + + auto serverConfig = m_serversModel->getServerConfig(serverIndex); + auto apiConfig = serverConfig.value(configKey::apiConfig).toObject(); + + QJsonObject newServerConfig; + ErrorCode errorCode = + apiController.getConfigForService(m_settings->getInstallationUuid(true), apiConfig.value(configKey::userCountryCode).toString(), + apiConfig.value(configKey::serviceType).toString(), + apiConfig.value(configKey::serviceProtocol).toString(), newCountryCode, newServerConfig); + if (errorCode != ErrorCode::NoError) { + emit installationErrorOccurred(errorCode); + return false; + } + + QJsonObject newApiConfig = newServerConfig.value(configKey::apiConfig).toObject(); + newApiConfig.insert(configKey::serviceInfo, apiConfig.value(configKey::serviceInfo)); + newApiConfig.insert(configKey::userCountryCode, apiConfig.value(configKey::userCountryCode)); + newApiConfig.insert(configKey::serviceType, apiConfig.value(configKey::serviceType)); + newApiConfig.insert(configKey::serviceProtocol, apiConfig.value(configKey::serviceProtocol)); + + newServerConfig.insert(configKey::apiConfig, newApiConfig); + m_serversModel->editServer(newServerConfig, serverIndex); + + if (reloadServiceConfig) { + emit reloadServerFromApiFinished(tr("API config reloaded")); + } else if (newCountryName.isEmpty()) { + emit updateServerFromApiFinished(); + } else { + emit changeApiCountryFinished(tr("Successfully changed the country of connection to %1").arg(newCountryName)); + } + return true; +} + +void InstallController::updateServiceFromTelegram(const int serverIndex) +{ + ApiController *apiController = new ApiController(m_settings->getGatewayEndpoint(), m_settings->isDevGatewayEnv()); + + auto serverConfig = m_serversModel->getServerConfig(serverIndex); + + apiController->updateServerConfigFromApi(m_settings->getInstallationUuid(true), serverIndex, serverConfig); + connect(apiController, &ApiController::finished, this, [this, apiController](const QJsonObject &config, const int serverIndex) { + m_serversModel->editServer(config, serverIndex); + emit updateServerFromApiFinished(); + apiController->deleteLater(); + }); + connect(apiController, &ApiController::errorOccurred, this, [this, apiController](ErrorCode errorCode) { + emit installationErrorOccurred(errorCode); + apiController->deleteLater(); + }); +} + bool InstallController::isUpdateDockerContainerRequired(const DockerContainer container, const QJsonObject &oldConfig, const QJsonObject &newConfig) { diff --git a/client/ui/controllers/installController.h b/client/ui/controllers/installController.h index 5e7fd41d..d7ab3553 100644 --- a/client/ui/controllers/installController.h +++ b/client/ui/controllers/installController.h @@ -10,6 +10,7 @@ #include "ui/models/containers_model.h" #include "ui/models/protocols_model.h" #include "ui/models/servers_model.h" +#include "ui/models/apiServicesModel.h" class InstallController : public QObject { @@ -18,6 +19,7 @@ public: explicit InstallController(const QSharedPointer &serversModel, const QSharedPointer &containersModel, const QSharedPointer &protocolsModel, const QSharedPointer &clientManagementModel, + const QSharedPointer &apiServicesModel, const std::shared_ptr &settings, QObject *parent = nullptr); ~InstallController(); @@ -50,11 +52,21 @@ public slots: void addEmptyServer(); + bool fillAvailableServices(); + bool installServiceFromApi(); + bool updateServiceFromApi(const int serverIndex, const QString &newCountryCode, const QString &newCountryName, bool reloadServiceConfig = false); + + void updateServiceFromTelegram(const int serverIndex); + signals: void installContainerFinished(const QString &finishMessage, bool isServiceInstall); void installServerFinished(const QString &finishMessage); + void installServerFromApiFinished(const QString &message); void updateContainerFinished(const QString &message); + void updateServerFromApiFinished(); + void changeApiCountryFinished(const QString &message); + void reloadServerFromApiFinished(const QString &message); void scanServerFinished(bool isInstalledContainerFound); @@ -63,8 +75,8 @@ signals: void removeAllContainersFinished(const QString &finishedMessage); void removeProcessedContainerFinished(const QString &finishedMessage); - void installationErrorOccurred(const QString &errorMessage); void installationErrorOccurred(ErrorCode errorCode); + void wrongInstallationUser(const QString &message); void serverAlreadyExists(int serverIndex); @@ -77,6 +89,7 @@ signals: void currentContainerUpdated(); void cachedProfileCleared(const QString &message); + void apiConfigRemoved(const QString &message); private: void installServer(const DockerContainer container, const QMap &installedContainers, @@ -95,6 +108,8 @@ private: QSharedPointer m_containersModel; QSharedPointer m_protocolModel; QSharedPointer m_clientManagementModel; + QSharedPointer m_apiServicesModel; + std::shared_ptr m_settings; ServerCredentials m_processedServerCredentials; diff --git a/client/ui/controllers/pageController.cpp b/client/ui/controllers/pageController.cpp index 3c6583d3..bbcc55a1 100644 --- a/client/ui/controllers/pageController.cpp +++ b/client/ui/controllers/pageController.cpp @@ -10,8 +10,6 @@ #ifdef Q_OS_ANDROID #include "platforms/android/android_controller.h" - #include "platforms/android/android_utils.h" - #include #endif #if defined Q_OS_MAC #include "ui/macos_util.h" @@ -22,18 +20,8 @@ PageController::PageController(const QSharedPointer &serversModel, : QObject(parent), m_serversModel(serversModel), m_settings(settings) { #ifdef Q_OS_ANDROID - // Change color of navigation and status bar's auto initialPageNavigationBarColor = getInitialPageNavigationBarColor(); - AndroidUtils::runOnAndroidThreadSync([&initialPageNavigationBarColor]() { - QJniObject activity = AndroidUtils::getActivity(); - QJniObject window = activity.callObjectMethod("getWindow", "()Landroid/view/Window;"); - if (window.isValid()) { - window.callMethod("addFlags", "(I)V", 0x80000000); - window.callMethod("clearFlags", "(I)V", 0x04000000); - window.callMethod("setStatusBarColor", "(I)V", 0xFF0E0E11); - window.callMethod("setNavigationBarColor", "(I)V", initialPageNavigationBarColor); - } - }); + AndroidController::instance()->setNavigationBarColor(initialPageNavigationBarColor); #endif #if defined Q_OS_MACX @@ -46,16 +34,16 @@ PageController::PageController(const QSharedPointer &serversModel, m_isTriggeredByConnectButton = false; } -QString PageController::getInitialPage() +bool PageController::isStartPageVisible() { if (m_serversModel->getServersCount()) { if (m_serversModel->getDefaultServerIndex() < 0) { auto defaultServerIndex = m_serversModel->index(0); m_serversModel->setData(defaultServerIndex, true, ServersModel::Roles::IsDefaultRole); } - return getPagePath(PageLoader::PageEnum::PageStart); + return false; } else { - return getPagePath(PageLoader::PageEnum::PageSetupWizardStart); + return true; } } @@ -115,14 +103,7 @@ unsigned int PageController::getInitialPageNavigationBarColor() void PageController::updateNavigationBarColor(const int color) { #ifdef Q_OS_ANDROID - // Change color of navigation bar - AndroidUtils::runOnAndroidThreadSync([&color]() { - QJniObject activity = AndroidUtils::getActivity(); - QJniObject window = activity.callObjectMethod("getWindow", "()Landroid/view/Window;"); - if (window.isValid()) { - window.callMethod("setNavigationBarColor", "(I)V", color); - } - }); + AndroidController::instance()->setNavigationBarColor(color); #endif } @@ -131,7 +112,7 @@ void PageController::showOnStartup() if (!m_settings->isStartMinimized()) { emit raiseMainWindow(); } else { -#ifdef Q_OS_WIN +#if defined(Q_OS_WIN) || (defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID)) emit hideMainWindow(); #elif defined Q_OS_MACX setDockIconVisible(false); diff --git a/client/ui/controllers/pageController.h b/client/ui/controllers/pageController.h index c9d655ba..f89d39a1 100644 --- a/client/ui/controllers/pageController.h +++ b/client/ui/controllers/pageController.h @@ -47,6 +47,8 @@ namespace PageLoader PageSetupWizardTextKey, PageSetupWizardViewConfig, PageSetupWizardQrReader, + PageSetupWizardApiServicesList, + PageSetupWizardApiServiceInfo, PageProtocolOpenVpnSettings, PageProtocolShadowSocksSettings, @@ -57,7 +59,12 @@ namespace PageLoader PageProtocolIKev2Settings, PageProtocolRaw, - PageShareFullAccess + PageProtocolWireGuardClientSettings, + PageProtocolAwgClientSettings, + + PageShareFullAccess, + + PageDevMenu }; Q_ENUM_NS(PageEnum) @@ -75,7 +82,7 @@ public: QObject *parent = nullptr); public slots: - QString getInitialPage(); + bool isStartPageVisible(); QString getPagePath(PageLoader::PageEnum page); void closeWindow(); @@ -110,7 +117,6 @@ signals: void closePage(); void restorePageHomeState(bool isContainerInstalled = false); - void replaceStartPage(); void showErrorMessage(amnezia::ErrorCode); void showErrorMessage(const QString &errorMessage); diff --git a/client/ui/controllers/settingsController.cpp b/client/ui/controllers/settingsController.cpp index aceac551..c3945512 100644 --- a/client/ui/controllers/settingsController.cpp +++ b/client/ui/controllers/settingsController.cpp @@ -88,7 +88,12 @@ void SettingsController::toggleLogging(bool enable) void SettingsController::openLogsFolder() { - Logger::openLogsFolder(); + Logger::openLogsFolder(false); +} + +void SettingsController::openServiceLogsFolder() +{ + Logger::openLogsFolder(true); } void SettingsController::exportLogsFile(const QString &fileName) @@ -100,12 +105,21 @@ void SettingsController::exportLogsFile(const QString &fileName) #endif } +void SettingsController::exportServiceLogsFile(const QString &fileName) +{ +#ifdef Q_OS_ANDROID + AndroidController::instance()->exportLogsFile(fileName); +#else + SystemController::saveFile(fileName, Logger::getServiceLogFile()); +#endif +} + void SettingsController::clearLogs() { #ifdef Q_OS_ANDROID AndroidController::instance()->clearLogs(); #else - Logger::clearLogs(); + Logger::clearLogs(false); Logger::clearServiceLogs(); #endif } @@ -252,3 +266,62 @@ void SettingsController::requestNotificationPermission() AndroidController::instance()->requestNotificationPermission(); #endif } + +QString SettingsController::getInstallationUuid() +{ + return m_settings->getInstallationUuid(false); +} + +void SettingsController::enableDevMode() +{ + m_isDevModeEnabled = true; + emit devModeEnabled(); +} + +bool SettingsController::isDevModeEnabled() +{ + return m_isDevModeEnabled; +} + +void SettingsController::resetGatewayEndpoint() +{ + m_settings->resetGatewayEndpoint(); + emit gatewayEndpointChanged(m_settings->getGatewayEndpoint()); +} + +void SettingsController::setGatewayEndpoint(const QString &endpoint) +{ + m_settings->setGatewayEndpoint(endpoint); + emit gatewayEndpointChanged(endpoint); +} + +QString SettingsController::getGatewayEndpoint() +{ + return m_settings->isDevGatewayEnv() ? "Dev endpoint" : m_settings->getGatewayEndpoint(); +} + +bool SettingsController::isDevGatewayEnv() +{ + return m_settings->isDevGatewayEnv(); +} + +void SettingsController::toggleDevGatewayEnv(bool enabled) +{ + m_settings->toggleDevGatewayEnv(enabled); + if (enabled) { + m_settings->setDevGatewayEndpoint(); + } else { + m_settings->resetGatewayEndpoint(); + } + emit gatewayEndpointChanged(m_settings->getGatewayEndpoint()); + emit devGatewayEnvChanged(enabled); +} + +bool SettingsController::isOnTv() +{ +#ifdef Q_OS_ANDROID + return AndroidController::instance()->isOnTv(); +#else + return false; +#endif +} \ No newline at end of file diff --git a/client/ui/controllers/settingsController.h b/client/ui/controllers/settingsController.h index 43ad10e8..efc18a7d 100644 --- a/client/ui/controllers/settingsController.h +++ b/client/ui/controllers/settingsController.h @@ -25,6 +25,10 @@ public: Q_PROPERTY(bool isLoggingEnabled READ isLoggingEnabled WRITE toggleLogging NOTIFY loggingStateChanged) Q_PROPERTY(bool isNotificationPermissionGranted READ isNotificationPermissionGranted NOTIFY onNotificationStateChanged) + Q_PROPERTY(bool isDevModeEnabled READ isDevModeEnabled NOTIFY devModeEnabled) + Q_PROPERTY(QString gatewayEndpoint READ getGatewayEndpoint WRITE setGatewayEndpoint NOTIFY gatewayEndpointChanged) + Q_PROPERTY(bool isDevGatewayEnv READ isDevGatewayEnv WRITE toggleDevGatewayEnv NOTIFY devGatewayEnvChanged) + public slots: void toggleAmneziaDns(bool enable); bool isAmneziaDnsEnabled(); @@ -39,7 +43,9 @@ public slots: void toggleLogging(bool enable); void openLogsFolder(); + void openServiceLogsFolder(); void exportLogsFile(const QString &fileName); + void exportServiceLogsFile(const QString &fileName); void clearLogs(); void backupAppConfig(const QString &fileName); @@ -70,6 +76,19 @@ public slots: bool isNotificationPermissionGranted(); void requestNotificationPermission(); + QString getInstallationUuid(); + + void enableDevMode(); + bool isDevModeEnabled(); + + void resetGatewayEndpoint(); + void setGatewayEndpoint(const QString &endpoint); + QString getGatewayEndpoint(); + bool isDevGatewayEnv(); + void toggleDevGatewayEnv(bool enabled); + + bool isOnTv(); + signals: void primaryDnsChanged(); void secondaryDnsChanged(); @@ -89,6 +108,10 @@ signals: void onNotificationStateChanged(); + void devModeEnabled(); + void gatewayEndpointChanged(const QString &endpoint); + void devGatewayEnvChanged(bool enabled); + private: QSharedPointer m_serversModel; QSharedPointer m_containersModel; @@ -101,6 +124,8 @@ private: QDateTime m_loggingDisableDate; + bool m_isDevModeEnabled = false; + void checkIfNeedDisableLogs(); }; diff --git a/client/ui/controllers/systemController.cpp b/client/ui/controllers/systemController.cpp index e6a9a28e..4598bff1 100644 --- a/client/ui/controllers/systemController.cpp +++ b/client/ui/controllers/systemController.cpp @@ -125,3 +125,12 @@ void SystemController::setQmlRoot(QObject *qmlRoot) { m_qmlRoot = qmlRoot; } + +bool SystemController::isAuthenticated() +{ +#ifdef Q_OS_ANDROID + return AndroidController::instance()->requestAuthentication(); +#else + return true; +#endif +} diff --git a/client/ui/controllers/systemController.h b/client/ui/controllers/systemController.h index 274df234..d2ee6f63 100644 --- a/client/ui/controllers/systemController.h +++ b/client/ui/controllers/systemController.h @@ -19,6 +19,7 @@ public slots: void setQmlRoot(QObject *qmlRoot); + bool isAuthenticated(); signals: void fileDialogClosed(const bool isAccepted); diff --git a/client/ui/macos_util.h b/client/ui/macos_util.h index 15677e42..ff16390a 100644 --- a/client/ui/macos_util.h +++ b/client/ui/macos_util.h @@ -3,7 +3,7 @@ #ifndef Q_OS_IOS #include -#include +#include void setDockIconVisible(bool visible); void fixWidget(QWidget *widget); diff --git a/client/ui/models/apiCountryModel.cpp b/client/ui/models/apiCountryModel.cpp new file mode 100644 index 00000000..ae58329f --- /dev/null +++ b/client/ui/models/apiCountryModel.cpp @@ -0,0 +1,80 @@ +#include "apiCountryModel.h" + +#include + +#include "logger.h" + +namespace +{ + Logger logger("ApiCountryModel"); + + namespace configKey + { + constexpr char serverCountryCode[] = "server_country_code"; + constexpr char serverCountryName[] = "server_country_name"; + } +} + +ApiCountryModel::ApiCountryModel(QObject *parent) : QAbstractListModel(parent) +{ +} + +int ApiCountryModel::rowCount(const QModelIndex &parent) const +{ + Q_UNUSED(parent) + return m_countries.size(); +} + +QVariant ApiCountryModel::data(const QModelIndex &index, int role) const +{ + if (!index.isValid() || index.row() < 0 || index.row() >= static_cast(rowCount())) + return QVariant(); + + QJsonObject countryInfo = m_countries.at(index.row()).toObject(); + + switch (role) { + case CountryCodeRole: { + return countryInfo.value(configKey::serverCountryCode).toString(); + } + case CountryNameRole: { + return countryInfo.value(configKey::serverCountryName).toString(); + } + } + + return QVariant(); +} + +void ApiCountryModel::updateModel(const QJsonArray &data, const QString ¤tCountryCode) +{ + beginResetModel(); + + m_countries = data; + for (int i = 0; i < m_countries.size(); i++) { + if (m_countries.at(i).toObject().value(configKey::serverCountryCode).toString() == currentCountryCode) { + m_currentIndex = i; + emit currentIndexChanged(m_currentIndex); + break; + } + } + + endResetModel(); +} + +int ApiCountryModel::getCurrentIndex() +{ + return m_currentIndex; +} + +void ApiCountryModel::setCurrentIndex(const int i) +{ + m_currentIndex = i; + emit currentIndexChanged(m_currentIndex); +} + +QHash ApiCountryModel::roleNames() const +{ + QHash roles; + roles[CountryNameRole] = "countryName"; + roles[CountryCodeRole] = "countryCode"; + return roles; +} diff --git a/client/ui/models/apiCountryModel.h b/client/ui/models/apiCountryModel.h new file mode 100644 index 00000000..8789158b --- /dev/null +++ b/client/ui/models/apiCountryModel.h @@ -0,0 +1,42 @@ +#ifndef APICOUNTRYMODEL_H +#define APICOUNTRYMODEL_H + +#include +#include + +class ApiCountryModel : public QAbstractListModel +{ + Q_OBJECT + +public: + enum Roles { + CountryNameRole = Qt::UserRole + 1, + CountryCodeRole + }; + + explicit ApiCountryModel(QObject *parent = nullptr); + + int rowCount(const QModelIndex &parent = QModelIndex()) const override; + + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; + + Q_PROPERTY(int currentIndex READ getCurrentIndex WRITE setCurrentIndex NOTIFY currentIndexChanged) + +public slots: + void updateModel(const QJsonArray &data, const QString ¤tCountryCode); + + int getCurrentIndex(); + void setCurrentIndex(const int i); + +signals: + void currentIndexChanged(const int index); + +protected: + QHash roleNames() const override; + +private: + QJsonArray m_countries; + int m_currentIndex; +}; + +#endif // APICOUNTRYMODEL_H diff --git a/client/ui/models/apiServicesModel.cpp b/client/ui/models/apiServicesModel.cpp new file mode 100644 index 00000000..2a87bde3 --- /dev/null +++ b/client/ui/models/apiServicesModel.cpp @@ -0,0 +1,218 @@ +#include "apiServicesModel.h" + +#include + +#include "logger.h" + +namespace +{ + Logger logger("ApiServicesModel"); + + namespace configKey + { + constexpr char userCountryCode[] = "user_country_code"; + constexpr char services[] = "services"; + constexpr char serviceInfo[] = "service_info"; + constexpr char serviceType[] = "service_type"; + constexpr char serviceProtocol[] = "service_protocol"; + + constexpr char name[] = "name"; + constexpr char price[] = "price"; + constexpr char speed[] = "speed"; + constexpr char timelimit[] = "timelimit"; + constexpr char region[] = "region"; + + constexpr char availableCountries[] = "available_countries"; + + constexpr char storeEndpoint[] = "store_endpoint"; + + constexpr char isAvailable[] = "is_available"; + } + + namespace serviceType + { + constexpr char amneziaFree[] = "amnezia-free"; + constexpr char amneziaPremium[] = "amnezia-premium"; + } +} + +ApiServicesModel::ApiServicesModel(QObject *parent) : QAbstractListModel(parent) +{ +} + +int ApiServicesModel::rowCount(const QModelIndex &parent) const +{ + Q_UNUSED(parent) + return m_services.size(); +} + +QVariant ApiServicesModel::data(const QModelIndex &index, int role) const +{ + if (!index.isValid() || index.row() < 0 || index.row() >= static_cast(rowCount())) + return QVariant(); + + QJsonObject service = m_services.at(index.row()).toObject(); + QJsonObject serviceInfo = service.value(configKey::serviceInfo).toObject(); + auto serviceType = service.value(configKey::serviceType).toString(); + + switch (role) { + case NameRole: { + return serviceInfo.value(configKey::name).toString(); + } + case CardDescriptionRole: { + auto speed = serviceInfo.value(configKey::speed).toString(); + if (serviceType == serviceType::amneziaPremium) { + return tr("Classic VPN for comfortable work, downloading large files and watching videos. " + "Works for any sites. Speed up to %1 MBit/s") + .arg(speed); + } else if (serviceType == serviceType::amneziaFree){ + QString description = tr("VPN to access blocked sites in regions with high levels of Internet censorship. "); + if (service.value(configKey::isAvailable).isBool() && !service.value(configKey::isAvailable).toBool()) { + description += tr("

Not available in your region. If you have VPN enabled, disable it, return to the previous screen, and try again."); + } + return description; + } + } + case ServiceDescriptionRole: { + if (serviceType == serviceType::amneziaPremium) { + return tr("Amnezia Premium - A classic VPN for comfortable work, downloading large files, and watching videos in high resolution. " + "It works for all websites, even in countries with the highest level of internet censorship."); + } else { + return tr("Amnezia Free is a free VPN to bypass blocking in countries with high levels of internet censorship"); + } + } + case IsServiceAvailableRole: { + if (serviceType == serviceType::amneziaFree) { + if (service.value(configKey::isAvailable).isBool() && !service.value(configKey::isAvailable).toBool()) { + return false; + } + } + return true; + } + case SpeedRole: { + auto speed = serviceInfo.value(configKey::speed).toString(); + return tr("%1 MBit/s").arg(speed); + } + case WorkPeriodRole: { + auto timelimit = serviceInfo.value(configKey::timelimit).toString(); + if (timelimit == "0") { + return ""; + } + return tr("%1 days").arg(timelimit); + } + case RegionRole: { + return serviceInfo.value(configKey::region).toString(); + } + case FeaturesRole: { + if (serviceType == serviceType::amneziaPremium) { + return tr(""); + } else { + return tr("VPN will open only popular sites blocked in your region, such as Instagram, Facebook, Twitter and others. " + "Other sites will be opened from your real IP address, " + "more details on the website."); + } + } + case PriceRole: { + auto price = serviceInfo.value(configKey::price).toString(); + if (price == "free") { + return tr("Free"); + } + return tr("%1 $/month").arg(price); + } + } + + return QVariant(); +} + +void ApiServicesModel::updateModel(const QJsonObject &data) +{ + beginResetModel(); + + m_countryCode = data.value(configKey::userCountryCode).toString(); + m_services = data.value(configKey::services).toArray(); + if (m_services.isEmpty()) { + QJsonObject service; + service.insert(configKey::serviceInfo, data.value(configKey::serviceInfo)); + service.insert(configKey::serviceType, data.value(configKey::serviceType)); + + m_services.push_back(service); + m_selectedServiceIndex = 0; + } + + endResetModel(); +} + +void ApiServicesModel::setServiceIndex(const int index) +{ + m_selectedServiceIndex = index; +} + +QJsonObject ApiServicesModel::getSelectedServiceInfo() +{ + QJsonObject service = m_services.at(m_selectedServiceIndex).toObject(); + return service.value(configKey::serviceInfo).toObject(); +} + +QString ApiServicesModel::getSelectedServiceType() +{ + QJsonObject service = m_services.at(m_selectedServiceIndex).toObject(); + return service.value(configKey::serviceType).toString(); +} + +QString ApiServicesModel::getSelectedServiceProtocol() +{ + QJsonObject service = m_services.at(m_selectedServiceIndex).toObject(); + return service.value(configKey::serviceProtocol).toString(); +} + +QString ApiServicesModel::getSelectedServiceName() +{ + auto modelIndex = index(m_selectedServiceIndex, 0); + return data(modelIndex, ApiServicesModel::Roles::NameRole).toString(); +} + +QJsonArray ApiServicesModel::getSelectedServiceCountries() +{ + QJsonObject service = m_services.at(m_selectedServiceIndex).toObject(); + return service.value(configKey::availableCountries).toArray(); +} + +QString ApiServicesModel::getCountryCode() +{ + return m_countryCode; +} + +QString ApiServicesModel::getStoreEndpoint() +{ + QJsonObject service = m_services.at(m_selectedServiceIndex).toObject(); + return service.value(configKey::storeEndpoint).toString(); +} + +QVariant ApiServicesModel::getSelectedServiceData(const QString roleString) +{ + QModelIndex modelIndex = index(m_selectedServiceIndex); + auto roles = roleNames(); + for (auto it = roles.begin(); it != roles.end(); it++) { + if (QString(it.value()) == roleString) { + return data(modelIndex, it.key()); + } + } + + return {}; +} + +QHash ApiServicesModel::roleNames() const +{ + QHash roles; + roles[NameRole] = "name"; + roles[CardDescriptionRole] = "cardDescription"; + roles[ServiceDescriptionRole] = "serviceDescription"; + roles[IsServiceAvailableRole] = "isServiceAvailable"; + roles[SpeedRole] = "speed"; + roles[WorkPeriodRole] = "workPeriod"; + roles[RegionRole] = "region"; + roles[FeaturesRole] = "features"; + roles[PriceRole] = "price"; + + return roles; +} diff --git a/client/ui/models/apiServicesModel.h b/client/ui/models/apiServicesModel.h new file mode 100644 index 00000000..49918940 --- /dev/null +++ b/client/ui/models/apiServicesModel.h @@ -0,0 +1,57 @@ +#ifndef APISERVICESMODEL_H +#define APISERVICESMODEL_H + +#include +#include + +class ApiServicesModel : public QAbstractListModel +{ + Q_OBJECT + +public: + enum Roles { + NameRole = Qt::UserRole + 1, + CardDescriptionRole, + ServiceDescriptionRole, + IsServiceAvailableRole, + SpeedRole, + WorkPeriodRole, + RegionRole, + FeaturesRole, + PriceRole + }; + + explicit ApiServicesModel(QObject *parent = nullptr); + + int rowCount(const QModelIndex &parent = QModelIndex()) const override; + + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; + +public slots: + void updateModel(const QJsonObject &data); + + void setServiceIndex(const int index); + + QJsonObject getSelectedServiceInfo(); + QString getSelectedServiceType(); + QString getSelectedServiceProtocol(); + QString getSelectedServiceName(); + QJsonArray getSelectedServiceCountries(); + + QString getCountryCode(); + + QString getStoreEndpoint(); + + QVariant getSelectedServiceData(const QString roleString); + +protected: + QHash roleNames() const override; + +private: + QString m_countryCode; + QJsonArray m_services; + + int m_selectedServiceIndex; +}; + +#endif // APISERVICESMODEL_H diff --git a/client/ui/models/clientManagementModel.cpp b/client/ui/models/clientManagementModel.cpp index 9a1e9667..5d8a6056 100644 --- a/client/ui/models/clientManagementModel.cpp +++ b/client/ui/models/clientManagementModel.cpp @@ -20,6 +20,7 @@ namespace constexpr char latestHandshake[] = "latestHandshake"; constexpr char dataReceived[] = "dataReceived"; constexpr char dataSent[] = "dataSent"; + constexpr char allowedIps[] = "allowedIps"; } } @@ -49,6 +50,7 @@ QVariant ClientManagementModel::data(const QModelIndex &index, int role) const case LatestHandshakeRole: return userData.value(configKey::latestHandshake).toString(); case DataReceivedRole: return userData.value(configKey::dataReceived).toString(); case DataSentRole: return userData.value(configKey::dataSent).toString(); + case AllowedIpsRole: return userData.value(configKey::allowedIps).toString(); } return QVariant(); @@ -75,6 +77,7 @@ ErrorCode ClientManagementModel::updateModel(const DockerContainer container, co { beginResetModel(); m_clientsTable = QJsonArray(); + endResetModel(); ErrorCode error = ErrorCode::NoError; @@ -88,10 +91,10 @@ ErrorCode ClientManagementModel::updateModel(const DockerContainer container, co const QByteArray clientsTableString = serverController->getTextFileFromContainer(container, credentials, clientsTableFile, error); if (error != ErrorCode::NoError) { logger.error() << "Failed to get the clientsTable file from the server"; - endResetModel(); return error; } + beginResetModel(); m_clientsTable = QJsonDocument::fromJson(clientsTableString).array(); if (m_clientsTable.isEmpty()) { @@ -143,6 +146,10 @@ ErrorCode ClientManagementModel::updateModel(const DockerContainer container, co userData[configKey::dataSent] = client.dataSent; } + if (!client.allowedIps.isEmpty()) { + userData[configKey::allowedIps] = client.allowedIps; + } + obj[configKey::userData] = userData; m_clientsTable.replace(i, obj); break; @@ -310,8 +317,9 @@ ErrorCode ClientManagementModel::wgShow(const DockerContainer container, const S const auto peerList = parts.filter("peer:"); const auto latestHandshakeList = parts.filter("latest handshake:"); const auto transferredDataList = parts.filter("transfer:"); + const auto allowedIpsList = parts.filter("allowed ips:"); - if (latestHandshakeList.isEmpty() || transferredDataList.isEmpty() || peerList.isEmpty()) { + if (allowedIpsList.isEmpty() || latestHandshakeList.isEmpty() || transferredDataList.isEmpty() || peerList.isEmpty()) { return error; } @@ -325,19 +333,20 @@ ErrorCode ClientManagementModel::wgShow(const DockerContainer container, const S } }; - for (int i = 0; i < peerList.size() && i < transferredDataList.size() && i < latestHandshakeList.size(); ++i) { + for (int i = 0; i < peerList.size() && i < transferredDataList.size() && i < latestHandshakeList.size() && i < allowedIpsList.size(); ++i) { const auto transferredData = getStrValue(transferredDataList[i]).split(","); auto latestHandshake = getStrValue(latestHandshakeList[i]); auto serverBytesReceived = transferredData.front().trimmed(); auto serverBytesSent = transferredData.back().trimmed(); + auto allowedIps = getStrValue(allowedIpsList[i]); changeHandshakeFormat(latestHandshake); serverBytesReceived.chop(QStringLiteral(" received").length()); serverBytesSent.chop(QStringLiteral(" sent").length()); - data.push_back({ getStrValue(peerList[i]), latestHandshake, serverBytesSent, serverBytesReceived }); + data.push_back({ getStrValue(peerList[i]), latestHandshake, serverBytesSent, serverBytesReceived, allowedIps }); } return error; @@ -777,5 +786,6 @@ QHash ClientManagementModel::roleNames() const roles[LatestHandshakeRole] = "latestHandshake"; roles[DataReceivedRole] = "dataReceived"; roles[DataSentRole] = "dataSent"; + roles[AllowedIpsRole] = "allowedIps"; return roles; } \ No newline at end of file diff --git a/client/ui/models/clientManagementModel.h b/client/ui/models/clientManagementModel.h index 2df641b4..9ac8b10b 100644 --- a/client/ui/models/clientManagementModel.h +++ b/client/ui/models/clientManagementModel.h @@ -17,7 +17,8 @@ public: CreationDateRole, LatestHandshakeRole, DataReceivedRole, - DataSentRole + DataSentRole, + AllowedIpsRole }; struct WgShowData @@ -26,6 +27,7 @@ public: QString latestHandshake; QString dataReceived; QString dataSent; + QString allowedIps; }; ClientManagementModel(std::shared_ptr settings, QObject *parent = nullptr); diff --git a/client/ui/models/containers_model.cpp b/client/ui/models/containers_model.cpp index 734f1e2d..41d26bc7 100644 --- a/client/ui/models/containers_model.cpp +++ b/client/ui/models/containers_model.cpp @@ -94,6 +94,26 @@ bool ContainersModel::isServiceContainer(const int containerIndex) return qvariant_cast(data(index(containerIndex), ServiceTypeRole) == ServiceType::Other); } +bool ContainersModel::hasInstalledServices() +{ + for (const auto &container : m_containers.keys()) { + if (ContainerProps::containerService(container) == ServiceType::Other) { + return true; + } + } + return false; +} + +bool ContainersModel::hasInstalledProtocols() +{ + for (const auto &container : m_containers.keys()) { + if (ContainerProps::containerService(container) == ServiceType::Vpn) { + return true; + } + } + return false; +} + QHash ContainersModel::roleNames() const { QHash roles; diff --git a/client/ui/models/containers_model.h b/client/ui/models/containers_model.h index 2a8117ea..3bd0ddc1 100644 --- a/client/ui/models/containers_model.h +++ b/client/ui/models/containers_model.h @@ -54,6 +54,9 @@ public slots: bool isSupportedByCurrentPlatform(const int containerIndex); bool isServiceContainer(const int containerIndex); + bool hasInstalledServices(); + bool hasInstalledProtocols(); + protected: QHash roleNames() const override; diff --git a/client/ui/models/languageModel.cpp b/client/ui/models/languageModel.cpp index f90b47b7..fe6f7a6c 100644 --- a/client/ui/models/languageModel.cpp +++ b/client/ui/models/languageModel.cpp @@ -103,3 +103,12 @@ QString LanguageModel::getCurrentLanguageName() { return m_availableLanguages[getCurrentLanguageIndex()].name; } + +QString LanguageModel::getCurrentSiteUrl() +{ + auto language = static_cast(getCurrentLanguageIndex()); + switch (language) { + case LanguageSettings::AvailableLanguageEnum::Russian: return "https://storage.googleapis.com/kldscp/amnezia.org"; + default: return "https://amnezia.org"; + } +} diff --git a/client/ui/models/languageModel.h b/client/ui/models/languageModel.h index ea29dda5..2c80880a 100644 --- a/client/ui/models/languageModel.h +++ b/client/ui/models/languageModel.h @@ -59,6 +59,7 @@ public slots: int getCurrentLanguageIndex(); int getLineHeightAppend(); QString getCurrentLanguageName(); + QString getCurrentSiteUrl(); signals: void updateTranslations(const QLocale &locale); diff --git a/client/ui/models/protocols/awgConfigModel.cpp b/client/ui/models/protocols/awgConfigModel.cpp index 6b9234f4..3a245ebe 100644 --- a/client/ui/models/protocols/awgConfigModel.cpp +++ b/client/ui/models/protocols/awgConfigModel.cpp @@ -21,28 +21,29 @@ bool AwgConfigModel::setData(const QModelIndex &index, const QVariant &value, in } switch (role) { - case Roles::PortRole: m_protocolConfig.insert(config_key::port, value.toString()); break; - case Roles::MtuRole: m_protocolConfig.insert(config_key::mtu, value.toString()); break; - case Roles::JunkPacketCountRole: m_protocolConfig.insert(config_key::junkPacketCount, value.toString()); break; - case Roles::JunkPacketMinSizeRole: m_protocolConfig.insert(config_key::junkPacketMinSize, value.toString()); break; - case Roles::JunkPacketMaxSizeRole: m_protocolConfig.insert(config_key::junkPacketMaxSize, value.toString()); break; - case Roles::InitPacketJunkSizeRole: - m_protocolConfig.insert(config_key::initPacketJunkSize, value.toString()); + case Roles::PortRole: m_serverProtocolConfig.insert(config_key::port, value.toString()); break; + + case Roles::ClientMtuRole: m_clientProtocolConfig.insert(config_key::mtu, value.toString()); break; + case Roles::ClientJunkPacketCountRole: m_clientProtocolConfig.insert(config_key::junkPacketCount, value.toString()); break; + case Roles::ClientJunkPacketMinSizeRole: m_clientProtocolConfig.insert(config_key::junkPacketMinSize, value.toString()); break; + case Roles::ClientJunkPacketMaxSizeRole: m_clientProtocolConfig.insert(config_key::junkPacketMaxSize, value.toString()); break; + + case Roles::ServerJunkPacketCountRole: m_serverProtocolConfig.insert(config_key::junkPacketCount, value.toString()); break; + case Roles::ServerJunkPacketMinSizeRole: m_serverProtocolConfig.insert(config_key::junkPacketMinSize, value.toString()); break; + case Roles::ServerJunkPacketMaxSizeRole: m_serverProtocolConfig.insert(config_key::junkPacketMaxSize, value.toString()); break; + case Roles::ServerInitPacketJunkSizeRole: m_serverProtocolConfig.insert(config_key::initPacketJunkSize, value.toString()); break; + case Roles::ServerResponsePacketJunkSizeRole: + m_serverProtocolConfig.insert(config_key::responsePacketJunkSize, value.toString()); break; - case Roles::ResponsePacketJunkSizeRole: - m_protocolConfig.insert(config_key::responsePacketJunkSize, value.toString()); + case Roles::ServerInitPacketMagicHeaderRole: m_serverProtocolConfig.insert(config_key::initPacketMagicHeader, value.toString()); break; + case Roles::ServerResponsePacketMagicHeaderRole: + m_serverProtocolConfig.insert(config_key::responsePacketMagicHeader, value.toString()); break; - case Roles::InitPacketMagicHeaderRole: - m_protocolConfig.insert(config_key::initPacketMagicHeader, value.toString()); + case Roles::ServerUnderloadPacketMagicHeaderRole: + m_serverProtocolConfig.insert(config_key::underloadPacketMagicHeader, value.toString()); break; - case Roles::ResponsePacketMagicHeaderRole: - m_protocolConfig.insert(config_key::responsePacketMagicHeader, value.toString()); - break; - case Roles::UnderloadPacketMagicHeaderRole: - m_protocolConfig.insert(config_key::underloadPacketMagicHeader, value.toString()); - break; - case Roles::TransportPacketMagicHeaderRole: - m_protocolConfig.insert(config_key::transportPacketMagicHeader, value.toString()); + case Roles::ServerTransportPacketMagicHeaderRole: + m_serverProtocolConfig.insert(config_key::transportPacketMagicHeader, value.toString()); break; } @@ -57,17 +58,22 @@ QVariant AwgConfigModel::data(const QModelIndex &index, int role) const } switch (role) { - case Roles::PortRole: return m_protocolConfig.value(config_key::port).toString(); - case Roles::MtuRole: return m_protocolConfig.value(config_key::mtu).toString(); - case Roles::JunkPacketCountRole: return m_protocolConfig.value(config_key::junkPacketCount); - case Roles::JunkPacketMinSizeRole: return m_protocolConfig.value(config_key::junkPacketMinSize); - case Roles::JunkPacketMaxSizeRole: return m_protocolConfig.value(config_key::junkPacketMaxSize); - case Roles::InitPacketJunkSizeRole: return m_protocolConfig.value(config_key::initPacketJunkSize); - case Roles::ResponsePacketJunkSizeRole: return m_protocolConfig.value(config_key::responsePacketJunkSize); - case Roles::InitPacketMagicHeaderRole: return m_protocolConfig.value(config_key::initPacketMagicHeader); - case Roles::ResponsePacketMagicHeaderRole: return m_protocolConfig.value(config_key::responsePacketMagicHeader); - case Roles::UnderloadPacketMagicHeaderRole: return m_protocolConfig.value(config_key::underloadPacketMagicHeader); - case Roles::TransportPacketMagicHeaderRole: return m_protocolConfig.value(config_key::transportPacketMagicHeader); + case Roles::PortRole: return m_serverProtocolConfig.value(config_key::port).toString(); + + case Roles::ClientMtuRole: return m_clientProtocolConfig.value(config_key::mtu); + case Roles::ClientJunkPacketCountRole: return m_clientProtocolConfig.value(config_key::junkPacketCount); + case Roles::ClientJunkPacketMinSizeRole: return m_clientProtocolConfig.value(config_key::junkPacketMinSize); + case Roles::ClientJunkPacketMaxSizeRole: return m_clientProtocolConfig.value(config_key::junkPacketMaxSize); + + case Roles::ServerJunkPacketCountRole: return m_serverProtocolConfig.value(config_key::junkPacketCount); + case Roles::ServerJunkPacketMinSizeRole: return m_serverProtocolConfig.value(config_key::junkPacketMinSize); + case Roles::ServerJunkPacketMaxSizeRole: return m_serverProtocolConfig.value(config_key::junkPacketMaxSize); + case Roles::ServerInitPacketJunkSizeRole: return m_serverProtocolConfig.value(config_key::initPacketJunkSize); + case Roles::ServerResponsePacketJunkSizeRole: return m_serverProtocolConfig.value(config_key::responsePacketJunkSize); + case Roles::ServerInitPacketMagicHeaderRole: return m_serverProtocolConfig.value(config_key::initPacketMagicHeader); + case Roles::ServerResponsePacketMagicHeaderRole: return m_serverProtocolConfig.value(config_key::responsePacketMagicHeader); + case Roles::ServerUnderloadPacketMagicHeaderRole: return m_serverProtocolConfig.value(config_key::underloadPacketMagicHeader); + case Roles::ServerTransportPacketMagicHeaderRole: return m_serverProtocolConfig.value(config_key::transportPacketMagicHeader); } return QVariant(); @@ -80,52 +86,63 @@ void AwgConfigModel::updateModel(const QJsonObject &config) m_fullConfig = config; - QJsonObject protocolConfig = config.value(config_key::awg).toObject(); + QJsonObject serverProtocolConfig = config.value(config_key::awg).toObject(); - m_protocolConfig[config_key::last_config] = protocolConfig.value(config_key::last_config); - m_protocolConfig[config_key::port] = protocolConfig.value(config_key::port).toString(protocols::awg::defaultPort); - m_protocolConfig[config_key::mtu] = protocolConfig.value(config_key::mtu).toString(protocols::awg::defaultMtu); - m_protocolConfig[config_key::junkPacketCount] = - protocolConfig.value(config_key::junkPacketCount).toString(protocols::awg::defaultJunkPacketCount); - m_protocolConfig[config_key::junkPacketMinSize] = - protocolConfig.value(config_key::junkPacketMinSize).toString(protocols::awg::defaultJunkPacketMinSize); - m_protocolConfig[config_key::junkPacketMaxSize] = - protocolConfig.value(config_key::junkPacketMaxSize).toString(protocols::awg::defaultJunkPacketMaxSize); - m_protocolConfig[config_key::initPacketJunkSize] = - protocolConfig.value(config_key::initPacketJunkSize).toString(protocols::awg::defaultInitPacketJunkSize); - m_protocolConfig[config_key::responsePacketJunkSize] = - protocolConfig.value(config_key::responsePacketJunkSize).toString(protocols::awg::defaultResponsePacketJunkSize); - m_protocolConfig[config_key::initPacketMagicHeader] = - protocolConfig.value(config_key::initPacketMagicHeader).toString(protocols::awg::defaultInitPacketMagicHeader); - m_protocolConfig[config_key::responsePacketMagicHeader] = - protocolConfig.value(config_key::responsePacketMagicHeader) - .toString(protocols::awg::defaultResponsePacketMagicHeader); - m_protocolConfig[config_key::underloadPacketMagicHeader] = - protocolConfig.value(config_key::underloadPacketMagicHeader) - .toString(protocols::awg::defaultUnderloadPacketMagicHeader); - m_protocolConfig[config_key::transportPacketMagicHeader] = - protocolConfig.value(config_key::transportPacketMagicHeader) - .toString(protocols::awg::defaultTransportPacketMagicHeader); + auto defaultTransportProto = ProtocolProps::transportProtoToString(ProtocolProps::defaultTransportProto(Proto::Awg), Proto::Awg); + m_serverProtocolConfig.insert(config_key::transport_proto, + serverProtocolConfig.value(config_key::transport_proto).toString(defaultTransportProto)); + m_serverProtocolConfig[config_key::last_config] = serverProtocolConfig.value(config_key::last_config); + m_serverProtocolConfig[config_key::port] = serverProtocolConfig.value(config_key::port).toString(protocols::awg::defaultPort); + m_serverProtocolConfig[config_key::junkPacketCount] = + serverProtocolConfig.value(config_key::junkPacketCount).toString(protocols::awg::defaultJunkPacketCount); + m_serverProtocolConfig[config_key::junkPacketMinSize] = + serverProtocolConfig.value(config_key::junkPacketMinSize).toString(protocols::awg::defaultJunkPacketMinSize); + m_serverProtocolConfig[config_key::junkPacketMaxSize] = + serverProtocolConfig.value(config_key::junkPacketMaxSize).toString(protocols::awg::defaultJunkPacketMaxSize); + m_serverProtocolConfig[config_key::initPacketJunkSize] = + serverProtocolConfig.value(config_key::initPacketJunkSize).toString(protocols::awg::defaultInitPacketJunkSize); + m_serverProtocolConfig[config_key::responsePacketJunkSize] = + serverProtocolConfig.value(config_key::responsePacketJunkSize).toString(protocols::awg::defaultResponsePacketJunkSize); + m_serverProtocolConfig[config_key::initPacketMagicHeader] = + serverProtocolConfig.value(config_key::initPacketMagicHeader).toString(protocols::awg::defaultInitPacketMagicHeader); + m_serverProtocolConfig[config_key::responsePacketMagicHeader] = + serverProtocolConfig.value(config_key::responsePacketMagicHeader).toString(protocols::awg::defaultResponsePacketMagicHeader); + m_serverProtocolConfig[config_key::underloadPacketMagicHeader] = + serverProtocolConfig.value(config_key::underloadPacketMagicHeader).toString(protocols::awg::defaultUnderloadPacketMagicHeader); + m_serverProtocolConfig[config_key::transportPacketMagicHeader] = + serverProtocolConfig.value(config_key::transportPacketMagicHeader).toString(protocols::awg::defaultTransportPacketMagicHeader); + auto lastConfig = m_serverProtocolConfig.value(config_key::last_config).toString(); + QJsonObject clientProtocolConfig = QJsonDocument::fromJson(lastConfig.toUtf8()).object(); + m_clientProtocolConfig[config_key::mtu] = clientProtocolConfig[config_key::mtu].toString(protocols::awg::defaultMtu); + m_clientProtocolConfig[config_key::junkPacketCount] = + clientProtocolConfig.value(config_key::junkPacketCount).toString(m_serverProtocolConfig[config_key::junkPacketCount].toString()); + m_clientProtocolConfig[config_key::junkPacketMinSize] = + clientProtocolConfig.value(config_key::junkPacketMinSize).toString(m_serverProtocolConfig[config_key::junkPacketMinSize].toString()); + m_clientProtocolConfig[config_key::junkPacketMaxSize] = + clientProtocolConfig.value(config_key::junkPacketMaxSize).toString(m_serverProtocolConfig[config_key::junkPacketMaxSize].toString()); endResetModel(); } QJsonObject AwgConfigModel::getConfig() { const AwgConfig oldConfig(m_fullConfig.value(config_key::awg).toObject()); - const AwgConfig newConfig(m_protocolConfig); + const AwgConfig newConfig(m_serverProtocolConfig); if (!oldConfig.hasEqualServerSettings(newConfig)) { - m_protocolConfig.remove(config_key::last_config); + m_serverProtocolConfig.remove(config_key::last_config); } else { - auto lastConfig = m_protocolConfig.value(config_key::last_config).toString(); + auto lastConfig = m_serverProtocolConfig.value(config_key::last_config).toString(); QJsonObject jsonConfig = QJsonDocument::fromJson(lastConfig.toUtf8()).object(); - jsonConfig[config_key::mtu] = newConfig.mtu; + jsonConfig[config_key::mtu] = m_clientProtocolConfig[config_key::mtu]; + jsonConfig[config_key::junkPacketCount] = m_clientProtocolConfig[config_key::junkPacketCount]; + jsonConfig[config_key::junkPacketMinSize] = m_clientProtocolConfig[config_key::junkPacketMinSize]; + jsonConfig[config_key::junkPacketMaxSize] = m_clientProtocolConfig[config_key::junkPacketMaxSize]; - m_protocolConfig[config_key::last_config] = QString(QJsonDocument(jsonConfig).toJson()); + m_serverProtocolConfig[config_key::last_config] = QString(QJsonDocument(jsonConfig).toJson()); } - m_fullConfig.insert(config_key::awg, m_protocolConfig); + m_fullConfig.insert(config_key::awg, m_serverProtocolConfig); return m_fullConfig; } @@ -139,56 +156,73 @@ bool AwgConfigModel::isPacketSizeEqual(const int s1, const int s2) return (AwgConstant::messageInitiationSize + s1 == AwgConstant::messageResponseSize + s2); } +bool AwgConfigModel::isServerSettingsEqual() +{ + const AwgConfig oldConfig(m_fullConfig.value(config_key::awg).toObject()); + const AwgConfig newConfig(m_serverProtocolConfig); + + return oldConfig.hasEqualServerSettings(newConfig); +} + QHash AwgConfigModel::roleNames() const { QHash roles; roles[PortRole] = "port"; - roles[MtuRole] = "mtu"; - roles[JunkPacketCountRole] = "junkPacketCount"; - roles[JunkPacketMinSizeRole] = "junkPacketMinSize"; - roles[JunkPacketMaxSizeRole] = "junkPacketMaxSize"; - roles[InitPacketJunkSizeRole] = "initPacketJunkSize"; - roles[ResponsePacketJunkSizeRole] = "responsePacketJunkSize"; - roles[InitPacketMagicHeaderRole] = "initPacketMagicHeader"; - roles[ResponsePacketMagicHeaderRole] = "responsePacketMagicHeader"; - roles[UnderloadPacketMagicHeaderRole] = "underloadPacketMagicHeader"; - roles[TransportPacketMagicHeaderRole] = "transportPacketMagicHeader"; + + roles[ClientMtuRole] = "clientMtu"; + roles[ClientJunkPacketCountRole] = "clientJunkPacketCount"; + roles[ClientJunkPacketMinSizeRole] = "clientJunkPacketMinSize"; + roles[ClientJunkPacketMaxSizeRole] = "clientJunkPacketMaxSize"; + + roles[ServerJunkPacketCountRole] = "serverJunkPacketCount"; + roles[ServerJunkPacketMinSizeRole] = "serverJunkPacketMinSize"; + roles[ServerJunkPacketMaxSizeRole] = "serverJunkPacketMaxSize"; + roles[ServerInitPacketJunkSizeRole] = "serverInitPacketJunkSize"; + roles[ServerResponsePacketJunkSizeRole] = "serverResponsePacketJunkSize"; + roles[ServerInitPacketMagicHeaderRole] = "serverInitPacketMagicHeader"; + roles[ServerResponsePacketMagicHeaderRole] = "serverResponsePacketMagicHeader"; + roles[ServerUnderloadPacketMagicHeaderRole] = "serverUnderloadPacketMagicHeader"; + roles[ServerTransportPacketMagicHeaderRole] = "serverTransportPacketMagicHeader"; return roles; } -AwgConfig::AwgConfig(const QJsonObject &jsonConfig) +AwgConfig::AwgConfig(const QJsonObject &serverProtocolConfig) { - port = jsonConfig.value(config_key::port).toString(protocols::awg::defaultPort); - mtu = jsonConfig.value(config_key::mtu).toString(protocols::awg::defaultMtu); - junkPacketCount = jsonConfig.value(config_key::junkPacketCount).toString(protocols::awg::defaultJunkPacketCount); - junkPacketMinSize = - jsonConfig.value(config_key::junkPacketMinSize).toString(protocols::awg::defaultJunkPacketMinSize); - junkPacketMaxSize = - jsonConfig.value(config_key::junkPacketMaxSize).toString(protocols::awg::defaultJunkPacketMaxSize); - initPacketJunkSize = - jsonConfig.value(config_key::initPacketJunkSize).toString(protocols::awg::defaultInitPacketJunkSize); - responsePacketJunkSize = - jsonConfig.value(config_key::responsePacketJunkSize).toString(protocols::awg::defaultResponsePacketJunkSize); - initPacketMagicHeader = - jsonConfig.value(config_key::initPacketMagicHeader).toString(protocols::awg::defaultInitPacketMagicHeader); - responsePacketMagicHeader = jsonConfig.value(config_key::responsePacketMagicHeader) - .toString(protocols::awg::defaultResponsePacketMagicHeader); - underloadPacketMagicHeader = jsonConfig.value(config_key::underloadPacketMagicHeader) - .toString(protocols::awg::defaultUnderloadPacketMagicHeader); - transportPacketMagicHeader = jsonConfig.value(config_key::transportPacketMagicHeader) - .toString(protocols::awg::defaultTransportPacketMagicHeader); + auto lastConfig = serverProtocolConfig.value(config_key::last_config).toString(); + QJsonObject clientProtocolConfig = QJsonDocument::fromJson(lastConfig.toUtf8()).object(); + clientMtu = clientProtocolConfig[config_key::mtu].toString(protocols::awg::defaultMtu); + clientJunkPacketCount = clientProtocolConfig.value(config_key::junkPacketCount).toString(protocols::awg::defaultJunkPacketCount); + clientJunkPacketMinSize = clientProtocolConfig.value(config_key::junkPacketMinSize).toString(protocols::awg::defaultJunkPacketMinSize); + clientJunkPacketMaxSize = clientProtocolConfig.value(config_key::junkPacketMaxSize).toString(protocols::awg::defaultJunkPacketMaxSize); + + port = serverProtocolConfig.value(config_key::port).toString(protocols::awg::defaultPort); + serverJunkPacketCount = serverProtocolConfig.value(config_key::junkPacketCount).toString(protocols::awg::defaultJunkPacketCount); + serverJunkPacketMinSize = serverProtocolConfig.value(config_key::junkPacketMinSize).toString(protocols::awg::defaultJunkPacketMinSize); + serverJunkPacketMaxSize = serverProtocolConfig.value(config_key::junkPacketMaxSize).toString(protocols::awg::defaultJunkPacketMaxSize); + serverInitPacketJunkSize = serverProtocolConfig.value(config_key::initPacketJunkSize).toString(protocols::awg::defaultInitPacketJunkSize); + serverResponsePacketJunkSize = + serverProtocolConfig.value(config_key::responsePacketJunkSize).toString(protocols::awg::defaultResponsePacketJunkSize); + serverInitPacketMagicHeader = + serverProtocolConfig.value(config_key::initPacketMagicHeader).toString(protocols::awg::defaultInitPacketMagicHeader); + serverResponsePacketMagicHeader = + serverProtocolConfig.value(config_key::responsePacketMagicHeader).toString(protocols::awg::defaultResponsePacketMagicHeader); + serverUnderloadPacketMagicHeader = + serverProtocolConfig.value(config_key::underloadPacketMagicHeader).toString(protocols::awg::defaultUnderloadPacketMagicHeader); + serverTransportPacketMagicHeader = + serverProtocolConfig.value(config_key::transportPacketMagicHeader).toString(protocols::awg::defaultTransportPacketMagicHeader); } bool AwgConfig::hasEqualServerSettings(const AwgConfig &other) const { - if (port != other.port || junkPacketCount != other.junkPacketCount || junkPacketMinSize != other.junkPacketMinSize - || junkPacketMaxSize != other.junkPacketMaxSize || initPacketJunkSize != other.initPacketJunkSize - || responsePacketJunkSize != other.responsePacketJunkSize || initPacketMagicHeader != other.initPacketMagicHeader - || responsePacketMagicHeader != other.responsePacketMagicHeader - || underloadPacketMagicHeader != other.underloadPacketMagicHeader - || transportPacketMagicHeader != other.transportPacketMagicHeader) { + if (port != other.port || serverJunkPacketCount != other.serverJunkPacketCount + || serverJunkPacketMinSize != other.serverJunkPacketMinSize || serverJunkPacketMaxSize != other.serverJunkPacketMaxSize + || serverInitPacketJunkSize != other.serverInitPacketJunkSize || serverResponsePacketJunkSize != other.serverResponsePacketJunkSize + || serverInitPacketMagicHeader != other.serverInitPacketMagicHeader + || serverResponsePacketMagicHeader != other.serverResponsePacketMagicHeader + || serverUnderloadPacketMagicHeader != other.serverUnderloadPacketMagicHeader + || serverTransportPacketMagicHeader != other.serverTransportPacketMagicHeader) { return false; } return true; @@ -196,7 +230,8 @@ bool AwgConfig::hasEqualServerSettings(const AwgConfig &other) const bool AwgConfig::hasEqualClientSettings(const AwgConfig &other) const { - if (mtu != other.mtu) { + if (clientMtu != other.clientMtu || clientJunkPacketCount != other.clientJunkPacketCount + || clientJunkPacketMinSize != other.clientJunkPacketMinSize || clientJunkPacketMaxSize != other.clientJunkPacketMaxSize) { return false; } return true; diff --git a/client/ui/models/protocols/awgConfigModel.h b/client/ui/models/protocols/awgConfigModel.h index 80375d38..06475bf5 100644 --- a/client/ui/models/protocols/awgConfigModel.h +++ b/client/ui/models/protocols/awgConfigModel.h @@ -16,16 +16,21 @@ struct AwgConfig AwgConfig(const QJsonObject &jsonConfig); QString port; - QString mtu; - QString junkPacketCount; - QString junkPacketMinSize; - QString junkPacketMaxSize; - QString initPacketJunkSize; - QString responsePacketJunkSize; - QString initPacketMagicHeader; - QString responsePacketMagicHeader; - QString underloadPacketMagicHeader; - QString transportPacketMagicHeader; + + QString clientMtu; + QString clientJunkPacketCount; + QString clientJunkPacketMinSize; + QString clientJunkPacketMaxSize; + + QString serverJunkPacketCount; + QString serverJunkPacketMinSize; + QString serverJunkPacketMaxSize; + QString serverInitPacketJunkSize; + QString serverResponsePacketJunkSize; + QString serverInitPacketMagicHeader; + QString serverResponsePacketMagicHeader; + QString serverUnderloadPacketMagicHeader; + QString serverTransportPacketMagicHeader; bool hasEqualServerSettings(const AwgConfig &other) const; bool hasEqualClientSettings(const AwgConfig &other) const; @@ -39,16 +44,21 @@ class AwgConfigModel : public QAbstractListModel public: enum Roles { PortRole = Qt::UserRole + 1, - MtuRole, - JunkPacketCountRole, - JunkPacketMinSizeRole, - JunkPacketMaxSizeRole, - InitPacketJunkSizeRole, - ResponsePacketJunkSizeRole, - InitPacketMagicHeaderRole, - ResponsePacketMagicHeaderRole, - UnderloadPacketMagicHeaderRole, - TransportPacketMagicHeaderRole + + ClientMtuRole, + ClientJunkPacketCountRole, + ClientJunkPacketMinSizeRole, + ClientJunkPacketMaxSizeRole, + + ServerJunkPacketCountRole, + ServerJunkPacketMinSizeRole, + ServerJunkPacketMaxSizeRole, + ServerInitPacketJunkSizeRole, + ServerResponsePacketJunkSizeRole, + ServerInitPacketMagicHeaderRole, + ServerResponsePacketMagicHeaderRole, + ServerUnderloadPacketMagicHeaderRole, + ServerTransportPacketMagicHeaderRole }; explicit AwgConfigModel(QObject *parent = nullptr); @@ -65,12 +75,15 @@ public slots: bool isHeadersEqual(const QString &h1, const QString &h2, const QString &h3, const QString &h4); bool isPacketSizeEqual(const int s1, const int s2); + bool isServerSettingsEqual(); + protected: QHash roleNames() const override; private: DockerContainer m_container; - QJsonObject m_protocolConfig; + QJsonObject m_serverProtocolConfig; + QJsonObject m_clientProtocolConfig; QJsonObject m_fullConfig; }; diff --git a/client/ui/models/protocols/cloakConfigModel.cpp b/client/ui/models/protocols/cloakConfigModel.cpp index 203f08b5..a9f06f4d 100644 --- a/client/ui/models/protocols/cloakConfigModel.cpp +++ b/client/ui/models/protocols/cloakConfigModel.cpp @@ -51,14 +51,11 @@ void CloakConfigModel::updateModel(const QJsonObject &config) m_fullConfig = config; QJsonObject protocolConfig = config.value(config_key::cloak).toObject(); - m_protocolConfig.insert(config_key::cipher, - protocolConfig.value(config_key::cipher).toString(protocols::cloak::defaultCipher)); - - m_protocolConfig.insert(config_key::port, - protocolConfig.value(config_key::port).toString(protocols::cloak::defaultPort)); - - m_protocolConfig.insert(config_key::site, - protocolConfig.value(config_key::site).toString(protocols::cloak::defaultRedirSite)); + auto defaultTransportProto = ProtocolProps::transportProtoToString(ProtocolProps::defaultTransportProto(Proto::Cloak), Proto::Cloak); + m_protocolConfig.insert(config_key::transport_proto, protocolConfig.value(config_key::transport_proto).toString(defaultTransportProto)); + m_protocolConfig.insert(config_key::cipher, protocolConfig.value(config_key::cipher).toString(protocols::cloak::defaultCipher)); + m_protocolConfig.insert(config_key::port, protocolConfig.value(config_key::port).toString(protocols::cloak::defaultPort)); + m_protocolConfig.insert(config_key::site, protocolConfig.value(config_key::site).toString(protocols::cloak::defaultRedirSite)); endResetModel(); } diff --git a/client/ui/models/protocols/ikev2ConfigModel.cpp b/client/ui/models/protocols/ikev2ConfigModel.cpp index a11b6652..05494a07 100644 --- a/client/ui/models/protocols/ikev2ConfigModel.cpp +++ b/client/ui/models/protocols/ikev2ConfigModel.cpp @@ -35,8 +35,7 @@ QVariant Ikev2ConfigModel::data(const QModelIndex &index, int role) const switch (role) { case Roles::PortRole: return m_protocolConfig.value(config_key::port).toString(protocols::shadowsocks::defaultPort); - case Roles::CipherRole: - return m_protocolConfig.value(config_key::cipher).toString(protocols::shadowsocks::defaultCipher); + case Roles::CipherRole: return m_protocolConfig.value(config_key::cipher).toString(protocols::shadowsocks::defaultCipher); } return QVariant(); @@ -50,11 +49,8 @@ void Ikev2ConfigModel::updateModel(const QJsonObject &config) m_fullConfig = config; QJsonObject protocolConfig = config.value(config_key::shadowsocks).toObject(); - m_protocolConfig.insert(config_key::cipher, - protocolConfig.value(config_key::cipher).toString(protocols::shadowsocks::defaultCipher)); - - m_protocolConfig.insert(config_key::port, - protocolConfig.value(config_key::port).toString(protocols::shadowsocks::defaultPort)); + m_protocolConfig.insert(config_key::cipher, protocolConfig.value(config_key::cipher).toString(protocols::shadowsocks::defaultCipher)); + m_protocolConfig.insert(config_key::port, protocolConfig.value(config_key::port).toString(protocols::shadowsocks::defaultPort)); endResetModel(); } diff --git a/client/ui/models/protocols/openvpnConfigModel.cpp b/client/ui/models/protocols/openvpnConfigModel.cpp index 30d00306..a04c2b1a 100644 --- a/client/ui/models/protocols/openvpnConfigModel.cpp +++ b/client/ui/models/protocols/openvpnConfigModel.cpp @@ -19,9 +19,7 @@ bool OpenVpnConfigModel::setData(const QModelIndex &index, const QVariant &value } switch (role) { - case Roles::SubnetAddressRole: - m_protocolConfig.insert(amnezia::config_key::subnet_address, value.toString()); - break; + case Roles::SubnetAddressRole: m_protocolConfig.insert(amnezia::config_key::subnet_address, value.toString()); break; case Roles::TransportProtoRole: m_protocolConfig.insert(config_key::transport_proto, value.toString()); break; case Roles::PortRole: m_protocolConfig.insert(config_key::port, value.toString()); break; case Roles::AutoNegotiateEncryprionRole: m_protocolConfig.insert(config_key::ncp_disable, !value.toBool()); break; @@ -29,12 +27,8 @@ bool OpenVpnConfigModel::setData(const QModelIndex &index, const QVariant &value case Roles::CipherRole: m_protocolConfig.insert(config_key::cipher, value.toString()); break; case Roles::TlsAuthRole: m_protocolConfig.insert(config_key::tls_auth, value.toBool()); break; case Roles::BlockDnsRole: m_protocolConfig.insert(config_key::block_outside_dns, value.toBool()); break; - case Roles::AdditionalClientCommandsRole: - m_protocolConfig.insert(config_key::additional_client_config, value.toString()); - break; - case Roles::AdditionalServerCommandsRole: - m_protocolConfig.insert(config_key::additional_server_config, value.toString()); - break; + case Roles::AdditionalClientCommandsRole: m_protocolConfig.insert(config_key::additional_client_config, value.toString()); break; + case Roles::AdditionalServerCommandsRole: m_protocolConfig.insert(config_key::additional_server_config, value.toString()); break; } emit dataChanged(index, index, QList { role }); @@ -49,26 +43,21 @@ QVariant OpenVpnConfigModel::data(const QModelIndex &index, int role) const switch (role) { case Roles::SubnetAddressRole: - return m_protocolConfig.value(amnezia::config_key::subnet_address) - .toString(amnezia::protocols::openvpn::defaultSubnetAddress); + return m_protocolConfig.value(amnezia::config_key::subnet_address).toString(amnezia::protocols::openvpn::defaultSubnetAddress); case Roles::TransportProtoRole: return m_protocolConfig.value(config_key::transport_proto).toString(protocols::openvpn::defaultTransportProto); case Roles::PortRole: return m_protocolConfig.value(config_key::port).toString(protocols::openvpn::defaultPort); case Roles::AutoNegotiateEncryprionRole: return !m_protocolConfig.value(config_key::ncp_disable).toBool(protocols::openvpn::defaultNcpDisable); case Roles::HashRole: return m_protocolConfig.value(config_key::hash).toString(protocols::openvpn::defaultHash); - case Roles::CipherRole: - return m_protocolConfig.value(config_key::cipher).toString(protocols::openvpn::defaultCipher); - case Roles::TlsAuthRole: - return m_protocolConfig.value(config_key::tls_auth).toBool(protocols::openvpn::defaultTlsAuth); + case Roles::CipherRole: return m_protocolConfig.value(config_key::cipher).toString(protocols::openvpn::defaultCipher); + case Roles::TlsAuthRole: return m_protocolConfig.value(config_key::tls_auth).toBool(protocols::openvpn::defaultTlsAuth); case Roles::BlockDnsRole: return m_protocolConfig.value(config_key::block_outside_dns).toBool(protocols::openvpn::defaultBlockOutsideDns); case Roles::AdditionalClientCommandsRole: - return m_protocolConfig.value(config_key::additional_client_config) - .toString(protocols::openvpn::defaultAdditionalClientConfig); + return m_protocolConfig.value(config_key::additional_client_config).toString(protocols::openvpn::defaultAdditionalClientConfig); case Roles::AdditionalServerCommandsRole: - return m_protocolConfig.value(config_key::additional_server_config) - .toString(protocols::openvpn::defaultAdditionalServerConfig); + return m_protocolConfig.value(config_key::additional_server_config).toString(protocols::openvpn::defaultAdditionalServerConfig); case Roles::IsPortEditable: return m_container == DockerContainer::OpenVpn ? true : false; case Roles::IsTransportProtoEditable: return m_container == DockerContainer::OpenVpn ? true : false; case Roles::HasRemoveButton: return m_container == DockerContainer::OpenVpn ? true : false; @@ -84,14 +73,13 @@ void OpenVpnConfigModel::updateModel(const QJsonObject &config) m_fullConfig = config; QJsonObject protocolConfig = config.value(config_key::openvpn).toObject(); - m_protocolConfig.insert(config_key::subnet_address, - protocolConfig.value(amnezia::config_key::subnet_address) - .toString(amnezia::protocols::openvpn::defaultSubnetAddress)); + m_protocolConfig.insert( + config_key::subnet_address, + protocolConfig.value(amnezia::config_key::subnet_address).toString(amnezia::protocols::openvpn::defaultSubnetAddress)); QString transportProto; if (m_container == DockerContainer::OpenVpn) { - transportProto = - protocolConfig.value(config_key::transport_proto).toString(protocols::openvpn::defaultTransportProto); + transportProto = protocolConfig.value(config_key::transport_proto).toString(protocols::openvpn::defaultTransportProto); } else { transportProto = "tcp"; } @@ -100,23 +88,18 @@ void OpenVpnConfigModel::updateModel(const QJsonObject &config) m_protocolConfig.insert(config_key::ncp_disable, protocolConfig.value(config_key::ncp_disable).toBool(protocols::openvpn::defaultNcpDisable)); - m_protocolConfig.insert(config_key::cipher, - protocolConfig.value(config_key::cipher).toString(protocols::openvpn::defaultCipher)); - m_protocolConfig.insert(config_key::hash, - protocolConfig.value(config_key::hash).toString(protocols::openvpn::defaultHash)); + m_protocolConfig.insert(config_key::cipher, protocolConfig.value(config_key::cipher).toString(protocols::openvpn::defaultCipher)); + m_protocolConfig.insert(config_key::hash, protocolConfig.value(config_key::hash).toString(protocols::openvpn::defaultHash)); m_protocolConfig.insert(config_key::block_outside_dns, protocolConfig.value(config_key::block_outside_dns).toBool(protocols::openvpn::defaultBlockOutsideDns)); - m_protocolConfig.insert(config_key::port, - protocolConfig.value(config_key::port).toString(protocols::openvpn::defaultPort)); + m_protocolConfig.insert(config_key::port, protocolConfig.value(config_key::port).toString(protocols::openvpn::defaultPort)); + m_protocolConfig.insert(config_key::tls_auth, protocolConfig.value(config_key::tls_auth).toBool(protocols::openvpn::defaultTlsAuth)); m_protocolConfig.insert( - config_key::tls_auth, - protocolConfig.value(config_key::tls_auth).toBool(protocols::openvpn::defaultTlsAuth)); - m_protocolConfig.insert(config_key::additional_client_config, - protocolConfig.value(config_key::additional_client_config) - .toString(protocols::openvpn::defaultAdditionalClientConfig)); - m_protocolConfig.insert(config_key::additional_server_config, - protocolConfig.value(config_key::additional_server_config) - .toString(protocols::openvpn::defaultAdditionalServerConfig)); + config_key::additional_client_config, + protocolConfig.value(config_key::additional_client_config).toString(protocols::openvpn::defaultAdditionalClientConfig)); + m_protocolConfig.insert( + config_key::additional_server_config, + protocolConfig.value(config_key::additional_server_config).toString(protocols::openvpn::defaultAdditionalServerConfig)); endResetModel(); } diff --git a/client/ui/models/protocols/shadowsocksConfigModel.cpp b/client/ui/models/protocols/shadowsocksConfigModel.cpp index 2fe2d2a9..769bef20 100644 --- a/client/ui/models/protocols/shadowsocksConfigModel.cpp +++ b/client/ui/models/protocols/shadowsocksConfigModel.cpp @@ -35,8 +35,7 @@ QVariant ShadowSocksConfigModel::data(const QModelIndex &index, int role) const switch (role) { case Roles::PortRole: return m_protocolConfig.value(config_key::port).toString(protocols::shadowsocks::defaultPort); - case Roles::CipherRole: - return m_protocolConfig.value(config_key::cipher).toString(protocols::shadowsocks::defaultCipher); + case Roles::CipherRole: return m_protocolConfig.value(config_key::cipher).toString(protocols::shadowsocks::defaultCipher); case Roles::IsPortEditableRole: return m_container == DockerContainer::ShadowSocks ? true : false; case Roles::IsCipherEditableRole: return m_container == DockerContainer::ShadowSocks ? true : false; } @@ -52,11 +51,11 @@ void ShadowSocksConfigModel::updateModel(const QJsonObject &config) m_fullConfig = config; QJsonObject protocolConfig = config.value(config_key::shadowsocks).toObject(); - m_protocolConfig.insert(config_key::cipher, - protocolConfig.value(config_key::cipher).toString(protocols::shadowsocks::defaultCipher)); - - m_protocolConfig.insert(config_key::port, - protocolConfig.value(config_key::port).toString(protocols::shadowsocks::defaultPort)); + auto defaultTransportProto = ProtocolProps::transportProtoToString(ProtocolProps::defaultTransportProto(Proto::ShadowSocks), Proto::ShadowSocks); + m_protocolConfig.insert(config_key::transport_proto, + protocolConfig.value(config_key::transport_proto).toString(defaultTransportProto)); + m_protocolConfig.insert(config_key::cipher, protocolConfig.value(config_key::cipher).toString(protocols::shadowsocks::defaultCipher)); + m_protocolConfig.insert(config_key::port, protocolConfig.value(config_key::port).toString(protocols::shadowsocks::defaultPort)); endResetModel(); } diff --git a/client/ui/models/protocols/wireguardConfigModel.cpp b/client/ui/models/protocols/wireguardConfigModel.cpp index 8903f40f..555915de 100644 --- a/client/ui/models/protocols/wireguardConfigModel.cpp +++ b/client/ui/models/protocols/wireguardConfigModel.cpp @@ -21,8 +21,8 @@ bool WireGuardConfigModel::setData(const QModelIndex &index, const QVariant &val } switch (role) { - case Roles::PortRole: m_protocolConfig.insert(config_key::port, value.toString()); break; - case Roles::MtuRole: m_protocolConfig.insert(config_key::mtu, value.toString()); break; + case Roles::PortRole: m_serverProtocolConfig.insert(config_key::port, value.toString()); break; + case Roles::ClientMtuRole: m_clientProtocolConfig.insert(config_key::mtu, value.toString()); break; } emit dataChanged(index, index, QList { role }); @@ -36,8 +36,8 @@ QVariant WireGuardConfigModel::data(const QModelIndex &index, int role) const } switch (role) { - case Roles::PortRole: return m_protocolConfig.value(config_key::port).toString(); - case Roles::MtuRole: return m_protocolConfig.value(config_key::mtu).toString(); + case Roles::PortRole: return m_serverProtocolConfig.value(config_key::port).toString(); + case Roles::ClientMtuRole: return m_clientProtocolConfig.value(config_key::mtu); } return QVariant(); @@ -49,14 +49,18 @@ void WireGuardConfigModel::updateModel(const QJsonObject &config) m_container = ContainerProps::containerFromString(config.value(config_key::container).toString()); m_fullConfig = config; - QJsonObject protocolConfig = config.value(config_key::wireguard).toObject(); + QJsonObject serverProtocolConfig = config.value(config_key::wireguard).toObject(); - m_protocolConfig[config_key::last_config] = protocolConfig.value(config_key::last_config); - m_protocolConfig[config_key::port] = - protocolConfig.value(config_key::port).toString(protocols::wireguard::defaultPort); + auto defaultTransportProto = + ProtocolProps::transportProtoToString(ProtocolProps::defaultTransportProto(Proto::WireGuard), Proto::WireGuard); + m_serverProtocolConfig.insert(config_key::transport_proto, + serverProtocolConfig.value(config_key::transport_proto).toString(defaultTransportProto)); + m_serverProtocolConfig[config_key::last_config] = serverProtocolConfig.value(config_key::last_config); + m_serverProtocolConfig[config_key::port] = serverProtocolConfig.value(config_key::port).toString(protocols::wireguard::defaultPort); - m_protocolConfig[config_key::mtu] = - protocolConfig.value(config_key::mtu).toString(protocols::wireguard::defaultMtu); + auto lastConfig = m_serverProtocolConfig.value(config_key::last_config).toString(); + QJsonObject clientProtocolConfig = QJsonDocument::fromJson(lastConfig.toUtf8()).object(); + m_clientProtocolConfig[config_key::mtu] = clientProtocolConfig[config_key::mtu].toString(protocols::wireguard::defaultMtu); endResetModel(); } @@ -64,36 +68,47 @@ void WireGuardConfigModel::updateModel(const QJsonObject &config) QJsonObject WireGuardConfigModel::getConfig() { const WgConfig oldConfig(m_fullConfig.value(config_key::wireguard).toObject()); - const WgConfig newConfig(m_protocolConfig); + const WgConfig newConfig(m_serverProtocolConfig); if (!oldConfig.hasEqualServerSettings(newConfig)) { - m_protocolConfig.remove(config_key::last_config); + m_serverProtocolConfig.remove(config_key::last_config); } else { - auto lastConfig = m_protocolConfig.value(config_key::last_config).toString(); + auto lastConfig = m_serverProtocolConfig.value(config_key::last_config).toString(); QJsonObject jsonConfig = QJsonDocument::fromJson(lastConfig.toUtf8()).object(); - jsonConfig[config_key::mtu] = newConfig.mtu; + jsonConfig[config_key::mtu] = m_clientProtocolConfig[config_key::mtu]; - m_protocolConfig[config_key::last_config] = QString(QJsonDocument(jsonConfig).toJson()); + m_serverProtocolConfig[config_key::last_config] = QString(QJsonDocument(jsonConfig).toJson()); } - m_fullConfig.insert(config_key::wireguard, m_protocolConfig); + m_fullConfig.insert(config_key::wireguard, m_serverProtocolConfig); return m_fullConfig; } +bool WireGuardConfigModel::isServerSettingsEqual() +{ + const WgConfig oldConfig(m_fullConfig.value(config_key::wireguard).toObject()); + const WgConfig newConfig(m_serverProtocolConfig); + + return oldConfig.hasEqualServerSettings(newConfig); +} + QHash WireGuardConfigModel::roleNames() const { QHash roles; roles[PortRole] = "port"; - roles[MtuRole] = "mtu"; + roles[ClientMtuRole] = "clientMtu"; return roles; } -WgConfig::WgConfig(const QJsonObject &jsonConfig) +WgConfig::WgConfig(const QJsonObject &serverProtocolConfig) { - port = jsonConfig.value(config_key::port).toString(protocols::wireguard::defaultPort); - mtu = jsonConfig.value(config_key::mtu).toString(protocols::wireguard::defaultMtu); + auto lastConfig = serverProtocolConfig.value(config_key::last_config).toString(); + QJsonObject clientProtocolConfig = QJsonDocument::fromJson(lastConfig.toUtf8()).object(); + clientMtu = clientProtocolConfig[config_key::mtu].toString(protocols::wireguard::defaultMtu); + + port = serverProtocolConfig.value(config_key::port).toString(protocols::wireguard::defaultPort); } bool WgConfig::hasEqualServerSettings(const WgConfig &other) const @@ -106,7 +121,7 @@ bool WgConfig::hasEqualServerSettings(const WgConfig &other) const bool WgConfig::hasEqualClientSettings(const WgConfig &other) const { - if (mtu != other.mtu) { + if (clientMtu != other.clientMtu) { return false; } return true; diff --git a/client/ui/models/protocols/wireguardConfigModel.h b/client/ui/models/protocols/wireguardConfigModel.h index 6cec76dd..a02bea5a 100644 --- a/client/ui/models/protocols/wireguardConfigModel.h +++ b/client/ui/models/protocols/wireguardConfigModel.h @@ -11,7 +11,7 @@ struct WgConfig WgConfig(const QJsonObject &jsonConfig); QString port; - QString mtu; + QString clientMtu; bool hasEqualServerSettings(const WgConfig &other) const; bool hasEqualClientSettings(const WgConfig &other) const; @@ -25,7 +25,7 @@ class WireGuardConfigModel : public QAbstractListModel public: enum Roles { PortRole = Qt::UserRole + 1, - MtuRole + ClientMtuRole }; explicit WireGuardConfigModel(QObject *parent = nullptr); @@ -39,12 +39,15 @@ public slots: void updateModel(const QJsonObject &config); QJsonObject getConfig(); + bool isServerSettingsEqual(); + protected: QHash roleNames() const override; private: DockerContainer m_container; - QJsonObject m_protocolConfig; + QJsonObject m_serverProtocolConfig; + QJsonObject m_clientProtocolConfig; QJsonObject m_fullConfig; }; diff --git a/client/ui/models/protocols/xrayConfigModel.cpp b/client/ui/models/protocols/xrayConfigModel.cpp index d5b50481..84bbb2f7 100644 --- a/client/ui/models/protocols/xrayConfigModel.cpp +++ b/client/ui/models/protocols/xrayConfigModel.cpp @@ -47,8 +47,11 @@ void XrayConfigModel::updateModel(const QJsonObject &config) m_fullConfig = config; QJsonObject protocolConfig = config.value(config_key::xray).toObject(); - m_protocolConfig.insert(config_key::site, - protocolConfig.value(config_key::site).toString(protocols::xray::defaultSite)); + auto defaultTransportProto = ProtocolProps::transportProtoToString(ProtocolProps::defaultTransportProto(Proto::Xray), Proto::Xray); + m_protocolConfig.insert(config_key::transport_proto, + protocolConfig.value(config_key::transport_proto).toString(defaultTransportProto)); + m_protocolConfig.insert(config_key::port, protocolConfig.value(config_key::port).toString(protocols::xray::defaultPort)); + m_protocolConfig.insert(config_key::site, protocolConfig.value(config_key::site).toString(protocols::xray::defaultSite)); endResetModel(); } diff --git a/client/ui/models/protocols_model.cpp b/client/ui/models/protocols_model.cpp index 32447cd4..019b2d2f 100644 --- a/client/ui/models/protocols_model.cpp +++ b/client/ui/models/protocols_model.cpp @@ -16,9 +16,11 @@ QHash ProtocolsModel::roleNames() const QHash roles; roles[ProtocolNameRole] = "protocolName"; - roles[ProtocolPageRole] = "protocolPage"; + roles[ServerProtocolPageRole] = "serverProtocolPage"; + roles[ClientProtocolPageRole] = "clientProtocolPage"; roles[ProtocolIndexRole] = "protocolIndex"; roles[RawConfigRole] = "rawConfig"; + roles[IsClientProtocolExistsRole] = "isClientProtocolExists"; return roles; } @@ -34,8 +36,10 @@ QVariant ProtocolsModel::data(const QModelIndex &index, int role) const amnezia::Proto proto = ProtocolProps::protoFromString(m_content.keys().at(index.row())); return ProtocolProps::protocolHumanNames().value(proto); } - case ProtocolPageRole: - return static_cast(protocolPage(ProtocolProps::protoFromString(m_content.keys().at(index.row())))); + case ServerProtocolPageRole: + return static_cast(serverProtocolPage(ProtocolProps::protoFromString(m_content.keys().at(index.row())))); + case ClientProtocolPageRole: + return static_cast(clientProtocolPage(ProtocolProps::protoFromString(m_content.keys().at(index.row())))); case ProtocolIndexRole: return ProtocolProps::protoFromString(m_content.keys().at(index.row())); case RawConfigRole: { auto protocolConfig = m_content.value(ContainerProps::containerTypeToString(m_container)).toObject(); @@ -50,6 +54,15 @@ QVariant ProtocolsModel::data(const QModelIndex &index, int role) const } return rawConfig; } + case IsClientProtocolExistsRole: { + auto protocolConfig = m_content.value(ContainerProps::containerTypeToString(m_container)).toObject(); + auto lastConfigJsonDoc = + QJsonDocument::fromJson(protocolConfig.value(config_key::last_config).toString().toUtf8()); + auto lastConfigJson = lastConfigJsonDoc.object(); + + auto configString = lastConfigJson.value(config_key::config).toString(); + return !configString.isEmpty(); + } } return QVariant(); @@ -70,7 +83,7 @@ QJsonObject ProtocolsModel::getConfig() return config; } -PageLoader::PageEnum ProtocolsModel::protocolPage(Proto protocol) const +PageLoader::PageEnum ProtocolsModel::serverProtocolPage(Proto protocol) const { switch (protocol) { case Proto::OpenVpn: return PageLoader::PageEnum::PageProtocolOpenVpnSettings; @@ -90,3 +103,12 @@ PageLoader::PageEnum ProtocolsModel::protocolPage(Proto protocol) const default: return PageLoader::PageEnum::PageProtocolOpenVpnSettings; } } + +PageLoader::PageEnum ProtocolsModel::clientProtocolPage(Proto protocol) const +{ + switch (protocol) { + case Proto::WireGuard: return PageLoader::PageEnum::PageProtocolWireGuardClientSettings; + case Proto::Awg: return PageLoader::PageEnum::PageProtocolAwgClientSettings; + default: return PageLoader::PageEnum::PageProtocolOpenVpnSettings; + } +} diff --git a/client/ui/models/protocols_model.h b/client/ui/models/protocols_model.h index 5ee8a3dd..5c52ee86 100644 --- a/client/ui/models/protocols_model.h +++ b/client/ui/models/protocols_model.h @@ -13,9 +13,11 @@ class ProtocolsModel : public QAbstractListModel public: enum Roles { ProtocolNameRole = Qt::UserRole + 1, - ProtocolPageRole, + ServerProtocolPageRole, + ClientProtocolPageRole, ProtocolIndexRole, - RawConfigRole + RawConfigRole, + IsClientProtocolExistsRole }; ProtocolsModel(std::shared_ptr settings, QObject *parent = nullptr); @@ -33,7 +35,8 @@ protected: QHash roleNames() const override; private: - PageLoader::PageEnum protocolPage(Proto protocol) const; + PageLoader::PageEnum serverProtocolPage(Proto protocol) const; + PageLoader::PageEnum clientProtocolPage(Proto protocol) const; std::shared_ptr m_settings; diff --git a/client/ui/models/servers_model.cpp b/client/ui/models/servers_model.cpp index 3f167029..85e5dae2 100644 --- a/client/ui/models/servers_model.cpp +++ b/client/ui/models/servers_model.cpp @@ -1,8 +1,31 @@ #include "servers_model.h" #include "core/controllers/serverController.h" +#include "core/enums/apiEnums.h" #include "core/networkUtilities.h" +#ifdef Q_OS_IOS + #include +#endif + +namespace +{ + namespace configKey + { + constexpr char apiConfig[] = "api_config"; + constexpr char serviceInfo[] = "service_info"; + constexpr char availableCountries[] = "available_countries"; + constexpr char serverCountryCode[] = "server_country_code"; + constexpr char serverCountryName[] = "server_country_name"; + constexpr char userCountryCode[] = "user_country_code"; + constexpr char serviceType[] = "service_type"; + constexpr char serviceProtocol[] = "service_protocol"; + + constexpr char publicKeyInfo[] = "public_key"; + constexpr char endDate[] = "end_date"; + } +} + ServersModel::ServersModel(std::shared_ptr settings, QObject *parent) : m_settings(settings), QAbstractListModel(parent) { m_isAmneziaDnsEnabled = m_settings->useAmneziaDns(); @@ -63,6 +86,7 @@ QVariant ServersModel::data(const QModelIndex &index, int role) const } const QJsonObject server = m_servers.at(index.row()).toObject(); + const auto apiConfig = server.value(configKey::apiConfig).toObject(); const auto configVersion = server.value(config_key::configVersion).toInt(); switch (role) { case NameRole: { @@ -98,8 +122,23 @@ QVariant ServersModel::data(const QModelIndex &index, int role) const case HasInstalledContainers: { return serverHasInstalledContainers(index.row()); } - case IsServerFromApiRole: { - return server.value(config_key::configVersion).toInt(); + case IsServerFromTelegramApiRole: { + return server.value(config_key::configVersion).toInt() == ApiConfigSources::Telegram; + } + case IsServerFromGatewayApiRole: { + return server.value(config_key::configVersion).toInt() == ApiConfigSources::AmneziaGateway; + } + case ApiConfigRole: { + return apiConfig; + } + case IsCountrySelectionAvailableRole: { + return !apiConfig.value(configKey::availableCountries).toArray().isEmpty(); + } + case ApiAvailableCountriesRole: { + return apiConfig.value(configKey::availableCountries).toArray(); + } + case ApiServerCountryCodeRole: { + return apiConfig.value(configKey::serverCountryCode).toString(); } case HasAmneziaDns: { QString primaryDns = server.value(config_key::dns1).toString(); @@ -146,10 +185,13 @@ const QString ServersModel::getDefaultServerName() QString ServersModel::getServerDescription(const QJsonObject &server, const int index) const { const auto configVersion = server.value(config_key::configVersion).toInt(); + const auto apiConfig = server.value(configKey::apiConfig).toObject(); QString description; - if (configVersion) { + if (configVersion && !apiConfig.value(configKey::serverCountryCode).toString().isEmpty()) { + return apiConfig.value(configKey::serverCountryName).toString(); + } else if (configVersion) { return server.value(config_key::description).toString(); } else if (data(index, HasWriteAccessRole).toBool()) { if (m_isAmneziaDnsEnabled && isAmneziaDnsContainerInstalled(index)) { @@ -208,6 +250,12 @@ void ServersModel::setProcessedServerIndex(const int index) { m_processedServerIndex = index; updateContainersModel(); + if (data(index, IsServerFromGatewayApiRole).toBool()) { + if (data(index, IsCountrySelectionAvailableRole).toBool()) { + emit updateApiLanguageModel(); + } + emit updateApiServicesModel(); + } emit processedServerIndexChanged(m_processedServerIndex); } @@ -233,7 +281,8 @@ bool ServersModel::isDefaultServerCurrentlyProcessed() bool ServersModel::isDefaultServerFromApi() { - return qvariant_cast(data(m_defaultServerIndex, IsServerFromApiRole)); + return data(m_defaultServerIndex, IsServerFromTelegramApiRole).toBool() + || data(m_defaultServerIndex, IsServerFromGatewayApiRole).toBool(); } bool ServersModel::isProcessedServerHasWriteAccess() @@ -315,7 +364,12 @@ QHash ServersModel::roleNames() const roles[DefaultContainerRole] = "defaultContainer"; roles[HasInstalledContainers] = "hasInstalledContainers"; - roles[IsServerFromApiRole] = "isServerFromApi"; + roles[IsServerFromTelegramApiRole] = "isServerFromTelegramApi"; + roles[IsServerFromGatewayApiRole] = "isServerFromGatewayApi"; + roles[ApiConfigRole] = "apiConfig"; + roles[IsCountrySelectionAvailableRole] = "isCountrySelectionAvailable"; + roles[ApiAvailableCountriesRole] = "apiAvailableCountries"; + roles[ApiServerCountryCodeRole] = "apiServerCountryCode"; return roles; } @@ -399,8 +453,7 @@ void ServersModel::addContainerConfig(const int containerIndex, const QJsonObjec auto defaultContainer = server.value(config_key::defaultContainer).toString(); if (ContainerProps::containerFromString(defaultContainer) == DockerContainer::None - && ContainerProps::containerService(container) != ServiceType::Other - && ContainerProps::isSupportedByCurrentPlatform(container)) { + && ContainerProps::containerService(container) != ServiceType::Other && ContainerProps::isSupportedByCurrentPlatform(container)) { server.insert(config_key::defaultContainer, ContainerProps::containerToString(container)); } @@ -565,7 +618,7 @@ void ServersModel::toggleAmneziaDns(bool enabled) bool ServersModel::isServerFromApiAlreadyExists(const quint16 crc) { - for (const auto &server : qAsConst(m_servers)) { + for (const auto &server : std::as_const(m_servers)) { if (static_cast(server.toObject().value(config_key::crc).toInt()) == crc) { return true; } @@ -573,6 +626,19 @@ bool ServersModel::isServerFromApiAlreadyExists(const quint16 crc) return false; } +bool ServersModel::isServerFromApiAlreadyExists(const QString &userCountryCode, const QString &serviceType, const QString &serviceProtocol) +{ + for (const auto &server : std::as_const(m_servers)) { + const auto apiConfig = server.toObject().value(configKey::apiConfig).toObject(); + if (apiConfig.value(configKey::userCountryCode).toString() == userCountryCode + && apiConfig.value(configKey::serviceType).toString() == serviceType + && apiConfig.value(configKey::serviceProtocol).toString() == serviceProtocol) { + return true; + } + } + return false; +} + bool ServersModel::serverHasInstalledContainers(const int serverIndex) const { QJsonObject server = m_servers.at(serverIndex).toObject(); @@ -621,14 +687,89 @@ bool ServersModel::isDefaultServerDefaultContainerHasSplitTunneling() auto containers = server.value(config_key::containers).toArray(); for (auto i = 0; i < containers.size(); i++) { auto container = containers.at(i).toObject(); + if (container.value(config_key::container).toString() != ContainerProps::containerToString(defaultContainer)) { + continue; + } if (defaultContainer == DockerContainer::Awg || defaultContainer == DockerContainer::WireGuard) { - auto containerConfig = container.value(ContainerProps::containerTypeToString(defaultContainer)).toObject(); - return !(containerConfig.value(config_key::last_config).toString().contains("AllowedIPs = 0.0.0.0/0, ::/0")); + QJsonObject serverProtocolConfig = container.value(ContainerProps::containerTypeToString(defaultContainer)).toObject(); + QString clientProtocolConfigString = serverProtocolConfig.value(config_key::last_config).toString(); + QJsonObject clientProtocolConfig = QJsonDocument::fromJson(clientProtocolConfigString.toUtf8()).object(); + return (clientProtocolConfigString.contains("AllowedIPs") && !clientProtocolConfigString.contains("AllowedIPs = 0.0.0.0/0, ::/0")) + || (!clientProtocolConfig.value(config_key::allowed_ips).toArray().isEmpty() + && !clientProtocolConfig.value(config_key::allowed_ips).toArray().contains("0.0.0.0/0")); } else if (defaultContainer == DockerContainer::Cloak || defaultContainer == DockerContainer::OpenVpn || defaultContainer == DockerContainer::ShadowSocks) { - auto containerConfig = container.value(ContainerProps::containerTypeToString(DockerContainer::OpenVpn)).toObject(); - return !(containerConfig.value(config_key::last_config).toString().contains("redirect-gateway")); + auto serverProtocolConfig = container.value(ContainerProps::containerTypeToString(DockerContainer::OpenVpn)).toObject(); + QString clientProtocolConfigString = serverProtocolConfig.value(config_key::last_config).toString(); + return !clientProtocolConfigString.isEmpty() && !clientProtocolConfigString.contains("redirect-gateway"); } } return false; } + +bool ServersModel::isServerFromApi(const int serverIndex) +{ + return data(serverIndex, IsServerFromTelegramApiRole).toBool() || data(serverIndex, IsServerFromGatewayApiRole).toBool(); +} + +bool ServersModel::isApiKeyExpired(const int serverIndex) +{ + auto serverConfig = m_servers.at(serverIndex).toObject(); + auto apiConfig = serverConfig.value(configKey::apiConfig).toObject(); + + auto publicKeyInfo = apiConfig.value(configKey::publicKeyInfo).toObject(); + const QString endDate = publicKeyInfo.value(configKey::endDate).toString(); + if (endDate.isEmpty()) { + publicKeyInfo.insert(configKey::endDate, QDateTime::currentDateTimeUtc().addDays(1).toString(Qt::ISODate)); + apiConfig.insert(configKey::publicKeyInfo, publicKeyInfo); + serverConfig.insert(configKey::apiConfig, apiConfig); + editServer(serverConfig, serverIndex); + + return false; + } + + auto endDateDateTime = QDateTime::fromString(endDate, Qt::ISODate).toUTC(); + if (endDateDateTime < QDateTime::currentDateTimeUtc()) { + return true; + } + return false; +} + +void ServersModel::removeApiConfig(const int serverIndex) +{ + auto serverConfig = getServerConfig(serverIndex); + +#ifdef Q_OS_IOS + QString vpncName = QString("%1 (%2) %3") + .arg(serverConfig[config_key::description].toString()) + .arg(serverConfig[config_key::hostName].toString()) + .arg(serverConfig[config_key::vpnproto].toString()); + + AmneziaVPN::removeVPNC(vpncName.toStdString()); +#endif + + serverConfig.remove(config_key::dns1); + serverConfig.remove(config_key::dns2); + serverConfig.remove(config_key::containers); + serverConfig.remove(config_key::hostName); + + auto apiConfig = serverConfig.value(configKey::apiConfig).toObject(); + apiConfig.remove(configKey::publicKeyInfo); + serverConfig.insert(configKey::apiConfig, apiConfig); + + serverConfig.insert(config_key::defaultContainer, ContainerProps::containerToString(DockerContainer::None)); + + editServer(serverConfig, serverIndex); +} + +const QString ServersModel::getDefaultServerImagePathCollapsed() +{ + const auto server = m_servers.at(m_defaultServerIndex).toObject(); + const auto apiConfig = server.value(configKey::apiConfig).toObject(); + const auto countryCode = apiConfig.value(configKey::serverCountryCode).toString(); + + if (countryCode.isEmpty()) { + return ""; + } + return QString("qrc:/countriesFlags/images/flagKit/%1.svg").arg(countryCode); +} diff --git a/client/ui/models/servers_model.h b/client/ui/models/servers_model.h index e6b9226b..0f18ea30 100644 --- a/client/ui/models/servers_model.h +++ b/client/ui/models/servers_model.h @@ -3,8 +3,8 @@ #include -#include "settings.h" #include "core/controllers/serverController.h" +#include "settings.h" class ServersModel : public QAbstractListModel { @@ -30,7 +30,13 @@ public: DefaultContainerRole, HasInstalledContainers, - IsServerFromApiRole, + + IsServerFromTelegramApiRole, + IsServerFromGatewayApiRole, + ApiConfigRole, + IsCountrySelectionAvailableRole, + ApiAvailableCountriesRole, + ApiServerCountryCodeRole, HasAmneziaDns }; @@ -49,8 +55,10 @@ public: Q_PROPERTY(QString defaultServerName READ getDefaultServerName NOTIFY defaultServerNameChanged) Q_PROPERTY(QString defaultServerDefaultContainerName READ getDefaultServerDefaultContainerName NOTIFY defaultServerDefaultContainerChanged) Q_PROPERTY(QString defaultServerDescriptionCollapsed READ getDefaultServerDescriptionCollapsed NOTIFY defaultServerDefaultContainerChanged) + Q_PROPERTY(QString defaultServerImagePathCollapsed READ getDefaultServerImagePathCollapsed NOTIFY defaultServerDefaultContainerChanged) Q_PROPERTY(QString defaultServerDescriptionExpanded READ getDefaultServerDescriptionExpanded NOTIFY defaultServerDefaultContainerChanged) - Q_PROPERTY(bool isDefaultServerDefaultContainerHasSplitTunneling READ isDefaultServerDefaultContainerHasSplitTunneling NOTIFY defaultServerDefaultContainerChanged) + Q_PROPERTY(bool isDefaultServerDefaultContainerHasSplitTunneling READ isDefaultServerDefaultContainerHasSplitTunneling NOTIFY + defaultServerDefaultContainerChanged) Q_PROPERTY(bool isDefaultServerFromApi READ isDefaultServerFromApi NOTIFY defaultServerIndexChanged) Q_PROPERTY(int processedIndex READ getProcessedServerIndex WRITE setProcessedServerIndex NOTIFY processedServerIndexChanged) @@ -60,6 +68,7 @@ public slots: const int getDefaultServerIndex(); const QString getDefaultServerName(); const QString getDefaultServerDescriptionCollapsed(); + const QString getDefaultServerImagePathCollapsed(); const QString getDefaultServerDescriptionExpanded(); const QString getDefaultServerDefaultContainerName(); bool isDefaultServerCurrentlyProcessed(); @@ -101,6 +110,7 @@ public slots: QPair getDnsPair(const int serverIndex); bool isServerFromApiAlreadyExists(const quint16 crc); + bool isServerFromApiAlreadyExists(const QString &userCountryCode, const QString &serviceType, const QString &serviceProtocol); QVariant getDefaultServerData(const QString roleString); @@ -108,6 +118,10 @@ public slots: bool isDefaultServerDefaultContainerHasSplitTunneling(); + bool isServerFromApi(const int serverIndex); + bool isApiKeyExpired(const int serverIndex); + void removeApiConfig(const int serverIndex); + protected: QHash roleNames() const override; @@ -121,6 +135,9 @@ signals: void defaultServerContainersUpdated(const QJsonArray &containers); void defaultServerDefaultContainerChanged(const int containerIndex); + void updateApiLanguageModel(); + void updateApiServicesModel(); + private: ServerCredentials serverCredentials(int index) const; diff --git a/client/ui/property_helper.h b/client/ui/property_helper.h deleted file mode 100644 index 927105b3..00000000 --- a/client/ui/property_helper.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef PROPERTY_HELPER_H -#define PROPERTY_HELPER_H - -#include - -#define AUTO_PROPERTY(TYPE, NAME) \ - Q_PROPERTY(TYPE NAME READ NAME WRITE set_ ## NAME NOTIFY NAME ## Changed ) \ - public: \ - TYPE NAME() const { return m_ ## NAME ; } \ - void set_ ## NAME(TYPE value) { \ - if (m_ ## NAME == value) return; \ - m_ ## NAME = value; \ - emit NAME ## Changed(value); \ - } \ - Q_SIGNAL void NAME ## Changed(TYPE value);\ - private: \ - TYPE m_ ## NAME{}; - -#define READONLY_PROPERTY(TYPE, NAME) \ - Q_PROPERTY(TYPE NAME READ NAME CONSTANT ) \ - public: \ - TYPE NAME() const { return m_ ## NAME ; } \ - private: \ - void NAME(TYPE value) {m_ ## NAME = value; } \ - TYPE m_ ## NAME{}; - -#endif // PROPERTY_HELPER_H diff --git a/client/ui/qml/Components/ConnectButton.qml b/client/ui/qml/Components/ConnectButton.qml index dcf8caa3..fa18703b 100644 --- a/client/ui/qml/Components/ConnectButton.qml +++ b/client/ui/qml/Components/ConnectButton.qml @@ -11,9 +11,10 @@ import Style 1.0 Button { id: root - property string defaultButtonColor: AmneziaStyle.color.white - property string progressButtonColor: AmneziaStyle.color.white - property string connectedButtonColor: AmneziaStyle.color.orange + property string defaultButtonColor: AmneziaStyle.color.paleGray + property string progressButtonColor: AmneziaStyle.color.paleGray + property string connectedButtonColor: AmneziaStyle.color.goldenApricot + property bool buttonActiveFocus: activeFocus && (Qt.platform.os !== "android" || SettingsController.isOnTv()) implicitWidth: 190 implicitHeight: 190 @@ -50,14 +51,14 @@ Button { verticalOffset: 0 radius: 10 samples: 25 - color: root.activeFocus ? AmneziaStyle.color.white : AmneziaStyle.color.orange + color: root.buttonActiveFocus ? AmneziaStyle.color.paleGray : AmneziaStyle.color.goldenApricot source: backgroundCircle } ShapePath { fillColor: AmneziaStyle.color.transparent - strokeColor: AmneziaStyle.color.white - strokeWidth: root.activeFocus ? 1 : 0 + strokeColor: AmneziaStyle.color.paleGray + strokeWidth: root.buttonActiveFocus ? 1 : 0 capStyle: ShapePath.RoundCap PathAngleArc { @@ -74,21 +75,21 @@ Button { fillColor: AmneziaStyle.color.transparent strokeColor: { if (ConnectionController.isConnectionInProgress) { - return AmneziaStyle.color.connectionInProgress + return AmneziaStyle.color.darkCharcoal } else if (ConnectionController.isConnected) { return connectedButtonColor } else { return defaultButtonColor } } - strokeWidth: root.activeFocus ? 2 : 3 + strokeWidth: root.buttonActiveFocus ? 2 : 3 capStyle: ShapePath.RoundCap PathAngleArc { centerX: backgroundCircle.width / 2 centerY: backgroundCircle.height / 2 - radiusX: 93 - (root.activeFocus ? 2 : 0) - radiusY: 93 - (root.activeFocus ? 2 : 0) + radiusX: 93 - (root.buttonActiveFocus ? 2 : 0) + radiusY: 93 - (root.buttonActiveFocus ? 2 : 0) startAngle: 0 sweepAngle: 360 } @@ -115,7 +116,7 @@ Button { ShapePath { fillColor: AmneziaStyle.color.transparent - strokeColor: AmneziaStyle.color.white + strokeColor: AmneziaStyle.color.paleGray strokeWidth: 3 capStyle: ShapePath.RoundCap diff --git a/client/ui/qml/Components/HomeSplitTunnelingDrawer.qml b/client/ui/qml/Components/HomeSplitTunnelingDrawer.qml index 5a3bf475..405d4eda 100644 --- a/client/ui/qml/Components/HomeSplitTunnelingDrawer.qml +++ b/client/ui/qml/Components/HomeSplitTunnelingDrawer.qml @@ -53,7 +53,7 @@ DrawerType2 { Layout.fillWidth: true Layout.topMargin: 16 - visible: ServersModel.isDefaultServerDefaultContainerHasSplitTunneling && ServersModel.getDefaultServerData("isServerFromApi") + visible: ServersModel.isDefaultServerDefaultContainerHasSplitTunneling text: qsTr("Split tunneling on the server") descriptionText: qsTr("Enabled \nCan't be disabled for current server") @@ -68,7 +68,7 @@ DrawerType2 { } DividerType { - visible: ServersModel.isDefaultServerDefaultContainerHasSplitTunneling && ServersModel.getDefaultServerData("isServerFromApi") + visible: ServersModel.isDefaultServerDefaultContainerHasSplitTunneling } LabelWithButtonType { diff --git a/client/ui/qml/Components/InstalledAppsDrawer.qml b/client/ui/qml/Components/InstalledAppsDrawer.qml index 1024b054..e5d10055 100644 --- a/client/ui/qml/Components/InstalledAppsDrawer.qml +++ b/client/ui/qml/Components/InstalledAppsDrawer.qml @@ -134,7 +134,7 @@ DrawerType2 { anchors.rightMargin: 16 anchors.leftMargin: 16 - backgroundColor: AmneziaStyle.color.greyDark + backgroundColor: AmneziaStyle.color.slateGray textFieldPlaceholderText: qsTr("application name") } diff --git a/client/ui/qml/Components/QuestionDrawer.qml b/client/ui/qml/Components/QuestionDrawer.qml index 1ea1417e..a0e86dbc 100644 --- a/client/ui/qml/Components/QuestionDrawer.qml +++ b/client/ui/qml/Components/QuestionDrawer.qml @@ -89,10 +89,10 @@ DrawerType2 { Layout.leftMargin: 16 defaultColor: AmneziaStyle.color.transparent - hoveredColor: AmneziaStyle.color.blackHovered - pressedColor: AmneziaStyle.color.blackPressed - disabledColor: AmneziaStyle.color.grey - textColor: AmneziaStyle.color.white + hoveredColor: AmneziaStyle.color.translucentWhite + pressedColor: AmneziaStyle.color.sheerWhite + disabledColor: AmneziaStyle.color.mutedGray + textColor: AmneziaStyle.color.paleGray borderWidth: 1 text: noButtonText diff --git a/client/ui/qml/Components/SelectLanguageDrawer.qml b/client/ui/qml/Components/SelectLanguageDrawer.qml index 38331079..4d9d7f0e 100644 --- a/client/ui/qml/Components/SelectLanguageDrawer.qml +++ b/client/ui/qml/Components/SelectLanguageDrawer.qml @@ -147,8 +147,8 @@ DrawerType2 { indicator: Rectangle { width: parent.width - 1 height: parent.height - color: radioButton.hovered ? AmneziaStyle.color.greyDark : AmneziaStyle.color.blackLight - border.color: radioButton.focus ? AmneziaStyle.color.white : AmneziaStyle.color.transparent + color: radioButton.hovered ? AmneziaStyle.color.slateGray : AmneziaStyle.color.onyxBlack + border.color: radioButton.focus ? AmneziaStyle.color.paleGray : AmneziaStyle.color.transparent border.width: radioButton.focus ? 1 : 0 Behavior on color { diff --git a/client/ui/qml/Components/ShareConnectionDrawer.qml b/client/ui/qml/Components/ShareConnectionDrawer.qml index 8bb38893..3235ad0a 100644 --- a/client/ui/qml/Components/ShareConnectionDrawer.qml +++ b/client/ui/qml/Components/ShareConnectionDrawer.qml @@ -113,10 +113,10 @@ DrawerType2 { Layout.topMargin: 8 defaultColor: AmneziaStyle.color.transparent - hoveredColor: AmneziaStyle.color.blackHovered - pressedColor: AmneziaStyle.color.blackPressed - disabledColor: AmneziaStyle.color.grey - textColor: AmneziaStyle.color.white + hoveredColor: AmneziaStyle.color.translucentWhite + pressedColor: AmneziaStyle.color.sheerWhite + disabledColor: AmneziaStyle.color.mutedGray + textColor: AmneziaStyle.color.paleGray borderWidth: 1 text: qsTr("Copy") @@ -136,10 +136,10 @@ DrawerType2 { visible: false defaultColor: AmneziaStyle.color.transparent - hoveredColor: AmneziaStyle.color.blackHovered - pressedColor: AmneziaStyle.color.blackPressed - disabledColor: AmneziaStyle.color.grey - textColor: AmneziaStyle.color.white + hoveredColor: AmneziaStyle.color.translucentWhite + pressedColor: AmneziaStyle.color.sheerWhite + disabledColor: AmneziaStyle.color.mutedGray + textColor: AmneziaStyle.color.paleGray borderWidth: 1 text: qsTr("Copy config string") @@ -155,10 +155,10 @@ DrawerType2 { Layout.topMargin: 24 defaultColor: AmneziaStyle.color.transparent - hoveredColor: AmneziaStyle.color.blackHovered - pressedColor: AmneziaStyle.color.blackPressed - disabledColor: AmneziaStyle.color.grey - textColor: AmneziaStyle.color.white + hoveredColor: AmneziaStyle.color.translucentWhite + pressedColor: AmneziaStyle.color.sheerWhite + disabledColor: AmneziaStyle.color.mutedGray + textColor: AmneziaStyle.color.paleGray borderWidth: 1 text: qsTr("Show connection settings") @@ -282,9 +282,9 @@ DrawerType2 { readOnly: true activeFocusOnTab: false - color: AmneziaStyle.color.white - selectionColor: AmneziaStyle.color.brown - selectedTextColor: AmneziaStyle.color.white + color: AmneziaStyle.color.paleGray + selectionColor: AmneziaStyle.color.richBrown + selectedTextColor: AmneziaStyle.color.paleGray font.pixelSize: 16 font.weight: Font.Medium diff --git a/client/ui/qml/Components/TransportProtoSelector.qml b/client/ui/qml/Components/TransportProtoSelector.qml index adb7371f..e40dd4bb 100644 --- a/client/ui/qml/Components/TransportProtoSelector.qml +++ b/client/ui/qml/Components/TransportProtoSelector.qml @@ -16,7 +16,7 @@ Rectangle { implicitWidth: transportProtoButtonGroup.implicitWidth implicitHeight: transportProtoButtonGroup.implicitHeight - color: AmneziaStyle.color.blackLight + color: AmneziaStyle.color.onyxBlack radius: 16 onFocusChanged: { diff --git a/client/ui/qml/Controls2/BackButtonType.qml b/client/ui/qml/Controls2/BackButtonType.qml index ff898e08..86fc86a2 100644 --- a/client/ui/qml/Controls2/BackButtonType.qml +++ b/client/ui/qml/Controls2/BackButtonType.qml @@ -30,7 +30,7 @@ Item { ImageButtonType { id: backButton image: backButtonImage - imageColor: AmneziaStyle.color.white + imageColor: AmneziaStyle.color.paleGray implicitWidth: 40 implicitHeight: 40 diff --git a/client/ui/qml/Controls2/BasicButtonType.qml b/client/ui/qml/Controls2/BasicButtonType.qml index 0b6c4a6f..5c599013 100644 --- a/client/ui/qml/Controls2/BasicButtonType.qml +++ b/client/ui/qml/Controls2/BasicButtonType.qml @@ -10,15 +10,15 @@ import "TextTypes" Button { id: root - property string hoveredColor: AmneziaStyle.color.whiteHovered - property string defaultColor: AmneziaStyle.color.white - property string disabledColor: AmneziaStyle.color.greyDisabled - property string pressedColor: AmneziaStyle.color.grey + property string hoveredColor: AmneziaStyle.color.lightGray + property string defaultColor: AmneziaStyle.color.paleGray + property string disabledColor: AmneziaStyle.color.charcoalGray + property string pressedColor: AmneziaStyle.color.mutedGray - property string textColor: AmneziaStyle.color.black + property string textColor: AmneziaStyle.color.midnightBlack - property string borderColor: AmneziaStyle.color.white - property string borderFocusedColor: AmneziaStyle.color.white + property string borderColor: AmneziaStyle.color.paleGray + property string borderFocusedColor: AmneziaStyle.color.paleGray property int borderWidth: 0 property int borderFocusedWidth: 1 diff --git a/client/ui/qml/Controls2/BusyIndicatorType.qml b/client/ui/qml/Controls2/BusyIndicatorType.qml index 590006ee..55af280f 100644 --- a/client/ui/qml/Controls2/BusyIndicatorType.qml +++ b/client/ui/qml/Controls2/BusyIndicatorType.qml @@ -43,7 +43,7 @@ Popup { ShapePath { fillColor: AmneziaStyle.color.transparent - strokeColor: AmneziaStyle.color.greyDisabled + strokeColor: AmneziaStyle.color.charcoalGray strokeWidth: 3 capStyle: ShapePath.RoundCap diff --git a/client/ui/qml/Controls2/CardType.qml b/client/ui/qml/Controls2/CardType.qml index 1e623853..50f84dbf 100644 --- a/client/ui/qml/Controls2/CardType.qml +++ b/client/ui/qml/Controls2/CardType.qml @@ -11,16 +11,16 @@ RadioButton { property string bodyText property string footerText - property string hoveredColor: AmneziaStyle.color.blackHovered + property string hoveredColor: AmneziaStyle.color.barelyTranslucentWhite property string defaultColor: AmneziaStyle.color.transparent property string disabledColor: AmneziaStyle.color.transparent - property string pressedColor: AmneziaStyle.color.blackPressed + property string pressedColor: AmneziaStyle.color.barelyTranslucentWhite property string selectedColor: AmneziaStyle.color.transparent - property string textColor: AmneziaStyle.color.black + property string textColor: AmneziaStyle.color.midnightBlack property string pressedBorderColor: Qt.rgba(251/255, 178/255, 106/255, 0.3) - property string selectedBorderColor: AmneziaStyle.color.orange + property string selectedBorderColor: AmneziaStyle.color.goldenApricot property string defaultBodredColor: AmneziaStyle.color.transparent property int borderWidth: 0 @@ -84,7 +84,7 @@ RadioButton { Text { text: root.headerText wrapMode: Text.WordWrap - color: AmneziaStyle.color.white + color: AmneziaStyle.color.paleGray font.pixelSize: 25 font.weight: 700 font.family: "PT Root UI VF" @@ -99,7 +99,7 @@ RadioButton { Text { text: root.bodyText wrapMode: Text.WordWrap - color: AmneziaStyle.color.white + color: AmneziaStyle.color.paleGray font.pixelSize: 16 font.weight: 400 font.family: "PT Root UI VF" @@ -115,7 +115,7 @@ RadioButton { text: root.footerText wrapMode: Text.WordWrap visible: root.footerText !== "" - color: AmneziaStyle.color.grey + color: AmneziaStyle.color.mutedGray font.pixelSize: 13 font.weight: 400 font.family: "PT Root UI VF" diff --git a/client/ui/qml/Controls2/CardWithIconsType.qml b/client/ui/qml/Controls2/CardWithIconsType.qml new file mode 100644 index 00000000..fea65116 --- /dev/null +++ b/client/ui/qml/Controls2/CardWithIconsType.qml @@ -0,0 +1,178 @@ +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts + +import Style 1.0 + +import "TextTypes" + +Button { + id: root + + property string headerText + property string bodyText + property string footerText + + property string hoveredColor: AmneziaStyle.color.slateGray + property string defaultColor: AmneziaStyle.color.onyxBlack + + property string textColor: AmneziaStyle.color.midnightBlack + + property string rightImageSource + property string rightImageColor: AmneziaStyle.color.paleGray + + property string leftImageSource + + property real textOpacity: 1.0 + + hoverEnabled: true + + background: Rectangle { + id: backgroundRect + anchors.fill: parent + radius: 16 + + color: defaultColor + + Behavior on color { + PropertyAnimation { duration: 200 } + } + } + + contentItem: Item { + anchors.left: parent.left + anchors.right: parent.right + + implicitHeight: content.implicitHeight + RowLayout { + id: content + anchors.fill: parent + + Image { + id: leftImage + source: leftImageSource + + visible: leftImageSource !== "" + + Layout.alignment: Qt.AlignLeft | Qt.AlignTop + Layout.topMargin: 24 + Layout.bottomMargin: 24 + Layout.leftMargin: 24 + } + + ColumnLayout { + ListItemTitleType { + text: root.headerText + visible: text !== "" + + Layout.fillWidth: true + Layout.rightMargin: 16 + Layout.leftMargin: 16 + Layout.topMargin: 16 + Layout.bottomMargin: root.bodyText !== "" ? 0 : 16 + + opacity: root.textOpacity + } + + CaptionTextType { + text: root.bodyText + visible: text !== "" + + color: AmneziaStyle.color.mutedGray + textFormat: Text.RichText + + Layout.fillWidth: true + Layout.rightMargin: 16 + Layout.leftMargin: 16 + Layout.bottomMargin: root.footerText !== "" ? 0 : 16 + + opacity: root.textOpacity + } + + ButtonTextType { + text: root.footerText + visible: text !== "" + + color: AmneziaStyle.color.mutedGray + + Layout.fillWidth: true + Layout.rightMargin: 16 + Layout.leftMargin: 16 + Layout.topMargin: 16 + Layout.bottomMargin: 16 + + opacity: root.textOpacity + } + } + + ImageButtonType { + id: rightImage + + implicitWidth: 40 + implicitHeight: 40 + + hoverEnabled: false + image: rightImageSource + imageColor: rightImageColor + visible: rightImageSource ? true : false + + Layout.alignment: Qt.AlignRight | Qt.AlignTop + Layout.topMargin: 16 + Layout.bottomMargin: 16 + Layout.rightMargin: 16 + + Rectangle { + id: rightImageBackground + anchors.fill: parent + radius: 12 + color: "transparent" + + Behavior on color { + PropertyAnimation { duration: 200 } + } + } + onClicked: { + if (clickedFunction && typeof clickedFunction === "function") { + clickedFunction() + } + } + } + } + } + + MouseArea { + anchors.fill: parent + + cursorShape: Qt.PointingHandCursor + hoverEnabled: true + + onEntered: { + backgroundRect.color = root.hoveredColor + + if (rightImageSource) { + rightImageBackground.color = rightImage.hoveredColor + } + root.textOpacity = 0.8 + } + + onExited: { + backgroundRect.color = root.defaultColor + + if (rightImageSource) { + rightImageBackground.color = rightImage.defaultColor + } + root.textOpacity = 1 + } + + onPressedChanged: { + if (rightImageSource) { + rightImageBackground.color = pressed ? rightImage.pressedColor : entered ? rightImage.hoveredColor : rightImage.defaultColor + } + root.textOpacity = 0.7 + } + + onClicked: { + root.clicked() + } + } +} diff --git a/client/ui/qml/Controls2/CheckBoxType.qml b/client/ui/qml/Controls2/CheckBoxType.qml index 1816c58c..a26a68f1 100644 --- a/client/ui/qml/Controls2/CheckBoxType.qml +++ b/client/ui/qml/Controls2/CheckBoxType.qml @@ -11,26 +11,26 @@ CheckBox { id: root property string descriptionText - property string descriptionTextColor: AmneziaStyle.color.grey - property string descriptionTextDisabledColor: AmneziaStyle.color.greyDisabled + property string descriptionTextColor: AmneziaStyle.color.mutedGray + property string descriptionTextDisabledColor: AmneziaStyle.color.charcoalGray - property string textColor: AmneziaStyle.color.white - property string textDisabledColor: AmneziaStyle.color.grey + property string textColor: AmneziaStyle.color.paleGray + property string textDisabledColor: AmneziaStyle.color.mutedGray - property string hoveredColor: AmneziaStyle.color.blackHovered + property string hoveredColor: AmneziaStyle.color.barelyTranslucentWhite property string defaultColor: AmneziaStyle.color.transparent - property string pressedColor: AmneziaStyle.color.blackPressed + property string pressedColor: AmneziaStyle.color.barelyTranslucentWhite - property string defaultBorderColor: AmneziaStyle.color.white - property string checkedBorderColor: AmneziaStyle.color.orange - property string checkedBorderDisabledColor: AmneziaStyle.color.brownDark + property string defaultBorderColor: AmneziaStyle.color.paleGray + property string checkedBorderColor: AmneziaStyle.color.goldenApricot + property string checkedBorderDisabledColor: AmneziaStyle.color.deepBrown - property string borderFocusedColor: AmneziaStyle.color.white + property string borderFocusedColor: AmneziaStyle.color.paleGray - property string checkedImageColor: AmneziaStyle.color.orange - property string pressedImageColor: AmneziaStyle.color.orangeDark + property string checkedImageColor: AmneziaStyle.color.goldenApricot + property string pressedImageColor: AmneziaStyle.color.burntOrange property string defaultImageColor: AmneziaStyle.color.transparent - property string checkedDisabledImageColor: AmneziaStyle.color.brownLight + property string checkedDisabledImageColor: AmneziaStyle.color.mutedBrown property string imageSource: "qrc:/images/controls/check.svg" diff --git a/client/ui/qml/Controls2/DividerType.qml b/client/ui/qml/Controls2/DividerType.qml index a6dec6fb..2eb535ec 100644 --- a/client/ui/qml/Controls2/DividerType.qml +++ b/client/ui/qml/Controls2/DividerType.qml @@ -10,5 +10,5 @@ Rectangle { Layout.rightMargin: 16 height: 1 - color: AmneziaStyle.color.greyDark + color: AmneziaStyle.color.slateGray } diff --git a/client/ui/qml/Controls2/DrawerType2.qml b/client/ui/qml/Controls2/DrawerType2.qml index 0611fb12..6647bc88 100644 --- a/client/ui/qml/Controls2/DrawerType2.qml +++ b/client/ui/qml/Controls2/DrawerType2.qml @@ -21,8 +21,8 @@ Item { property Component collapsedContent property Component expandedContent - property string defaultColor: AmneziaStyle.color.blackLight - property string borderColor: AmneziaStyle.color.greyDark + property string defaultColor: AmneziaStyle.color.onyxBlack + property string borderColor: AmneziaStyle.color.slateGray property real expandedHeight property real collapsedHeight: 0 diff --git a/client/ui/qml/Controls2/DropDownType.qml b/client/ui/qml/Controls2/DropDownType.qml index 437c5146..906cfffe 100644 --- a/client/ui/qml/Controls2/DropDownType.qml +++ b/client/ui/qml/Controls2/DropDownType.qml @@ -11,31 +11,31 @@ Item { id: root property string text - property string textColor: AmneziaStyle.color.white - property string textDisabledColor: AmneziaStyle.color.grey + property string textColor: AmneziaStyle.color.paleGray + property string textDisabledColor: AmneziaStyle.color.mutedGray property int textMaximumLineCount: 2 property int textElide: Qt.ElideRight property string descriptionText - property string descriptionTextColor: AmneziaStyle.color.grey - property string descriptionTextDisabledColor: AmneziaStyle.color.greyDisabled + property string descriptionTextColor: AmneziaStyle.color.mutedGray + property string descriptionTextDisabledColor: AmneziaStyle.color.charcoalGray property string headerText property string headerBackButtonImage property var rootButtonClickedFunction property string rootButtonImage: "qrc:/images/controls/chevron-down.svg" - property string rootButtonImageColor: AmneziaStyle.color.white - property string rootButtonBackgroundColor: AmneziaStyle.color.blackLight - property string rootButtonBackgroundHoveredColor: AmneziaStyle.color.blackLight - property string rootButtonBackgroundPressedColor: AmneziaStyle.color.blackLight + property string rootButtonImageColor: AmneziaStyle.color.paleGray + property string rootButtonBackgroundColor: AmneziaStyle.color.onyxBlack + property string rootButtonBackgroundHoveredColor: AmneziaStyle.color.onyxBlack + property string rootButtonBackgroundPressedColor: AmneziaStyle.color.onyxBlack - property string borderFocusedColor: AmneziaStyle.color.white + property string borderFocusedColor: AmneziaStyle.color.paleGray property int borderFocusedWidth: 1 - property string rootButtonHoveredBorderColor: AmneziaStyle.color.greyDisabled - property string rootButtonDefaultBorderColor: AmneziaStyle.color.greyDark - property string rootButtonPressedBorderColor: AmneziaStyle.color.white + property string rootButtonHoveredBorderColor: AmneziaStyle.color.charcoalGray + property string rootButtonDefaultBorderColor: AmneziaStyle.color.slateGray + property string rootButtonPressedBorderColor: AmneziaStyle.color.paleGray property int rootButtonTextLeftMargins: 16 property int rootButtonTextTopMargin: 16 diff --git a/client/ui/qml/Controls2/Header2Type.qml b/client/ui/qml/Controls2/Header2Type.qml index 4c8cb79b..c435cbe2 100644 --- a/client/ui/qml/Controls2/Header2Type.qml +++ b/client/ui/qml/Controls2/Header2Type.qml @@ -39,7 +39,7 @@ Item { implicitHeight: 40 image: root.actionButtonImage - imageColor: AmneziaStyle.color.white + imageColor: AmneziaStyle.color.paleGray visible: image ? true : false @@ -59,7 +59,7 @@ Item { text: root.descriptionText - color: AmneziaStyle.color.grey + color: AmneziaStyle.color.mutedGray visible: root.descriptionText !== "" } diff --git a/client/ui/qml/Controls2/HeaderType.qml b/client/ui/qml/Controls2/HeaderType.qml index 60cb5b8a..f1cafbff 100644 --- a/client/ui/qml/Controls2/HeaderType.qml +++ b/client/ui/qml/Controls2/HeaderType.qml @@ -48,7 +48,7 @@ Item { Layout.alignment: Qt.AlignRight image: root.actionButtonImage - imageColor: AmneziaStyle.color.white + imageColor: AmneziaStyle.color.paleGray visible: image ? true : false @@ -68,7 +68,7 @@ Item { text: root.descriptionText - color: AmneziaStyle.color.grey + color: AmneziaStyle.color.mutedGray visible: root.descriptionText !== "" } diff --git a/client/ui/qml/Controls2/HorizontalRadioButton.qml b/client/ui/qml/Controls2/HorizontalRadioButton.qml index addda1ab..1ac1cd30 100644 --- a/client/ui/qml/Controls2/HorizontalRadioButton.qml +++ b/client/ui/qml/Controls2/HorizontalRadioButton.qml @@ -9,19 +9,19 @@ import "TextTypes" RadioButton { id: root - property string hoveredColor: AmneziaStyle.color.blackHovered + property string hoveredColor: AmneziaStyle.color.barelyTranslucentWhite property string defaultColor: AmneziaStyle.color.transparent property string checkedColor: AmneziaStyle.color.transparent property string disabledColor: AmneziaStyle.color.transparent - property string textColor: AmneziaStyle.color.white - property string textDisabledColor: AmneziaStyle.color.grey + property string textColor: AmneziaStyle.color.paleGray + property string textDisabledColor: AmneziaStyle.color.mutedGray - property string pressedBorderColor: AmneziaStyle.color.greyDisabled - property string checkedBorderColor: AmneziaStyle.color.orange + property string pressedBorderColor: AmneziaStyle.color.charcoalGray + property string checkedBorderColor: AmneziaStyle.color.goldenApricot property string defaultBodredColor: AmneziaStyle.color.transparent - property string checkedDisabledBorderColor: AmneziaStyle.color.brownLight - property string borderFocusedColor: AmneziaStyle.color.white + property string checkedDisabledBorderColor: AmneziaStyle.color.mutedBrown + property string borderFocusedColor: AmneziaStyle.color.paleGray property int borderWidth: 0 implicitWidth: content.implicitWidth diff --git a/client/ui/qml/Controls2/ImageButtonType.qml b/client/ui/qml/Controls2/ImageButtonType.qml index 7a47050c..fffb6d84 100644 --- a/client/ui/qml/Controls2/ImageButtonType.qml +++ b/client/ui/qml/Controls2/ImageButtonType.qml @@ -9,18 +9,18 @@ Button { property string image - property string hoveredColor: AmneziaStyle.color.blackHovered + property string hoveredColor: AmneziaStyle.color.translucentWhite property string defaultColor: AmneziaStyle.color.transparent - property string pressedColor: AmneziaStyle.color.blackPressed - property string disableColor: AmneziaStyle.color.greyDark + property string pressedColor: AmneziaStyle.color.sheerWhite + property string disableColor: AmneziaStyle.color.slateGray - property string imageColor: AmneziaStyle.color.grey - property string disableImageColor: AmneziaStyle.color.greyDark + property string imageColor: AmneziaStyle.color.mutedGray + property string disableImageColor: AmneziaStyle.color.slateGray property alias backgroundColor: background.color property alias backgroundRadius: background.radius - property string borderFocusedColor: AmneziaStyle.color.white + property string borderFocusedColor: AmneziaStyle.color.paleGray property int borderFocusedWidth: 1 hoverEnabled: true diff --git a/client/ui/qml/Controls2/LabelWithButtonType.qml b/client/ui/qml/Controls2/LabelWithButtonType.qml index 9a55e521..41faf108 100644 --- a/client/ui/qml/Controls2/LabelWithButtonType.qml +++ b/client/ui/qml/Controls2/LabelWithButtonType.qml @@ -20,22 +20,23 @@ Item { property string buttonImageSource property string rightImageSource property string leftImageSource - property bool isLeftImageHoverEnabled: true //todo separete this qml file to 3 + property bool isLeftImageHoverEnabled: true + property bool isSmallLeftImage: false property alias rightButton: rightImage property alias eyeButton: eyeImage property FlickableType parentFlickable - property string textColor: AmneziaStyle.color.white - property string textDisabledColor: AmneziaStyle.color.grey - property string descriptionColor: AmneziaStyle.color.grey - property string descriptionDisabledColor: AmneziaStyle.color.greyDisabled + property string textColor: AmneziaStyle.color.paleGray + property string textDisabledColor: AmneziaStyle.color.mutedGray + property string descriptionColor: AmneziaStyle.color.mutedGray + property string descriptionDisabledColor: AmneziaStyle.color.charcoalGray property real textOpacity: 1.0 - property string borderFocusedColor: AmneziaStyle.color.white + property string borderFocusedColor: AmneziaStyle.color.paleGray property int borderFocusedWidth: 1 - property string rightImageColor: AmneziaStyle.color.white + property string rightImageColor: AmneziaStyle.color.paleGray property bool descriptionOnTop: false property bool hideDescription: true @@ -114,9 +115,9 @@ Item { visible: leftImageSource ? true : false - Layout.preferredHeight: rightImageSource || !isLeftImageHoverEnabled ? leftImage.implicitHeight : 56 - Layout.preferredWidth: rightImageSource || !isLeftImageHoverEnabled ? leftImage.implicitWidth : 56 - Layout.rightMargin: rightImageSource || !isLeftImageHoverEnabled ? 16 : 0 + Layout.preferredHeight: (rightImageSource || !isLeftImageHoverEnabled || isSmallLeftImage) ? 40 : 56 + Layout.preferredWidth: (rightImageSource || !isLeftImageHoverEnabled || isSmallLeftImage)? 40 : 56 + Layout.rightMargin: isSmallLeftImage ? 8 : (rightImageSource || !isLeftImageHoverEnabled) ? 16 : 0 radius: 12 color: AmneziaStyle.color.transparent diff --git a/client/ui/qml/Controls2/LabelWithImageType.qml b/client/ui/qml/Controls2/LabelWithImageType.qml new file mode 100644 index 00000000..57d60d8f --- /dev/null +++ b/client/ui/qml/Controls2/LabelWithImageType.qml @@ -0,0 +1,38 @@ +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts + +import Style 1.0 + +import "TextTypes" + +RowLayout { + property string imageSource + property string leftText + property var rightText + property bool isRightTextUndefined: rightText === undefined + + visible: !isRightTextUndefined + + Image { + Layout.preferredHeight: 18 + Layout.preferredWidth: 18 + source: imageSource + } + + ListItemTitleType { + Layout.fillWidth: true + Layout.rightMargin: 10 + Layout.alignment: Qt.AlignRight + + text: leftText + } + + ParagraphTextType { + visible: rightText !== "" + + Layout.alignment: Qt.AlignLeft + + text: isRightTextUndefined ? "" : rightText + } +} diff --git a/client/ui/qml/Controls2/ListViewWithRadioButtonType.qml b/client/ui/qml/Controls2/ListViewWithRadioButtonType.qml index 67118913..f7b777a7 100644 --- a/client/ui/qml/Controls2/ListViewWithRadioButtonType.qml +++ b/client/ui/qml/Controls2/ListViewWithRadioButtonType.qml @@ -105,8 +105,8 @@ ListView { indicator: Rectangle { width: parent.width - 1 height: parent.height - color: radioButton.hovered ? AmneziaStyle.color.greyDark : AmneziaStyle.color.blackLight - border.color: radioButton.focus ? AmneziaStyle.color.white : AmneziaStyle.color.transparent + color: radioButton.hovered ? AmneziaStyle.color.slateGray : AmneziaStyle.color.onyxBlack + border.color: radioButton.focus ? AmneziaStyle.color.paleGray : AmneziaStyle.color.transparent border.width: radioButton.focus ? 1 : 0 Behavior on color { diff --git a/client/ui/qml/Controls2/PopupType.qml b/client/ui/qml/Controls2/PopupType.qml index 0a6e6914..bd4aa4fb 100644 --- a/client/ui/qml/Controls2/PopupType.qml +++ b/client/ui/qml/Controls2/PopupType.qml @@ -84,11 +84,11 @@ Popup { implicitHeight: 32 defaultColor: "white" - hoveredColor: AmneziaStyle.color.whiteHovered - pressedColor: AmneziaStyle.color.whiteHovered - disabledColor: AmneziaStyle.color.greyDisabled + hoveredColor: AmneziaStyle.color.lightGray + pressedColor: AmneziaStyle.color.lightGray + disabledColor: AmneziaStyle.color.charcoalGray - textColor: AmneziaStyle.color.black + textColor: AmneziaStyle.color.midnightBlack borderWidth: 0 text: qsTr("Close") diff --git a/client/ui/qml/Controls2/ProgressBarType.qml b/client/ui/qml/Controls2/ProgressBarType.qml index 0ae63dc3..83e49771 100644 --- a/client/ui/qml/Controls2/ProgressBarType.qml +++ b/client/ui/qml/Controls2/ProgressBarType.qml @@ -10,14 +10,14 @@ ProgressBar { implicitHeight: 4 background: Rectangle { - color: AmneziaStyle.color.brown + color: AmneziaStyle.color.richBrown } contentItem: Item { Rectangle { width: root.visualPosition * parent.width height: parent.height - color: AmneziaStyle.color.orange + color: AmneziaStyle.color.goldenApricot } } } diff --git a/client/ui/qml/Controls2/SwitcherType.qml b/client/ui/qml/Controls2/SwitcherType.qml index 6bf430de..43c35778 100644 --- a/client/ui/qml/Controls2/SwitcherType.qml +++ b/client/ui/qml/Controls2/SwitcherType.qml @@ -10,29 +10,29 @@ Switch { id: root property alias descriptionText: description.text - property string descriptionTextColor: AmneziaStyle.color.grey - property string descriptionTextDisabledColor: AmneziaStyle.color.greyDisabled + property string descriptionTextColor: AmneziaStyle.color.mutedGray + property string descriptionTextDisabledColor: AmneziaStyle.color.charcoalGray - property string textColor: AmneziaStyle.color.white - property string textDisabledColor: AmneziaStyle.color.grey + property string textColor: AmneziaStyle.color.paleGray + property string textDisabledColor: AmneziaStyle.color.mutedGray - property string checkedIndicatorColor: AmneziaStyle.color.brown + property string checkedIndicatorColor: AmneziaStyle.color.richBrown property string defaultIndicatorColor: AmneziaStyle.color.transparent - property string checkedDisabledIndicatorColor: AmneziaStyle.color.brownDark + property string checkedDisabledIndicatorColor: AmneziaStyle.color.deepBrown - property string borderFocusedColor: AmneziaStyle.color.white + property string borderFocusedColor: AmneziaStyle.color.paleGray property int borderFocusedWidth: 1 - property string checkedIndicatorBorderColor: AmneziaStyle.color.brown - property string defaultIndicatorBorderColor: AmneziaStyle.color.greyDisabled - property string checkedDisabledIndicatorBorderColor: AmneziaStyle.color.brownDark + property string checkedIndicatorBorderColor: AmneziaStyle.color.richBrown + property string defaultIndicatorBorderColor: AmneziaStyle.color.charcoalGray + property string checkedDisabledIndicatorBorderColor: AmneziaStyle.color.deepBrown - property string checkedInnerCircleColor: AmneziaStyle.color.orange - property string defaultInnerCircleColor: AmneziaStyle.color.white - property string checkedDisabledInnerCircleColor: AmneziaStyle.color.brownLight - property string defaultDisabledInnerCircleColor: AmneziaStyle.color.greyDisabled + property string checkedInnerCircleColor: AmneziaStyle.color.goldenApricot + property string defaultInnerCircleColor: AmneziaStyle.color.paleGray + property string checkedDisabledInnerCircleColor: AmneziaStyle.color.mutedBrown + property string defaultDisabledInnerCircleColor: AmneziaStyle.color.charcoalGray - property string hoveredIndicatorBackgroundColor: AmneziaStyle.color.blackHovered + property string hoveredIndicatorBackgroundColor: AmneziaStyle.color.translucentWhite property string defaultIndicatorBackgroundColor: AmneziaStyle.color.transparent hoverEnabled: enabled ? true : false @@ -102,8 +102,7 @@ Switch { contentItem: ColumnLayout { id: content - anchors.top: parent.top - anchors.bottom: parent.bottom + anchors.verticalCenter: parent.verticalCenter anchors.left: parent.left ListItemTitleType { diff --git a/client/ui/qml/Controls2/TabButtonType.qml b/client/ui/qml/Controls2/TabButtonType.qml index 5f34aaf4..d57ff3a0 100644 --- a/client/ui/qml/Controls2/TabButtonType.qml +++ b/client/ui/qml/Controls2/TabButtonType.qml @@ -6,13 +6,13 @@ import Style 1.0 TabButton { id: root - property string hoveredColor: AmneziaStyle.color.brown - property string defaultColor: AmneziaStyle.color.greyDark - property string selectedColor: AmneziaStyle.color.orange + property string hoveredColor: AmneziaStyle.color.richBrown + property string defaultColor: AmneziaStyle.color.slateGray + property string selectedColor: AmneziaStyle.color.goldenApricot - property string textColor: AmneziaStyle.color.white + property string textColor: AmneziaStyle.color.paleGray - property string borderFocusedColor: AmneziaStyle.color.white + property string borderFocusedColor: AmneziaStyle.color.paleGray property int borderFocusedWidth: 1 property bool isSelected: false diff --git a/client/ui/qml/Controls2/TabImageButtonType.qml b/client/ui/qml/Controls2/TabImageButtonType.qml index 4484f8e4..abe544aa 100644 --- a/client/ui/qml/Controls2/TabImageButtonType.qml +++ b/client/ui/qml/Controls2/TabImageButtonType.qml @@ -6,15 +6,15 @@ import Style 1.0 TabButton { id: root - property string hoveredColor: AmneziaStyle.color.brown - property string defaultColor: AmneziaStyle.color.white - property string selectedColor: AmneziaStyle.color.orange + property string hoveredColor: AmneziaStyle.color.richBrown + property string defaultColor: AmneziaStyle.color.paleGray + property string selectedColor: AmneziaStyle.color.goldenApricot property string image property bool isSelected: false - property string borderFocusedColor: AmneziaStyle.color.white + property string borderFocusedColor: AmneziaStyle.color.paleGray property int borderFocusedWidth: 1 property var clickedFunc diff --git a/client/ui/qml/Controls2/TextAreaType.qml b/client/ui/qml/Controls2/TextAreaType.qml index db84ba61..9359fa16 100644 --- a/client/ui/qml/Controls2/TextAreaType.qml +++ b/client/ui/qml/Controls2/TextAreaType.qml @@ -11,12 +11,12 @@ Rectangle { property alias textArea: textArea property alias textAreaText: textArea.text - property string borderHoveredColor: AmneziaStyle.color.greyDisabled - property string borderNormalColor: AmneziaStyle.color.greyDark - property string borderFocusedColor: AmneziaStyle.color.white + property string borderHoveredColor: AmneziaStyle.color.charcoalGray + property string borderNormalColor: AmneziaStyle.color.slateGray + property string borderFocusedColor: AmneziaStyle.color.paleGray height: 148 - color: AmneziaStyle.color.blackLight + color: AmneziaStyle.color.onyxBlack border.width: 1 border.color: getBorderColor(borderNormalColor) radius: 16 @@ -54,10 +54,10 @@ Rectangle { anchors.topMargin: 16 anchors.bottomMargin: 16 - color: AmneziaStyle.color.white - selectionColor: AmneziaStyle.color.brown - selectedTextColor: AmneziaStyle.color.white - placeholderTextColor: AmneziaStyle.color.grey + color: AmneziaStyle.color.paleGray + selectionColor: AmneziaStyle.color.richBrown + selectedTextColor: AmneziaStyle.color.paleGray + placeholderTextColor: AmneziaStyle.color.mutedGray font.pixelSize: 16 font.weight: Font.Medium diff --git a/client/ui/qml/Controls2/TextAreaWithFooterType.qml b/client/ui/qml/Controls2/TextAreaWithFooterType.qml new file mode 100644 index 00000000..102929e2 --- /dev/null +++ b/client/ui/qml/Controls2/TextAreaWithFooterType.qml @@ -0,0 +1,183 @@ +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts + +import Style 1.0 + +import "TextTypes" + +Rectangle { + id: root + + property string placeholderText + property string text + property string headerText + property alias textArea: textArea + property alias textAreaText: textArea.text + + property string borderHoveredColor: AmneziaStyle.color.charcoalGray + property string borderNormalColor: AmneziaStyle.color.slateGray + property string borderFocusedColor: AmneziaStyle.color.paleGray + + property string firstButtonImage + property string secondButtonImage + + property var firstButtonClickedFunc + property var secondButtonClickedFunc + + height: 148 + color: AmneziaStyle.color.onyxBlack + border.width: 1 + border.color: getBorderColor(borderNormalColor) + radius: 16 + + property FlickableType parentFlickable: null + onFocusChanged: { + if (root.activeFocus) { + if (root.parentFlickable) { + root.parentFlickable.ensureVisible(root) + } + } + } + + MouseArea { + id: parentMouse + anchors.fill: parent + cursorShape: Qt.IBeamCursor + onClicked: textArea.forceActiveFocus() + hoverEnabled: true + + ColumnLayout { + anchors.fill: parent + anchors.margins: 16 + spacing: 0 + + LabelTextType { + Layout.fillWidth: true + text: root.headerText + } + + TextArea { + id: textArea + + Layout.fillWidth: true + Layout.fillHeight: true + + leftPadding: 0 + Layout.bottomMargin: 16 + + color: AmneziaStyle.color.paleGray + selectionColor: AmneziaStyle.color.richBrown + selectedTextColor: AmneziaStyle.color.paleGray + placeholderTextColor: AmneziaStyle.color.mutedGray + + font.pixelSize: 16 + font.weight: Font.Medium + font.family: "PT Root UI VF" + + placeholderText: root.placeholderText + text: root.text + + + KeyNavigation.tab: firstButton + + onCursorVisibleChanged: { + if (textArea.cursorVisible) { + fl.interactive = true + } else { + fl.interactive = false + } + } + + wrapMode: Text.Wrap + + MouseArea { + id: textAreaMouse + anchors.fill: parent + acceptedButtons: Qt.RightButton + hoverEnabled: true + onClicked: { + fl.interactive = true + contextMenu.open() + } + } + + onFocusChanged: { + root.border.color = getBorderColor(borderNormalColor) + } + + ContextMenuType { + id: contextMenu + textObj: textArea + } + } + + RowLayout { + Layout.fillWidth: true + Layout.leftMargin: -8 + spacing: 0 + ImageButtonType { + id: firstButton + visible: root.firstButtonImage !== "" + + imageColor: AmneziaStyle.color.paleGray + + image: root.firstButtonImage + onClicked: function() { + if (root.firstButtonClickedFunc && typeof root.firstButtonClickedFunc === "function") { + root.firstButtonClickedFunc() + } + } + } + + ImageButtonType { + id: secondButton + visible: root.secondButtonImage !== "" + + imageColor: AmneziaStyle.color.paleGray + + image: root.secondButtonImage + onClicked: function() { + if (root.secondButtonClickedFunc && typeof root.secondButtonClickedFunc === "function") { + root.secondButtonClickedFunc() + } + } + } + + Item { + Layout.fillWidth: true + } + + ImageButtonType { + id: resetButton + imageColor: AmneziaStyle.color.paleGray + + visible: root.textAreaText !== "" + image: "qrc:/images/controls/close.svg" + + onClicked: function() { + root.textAreaText = "" + textArea.focus = true + } + } + } + } + + onPressed: { + root.border.color = getBorderColor(borderFocusedColor) + } + + onExited: { + root.border.color = getBorderColor(borderNormalColor) + } + + onEntered: { + root.border.color = getBorderColor(borderHoveredColor) + } + } + + + function getBorderColor(noneFocusedColor) { + return textArea.focus ? root.borderFocusedColor : noneFocusedColor + } +} diff --git a/client/ui/qml/Controls2/TextFieldWithHeaderType.qml b/client/ui/qml/Controls2/TextFieldWithHeaderType.qml index 7ab8f9e3..4ec0976b 100644 --- a/client/ui/qml/Controls2/TextFieldWithHeaderType.qml +++ b/client/ui/qml/Controls2/TextFieldWithHeaderType.qml @@ -10,8 +10,8 @@ Item { id: root property string headerText - property string headerTextDisabledColor: AmneziaStyle.color.greyDisabled - property string headerTextColor: AmneziaStyle.color.grey + property string headerTextDisabledColor: AmneziaStyle.color.charcoalGray + property string headerTextColor: AmneziaStyle.color.mutedGray property alias errorText: errorField.text property bool checkEmptyText: false @@ -23,18 +23,18 @@ Item { property alias textField: textField property alias textFieldText: textField.text - property string textFieldTextColor: AmneziaStyle.color.white - property string textFieldTextDisabledColor: AmneziaStyle.color.grey + property string textFieldTextColor: AmneziaStyle.color.paleGray + property string textFieldTextDisabledColor: AmneziaStyle.color.mutedGray property string textFieldPlaceholderText property bool textFieldEditable: true - property string borderColor: AmneziaStyle.color.greyDark - property string borderFocusedColor: AmneziaStyle.color.white + property string borderColor: AmneziaStyle.color.slateGray + property string borderFocusedColor: AmneziaStyle.color.paleGray - property string backgroundColor: AmneziaStyle.color.blackLight + property string backgroundColor: AmneziaStyle.color.onyxBlack property string backgroundDisabledColor: AmneziaStyle.color.transparent - property string bgBorderHoveredColor: AmneziaStyle.color.greyDisabled + property string bgBorderHoveredColor: AmneziaStyle.color.charcoalGray implicitWidth: content.implicitWidth implicitHeight: content.implicitHeight @@ -92,10 +92,10 @@ Item { inputMethodHints: Qt.ImhNoAutoUppercase | Qt.ImhSensitiveData | Qt.ImhNoPredictiveText placeholderText: root.textFieldPlaceholderText - placeholderTextColor: AmneziaStyle.color.greyDisabled + placeholderTextColor: AmneziaStyle.color.charcoalGray - selectionColor: AmneziaStyle.color.brown - selectedTextColor: AmneziaStyle.color.white + selectionColor: AmneziaStyle.color.richBrown + selectedTextColor: AmneziaStyle.color.paleGray font.pixelSize: 16 font.weight: 400 @@ -149,7 +149,9 @@ Item { text: root.errorText visible: root.errorText !== "" - color: AmneziaStyle.color.red + color: AmneziaStyle.color.vibrantRed + + Layout.fillWidth: true } } diff --git a/client/ui/qml/Controls2/TextTypes/ButtonTextType.qml b/client/ui/qml/Controls2/TextTypes/ButtonTextType.qml index 0bf5b203..28056758 100644 --- a/client/ui/qml/Controls2/TextTypes/ButtonTextType.qml +++ b/client/ui/qml/Controls2/TextTypes/ButtonTextType.qml @@ -6,7 +6,7 @@ Text { lineHeight: 24 lineHeightMode: Text.FixedHeight - color: AmneziaStyle.color.white + color: AmneziaStyle.color.paleGray font.pixelSize: 16 font.weight: 600 font.family: "PT Root UI VF" diff --git a/client/ui/qml/Controls2/TextTypes/CaptionTextType.qml b/client/ui/qml/Controls2/TextTypes/CaptionTextType.qml index 4b480154..ba511289 100644 --- a/client/ui/qml/Controls2/TextTypes/CaptionTextType.qml +++ b/client/ui/qml/Controls2/TextTypes/CaptionTextType.qml @@ -6,7 +6,7 @@ Text { lineHeight: 16 + LanguageModel.getLineHeightAppend() lineHeightMode: Text.FixedHeight - color: AmneziaStyle.color.black + color: AmneziaStyle.color.midnightBlack font.pixelSize: 13 font.weight: 400 font.family: "PT Root UI VF" diff --git a/client/ui/qml/Controls2/TextTypes/Header1TextType.qml b/client/ui/qml/Controls2/TextTypes/Header1TextType.qml index fa4aaa4e..40a0b35e 100644 --- a/client/ui/qml/Controls2/TextTypes/Header1TextType.qml +++ b/client/ui/qml/Controls2/TextTypes/Header1TextType.qml @@ -6,7 +6,7 @@ Text { lineHeight: 38 + LanguageModel.getLineHeightAppend() lineHeightMode: Text.FixedHeight - color: AmneziaStyle.color.white + color: AmneziaStyle.color.paleGray font.pixelSize: 32 font.weight: 700 font.family: "PT Root UI VF" diff --git a/client/ui/qml/Controls2/TextTypes/Header2TextType.qml b/client/ui/qml/Controls2/TextTypes/Header2TextType.qml index e456c117..74412cfd 100644 --- a/client/ui/qml/Controls2/TextTypes/Header2TextType.qml +++ b/client/ui/qml/Controls2/TextTypes/Header2TextType.qml @@ -6,7 +6,7 @@ Text { lineHeight: 30 + LanguageModel.getLineHeightAppend() lineHeightMode: Text.FixedHeight - color: AmneziaStyle.color.white + color: AmneziaStyle.color.paleGray font.pixelSize: 25 font.weight: 700 font.family: "PT Root UI VF" diff --git a/client/ui/qml/Controls2/TextTypes/LabelTextType.qml b/client/ui/qml/Controls2/TextTypes/LabelTextType.qml index edad6ef9..9a9a1963 100644 --- a/client/ui/qml/Controls2/TextTypes/LabelTextType.qml +++ b/client/ui/qml/Controls2/TextTypes/LabelTextType.qml @@ -6,7 +6,7 @@ Text { lineHeight: 16 + LanguageModel.getLineHeightAppend() lineHeightMode: Text.FixedHeight - color: AmneziaStyle.color.grey + color: AmneziaStyle.color.mutedGray font.pixelSize: 13 font.weight: 400 font.family: "PT Root UI VF" diff --git a/client/ui/qml/Controls2/TextTypes/ListItemTitleType.qml b/client/ui/qml/Controls2/TextTypes/ListItemTitleType.qml index eef97c60..40cd7835 100644 --- a/client/ui/qml/Controls2/TextTypes/ListItemTitleType.qml +++ b/client/ui/qml/Controls2/TextTypes/ListItemTitleType.qml @@ -6,7 +6,7 @@ Text { lineHeight: 21.6 + LanguageModel.getLineHeightAppend() lineHeightMode: Text.FixedHeight - color: AmneziaStyle.color.white + color: AmneziaStyle.color.paleGray font.pixelSize: 18 font.weight: 400 font.family: "PT Root UI VF" diff --git a/client/ui/qml/Controls2/TextTypes/ParagraphTextType.qml b/client/ui/qml/Controls2/TextTypes/ParagraphTextType.qml index b2723007..109b2876 100644 --- a/client/ui/qml/Controls2/TextTypes/ParagraphTextType.qml +++ b/client/ui/qml/Controls2/TextTypes/ParagraphTextType.qml @@ -5,7 +5,7 @@ Text { lineHeight: 24 + LanguageModel.getLineHeightAppend() lineHeightMode: Text.FixedHeight - color: AmneziaStyle.color.white + color: AmneziaStyle.color.paleGray font.pixelSize: 16 font.weight: 400 font.family: "PT Root UI VF" diff --git a/client/ui/qml/Controls2/TextTypes/SmallTextType.qml b/client/ui/qml/Controls2/TextTypes/SmallTextType.qml index 06966c4f..6c28607a 100644 --- a/client/ui/qml/Controls2/TextTypes/SmallTextType.qml +++ b/client/ui/qml/Controls2/TextTypes/SmallTextType.qml @@ -6,7 +6,7 @@ Text { lineHeight: 20 + LanguageModel.getLineHeightAppend() lineHeightMode: Text.FixedHeight - color: AmneziaStyle.color.white + color: AmneziaStyle.color.paleGray font.pixelSize: 14 font.weight: 400 font.family: "PT Root UI VF" diff --git a/client/ui/qml/Controls2/TopCloseButtonType.qml b/client/ui/qml/Controls2/TopCloseButtonType.qml index af9f4576..1bd7fef6 100644 --- a/client/ui/qml/Controls2/TopCloseButtonType.qml +++ b/client/ui/qml/Controls2/TopCloseButtonType.qml @@ -25,7 +25,7 @@ Popup { id: button image: "qrc:/images/svg/close_black_24dp.svg" - imageColor: AmneziaStyle.color.white + imageColor: AmneziaStyle.color.paleGray implicitWidth: 40 implicitHeight: 40 diff --git a/client/ui/qml/Controls2/VerticalRadioButton.qml b/client/ui/qml/Controls2/VerticalRadioButton.qml index 04ae91a3..1a781f20 100644 --- a/client/ui/qml/Controls2/VerticalRadioButton.qml +++ b/client/ui/qml/Controls2/VerticalRadioButton.qml @@ -14,15 +14,15 @@ RadioButton { property int textElide: Qt.ElideRight property string descriptionText - property string hoveredColor: AmneziaStyle.color.blackHovered + property string hoveredColor: AmneziaStyle.color.barelyTranslucentWhite property string defaultColor: AmneziaStyle.color.transparent property string disabledColor: AmneziaStyle.color.transparent property string selectedColor: AmneziaStyle.color.transparent - property string textColor: AmneziaStyle.color.white - property string selectedTextColor: AmneziaStyle.color.orange + property string textColor: AmneziaStyle.color.paleGray + property string selectedTextColor: AmneziaStyle.color.goldenApricot - property string borderFocusedColor: AmneziaStyle.color.white + property string borderFocusedColor: AmneziaStyle.color.paleGray property int borderFocusedWidth: 1 property string imageSource @@ -139,7 +139,7 @@ RadioButton { CaptionTextType { id: description - color: AmneziaStyle.color.grey + color: AmneziaStyle.color.mutedGray text: root.descriptionText visible: root.descriptionText !== "" diff --git a/client/ui/qml/Controls2/WarningType.qml b/client/ui/qml/Controls2/WarningType.qml index 6d30fcb3..24e5ecad 100644 --- a/client/ui/qml/Controls2/WarningType.qml +++ b/client/ui/qml/Controls2/WarningType.qml @@ -10,9 +10,9 @@ import "TextTypes" Rectangle { id: root - property string textColor: AmneziaStyle.color.white - property string backGroundColor: AmneziaStyle.color.blackLight - property string imageColor: AmneziaStyle.color.white + property string textColor: AmneziaStyle.color.paleGray + property string backGroundColor: AmneziaStyle.color.onyxBlack + property string imageColor: AmneziaStyle.color.paleGray property string textString property int textFormat: Text.PlainText diff --git a/client/ui/qml/Modules/Style/AmneziaStyle.qml b/client/ui/qml/Modules/Style/AmneziaStyle.qml index 7f1850aa..c0038246 100644 --- a/client/ui/qml/Modules/Style/AmneziaStyle.qml +++ b/client/ui/qml/Modules/Style/AmneziaStyle.qml @@ -5,22 +5,22 @@ import QtQuick QtObject { property QtObject color: QtObject { readonly property color transparent: 'transparent' - readonly property color white: '#D7D8DB' - readonly property color whiteHovered: '#C1C2C5' - readonly property color grey: '#878B91' - readonly property color greyDisabled: '#494B50' - readonly property color greyDark: '#2C2D30' - readonly property color blackLight: '#1C1D21' - readonly property color blackHovered: '#01010114' - readonly property color blackPressed: '#0101011f' - readonly property color black: '#0E0E11' - readonly property color orange: '#FBB26A' - readonly property color orangeDark: '#A85809' - readonly property color brownLight: '#84603D' - readonly property color brown: '#633303' - readonly property color brownDark: '#402102' - readonly property color red: '#EB5757' - - readonly property color connectionInProgress: '#261E1A' + readonly property color paleGray: '#D7D8DB' + readonly property color lightGray: '#C1C2C5' + readonly property color mutedGray: '#878B91' + readonly property color charcoalGray: '#494B50' + readonly property color slateGray: '#2C2D30' + readonly property color onyxBlack: '#1C1D21' + readonly property color midnightBlack: '#0E0E11' + readonly property color goldenApricot: '#FBB26A' + readonly property color burntOrange: '#A85809' + readonly property color mutedBrown: '#84603D' + readonly property color richBrown: '#633303' + readonly property color deepBrown: '#402102' + readonly property color vibrantRed: '#EB5757' + readonly property color darkCharcoal: '#261E1A' + readonly property color sheerWhite: Qt.rgba(1, 1, 1, 0.12) + readonly property color translucentWhite: Qt.rgba(1, 1, 1, 0.08) + readonly property color barelyTranslucentWhite: Qt.rgba(1, 1, 1, 0.05) } -} \ No newline at end of file +} diff --git a/client/ui/qml/Pages2/PageDeinstalling.qml b/client/ui/qml/Pages2/PageDeinstalling.qml index 15633fa0..f5fdb29a 100644 --- a/client/ui/qml/Pages2/PageDeinstalling.qml +++ b/client/ui/qml/Pages2/PageDeinstalling.qml @@ -5,6 +5,7 @@ import QtQuick.Layouts import SortFilterProxyModel 0.2 import PageEnum 1.0 +import Style 1.0 import "./" import "../Controls2" diff --git a/client/ui/qml/Pages2/PageDevMenu.qml b/client/ui/qml/Pages2/PageDevMenu.qml new file mode 100644 index 00000000..5da40eff --- /dev/null +++ b/client/ui/qml/Pages2/PageDevMenu.qml @@ -0,0 +1,109 @@ +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts + +import SortFilterProxyModel 0.2 + +import PageEnum 1.0 +import Style 1.0 + +import "./" +import "../Controls2" +import "../Controls2/TextTypes" +import "../Config" +import "../Components" + +PageType { + id: root + + defaultActiveFocusItem: focusItem + + Item { + id: focusItem + KeyNavigation.tab: backButton + } + + ColumnLayout { + id: backButtonLayout + + anchors.top: parent.top + anchors.left: parent.left + anchors.right: parent.right + + anchors.topMargin: 20 + + BackButtonType { + id: backButton + // KeyNavigation.tab: removeButton + } + } + + FlickableType { + id: fl + anchors.top: backButtonLayout.bottom + anchors.bottom: parent.bottom + contentHeight: content.implicitHeight + + ColumnLayout { + id: content + + anchors.top: parent.top + anchors.left: parent.left + anchors.right: parent.right + + HeaderType { + id: header + + Layout.fillWidth: true + Layout.rightMargin: 16 + Layout.leftMargin: 16 + + headerText: "Dev menu" + } + + + TextFieldWithHeaderType { + id: passwordTextField + + Layout.fillWidth: true + Layout.topMargin: 16 + Layout.rightMargin: 16 + Layout.leftMargin: 16 + parentFlickable: fl + + headerText: qsTr("Gateway endpoint") + textFieldText: SettingsController.gatewayEndpoint + + buttonImageSource: textFieldText !== "" ? "qrc:/images/controls/refresh-cw.svg" : "" + + clickedFunc: function() { + SettingsController.resetGatewayEndpoint() + } + + textField.onEditingFinished: { + textFieldText = textField.text.replace(/^\s+|\s+$/g, '') + if (textFieldText !== SettingsController.gatewayEndpoint) { + SettingsController.gatewayEndpoint = textFieldText + } + } + + // KeyNavigation.tab: saveButton + } + + SwitcherType { + id: switcher + + Layout.fillWidth: true + Layout.rightMargin: 16 + Layout.leftMargin: 16 + Layout.topMargin: 16 + + text: qsTr("Dev gateway environment") + checked: SettingsController.isDevGatewayEnv + onToggled: function() { + SettingsController.isDevGatewayEnv = checked + } + } + } + } +} diff --git a/client/ui/qml/Pages2/PageHome.qml b/client/ui/qml/Pages2/PageHome.qml index da52d535..8074337a 100644 --- a/client/ui/qml/Pages2/PageHome.qml +++ b/client/ui/qml/Pages2/PageHome.qml @@ -57,10 +57,10 @@ PageType { implicitHeight: 36 defaultColor: AmneziaStyle.color.transparent - hoveredColor: AmneziaStyle.color.blackHovered - pressedColor: AmneziaStyle.color.blackPressed - disabledColor: AmneziaStyle.color.grey - textColor: AmneziaStyle.color.grey + hoveredColor: AmneziaStyle.color.translucentWhite + pressedColor: AmneziaStyle.color.sheerWhite + disabledColor: AmneziaStyle.color.mutedGray + textColor: AmneziaStyle.color.mutedGray borderWidth: 0 visible: isLoggingEnabled ? true : false @@ -94,10 +94,10 @@ PageType { implicitHeight: 36 defaultColor: AmneziaStyle.color.transparent - hoveredColor: AmneziaStyle.color.blackHovered - pressedColor: AmneziaStyle.color.blackPressed - disabledColor: AmneziaStyle.color.grey - textColor: AmneziaStyle.color.grey + hoveredColor: AmneziaStyle.color.translucentWhite + pressedColor: AmneziaStyle.color.sheerWhite + disabledColor: AmneziaStyle.color.mutedGray + textColor: AmneziaStyle.color.mutedGray leftImageColor: AmneziaStyle.color.transparent borderWidth: 0 @@ -106,7 +106,7 @@ PageType { buttonTextLabel.font.weight: 500 property bool isSplitTunnelingEnabled: SitesModel.isTunnelingEnabled || AppSplitTunnelingModel.isTunnelingEnabled || - (ServersModel.isDefaultServerDefaultContainerHasSplitTunneling && ServersModel.getDefaultServerData("isServerFromApi")) + ServersModel.isDefaultServerDefaultContainerHasSplitTunneling text: isSplitTunnelingEnabled ? qsTr("Split tunneling enabled") : qsTr("Split tunneling disabled") @@ -243,7 +243,7 @@ PageType { hoverEnabled: false image: "qrc:/images/controls/chevron-down.svg" - imageColor: AmneziaStyle.color.white + imageColor: AmneziaStyle.color.paleGray icon.width: 18 icon.height: 18 @@ -265,11 +265,21 @@ PageType { } } - LabelTextType { - id: collapsedServerMenuDescription - Layout.bottomMargin: drawer.isCollapsed ? 44 : ServersModel.isDefaultServerFromApi ? 89 : 44 + RowLayout { Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter - text: drawer.isCollapsed ? ServersModel.defaultServerDescriptionCollapsed : ServersModel.defaultServerDescriptionExpanded + Layout.bottomMargin: drawer.isCollapsed ? 44 : ServersModel.isDefaultServerFromApi ? 89 : 44 + spacing: 0 + + Image { + Layout.rightMargin: 8 + visible: source !== "" + source: ServersModel.defaultServerImagePathCollapsed + } + + LabelTextType { + id: collapsedServerMenuDescription + text: drawer.isCollapsed ? ServersModel.defaultServerDescriptionCollapsed : ServersModel.defaultServerDescriptionExpanded + } } } @@ -304,8 +314,8 @@ PageType { DropDownType { id: containersDropDown - rootButtonImageColor: AmneziaStyle.color.black - rootButtonBackgroundColor: AmneziaStyle.color.white + rootButtonImageColor: AmneziaStyle.color.midnightBlack + rootButtonBackgroundColor: AmneziaStyle.color.paleGray rootButtonBackgroundHoveredColor: Qt.rgba(215, 216, 219, 0.8) rootButtonBackgroundPressedColor: Qt.rgba(215, 216, 219, 0.65) rootButtonHoveredBorderColor: AmneziaStyle.color.transparent @@ -314,7 +324,7 @@ PageType { rootButtonTextBottomMargin: 8 text: ServersModel.defaultServerDefaultContainerName - textColor: AmneziaStyle.color.black + textColor: AmneziaStyle.color.midnightBlack headerText: qsTr("VPN protocol") headerBackButtonImage: "qrc:/images/controls/arrow-left.svg" @@ -505,7 +515,7 @@ PageType { ImageButtonType { id: serverInfoButton image: "qrc:/images/controls/settings.svg" - imageColor: AmneziaStyle.color.white + imageColor: AmneziaStyle.color.paleGray implicitWidth: 56 implicitHeight: 56 diff --git a/client/ui/qml/Pages2/PageProtocolAwgClientSettings.qml b/client/ui/qml/Pages2/PageProtocolAwgClientSettings.qml new file mode 100644 index 00000000..2b912f18 --- /dev/null +++ b/client/ui/qml/Pages2/PageProtocolAwgClientSettings.qml @@ -0,0 +1,312 @@ +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts + +import SortFilterProxyModel 0.2 + +import PageEnum 1.0 + +import "./" +import "../Controls2" +import "../Controls2/TextTypes" +import "../Config" +import "../Components" + + +PageType { + id: root + + defaultActiveFocusItem: listview.currentItem.mtuTextField.textField + + Item { + id: focusItem + onFocusChanged: { + if (activeFocus) { + fl.ensureVisible(focusItem) + } + } + KeyNavigation.tab: backButton + } + + ColumnLayout { + id: backButtonLayout + + anchors.top: parent.top + anchors.left: parent.left + anchors.right: parent.right + + anchors.topMargin: 20 + + BackButtonType { + id: backButton + KeyNavigation.tab: listview.currentItem.mtuTextField.textField + } + } + + FlickableType { + id: fl + anchors.top: backButtonLayout.bottom + anchors.bottom: parent.bottom + contentHeight: content.implicitHeight + saveButton.implicitHeight + saveButton.anchors.bottomMargin + saveButton.anchors.topMargin + + Column { + id: content + + anchors.top: parent.top + anchors.left: parent.left + anchors.right: parent.right + + ListView { + id: listview + + width: parent.width + height: listview.contentItem.height + + clip: true + interactive: false + + model: AwgConfigModel + + delegate: Item { + id: delegateItem + implicitWidth: listview.width + implicitHeight: col.implicitHeight + + property alias mtuTextField: mtuTextField + property bool isSaveButtonEnabled: mtuTextField.errorText === "" && + junkPacketMaxSizeTextField.errorText === "" && + junkPacketMinSizeTextField.errorText === "" && + junkPacketCountTextField.errorText === "" + + ColumnLayout { + id: col + + anchors.top: parent.top + anchors.left: parent.left + anchors.right: parent.right + + anchors.leftMargin: 16 + anchors.rightMargin: 16 + + spacing: 0 + + HeaderType { + Layout.fillWidth: true + + headerText: qsTr("AmneziaWG settings") + } + + TextFieldWithHeaderType { + id: mtuTextField + Layout.fillWidth: true + Layout.topMargin: 40 + + headerText: qsTr("MTU") + textFieldText: clientMtu + textField.validator: IntValidator { bottom: 576; top: 65535 } + + textField.onEditingFinished: { + if (textFieldText !== clientMtu) { + clientMtu = textFieldText + } + } + checkEmptyText: true + KeyNavigation.tab: junkPacketCountTextField.textField + } + + TextFieldWithHeaderType { + id: junkPacketCountTextField + Layout.fillWidth: true + Layout.topMargin: 16 + + headerText: "Jc - Junk packet count" + textFieldText: clientJunkPacketCount + textField.validator: IntValidator { bottom: 0 } + parentFlickable: fl + + textField.onEditingFinished: { + if (textFieldText !== clientJunkPacketCount) { + clientJunkPacketCount = textFieldText + } + } + + checkEmptyText: true + + KeyNavigation.tab: junkPacketMinSizeTextField.textField + } + + TextFieldWithHeaderType { + id: junkPacketMinSizeTextField + Layout.fillWidth: true + Layout.topMargin: 16 + + headerText: "Jmin - Junk packet minimum size" + textFieldText: clientJunkPacketMinSize + textField.validator: IntValidator { bottom: 0 } + parentFlickable: fl + + textField.onEditingFinished: { + if (textFieldText !== clientJunkPacketMinSize) { + clientJunkPacketMinSize = textFieldText + } + } + + checkEmptyText: true + + KeyNavigation.tab: junkPacketMaxSizeTextField.textField + } + + TextFieldWithHeaderType { + id: junkPacketMaxSizeTextField + Layout.fillWidth: true + Layout.topMargin: 16 + + headerText: "Jmax - Junk packet maximum size" + textFieldText: clientJunkPacketMaxSize + textField.validator: IntValidator { bottom: 0 } + parentFlickable: fl + + textField.onEditingFinished: { + if (textFieldText !== clientJunkPacketMaxSize) { + clientJunkPacketMaxSize = textFieldText + } + } + + checkEmptyText: true + + Keys.onTabPressed: saveButton.forceActiveFocus() + } + + Header2TextType { + Layout.fillWidth: true + Layout.topMargin: 16 + + text: qsTr("Server settings") + } + + TextFieldWithHeaderType { + id: portTextField + Layout.fillWidth: true + Layout.topMargin: 8 + + enabled: false + + headerText: qsTr("Port") + textFieldText: port + } + + TextFieldWithHeaderType { + id: initPacketJunkSizeTextField + Layout.fillWidth: true + Layout.topMargin: 16 + + enabled: false + + headerText: "S1 - Init packet junk size" + textFieldText: serverInitPacketJunkSize + } + + TextFieldWithHeaderType { + id: responsePacketJunkSizeTextField + Layout.fillWidth: true + Layout.topMargin: 16 + + enabled: false + + headerText: "S2 - Response packet junk size" + textFieldText: serverResponsePacketJunkSize + } + + TextFieldWithHeaderType { + id: initPacketMagicHeaderTextField + Layout.fillWidth: true + Layout.topMargin: 16 + + enabled: false + + headerText: "H1 - Init packet magic header" + textFieldText: serverInitPacketMagicHeader + } + + TextFieldWithHeaderType { + id: responsePacketMagicHeaderTextField + Layout.fillWidth: true + Layout.topMargin: 16 + + enabled: false + + headerText: "H2 - Response packet magic header" + textFieldText: serverResponsePacketMagicHeader + } + + TextFieldWithHeaderType { + id: underloadPacketMagicHeaderTextField + Layout.fillWidth: true + Layout.topMargin: 16 + parentFlickable: fl + + enabled: false + + headerText: "H3 - Underload packet magic header" + textFieldText: serverUnderloadPacketMagicHeader + } + + TextFieldWithHeaderType { + id: transportPacketMagicHeaderTextField + Layout.fillWidth: true + Layout.topMargin: 16 + + enabled: false + + headerText: "H4 - Transport packet magic header" + textFieldText: serverTransportPacketMagicHeader + } + } + } + } + } + } + + BasicButtonType { + id: saveButton + + anchors.right: root.right + anchors.left: root.left + anchors.bottom: root.bottom + + anchors.topMargin: 24 + anchors.bottomMargin: 24 + anchors.rightMargin: 16 + anchors.leftMargin: 16 + + enabled: listview.currentItem.isSaveButtonEnabled + + text: qsTr("Save") + + Keys.onTabPressed: lastItemTabClicked(focusItem) + + clickedFunc: function() { + forceActiveFocus() + var headerText = qsTr("Save settings?") + var descriptionText = qsTr("Only the settings for this device will be changed") + var yesButtonText = qsTr("Continue") + var noButtonText = qsTr("Cancel") + + var yesButtonFunction = function() { + if (ConnectionController.isConnected && ServersModel.getDefaultServerData("defaultContainer") === ContainersModel.getProcessedContainerIndex()) { + PageController.showNotificationMessage(qsTr("Unable change settings while there is an active connection")) + return + } + + PageController.goToPage(PageEnum.PageSetupWizardInstalling); + InstallController.updateContainer(AwgConfigModel.getConfig()) + } + var noButtonFunction = function() { + if (!GC.isMobile()) { + saveButton.forceActiveFocus() + } + } + showQuestionDrawer(headerText, descriptionText, yesButtonText, noButtonText, yesButtonFunction, noButtonFunction) + } + } +} diff --git a/client/ui/qml/Pages2/PageProtocolAwgSettings.qml b/client/ui/qml/Pages2/PageProtocolAwgSettings.qml index e8a8c149..27ea66f9 100644 --- a/client/ui/qml/Pages2/PageProtocolAwgSettings.qml +++ b/client/ui/qml/Pages2/PageProtocolAwgSettings.qml @@ -5,6 +5,7 @@ import QtQuick.Layouts import SortFilterProxyModel 0.2 import PageEnum 1.0 +import Style 1.0 import "./" import "../Controls2" @@ -56,8 +57,6 @@ PageType { anchors.left: parent.left anchors.right: parent.right - enabled: ServersModel.isProcessedServerHasWriteAccess() - ListView { id: listview @@ -70,12 +69,12 @@ PageType { model: AwgConfigModel delegate: Item { - id: _delegate - + id: delegateItem implicitWidth: listview.width implicitHeight: col.implicitHeight - property alias portTextField:portTextField + property alias portTextField: portTextField + property bool isEnabled: ServersModel.isProcessedServerHasWriteAccess() ColumnLayout { id: col @@ -100,6 +99,8 @@ PageType { Layout.fillWidth: true Layout.topMargin: 40 + enabled: delegateItem.isEnabled + headerText: qsTr("Port") textFieldText: port textField.maximumLength: 5 @@ -114,27 +115,6 @@ PageType { checkEmptyText: true - KeyNavigation.tab: mtuTextField.textField - } - - TextFieldWithHeaderType { - id: mtuTextField - Layout.fillWidth: true - Layout.topMargin: 16 - - headerText: qsTr("MTU") - textFieldText: mtu - textField.validator: IntValidator { bottom: 576; top: 65535 } - - textField.onEditingFinished: { - if (textFieldText === "") { - textFieldText = "0" - } - if (textFieldText !== mtu) { - mtu = textFieldText - } - } - checkEmptyText: true KeyNavigation.tab: junkPacketCountTextField.textField } @@ -144,7 +124,7 @@ PageType { Layout.topMargin: 16 headerText: qsTr("Jc - Junk packet count") - textFieldText: junkPacketCount + textFieldText: serverJunkPacketCount textField.validator: IntValidator { bottom: 0 } parentFlickable: fl @@ -153,8 +133,8 @@ PageType { textFieldText = "0" } - if (textFieldText !== junkPacketCount) { - junkPacketCount = textFieldText + if (textFieldText !== serverJunkPacketCount) { + serverJunkPacketCount = textFieldText } } @@ -169,13 +149,13 @@ PageType { Layout.topMargin: 16 headerText: qsTr("Jmin - Junk packet minimum size") - textFieldText: junkPacketMinSize + textFieldText: serverJunkPacketMinSize textField.validator: IntValidator { bottom: 0 } parentFlickable: fl textField.onEditingFinished: { - if (textFieldText !== junkPacketMinSize) { - junkPacketMinSize = textFieldText + if (textFieldText !== serverJunkPacketMinSize) { + serverJunkPacketMinSize = textFieldText } } @@ -190,13 +170,13 @@ PageType { Layout.topMargin: 16 headerText: qsTr("Jmax - Junk packet maximum size") - textFieldText: junkPacketMaxSize + textFieldText: serverJunkPacketMaxSize textField.validator: IntValidator { bottom: 0 } parentFlickable: fl textField.onEditingFinished: { - if (textFieldText !== junkPacketMaxSize) { - junkPacketMaxSize = textFieldText + if (textFieldText !== serverJunkPacketMaxSize) { + serverJunkPacketMaxSize = textFieldText } } @@ -211,13 +191,13 @@ PageType { Layout.topMargin: 16 headerText: qsTr("S1 - Init packet junk size") - textFieldText: initPacketJunkSize + textFieldText: serverInitPacketJunkSize textField.validator: IntValidator { bottom: 0 } parentFlickable: fl textField.onEditingFinished: { - if (textFieldText !== initPacketJunkSize) { - initPacketJunkSize = textFieldText + if (textFieldText !== serverInitPacketJunkSize) { + serverInitPacketJunkSize = textFieldText } } @@ -232,13 +212,13 @@ PageType { Layout.topMargin: 16 headerText: qsTr("S2 - Response packet junk size") - textFieldText: responsePacketJunkSize + textFieldText: serverResponsePacketJunkSize textField.validator: IntValidator { bottom: 0 } parentFlickable: fl textField.onEditingFinished: { - if (textFieldText !== responsePacketJunkSize) { - responsePacketJunkSize = textFieldText + if (textFieldText !== serverResponsePacketJunkSize) { + serverResponsePacketJunkSize = textFieldText } } @@ -253,13 +233,13 @@ PageType { Layout.topMargin: 16 headerText: qsTr("H1 - Init packet magic header") - textFieldText: initPacketMagicHeader + textFieldText: serverInitPacketMagicHeader textField.validator: IntValidator { bottom: 0 } parentFlickable: fl textField.onEditingFinished: { - if (textFieldText !== initPacketMagicHeader) { - initPacketMagicHeader = textFieldText + if (textFieldText !== serverInitPacketMagicHeader) { + serverInitPacketMagicHeader = textFieldText } } @@ -274,13 +254,13 @@ PageType { Layout.topMargin: 16 headerText: qsTr("H2 - Response packet magic header") - textFieldText: responsePacketMagicHeader + textFieldText: serverResponsePacketMagicHeader textField.validator: IntValidator { bottom: 0 } parentFlickable: fl textField.onEditingFinished: { - if (textFieldText !== responsePacketMagicHeader) { - responsePacketMagicHeader = textFieldText + if (textFieldText !== serverResponsePacketMagicHeader) { + serverResponsePacketMagicHeader = textFieldText } } @@ -295,13 +275,13 @@ PageType { Layout.topMargin: 16 headerText: qsTr("H4 - Transport packet magic header") - textFieldText: transportPacketMagicHeader + textFieldText: serverTransportPacketMagicHeader textField.validator: IntValidator { bottom: 0 } parentFlickable: fl textField.onEditingFinished: { - if (textFieldText !== transportPacketMagicHeader) { - transportPacketMagicHeader = textFieldText + if (textFieldText !== serverTransportPacketMagicHeader) { + serverTransportPacketMagicHeader = textFieldText } } @@ -317,12 +297,12 @@ PageType { parentFlickable: fl headerText: qsTr("H3 - Underload packet magic header") - textFieldText: underloadPacketMagicHeader + textFieldText: serverUnderloadPacketMagicHeader textField.validator: IntValidator { bottom: 0 } textField.onEditingFinished: { - if (textFieldText !== underloadPacketMagicHeader) { - underloadPacketMagicHeader = textFieldText + if (textFieldText !== serverUnderloadPacketMagicHeader) { + serverUnderloadPacketMagicHeader = textFieldText } } @@ -355,18 +335,22 @@ PageType { Keys.onTabPressed: lastItemTabClicked(focusItem) clickedFunc: function() { - if (AwgConfigModel.isHeadersEqual(underloadPacketMagicHeaderTextField.textField.text, - transportPacketMagicHeaderTextField.textField.text, - responsePacketMagicHeaderTextField.textField.text, - initPacketMagicHeaderTextField.textField.text)) { - PageController.showErrorMessage(qsTr("The values of the H1-H4 fields must be unique")) - return - } + forceActiveFocus() - if (AwgConfigModel.isPacketSizeEqual(parseInt(initPacketJunkSizeTextField.textField.text), - parseInt(responsePacketJunkSizeTextField.textField.text))) { - PageController.showErrorMessage(qsTr("The value of the field S1 + message initiation size (148) must not equal S2 + message response size (92)")) - return + if (delegateItem.isEnabled) { + if (AwgConfigModel.isHeadersEqual(underloadPacketMagicHeaderTextField.textField.text, + transportPacketMagicHeaderTextField.textField.text, + responsePacketMagicHeaderTextField.textField.text, + initPacketMagicHeaderTextField.textField.text)) { + PageController.showErrorMessage(qsTr("The values of the H1-H4 fields must be unique")) + return + } + + if (AwgConfigModel.isPacketSizeEqual(parseInt(initPacketJunkSizeTextField.textField.text), + parseInt(responsePacketJunkSizeTextField.textField.text))) { + PageController.showErrorMessage(qsTr("The value of the field S1 + message initiation size (148) must not equal S2 + message response size (92)")) + return + } } var headerText = qsTr("Save settings?") @@ -375,8 +359,6 @@ PageType { var noButtonText = qsTr("Cancel") var yesButtonFunction = function() { - forceActiveFocus() - if (ConnectionController.isConnected && ServersModel.getDefaultServerData("defaultContainer") === ContainersModel.getProcessedContainerIndex()) { PageController.showNotificationMessage(qsTr("Unable change settings while there is an active connection")) return diff --git a/client/ui/qml/Pages2/PageProtocolCloakSettings.qml b/client/ui/qml/Pages2/PageProtocolCloakSettings.qml index 5ef5771e..5089a764 100644 --- a/client/ui/qml/Pages2/PageProtocolCloakSettings.qml +++ b/client/ui/qml/Pages2/PageProtocolCloakSettings.qml @@ -5,6 +5,7 @@ import QtQuick.Layouts import SortFilterProxyModel 0.2 import PageEnum 1.0 +import Style 1.0 import "./" import "../Controls2" diff --git a/client/ui/qml/Pages2/PageProtocolOpenVpnSettings.qml b/client/ui/qml/Pages2/PageProtocolOpenVpnSettings.qml index d2330c27..30540a93 100644 --- a/client/ui/qml/Pages2/PageProtocolOpenVpnSettings.qml +++ b/client/ui/qml/Pages2/PageProtocolOpenVpnSettings.qml @@ -295,7 +295,7 @@ PageType { Layout.fillWidth: true Layout.topMargin: 32 Layout.preferredHeight: checkboxLayout.implicitHeight - color: AmneziaStyle.color.blackLight + color: AmneziaStyle.color.onyxBlack radius: 16 Connections { diff --git a/client/ui/qml/Pages2/PageProtocolRaw.qml b/client/ui/qml/Pages2/PageProtocolRaw.qml index 1acc5b54..24853afd 100644 --- a/client/ui/qml/Pages2/PageProtocolRaw.qml +++ b/client/ui/qml/Pages2/PageProtocolRaw.qml @@ -192,9 +192,9 @@ PageType { leftPadding: 0 height: 24 - color: AmneziaStyle.color.white - selectionColor: AmneziaStyle.color.brown - selectedTextColor: AmneziaStyle.color.white + color: AmneziaStyle.color.paleGray + selectionColor: AmneziaStyle.color.richBrown + selectedTextColor: AmneziaStyle.color.paleGray font.pixelSize: 16 font.weight: Font.Medium @@ -224,7 +224,7 @@ PageType { visible: ServersModel.isProcessedServerHasWriteAccess() text: qsTr("Remove ") + ContainersModel.getProcessedContainerName() - textColor: AmneziaStyle.color.red + textColor: AmneziaStyle.color.vibrantRed Keys.onTabPressed: lastItemTabClicked(focusItem) clickedFunction: function() { diff --git a/client/ui/qml/Pages2/PageProtocolShadowSocksSettings.qml b/client/ui/qml/Pages2/PageProtocolShadowSocksSettings.qml index 2cf18544..4d3b2c4e 100644 --- a/client/ui/qml/Pages2/PageProtocolShadowSocksSettings.qml +++ b/client/ui/qml/Pages2/PageProtocolShadowSocksSettings.qml @@ -5,6 +5,7 @@ import QtQuick.Layouts import SortFilterProxyModel 0.2 import PageEnum 1.0 +import Style 1.0 import "./" import "../Controls2" diff --git a/client/ui/qml/Pages2/PageProtocolWireGuardClientSettings.qml b/client/ui/qml/Pages2/PageProtocolWireGuardClientSettings.qml new file mode 100644 index 00000000..007de5ca --- /dev/null +++ b/client/ui/qml/Pages2/PageProtocolWireGuardClientSettings.qml @@ -0,0 +1,179 @@ +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts + +import SortFilterProxyModel 0.2 + +import PageEnum 1.0 + +import "./" +import "../Controls2" +import "../Controls2/TextTypes" +import "../Config" +import "../Components" + + +PageType { + id: root + + defaultActiveFocusItem: listview.currentItem.mtuTextField.textField + + Item { + id: focusItem + onFocusChanged: { + if (activeFocus) { + fl.ensureVisible(focusItem) + } + } + KeyNavigation.tab: backButton + } + + ColumnLayout { + id: backButtonLayout + + anchors.top: parent.top + anchors.left: parent.left + anchors.right: parent.right + + anchors.topMargin: 20 + + BackButtonType { + id: backButton + KeyNavigation.tab: listview.currentItem.mtuTextField.textField + } + } + + FlickableType { + id: fl + anchors.top: backButtonLayout.bottom + anchors.bottom: parent.bottom + contentHeight: content.implicitHeight + saveButton.implicitHeight + saveButton.anchors.bottomMargin + saveButton.anchors.topMargin + + Column { + id: content + + anchors.top: parent.top + anchors.left: parent.left + anchors.right: parent.right + + ListView { + id: listview + + width: parent.width + height: listview.contentItem.height + + clip: true + interactive: false + + model: WireGuardConfigModel + + delegate: Item { + id: delegateItem + implicitWidth: listview.width + implicitHeight: col.implicitHeight + + property alias mtuTextField: mtuTextField + property bool isSaveButtonEnabled: mtuTextField.errorText === "" + + ColumnLayout { + id: col + + anchors.top: parent.top + anchors.left: parent.left + anchors.right: parent.right + + anchors.leftMargin: 16 + anchors.rightMargin: 16 + + spacing: 0 + + HeaderType { + Layout.fillWidth: true + + headerText: qsTr("WG settings") + } + + TextFieldWithHeaderType { + id: mtuTextField + Layout.fillWidth: true + Layout.topMargin: 40 + + headerText: qsTr("MTU") + textFieldText: clientMtu + textField.validator: IntValidator { bottom: 576; top: 65535 } + + textField.onEditingFinished: { + if (textFieldText !== clientMtu) { + clientMtu = textFieldText + } + } + checkEmptyText: true + KeyNavigation.tab: saveButton + } + + Header2TextType { + Layout.fillWidth: true + Layout.topMargin: 16 + + text: qsTr("Server settings") + } + + TextFieldWithHeaderType { + id: portTextField + Layout.fillWidth: true + Layout.topMargin: 8 + + enabled: false + + headerText: qsTr("Port") + textFieldText: port + } + } + } + } + } + } + + BasicButtonType { + id: saveButton + + anchors.right: root.right + anchors.left: root.left + anchors.bottom: root.bottom + + anchors.topMargin: 24 + anchors.bottomMargin: 24 + anchors.rightMargin: 16 + anchors.leftMargin: 16 + + enabled: listview.currentItem.isSaveButtonEnabled + + text: qsTr("Save") + + Keys.onTabPressed: lastItemTabClicked(focusItem) + + clickedFunc: function() { + forceActiveFocus() + var headerText = qsTr("Save settings?") + var descriptionText = qsTr("Only the settings for this device will be changed") + var yesButtonText = qsTr("Continue") + var noButtonText = qsTr("Cancel") + + var yesButtonFunction = function() { + if (ConnectionController.isConnected && ServersModel.getDefaultServerData("defaultContainer") === ContainersModel.getProcessedContainerIndex()) { + PageController.showNotificationMessage(qsTr("Unable change settings while there is an active connection")) + return + } + + PageController.goToPage(PageEnum.PageSetupWizardInstalling); + InstallController.updateContainer(WireGuardConfigModel.getConfig()) + } + var noButtonFunction = function() { + if (!GC.isMobile()) { + saveButton.forceActiveFocus() + } + } + showQuestionDrawer(headerText, descriptionText, yesButtonText, noButtonText, yesButtonFunction, noButtonFunction) + } + } +} diff --git a/client/ui/qml/Pages2/PageProtocolWireGuardSettings.qml b/client/ui/qml/Pages2/PageProtocolWireGuardSettings.qml index 4e6a851e..b5d08132 100644 --- a/client/ui/qml/Pages2/PageProtocolWireGuardSettings.qml +++ b/client/ui/qml/Pages2/PageProtocolWireGuardSettings.qml @@ -5,6 +5,7 @@ import QtQuick.Layouts import SortFilterProxyModel 0.2 import PageEnum 1.0 +import Style 1.0 import "./" import "../Controls2" @@ -71,7 +72,10 @@ PageType { } delegate: Item { + id: delegateItem + property alias focusItemId: portTextField.textField + property bool isEnabled: ServersModel.isProcessedServerHasWriteAccess() implicitWidth: listview.width implicitHeight: col.implicitHeight @@ -98,12 +102,14 @@ PageType { Layout.fillWidth: true Layout.topMargin: 40 + enabled: delegateItem.isEnabled + headerText: qsTr("Port") textFieldText: port textField.maximumLength: 5 textField.validator: IntValidator { bottom: 1; top: 65535 } - KeyNavigation.tab: mtuTextField.textField + KeyNavigation.tab: saveButton textField.onEditingFinished: { if (textFieldText !== port) { @@ -114,52 +120,41 @@ PageType { checkEmptyText: true } - TextFieldWithHeaderType { - id: mtuTextField - Layout.fillWidth: true - Layout.topMargin: 16 - - headerText: qsTr("MTU") - textFieldText: mtu - textField.validator: IntValidator { bottom: 576; top: 65535 } - - KeyNavigation.tab: saveButton - - textField.onEditingFinished: { - if (textFieldText === "") { - textFieldText = "0" - } - if (textFieldText !== mtu) { - mtu = textFieldText - } - } - checkEmptyText: true - } - BasicButtonType { id: saveButton Layout.fillWidth: true Layout.topMargin: 24 Layout.bottomMargin: 24 - enabled: mtuTextField.errorText === "" && - portTextField.errorText === "" + enabled: portTextField.errorText === "" text: qsTr("Save") Keys.onTabPressed: lastItemTabClicked(focusItem) - onClicked: { + onClicked: function() { forceActiveFocus() - if (ConnectionController.isConnected && ServersModel.getDefaultServerData("defaultContainer") === ContainersModel.getProcessedContainerIndex()) { - PageController.showNotificationMessage(qsTr("Unable change settings while there is an active connection")) - return - } + var headerText = qsTr("Save settings?") + var descriptionText = qsTr("All users with whom you shared a connection with will no longer be able to connect to it.") + var yesButtonText = qsTr("Continue") + var noButtonText = qsTr("Cancel") - PageController.goToPage(PageEnum.PageSetupWizardInstalling); - InstallController.updateContainer(WireGuardConfigModel.getConfig()) - focusItem.forceActiveFocus() + var yesButtonFunction = function() { + if (ConnectionController.isConnected && ServersModel.getDefaultServerData("defaultContainer") === ContainersModel.getProcessedContainerIndex()) { + PageController.showNotificationMessage(qsTr("Unable change settings while there is an active connection")) + return + } + + PageController.goToPage(PageEnum.PageSetupWizardInstalling); + InstallController.updateContainer(WireGuardConfigModel.getConfig()) + } + var noButtonFunction = function() { + if (!GC.isMobile()) { + saveRestartButton.forceActiveFocus() + } + } + showQuestionDrawer(headerText, descriptionText, yesButtonText, noButtonText, yesButtonFunction, noButtonFunction) } Keys.onEnterPressed: saveButton.clicked() diff --git a/client/ui/qml/Pages2/PageProtocolXraySettings.qml b/client/ui/qml/Pages2/PageProtocolXraySettings.qml index 6a8094d7..20ee1da6 100644 --- a/client/ui/qml/Pages2/PageProtocolXraySettings.qml +++ b/client/ui/qml/Pages2/PageProtocolXraySettings.qml @@ -6,6 +6,7 @@ import SortFilterProxyModel 0.2 import PageEnum 1.0 import ContainerEnum 1.0 +import Style 1.0 import "./" import "../Controls2" diff --git a/client/ui/qml/Pages2/PageServiceDnsSettings.qml b/client/ui/qml/Pages2/PageServiceDnsSettings.qml index 7d9f2df4..bb3cbf96 100644 --- a/client/ui/qml/Pages2/PageServiceDnsSettings.qml +++ b/client/ui/qml/Pages2/PageServiceDnsSettings.qml @@ -70,7 +70,7 @@ PageType { width: parent.width text: qsTr("Remove ") + ContainersModel.getProcessedContainerName() - textColor: AmneziaStyle.color.red + textColor: AmneziaStyle.color.vibrantRed Keys.onTabPressed: root.lastItemTabClicked() diff --git a/client/ui/qml/Pages2/PageServiceSftpSettings.qml b/client/ui/qml/Pages2/PageServiceSftpSettings.qml index 9b5425db..9bdbf2db 100644 --- a/client/ui/qml/Pages2/PageServiceSftpSettings.qml +++ b/client/ui/qml/Pages2/PageServiceSftpSettings.qml @@ -115,7 +115,7 @@ PageType { descriptionOnTop: true rightImageSource: "qrc:/images/controls/copy.svg" - rightImageColor: AmneziaStyle.color.white + rightImageColor: AmneziaStyle.color.paleGray clickedFunction: function() { GC.copyToClipBoard(descriptionText) @@ -139,7 +139,7 @@ PageType { KeyNavigation.tab: usernameLabel.rightButton rightImageSource: "qrc:/images/controls/copy.svg" - rightImageColor: AmneziaStyle.color.white + rightImageColor: AmneziaStyle.color.paleGray clickedFunction: function() { GC.copyToClipBoard(descriptionText) @@ -163,7 +163,7 @@ PageType { KeyNavigation.tab: passwordLabel.eyeButton rightImageSource: "qrc:/images/controls/copy.svg" - rightImageColor: AmneziaStyle.color.white + rightImageColor: AmneziaStyle.color.paleGray clickedFunction: function() { GC.copyToClipBoard(descriptionText) @@ -194,7 +194,7 @@ PageType { } rightImageSource: "qrc:/images/controls/copy.svg" - rightImageColor: AmneziaStyle.color.white + rightImageColor: AmneziaStyle.color.paleGray buttonImageSource: hideDescription ? "qrc:/images/controls/eye.svg" : "qrc:/images/controls/eye-off.svg" @@ -218,10 +218,10 @@ PageType { Layout.rightMargin: 16 defaultColor: AmneziaStyle.color.transparent - hoveredColor: AmneziaStyle.color.blackHovered - pressedColor: AmneziaStyle.color.blackPressed - disabledColor: AmneziaStyle.color.grey - textColor: AmneziaStyle.color.white + hoveredColor: AmneziaStyle.color.translucentWhite + pressedColor: AmneziaStyle.color.sheerWhite + disabledColor: AmneziaStyle.color.mutedGray + textColor: AmneziaStyle.color.paleGray borderWidth: 1 parentFlickable: fl @@ -282,10 +282,10 @@ PageType { implicitHeight: 32 defaultColor: AmneziaStyle.color.transparent - hoveredColor: AmneziaStyle.color.blackHovered - pressedColor: AmneziaStyle.color.blackPressed - disabledColor: AmneziaStyle.color.grey - textColor: AmneziaStyle.color.orange + hoveredColor: AmneziaStyle.color.translucentWhite + pressedColor: AmneziaStyle.color.sheerWhite + disabledColor: AmneziaStyle.color.mutedGray + textColor: AmneziaStyle.color.goldenApricot text: qsTr("Detailed instructions") diff --git a/client/ui/qml/Pages2/PageServiceSocksProxySettings.qml b/client/ui/qml/Pages2/PageServiceSocksProxySettings.qml index 95343f63..9d21963d 100644 --- a/client/ui/qml/Pages2/PageServiceSocksProxySettings.qml +++ b/client/ui/qml/Pages2/PageServiceSocksProxySettings.qml @@ -6,6 +6,7 @@ import SortFilterProxyModel 0.2 import PageEnum 1.0 import ContainerProps 1.0 +import Style 1.0 import "./" import "../Controls2" @@ -106,7 +107,7 @@ PageType { descriptionOnTop: true rightImageSource: "qrc:/images/controls/copy.svg" - rightImageColor: "#D7D8DB" + rightImageColor: AmneziaStyle.color.paleGray clickedFunction: function() { GC.copyToClipBoard(descriptionText) @@ -130,7 +131,7 @@ PageType { KeyNavigation.tab: usernameLabel.rightButton rightImageSource: "qrc:/images/controls/copy.svg" - rightImageColor: "#D7D8DB" + rightImageColor: AmneziaStyle.color.paleGray clickedFunction: function() { GC.copyToClipBoard(descriptionText) @@ -154,7 +155,7 @@ PageType { KeyNavigation.tab: passwordLabel.eyeButton rightImageSource: "qrc:/images/controls/copy.svg" - rightImageColor: "#D7D8DB" + rightImageColor: AmneziaStyle.color.paleGray clickedFunction: function() { GC.copyToClipBoard(descriptionText) @@ -179,7 +180,7 @@ PageType { rightButton.KeyNavigation.tab: changeSettingsButton rightImageSource: "qrc:/images/controls/copy.svg" - rightImageColor: "#D7D8DB" + rightImageColor: AmneziaStyle.color.paleGray buttonImageSource: hideDescription ? "qrc:/images/controls/eye.svg" : "qrc:/images/controls/eye-off.svg" diff --git a/client/ui/qml/Pages2/PageServiceTorWebsiteSettings.qml b/client/ui/qml/Pages2/PageServiceTorWebsiteSettings.qml index de1fefb8..946a77bb 100644 --- a/client/ui/qml/Pages2/PageServiceTorWebsiteSettings.qml +++ b/client/ui/qml/Pages2/PageServiceTorWebsiteSettings.qml @@ -83,10 +83,10 @@ PageType { } descriptionOnTop: true - textColor: AmneziaStyle.color.orange + textColor: AmneziaStyle.color.goldenApricot rightImageSource: "qrc:/images/controls/copy.svg" - rightImageColor: AmneziaStyle.color.white + rightImageColor: AmneziaStyle.color.paleGray Keys.onTabPressed: lastItemTabClicked(focusItem) diff --git a/client/ui/qml/Pages2/PageSettings.qml b/client/ui/qml/Pages2/PageSettings.qml index f8056c63..bb5ca766 100644 --- a/client/ui/qml/Pages2/PageSettings.qml +++ b/client/ui/qml/Pages2/PageSettings.qml @@ -4,6 +4,7 @@ import QtQuick.Layouts import QtQuick.Dialogs import PageEnum 1.0 +import Style 1.0 import "./" import "../Controls2" @@ -128,6 +129,26 @@ PageType { DividerType {} + LabelWithButtonType { + id: devConsole + visible: SettingsController.isDevModeEnabled + Layout.fillWidth: true + + text: qsTr("Dev console") + rightImageSource: "qrc:/images/controls/chevron-right.svg" + leftImageSource: "qrc:/images/controls/bug.svg" + + // Keys.onTabPressed: lastItemTabClicked(header) + + clickedFunction: function() { + PageController.goToPage(PageEnum.PageDevMenu) + } + } + + DividerType { + visible: SettingsController.isDevModeEnabled + } + LabelWithButtonType { id: close visible: GC.isDesktop() diff --git a/client/ui/qml/Pages2/PageSettingsAbout.qml b/client/ui/qml/Pages2/PageSettingsAbout.qml index f6fcea62..cde9ee20 100644 --- a/client/ui/qml/Pages2/PageSettingsAbout.qml +++ b/client/ui/qml/Pages2/PageSettingsAbout.qml @@ -85,7 +85,7 @@ PageType { font.pixelSize: 14 text: qsTr("Amnezia is a free and open-source application. You can support the developers if you like it.") - color: AmneziaStyle.color.white + color: AmneziaStyle.color.paleGray } ParagraphTextType { @@ -120,7 +120,7 @@ PageType { id: mailButton Layout.fillWidth: true - text: qsTr("Mail") + text: qsTr("support@amnezia.org") descriptionText: qsTr("For reviews and bug reports") leftImageSource: "qrc:/images/controls/mail.svg" @@ -128,6 +128,8 @@ PageType { parentFlickable: fl clickedFunction: function() { + GC.copyToClipBoard(text) + PageController.showNotificationMessage(qsTr("Copied")) } } @@ -163,7 +165,7 @@ PageType { parentFlickable: fl clickedFunction: function() { - Qt.openUrlExternally(qsTr("https://amnezia.org")) + Qt.openUrlExternally(LanguageModel.getCurrentSiteUrl()) } } @@ -177,7 +179,19 @@ PageType { horizontalAlignment: Text.AlignHCenter text: qsTr("Software version: %1").arg(SettingsController.getAppVersion()) - color: AmneziaStyle.color.grey + color: AmneziaStyle.color.mutedGray + + MouseArea { + property int clickCount: 0 + anchors.fill: parent + onClicked: { + if (clickCount > 10) { + SettingsController.enableDevMode() + } else { + clickCount++ + } + } + } } BasicButtonType { @@ -188,10 +202,10 @@ PageType { implicitHeight: 32 defaultColor: AmneziaStyle.color.transparent - hoveredColor: AmneziaStyle.color.blackHovered - pressedColor: AmneziaStyle.color.blackPressed - disabledColor: AmneziaStyle.color.grey - textColor: AmneziaStyle.color.orange + hoveredColor: AmneziaStyle.color.translucentWhite + pressedColor: AmneziaStyle.color.sheerWhite + disabledColor: AmneziaStyle.color.mutedGray + textColor: AmneziaStyle.color.goldenApricot text: qsTr("Check for updates") @@ -211,10 +225,10 @@ PageType { implicitHeight: 25 defaultColor: AmneziaStyle.color.transparent - hoveredColor: AmneziaStyle.color.blackHovered - pressedColor: AmneziaStyle.color.blackPressed - disabledColor: AmneziaStyle.color.grey - textColor: AmneziaStyle.color.orange + hoveredColor: AmneziaStyle.color.translucentWhite + pressedColor: AmneziaStyle.color.sheerWhite + disabledColor: AmneziaStyle.color.mutedGray + textColor: AmneziaStyle.color.goldenApricot text: qsTr("Privacy Policy") @@ -222,7 +236,7 @@ PageType { parentFlickable: fl clickedFunc: function() { - Qt.openUrlExternally("https://amnezia.org/en/policy") + Qt.openUrlExternally(LanguageModel.getCurrentSiteUrl() + "/policy") } } } diff --git a/client/ui/qml/Pages2/PageSettingsApiLanguageList.qml b/client/ui/qml/Pages2/PageSettingsApiLanguageList.qml new file mode 100644 index 00000000..234e5142 --- /dev/null +++ b/client/ui/qml/Pages2/PageSettingsApiLanguageList.qml @@ -0,0 +1,103 @@ +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts +import QtQuick.Dialogs + +import PageEnum 1.0 +import Style 1.0 + +import "./" +import "../Controls2" +import "../Controls2/TextTypes" +import "../Config" +import "../Components" + +PageType { + id: root + + ListView { + id: menuContent + + property var selectedText + + width: parent.width + height: menuContent.contentItem.height + + clip: true + interactive: false + model: ApiCountryModel + + ButtonGroup { + id: containersRadioButtonGroup + } + + delegate: Item { + implicitWidth: parent.width + implicitHeight: content.implicitHeight + + ColumnLayout { + id: content + + anchors.fill: parent + + RowLayout { + VerticalRadioButton { + id: containerRadioButton + + Layout.fillWidth: true + Layout.leftMargin: 16 + + text: countryName + + ButtonGroup.group: containersRadioButtonGroup + + imageSource: "qrc:/images/controls/download.svg" + + checked: index === ApiCountryModel.currentIndex + + onClicked: { + if (index !== ApiCountryModel.currentIndex) { + PageController.showBusyIndicator(true) + var prevIndex = ApiCountryModel.currentIndex + ApiCountryModel.currentIndex = index + if (!InstallController.updateServiceFromApi(ServersModel.defaultIndex, countryCode, countryName)) { + ApiCountryModel.currentIndex = prevIndex + } + } + } + + MouseArea { + anchors.fill: containerRadioButton + cursorShape: Qt.PointingHandCursor + enabled: false + } + + Keys.onEnterPressed: { + if (checkable) { + checked = true + } + containerRadioButton.clicked() + } + Keys.onReturnPressed: { + if (checkable) { + checked = true + } + containerRadioButton.clicked() + } + } + + Image { + Layout.rightMargin: 32 + Layout.alignment: Qt.AlignRight + + source: "qrc:/countriesFlags/images/flagKit/" + countryCode + ".svg" + } + } + + DividerType { + Layout.fillWidth: true + } + } + } + } +} diff --git a/client/ui/qml/Pages2/PageSettingsApiServerInfo.qml b/client/ui/qml/Pages2/PageSettingsApiServerInfo.qml new file mode 100644 index 00000000..f23e36d9 --- /dev/null +++ b/client/ui/qml/Pages2/PageSettingsApiServerInfo.qml @@ -0,0 +1,208 @@ +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts +import QtQuick.Dialogs + +import PageEnum 1.0 +import Style 1.0 + +import "./" +import "../Controls2" +import "../Controls2/TextTypes" +import "../Config" +import "../Components" + +PageType { + id: root + + defaultActiveFocusItem: focusItem + + FlickableType { + id: fl + anchors.top: parent.top + anchors.bottom: parent.bottom + contentHeight: content.height + + ColumnLayout { + id: content + + anchors.top: parent.top + anchors.left: parent.left + anchors.right: parent.right + + spacing: 0 + + Item { + id: focusItem +// KeyNavigation.tab: backButton + } + + LabelWithImageType { + Layout.fillWidth: true + Layout.margins: 16 + + imageSource: "qrc:/images/controls/map-pin.svg" + leftText: qsTr("For the region") + rightText: ApiServicesModel.getSelectedServiceData("region") + } + + LabelWithImageType { + Layout.fillWidth: true + Layout.margins: 16 + + imageSource: "qrc:/images/controls/tag.svg" + leftText: qsTr("Price") + rightText: ApiServicesModel.getSelectedServiceData("price") + } + + LabelWithImageType { + Layout.fillWidth: true + Layout.margins: 16 + + imageSource: "qrc:/images/controls/history.svg" + leftText: qsTr("Work period") + rightText: ApiServicesModel.getSelectedServiceData("workPeriod") + + visible: rightText !== "" + } + + LabelWithImageType { + Layout.fillWidth: true + Layout.margins: 16 + + imageSource: "qrc:/images/controls/gauge.svg" + leftText: qsTr("Speed") + rightText: ApiServicesModel.getSelectedServiceData("speed") + } + + ParagraphTextType { + Layout.fillWidth: true + Layout.rightMargin: 16 + Layout.leftMargin: 16 + + onLinkActivated: function(link) { + Qt.openUrlExternally(link) + } + textFormat: Text.RichText + text: { + var text = ApiServicesModel.getSelectedServiceData("features") + if (text === undefined) { + return "" + } + return text.replace("%1", LanguageModel.getCurrentSiteUrl()) + } + + MouseArea { + anchors.fill: parent + acceptedButtons: Qt.NoButton + cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor + } + } + + LabelWithButtonType { + id: supportUuid + Layout.fillWidth: true + + text: qsTr("Support tag") + descriptionText: SettingsController.getInstallationUuid() + + descriptionOnTop: true + +// parentFlickable: fl +// KeyNavigation.tab: passwordLabel.eyeButton + + rightImageSource: "qrc:/images/controls/copy.svg" + rightImageColor: AmneziaStyle.color.paleGray + + clickedFunction: function() { + GC.copyToClipBoard(descriptionText) + PageController.showNotificationMessage(qsTr("Copied")) + if (!GC.isMobile()) { + this.rightButton.forceActiveFocus() + } + } + } + + BasicButtonType { + id: resetButton + Layout.alignment: Qt.AlignHCenter + Layout.topMargin: 24 + Layout.bottomMargin: 16 + Layout.leftMargin: 8 + implicitHeight: 32 + + defaultColor: "transparent" + hoveredColor: Qt.rgba(1, 1, 1, 0.08) + pressedColor: Qt.rgba(1, 1, 1, 0.12) + textColor: AmneziaStyle.color.vibrantRed + + text: qsTr("Reload API config") + +// Keys.onTabPressed: lastItemTabClicked(focusItem) + + clickedFunc: function() { + var headerText = qsTr("Reload API config?") + var yesButtonText = qsTr("Continue") + var noButtonText = qsTr("Cancel") + + var yesButtonFunction = function() { + if (ServersModel.isDefaultServerCurrentlyProcessed() && ConnectionController.isConnected) { + PageController.showNotificationMessage(qsTr("Cannot reload API config during active connection")) + } else { + PageController.showBusyIndicator(true) + InstallController.updateServiceFromApi(ServersModel.processedIndex, "", "", true) + PageController.showBusyIndicator(false) + } + } + var noButtonFunction = function() { + if (!GC.isMobile()) { + removeButton.forceActiveFocus() + } + } + + showQuestionDrawer(headerText, "", yesButtonText, noButtonText, yesButtonFunction, noButtonFunction) + } + } + + BasicButtonType { + id: removeButton + Layout.alignment: Qt.AlignHCenter + Layout.bottomMargin: 16 + Layout.leftMargin: 8 + implicitHeight: 32 + + defaultColor: "transparent" + hoveredColor: Qt.rgba(1, 1, 1, 0.08) + pressedColor: Qt.rgba(1, 1, 1, 0.12) + textColor: AmneziaStyle.color.vibrantRed + + text: qsTr("Remove from application") + +// Keys.onTabPressed: lastItemTabClicked(focusItem) + + clickedFunc: function() { + var headerText = qsTr("Remove from application?") + var yesButtonText = qsTr("Continue") + var noButtonText = qsTr("Cancel") + + var yesButtonFunction = function() { + if (ServersModel.isDefaultServerCurrentlyProcessed() && ConnectionController.isConnected) { + PageController.showNotificationMessage(qsTr("Cannot remove server during active connection")) + } else { + PageController.showBusyIndicator(true) + InstallController.removeProcessedServer() + PageController.showBusyIndicator(false) + } + } + var noButtonFunction = function() { + if (!GC.isMobile()) { + removeButton.forceActiveFocus() + } + } + + showQuestionDrawer(headerText, "", yesButtonText, noButtonText, yesButtonFunction, noButtonFunction) + } + } + } + } +} diff --git a/client/ui/qml/Pages2/PageSettingsAppSplitTunneling.qml b/client/ui/qml/Pages2/PageSettingsAppSplitTunneling.qml index 2a650d6b..2e8bda2f 100644 --- a/client/ui/qml/Pages2/PageSettingsAppSplitTunneling.qml +++ b/client/ui/qml/Pages2/PageSettingsAppSplitTunneling.qml @@ -215,7 +215,7 @@ PageType { text: appPath rightImageSource: "qrc:/images/controls/trash.svg" - rightImageColor: AmneziaStyle.color.white + rightImageColor: AmneziaStyle.color.paleGray clickedFunction: function() { var headerText = qsTr("Remove ") + appPath + "?" @@ -242,7 +242,7 @@ PageType { Rectangle { anchors.fill: addAppButton anchors.bottomMargin: -24 - color: AmneziaStyle.color.black + color: AmneziaStyle.color.midnightBlack opacity: 0.8 } diff --git a/client/ui/qml/Pages2/PageSettingsApplication.qml b/client/ui/qml/Pages2/PageSettingsApplication.qml index 1693018c..0f85ac30 100644 --- a/client/ui/qml/Pages2/PageSettingsApplication.qml +++ b/client/ui/qml/Pages2/PageSettingsApplication.qml @@ -224,7 +224,7 @@ PageType { text: qsTr("Reset settings and remove all data from the application") rightImageSource: "qrc:/images/controls/chevron-right.svg" - textColor: AmneziaStyle.color.red + textColor: AmneziaStyle.color.vibrantRed Keys.onTabPressed: lastItemTabClicked() parentFlickable: fl @@ -241,7 +241,7 @@ PageType { } else { SettingsController.clearSettings() - PageController.replaceStartPage() + PageController.goToPageHome() } if (!GC.isMobile()) { diff --git a/client/ui/qml/Pages2/PageSettingsBackup.qml b/client/ui/qml/Pages2/PageSettingsBackup.qml index 0a4f5994..abede9b3 100644 --- a/client/ui/qml/Pages2/PageSettingsBackup.qml +++ b/client/ui/qml/Pages2/PageSettingsBackup.qml @@ -28,7 +28,6 @@ PageType { function onRestoreBackupFinished() { PageController.showNotificationMessage(qsTr("Settings restored from backup file")) - //goToStartPage() PageController.goToPageHome() } @@ -122,10 +121,10 @@ PageType { Layout.topMargin: -8 defaultColor: AmneziaStyle.color.transparent - hoveredColor: AmneziaStyle.color.blackHovered - pressedColor: AmneziaStyle.color.blackPressed - disabledColor: AmneziaStyle.color.grey - textColor: AmneziaStyle.color.white + hoveredColor: AmneziaStyle.color.translucentWhite + pressedColor: AmneziaStyle.color.sheerWhite + disabledColor: AmneziaStyle.color.mutedGray + textColor: AmneziaStyle.color.paleGray borderWidth: 1 text: qsTr("Restore from backup") diff --git a/client/ui/qml/Pages2/PageSettingsConnection.qml b/client/ui/qml/Pages2/PageSettingsConnection.qml index 218ffe28..31b1c764 100644 --- a/client/ui/qml/Pages2/PageSettingsConnection.qml +++ b/client/ui/qml/Pages2/PageSettingsConnection.qml @@ -3,6 +3,7 @@ import QtQuick.Controls import QtQuick.Layouts import PageEnum 1.0 +import Style 1.0 import "./" import "../Controls2" diff --git a/client/ui/qml/Pages2/PageSettingsDns.qml b/client/ui/qml/Pages2/PageSettingsDns.qml index a73de327..1d7517d9 100644 --- a/client/ui/qml/Pages2/PageSettingsDns.qml +++ b/client/ui/qml/Pages2/PageSettingsDns.qml @@ -38,7 +38,7 @@ PageType { anchors.bottom: parent.bottom contentHeight: content.height - property var isServerFromApi: ServersModel.getDefaultServerData("isServerFromApi") + property var isServerFromApi: ServersModel.isServerFromApi(ServersModel.defaultIndex) enabled: !isServerFromApi @@ -103,10 +103,10 @@ PageType { Layout.fillWidth: true defaultColor: AmneziaStyle.color.transparent - hoveredColor: AmneziaStyle.color.blackHovered - pressedColor: AmneziaStyle.color.blackPressed - disabledColor: AmneziaStyle.color.grey - textColor: AmneziaStyle.color.white + hoveredColor: AmneziaStyle.color.translucentWhite + pressedColor: AmneziaStyle.color.sheerWhite + disabledColor: AmneziaStyle.color.mutedGray + textColor: AmneziaStyle.color.paleGray borderWidth: 1 text: qsTr("Restore default") diff --git a/client/ui/qml/Pages2/PageSettingsLogging.qml b/client/ui/qml/Pages2/PageSettingsLogging.qml index 6a7fa385..9abfc453 100644 --- a/client/ui/qml/Pages2/PageSettingsLogging.qml +++ b/client/ui/qml/Pages2/PageSettingsLogging.qml @@ -16,18 +16,6 @@ import "../Controls2/TextTypes" PageType { id: root - Connections { - target: SettingsController - - function onLoggingStateChanged() { - if (SettingsController.isLoggingEnabled) { - var message = qsTr("Logging is enabled. Note that logs will be automatically \ -disabled after 14 days, and all log files will be deleted.") - PageController.showNotificationMessage(message) - } - } - } - defaultActiveFocusItem: focusItem Item { @@ -58,13 +46,12 @@ disabled after 14 days, and all log files will be deleted.") anchors.top: parent.top anchors.left: parent.left anchors.right: parent.right - anchors.leftMargin: 16 - anchors.rightMargin: 16 - - spacing: 16 + spacing: 0 HeaderType { Layout.fillWidth: true + Layout.leftMargin: 16 + Layout.rightMargin: 16 headerText: qsTr("Logging") descriptionText: qsTr("Enabling this function will save application's logs automatically. " + @@ -75,11 +62,13 @@ disabled after 14 days, and all log files will be deleted.") id: switcher Layout.fillWidth: true Layout.topMargin: 16 + Layout.leftMargin: 16 + Layout.rightMargin: 16 - text: qsTr("Save logs") + text: qsTr("Enable logs") checked: SettingsController.isLoggingEnabled - KeyNavigation.tab: openFolderButton + //KeyNavigation.tab: openFolderButton onCheckedChanged: { if (checked !== SettingsController.isLoggingEnabled) { SettingsController.isLoggingEnabled = checked @@ -87,132 +76,200 @@ disabled after 14 days, and all log files will be deleted.") } } - RowLayout { + DividerType {} + + LabelWithButtonType { + // id: labelWithButton2 Layout.fillWidth: true + Layout.topMargin: -8 - ColumnLayout { - Layout.alignment: Qt.AlignBaseline - Layout.preferredWidth: GC.isMobile() ? 0 : root.width / 3 - visible: !GC.isMobile() + text: qsTr("Clear logs") + leftImageSource: "qrc:/images/controls/trash.svg" + isSmallLeftImage: true - ImageButtonType { - id: openFolderButton - Layout.alignment: Qt.AlignHCenter + // KeyNavigation.tab: labelWithButton3 - implicitWidth: 56 - implicitHeight: 56 + clickedFunction: function() { + var headerText = qsTr("Clear logs?") + var yesButtonText = qsTr("Continue") + var noButtonText = qsTr("Cancel") - image: "qrc:/images/controls/folder-open.svg" - KeyNavigation.tab: saveButton - - onClicked: SettingsController.openLogsFolder() - Keys.onReturnPressed: openFolderButton.clicked() - Keys.onEnterPressed: openFolderButton.clicked() + var yesButtonFunction = function() { + PageController.showBusyIndicator(true) + SettingsController.clearLogs() + PageController.showBusyIndicator(false) + PageController.showNotificationMessage(qsTr("Logs have been cleaned up")) + if (!GC.isMobile()) { + focusItem.forceActiveFocus() + } } - - CaptionTextType { - horizontalAlignment: Text.AlignHCenter - Layout.fillWidth: true - - text: qsTr("Open folder with logs") - color: AmneziaStyle.color.white - } - } - - ColumnLayout { - Layout.alignment: Qt.AlignBaseline - Layout.preferredWidth: root.width / ( GC.isMobile() ? 2 : 3 ) - - ImageButtonType { - id: saveButton - Layout.alignment: Qt.AlignHCenter - - implicitWidth: 56 - implicitHeight: 56 - - image: "qrc:/images/controls/save.svg" - KeyNavigation.tab: clearButton - - Keys.onReturnPressed: saveButton.clicked() - Keys.onEnterPressed: saveButton.clicked() - onClicked: { - var fileName = "" - if (GC.isMobile()) { - fileName = "AmneziaVPN.log" - } else { - fileName = SystemController.getFileName(qsTr("Save"), - qsTr("Logs files (*.log)"), - StandardPaths.standardLocations(StandardPaths.DocumentsLocation) + "/AmneziaVPN", - true, - ".log") - } - if (fileName !== "") { - PageController.showBusyIndicator(true) - SettingsController.exportLogsFile(fileName) - PageController.showBusyIndicator(false) - PageController.showNotificationMessage(qsTr("Logs file saved")) - } + var noButtonFunction = function() { + if (!GC.isMobile()) { + focusItem.forceActiveFocus() } } - CaptionTextType { - horizontalAlignment: Text.AlignHCenter - Layout.fillWidth: true + showQuestionDrawer(headerText, "", yesButtonText, noButtonText, yesButtonFunction, noButtonFunction) + } + } - text: qsTr("Save logs to file") - color: AmneziaStyle.color.white + ListItemTitleType { + Layout.fillWidth: true + Layout.topMargin: 8 + Layout.leftMargin: 16 + Layout.rightMargin: 16 + + text: qsTr("Client logs") + } + + ParagraphTextType { + Layout.fillWidth: true + Layout.topMargin: 8 + Layout.leftMargin: 16 + Layout.rightMargin: 16 + + color: AmneziaStyle.color.mutedGray + text: qsTr("AmneziaVPN logs") + } + + LabelWithButtonType { + // id: labelWithButton2 + Layout.fillWidth: true + Layout.topMargin: -8 + Layout.bottomMargin: -8 + + text: qsTr("Open logs folder") + leftImageSource: "qrc:/images/controls/folder-open.svg" + isSmallLeftImage: true + + // KeyNavigation.tab: labelWithButton3 + + clickedFunction: function() { + SettingsController.openLogsFolder() + } + } + + DividerType {} + + LabelWithButtonType { + // id: labelWithButton2 + Layout.fillWidth: true + Layout.topMargin: -8 + Layout.bottomMargin: -8 + + text: qsTr("Export logs") + leftImageSource: "qrc:/images/controls/save.svg" + isSmallLeftImage: true + + // KeyNavigation.tab: labelWithButton3 + + clickedFunction: function() { + var fileName = "" + if (GC.isMobile()) { + fileName = "AmneziaVPN.log" + } else { + fileName = SystemController.getFileName(qsTr("Save"), + qsTr("Logs files (*.log)"), + StandardPaths.standardLocations(StandardPaths.DocumentsLocation) + "/AmneziaVPN", + true, + ".log") + } + if (fileName !== "") { + PageController.showBusyIndicator(true) + SettingsController.exportLogsFile(fileName) + PageController.showBusyIndicator(false) + PageController.showNotificationMessage(qsTr("Logs file saved")) } } + } - ColumnLayout { - Layout.alignment: Qt.AlignBaseline - Layout.preferredWidth: root.width / ( GC.isMobile() ? 2 : 3 ) + DividerType {} - ImageButtonType { - id: clearButton - Layout.alignment: Qt.AlignHCenter + ListItemTitleType { + visible: !GC.isMobile() - implicitWidth: 56 - implicitHeight: 56 + Layout.fillWidth: true + Layout.topMargin: 32 + Layout.leftMargin: 16 + Layout.rightMargin: 16 - image: "qrc:/images/controls/delete.svg" - Keys.onTabPressed: lastItemTabClicked(focusItem) + text: qsTr("Service logs") + } - Keys.onReturnPressed: clearButton.clicked() - Keys.onEnterPressed: clearButton.clicked() - onClicked: function() { - var headerText = qsTr("Clear logs?") - var yesButtonText = qsTr("Continue") - var noButtonText = qsTr("Cancel") + ParagraphTextType { + visible: !GC.isMobile() - var yesButtonFunction = function() { - PageController.showBusyIndicator(true) - SettingsController.clearLogs() - PageController.showBusyIndicator(false) - PageController.showNotificationMessage(qsTr("Logs have been cleaned up")) - if (!GC.isMobile()) { - focusItem.forceActiveFocus() - } - } - var noButtonFunction = function() { - if (!GC.isMobile()) { - focusItem.forceActiveFocus() - } - } + Layout.fillWidth: true + Layout.topMargin: 8 + Layout.leftMargin: 16 + Layout.rightMargin: 16 - showQuestionDrawer(headerText, "", yesButtonText, noButtonText, yesButtonFunction, noButtonFunction) - } + color: AmneziaStyle.color.mutedGray + text: qsTr("AmneziaVPN-service logs") + } + + LabelWithButtonType { + // id: labelWithButton2 + + visible: !GC.isMobile() + + Layout.fillWidth: true + Layout.topMargin: -8 + Layout.bottomMargin: -8 + + text: qsTr("Open logs folder") + leftImageSource: "qrc:/images/controls/folder-open.svg" + isSmallLeftImage: true + + // KeyNavigation.tab: labelWithButton3 + + clickedFunction: function() { + SettingsController.openServiceLogsFolder() + } + } + + DividerType { + visible: !GC.isMobile() + } + + LabelWithButtonType { + // id: labelWithButton2 + + visible: !GC.isMobile() + + Layout.fillWidth: true + Layout.topMargin: -8 + Layout.bottomMargin: -8 + + text: qsTr("Export logs") + leftImageSource: "qrc:/images/controls/save.svg" + isSmallLeftImage: true + + // KeyNavigation.tab: labelWithButton3 + + clickedFunction: function() { + var fileName = "" + if (GC.isMobile()) { + fileName = "AmneziaVPN-service.log" + } else { + fileName = SystemController.getFileName(qsTr("Save"), + qsTr("Logs files (*.log)"), + StandardPaths.standardLocations(StandardPaths.DocumentsLocation) + "/AmneziaVPN-service", + true, + ".log") } - - CaptionTextType { - horizontalAlignment: Text.AlignHCenter - Layout.fillWidth: true - - text: qsTr("Clear logs") - color: AmneziaStyle.color.white + if (fileName !== "") { + PageController.showBusyIndicator(true) + SettingsController.exportServiceLogsFile(fileName) + PageController.showBusyIndicator(false) + PageController.showNotificationMessage(qsTr("Logs file saved")) } } } + + DividerType { + visible: !GC.isMobile() + } } } } diff --git a/client/ui/qml/Pages2/PageSettingsServerData.qml b/client/ui/qml/Pages2/PageSettingsServerData.qml index ffee0289..e170a351 100644 --- a/client/ui/qml/Pages2/PageSettingsServerData.qml +++ b/client/ui/qml/Pages2/PageSettingsServerData.qml @@ -38,7 +38,7 @@ PageType { function onRemoveProcessedServerFinished(finishedMessage) { if (!ServersModel.getServersCount()) { - PageController.replaceStartPage() + PageController.goToPageHome() } else { PageController.goToStartPage() PageController.goToPage(PageEnum.PageSettingsServersList) @@ -119,7 +119,7 @@ PageType { Layout.fillWidth: true text: qsTr("Reboot server") - textColor: AmneziaStyle.color.red + textColor: AmneziaStyle.color.vibrantRed KeyNavigation.tab: labelWithButton3 @@ -160,7 +160,7 @@ PageType { Layout.fillWidth: true text: qsTr("Remove server from application") - textColor: AmneziaStyle.color.red + textColor: AmneziaStyle.color.vibrantRed Keys.onTabPressed: { if (content.isServerWithWriteAccess) { @@ -208,7 +208,7 @@ PageType { Layout.fillWidth: true text: qsTr("Clear server from Amnezia software") - textColor: AmneziaStyle.color.red + textColor: AmneziaStyle.color.vibrantRed Keys.onTabPressed: labelWithButton5.visible ? labelWithButton5.forceActiveFocus() : @@ -247,11 +247,11 @@ PageType { LabelWithButtonType { id: labelWithButton5 - visible: ServersModel.getProcessedServerData("isServerFromApi") + visible: ServersModel.getProcessedServerData("isServerFromTelegramApi") Layout.fillWidth: true text: qsTr("Reset API config") - textColor: AmneziaStyle.color.red + textColor: AmneziaStyle.color.vibrantRed Keys.onTabPressed: root.lastItemTabClickedSignal() @@ -285,7 +285,7 @@ PageType { } DividerType { - visible: ServersModel.getProcessedServerData("isServerFromApi") + visible: ServersModel.getProcessedServerData("isServerFromTelegramApi") } } } diff --git a/client/ui/qml/Pages2/PageSettingsServerInfo.qml b/client/ui/qml/Pages2/PageSettingsServerInfo.qml index cf649ae0..95ae5c8a 100644 --- a/client/ui/qml/Pages2/PageSettingsServerInfo.qml +++ b/client/ui/qml/Pages2/PageSettingsServerInfo.qml @@ -19,13 +19,19 @@ import "../Components" PageType { id: root + property int pageSettingsServerProtocols: 0 + property int pageSettingsServerServices: 1 + property int pageSettingsServerData: 2 + property int pageSettingsApiServerInfo: 3 + property int pageSettingsApiLanguageList: 4 + defaultActiveFocusItem: focusItem Connections { target: PageController function onGoToPageSettingsServerServices() { - tabBar.currentIndex = 1 + tabBar.currentIndex = root.pageSettingsServerServices } } @@ -70,6 +76,15 @@ PageType { BackButtonType { id: backButton KeyNavigation.tab: headerContent.actionButton + + backButtonFunction: function() { + if (nestedStackView.currentIndex === root.pageSettingsApiServerInfo && + ServersModel.getProcessedServerData("isCountrySelectionAvailable")) { + nestedStackView.currentIndex = root.pageSettingsApiLanguageList + } else { + PageController.closePage() + } + } } HeaderType { @@ -78,11 +93,15 @@ PageType { Layout.leftMargin: 16 Layout.rightMargin: 16 - actionButtonImage: "qrc:/images/controls/edit-3.svg" + actionButtonImage: nestedStackView.currentIndex === root.pageSettingsApiLanguageList ? "qrc:/images/controls/settings.svg" : "qrc:/images/controls/edit-3.svg" headerText: name descriptionText: { - if (ServersModel.isProcessedServerHasWriteAccess()) { + if (ServersModel.getProcessedServerData("isServerFromGatewayApi")) { + return ApiServicesModel.getSelectedServiceData("serviceDescription") + } else if (ServersModel.getProcessedServerData("isServerFromTelegramApi")) { + return serverDescription + } else if (ServersModel.isProcessedServerHasWriteAccess()) { return credentialsLogin + " · " + hostName } else { return hostName @@ -92,7 +111,11 @@ PageType { KeyNavigation.tab: tabBar actionButtonFunction: function() { - serverNameEditDrawer.open() + if (nestedStackView.currentIndex === root.pageSettingsApiLanguageList) { + nestedStackView.currentIndex = root.pageSettingsApiServerInfo + } else { + serverNameEditDrawer.open() + } } } @@ -172,13 +195,16 @@ PageType { Layout.fillWidth: true - currentIndex: (ServersModel.getProcessedServerData("isServerFromApi") - && !ServersModel.getProcessedServerData("hasInstalledContainers")) ? 2 : 0 + currentIndex: (ServersModel.getProcessedServerData("isServerFromTelegramApi") + && !ServersModel.getProcessedServerData("hasInstalledContainers")) ? + root.pageSettingsServerData : root.pageSettingsServerProtocols background: Rectangle { color: AmneziaStyle.color.transparent } + visible: !ServersModel.getProcessedServerData("isServerFromGatewayApi") + activeFocusOnTab: true onFocusChanged: { if (activeFocus) { @@ -190,45 +216,53 @@ PageType { id: protocolsTab visible: protocolsPage.installedProtocolsCount width: protocolsPage.installedProtocolsCount ? undefined : 0 - isSelected: tabBar.currentIndex === 0 + isSelected: tabBar.currentIndex === root.pageSettingsServerProtocols text: qsTr("Protocols") KeyNavigation.tab: servicesTab - Keys.onReturnPressed: tabBar.currentIndex = 0 - Keys.onEnterPressed: tabBar.currentIndex = 0 + Keys.onReturnPressed: tabBar.currentIndex = root.pageSettingsServerProtocols + Keys.onEnterPressed: tabBar.currentIndex = root.pageSettingsServerProtocols } + TabButtonType { id: servicesTab visible: servicesPage.installedServicesCount width: servicesPage.installedServicesCount ? undefined : 0 - isSelected: tabBar.currentIndex === 1 + isSelected: tabBar.currentIndex === root.pageSettingsServerServices text: qsTr("Services") KeyNavigation.tab: dataTab - Keys.onReturnPressed: tabBar.currentIndex = 1 - Keys.onEnterPressed: tabBar.currentIndex = 1 + Keys.onReturnPressed: tabBar.currentIndex = root.pageSettingsServerServices + Keys.onEnterPressed: tabBar.currentIndex = root.pageSettingsServerServices } + TabButtonType { id: dataTab - isSelected: tabBar.currentIndex === 2 + isSelected: tabBar.currentIndex === root.pageSettingsServerData text: qsTr("Management") - Keys.onReturnPressed: tabBar.currentIndex = 2 - Keys.onEnterPressed: tabBar.currentIndex = 2 - KeyNavigation.tab: stackView.currentIndex === 0 ? - protocolsPage : - stackView.currentIndex === 1 ? - servicesPage : - dataPage + Keys.onReturnPressed: tabBar.currentIndex = root.pageSettingsServerData + Keys.onEnterPressed: tabBar.currentIndex = root.pageSettingsServerData + Keys.onTabPressed: function() { + if (nestedStackView.currentIndex === root.pageSettingsServerProtocols) { + return protocolsPage + } else if (nestedStackView.currentIndex === root.pageSettingsServerProtocols) { + return servicesPage + } else { + return dataPage + } + } } } StackLayout { - id: stackView + id: nestedStackView Layout.preferredWidth: root.width Layout.preferredHeight: root.height - tabBar.implicitHeight - header.implicitHeight - currentIndex: tabBar.currentIndex + currentIndex: ServersModel.getProcessedServerData("isServerFromGatewayApi") ? + (ServersModel.getProcessedServerData("isCountrySelectionAvailable") ? + root.pageSettingsApiLanguageList : root.pageSettingsApiServerInfo) : tabBar.currentIndex PageSettingsServerProtocols { id: protocolsPage @@ -236,18 +270,34 @@ PageType { onLastItemTabClickedSignal: lastItemTabClicked(focusItem) } + PageSettingsServerServices { id: servicesPage stackView: root.stackView onLastItemTabClickedSignal: lastItemTabClicked(focusItem) } + PageSettingsServerData { id: dataPage stackView: root.stackView onLastItemTabClickedSignal: lastItemTabClicked(focusItem) } + + PageSettingsApiServerInfo { + id: apiInfoPage + stackView: root.stackView + +// onLastItemTabClickedSignal: lastItemTabClicked(focusItem) + } + + PageSettingsApiLanguageList { + id: apiLanguageListPage + stackView: root.stackView + +// onLastItemTabClickedSignal: lastItemTabClicked(focusItem) + } } } diff --git a/client/ui/qml/Pages2/PageSettingsServerProtocol.qml b/client/ui/qml/Pages2/PageSettingsServerProtocol.qml index e06a637e..dcdf01af 100644 --- a/client/ui/qml/Pages2/PageSettingsServerProtocol.qml +++ b/client/ui/qml/Pages2/PageSettingsServerProtocol.qml @@ -79,7 +79,7 @@ PageType { } delegate: Item { - property var focusItem: button.rightButton + property var focusItem: clientSettings.rightButton implicitWidth: protocols.width implicitHeight: delegateContent.implicitHeight @@ -89,13 +89,49 @@ PageType { anchors.fill: parent + property bool isClientSettingsVisible: protocolIndex === ProtocolEnum.WireGuard || protocolIndex === ProtocolEnum.Awg + property bool isServerSettingsVisible: ServersModel.isProcessedServerHasWriteAccess() + LabelWithButtonType { - id: button + id: clientSettings Layout.fillWidth: true - text: protocolName + text: protocolName + qsTr(" connection settings") rightImageSource: "qrc:/images/controls/chevron-right.svg" + visible: delegateContent.isClientSettingsVisible + + clickedFunction: function() { + if (isClientProtocolExists) { + switch (protocolIndex) { + case ProtocolEnum.WireGuard: WireGuardConfigModel.updateModel(ProtocolsModel.getConfig()); break; + case ProtocolEnum.Awg: AwgConfigModel.updateModel(ProtocolsModel.getConfig()); break; + } + PageController.goToPage(clientProtocolPage); + } else { + PageController.showNotificationMessage(qsTr("Click the \"connect\" button to create a connection configuration")) + } + } + + MouseArea { + anchors.fill: clientSettings + cursorShape: Qt.PointingHandCursor + enabled: false + } + } + + DividerType { + visible: delegateContent.isClientSettingsVisible + } + + LabelWithButtonType { + id: serverSettings + + Layout.fillWidth: true + + text: protocolName + qsTr(" server settings") + rightImageSource: "qrc:/images/controls/chevron-right.svg" + visible: delegateContent.isServerSettingsVisible clickedFunction: function() { switch (protocolIndex) { @@ -109,17 +145,19 @@ PageType { case ProtocolEnum.Ipsec: Ikev2ConfigModel.updateModel(ProtocolsModel.getConfig()); break; case ProtocolEnum.Socks5Proxy: Socks5ProxyConfigModel.updateModel(ProtocolsModel.getConfig()); break; } - PageController.goToPage(protocolPage); + PageController.goToPage(serverProtocolPage); } MouseArea { - anchors.fill: button + anchors.fill: serverSettings cursorShape: Qt.PointingHandCursor enabled: false } } - DividerType {} + DividerType { + visible: delegateContent.isServerSettingsVisible + } } } } @@ -132,11 +170,11 @@ PageType { visible: root.isClearCacheVisible KeyNavigation.tab: removeButton - text: qsTr("Clear %1 profile").arg(ContainersModel.getProcessedContainerName()) + text: qsTr("Clear profile") clickedFunction: function() { var headerText = qsTr("Clear %1 profile?").arg(ContainersModel.getProcessedContainerName()) - var descriptionText = qsTr("") + var descriptionText = qsTr("The connection configuration will be deleted for this device only") var yesButtonText = qsTr("Continue") var noButtonText = qsTr("Cancel") @@ -183,8 +221,8 @@ PageType { visible: ServersModel.isProcessedServerHasWriteAccess() Keys.onTabPressed: lastItemTabClicked(focusItem) - text: qsTr("Remove ") + ContainersModel.getProcessedContainerName() - textColor: AmneziaStyle.color.red + text: qsTr("Remove ") + textColor: AmneziaStyle.color.vibrantRed clickedFunction: function() { var headerText = qsTr("Remove %1 from server?").arg(ContainersModel.getProcessedContainerName()) diff --git a/client/ui/qml/Pages2/PageSettingsServerProtocols.qml b/client/ui/qml/Pages2/PageSettingsServerProtocols.qml index 33585d71..0bc1fc7d 100644 --- a/client/ui/qml/Pages2/PageSettingsServerProtocols.qml +++ b/client/ui/qml/Pages2/PageSettingsServerProtocols.qml @@ -8,6 +8,7 @@ import PageEnum 1.0 import ProtocolEnum 1.0 import ContainerProps 1.0 import ContainersModelFilters 1.0 +import Style 1.0 import "./" import "../Controls2" diff --git a/client/ui/qml/Pages2/PageSettingsServerServices.qml b/client/ui/qml/Pages2/PageSettingsServerServices.qml index 72a4d3f7..440fd8db 100644 --- a/client/ui/qml/Pages2/PageSettingsServerServices.qml +++ b/client/ui/qml/Pages2/PageSettingsServerServices.qml @@ -8,6 +8,7 @@ import PageEnum 1.0 import ProtocolEnum 1.0 import ContainerProps 1.0 import ContainersModelFilters 1.0 +import Style 1.0 import "./" import "../Controls2" diff --git a/client/ui/qml/Pages2/PageSettingsServersList.qml b/client/ui/qml/Pages2/PageSettingsServersList.qml index 596505a9..102dd46f 100644 --- a/client/ui/qml/Pages2/PageSettingsServersList.qml +++ b/client/ui/qml/Pages2/PageSettingsServersList.qml @@ -7,6 +7,7 @@ import SortFilterProxyModel 0.2 import PageEnum 1.0 import ProtocolEnum 1.0 import ContainerProps 1.0 +import Style 1.0 import "./" import "../Controls2" @@ -119,7 +120,11 @@ PageType { servicesNameString += servicesName[i] + " · " } - return servicesNameString + hostName + if (ServersModel.isServerFromApi(index)) { + return servicesNameString + serverDescription + } else { + return servicesNameString + hostName + } } rightImageSource: "qrc:/images/controls/chevron-right.svg" diff --git a/client/ui/qml/Pages2/PageSettingsSplitTunneling.qml b/client/ui/qml/Pages2/PageSettingsSplitTunneling.qml index 60821ebc..f5fe285a 100644 --- a/client/ui/qml/Pages2/PageSettingsSplitTunneling.qml +++ b/client/ui/qml/Pages2/PageSettingsSplitTunneling.qml @@ -21,7 +21,7 @@ import "../Components" PageType { id: root - property var isServerFromApi: ServersModel.getDefaultServerData("isServerFromApi") + property var isServerFromTelegramApi: ServersModel.getDefaultServerData("isServerFromTelegramApi") defaultActiveFocusItem: searchField.textField @@ -36,7 +36,7 @@ PageType { if (ConnectionController.isConnected) { PageController.showNotificationMessage(qsTr("Cannot change split tunneling settings during active connection")) root.pageEnabled = false - } else if (ServersModel.isDefaultServerDefaultContainerHasSplitTunneling && isServerFromApi) { + } else if (ServersModel.isDefaultServerDefaultContainerHasSplitTunneling) { PageController.showNotificationMessage(qsTr("Default server does not support split tunneling function")) root.pageEnabled = false } else { @@ -266,7 +266,7 @@ PageType { text: url descriptionText: ip rightImageSource: "qrc:/images/controls/trash.svg" - rightImageColor: AmneziaStyle.color.white + rightImageColor: AmneziaStyle.color.paleGray clickedFunction: function() { var headerText = qsTr("Remove ") + url + "?" @@ -300,7 +300,7 @@ PageType { Rectangle { anchors.fill: addSiteButton anchors.bottomMargin: -24 - color: AmneziaStyle.color.black + color: AmneziaStyle.color.midnightBlack opacity: 0.8 } @@ -341,7 +341,7 @@ PageType { implicitHeight: 56 image: "qrc:/images/controls/more-vertical.svg" - imageColor: AmneziaStyle.color.white + imageColor: AmneziaStyle.color.paleGray onClicked: function () { moreActionsDrawer.open() diff --git a/client/ui/qml/Pages2/PageSetupWizardApiServiceInfo.qml b/client/ui/qml/Pages2/PageSetupWizardApiServiceInfo.qml new file mode 100644 index 00000000..75fd3d47 --- /dev/null +++ b/client/ui/qml/Pages2/PageSetupWizardApiServiceInfo.qml @@ -0,0 +1,154 @@ +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts +import QtQuick.Dialogs + +import PageEnum 1.0 +import Style 1.0 + +import "./" +import "../Controls2" +import "../Controls2/TextTypes" +import "../Config" +import "../Components" + +PageType { + id: root + + defaultActiveFocusItem: focusItem + + FlickableType { + id: fl + anchors.top: parent.top + anchors.bottom: parent.bottom + contentHeight: content.height + continueButton.implicitHeight + continueButton.anchors.bottomMargin + continueButton.anchors.topMargin + + ColumnLayout { + id: content + + anchors.top: parent.top + anchors.left: parent.left + anchors.right: parent.right + + spacing: 0 + + Item { + id: focusItem + KeyNavigation.tab: backButton + } + + BackButtonType { + id: backButton + Layout.topMargin: 20 +// KeyNavigation.tab: fileButton.rightButton + } + + HeaderType { + Layout.fillWidth: true + Layout.topMargin: 8 + Layout.rightMargin: 16 + Layout.leftMargin: 16 + Layout.bottomMargin: 32 + + headerText: ApiServicesModel.getSelectedServiceData("name") + descriptionText: ApiServicesModel.getSelectedServiceData("serviceDescription") + } + + LabelWithImageType { + Layout.fillWidth: true + Layout.margins: 16 + + imageSource: "qrc:/images/controls/map-pin.svg" + leftText: qsTr("For the region") + rightText: ApiServicesModel.getSelectedServiceData("region") + } + + LabelWithImageType { + Layout.fillWidth: true + Layout.margins: 16 + + imageSource: "qrc:/images/controls/tag.svg" + leftText: qsTr("Price") + rightText: ApiServicesModel.getSelectedServiceData("price") + } + + LabelWithImageType { + Layout.fillWidth: true + Layout.margins: 16 + + imageSource: "qrc:/images/controls/history.svg" + leftText: qsTr("Work period") + rightText: ApiServicesModel.getSelectedServiceData("workPeriod") + + visible: rightText !== "" + } + + LabelWithImageType { + Layout.fillWidth: true + Layout.margins: 16 + + imageSource: "qrc:/images/controls/gauge.svg" + leftText: qsTr("Speed") + rightText: ApiServicesModel.getSelectedServiceData("speed") + } + + LabelWithImageType { + Layout.fillWidth: true + Layout.margins: 16 + + imageSource: "qrc:/images/controls/info.svg" + leftText: qsTr("Features") + rightText: "" + } + + ParagraphTextType { + Layout.fillWidth: true + Layout.rightMargin: 16 + Layout.leftMargin: 16 + + onLinkActivated: function(link) { + Qt.openUrlExternally(link) + } + textFormat: Text.RichText + text: { + var text = ApiServicesModel.getSelectedServiceData("features") + return text.replace("%1", LanguageModel.getCurrentSiteUrl()) + } + + MouseArea { + anchors.fill: parent + acceptedButtons: Qt.NoButton + cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor + } + } + } + } + + BasicButtonType { + id: continueButton + + anchors.right: parent.right + anchors.left: parent.left + anchors.bottom: parent.bottom + + anchors.topMargin: 32 + anchors.rightMargin: 16 + anchors.leftMargin: 16 + anchors.bottomMargin: 32 + + text: qsTr("Connect") + + clickedFunc: function() { + var endpoint = ApiServicesModel.getStoreEndpoint() + if (endpoint !== undefined && endpoint !== "") { + Qt.openUrlExternally(endpoint) + PageController.closePage() + PageController.closePage() + } else { + PageController.showBusyIndicator(true) + InstallController.installServiceFromApi() + PageController.showBusyIndicator(false) + } + } + } +} diff --git a/client/ui/qml/Pages2/PageSetupWizardApiServicesList.qml b/client/ui/qml/Pages2/PageSetupWizardApiServicesList.qml new file mode 100644 index 00000000..85a50393 --- /dev/null +++ b/client/ui/qml/Pages2/PageSetupWizardApiServicesList.qml @@ -0,0 +1,102 @@ +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts +import QtQuick.Dialogs + +import PageEnum 1.0 +import Style 1.0 + +import "./" +import "../Controls2" +import "../Controls2/TextTypes" +import "../Config" + +PageType { + id: root + + defaultActiveFocusItem: focusItem + + FlickableType { + id: fl + anchors.top: parent.top + anchors.bottom: parent.bottom + contentHeight: content.height + + ColumnLayout { + id: content + + anchors.top: parent.top + anchors.left: parent.left + anchors.right: parent.right + + spacing: 0 + + Item { + id: focusItem + KeyNavigation.tab: backButton + } + + BackButtonType { + id: backButton + Layout.topMargin: 20 +// KeyNavigation.tab: fileButton.rightButton + } + + HeaderType { + Layout.fillWidth: true + Layout.topMargin: 8 + Layout.rightMargin: 16 + Layout.leftMargin: 16 + Layout.bottomMargin: 32 + + headerText: qsTr("VPN by Amnezia") + descriptionText: qsTr("Choose a VPN service that suits your needs.") + } + + ListView { + id: containers + width: parent.width + height: containers.contentItem.height + spacing: 16 + + currentIndex: 1 + interactive: false + model: ApiServicesModel + + delegate: Item { + implicitWidth: containers.width + implicitHeight: delegateContent.implicitHeight + + ColumnLayout { + id: delegateContent + + anchors.top: parent.top + anchors.left: parent.left + anchors.right: parent.right + + CardWithIconsType { + id: card + + Layout.fillWidth: true + Layout.rightMargin: 16 + Layout.leftMargin: 16 + + headerText: name + bodyText: cardDescription + footerText: price + + rightImageSource: "qrc:/images/controls/chevron-right.svg" + + onClicked: { + if (isServiceAvailable) { + ApiServicesModel.setServiceIndex(index) + PageController.goToPage(PageEnum.PageSetupWizardApiServiceInfo) + } + } + } + } + } + } + } + } +} diff --git a/client/ui/qml/Pages2/PageSetupWizardConfigSource.qml b/client/ui/qml/Pages2/PageSetupWizardConfigSource.qml index f7b8949b..7f7cf9e1 100644 --- a/client/ui/qml/Pages2/PageSetupWizardConfigSource.qml +++ b/client/ui/qml/Pages2/PageSetupWizardConfigSource.qml @@ -4,6 +4,7 @@ import QtQuick.Layouts import QtQuick.Dialogs import PageEnum 1.0 +import Style 1.0 import "./" import "../Controls2" @@ -17,7 +18,9 @@ PageType { target: ImportController function onQrDecodingFinished() { - PageController.closePage() + if (Qt.platform.os === "ios") { + PageController.closePage() + } PageController.goToPage(PageEnum.PageSetupWizardViewConfig) } } @@ -41,46 +44,206 @@ PageType { Item { id: focusItem - KeyNavigation.tab: backButton + KeyNavigation.tab: textKey.textField } - BackButtonType { - id: backButton - Layout.topMargin: 20 - KeyNavigation.tab: fileButton.rightButton - } HeaderType { Layout.fillWidth: true - Layout.topMargin: 8 + Layout.topMargin: 24 Layout.rightMargin: 16 Layout.leftMargin: 16 - headerText: qsTr("Server connection") - descriptionText: qsTr("Do not use connection codes from untrusted sources, as they may be created to intercept your data.") + headerText: qsTr("Connection") + + actionButtonImage: PageController.isStartPageVisible() ? "qrc:/images/controls/more-vertical.svg" : "" + actionButtonFunction: function() { + moreActionsDrawer.open() + } + + DrawerType2 { + id: moreActionsDrawer + + parent: root + + anchors.fill: parent + expandedHeight: root.height * 0.35 + + expandedContent: ColumnLayout { + anchors.top: parent.top + anchors.left: parent.left + anchors.right: parent.right + anchors.leftMargin: 16 + anchors.rightMargin: 16 + + HeaderType { + Layout.fillWidth: true + Layout.topMargin: 32 + + headerText: qsTr("Settings") + } + + SwitcherType { + id: switcher + Layout.fillWidth: true + Layout.topMargin: 16 + + text: qsTr("Enable logs") + + checked: SettingsController.isLoggingEnabled + onCheckedChanged: { + if (checked !== SettingsController.isLoggingEnabled) { + SettingsController.isLoggingEnabled = checked + } + } + } + + } + } } - Header2TextType { + ParagraphTextType { + Layout.fillWidth: true + Layout.topMargin: 32 + Layout.rightMargin: 16 + Layout.leftMargin: 16 + Layout.bottomMargin: 24 + + text: qsTr("Insert the key, add a configuration file or scan the QR-code") + } + + TextFieldWithHeaderType { + id: textKey + Layout.fillWidth: true - Layout.topMargin: 48 Layout.rightMargin: 16 Layout.leftMargin: 16 - text: qsTr("What do you have?") + headerText: qsTr("Insert key") + buttonText: qsTr("Insert") + + clickedFunc: function() { + textField.text = "" + textField.paste() + } + + KeyNavigation.tab: continueButton } - LabelWithButtonType { - id: fileButton + BasicButtonType { + id: continueButton + Layout.fillWidth: true Layout.topMargin: 16 + Layout.rightMargin: 16 + Layout.leftMargin: 16 + + visible: textKey.textFieldText !== "" + + text: qsTr("Continue") + Keys.onTabPressed: lastItemTabClicked(focusItem) + + clickedFunc: function() { + if (ImportController.extractConfigFromData(textKey.textFieldText)) { + PageController.goToPage(PageEnum.PageSetupWizardViewConfig) + } + } + } + + ParagraphTextType { + Layout.fillWidth: true + Layout.topMargin: 32 + Layout.rightMargin: 16 + Layout.leftMargin: 16 + Layout.bottomMargin: 24 + + color: AmneziaStyle.color.charcoalGray + text: qsTr("Other connection options") + } + + CardWithIconsType { + id: apiInstalling + + Layout.fillWidth: true + Layout.rightMargin: 16 + Layout.leftMargin: 16 + Layout.bottomMargin: 16 + + headerText: qsTr("VPN by Amnezia") + bodyText: qsTr("Connect to classic paid and free VPN services from Amnezia") - text: !ServersModel.getServersCount() ? qsTr("File with connection settings or backup") : qsTr("File with connection settings") rightImageSource: "qrc:/images/controls/chevron-right.svg" - leftImageSource: "qrc:/images/controls/folder-open.svg" + leftImageSource: "qrc:/images/controls/amnezia.svg" - KeyNavigation.tab: qrButton.visible ? qrButton.rightButton : textButton.rightButton + onClicked: function() { + PageController.showBusyIndicator(true) + var result = InstallController.fillAvailableServices() + PageController.showBusyIndicator(false) + if (result) { + PageController.goToPage(PageEnum.PageSetupWizardApiServicesList) + } + } + } - clickedFunction: function() { + CardWithIconsType { + id: manualInstalling + + Layout.fillWidth: true + Layout.rightMargin: 16 + Layout.leftMargin: 16 + Layout.bottomMargin: 16 + + headerText: qsTr("Self-hosted VPN") + bodyText: qsTr("Configure Amnezia VPN on your own server") + + rightImageSource: "qrc:/images/controls/chevron-right.svg" + leftImageSource: "qrc:/images/controls/server.svg" + + onClicked: { + PageController.goToPage(PageEnum.PageSetupWizardCredentials) + } + } + + CardWithIconsType { + id: backupRestore + + Layout.fillWidth: true + Layout.rightMargin: 16 + Layout.leftMargin: 16 + Layout.bottomMargin: 16 + + visible: PageController.isStartPageVisible() + + headerText: qsTr("Restore from backup") + + rightImageSource: "qrc:/images/controls/chevron-right.svg" + leftImageSource: "qrc:/images/controls/archive-restore.svg" + + onClicked: { + var filePath = SystemController.getFileName(qsTr("Open backup file"), + qsTr("Backup files (*.backup)")) + if (filePath !== "") { + PageController.showBusyIndicator(true) + SettingsController.restoreAppConfig(filePath) + PageController.showBusyIndicator(false) + } + } + } + + CardWithIconsType { + id: openFile + + Layout.fillWidth: true + Layout.rightMargin: 16 + Layout.leftMargin: 16 + Layout.bottomMargin: 16 + + headerText: qsTr("File with connection settings") + + rightImageSource: "qrc:/images/controls/chevron-right.svg" + leftImageSource: "qrc:/images/controls/folder-search-2.svg" + + onClicked: { var nameFilter = !ServersModel.getServersCount() ? "Config or backup files (*.vpn *.ovpn *.conf *.json *.backup)" : "Config files (*.vpn *.ovpn *.conf *.json)" var fileName = SystemController.getFileName(qsTr("Open config file"), nameFilter) @@ -92,20 +255,22 @@ PageType { } } - DividerType {} + CardWithIconsType { + id: scanQr - LabelWithButtonType { - id: qrButton Layout.fillWidth: true + Layout.rightMargin: 16 + Layout.leftMargin: 16 + Layout.bottomMargin: 16 + visible: SettingsController.isCameraPresent() - text: qsTr("QR code") + headerText: qsTr("QR code") + rightImageSource: "qrc:/images/controls/chevron-right.svg" - leftImageSource: "qrc:/images/controls/qr-code.svg" + leftImageSource: "qrc:/images/controls/scan-line.svg" - KeyNavigation.tab: textButton.rightButton - - clickedFunction: function() { + onClicked: { ImportController.startDecodingQr() if (Qt.platform.os === "ios") { PageController.goToPage(PageEnum.PageSetupWizardQrReader) @@ -113,26 +278,25 @@ PageType { } } - DividerType { - visible: SettingsController.isCameraPresent() - } + CardWithIconsType { + id: siteLink - LabelWithButtonType { - id: textButton Layout.fillWidth: true + Layout.rightMargin: 16 + Layout.leftMargin: 16 + Layout.bottomMargin: 16 + + visible: PageController.isStartPageVisible() + + headerText: qsTr("I have nothing") - text: qsTr("Key as text") rightImageSource: "qrc:/images/controls/chevron-right.svg" - leftImageSource: "qrc:/images/controls/text-cursor.svg" + leftImageSource: "qrc:/images/controls/help-circle.svg" - Keys.onTabPressed: lastItemTabClicked(focusItem) - - clickedFunction: function() { - PageController.goToPage(PageEnum.PageSetupWizardTextKey) + onClicked: { + Qt.openUrlExternally(LanguageModel.getCurrentSiteUrl()) } } - - DividerType {} } } } diff --git a/client/ui/qml/Pages2/PageSetupWizardCredentials.qml b/client/ui/qml/Pages2/PageSetupWizardCredentials.qml index ea522363..aced12b1 100644 --- a/client/ui/qml/Pages2/PageSetupWizardCredentials.qml +++ b/client/ui/qml/Pages2/PageSetupWizardCredentials.qml @@ -3,6 +3,7 @@ import QtQuick.Controls import QtQuick.Layouts import PageEnum 1.0 +import Style 1.0 import "./" import "../Controls2" @@ -59,9 +60,6 @@ PageType { Layout.fillWidth: true headerText: qsTr("Server IP address [:port]") textFieldPlaceholderText: qsTr("255.255.255.255:22") - textField.validator: RegularExpressionValidator { - regularExpression: InstallController.ipAddressPortRegExp() - } textField.onFocusChanged: { textField.text = textField.text.replace(/^\s+|\s+$/g, '') @@ -142,6 +140,23 @@ PageType { text: qsTr("All data you enter will remain strictly confidential and will not be shared or disclosed to the Amnezia or any third parties") } + + CardWithIconsType { + id: siteLink + + Layout.fillWidth: true + Layout.bottomMargin: 16 + + headerText: qsTr("How to run your VPN server") + bodyText: qsTr("Where to get connection data, step-by-step instructions for buying a VPS") + + rightImageSource: "qrc:/images/controls/chevron-right.svg" + leftImageSource: "qrc:/images/controls/help-circle.svg" + + onClicked: { + Qt.openUrlExternally(LanguageModel.getCurrentSiteUrl() + "/starter-guide") + } + } } } diff --git a/client/ui/qml/Pages2/PageSetupWizardEasy.qml b/client/ui/qml/Pages2/PageSetupWizardEasy.qml index 0cf4c88c..02a7c928 100644 --- a/client/ui/qml/Pages2/PageSetupWizardEasy.qml +++ b/client/ui/qml/Pages2/PageSetupWizardEasy.qml @@ -187,10 +187,10 @@ PageType { anchors.bottomMargin: 24 defaultColor: AmneziaStyle.color.transparent - hoveredColor: AmneziaStyle.color.blackHovered - pressedColor: AmneziaStyle.color.blackPressed - disabledColor: AmneziaStyle.color.grey - textColor: AmneziaStyle.color.white + hoveredColor: AmneziaStyle.color.translucentWhite + pressedColor: AmneziaStyle.color.sheerWhite + disabledColor: AmneziaStyle.color.mutedGray + textColor: AmneziaStyle.color.paleGray borderWidth: 1 Keys.onTabPressed: lastItemTabClicked(focusItem) diff --git a/client/ui/qml/Pages2/PageSetupWizardInstalling.qml b/client/ui/qml/Pages2/PageSetupWizardInstalling.qml index b94e40f1..1128761d 100644 --- a/client/ui/qml/Pages2/PageSetupWizardInstalling.qml +++ b/client/ui/qml/Pages2/PageSetupWizardInstalling.qml @@ -5,6 +5,7 @@ import QtQuick.Layouts import SortFilterProxyModel 0.2 import PageEnum 1.0 +import Style 1.0 import "./" import "../Controls2" @@ -46,14 +47,7 @@ PageType { ServersModel.processedIndex = ServersModel.defaultIndex } - PageController.goToStartPage() - if (stackView.currentItem.objectName === PageController.getPagePath(PageEnum.PageSetupWizardStart)) { - PageController.replaceStartPage() - } - if (stackView.currentItem.objectName !== PageController.getPagePath(PageEnum.PageHome)) { - PageController.goToPageHome() - } - + PageController.goToPageHome() PageController.showNotificationMessage(finishedMessage) } diff --git a/client/ui/qml/Pages2/PageSetupWizardProtocolSettings.qml b/client/ui/qml/Pages2/PageSetupWizardProtocolSettings.qml index d3e4aa4a..6b4c0a1c 100644 --- a/client/ui/qml/Pages2/PageSetupWizardProtocolSettings.qml +++ b/client/ui/qml/Pages2/PageSetupWizardProtocolSettings.qml @@ -95,10 +95,10 @@ PageType { implicitHeight: 32 defaultColor: AmneziaStyle.color.transparent - hoveredColor: AmneziaStyle.color.blackHovered - pressedColor: AmneziaStyle.color.blackPressed - disabledColor: AmneziaStyle.color.grey - textColor: AmneziaStyle.color.orange + hoveredColor: AmneziaStyle.color.translucentWhite + pressedColor: AmneziaStyle.color.sheerWhite + disabledColor: AmneziaStyle.color.mutedGray + textColor: AmneziaStyle.color.goldenApricot text: qsTr("More detailed") KeyNavigation.tab: transportProtoSelector @@ -263,7 +263,8 @@ PageType { clickedFunc: function() { if (!port.textField.acceptableInput && - ContainerProps.containerTypeToString(dockerContainer) !== "torwebsite") { + ContainerProps.containerTypeToString(dockerContainer) !== "torwebsite" && + ContainerProps.containerTypeToString(dockerContainer) !== "ikev2") { port.errorText = qsTr("The port must be in the range of 1 to 65535") return } diff --git a/client/ui/qml/Pages2/PageSetupWizardProtocols.qml b/client/ui/qml/Pages2/PageSetupWizardProtocols.qml index 59da549c..48265f66 100644 --- a/client/ui/qml/Pages2/PageSetupWizardProtocols.qml +++ b/client/ui/qml/Pages2/PageSetupWizardProtocols.qml @@ -6,6 +6,7 @@ import SortFilterProxyModel 0.2 import PageEnum 1.0 import ProtocolEnum 1.0 +import Style 1.0 import "./" import "../Controls2" diff --git a/client/ui/qml/Pages2/PageSetupWizardStart.qml b/client/ui/qml/Pages2/PageSetupWizardStart.qml index ee7e2a24..b12c7830 100644 --- a/client/ui/qml/Pages2/PageSetupWizardStart.qml +++ b/client/ui/qml/Pages2/PageSetupWizardStart.qml @@ -14,183 +14,44 @@ import "../Components" PageType { id: root - property bool isControlsDisabled: false - defaultActiveFocusItem: focusItem - Connections { - target: PageController + ColumnLayout { + id: content - function onGoToPageViewConfig() { - PageController.goToPage(PageEnum.PageSetupWizardViewConfig) + anchors.fill: parent + spacing: 0 + + Image { + id: image + source: "qrc:/images/amneziaBigLogo.png" + + Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter + Layout.topMargin: 32 + Layout.preferredWidth: 360 + Layout.preferredHeight: 287 } - function onClosePage() { - if (stackView.depth <= 1) { - PageController.hideWindow() - return - } - stackView.pop() + Item { + id: focusItem + KeyNavigation.tab: startButton } - function onGoToPage(page, slide) { - var pagePath = PageController.getPagePath(page) - if (slide) { - stackView.push(pagePath, { "objectName" : pagePath }, StackView.PushTransition) - } else { - stackView.push(pagePath, { "objectName" : pagePath }, StackView.Immediate) - } - } + BasicButtonType { + id: startButton + Layout.fillWidth: true + Layout.bottomMargin: 48 + Layout.leftMargin: 16 + Layout.rightMargin: 16 + Layout.alignment: Qt.AlignBottom - function onGoToStartPage() { - while (stackView.depth > 1) { - stackView.pop() - } - } + text: qsTr("Let's get started") - function onDisableControls(disabled) { - isControlsDisabled = disabled - } - - function onDisableTabBar(disabled) { - isControlsDisabled = disabled - } - - function onEscapePressed() { - if (isControlsDisabled) { - return + clickedFunc: function() { + PageController.goToPage(PageEnum.PageSetupWizardConfigSource) } - PageController.closePage() - } - } - - Connections { - target: SettingsController - - function onRestoreBackupFinished() { - PageController.showNotificationMessage(qsTr("Settings restored from backup file")) - PageController.replaceStartPage() - } - } - - Connections { - target: InstallController - - function onInstallationErrorOccurred(error) { - PageController.showBusyIndicator(false) - PageController.showErrorMessage(error) - - var currentPageName = stackView.currentItem.objectName - - if (currentPageName === PageController.getPagePath(PageEnum.PageSetupWizardInstalling)) { - PageController.closePage() - } - } - } - - Connections { - target: ImportController - - function onRestoreAppConfig(data) { - PageController.showBusyIndicator(true) - SettingsController.restoreAppConfigFromData(data) - PageController.showBusyIndicator(false) - } - - function onImportErrorOccurred(error, goToPageHome) { - PageController.showErrorMessage(error) - } - } - - FlickableType { - id: fl - anchors.top: parent.top - anchors.bottom: parent.bottom - contentHeight: content.height - - ColumnLayout { - id: content - - anchors.top: parent.top - anchors.left: parent.left - anchors.right: parent.right - spacing: 0 - - Image { - id: image - source: "qrc:/images/amneziaBigLogo.png" - - Layout.alignment: Qt.AlignCenter - Layout.topMargin: 32 - Layout.leftMargin: 8 - Layout.rightMargin: 8 - Layout.preferredWidth: 344 - Layout.preferredHeight: 279 - } - - ParagraphTextType { - Layout.fillWidth: true - Layout.topMargin: 50 - Layout.leftMargin: 16 - Layout.rightMargin: 16 - - text: qsTr("Free service for creating a personal VPN on your server.") + - qsTr(" Helps you access blocked content without revealing your privacy, even to VPN providers.") - } - - Item { - id: focusItem - KeyNavigation.tab: startButton - } - - BasicButtonType { - id: startButton - Layout.fillWidth: true - Layout.topMargin: 32 - Layout.leftMargin: 16 - Layout.rightMargin: 16 - - text: qsTr("I have the data to connect") - - clickedFunc: function() { - connectionTypeSelection.open() - } - - KeyNavigation.tab: startButton2 - } - - BasicButtonType { - id: startButton2 - Layout.fillWidth: true - Layout.topMargin: 8 - Layout.leftMargin: 16 - Layout.rightMargin: 16 - - defaultColor: AmneziaStyle.color.transparent - hoveredColor: AmneziaStyle.color.blackHovered - pressedColor: AmneziaStyle.color.blackPressed - disabledColor: AmneziaStyle.color.grey - textColor: AmneziaStyle.color.white - borderWidth: 1 - - text: qsTr("I have nothing") - - clickedFunc: function() { - Qt.openUrlExternally(qsTr("https://amnezia.org/instructions/0_starter-guide")) - } - - Keys.onTabPressed: lastItemTabClicked(focusItem) - } - } - } - - ConnectionTypeSelectionDrawer { - id: connectionTypeSelection - - onClosed: { - PageController.forceTabBarActiveFocus() - root.defaultActiveFocusItem.forceActiveFocus() + Keys.onTabPressed: lastItemTabClicked(focusItem) } } } diff --git a/client/ui/qml/Pages2/PageSetupWizardTextKey.qml b/client/ui/qml/Pages2/PageSetupWizardTextKey.qml index 5c9da47a..c4227df1 100644 --- a/client/ui/qml/Pages2/PageSetupWizardTextKey.qml +++ b/client/ui/qml/Pages2/PageSetupWizardTextKey.qml @@ -3,6 +3,7 @@ import QtQuick.Controls import QtQuick.Layouts import PageEnum 1.0 +import Style 1.0 import "./" import "../Controls2" diff --git a/client/ui/qml/Pages2/PageSetupWizardViewConfig.qml b/client/ui/qml/Pages2/PageSetupWizardViewConfig.qml index 54f64423..92048f36 100644 --- a/client/ui/qml/Pages2/PageSetupWizardViewConfig.qml +++ b/client/ui/qml/Pages2/PageSetupWizardViewConfig.qml @@ -37,7 +37,7 @@ PageType { Connections { target: ImportController - function onImportErrorOccurred(errorMessage, goToPageHome) { + function onImportErrorOccurred(error, goToPageHome) { if (goToPageHome) { PageController.goToStartPage() } else { @@ -51,13 +51,7 @@ PageType { ServersModel.processedIndex = ServersModel.defaultIndex } - PageController.goToStartPage() - if (stackView.currentItem.objectName === PageController.getPagePath(PageEnum.PageSetupWizardStart)) { - PageController.replaceStartPage() - } - if (stackView.currentItem.objectName !== PageController.getPagePath(PageEnum.PageHome)) { - PageController.goToPageHome() - } + PageController.goToPageHome() } } @@ -107,10 +101,10 @@ PageType { implicitHeight: 32 defaultColor: AmneziaStyle.color.transparent - hoveredColor: AmneziaStyle.color.blackHovered - pressedColor: AmneziaStyle.color.blackPressed - disabledColor: AmneziaStyle.color.grey - textColor: AmneziaStyle.color.orange + hoveredColor: AmneziaStyle.color.translucentWhite + pressedColor: AmneziaStyle.color.sheerWhite + disabledColor: AmneziaStyle.color.mutedGray + textColor: AmneziaStyle.color.goldenApricot text: showContent ? qsTr("Collapse content") : qsTr("Show content") KeyNavigation.tab: connectButton @@ -139,8 +133,8 @@ PageType { iconPath: "qrc:/images/controls/alert-circle.svg" - textColor: AmneziaStyle.color.red - imageColor: AmneziaStyle.color.red + textColor: AmneziaStyle.color.vibrantRed + imageColor: AmneziaStyle.color.vibrantRed } WarningType { @@ -159,7 +153,7 @@ PageType { implicitHeight: configContent.implicitHeight radius: 10 - color: AmneziaStyle.color.blackLight + color: AmneziaStyle.color.onyxBlack visible: showContent @@ -180,7 +174,7 @@ PageType { Rectangle { anchors.fill: columnContent anchors.bottomMargin: -24 - color: AmneziaStyle.color.black + color: AmneziaStyle.color.midnightBlack opacity: 0.8 } diff --git a/client/ui/qml/Pages2/PageShare.qml b/client/ui/qml/Pages2/PageShare.qml index 459b985f..6640df36 100644 --- a/client/ui/qml/Pages2/PageShare.qml +++ b/client/ui/qml/Pages2/PageShare.qml @@ -273,7 +273,7 @@ PageType { implicitWidth: accessTypeSelectorContent.implicitWidth implicitHeight: accessTypeSelectorContent.implicitHeight - color: AmneziaStyle.color.blackLight + color: AmneziaStyle.color.onyxBlack radius: 16 RowLayout { @@ -327,7 +327,7 @@ PageType { visible: accessTypeSelector.currentIndex === 0 text: qsTr("Share VPN access without the ability to manage the server") - color: AmneziaStyle.color.grey + color: AmneziaStyle.color.mutedGray } TextFieldWithHeaderType { @@ -658,7 +658,7 @@ PageType { ImageButtonType { id: closeSearchButton image: "qrc:/images/controls/close.svg" - imageColor: AmneziaStyle.color.white + imageColor: AmneziaStyle.color.paleGray Keys.onTabPressed: { if (!GC.isMobile()) { @@ -806,7 +806,7 @@ PageType { ColumnLayout { id: textColumn - property string textColor: AmneziaStyle.color.grey + property string textColor: AmneziaStyle.color.mutedGray Layout.bottomMargin: 24 ParagraphTextType { @@ -840,6 +840,14 @@ PageType { text: qsTr("Data sent: %1").arg(dataSent) } + + ParagraphTextType { + color: textColumn.textColor + visible: allowedIps + Layout.fillWidth: true + + text: qsTr("Allowed IPs: %1").arg(allowedIps) + } } Item { @@ -853,10 +861,10 @@ PageType { Layout.topMargin: 24 defaultColor: AmneziaStyle.color.transparent - hoveredColor: AmneziaStyle.color.blackHovered - pressedColor: AmneziaStyle.color.blackPressed - disabledColor: AmneziaStyle.color.grey - textColor: AmneziaStyle.color.white + hoveredColor: AmneziaStyle.color.translucentWhite + pressedColor: AmneziaStyle.color.sheerWhite + disabledColor: AmneziaStyle.color.mutedGray + textColor: AmneziaStyle.color.paleGray borderWidth: 1 text: qsTr("Rename") @@ -946,10 +954,10 @@ PageType { Layout.fillWidth: true defaultColor: AmneziaStyle.color.transparent - hoveredColor: AmneziaStyle.color.blackHovered - pressedColor: AmneziaStyle.color.blackPressed - disabledColor: AmneziaStyle.color.grey - textColor: AmneziaStyle.color.white + hoveredColor: AmneziaStyle.color.translucentWhite + pressedColor: AmneziaStyle.color.sheerWhite + disabledColor: AmneziaStyle.color.mutedGray + textColor: AmneziaStyle.color.paleGray borderWidth: 1 text: qsTr("Revoke") diff --git a/client/ui/qml/Pages2/PageShareFullAccess.qml b/client/ui/qml/Pages2/PageShareFullAccess.qml index f22132c1..2a565230 100644 --- a/client/ui/qml/Pages2/PageShareFullAccess.qml +++ b/client/ui/qml/Pages2/PageShareFullAccess.qml @@ -67,7 +67,7 @@ PageType { text: qsTr("We recommend that you use full access to the server only for your own additional devices.\n") + qsTr("If you share full access with other people, they can remove and add protocols and services to the server, which will cause the VPN to work incorrectly for all users. ") - color: AmneziaStyle.color.grey + color: AmneziaStyle.color.mutedGray } DropDownType { @@ -140,22 +140,23 @@ PageType { Keys.onTabPressed: lastItemTabClicked(focusItem) clickedFunc: function() { + PageController.showBusyIndicator(true) + + if (Qt.platform.os === "android" && !SystemController.isAuthenticated()) { + PageController.showBusyIndicator(false) + ExportController.exportErrorOccurred(qsTr("Access error!")) + return + } else { + ExportController.generateFullAccessConfig() + } + shareConnectionDrawer.headerText = qsTr("Connection to ") + serverSelector.text shareConnectionDrawer.configContentHeaderText = qsTr("File with connection settings to ") + serverSelector.text shareConnectionDrawer.open() - shareConnectionDrawer.contentVisible = false - PageController.showBusyIndicator(true) - - if (Qt.platform.os === "android") { - ExportController.generateFullAccessConfigAndroid(); - } else { - ExportController.generateFullAccessConfig(); - } + shareConnectionDrawer.contentVisible = true PageController.showBusyIndicator(false) - - shareConnectionDrawer.contentVisible = true } } } diff --git a/client/ui/qml/Pages2/PageStart.qml b/client/ui/qml/Pages2/PageStart.qml index 1e9ba16f..640c61ef 100644 --- a/client/ui/qml/Pages2/PageStart.qml +++ b/client/ui/qml/Pages2/PageStart.qml @@ -24,8 +24,14 @@ PageType { target: PageController function onGoToPageHome() { - tabBar.setCurrentIndex(0) - tabBarStackView.goToTabBarPage(PageEnum.PageHome) + if (PageController.isStartPageVisible()) { + tabBar.visible = false + tabBarStackView.goToTabBarPage(PageEnum.PageSetupWizardStart) + } else { + tabBar.visible = true + tabBar.setCurrentIndex(0) + tabBarStackView.goToTabBarPage(PageEnum.PageHome) + } } function onGoToPageSettings() { @@ -65,7 +71,6 @@ PageType { } function onGoToStartPage() { - connectionTypeSelection.close() while (tabBarStackView.depth > 1) { tabBarStackView.pop() } @@ -78,9 +83,9 @@ PageType { var pageName = tabBarStackView.currentItem.objectName if ((pageName === PageController.getPagePath(PageEnum.PageShare)) || - (pageName === PageController.getPagePath(PageEnum.PageSettings))) { + (pageName === PageController.getPagePath(PageEnum.PageSettings)) || + (pageName === PageController.getPagePath(PageEnum.PageSetupWizardConfigSource))) { PageController.goToPageHome() - tabBar.previousIndex = 0 } else { PageController.closePage() } @@ -118,6 +123,10 @@ PageType { } } + function onWrongInstallationUser(message) { + onInstallationErrorOccurred(message) + } + function onUpdateContainerFinished(message) { PageController.showNotificationMessage(message) PageController.closePage() @@ -126,6 +135,33 @@ PageType { function onCachedProfileCleared(message) { PageController.showNotificationMessage(message) } + + function onApiConfigRemoved(message) { + PageController.showNotificationMessage(message) + } + + function onInstallServerFromApiFinished(message) { + PageController.showBusyIndicator(false) + if (!ConnectionController.isConnected) { + ServersModel.setDefaultServerIndex(ServersModel.getServersCount() - 1); + ServersModel.processedIndex = ServersModel.defaultIndex + } + + PageController.goToPageHome() + PageController.showNotificationMessage(message) + } + + function onChangeApiCountryFinished(message) { + PageController.showBusyIndicator(false) + + PageController.goToPageHome() + PageController.showNotificationMessage(message) + } + + function onReloadServerFromApiFinished(message) { + PageController.goToPageHome() + PageController.showNotificationMessage(message) + } } Connections { @@ -151,6 +187,12 @@ PageType { function onImportErrorOccurred(error, goToPageHome) { PageController.showErrorMessage(error) } + + function onRestoreAppConfig(data) { + PageController.showBusyIndicator(true) + SettingsController.restoreAppConfigFromData(data) + PageController.showBusyIndicator(false) + } } Connections { @@ -159,6 +201,19 @@ PageType { function onLoggingDisableByWatcher() { PageController.showNotificationMessage(qsTr("Logging was disabled after 14 days, log files were deleted")) } + + function onRestoreBackupFinished() { + PageController.showNotificationMessage(qsTr("Settings restored from backup file")) + PageController.goToPageHome() + } + + function onLoggingStateChanged() { + if (SettingsController.isLoggingEnabled) { + var message = qsTr("Logging is enabled. Note that logs will be automatically" + + "disabled after 14 days, and all log files will be deleted.") + PageController.showNotificationMessage(message) + } + } } StackViewType { @@ -169,31 +224,37 @@ PageType { anchors.left: parent.left anchors.bottom: tabBar.top - width: parent.width - height: root.height - tabBar.implicitHeight - enabled: !root.isControlsDisabled function goToTabBarPage(page) { - connectionTypeSelection.close() - var pagePath = PageController.getPagePath(page) tabBarStackView.clear(StackView.Immediate) tabBarStackView.replace(pagePath, { "objectName" : pagePath }, StackView.Immediate) } Component.onCompleted: { - var pagePath = PageController.getPagePath(PageEnum.PageHome) - ServersModel.processedIndex = ServersModel.defaultIndex + var pagePath + if (PageController.isStartPageVisible()) { + tabBar.visible = false + pagePath = PageController.getPagePath(PageEnum.PageSetupWizardStart) + } else { + tabBar.visible = true + pagePath = PageController.getPagePath(PageEnum.PageHome) + ServersModel.processedIndex = ServersModel.defaultIndex + } + tabBarStackView.push(pagePath, { "objectName" : pagePath }) } + + Keys.onPressed: function(event) { + PageController.keyPressEvent(event.key) + event.accepted = true + } } TabBar { id: tabBar - property int previousIndex: 0 - anchors.right: parent.right anchors.left: parent.left anchors.bottom: parent.bottom @@ -203,6 +264,8 @@ PageType { leftPadding: 96 rightPadding: 96 + height: visible ? homeTabButton.implicitHeight + tabBar.topPadding + tabBar.bottomPadding : 0 + enabled: !root.isControlsDisabled && !root.isTabBarDisabled background: Shape { @@ -219,8 +282,8 @@ PageType { PathLine { x: 0; y: 0 } strokeWidth: 1 - strokeColor: AmneziaStyle.color.greyDark - fillColor: AmneziaStyle.color.blackLight + strokeColor: AmneziaStyle.color.slateGray + fillColor: AmneziaStyle.color.onyxBlack } } @@ -232,7 +295,6 @@ PageType { tabBarStackView.goToTabBarPage(PageEnum.PageHome) ServersModel.processedIndex = ServersModel.defaultIndex tabBar.currentIndex = 0 - tabBar.previousIndex = 0 } KeyNavigation.tab: shareTabButton @@ -261,7 +323,6 @@ PageType { clickedFunc: function () { tabBarStackView.goToTabBarPage(PageEnum.PageShare) tabBar.currentIndex = 1 - tabBar.previousIndex = 1 } KeyNavigation.tab: settingsTabButton @@ -274,7 +335,6 @@ PageType { clickedFunc: function () { tabBarStackView.goToTabBarPage(PageEnum.PageSettings) tabBar.currentIndex = 2 - tabBar.previousIndex = 2 } KeyNavigation.tab: plusTabButton @@ -285,19 +345,11 @@ PageType { isSelected: tabBar.currentIndex === 3 image: "qrc:/images/controls/plus.svg" clickedFunc: function () { - connectionTypeSelection.open() + tabBarStackView.goToTabBarPage(PageEnum.PageSetupWizardConfigSource) + tabBar.currentIndex = 3 } Keys.onTabPressed: PageController.forceStackActiveFocus() } } - - ConnectionTypeSelectionDrawer { - id: connectionTypeSelection - - onAboutToHide: { - PageController.forceTabBarActiveFocus() - tabBar.setCurrentIndex(tabBar.previousIndex) - } - } } diff --git a/client/ui/qml/main2.qml b/client/ui/qml/main2.qml index ea775d26..fb99559f 100644 --- a/client/ui/qml/main2.qml +++ b/client/ui/qml/main2.qml @@ -10,6 +10,7 @@ import Style 1.0 import "Config" import "Controls2" import "Components" +import "Pages2" Window { id: root @@ -22,7 +23,7 @@ Window { maximumWidth: 600 maximumHeight: 800 - color: AmneziaStyle.color.black + color: AmneziaStyle.color.midnightBlack onClosing: function() { console.debug("QML onClosing signal") @@ -31,34 +32,9 @@ Window { title: "AmneziaVPN" - StackViewType { - id: rootStackView - - width: root.width - height: root.height - focus: true - - Component.onCompleted: { - var pagePath = PageController.getInitialPage() - rootStackView.push(pagePath, { "objectName" : pagePath }) - } - - Keys.onPressed: function(event) { - PageController.keyPressEvent(event.key) - event.accepted = true - } - } - Connections { target: PageController - function onReplaceStartPage() { - var pagePath = PageController.getInitialPage() - rootStackView.clear() - PageController.updateNavigationBarColor(PageController.getInitialPageNavigationBarColor()) - rootStackView.replace(pagePath, { "objectName" : pagePath }) - } - function onRaiseMainWindow() { root.show() root.raise() @@ -103,6 +79,11 @@ Window { } } + PageStart { + width: root.width + height: root.height + } + Item { anchors.right: parent.right anchors.left: parent.left @@ -196,10 +177,10 @@ Window { Layout.fillWidth: true defaultColor: AmneziaStyle.color.transparent - hoveredColor: AmneziaStyle.color.blackHovered - pressedColor: AmneziaStyle.color.blackPressed - disabledColor: AmneziaStyle.color.grey - textColor: AmneziaStyle.color.white + hoveredColor: AmneziaStyle.color.translucentWhite + pressedColor: AmneziaStyle.color.sheerWhite + disabledColor: AmneziaStyle.color.mutedGray + textColor: AmneziaStyle.color.paleGray borderWidth: 1 text: qsTr("Save") diff --git a/client/utilities.cpp b/client/utilities.cpp index a2f3d021..4047365f 100644 --- a/client/utilities.cpp +++ b/client/utilities.cpp @@ -69,22 +69,6 @@ QString Utils::JsonToString(const QJsonArray &array, QJsonDocument::JsonFormat f return doc.toJson(format); } -QString Utils::systemLogPath() -{ -#ifdef Q_OS_WIN - QStringList locationList = QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation); - QString primaryLocation = "ProgramData"; - foreach (const QString &location, locationList) { - if (location.contains(primaryLocation)) { - return QString("%1/%2/log").arg(location).arg(APPLICATION_NAME); - } - } - return QString(); -#else - return QString("/var/log/%1").arg(APPLICATION_NAME); -#endif -} - bool Utils::initializePath(const QString &path) { QDir dir; diff --git a/client/utilities.h b/client/utilities.h index b85c5b3b..9bf8c82a 100644 --- a/client/utilities.h +++ b/client/utilities.h @@ -23,7 +23,6 @@ public: static QJsonObject JsonFromString(const QString &string); static QString executable(const QString &baseName, bool absPath); static QString usrExecutable(const QString &baseName); - static QString systemLogPath(); static bool createEmptyFile(const QString &path); static bool initializePath(const QString &path); diff --git a/client/vpnconnection.cpp b/client/vpnconnection.cpp index daff1187..591e396f 100644 --- a/client/vpnconnection.cpp +++ b/client/vpnconnection.cpp @@ -1,16 +1,16 @@ #include "qtimer.h" #include +#include #include #include #include -#include +#include "core/controllers/serverController.h" #include #include #include #include -#include "core/controllers/serverController.h" #ifdef AMNEZIA_DESKTOP #include "core/ipcclient.h" @@ -34,8 +34,7 @@ VpnConnection::VpnConnection(std::shared_ptr settings, QObject *parent { m_checkTimer.setInterval(1000); #ifdef Q_OS_IOS - connect(IosController::Instance(), &IosController::connectionStateChanged, this, - &VpnConnection::onConnectionStateChanged); + connect(IosController::Instance(), &IosController::connectionStateChanged, this, &VpnConnection::onConnectionStateChanged); connect(IosController::Instance(), &IosController::bytesChanged, this, &VpnConnection::onBytesChanged); #endif @@ -58,7 +57,7 @@ void VpnConnection::onConnectionStateChanged(Vpn::ConnectionState state) #ifdef AMNEZIA_DESKTOP QString proto = m_settings->defaultContainerName(m_settings->defaultServerIndex()); - + if (IpcClient::Interface()) { if (state == Vpn::ConnectionState::Connected) { IpcClient::Interface()->resetIpStack(); @@ -72,7 +71,7 @@ void VpnConnection::onConnectionStateChanged(Vpn::ConnectionState state) if (m_settings->isSitesSplitTunnelingEnabled()) { IpcClient::Interface()->routeDeleteList(m_vpnProtocol->vpnGateway(), QStringList() << "0.0.0.0"); - // qDebug() << "VpnConnection::onConnectionStateChanged :: adding custom routes, count:" << forwardIps.size(); + // qDebug() << "VpnConnection::onConnectionStateChanged :: adding custom routes, count:" << forwardIps.size(); if (m_settings->routeMode() == Settings::VpnOnlyForwardSites) { QTimer::singleShot(1000, m_vpnProtocol.data(), [this]() { addSitesRoutes(m_vpnProtocol->vpnGateway(), m_settings->routeMode()); }); @@ -234,7 +233,7 @@ void VpnConnection::connectToVpn(int serverIndex, const ServerCredentials &crede } #endif - m_remoteAddress = credentials.hostName; + m_remoteAddress = NetworkUtilities::getIPAddress(credentials.hostName); emit connectionStateChanged(Vpn::ConnectionState::Connecting); m_vpnConfiguration = vpnConfiguration; @@ -291,27 +290,62 @@ void VpnConnection::appendKillSwitchConfig() void VpnConnection::appendSplitTunnelingConfig() { - if (m_vpnConfiguration.value(config_key::configVersion).toInt()) { - auto protocolName = m_vpnConfiguration.value(config_key::vpnproto).toString(); - if (protocolName == ProtocolProps::protoToString(Proto::Awg)) { - auto configData = m_vpnConfiguration.value(protocolName + "_config_data").toObject(); - QJsonArray allowedIpsJsonArray = QJsonArray::fromStringList(configData.value("allowed_ips").toString().split(",")); - QJsonArray defaultAllowedIP = QJsonArray::fromStringList(QString("0.0.0.0/0, ::/0").split(",")); + bool allowSiteBasedSplitTunneling = true; - if (allowedIpsJsonArray != defaultAllowedIP) { - allowedIpsJsonArray.append(m_vpnConfiguration.value(config_key::dns1).toString()); - allowedIpsJsonArray.append(m_vpnConfiguration.value(config_key::dns2).toString()); - - m_vpnConfiguration.insert(config_key::splitTunnelType, Settings::RouteMode::VpnOnlyForwardSites); - m_vpnConfiguration.insert(config_key::splitTunnelSites, allowedIpsJsonArray); + // this block is for old native configs and for old self-hosted configs + auto protocolName = m_vpnConfiguration.value(config_key::vpnproto).toString(); + if (protocolName == ProtocolProps::protoToString(Proto::Awg) || protocolName == ProtocolProps::protoToString(Proto::WireGuard)) { + allowSiteBasedSplitTunneling = false; + auto configData = m_vpnConfiguration.value(protocolName + "_config_data").toObject(); + if (configData.value(config_key::allowed_ips).isString()) { + QJsonArray allowedIpsJsonArray = QJsonArray::fromStringList(configData.value(config_key::allowed_ips).toString().split(", ")); + configData.insert(config_key::allowed_ips, allowedIpsJsonArray); + m_vpnConfiguration.insert(protocolName + "_config_data", configData); + } else if (configData.value(config_key::allowed_ips).isUndefined()) { + auto nativeConfig = configData.value(config_key::config).toString(); + auto nativeConfigLines = nativeConfig.split("\n"); + for (auto &line : nativeConfigLines) { + if (line.contains("AllowedIPs")) { + auto allowedIpsString = line.split(" = "); + if (allowedIpsString.size() < 1) { + break; + } + QJsonArray allowedIpsJsonArray = QJsonArray::fromStringList(allowedIpsString.at(1).split(", ")); + configData.insert(config_key::allowed_ips, allowedIpsJsonArray); + m_vpnConfiguration.insert(protocolName + "_config_data", configData); + break; + } } } - } else { - Settings::RouteMode routeMode = Settings::RouteMode::VpnAllSites; - QJsonArray sitesJsonArray; - if (m_settings->isSitesSplitTunnelingEnabled()) { - routeMode = m_settings->routeMode(); + if (configData.value(config_key::persistent_keep_alive).isUndefined()) { + auto nativeConfig = configData.value(config_key::config).toString(); + auto nativeConfigLines = nativeConfig.split("\n"); + for (auto &line : nativeConfigLines) { + if (line.contains("PersistentKeepalive")) { + auto persistentKeepaliveString = line.split(" = "); + if (persistentKeepaliveString.size() < 1) { + break; + } + configData.insert(config_key::persistent_keep_alive, persistentKeepaliveString.at(1)); + m_vpnConfiguration.insert(protocolName + "_config_data", configData); + break; + } + } + } + + QJsonArray allowedIpsJsonArray = configData.value(config_key::allowed_ips).toArray(); + if (allowedIpsJsonArray.contains("0.0.0.0/0") && allowedIpsJsonArray.contains("::/0")) { + allowSiteBasedSplitTunneling = true; + } + } + + Settings::RouteMode routeMode = Settings::RouteMode::VpnAllSites; + QJsonArray sitesJsonArray; + if (m_settings->isSitesSplitTunnelingEnabled()) { + routeMode = m_settings->routeMode(); + + if (allowSiteBasedSplitTunneling) { auto sites = m_settings->getVpnIps(routeMode); for (const auto &site : sites) { sitesJsonArray.append(site); @@ -323,11 +357,11 @@ void VpnConnection::appendSplitTunnelingConfig() sitesJsonArray.append(m_vpnConfiguration.value(config_key::dns2).toString()); } } - - m_vpnConfiguration.insert(config_key::splitTunnelType, routeMode); - m_vpnConfiguration.insert(config_key::splitTunnelSites, sitesJsonArray); } + m_vpnConfiguration.insert(config_key::splitTunnelType, routeMode); + m_vpnConfiguration.insert(config_key::splitTunnelSites, sitesJsonArray); + Settings::AppsRouteMode appsRouteMode = Settings::AppsRouteMode::VpnAllApps; QJsonArray appsJsonArray; if (m_settings->isAppsSplitTunnelingEnabled()) { @@ -359,8 +393,7 @@ void VpnConnection::createAndroidConnections() connect(AndroidController::instance(), &AndroidController::connectionStateChanged, androidVpnProtocol, &AndroidVpnProtocol::setConnectionState); - connect(AndroidController::instance(), &AndroidController::statisticsUpdated, androidVpnProtocol, - &AndroidVpnProtocol::setBytesChanged); + connect(AndroidController::instance(), &AndroidController::statisticsUpdated, androidVpnProtocol, &AndroidVpnProtocol::setBytesChanged); } AndroidVpnProtocol *VpnConnection::createDefaultAndroidVpnProtocol() diff --git a/client/logger.cpp b/common/logger/logger.cpp similarity index 56% rename from client/logger.cpp rename to common/logger/logger.cpp index c76bc698..747590b9 100644 --- a/client/logger.cpp +++ b/common/logger/logger.cpp @@ -4,18 +4,18 @@ #include #include #include -#include #include +#include #include #include #include -#include "version.h" #include "utilities.h" +#include "version.h" #ifdef AMNEZIA_DESKTOP -#include + #include #endif #ifdef Q_OS_IOS @@ -25,8 +25,9 @@ QFile Logger::m_file; QTextStream Logger::m_textStream; QString Logger::m_logFileName = QString("%1.log").arg(APPLICATION_NAME); +QString Logger::m_serviceLogFileName = QString("%1.log").arg(SERVICE_NAME); -void debugMessageHandler(QtMsgType type, const QMessageLogContext& context, const QString& msg) +void debugMessageHandler(QtMsgType type, const QMessageLogContext &context, const QString &msg) { if (msg.simplified().isEmpty()) { return; @@ -37,12 +38,12 @@ void debugMessageHandler(QtMsgType type, const QMessageLogContext& context, cons 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; } Logger::m_textStream << qFormatLogMessage(type, context, msg) << Qt::endl << Qt::flush; - Logger::appendAllLog(qFormatLogMessage(type, context, msg)); std::cout << qFormatLogMessage(type, context, msg).toStdString() << std::endl << std::flush; } @@ -53,36 +54,24 @@ Logger &Logger::Instance() return s; } -void Logger::appendSshLog(const QString &log) +bool Logger::init(bool isServiceLogger) { - QString dt = QDateTime::currentDateTime().toString(); - Instance().m_sshLog.append(dt + ": " + log + "\n"); - emit Instance().sshLogChanged(Instance().sshLog()); -} - -void Logger::appendAllLog(const QString &log) -{ - Instance().m_allLog.append(log + "\n"); - emit Instance().allLogChanged(Instance().allLog()); -} - -bool Logger::init() -{ - qSetMessagePattern("%{time yyyy-MM-dd hh:mm:ss} %{type} %{message}"); - - QString path = userLogsDir(); + QString path = isServiceLogger ? systemLogDir() : userLogsDir(); + QString logFileName = isServiceLogger ? m_serviceLogFileName : m_logFileName ; QDir appDir(path); if (!appDir.mkpath(path)) { return false; } - m_file.setFileName(appDir.filePath(m_logFileName)); + m_file.setFileName(appDir.filePath(logFileName)); if (!m_file.open(QIODevice::Append)) { - qWarning() << "Cannot open log file:" << m_logFileName; + qWarning() << "Cannot open log file:" << logFileName; return false; } + m_file.setTextModeEnabled(true); m_textStream.setDevice(&m_file); + qSetMessagePattern("%{time yyyy-MM-dd hh:mm:ss} %{type} %{message}"); #if !defined(QT_DEBUG) || defined(Q_OS_IOS) qInstallMessageHandler(debugMessageHandler); @@ -99,7 +88,8 @@ void Logger::deInit() m_file.close(); } -bool Logger::setServiceLogsEnabled(bool enabled) { +bool Logger::setServiceLogsEnabled(bool enabled) +{ #ifdef AMNEZIA_DESKTOP IpcClient *m_IpcClient = new IpcClient; @@ -112,8 +102,7 @@ bool Logger::setServiceLogsEnabled(bool enabled) { if (m_IpcClient->Interface()) { m_IpcClient->Interface()->setLogsEnabled(enabled); - } - else { + } else { qWarning() << "Error occurred setting up service logs"; return false; } @@ -127,11 +116,32 @@ QString Logger::userLogsDir() return QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/log"; } +QString Logger::systemLogDir() +{ +#ifdef Q_OS_WIN + QStringList locationList = QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation); + QString primaryLocation = "ProgramData"; + foreach (const QString &location, locationList) { + if (location.contains(primaryLocation)) { + return QString("%1/%2/log").arg(location).arg(APPLICATION_NAME); + } + } + return QString(); +#else + return QString("/var/log/%1").arg(APPLICATION_NAME); +#endif +} + QString Logger::userLogsFilePath() { return userLogsDir() + QDir::separator() + m_logFileName; } +QString Logger::serviceLogsFilePath() +{ + return systemLogDir() + QDir::separator() + m_serviceLogFileName; +} + QString Logger::getLogFile() { m_file.flush(); @@ -139,18 +149,32 @@ QString Logger::getLogFile() file.open(QIODevice::ReadOnly); QString qtLog = file.readAll(); - + #ifdef Q_OS_IOS return QString().fromStdString(AmneziaVPN::swiftUpdateLogData(qtLog.toStdString())); #else return qtLog; #endif - } -bool Logger::openLogsFolder() +QString Logger::getServiceLogFile() { - QString path = userLogsDir(); + m_file.flush(); + QFile file(serviceLogsFilePath()); + + file.open(QIODevice::ReadOnly); + QString qtLog = file.readAll(); + +#ifdef Q_OS_IOS + return QString().fromStdString(AmneziaVPN::swiftUpdateLogData(qtLog.toStdString())); +#else + return qtLog; +#endif +} + +bool Logger::openLogsFolder(bool isServiceLogger) +{ + QString path = isServiceLogger ? systemLogDir() : userLogsDir(); #ifdef Q_OS_WIN path = "file:///" + path; #endif @@ -161,38 +185,23 @@ bool Logger::openLogsFolder() return true; } -bool Logger::openServiceLogsFolder() -{ - QString path = Utils::systemLogPath(); -#ifdef Q_OS_WIN - path = "file:///" + path; -#endif - QDesktopServices::openUrl(QUrl::fromLocalFile(path)); - return true; -} - -QString Logger::appLogFileNamePath() -{ - return m_file.fileName(); -} - -void Logger::clearLogs() +void Logger::clearLogs(bool isServiceLogger) { bool isLogActive = m_file.isOpen(); m_file.close(); - QFile file(userLogsFilePath()); + QFile file(isServiceLogger ? serviceLogsFilePath() : userLogsFilePath()); file.open(QIODevice::WriteOnly | QIODevice::Truncate); file.resize(0); file.close(); - + #ifdef Q_OS_IOS AmneziaVPN::swiftDeleteLog(); #endif - + if (isLogActive) { - init(); + init(isServiceLogger); } } @@ -210,8 +219,7 @@ void Logger::clearServiceLogs() if (m_IpcClient->Interface()) { m_IpcClient->Interface()->clearLogs(); - } - else { + } else { qWarning() << "Error occurred cleaning up service logs"; } #endif @@ -219,26 +227,41 @@ void Logger::clearServiceLogs() void Logger::cleanUp() { - clearLogs(); + clearLogs(false); QDir dir(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation)); dir.removeRecursively(); - clearServiceLogs(); + clearLogs(true); } -Logger::Log::Log(Logger* logger, LogLevel logLevel) - : m_logger(logger), m_logLevel(logLevel), m_data(new Data()) {} +Logger::Log::Log(Logger *logger, LogLevel logLevel) : m_logger(logger), m_logLevel(logLevel), m_data(new Data()) +{ +} -Logger::Log::~Log() { +Logger::Log::~Log() +{ qDebug() << "Amnezia" << m_logger->className() << m_data->m_buffer.trimmed(); delete m_data; } -Logger::Log Logger::error() { return Log(this, LogLevel::Error); } -Logger::Log Logger::warning() { return Log(this, LogLevel::Warning); } -Logger::Log Logger::info() { return Log(this, LogLevel::Info); } -Logger::Log Logger::debug() { return Log(this, LogLevel::Debug); } -QString Logger::sensitive(const QString& input) { +Logger::Log Logger::error() +{ + return Log(this, LogLevel::Error); +} +Logger::Log Logger::warning() +{ + return Log(this, LogLevel::Warning); +} +Logger::Log Logger::info() +{ + return Log(this, LogLevel::Info); +} +Logger::Log Logger::debug() +{ + return Log(this, LogLevel::Debug); +} +QString Logger::sensitive(const QString &input) +{ #ifdef Q_DEBUG return input; #else @@ -247,48 +270,51 @@ QString Logger::sensitive(const QString& input) { #endif } - -#define CREATE_LOG_OP_REF(x) \ -Logger::Log& Logger::Log::operator<<(x t) { \ - m_data->m_ts << t << ' '; \ - return *this; \ -} +#define CREATE_LOG_OP_REF(x) \ + Logger::Log &Logger::Log::operator<<(x t) \ + { \ + m_data->m_ts << t << ' '; \ + return *this; \ + } CREATE_LOG_OP_REF(uint64_t); -CREATE_LOG_OP_REF(const char*); -CREATE_LOG_OP_REF(const QString&); -CREATE_LOG_OP_REF(const QByteArray&); -CREATE_LOG_OP_REF(const void*); +CREATE_LOG_OP_REF(const char *); +CREATE_LOG_OP_REF(const QString &); +CREATE_LOG_OP_REF(const QByteArray &); +CREATE_LOG_OP_REF(const void *); #undef CREATE_LOG_OP_REF -Logger::Log& Logger::Log::operator<<(const QStringList& t) { +Logger::Log &Logger::Log::operator<<(const QStringList &t) +{ m_data->m_ts << '[' << t.join(",") << ']' << ' '; return *this; } -Logger::Log& Logger::Log::operator<<(const QJsonObject& t) { +Logger::Log &Logger::Log::operator<<(const QJsonObject &t) +{ m_data->m_ts << QJsonDocument(t).toJson(QJsonDocument::Indented) << ' '; return *this; } -Logger::Log& Logger::Log::operator<<(QTextStreamFunction t) { +Logger::Log &Logger::Log::operator<<(QTextStreamFunction t) +{ m_data->m_ts << t; return *this; } -void Logger::Log::addMetaEnum(quint64 value, const QMetaObject* meta, - const char* name) { +void Logger::Log::addMetaEnum(quint64 value, const QMetaObject *meta, const char *name) +{ QMetaEnum me = meta->enumerator(meta->indexOfEnumerator(name)); QString out; QTextStream ts(&out); - if (const char* scope = me.scope()) { + if (const char *scope = me.scope()) { ts << scope << "::"; } - const char* key = me.valueToKey(static_cast(value)); + const char *key = me.valueToKey(static_cast(value)); const bool scoped = me.isScoped(); if (scoped || !key) { ts << me.enumName() << (!key ? "(" : "::"); diff --git a/common/logger/logger.h b/common/logger/logger.h new file mode 100644 index 00000000..7dff7ede --- /dev/null +++ b/common/logger/logger.h @@ -0,0 +1,114 @@ +#ifndef LOGGER_H +#define LOGGER_H + +#include +#include +#include +#include +#include + +#include "mozilla/shared/loglevel.h" + +class Logger : public QObject +{ + Q_OBJECT + +public: + static Logger &Instance(); + + static bool init(bool isServiceLogger); + static void deInit(); + + static bool setServiceLogsEnabled(bool enabled); + + static bool openLogsFolder(bool isServiceLogger); + + static void clearLogs(bool isServiceLogger); + static void clearServiceLogs(); + static void cleanUp(); + + static QString userLogsFilePath(); + static QString serviceLogsFilePath(); + static QString systemLogDir(); + + static QString getLogFile(); + static QString getServiceLogFile(); + + // compat with Mozilla logger + Logger(const QString &className) + { + m_className = className; + } + const QString &className() const + { + return m_className; + } + + class Log + { + public: + Log(Logger *logger, LogLevel level); + ~Log(); + + Log &operator<<(uint64_t t); + Log &operator<<(const char *t); + Log &operator<<(const QString &t); + Log &operator<<(const QStringList &t); + Log &operator<<(const QByteArray &t); + Log &operator<<(const QJsonObject &t); + Log &operator<<(QTextStreamFunction t); + Log &operator<<(const void *t); + + // Q_ENUM + template typename std::enable_if::Value, Log &>::type operator<<(T t) + { + const QMetaObject *meta = qt_getEnumMetaObject(t); + const char *name = qt_getEnumName(t); + addMetaEnum(typename QFlags::Int(t), meta, name); + return *this; + } + + private: + void addMetaEnum(quint64 value, const QMetaObject *meta, const char *name); + + Logger *m_logger; + LogLevel m_logLevel; + + struct Data + { + Data() : m_ts(&m_buffer, QIODevice::WriteOnly) + { + } + + QString m_buffer; + QTextStream m_ts; + }; + + Data *m_data; + }; + + Log error(); + Log warning(); + Log info(); + Log debug(); + QString sensitive(const QString &input); + +private: + Logger() {}; + Logger(Logger const &) = delete; + Logger &operator=(Logger const &) = delete; + + static QString userLogsDir(); + + static QFile m_file; + static QTextStream m_textStream; + static QString m_logFileName; + static QString m_serviceLogFileName; + + friend void debugMessageHandler(QtMsgType type, const QMessageLogContext &context, const QString &msg); + + // compat with Mozilla logger + QString m_className; +}; + +#endif // LOGGER_H diff --git a/ipc/ipc_interface.rep b/ipc/ipc_interface.rep index 5baf9c33..c0f031fe 100644 --- a/ipc/ipc_interface.rep +++ b/ipc/ipc_interface.rep @@ -7,7 +7,6 @@ class IpcInterface { SLOT( int createPrivilegedProcess() ); // return local pid - //SIGNAL(sendMessage(const QByteArray &message)); // Route functions SLOT( int routeAddList(const QString &gw, const QStringList &ips) ); diff --git a/ipc/ipc_process_interface.rep b/ipc/ipc_process_interface.rep index ba42332c..6b3bb654 100644 --- a/ipc/ipc_process_interface.rep +++ b/ipc/ipc_process_interface.rep @@ -3,7 +3,6 @@ class IpcProcessInterface { - //SLOT( start(const QString &program, const QStringList &args) ); SLOT( start() ); SLOT( close() ); diff --git a/ipc/ipc_process_tun2socks.rep b/ipc/ipc_process_tun2socks.rep new file mode 100644 index 00000000..e355035e --- /dev/null +++ b/ipc/ipc_process_tun2socks.rep @@ -0,0 +1,11 @@ +#include +#include + +class IpcProcessTun2Socks +{ + SLOT( start() ); + SLOT( stop() ); + + SIGNAL( setConnectionState(int state) ); + SIGNAL( stateChanged(QProcess::ProcessState newState) ); +}; diff --git a/ipc/ipcserver.cpp b/ipc/ipcserver.cpp index 32fc5f30..bb8a4182 100644 --- a/ipc/ipcserver.cpp +++ b/ipc/ipcserver.cpp @@ -1,32 +1,33 @@ #include "ipcserver.h" -#include #include -#include #include +#include +#include -#include "router.h" #include "logger.h" +#include "router.h" +#include "../core/networkUtilities.h" #include "../client/protocols/protocols_defs.h" #ifdef Q_OS_WIN -#include "tapcontroller_win.h" -#include "../client/platforms/windows/daemon/windowsfirewall.h" -#include "../client/platforms/windows/daemon/windowsdaemon.h" + #include "../client/platforms/windows/daemon/windowsdaemon.h" + #include "../client/platforms/windows/daemon/windowsfirewall.h" + #include "tapcontroller_win.h" #endif #ifdef Q_OS_LINUX -#include "../client/platforms/linux/daemon/linuxfirewall.h" + #include "../client/platforms/linux/daemon/linuxfirewall.h" #endif #ifdef Q_OS_MACOS -#include "../client/platforms/macos/daemon/macosfirewall.h" + #include "../client/platforms/macos/daemon/macosfirewall.h" #endif -IpcServer::IpcServer(QObject *parent): - IpcInterfaceSource(parent) +IpcServer::IpcServer(QObject *parent) : IpcInterfaceSource(parent) -{} +{ +} int IpcServer::createPrivilegedProcess() { @@ -58,23 +59,10 @@ int IpcServer::createPrivilegedProcess() } }); - QObject::connect(pd.serverNode.data(), &QRemoteObjectHost::error, this, [pd](QRemoteObjectNode::ErrorCode errorCode) { - qDebug() << "QRemoteObjectHost::error" << errorCode; - }); + QObject::connect(pd.serverNode.data(), &QRemoteObjectHost::error, this, + [pd](QRemoteObjectNode::ErrorCode errorCode) { qDebug() << "QRemoteObjectHost::error" << errorCode; }); - QObject::connect(pd.serverNode.data(), &QRemoteObjectHost::destroyed, this, [pd]() { - qDebug() << "QRemoteObjectHost::destroyed"; - }); - -// connect(pd.ipcProcess.data(), &IpcServerProcess::finished, this, [this, pid=m_localpid](int exitCode, QProcess::ExitStatus exitStatus){ -// qDebug() << "IpcServerProcess finished" << exitCode << exitStatus; -//// if (m_processes.contains(pid)) { -//// m_processes[pid].ipcProcess.reset(); -//// m_processes[pid].serverNode.reset(); -//// m_processes[pid].localServer.reset(); -//// m_processes.remove(pid); -//// } -// }); + QObject::connect(pd.serverNode.data(), &QRemoteObjectHost::destroyed, this, [pd]() { qDebug() << "QRemoteObjectHost::destroyed"; }); m_processes.insert(m_localpid, pd); @@ -105,7 +93,7 @@ bool IpcServer::routeDeleteList(const QString &gw, const QStringList &ips) qDebug() << "IpcServer::routeDeleteList"; #endif - return Router::routeDeleteList(gw ,ips); + return Router::routeDeleteList(gw, ips); } void IpcServer::flushDns() @@ -158,12 +146,13 @@ void IpcServer::cleanUp() qDebug() << "IpcServer::cleanUp"; #endif - Logger::deinit(); + Logger::deInit(); Logger::cleanUp(); } -void IpcServer::clearLogs() { - Logger::clearLogs(); +void IpcServer::clearLogs() +{ + Logger::clearLogs(true); } bool IpcServer::createTun(const QString &dev, const QString &subnet) @@ -176,7 +165,7 @@ bool IpcServer::deleteTun(const QString &dev) return Router::deleteTun(dev); } -bool IpcServer::updateResolvers(const QString& ifname, const QList& resolvers) +bool IpcServer::updateResolvers(const QString &ifname, const QList &resolvers) { return Router::updateResolvers(ifname, resolvers); } @@ -197,14 +186,12 @@ void IpcServer::setLogsEnabled(bool enabled) #endif if (enabled) { - Logger::init(); - } - else { - Logger::deinit(); + Logger::init(true); + } else { + Logger::deInit(); } } - bool IpcServer::enableKillSwitch(const QJsonObject &configStr, int vpnAdapterIndex) { #ifdef Q_OS_WIN @@ -220,13 +207,11 @@ bool IpcServer::enableKillSwitch(const QJsonObject &configStr, int vpnAdapterInd QStringList allownets; QStringList blocknets; - if (splitTunnelType == 0) - { + if (splitTunnelType == 0) { blockAll = true; allowNets = true; - allownets.append(configStr.value(amnezia::config_key::hostName).toString()); - } else if (splitTunnelType == 1) - { + allownets.append(configStr.value("vpnServer").toString()); + } else if (splitTunnelType == 1) { blockNets = true; for (auto v : splitTunnelSites) { blocknets.append(v.toString()); @@ -234,7 +219,7 @@ bool IpcServer::enableKillSwitch(const QJsonObject &configStr, int vpnAdapterInd } else if (splitTunnelType == 2) { blockAll = true; allowNets = true; - allownets.append(configStr.value(amnezia::config_key::hostName).toString()); + allownets.append(configStr.value("vpnServer").toString()); for (auto v : splitTunnelSites) { allownets.append(v.toString()); } @@ -268,18 +253,17 @@ bool IpcServer::enableKillSwitch(const QJsonObject &configStr, int vpnAdapterInd // double-check + ensure our firewall is installed and enabled. This is necessary as // other software may disable pfctl before re-enabling with their own rules (e.g other VPNs) - if (!MacOSFirewall::isInstalled()) MacOSFirewall::install(); + if (!MacOSFirewall::isInstalled()) + MacOSFirewall::install(); MacOSFirewall::ensureRootAnchorPriority(); MacOSFirewall::setAnchorEnabled(QStringLiteral("000.allowLoopback"), true); MacOSFirewall::setAnchorEnabled(QStringLiteral("100.blockAll"), blockAll); MacOSFirewall::setAnchorEnabled(QStringLiteral("110.allowNets"), allowNets); - MacOSFirewall::setAnchorTable(QStringLiteral("110.allowNets"), allowNets, - QStringLiteral("allownets"), allownets); + MacOSFirewall::setAnchorTable(QStringLiteral("110.allowNets"), allowNets, QStringLiteral("allownets"), allownets); MacOSFirewall::setAnchorEnabled(QStringLiteral("120.blockNets"), blockNets); - MacOSFirewall::setAnchorTable(QStringLiteral("120.blockNets"), blockNets, - QStringLiteral("blocknets"), blocknets); + MacOSFirewall::setAnchorTable(QStringLiteral("120.blockNets"), blockNets, QStringLiteral("blocknets"), blocknets); MacOSFirewall::setAnchorEnabled(QStringLiteral("200.allowVPN"), true); MacOSFirewall::setAnchorEnabled(QStringLiteral("250.blockIPv6"), true); MacOSFirewall::setAnchorEnabled(QStringLiteral("290.allowDHCP"), true); @@ -330,10 +314,8 @@ bool IpcServer::enablePeerTraffic(const QJsonObject &configStr) // Use APP split tunnel if (splitTunnelType == 0 || splitTunnelType == 2) { - config.m_allowedIPAddressRanges.append( - IPAddress(QHostAddress("0.0.0.0"), 0)); - config.m_allowedIPAddressRanges.append( - IPAddress(QHostAddress("::"), 0)); + config.m_allowedIPAddressRanges.append(IPAddress(QHostAddress("0.0.0.0"), 0)); + config.m_allowedIPAddressRanges.append(IPAddress(QHostAddress("::"), 0)); } if (splitTunnelType == 1) { @@ -341,15 +323,14 @@ bool IpcServer::enablePeerTraffic(const QJsonObject &configStr) QString ipRange = v.toString(); if (ipRange.split('/').size() > 1) { config.m_allowedIPAddressRanges.append( - IPAddress(QHostAddress(ipRange.split('/')[0]), atoi(ipRange.split('/')[1].toLocal8Bit()))); + IPAddress(QHostAddress(ipRange.split('/')[0]), atoi(ipRange.split('/')[1].toLocal8Bit()))); } else { - config.m_allowedIPAddressRanges.append( - IPAddress(QHostAddress(ipRange), 32)); + config.m_allowedIPAddressRanges.append(IPAddress(QHostAddress(ipRange), 32)); } } } - config.m_excludedAddresses.append(configStr.value(amnezia::config_key::hostName).toString()); + config.m_excludedAddresses.append(configStr.value("vpnServer").toString()); if (splitTunnelType == 2) { for (auto v : splitTunnelSites) { QString ipRange = v.toString(); @@ -357,7 +338,7 @@ bool IpcServer::enablePeerTraffic(const QJsonObject &configStr) } } - for (const QJsonValue& i : configStr.value(amnezia::config_key::splitTunnelApps).toArray()) { + for (const QJsonValue &i : configStr.value(amnezia::config_key::splitTunnelApps).toArray()) { if (!i.isString()) { break; } @@ -371,7 +352,6 @@ bool IpcServer::enablePeerTraffic(const QJsonObject &configStr) WindowsDaemon::instance()->prepareActivation(config, inetAdapterIndex); WindowsDaemon::instance()->activateSplitTunnel(config, vpnAdapterIndex); - return true; #endif return true; } diff --git a/ipc/ipcserver.h b/ipc/ipcserver.h index 74f88d0f..9810046b 100644 --- a/ipc/ipcserver.h +++ b/ipc/ipcserver.h @@ -9,8 +9,10 @@ #include "ipc.h" #include "ipcserverprocess.h" +#include "ipctun2socksprocess.h" #include "rep_ipc_interface_source.h" +#include "rep_ipc_process_tun2socks_source.h" class IpcServer : public IpcInterfaceSource { @@ -44,10 +46,12 @@ private: ProcessDescriptor (QObject *parent = nullptr) { serverNode = QSharedPointer(new QRemoteObjectHost(parent)); ipcProcess = QSharedPointer(new IpcServerProcess(parent)); + tun2socksProcess = QSharedPointer(new IpcProcessTun2Socks(parent)); localServer = QSharedPointer(new QLocalServer(parent)); } QSharedPointer ipcProcess; + QSharedPointer tun2socksProcess; QSharedPointer serverNode; QSharedPointer localServer; }; diff --git a/ipc/ipctun2socksprocess.cpp b/ipc/ipctun2socksprocess.cpp new file mode 100644 index 00000000..ffcb1bcd --- /dev/null +++ b/ipc/ipctun2socksprocess.cpp @@ -0,0 +1,74 @@ +#include "ipctun2socksprocess.h" +#include "ipc.h" +#include +#include + +#include "../protocols/protocols_defs.h" + +#ifndef Q_OS_IOS + +IpcProcessTun2Socks::IpcProcessTun2Socks(QObject *parent) : + IpcProcessTun2SocksSource(parent), + m_t2sProcess(QSharedPointer(new QProcess())) +{ + connect(m_t2sProcess.data(), &QProcess::stateChanged, this, &IpcProcessTun2Socks::stateChanged); + qDebug() << "IpcProcessTun2Socks::IpcProcessTun2Socks()"; + +} + +IpcProcessTun2Socks::~IpcProcessTun2Socks() +{ + qDebug() << "IpcProcessTun2Socks::~IpcProcessTun2Socks()"; +} + +void IpcProcessTun2Socks::start() +{ + qDebug() << "IpcProcessTun2Socks::start()"; + m_t2sProcess->setProgram(amnezia::permittedProcessPath(static_cast(amnezia::PermittedProcess::Tun2Socks))); + QString XrayConStr = "socks5://127.0.0.1:10808"; + +#ifdef Q_OS_WIN + QStringList arguments({"-device", "tun://tun2", "-proxy", XrayConStr, "-tun-post-up", + QString("cmd /c netsh interface ip set address name=\"tun2\" static %1 255.255.255.255") + .arg(amnezia::protocols::xray::defaultLocalAddr)}); +#endif +#ifdef Q_OS_LINUX + QStringList arguments({"-device", "tun://tun2", "-proxy", XrayConStr}); +#endif +#ifdef Q_OS_MAC + QStringList arguments({"-device", "utun22", "-proxy", XrayConStr}); +#endif + + m_t2sProcess->setArguments(arguments); + + Utils::killProcessByName(m_t2sProcess->program()); + m_t2sProcess->start(); + + connect(m_t2sProcess.data(), &QProcess::readyReadStandardOutput, this, [this]() { + QString line = m_t2sProcess.data()->readAllStandardOutput(); + if (line.contains("[STACK] tun://") && line.contains("<-> socks5://127.0.0.1")) { + emit setConnectionState(Vpn::ConnectionState::Connected); + } + }); + + connect(m_t2sProcess.data(), QOverload::of(&QProcess::finished), this, [this](int exitCode, QProcess::ExitStatus exitStatus) { + qDebug().noquote() << "tun2socks finished, exitCode, exiStatus" << exitCode << exitStatus; + emit setConnectionState(Vpn::ConnectionState::Disconnected); + if (exitStatus != QProcess::NormalExit){ + stop(); + } + if (exitCode !=0 ){ + stop(); + } + }); + + m_t2sProcess->start(); + m_t2sProcess->waitForStarted(); +} + +void IpcProcessTun2Socks::stop() +{ + qDebug() << "IpcProcessTun2Socks::stop()"; + m_t2sProcess->close(); +} +#endif diff --git a/ipc/ipctun2socksprocess.h b/ipc/ipctun2socksprocess.h new file mode 100644 index 00000000..8ce9be1a --- /dev/null +++ b/ipc/ipctun2socksprocess.h @@ -0,0 +1,52 @@ +#ifndef IPCTUN2SOCKSPROCESS_H +#define IPCTUN2SOCKSPROCESS_H + +#include + +#ifndef Q_OS_IOS +#include "rep_ipc_process_tun2socks_source.h" + +namespace Vpn +{ +Q_NAMESPACE + enum ConnectionState { + Unknown, + Disconnected, + Preparing, + Connecting, + Connected, + Disconnecting, + Reconnecting, + Error + }; +Q_ENUM_NS(ConnectionState) +} + + +class IpcProcessTun2Socks : public IpcProcessTun2SocksSource +{ + Q_OBJECT +public: + explicit IpcProcessTun2Socks(QObject *parent = nullptr); + virtual ~IpcProcessTun2Socks(); + + void start() override; + void stop() override; + +signals: + +private: + QSharedPointer m_t2sProcess; +}; + +#else +class IpcProcessTun2Socks : public QObject +{ + Q_OBJECT + +public: + explicit IpcProcessTun2Socks(QObject *parent = nullptr); +}; +#endif + +#endif // IPCTUN2SOCKSPROCESS_H diff --git a/service/server/CMakeLists.txt b/service/server/CMakeLists.txt index 234dfafe..0f101087 100644 --- a/service/server/CMakeLists.txt +++ b/service/server/CMakeLists.txt @@ -18,8 +18,9 @@ set(HEADERS ${CMAKE_CURRENT_LIST_DIR}/../../ipc/ipc.h ${CMAKE_CURRENT_LIST_DIR}/../../ipc/ipcserver.h ${CMAKE_CURRENT_LIST_DIR}/../../ipc/ipcserverprocess.h + ${CMAKE_CURRENT_LIST_DIR}/../../ipc/ipctun2socksprocess.h ${CMAKE_CURRENT_LIST_DIR}/localserver.h - ${CMAKE_CURRENT_LIST_DIR}/logger.h + ${CMAKE_CURRENT_LIST_DIR}/../../common/logger/logger.h ${CMAKE_CURRENT_LIST_DIR}/router.h ${CMAKE_CURRENT_LIST_DIR}/systemservice.h ${CMAKE_CURRENT_BINARY_DIR}/version.h @@ -30,8 +31,9 @@ set(SOURCES ${CMAKE_CURRENT_LIST_DIR}/../../client/core/networkUtilities.cpp ${CMAKE_CURRENT_LIST_DIR}/../../ipc/ipcserver.cpp ${CMAKE_CURRENT_LIST_DIR}/../../ipc/ipcserverprocess.cpp + ${CMAKE_CURRENT_LIST_DIR}/../../ipc/ipctun2socksprocess.cpp ${CMAKE_CURRENT_LIST_DIR}/localserver.cpp - ${CMAKE_CURRENT_LIST_DIR}/logger.cpp + ${CMAKE_CURRENT_LIST_DIR}/../../common/logger/logger.cpp ${CMAKE_CURRENT_LIST_DIR}/main.cpp ${CMAKE_CURRENT_LIST_DIR}/router.cpp ${CMAKE_CURRENT_LIST_DIR}/systemservice.cpp @@ -238,6 +240,7 @@ include_directories( ${CMAKE_CURRENT_LIST_DIR} ${CMAKE_CURRENT_LIST_DIR}/../../client ${CMAKE_CURRENT_LIST_DIR}/../../ipc + ${CMAKE_CURRENT_LIST_DIR}/../../common/logger ${CMAKE_CURRENT_BINARY_DIR} ) @@ -278,6 +281,7 @@ endif() qt_add_repc_sources(${PROJECT} ${CMAKE_CURRENT_LIST_DIR}/../../ipc/ipc_interface.rep) qt_add_repc_sources(${PROJECT} ${CMAKE_CURRENT_LIST_DIR}/../../ipc/ipc_process_interface.rep) +qt_add_repc_sources(${PROJECT} ${CMAKE_CURRENT_LIST_DIR}/../../ipc/ipc_process_tun2socks.rep) # copy deploy artifacts required to run the application to the debug build folder if(WIN32) diff --git a/service/server/localserver.cpp b/service/server/localserver.cpp index 3e1b0954..8a5079cb 100644 --- a/service/server/localserver.cpp +++ b/service/server/localserver.cpp @@ -37,6 +37,7 @@ LocalServer::LocalServer(QObject *parent) : QObject(parent), if (!m_isRemotingEnabled) { m_isRemotingEnabled = true; m_serverNode.enableRemoting(&m_ipcServer); + m_serverNode.enableRemoting(&m_tun2socks); } }); diff --git a/service/server/localserver.h b/service/server/localserver.h index 4a6648a5..3c565d3b 100644 --- a/service/server/localserver.h +++ b/service/server/localserver.h @@ -38,6 +38,7 @@ public: ~LocalServer(); QSharedPointer m_server; IpcServer m_ipcServer; + IpcProcessTun2Socks m_tun2socks; QRemoteObjectHost m_serverNode; bool m_isRemotingEnabled = false; #ifdef Q_OS_LINUX diff --git a/service/server/logger.cpp b/service/server/logger.cpp deleted file mode 100644 index ab658796..00000000 --- a/service/server/logger.cpp +++ /dev/null @@ -1,185 +0,0 @@ -#include "logger.h" - -#include -#include -#include -#include - -#include - -#include "version.h" -#include "utilities.h" - -QFile Logger::m_file; -QTextStream Logger::m_textStream; -QString Logger::m_logFileName = QString("%1.log").arg(SERVICE_NAME); - -void debugMessageHandler(QtMsgType type, const QMessageLogContext& context, const QString& msg) -{ - if (msg.simplified().isEmpty()) { - return; - } - - Logger::m_textStream << qFormatLogMessage(type, context, msg) << Qt::endl << Qt::flush; - - std::cout << qFormatLogMessage(type, context, msg).toStdString() << std::endl << std::flush; -} - -bool Logger::init() -{ - if (m_file.isOpen()) return true; - - QString path = Utils::systemLogPath(); - QDir appDir(path); - if (!appDir.mkpath(path)) { - return false; - } - - qSetMessagePattern("%{time yyyy-MM-dd hh:mm:ss} %{type} %{message}"); - - m_file.setFileName(appDir.filePath(m_logFileName)); - if (!m_file.open(QIODevice::Append)) { - qWarning() << "Cannot open log file:" << m_logFileName; - return false; - } - m_file.setTextModeEnabled(true); - m_textStream.setDevice(&m_file); - qInstallMessageHandler(debugMessageHandler); - - return true; -} - -void Logger::deinit() -{ - m_file.close(); - m_textStream.setDevice(nullptr); - qInstallMessageHandler(nullptr); -} - -QString Logger::serviceLogFileNamePath() -{ - return m_file.fileName(); -} - -void Logger::clearLogs() -{ - bool isLogActive = m_file.isOpen(); - m_file.close(); - - - QString path = Utils::systemLogPath(); - QDir appDir(path); - QFile file; - file.setFileName(appDir.filePath(m_logFileName)); - - file.open(QIODevice::WriteOnly | QIODevice::Truncate); - file.resize(0); - file.close(); - - if (isLogActive) { - init(); - } -} - -void Logger::cleanUp() -{ - clearLogs(); - deinit(); - - QString path = Utils::systemLogPath(); - QDir appDir(path); - - { - QFile file; - file.setFileName(appDir.filePath(m_logFileName)); - file.remove(); - } - { - QFile file; - file.setFileName(appDir.filePath("openvpn.log")); - file.remove(); - } - -#ifdef Q_OS_WINDOWS - QDir dir(Utils::systemLogPath()); - dir.removeRecursively(); -#endif -} - - -Logger::Log::Log(Logger* logger, LogLevel logLevel) - : m_logger(logger), m_logLevel(logLevel), m_data(new Data()) {} - -Logger::Log::~Log() { - qDebug() << "Amnezia" << m_logger->className() << m_data->m_buffer.trimmed(); - delete m_data; -} - -Logger::Log Logger::error() { return Log(this, LogLevel::Error); } -Logger::Log Logger::warning() { return Log(this, LogLevel::Warning); } -Logger::Log Logger::info() { return Log(this, LogLevel::Info); } -Logger::Log Logger::debug() { return Log(this, LogLevel::Debug); } -QString Logger::sensitive(const QString& input) { -#ifdef Q_DEBUG - return input; -#else - Q_UNUSED(input); - return QString(8, 'X'); -#endif -} - - -#define CREATE_LOG_OP_REF(x) \ -Logger::Log& Logger::Log::operator<<(x t) { \ - m_data->m_ts << t << ' '; \ - return *this; \ -} - -CREATE_LOG_OP_REF(uint64_t); -CREATE_LOG_OP_REF(const char*); -CREATE_LOG_OP_REF(const QString&); -CREATE_LOG_OP_REF(const QByteArray&); -CREATE_LOG_OP_REF(const void*); - -#undef CREATE_LOG_OP_REF - -Logger::Log& Logger::Log::operator<<(const QStringList& t) { - m_data->m_ts << '[' << t.join(",") << ']' << ' '; - return *this; -} - -Logger::Log& Logger::Log::operator<<(const QJsonObject& t) { - m_data->m_ts << QJsonDocument(t).toJson(QJsonDocument::Indented) << ' '; - return *this; -} - -Logger::Log& Logger::Log::operator<<(QTextStreamFunction t) { - m_data->m_ts << t; - return *this; -} - -void Logger::Log::addMetaEnum(quint64 value, const QMetaObject* meta, - const char* name) { - QMetaEnum me = meta->enumerator(meta->indexOfEnumerator(name)); - - QString out; - QTextStream ts(&out); - - if (const char* scope = me.scope()) { - ts << scope << "::"; - } - - const char* key = me.valueToKey(static_cast(value)); - const bool scoped = me.isScoped(); - if (scoped || !key) { - ts << me.enumName() << (!key ? "(" : "::"); - } - - if (key) { - ts << key; - } else { - ts << value << ")"; - } - - m_data->m_ts << out; -} diff --git a/service/server/logger.h b/service/server/logger.h deleted file mode 100644 index bb920931..00000000 --- a/service/server/logger.h +++ /dev/null @@ -1,83 +0,0 @@ -#ifndef LOGGER_H -#define LOGGER_H - -#include -#include -#include -#include - -#include "mozilla/shared/loglevel.h" - -class Logger -{ -public: - static bool init(); - static void deinit(); - - static QString serviceLogFileNamePath(); - - static void clearLogs(); - static void cleanUp(); - - // compat with Mozilla logger - Logger(const QString &className) { m_className = className; } - const QString& className() const { return m_className; } - - class Log { - public: - Log(Logger* logger, LogLevel level); - ~Log(); - - Log& operator<<(uint64_t t); - Log& operator<<(const char* t); - Log& operator<<(const QString& t); - Log& operator<<(const QStringList& t); - Log& operator<<(const QByteArray& t); - Log& operator<<(const QJsonObject& t); - Log& operator<<(QTextStreamFunction t); - Log& operator<<(const void* t); - - // Q_ENUM - template - typename std::enable_if::Value, Log&>::type - operator<<(T t) { - const QMetaObject* meta = qt_getEnumMetaObject(t); - const char* name = qt_getEnumName(t); - addMetaEnum(typename QFlags::Int(t), meta, name); - return *this; - } - - private: - void addMetaEnum(quint64 value, const QMetaObject* meta, const char* name); - - Logger* m_logger; - LogLevel m_logLevel; - - struct Data { - Data() : m_ts(&m_buffer, QIODevice::WriteOnly) {} - - QString m_buffer; - QTextStream m_ts; - }; - - Data* m_data; - }; - - Log error(); - Log warning(); - Log info(); - Log debug(); - QString sensitive(const QString& input); - -private: - friend void debugMessageHandler(QtMsgType type, const QMessageLogContext& context, const QString& msg); - - static QFile m_file; - static QString m_logFileName; - static QTextStream m_textStream; - - // compat with Mozilla logger - QString m_className; -}; - -#endif // LOGGER_H diff --git a/service/server/main.cpp b/service/server/main.cpp index 144ddf60..cee33d72 100644 --- a/service/server/main.cpp +++ b/service/server/main.cpp @@ -44,7 +44,7 @@ int runApplication(int argc, char** argv) int main(int argc, char **argv) { - Utils::initializePath(Utils::systemLogPath()); + Utils::initializePath(Logger::systemLogDir()); if (argc >= 2) { qInfo() << "Started as console application";