Compare commits

..

39 Commits

Author SHA1 Message Date
Macbook
2c54fe7776 update 2024-10-24 19:12:49 +07:00
Macbook
d0b85813c7 final clean code 2024-10-13 17:06:56 +07:00
Macbook
484d33e922 test build Mac NE change build 2024-10-11 23:51:45 +07:00
Macbook
b3cd6e03a2 test build Mac NE change build 2024-10-11 23:38:56 +07:00
Macbook
1cdb8b33ee test build Mac NE change build 2024-10-11 23:14:16 +07:00
Macbook
e4679ff1fb test build Mac NE change build 2024-10-11 23:05:55 +07:00
Macbook
6ef03f9374 test build Mac NE change build 2024-10-11 22:58:15 +07:00
Macbook
e6c3ece85c test build Mac NE change build 2024-10-11 22:51:01 +07:00
Macbook
f8b951a428 test build Mac NE change build 2024-10-11 22:45:32 +07:00
Macbook
ea1a7e8701 test build Mac NE change build 2024-10-11 22:41:01 +07:00
Macbook
4700947fcb test build Mac NE change build 2024-10-11 22:27:36 +07:00
Macbook
e1d23c6738 test build Mac NE 2024-10-11 22:04:20 +07:00
Macbook
bfc2ac6c32 error: No profiles for NE 2024-10-10 20:49:45 +07:00
Macbook
9fc1df38cc add target 2024-10-10 17:33:27 +07:00
Macbook
336850624f input QT_PATH 2024-10-10 17:14:36 +07:00
Macbook
4287e5aa76 input QT_BIN_DIR 2024-10-10 17:08:22 +07:00
Macbook
c9b61f48cf input QT_BIN_DIR 2024-10-10 17:07:13 +07:00
Macbook
4c9a249695 chaneg version QT 2024-10-10 16:59:29 +07:00
Macbook
d0db1293b5 fix bug qt-cmake 2024-10-09 23:17:33 +07:00
Macbook
aaa8030348 fix bug qt-cmake 2024-10-09 23:15:55 +07:00
Macbook
3c3d4252f2 fix bug qt-cmake 2024-10-09 23:04:00 +07:00
Macbook
56d6ab2dd5 fix bug qt-cmake 2024-10-09 22:45:15 +07:00
Macbook
b93c5f3e57 fix bug qt-cmake 2024-10-09 22:41:32 +07:00
Macbook
9ddfa54352 fix bug QIF_VERSION 2024-10-09 22:31:53 +07:00
Macbook
1e893c2260 fix bug QT_BIN_DIR 2024-10-09 22:25:06 +07:00
Macbook
7d186c3c84 fix bug QT_BIN_DIR 2024-10-09 22:13:52 +07:00
Macbook
31938899a2 update build.sh 2024-10-09 21:59:25 +07:00
Macbook
b338a4fb79 update build.sh 2024-10-09 21:53:33 +07:00
Macbook
0500f1887c add qtmultimedia 2024-10-09 21:16:57 +07:00
Macbook
226f9b9316 add build ci/cd for macos ne 2024-10-09 21:04:35 +07:00
Macbook
ae16b19515 fix build on github 2024-10-09 20:44:00 +07:00
Macbook
5569524efa update all lib 2024-10-09 14:58:53 +07:00
Macbook
e2099b1682 clean source code 2024-10-08 21:33:36 +07:00
Macbook
022444ad63 Removed OpenVPNAdapter.bk submodule 2024-10-08 11:43:01 +07:00
Macbook
7da585fc27 update final code and cmake build file 2024-10-07 21:42:45 +07:00
Macbook
b1ad874f14 refactor code for iOS and MacNE 2024-10-06 23:07:21 +07:00
Macbook
f7aa82331e final build network extension 2024-10-05 11:16:57 +07:00
Macbook
b6601d051a error UIKet 2024-10-05 00:10:05 +07:00
Anh TV
1e60792f0c Merge to dev branch 2024-10-04 21:52:50 +07:00
126 changed files with 2280 additions and 901 deletions

View File

@@ -16,10 +16,7 @@ jobs:
QT_VERSION: 6.6.2
QIF_VERSION: 4.7
PROD_AGW_PUBLIC_KEY: ${{ secrets.PROD_AGW_PUBLIC_KEY }}
PROD_S3_ENDPOINT: ${{ secrets.PROD_S3_ENDPOINT }}
DEV_AGW_PUBLIC_KEY: ${{ secrets.DEV_AGW_PUBLIC_KEY }}
DEV_AGW_ENDPOINT: ${{ secrets.DEV_AGW_ENDPOINT }}
DEV_S3_ENDPOINT: ${{ secrets.DEV_S3_ENDPOINT }}
steps:
- name: 'Install Qt'
@@ -86,10 +83,7 @@ jobs:
QIF_VERSION: 4.7
BUILD_ARCH: 64
PROD_AGW_PUBLIC_KEY: ${{ secrets.PROD_AGW_PUBLIC_KEY }}
PROD_S3_ENDPOINT: ${{ secrets.PROD_S3_ENDPOINT }}
DEV_AGW_PUBLIC_KEY: ${{ secrets.DEV_AGW_PUBLIC_KEY }}
DEV_AGW_ENDPOINT: ${{ secrets.DEV_AGW_ENDPOINT }}
DEV_S3_ENDPOINT: ${{ secrets.DEV_S3_ENDPOINT }}
steps:
- name: 'Get sources'
@@ -152,10 +146,7 @@ jobs:
CC: cc
CXX: c++
PROD_AGW_PUBLIC_KEY: ${{ secrets.PROD_AGW_PUBLIC_KEY }}
PROD_S3_ENDPOINT: ${{ secrets.PROD_S3_ENDPOINT }}
DEV_AGW_PUBLIC_KEY: ${{ secrets.DEV_AGW_PUBLIC_KEY }}
DEV_AGW_ENDPOINT: ${{ secrets.DEV_AGW_ENDPOINT }}
DEV_S3_ENDPOINT: ${{ secrets.DEV_S3_ENDPOINT }}
steps:
- name: 'Setup xcode'
@@ -247,10 +238,7 @@ jobs:
QT_VERSION: 6.4.3
QIF_VERSION: 4.6
PROD_AGW_PUBLIC_KEY: ${{ secrets.PROD_AGW_PUBLIC_KEY }}
PROD_S3_ENDPOINT: ${{ secrets.PROD_S3_ENDPOINT }}
DEV_AGW_PUBLIC_KEY: ${{ secrets.DEV_AGW_PUBLIC_KEY }}
DEV_AGW_ENDPOINT: ${{ secrets.DEV_AGW_ENDPOINT }}
DEV_S3_ENDPOINT: ${{ secrets.DEV_S3_ENDPOINT }}
steps:
- name: 'Setup xcode'
@@ -306,6 +294,70 @@ jobs:
path: deploy/build/client/AmneziaVPN.app
retention-days: 7
# ------------------------------------------------------
Build-MacOS-NE:
runs-on: macos-latest
env:
QT_VERSION: 6.4.3
QIF_VERSION: 4.6
QT_MIRROR: https://mirrors.ocf.berkeley.edu/qt/
PROD_AGW_PUBLIC_KEY: ${{ secrets.PROD_AGW_PUBLIC_KEY }}
DEV_AGW_PUBLIC_KEY: ${{ secrets.DEV_AGW_PUBLIC_KEY }}
steps:
- name: 'Setup Xcode'
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '14.3.1'
- name: 'Install desktop Qt'
uses: jurplel/install-qt-action@v3
with:
version: ${{ env.QT_VERSION }}
host: 'mac'
target: 'desktop'
modules: 'qtremoteobjects qt5compat qtshadertools qtmultimedia'
arch: 'clang_64'
dir: ${{ runner.temp }}
set-env: 'true'
extra: '--base ${{ env.QT_MIRROR }}'
- name: 'Install Qt Installer Framework ${{ env.QIF_VERSION }}'
run: |
mkdir -pv ${{ runner.temp }}/Qt/Tools/QtInstallerFramework
wget https://qt.amzsvc.com/tools/ifw/${{ env.QIF_VERSION }}.zip
unzip ${{ env.QIF_VERSION }}.zip -d ${{ runner.temp }}/Qt/Tools/QtInstallerFramework/
- name: 'Install Go'
uses: actions/setup-go@v5
with:
go-version: '1.22.1'
cache: false
- name: 'Get sources'
uses: actions/checkout@v4
with:
submodules: 'true'
fetch-depth: 10
- name: 'Install dependencies'
run: pip install jsonschema jinja2
- name: 'Set execute permissions for deploy script'
run: chmod +x deploy/build_macos_ne.sh
- name: 'Build and deploy macOS NE'
run: |
export QT_BIN_DIR="${{ runner.temp }}/Qt/${{ env.QT_VERSION }}/macos/bin"
export QIF_BIN_DIR="${{ runner.temp }}/Qt/Tools/QtInstallerFramework/${{ env.QIF_VERSION }}/bin"
export QT_MACOS_ROOT_DIR="${{ runner.temp }}/Qt/${{ env.QT_VERSION }}/macos"
bash deploy/build_macos_ne.sh
env:
APPSTORE_CONNECT_KEY_ID: ${{ secrets.APPSTORE_CONNECT_KEY_ID }}
APPSTORE_CONNECT_ISSUER_ID: ${{ secrets.APPSTORE_CONNECT_ISSUER_ID }}
APPSTORE_CONNECT_PRIVATE_KEY: ${{ secrets.APPSTORE_CONNECT_PRIVATE_KEY }}
MAC_TRUST_CERT_BASE64: ${{ secrets.IOS_TRUST_CERT_BASE64 }}
MAC_SIGNING_CERT_BASE64: ${{ secrets.IOS_SIGNING_CERT_BASE64 }}
MAC_SIGNING_CERT_PASSWORD: ${{ secrets.IOS_SIGNING_CERT_PASSWORD }}
# ------------------------------------------------------
Build-Android:
@@ -313,13 +365,10 @@ jobs:
env:
ANDROID_BUILD_PLATFORM: android-34
QT_VERSION: 6.7.3
QT_VERSION: 6.7.2
QT_MODULES: 'qtremoteobjects qt5compat qtimageformats qtshadertools'
PROD_AGW_PUBLIC_KEY: ${{ secrets.PROD_AGW_PUBLIC_KEY }}
PROD_S3_ENDPOINT: ${{ secrets.PROD_S3_ENDPOINT }}
DEV_AGW_PUBLIC_KEY: ${{ secrets.DEV_AGW_PUBLIC_KEY }}
DEV_AGW_ENDPOINT: ${{ secrets.DEV_AGW_ENDPOINT }}
DEV_S3_ENDPOINT: ${{ secrets.DEV_S3_ENDPOINT }}
steps:
- name: 'Install desktop Qt'

View File

@@ -16,10 +16,7 @@ jobs:
QT_VERSION: 6.4.1
QIF_VERSION: 4.5
PROD_AGW_PUBLIC_KEY: ${{ secrets.PROD_AGW_PUBLIC_KEY }}
PROD_S3_ENDPOINT: ${{ secrets.PROD_S3_ENDPOINT }}
DEV_AGW_PUBLIC_KEY: ${{ secrets.DEV_AGW_PUBLIC_KEY }}
DEV_AGW_ENDPOINT: ${{ secrets.DEV_AGW_ENDPOINT }}
DEV_S3_ENDPOINT: ${{ secrets.DEV_S3_ENDPOINT }}
steps:
- name: 'Install desktop Qt'

2
.gitmodules vendored
View File

@@ -1,6 +1,7 @@
[submodule "client/3rd/OpenVPNAdapter"]
path = client/3rd/OpenVPNAdapter
url = https://github.com/amnezia-vpn/OpenVPNAdapter.git
branch = macos-dirty-build
[submodule "client/3rd/qtkeychain"]
path = client/3rd/qtkeychain
url = https://github.com/frankosterfeld/qtkeychain.git
@@ -10,6 +11,7 @@
[submodule "client/3rd-prebuilt"]
path = client/3rd-prebuilt
url = https://github.com/amnezia-vpn/3rd-prebuilt
branch = fixbug/mac-network-extension
[submodule "client/3rd/amneziawg-apple"]
path = client/3rd/amneziawg-apple
url = https://github.com/amnezia-vpn/amneziawg-apple

View File

@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.25.0 FATAL_ERROR)
set(PROJECT AmneziaVPN)
project(${PROJECT} VERSION 4.8.2.3
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 2069)
set(APP_ANDROID_VERSION_CODE 65)
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
set(MZ_PLATFORM_NAME "linux")
@@ -26,18 +26,20 @@ elseif(${CMAKE_SYSTEM_NAME} STREQUAL "iOS")
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Emscripten")
set(MZ_PLATFORM_NAME "wasm")
endif()
message(STATUS "Platform: ${MZ_PLATFORM_NAME}")
message(STATUS "Version: ${MACOS_NE}")
set(QT_BUILD_TOOLS_WHEN_CROSS_COMPILING ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
if(APPLE AND NOT IOS)
if((APPLE AND NOT IOS) OR (DEFINED MACOS_NE AND MACOS_NE AND NOT IOS))
set(CMAKE_OSX_ARCHITECTURES "x86_64")
endif()
add_subdirectory(client)
if(NOT IOS AND NOT ANDROID)
# Mac OSX with Network Extension don't need service
if(NOT IOS AND NOT ANDROID AND NOT MACOS_NE)
add_subdirectory(service)
include(${CMAKE_SOURCE_DIR}/deploy/installer/config.cmake)

View File

@@ -10,17 +10,21 @@ Amnezia is an open-source VPN client, with a key feature that enables you to dep
<br>
<a href="https://amnezia.org/downloads"><img src="https://github.com/amnezia-vpn/amnezia-client/blob/dev/metadata/img-readme/download.png" width="150" style="max-width: 100%;"></a>
<a href="https://github.com/amnezia-vpn/amnezia-client/releases/download/4.7.0.0/AmneziaVPN_4.7.0.0_x64.exe"><img src="https://github.com/amnezia-vpn/amnezia-client/blob/dev/metadata/img-readme/win.png" width="150" style="max-width: 100%;"></a>
<a href="https://github.com/amnezia-vpn/amnezia-client/releases/download/4.7.0.0/AmneziaVPN_4.7.0.0.dmg"><img src="https://github.com/amnezia-vpn/amnezia-client/blob/dev/metadata/img-readme/mac.png" width="150" style="max-width: 100%;"></a>
<a href="https://github.com/amnezia-vpn/amnezia-client/releases/download/4.7.0.0/AmneziaVPN_Linux_4.7.0.0.tar.zip"><img src="https://github.com/amnezia-vpn/amnezia-client/blob/dev/metadata/img-readme/lin.png" width="150" style="max-width: 100%;"></a>
<a href="https://github.com/amnezia-vpn/amnezia-client/releases/tag/4.7.0.0"><img src="https://github.com/amnezia-vpn/amnezia-client/blob/dev/metadata/img-readme/andr.png" width="150" style="max-width: 100%;"></a>
<br>
<a href="https://play.google.com/store/search?q=amnezia+vpn&c=apps"><img src="https://github.com/amnezia-vpn/amnezia-client/blob/dev/metadata/img-readme/play.png" width="150" style="max-width: 100%;"></a>
<a href="https://apps.apple.com/us/app/amneziavpn/id1600529900"><img src="https://github.com/amnezia-vpn/amnezia-client/blob/dev/metadata/img-readme/apl.png" width="150" style="max-width: 100%;"></a>
[Alternative download link (mirror)](https://storage.googleapis.com/kldscp/amnezia.org/downloads)
[All releases](https://github.com/amnezia-vpn/amnezia-client/releases)
<br>
<a href="https://www.testiny.io"><img src="https://github.com/amnezia-vpn/amnezia-client/blob/dev/metadata/img-readme/testiny.png" height="28px"></a>
## Features
@@ -33,7 +37,7 @@ Amnezia is an open-source VPN client, with a key feature that enables you to dep
## Links
- [https://amnezia.org](https://amnezia.org) - project website | [Alternative link (mirror)](https://storage.googleapis.com/kldscp/amnezia.org)
- [https://amnezia.org](https://amnezia.org) - project website
- [https://www.reddit.com/r/AmneziaVPN](https://www.reddit.com/r/AmneziaVPN) - Reddit
- [https://t.me/amnezia_vpn_en](https://t.me/amnezia_vpn_en) - Telegram support channel (English)
- [https://t.me/amnezia_vpn_ir](https://t.me/amnezia_vpn_ir) - Telegram support channel (Farsi)

View File

@@ -25,17 +25,17 @@ execute_process(
add_definitions(-DGIT_COMMIT_HASH="${GIT_COMMIT_HASH}")
add_definitions(-DPROD_AGW_PUBLIC_KEY="$ENV{PROD_AGW_PUBLIC_KEY}")
add_definitions(-DPROD_S3_ENDPOINT="$ENV{PROD_S3_ENDPOINT}")
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}")
add_definitions(-DDEV_S3_ENDPOINT="$ENV{DEV_S3_ENDPOINT}")
if(IOS)
if(IOS OR MACOS_NE)
set(PACKAGES ${PACKAGES} Multimedia)
endif()
if(WIN32 OR (APPLE AND NOT IOS) OR (LINUX AND NOT ANDROID))
#Macos Network Extension doesn't need Widgets
if(WIN32 OR (APPLE AND NOT IOS AND NOT MACOS_NE) OR (LINUX AND NOT ANDROID))
set(PACKAGES ${PACKAGES} Widgets)
endif()
@@ -48,18 +48,23 @@ set(LIBS ${LIBS}
Qt6::Core5Compat Qt6::Concurrent
)
if(IOS)
if(IOS OR MACOS_NE)
set(LIBS ${LIBS} Qt6::Multimedia)
endif()
# message("Client desktop build ", ${MACOS_NE})
#Macos Network Extension doesn't need Widgets
if(WIN32 OR (APPLE AND NOT IOS) OR (LINUX AND NOT ANDROID))
if(WIN32 OR (APPLE AND NOT IOS AND NOT MACOS_NE) OR (LINUX AND NOT ANDROID))
message("Run this block when MACOS_NE is not defined or set to FALSE")
set(LIBS ${LIBS} Qt6::Widgets)
endif()
qt_standard_project_setup()
qt_add_executable(${PROJECT} MANUAL_FINALIZATION)
if(WIN32 OR (APPLE AND NOT IOS) OR (LINUX AND NOT ANDROID))
# TODO error in there
if(WIN32 OR (APPLE AND NOT IOS AND NOT MACOS_NE) OR (LINUX AND NOT ANDROID))
message("Run this block when MACOS_NE is not defined or set to FALSE")
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)
@@ -97,10 +102,18 @@ qt6_add_resources(QRC ${I18NQRC} ${CMAKE_CURRENT_BINARY_DIR}/translations.qrc)
# -- i18n end
if(IOS)
message("Building for iOS")
execute_process(COMMAND bash ${CMAKE_CURRENT_LIST_DIR}/ios/scripts/openvpn.sh args
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR})
endif()
# Build openvpn adapter for MacOS Network Extension
if(MACOS_NE)
message("Building for MacOS Network Extension")
execute_process(COMMAND bash ${CMAKE_CURRENT_LIST_DIR}/macos/scripts/openvpn.sh args
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR})
endif()
set(IS_CI ${CI})
if(IS_CI)
message("Detected CI env")
@@ -161,12 +174,24 @@ include_directories(mozilla)
include_directories(mozilla/shared)
include_directories(mozilla/models)
if(NOT IOS)
if(MACOS_NE)
message("MACOS_NE is ON")
add_definitions(-DQ_OS_IOS)
add_definitions(-DMACOS_NE)
message("Add macros for MacOS Network Extension")
else()
message("MACOS_NE is OFF")
endif()
if(NOT IOS AND NOT MACOS_NE)
message(" Add header for non-IOS and non-MACOS_NE")
set(HEADERS ${HEADERS}
${CMAKE_CURRENT_LIST_DIR}/platforms/ios/QRCodeReaderBase.h
)
endif()
if(NOT ANDROID)
set(HEADERS ${HEADERS}
${CMAKE_CURRENT_LIST_DIR}/ui/notificationhandler.h
@@ -211,7 +236,7 @@ if(CMAKE_BUILD_TYPE STREQUAL "Debug")
target_compile_definitions(${PROJECT} PRIVATE "MZ_DEBUG")
endif()
if(NOT IOS)
if(NOT IOS AND NOT MACOS_NE)
set(SOURCES ${SOURCES}
${CMAKE_CURRENT_LIST_DIR}/platforms/ios/QRCodeReaderBase.cpp
)
@@ -319,10 +344,11 @@ if(LINUX AND NOT ANDROID)
link_directories(${CMAKE_CURRENT_LIST_DIR}/platforms/linux)
endif()
if(WIN32 OR (APPLE AND NOT IOS) OR (LINUX AND NOT ANDROID))
message("Client desktop build")
# Macos Network Extension doesn't need
if(WIN32 OR (APPLE AND NOT IOS AND NOT MACOS_NE) OR (LINUX AND NOT ANDROID))
message("-----> Client desktop build")
add_compile_definitions(AMNEZIA_DESKTOP)
message("-----> Add AMNEZIA_DESKTOP")
set(HEADERS ${HEADERS}
${CMAKE_CURRENT_LIST_DIR}/core/ipcclient.h
${CMAKE_CURRENT_LIST_DIR}/core/privileged_process.h
@@ -355,9 +381,12 @@ endif()
if(IOS)
include(cmake/ios.cmake)
include(cmake/ios-arch-fixup.cmake)
elseif(APPLE AND NOT IOS)
include(cmake/osxtools.cmake)
elseif(APPLE AND NOT IOS AND NOT DEFINED MACOS_NE)
# include(cmake/osxtools.cmake)
include(cmake/macos.cmake)
elseif(APPLE AND NOT IOS AND MACOS_NE)
include(cmake/osxtools.cmake)
include(cmake/macos_ne.cmake)
endif()
target_link_libraries(${PROJECT} PRIVATE ${LIBS})
@@ -376,7 +405,7 @@ elseif(APPLE AND NOT IOS)
set(DEPLOY_PLATFORM_PATH "macos")
endif()
if(NOT IOS AND NOT ANDROID)
if(NOT IOS AND NOT ANDROID AND NOT MACOS_NE)
add_custom_command(
TARGET ${PROJECT} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E $<IF:$<CONFIG:Debug>,copy_directory,true>
@@ -395,4 +424,36 @@ if(NOT IOS AND NOT ANDROID)
endif()
target_sources(${PROJECT} PRIVATE ${SOURCES} ${HEADERS} ${RESOURCES} ${QRC} ${I18NQRC})
if(MACOS_NE)
message("Copy MacOS Network Extension files")
message("QT_HOST_PATH: $ENV{QT_MACOS_ROOT_DIR}")
add_custom_command(TARGET ${PROJECT} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory
"$<TARGET_BUNDLE_DIR:AmneziaVPN>/Contents/Frameworks"
COMMAND ${CMAKE_COMMAND} -E copy_directory
"$ENV{QT_MACOS_ROOT_DIR}/lib/QtConcurrent.framework"
"$<TARGET_BUNDLE_DIR:AmneziaVPN>/Contents/Frameworks/QtConcurrent.framework"
COMMENT "Copying QtConcurrent.framework from QT_MACOS_ROOT_DIR to the bundle's Frameworks directory"
)
# MacOS specific application deployment
add_custom_command(TARGET ${PROJECT} POST_BUILD
COMMAND ${QT_BIN_DIR_DETECTED}/macdeployqt $<TARGET_BUNDLE_DIR:AmneziaVPN> -appstore-compliant -qmldir=${CMAKE_CURRENT_SOURCE_DIR}
)
# MacOS specific code signing for Release
if(CMAKE_BUILD_TYPE STREQUAL "Release")
SET(SIGN_CMD codesign --deep --force --sign 'Apple Distribution: Privacy Technologies OU \(X7UJ388FXK\)' --timestamp --options runtime $<TARGET_BUNDLE_DIR:AmneziaVPN>)
message("Manual signing bundle...")
message(${SIGN_CMD})
add_custom_command(TARGET ${PROJECT} POST_BUILD
COMMAND ${SIGN_CMD}
)
endif()
endif()
qt_finalize_target(${PROJECT})

View File

@@ -111,11 +111,10 @@ void AmneziaApplication::init()
qFatal("Android controller initialization failed");
}
connect(AndroidController::instance(), &AndroidController::importConfigFromOutside, this, [this](QString data) {
emit m_pageController->goToPageHome();
connect(AndroidController::instance(), &AndroidController::importConfigFromOutside, [this](QString data) {
m_pageController->goToPageHome();
m_importController->extractConfigFromData(data);
data.clear();
emit m_pageController->goToPageViewConfig();
m_pageController->goToPageViewConfig();
});
m_engine->addImageProvider(QLatin1String("installedAppImage"), new InstalledAppsImageProvider);
@@ -123,16 +122,16 @@ void AmneziaApplication::init()
#ifdef Q_OS_IOS
IosController::Instance()->initialize();
connect(IosController::Instance(), &IosController::importConfigFromOutside, this, [this](QString data) {
emit m_pageController->goToPageHome();
connect(IosController::Instance(), &IosController::importConfigFromOutside, [this](QString data) {
m_pageController->goToPageHome();
m_importController->extractConfigFromData(data);
emit m_pageController->goToPageViewConfig();
m_pageController->goToPageViewConfig();
});
connect(IosController::Instance(), &IosController::importBackupFromOutside, this, [this](QString filePath) {
emit m_pageController->goToPageHome();
connect(IosController::Instance(), &IosController::importBackupFromOutside, [this](QString filePath) {
m_pageController->goToPageHome();
m_pageController->goToPageSettingsBackup();
emit m_settingsController->importBackupFromOutside(filePath);
m_settingsController->importBackupFromOutside(filePath);
});
QTimer::singleShot(0, this, [this]() { AmneziaVPN::toggleScreenshots(m_settings->isScreenshotsEnabled()); });

View File

@@ -33,7 +33,7 @@ android.library.defaults.buildfeatures.androidresources=false
# For development copy and set local values for these parameters in local.properties
#androidCompileSdkVersion=android-34
#androidBuildToolsVersion=34.0.0
#qtMinSdkVersion=26
#qtMinSdkVersion=24
#qtTargetSdkVersion=34
#androidNdkVersion=26.1.10909125
#qtTargetAbiList=x86_64

View File

@@ -1,5 +1,6 @@
package org.amnezia.vpn.protocol
import android.annotation.SuppressLint
import android.content.Context
import android.net.IpPrefix
import android.net.VpnService
@@ -7,6 +8,9 @@ import android.net.VpnService.Builder
import android.os.Build
import android.system.OsConstants
import androidx.annotation.RequiresApi
import java.io.File
import java.io.FileOutputStream
import java.util.zip.ZipFile
import kotlinx.coroutines.flow.MutableStateFlow
import org.amnezia.vpn.util.Log
import org.amnezia.vpn.util.net.InetNetwork

View File

@@ -21,7 +21,6 @@ import android.os.Looper
import android.os.Message
import android.os.Messenger
import android.provider.Settings
import android.view.MotionEvent
import android.view.WindowManager.LayoutParams
import android.webkit.MimeTypeMap
import android.widget.Toast
@@ -159,7 +158,7 @@ class AmneziaActivity : QtActivity() {
*/
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
Log.d(TAG, "Create Amnezia activity")
Log.d(TAG, "Create Amnezia activity: $intent")
loadLibs()
window.apply {
addFlags(LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS)
@@ -201,7 +200,7 @@ class AmneziaActivity : QtActivity() {
NotificationManager.ACTION_APP_BLOCK_STATE_CHANGED
)
) {
Log.v(
Log.d(
TAG, "Notification state changed: ${it?.action}, blocked = " +
"${it?.getBooleanExtra(NotificationManager.EXTRA_BLOCKED_STATE, false)}"
)
@@ -215,7 +214,7 @@ class AmneziaActivity : QtActivity() {
override fun onNewIntent(intent: Intent?) {
super.onNewIntent(intent)
Log.v(TAG, "onNewIntent: $intent")
Log.d(TAG, "onNewIntent: $intent")
intent?.let(::processIntent)
}
@@ -404,7 +403,7 @@ class AmneziaActivity : QtActivity() {
@MainThread
private fun startVpn(vpnConfig: String) {
getVpnProto(vpnConfig)?.let { proto ->
Log.v(TAG, "Proto from config: $proto, current proto: $vpnProto")
Log.d(TAG, "Proto from config: $proto, current proto: $vpnProto")
if (isServiceConnected) {
if (proto.serviceClass == vpnProto?.serviceClass) {
vpnProto = proto
@@ -517,7 +516,7 @@ class AmneziaActivity : QtActivity() {
startActivityForResult(it, CREATE_FILE_ACTION_CODE, ActivityResultHandler(
onSuccess = {
it?.data?.let { uri ->
Log.v(TAG, "Save file to $uri")
Log.d(TAG, "Save file to $uri")
try {
contentResolver.openOutputStream(uri)?.use { os ->
os.bufferedWriter().use { it.write(data) }
@@ -566,7 +565,7 @@ class AmneziaActivity : QtActivity() {
startActivityForResult(it, OPEN_FILE_ACTION_CODE, ActivityResultHandler(
onAny = {
val uri = it?.data?.toString() ?: ""
Log.v(TAG, "Open file: $uri")
Log.d(TAG, "Open file: $uri")
mainScope.launch {
qtInitialized.await()
QtAndroidController.onFileOpened(uri)
@@ -721,66 +720,6 @@ class AmneziaActivity : QtActivity() {
}
}
// workaround for a bug in Qt that causes the mouse click event not to be handled
// also disable right-click, as it causes the application to crash
private var lastButtonState = 0
private fun MotionEvent.fixCopy(): MotionEvent = MotionEvent.obtain(
downTime,
eventTime,
action,
pointerCount,
(0 until pointerCount).map { i ->
MotionEvent.PointerProperties().apply {
getPointerProperties(i, this)
}
}.toTypedArray(),
(0 until pointerCount).map { i ->
MotionEvent.PointerCoords().apply {
getPointerCoords(i, this)
}
}.toTypedArray(),
metaState,
MotionEvent.BUTTON_PRIMARY,
xPrecision,
yPrecision,
deviceId,
edgeFlags,
source,
flags
)
private fun handleMouseEvent(ev: MotionEvent, superDispatch: (MotionEvent?) -> Boolean): Boolean {
when (ev.action) {
MotionEvent.ACTION_DOWN -> {
lastButtonState = ev.buttonState
if (ev.buttonState == MotionEvent.BUTTON_SECONDARY) return true
}
MotionEvent.ACTION_UP -> {
when (lastButtonState) {
MotionEvent.BUTTON_SECONDARY -> return true
MotionEvent.BUTTON_PRIMARY -> {
val modEvent = ev.fixCopy()
return superDispatch(modEvent).apply { modEvent.recycle() }
}
}
}
}
return superDispatch(ev)
}
override fun dispatchTouchEvent(ev: MotionEvent?): Boolean {
if (ev != null && ev.getToolType(0) == MotionEvent.TOOL_TYPE_MOUSE) {
return handleMouseEvent(ev) { super.dispatchTouchEvent(it) }
}
return super.dispatchTouchEvent(ev)
}
override fun dispatchTrackballEvent(ev: MotionEvent?): Boolean {
ev?.let { return handleMouseEvent(ev) { super.dispatchTrackballEvent(it) }}
return super.dispatchTrackballEvent(ev)
}
/**
* Utils methods
*/

View File

@@ -300,7 +300,7 @@ open class AmneziaVpnService : VpnService() {
arrayOf(ACTION_CONNECT, ACTION_DISCONNECT), ContextCompat.RECEIVER_NOT_EXPORTED
) {
it?.action?.let { action ->
Log.v(TAG, "Broadcast request received: $action")
Log.d(TAG, "Broadcast request received: $action")
when (action) {
ACTION_CONNECT -> connect()
ACTION_DISCONNECT -> disconnect()
@@ -317,7 +317,7 @@ open class AmneziaVpnService : VpnService() {
)
) {
val state = it?.getBooleanExtra(NotificationManager.EXTRA_BLOCKED_STATE, false)
Log.v(TAG, "Notification state changed: ${it?.action}, blocked = $state")
Log.d(TAG, "Notification state changed: ${it?.action}, blocked = $state")
if (state == false) {
enableNotification()
} else {
@@ -450,7 +450,7 @@ open class AmneziaVpnService : VpnService() {
serviceNotification.isNotificationEnabled() &&
getSystemService<PowerManager>()?.isInteractive != false
) {
Log.v(TAG, "Launch traffic stats update")
Log.d(TAG, "Launch traffic stats update")
trafficStats.reset()
startTrafficStatsUpdateJob()
}

View File

@@ -66,7 +66,7 @@ class AuthActivity : FragmentActivity() {
object : BiometricPrompt.AuthenticationCallback() {
override fun onAuthenticationSucceeded(result: AuthenticationResult) {
super.onAuthenticationSucceeded(result)
Log.v(TAG, "Authentication succeeded")
Log.d(TAG, "Authentication succeeded")
QtAndroidController.onAuthResult(true)
finish()
}

View File

@@ -29,20 +29,20 @@ class ImportConfigActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
Log.v(TAG, "Create Import Config Activity: $intent")
Log.d(TAG, "Create Import Config Activity: $intent")
intent?.let(::readConfig)
}
override fun onNewIntent(intent: Intent) {
super.onNewIntent(intent)
Log.v(TAG, "onNewIntent: $intent")
Log.d(TAG, "onNewIntent: $intent")
intent.let(::readConfig)
}
private fun readConfig(intent: Intent) {
when (intent.action) {
ACTION_SEND -> {
Log.v(TAG, "Process SEND action, type: ${intent.type}")
Log.d(TAG, "Process SEND action, type: ${intent.type}")
when (intent.type) {
"application/octet-stream" -> {
intent.getUriCompat()?.let { uri ->
@@ -60,7 +60,7 @@ class ImportConfigActivity : ComponentActivity() {
}
ACTION_VIEW -> {
Log.v(TAG, "Process VIEW action, scheme: ${intent.scheme}")
Log.d(TAG, "Process VIEW action, scheme: ${intent.scheme}")
when (intent.scheme) {
"file", "content" -> {
intent.data?.let { uri ->

View File

@@ -62,7 +62,7 @@ class ServiceNotification(private val context: Context) {
fun buildNotification(serverName: String?, protocol: String?, state: ProtocolState): Notification {
val speedString = if (state == CONNECTED) zeroSpeed else null
Log.v(TAG, "Build notification: $serverName, $state")
Log.d(TAG, "Build notification: $serverName, $state")
return notificationBuilder
.setSmallIcon(R.drawable.ic_amnezia_round)
@@ -88,15 +88,17 @@ class ServiceNotification(private val context: Context) {
fun isNotificationEnabled(): Boolean {
if (!context.isNotificationPermissionGranted()) return false
if (!notificationManager.areNotificationsEnabled()) return false
return notificationManager.getNotificationChannel(NOTIFICATION_CHANNEL_ID)?.let {
it.importance != NotificationManager.IMPORTANCE_NONE
} ?: true
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
return notificationManager.getNotificationChannel(NOTIFICATION_CHANNEL_ID)
?.let { it.importance != NotificationManager.IMPORTANCE_NONE } ?: true
}
return true
}
@SuppressLint("MissingPermission")
fun updateNotification(serverName: String?, protocol: String?, state: ProtocolState) {
if (context.isNotificationPermissionGranted()) {
Log.v(TAG, "Update notification: $serverName, $state")
Log.d(TAG, "Update notification: $serverName, $state")
notificationManager.notify(NOTIFICATION_ID, buildNotification(serverName, protocol, state))
}
}

View File

@@ -46,7 +46,7 @@ object LibraryLoader {
System.loadLibrary(libraryName)
return
} catch (_: UnsatisfiedLinkError) {
Log.w(TAG, "Failed to load library, try to extract it from apk")
Log.d(TAG, "Failed to load library, try to extract it from apk")
}
var tempFile: File? = null
try {

View File

@@ -1,6 +1,8 @@
package org.amnezia.vpn.util
import android.content.Context
import android.icu.text.DateFormat
import android.icu.text.SimpleDateFormat
import android.os.Build
import android.os.Process
import java.io.File
@@ -10,6 +12,8 @@ import java.nio.channels.FileChannel
import java.nio.channels.FileLock
import java.time.LocalDateTime
import java.time.format.DateTimeFormatter
import java.util.Date
import java.util.Locale
import java.util.concurrent.locks.ReentrantLock
import org.amnezia.vpn.util.Log.Priority.D
import org.amnezia.vpn.util.Log.Priority.E
@@ -37,7 +41,11 @@ private const val LOG_MAX_FILE_SIZE = 1024 * 1024
* | | | create a report and/or terminate the process |
*/
object Log {
private val dateTimeFormat: DateTimeFormatter = DateTimeFormatter.ofPattern(DATE_TIME_PATTERN)
private val dateTimeFormat: Any =
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) DateTimeFormatter.ofPattern(DATE_TIME_PATTERN)
else object : ThreadLocal<DateFormat>() {
override fun initialValue(): DateFormat = SimpleDateFormat(DATE_TIME_PATTERN, Locale.US)
}
private lateinit var logDir: File
private val logFile: File by lazy { File(logDir, LOG_FILE_NAME) }
@@ -135,7 +143,12 @@ object Log {
}
private fun formatLogMsg(tag: String, msg: String, priority: Priority): String {
val date = LocalDateTime.now().format(dateTimeFormat)
val date = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
LocalDateTime.now().format(dateTimeFormat as DateTimeFormatter)
} else {
@Suppress("UNCHECKED_CAST")
(dateTimeFormat as ThreadLocal<DateFormat>).get()?.format(Date())
}
return "$date ${Process.myPid()} ${Process.myTid()} $priority [${Thread.currentThread().name}] " +
"$tag: $msg\n"
}

View File

@@ -42,12 +42,18 @@ class NetworkState(
private val networkCallback: NetworkCallback by lazy(NONE) {
object : NetworkCallback() {
override fun onAvailable(network: Network) {
Log.v(TAG, "onAvailable: $network")
Log.d(TAG, "onAvailable: $network")
}
override fun onCapabilitiesChanged(network: Network, networkCapabilities: NetworkCapabilities) {
Log.v(TAG, "onCapabilitiesChanged: $network, $networkCapabilities")
checkNetworkState(network, networkCapabilities)
Log.d(TAG, "onCapabilitiesChanged: $network, $networkCapabilities")
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
checkNetworkState(network, networkCapabilities)
} else {
handler.post {
checkNetworkState(network, networkCapabilities)
}
}
}
private fun checkNetworkState(network: Network, networkCapabilities: NetworkCapabilities) {
@@ -67,11 +73,11 @@ class NetworkState(
}
override fun onBlockedStatusChanged(network: Network, blocked: Boolean) {
Log.v(TAG, "onBlockedStatusChanged: $network, $blocked")
Log.d(TAG, "onBlockedStatusChanged: $network, $blocked")
}
override fun onLost(network: Network) {
Log.v(TAG, "onLost: $network")
Log.d(TAG, "onLost: $network")
}
}
}
@@ -81,7 +87,7 @@ class NetworkState(
Log.d(TAG, "Bind network listener")
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
connectivityManager.registerBestMatchingNetworkCallback(networkRequest, networkCallback, handler)
} else {
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
val numberAttempts = 300
var attemptCount = 0
while(true) {
@@ -102,6 +108,8 @@ class NetworkState(
}
}
}
} else {
connectivityManager.requestNetwork(networkRequest, networkCallback)
}
isListenerBound = true
}

View File

@@ -66,7 +66,7 @@ open class Wireguard : Protocol() {
try {
delay(1000)
var log = getLogcat(time)
Log.v(TAG, "First waiting log: $log")
Log.d(TAG, "First waiting log: $log")
// check that there is a connection log,
// to avoid infinite connection
if (!log.contains("Attaching to interface")) {

View File

@@ -130,8 +130,8 @@ class Xray : Protocol() {
LibXray.initXray(assetsPath)
val geoDir = File(assetsPath, "geo").absolutePath
val configPath = File(context.cacheDir, "config.json")
Log.v(TAG, "xray.location.asset: $geoDir")
Log.v(TAG, "config: $configPath")
Log.d(TAG, "xray.location.asset: $geoDir")
Log.d(TAG, "config: $configPath")
try {
configPath.writeText(configJson)
} catch (e: IOException) {

View File

@@ -1,6 +1,6 @@
message("Client android ${CMAKE_ANDROID_ARCH_ABI} build")
set(APP_ANDROID_MIN_SDK 26)
set(APP_ANDROID_MIN_SDK 24)
set(ANDROID_PLATFORM "android-${APP_ANDROID_MIN_SDK}" CACHE STRING
"The minimum API level supported by the application or library" FORCE)

181
client/cmake/macos_ne.cmake Normal file
View File

@@ -0,0 +1,181 @@
message("Client ==> MacOS NE build")
set_target_properties(${PROJECT} PROPERTIES MACOSX_BUNDLE TRUE)
set(CMAKE_OSX_ARCHITECTURES "x86_64" CACHE INTERNAL "" FORCE)
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.15)
set(APPLE_PROJECT_VERSION ${CMAKE_PROJECT_VERSION_MAJOR}.${CMAKE_PROJECT_VERSION_MINOR}.${CMAKE_PROJECT_VERSION_PATCH})
enable_language(OBJC)
# enable_language(OBJCXX)
enable_language(Swift)
find_package(Qt6 REQUIRED COMPONENTS ShaderTools)
set(LIBS ${LIBS} Qt6::ShaderTools)
find_library(FW_AUTHENTICATIONSERVICES AuthenticationServices)
#find_library(FW_UIKIT UIKit)
find_library(FW_AVFOUNDATION AVFoundation)
find_library(FW_FOUNDATION Foundation)
find_library(FW_STOREKIT StoreKit)
find_library(FW_USERNOTIFICATIONS UserNotifications)
find_library(FW_NETWORKEXTENSION NetworkExtension)
set(LIBS ${LIBS}
${FW_AUTHENTICATIONSERVICES}
# ${FW_UIKIT}
${FW_AVFOUNDATION}
${FW_FOUNDATION}
${FW_STOREKIT}
${FW_USERNOTIFICATIONS}
${FW_NETWORKEXTENSION}
)
set(HEADERS ${HEADERS}
${CMAKE_CURRENT_SOURCE_DIR}/platforms/ios/ios_controller.h
${CMAKE_CURRENT_SOURCE_DIR}/platforms/ios/ios_controller_wrapper.h
${CMAKE_CURRENT_SOURCE_DIR}/platforms/ios/iosnotificationhandler.h
${CMAKE_CURRENT_SOURCE_DIR}/platforms/ios/QtAppDelegate.h
${CMAKE_CURRENT_SOURCE_DIR}/platforms/ios/QtAppDelegate-C-Interface.h
)
set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/platforms/ios/ios_controller.h PROPERTIES OBJECTIVE_CPP_HEADER TRUE)
set(SOURCES ${SOURCES}
${CMAKE_CURRENT_SOURCE_DIR}/platforms/ios/ios_controller.mm
${CMAKE_CURRENT_SOURCE_DIR}/platforms/ios/ios_controller_wrapper.mm
${CMAKE_CURRENT_SOURCE_DIR}/platforms/ios/iosnotificationhandler.mm
${CMAKE_CURRENT_SOURCE_DIR}/platforms/ios/iosglue.mm
${CMAKE_CURRENT_SOURCE_DIR}/platforms/ios/QRCodeReaderBase.mm
${CMAKE_CURRENT_SOURCE_DIR}/platforms/ios/QtAppDelegate.mm
)
set(ICON_FILE ${CMAKE_CURRENT_SOURCE_DIR}/images/app.icns)
set(MACOSX_BUNDLE_ICON_FILE app.icns)
set_source_files_properties(${ICON_FILE} PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
set(SOURCES ${SOURCES} ${ICON_FILE})
# set(HEADERS ${HEADERS}
# ${CMAKE_CURRENT_SOURCE_DIR}/ui/macos_util.h
# )
# set(SOURCES ${SOURCES}
# ${CMAKE_CURRENT_SOURCE_DIR}/ui/macos_util.mm
# )
target_include_directories(${PROJECT} PRIVATE ${Qt6Gui_PRIVATE_INCLUDE_DIRS})
set_target_properties(${PROJECT} PROPERTIES
XCODE_LINK_BUILD_PHASE_MODE KNOWN_LOCATION
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/macos/app/Info.plist.in
#MACOSX_BUNDLE_ICON_FILE "AppIcon"
MACOSX_BUNDLE_INFO_STRING "AmneziaVPN"
MACOSX_BUNDLE_BUNDLE_NAME "AmneziaVPN"
MACOSX_BUNDLE_BUNDLE_VERSION "${CMAKE_PROJECT_VERSION_TWEAK}"
MACOSX_BUNDLE_LONG_VERSION_STRING "${APPLE_PROJECT_VERSION}-${CMAKE_PROJECT_VERSION_TWEAK}"
MACOSX_BUNDLE_SHORT_VERSION_STRING "${APPLE_PROJECT_VERSION}"
XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER "${BUILD_IOS_APP_IDENTIFIER}"
XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS "${CMAKE_CURRENT_SOURCE_DIR}/macos/app/main.entitlements"
XCODE_ATTRIBUTE_MARKETING_VERSION "${APPLE_PROJECT_VERSION}"
XCODE_ATTRIBUTE_CURRENT_PROJECT_VERSION "${CMAKE_PROJECT_VERSION_TWEAK}"
XCODE_ATTRIBUTE_PRODUCT_NAME "AmneziaVPN"
XCODE_ATTRIBUTE_BUNDLE_INFO_STRING "AmneziaVPN"
XCODE_GENERATE_SCHEME TRUE
XCODE_ATTRIBUTE_ENABLE_BITCODE "NO"
#XCODE_ATTRIBUTE_ASSETCATALOG_COMPILER_APPICON_NAME "AppIcon"
XCODE_ATTRIBUTE_TARGETED_DEVICE_FAMILY "1,2"
XCODE_EMBED_FRAMEWORKS_CODE_SIGN_ON_COPY "NO"
XCODE_EMBED_FRAMEWORKS_REMOVE_HEADERS_ON_COPY "YES"
XCODE_LINK_BUILD_PHASE_MODE KNOWN_LOCATION
XCODE_ATTRIBUTE_LD_RUNPATH_SEARCH_PATHS "@executable_path/../Frameworks"
XCODE_EMBED_APP_EXTENSIONS networkextension
XCODE_ATTRIBUTE_CODE_SIGN_STYLE Automatic
# XCODE_ATTRIBUTE_CODE_SIGN_STYLE Manual
# XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "Apple Distribution: Privacy Technologies OU (X7UJ388FXK)"
# XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY[variant=Debug] "Apple Development"
# XCODE_ATTRIBUTE_PROVISIONING_PROFILE_SPECIFIER "Mac AppStore AmneziaVPN"
# XCODE_ATTRIBUTE_PROVISIONING_PROFILE_SPECIFIER[variant=Debug] "Mac AppStore AmneziaVPN"
)
set_target_properties(${PROJECT} PROPERTIES
XCODE_ATTRIBUTE_SWIFT_VERSION "5.0"
XCODE_ATTRIBUTE_CLANG_ENABLE_MODULES "YES"
XCODE_ATTRIBUTE_SWIFT_PRECOMPILE_BRIDGING_HEADER "NO"
XCODE_ATTRIBUTE_SWIFT_OBJC_INTERFACE_HEADER_NAME "AmneziaVPN-Swift.h"
XCODE_ATTRIBUTE_SWIFT_OBJC_INTEROP_MODE "objcxx"
)
set_target_properties(${PROJECT} PROPERTIES
XCODE_ATTRIBUTE_DEVELOPMENT_TEAM "X7UJ388FXK"
)
target_include_directories(${PROJECT} PRIVATE ${CMAKE_CURRENT_LIST_DIR})
target_compile_options(${PROJECT} PRIVATE
-DGROUP_ID=\"${BUILD_IOS_GROUP_IDENTIFIER}\"
-DVPN_NE_BUNDLEID=\"${BUILD_IOS_APP_IDENTIFIER}.network-extension\"
)
set(WG_APPLE_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/3rd/amneziawg-apple/Sources)
target_sources(${PROJECT} PRIVATE
# ${CMAKE_CURRENT_SOURCE_DIR}/platforms/ios/iosvpnprotocol.swift
${WG_APPLE_SOURCE_DIR}/WireGuardKitC/x25519.c
${CLIENT_ROOT_DIR}/platforms/ios/LogController.swift
${CLIENT_ROOT_DIR}/platforms/ios/Log.swift
${CLIENT_ROOT_DIR}/platforms/ios/LogRecord.swift
${CLIENT_ROOT_DIR}/platforms/ios/ScreenProtection.swift
${CLIENT_ROOT_DIR}/platforms/ios/VPNCController.swift
)
target_sources(${PROJECT} PRIVATE
#${CMAKE_CURRENT_SOURCE_DIR}/macos_ne/app/AmneziaVPNLaunchScreen.storyboard
${CMAKE_CURRENT_SOURCE_DIR}/macos/app/Media.xcassets
${CMAKE_CURRENT_SOURCE_DIR}/macos/app/PrivacyInfo.xcprivacy
)
set_property(TARGET ${PROJECT} APPEND PROPERTY RESOURCE
#${CMAKE_CURRENT_SOURCE_DIR}/macos/app/AmneziaVPNLaunchScreen.storyboard
${CMAKE_CURRENT_SOURCE_DIR}/macos/app/Media.xcassets
${CMAKE_CURRENT_SOURCE_DIR}/macos/app/PrivacyInfo.xcprivacy
)
add_subdirectory(macos/networkextension)
add_dependencies(${PROJECT} networkextension)
# set_property(TARGET ${PROJECT} PROPERTY XCODE_EMBED_FRAMEWORKS
# "${CMAKE_CURRENT_SOURCE_DIR}/3rd/OpenVPNAdapter/build/Release-iphoneos/OpenVPNAdapter.framework"
# )
# set(CMAKE_XCODE_ATTRIBUTE_FRAMEWORK_SEARCH_PATHS ${CMAKE_CURRENT_SOURCE_DIR}/3rd/OpenVPNAdapter/build/Release-iphoneos)
# target_link_libraries("networkextension" PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/3rd/OpenVPNAdapter/build/Release-iphoneos/OpenVPNAdapter.framework")
get_target_property(QtCore_location Qt6::Core LOCATION)
message("QtCore_location")
message(${QtCore_location})
get_filename_component(QT_BIN_DIR_DETECTED "${QtCore_location}/../../../../../bin" ABSOLUTE)
# add_custom_command(TARGET ${PROJECT} POST_BUILD
# COMMAND ${QT_BIN_DIR_DETECTED}/macdeployqt $<TARGET_BUNDLE_DIR:AmneziaVPN> -appstore-compliant -qmldir=${CMAKE_CURRENT_SOURCE_DIR}
# )
# if(CMAKE_BUILD_TYPE STREQUAL "Release")
# SET(SIGN_CMD codesign --deep --force --sign 'Apple Distribution: Privacy Technologies OU \(X7UJ388FXK\)' --timestamp --options runtime $<TARGET_BUNDLE_DIR:AmneziaVPN>)
# message("Manual signing bundle...")
# message(${SIGN_CMD})
# add_custom_command(TARGET ${PROJECT} POST_BUILD
# COMMAND ${SIGN_CMD}
# )
# endif()

View File

@@ -76,7 +76,7 @@ function(osx_bundle_assetcatalog TARGET)
)
## Patch the asset catalog into the target bundle.
if(NOT IOS)
if(NOT IOS AND NOT MACOS_NE)
set(XCASSETS_RESOURCE_DIR "Resources")
endif()
add_custom_command(TARGET ${TARGET} POST_BUILD
@@ -141,6 +141,7 @@ function(osx_codesign_target TARGET)
endif()
foreach(FILE ${CODESIGN_FILES})
message(STATUS "Signing ${TARGET}: ${FILE}")
add_custom_command(TARGET ${TARGET} POST_BUILD VERBATIM
COMMAND ${COMMENT_ECHO_COMMAND} "Signing ${TARGET}: ${FILE}"
COMMAND ${CODESIGN_BIN} ${CODESIGN_ARGS} ${FILE}

View File

@@ -102,7 +102,9 @@ QProcessEnvironment SshConfigurator::prepareEnv()
pathEnvVar.prepend(QDir::toNativeSeparators(QApplication::applicationDirPath()) + "\\cygwin;");
pathEnvVar.prepend(QDir::toNativeSeparators(QApplication::applicationDirPath()) + "\\openvpn;");
#elif defined(Q_OS_MACX)
#if !defined(MACOS_NE)
pathEnvVar.prepend(QDir::toNativeSeparators(QApplication::applicationDirPath()) + "/Contents/MacOS");
#endif
#endif
env.insert("PATH", pathEnvVar);

View File

@@ -1,8 +1,5 @@
#include "apiController.h"
#include <algorithm>
#include <random>
#include <QEventLoop>
#include <QNetworkAccessManager>
#include <QNetworkReply>
@@ -14,7 +11,6 @@
#include "amnezia_application.h"
#include "configurators/wireguard_configurator.h"
#include "core/enums/apiEnums.h"
#include "utilities.h"
#include "version.h"
namespace
@@ -37,7 +33,6 @@ namespace
constexpr char userCountryCode[] = "user_country_code";
constexpr char serverCountryCode[] = "server_country_code";
constexpr char serviceType[] = "service_type";
constexpr char serviceInfo[] = "service_info";
constexpr char aesKey[] = "aes_key";
constexpr char aesIv[] = "aes_iv";
@@ -45,11 +40,10 @@ namespace
constexpr char apiPayload[] = "api_payload";
constexpr char keyPayload[] = "key_payload";
constexpr char apiConfig[] = "api_config";
constexpr char authData[] = "auth_data";
}
const QStringList proxyStorageUrl = { "" };
ErrorCode checkErrors(const QList<QSslError> &sslErrors, QNetworkReply *reply)
{
if (!sslErrors.empty()) {
@@ -69,28 +63,6 @@ namespace
return ErrorCode::ApiConfigDownloadError;
}
}
bool shouldBypassProxy(QNetworkReply *reply, const QByteArray &responseBody, bool checkEncryption, const QByteArray &key = "",
const QByteArray &iv = "", const QByteArray &salt = "")
{
if (reply->error() == QNetworkReply::NetworkError::OperationCanceledError
|| reply->error() == QNetworkReply::NetworkError::TimeoutError) {
qDebug() << "Timeout occurred";
return true;
} else if (responseBody.contains("html")) {
qDebug() << "The response contains an html tag";
return true;
} else if (checkEncryption) {
try {
QSimpleCrypto::QBlockCipher blockCipher;
static_cast<void>(blockCipher.decryptAesBlockCipher(responseBody, key, iv, "", salt));
} catch (...) {
qDebug() << "Failed to decrypt the data";
return true;
}
}
return false;
}
}
ApiController::ApiController(const QString &gatewayEndpoint, bool isDevEnvironment, QObject *parent)
@@ -122,8 +94,8 @@ void ApiController::fillServerConfig(const QString &protocol, const ApiControlle
configStr.replace("$OPENVPN_PRIV_KEY", apiPayloadData.certRequest.privKey);
} else if (protocol == configKey::awg) {
configStr.replace("$WIREGUARD_CLIENT_PRIVATE_KEY", apiPayloadData.wireGuardClientPrivKey);
auto newServerConfig = QJsonDocument::fromJson(configStr.toUtf8()).object();
auto containers = newServerConfig.value(config_key::containers).toArray();
auto serverConfig = QJsonDocument::fromJson(configStr.toUtf8()).object();
auto containers = serverConfig.value(config_key::containers).toArray();
if (containers.isEmpty()) {
return; // todo process error
}
@@ -142,35 +114,25 @@ void ApiController::fillServerConfig(const QString &protocol, const ApiControlle
containerConfig[config_key::transportPacketMagicHeader] = protocolConfig.value(config_key::transportPacketMagicHeader);
container[containerName] = containerConfig;
containers.replace(0, container);
newServerConfig[config_key::containers] = containers;
configStr = QString(QJsonDocument(newServerConfig).toJson());
serverConfig[config_key::containers] = containers;
configStr = QString(QJsonDocument(serverConfig).toJson());
}
QJsonObject newServerConfig = QJsonDocument::fromJson(configStr.toUtf8()).object();
serverConfig[config_key::dns1] = newServerConfig.value(config_key::dns1);
serverConfig[config_key::dns2] = newServerConfig.value(config_key::dns2);
serverConfig[config_key::containers] = newServerConfig.value(config_key::containers);
serverConfig[config_key::hostName] = newServerConfig.value(config_key::hostName);
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 (newServerConfig.value(config_key::configVersion).toInt() == ApiConfigSources::AmneziaGateway) {
serverConfig[config_key::configVersion] = newServerConfig.value(config_key::configVersion);
serverConfig[config_key::description] = newServerConfig.value(config_key::description);
serverConfig[config_key::name] = newServerConfig.value(config_key::name);
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 = newServerConfig.value(config_key::defaultContainer).toString();
auto defaultContainer = apiConfig.value(config_key::defaultContainer).toString();
serverConfig[config_key::defaultContainer] = defaultContainer;
QVariantMap map = serverConfig.value(configKey::apiConfig).toObject().toVariantMap();
map.insert(newServerConfig.value(configKey::apiConfig).toObject().toVariantMap());
auto apiConfig = QJsonObject::fromVariantMap(map);
if (newServerConfig.value(config_key::configVersion).toInt() == ApiConfigSources::AmneziaGateway) {
apiConfig.insert(configKey::serviceInfo, QJsonDocument::fromJson(apiResponseBody).object().value(configKey::serviceInfo).toObject());
}
serverConfig[configKey::apiConfig] = apiConfig;
return;
}
@@ -184,15 +146,6 @@ QStringList ApiController::getProxyUrls()
QList<QSslError> sslErrors;
QNetworkReply *reply;
QStringList proxyStorageUrl;
if (m_isDevEnvironment) {
proxyStorageUrl = QStringList { DEV_S3_ENDPOINT };
} else {
proxyStorageUrl = QStringList { PROD_S3_ENDPOINT };
}
QByteArray key = m_isDevEnvironment ? DEV_AGW_PUBLIC_KEY : PROD_AGW_PUBLIC_KEY;
for (const auto &proxyStorageUrl : proxyStorageUrl) {
request.setUrl(proxyStorageUrl);
reply = amnApp->manager()->get(request);
@@ -213,23 +166,11 @@ QStringList ApiController::getProxyUrls()
EVP_PKEY *privateKey = nullptr;
QByteArray responseBody;
try {
if (!m_isDevEnvironment) {
QCryptographicHash hash(QCryptographicHash::Sha512);
hash.addData(key);
QByteArray hashResult = hash.result().toHex();
QByteArray key = QByteArray::fromHex(hashResult.left(64));
QByteArray iv = QByteArray::fromHex(hashResult.mid(64, 32));
QByteArray ba = QByteArray::fromBase64(encryptedResponseBody);
QSimpleCrypto::QBlockCipher blockCipher;
responseBody = blockCipher.decryptAesBlockCipher(ba, key, iv);
} else {
responseBody = encryptedResponseBody;
}
QByteArray key = PROD_PROXY_STORAGE_KEY;
QSimpleCrypto::QRsa rsa;
privateKey = rsa.getPrivateKeyFromByteArray(key, "");
responseBody = rsa.decrypt(encryptedResponseBody, privateKey, RSA_PKCS1_PADDING);
} catch (...) {
Utils::logException();
qCritical() << "error loading private key from environment variables or decrypting payload";
return {};
}
@@ -351,44 +292,38 @@ ErrorCode ApiController::getServicesList(QByteArray &responseBody)
connect(reply, &QNetworkReply::sslErrors, [this, &sslErrors](const QList<QSslError> &errors) { sslErrors = errors; });
wait.exec();
responseBody = reply->readAll();
if (sslErrors.isEmpty() && shouldBypassProxy(reply, responseBody, false)) {
if (reply->error() == QNetworkReply::NetworkError::TimeoutError || reply->error() == QNetworkReply::NetworkError::OperationCanceledError) {
m_proxyUrls = getProxyUrls();
std::random_device randomDevice;
std::mt19937 generator(randomDevice());
std::shuffle(m_proxyUrls.begin(), m_proxyUrls.end(), generator);
for (const QString &proxyUrl : m_proxyUrls) {
qDebug() << "Go to the next endpoint";
request.setUrl(QString("%1v1/services").arg(proxyUrl));
reply->deleteLater(); // delete the previous reply
reply = amnApp->manager()->get(request);
QObject::connect(reply, &QNetworkReply::finished, &wait, &QEventLoop::quit);
connect(reply, &QNetworkReply::sslErrors, [this, &sslErrors](const QList<QSslError> &errors) { sslErrors = errors; });
wait.exec();
responseBody = reply->readAll();
if (!sslErrors.isEmpty() || !shouldBypassProxy(reply, responseBody, false)) {
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, const QJsonObject &authData,
QJsonObject &serverConfig)
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");
@@ -404,9 +339,6 @@ ErrorCode ApiController::getConfigForService(const QString &installationUuid, co
}
apiPayload[configKey::serviceType] = serviceType;
apiPayload[configKey::uuid] = installationUuid;
if (!authData.isEmpty()) {
apiPayload[configKey::authData] = authData;
}
QSimpleCrypto::QBlockCipher blockCipher;
QByteArray key = blockCipher.generatePrivateSalt(32);
@@ -429,7 +361,6 @@ ErrorCode ApiController::getConfigForService(const QString &installationUuid, co
QSimpleCrypto::QRsa rsa;
publicKey = rsa.getPublicKeyFromByteArray(rsaKey);
} catch (...) {
Utils::logException();
qCritical() << "error loading public key from environment variables";
return ErrorCode::ApiMissingAgwPublicKey;
}
@@ -439,16 +370,14 @@ ErrorCode ApiController::getConfigForService(const QString &installationUuid, co
encryptedApiPayload = blockCipher.encryptAesBlockCipher(QJsonDocument(apiPayload).toJson(), key, iv, "", salt);
} catch (...) { // todo change error handling in QSimpleCrypto?
Utils::logException();
qCritical() << "error when encrypting the request body";
return ErrorCode::ApiConfigDecryptionError;
}
QJsonObject requestBody;
requestBody[configKey::keyPayload] = QString(encryptedKeyPayload.toBase64());
requestBody[configKey::apiPayload] = QString(encryptedApiPayload.toBase64());
QNetworkReply *reply = amnApp->manager()->post(request, QJsonDocument(requestBody).toJson());
QNetworkReply *reply = manager.post(request, QJsonDocument(requestBody).toJson());
QEventLoop wait;
connect(reply, &QNetworkReply::finished, &wait, &QEventLoop::quit);
@@ -457,43 +386,37 @@ ErrorCode ApiController::getConfigForService(const QString &installationUuid, co
connect(reply, &QNetworkReply::sslErrors, [this, &sslErrors](const QList<QSslError> &errors) { sslErrors = errors; });
wait.exec();
auto encryptedResponseBody = reply->readAll();
if (sslErrors.isEmpty() && shouldBypassProxy(reply, encryptedResponseBody, true, key, iv, salt)) {
m_proxyUrls = getProxyUrls();
std::random_device randomDevice;
std::mt19937 generator(randomDevice());
std::shuffle(m_proxyUrls.begin(), m_proxyUrls.end(), generator);
if (reply->error() == QNetworkReply::NetworkError::TimeoutError || reply->error() == QNetworkReply::NetworkError::OperationCanceledError) {
if (m_proxyUrls.isEmpty()) {
m_proxyUrls = getProxyUrls();
}
for (const QString &proxyUrl : m_proxyUrls) {
qDebug() << "Go to the next endpoint";
request.setUrl(QString("%1v1/config").arg(proxyUrl));
reply->deleteLater(); // delete the previous reply
reply = amnApp->manager()->post(request, QJsonDocument(requestBody).toJson());
reply = manager.post(request, QJsonDocument(requestBody).toJson());
QObject::connect(reply, &QNetworkReply::finished, &wait, &QEventLoop::quit);
connect(reply, &QNetworkReply::sslErrors, [this, &sslErrors](const QList<QSslError> &errors) { sslErrors = errors; });
wait.exec();
encryptedResponseBody = reply->readAll();
if (!sslErrors.isEmpty() || !shouldBypassProxy(reply, encryptedResponseBody, true, key, iv, salt)) {
if (reply->error() != QNetworkReply::NetworkError::TimeoutError
&& reply->error() != QNetworkReply::NetworkError::OperationCanceledError) {
break;
}
reply->deleteLater();
}
}
auto errorCode = checkErrors(sslErrors, reply);
reply->deleteLater();
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?
Utils::logException();
qCritical() << "error when decrypting the request body";
return ErrorCode::ApiConfigDecryptionError;
}
return errorCode;

View File

@@ -21,7 +21,7 @@ public slots:
ErrorCode getServicesList(QByteArray &responseBody);
ErrorCode getConfigForService(const QString &installationUuid, const QString &userCountryCode, const QString &serviceType,
const QString &protocol, const QString &serverCountryCode, const QJsonObject &authData, QJsonObject &serverConfig);
const QString &protocol, const QString &serverCountryCode, QJsonObject &serverConfig);
signals:
void errorOccurred(ErrorCode errorCode);

View File

@@ -770,12 +770,6 @@ ErrorCode ServerController::isUserInSudo(const ServerCredentials &credentials, D
if (!stdOut.contains("sudo"))
return ErrorCode::ServerUserNotInSudo;
if (stdOut.contains("command not found"))
return ErrorCode::SudoPackageIsNotPreinstalled;
if (stdOut.contains("sudoers"))
return ErrorCode::ServerUserNotListedInSudoers;
if (stdOut.contains("password is required"))
return ErrorCode::ServerUserPasswordRequired;
return error;
}

View File

@@ -56,9 +56,6 @@ namespace amnezia
ServerCancelInstallation = 204,
ServerUserNotInSudo = 205,
ServerPacketManagerError = 206,
SudoPackageIsNotPreinstalled = 207,
ServerUserNotListedInSudoers = 208,
ServerUserPasswordRequired = 209,
// Ssh connection errors
SshRequestDeniedError = 300,
@@ -99,7 +96,6 @@ namespace amnezia
// import and install errors
ImportInvalidConfigError = 900,
ImportOpenConfigError = 901,
// Android errors
AndroidError = 1000,
@@ -111,7 +107,6 @@ namespace amnezia
ApiConfigTimeoutError = 1103,
ApiConfigSslError = 1104,
ApiMissingAgwPublicKey = 1105,
ApiConfigDecryptionError = 1106,
// QFile errors
OpenError = 1200,

View File

@@ -21,9 +21,6 @@ QString errorString(ErrorCode code) {
case(ErrorCode::ServerCancelInstallation): errorMessage = QObject::tr("Installation canceled by user"); break;
case(ErrorCode::ServerUserNotInSudo): errorMessage = QObject::tr("The user does not have permission to use sudo"); break;
case(ErrorCode::ServerPacketManagerError): errorMessage = QObject::tr("Server error: Packet manager error"); break;
case(ErrorCode::SudoPackageIsNotPreinstalled): errorMessage = QObject::tr("The sudo package is not pre-installed"); break;
case(ErrorCode::ServerUserNotListedInSudoers): errorMessage = QObject::tr("The user is not listed in sudoers"); break;
case(ErrorCode::ServerUserPasswordRequired): errorMessage = QObject::tr("The user's password is required"); break;
// Libssh errors
case(ErrorCode::SshRequestDeniedError): errorMessage = QObject::tr("SSH request was denied"); break;
@@ -53,7 +50,6 @@ 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("Unable to open config file"); break;
// Android errors
case (ErrorCode::AndroidError): errorMessage = QObject::tr("VPN connection error"); break;
@@ -65,7 +61,6 @@ QString errorString(ErrorCode code) {
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;
case (ErrorCode::ApiConfigDecryptionError): errorMessage = QObject::tr("Failed to decrypt response payload"); break;
// QFile errors
case(ErrorCode::OpenError): errorMessage = QObject::tr("QFile error: The file could not be opened"); break;

View File

@@ -78,7 +78,7 @@ bool Daemon::activate(const InterfaceConfig& config) {
return false;
}
if (!dnsutils()->restoreResolvers()) {
if (supportDnsUtils() && !dnsutils()->restoreResolvers()) {
return false;
}
@@ -165,6 +165,10 @@ bool Daemon::activate(const InterfaceConfig& config) {
}
bool Daemon::maybeUpdateResolvers(const InterfaceConfig& config) {
if (!supportDnsUtils()) {
return true;
}
if ((config.m_hopType == InterfaceConfig::MultiHopExit) ||
(config.m_hopType == InterfaceConfig::SingleHop)) {
QList<QHostAddress> resolvers;
@@ -419,8 +423,13 @@ bool Daemon::deactivate(bool emitSignals) {
}
// Cleanup DNS
if (!dnsutils()->restoreResolvers()) {
logger.warning() << "Failed to restore DNS resolvers.";
if (supportDnsUtils() && !dnsutils()->restoreResolvers()) {
return false;
}
if (!wgutils()->interfaceExists()) {
logger.warning() << "Wireguard interface does not exist.";
return false;
}
// Cleanup peers and routing
@@ -440,9 +449,13 @@ bool Daemon::deactivate(bool emitSignals) {
}
m_excludedAddrSet.clear();
m_connections.clear();
// Delete the interface
return wgutils()->deleteInterface();
if (!wgutils()->deleteInterface()) {
return false;
}
m_connections.clear();
return true;
}
QString Daemon::logs() {

View File

@@ -69,6 +69,7 @@ class Daemon : public QObject {
virtual WireguardUtils* wgutils() const = 0;
virtual bool supportIPUtils() const { return false; }
virtual IPUtils* iputils() { return nullptr; }
virtual bool supportDnsUtils() const { return false; }
virtual DnsUtils* dnsutils() { return nullptr; }
static bool parseStringList(const QJsonObject& obj, const QString& name,

View File

@@ -92,17 +92,6 @@ void DaemonLocalServerConnection::parseCommand(const QByteArray& data) {
logger.debug() << "Command received:" << type;
// It is expected that sometimes the client will request backend logs
// before the first authentication. In these cases we just return empty
// logs.
if (type == "logs") {
QJsonObject obj;
obj.insert("type", "logs");
obj.insert("logs", "");
write(obj);
return;
}
if (type == "activate") {
InterfaceConfig config;
if (!Daemon::parseConfig(obj, config)) {
@@ -126,7 +115,8 @@ void DaemonLocalServerConnection::parseCommand(const QByteArray& data) {
if (type == "status") {
QJsonObject obj = Daemon::instance()->getStatus();
obj.insert("type", "status");
write(obj);
m_socket->write(QJsonDocument(obj).toJson(QJsonDocument::Compact));
m_socket->write("\n");
return;
}
@@ -134,7 +124,8 @@ void DaemonLocalServerConnection::parseCommand(const QByteArray& data) {
QJsonObject obj;
obj.insert("type", "logs");
obj.insert("logs", Daemon::instance()->logs().replace("\n", "|"));
write(obj);
m_socket->write(QJsonDocument(obj).toJson(QJsonDocument::Compact));
m_socket->write("\n");
return;
}

View File

@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="17506" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<device id="ipad12_9rounded" orientation="portrait" layout="fullscreen" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17505"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="gZ9-gc-3t5">
<rect key="frame" x="0.0" y="0.0" width="1024" height="1366"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="launch.png" translatesAutoresizingMaskIntoConstraints="NO" id="q5g-aV-39U">
<rect key="frame" x="467" y="638" width="90" height="90"/>
<constraints>
<constraint firstAttribute="width" constant="90" id="VFp-nz-h8O"/>
<constraint firstAttribute="height" constant="90" id="ZUg-Ud-mgE"/>
</constraints>
</imageView>
</subviews>
<viewLayoutGuide key="safeArea" id="Whf-X3-AA4"/>
<color key="backgroundColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="q5g-aV-39U" firstAttribute="centerX" secondItem="gZ9-gc-3t5" secondAttribute="centerX" id="Ayw-bo-LVF"/>
<constraint firstItem="q5g-aV-39U" firstAttribute="centerY" secondItem="gZ9-gc-3t5" secondAttribute="centerY" id="YHd-Kc-J0u"/>
</constraints>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
<resources>
<image name="launch.png" width="1024" height="1024"/>
</resources>
</document>

View File

@@ -0,0 +1,178 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleAllowMixedLocalizations</key>
<true/>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>${QT_INTERNAL_DOLLAR_VAR}{PRODUCT_NAME}</string>
<key>CFBundleExecutable</key>
<string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>${MACOSX_BUNDLE_GUI_IDENTIFIER}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${MACOSX_BUNDLE_BUNDLE_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>${MACOSX_BUNDLE_SHORT_VERSION_STRING}</string>
<key>CFBundleVersion</key>
<string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string>
<key>NSHumanReadableCopyright</key>
<string>${MACOSX_BUNDLE_COPYRIGHT}</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>LSSupportsOpeningDocumentsInPlace</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>AmneziaVPNLaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key>
<array/>
<key>UIRequiresFullScreen</key>
<true/>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationPortrait</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array/>
<key>UIUserInterfaceStyle</key>
<string>Light</string>
<key>com.wireguard.ios.app_group_id</key>
<string>group.org.amnezia.AmneziaVPN</string>
<key>UIViewControllerBasedStatusBarAppearance</key>
<true/>
<key>NSCameraUsageDescription</key>
<string>Amnezia VPN needs access to the camera for reading QR-codes.</string>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<false/>
<key>NSAllowsLocalNetworking</key>
<true/>
</dict>
<key>CFBundleIcons</key>
<dict/>
<key>CFBundleIcons~ipad</key>
<dict/>
<key>UTImportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.data</string>
</array>
<key>UTTypeDescription</key>
<string>Amnezia VPN config</string>
<key>UTTypeIconFiles</key>
<array/>
<key>UTTypeIdentifier</key>
<string>org.amnezia.AmneziaVPN.amnezia-config</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>vpn</string>
</array>
<key>public.mime-type</key>
<array>
<string>text/plain</string>
</array>
</dict>
</dict>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.data</string>
</array>
<key>UTTypeDescription</key>
<string>WireGuard config</string>
<key>UTTypeIconFiles</key>
<array/>
<key>UTTypeIdentifier</key>
<string>org.amnezia.AmneziaVPN.wireguard-config</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>conf</string>
<string>cfg</string>
</array>
<key>public.mime-type</key>
<array>
<string>text/plain</string>
</array>
</dict>
</dict>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.data</string>
</array>
<key>UTTypeDescription</key>
<string>OpenVPN config</string>
<key>UTTypeIconFiles</key>
<array/>
<key>UTTypeIdentifier</key>
<string>org.amnezia.AmneziaVPN.openvpn-config</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>ovpn</string>
</array>
<key>public.mime-type</key>
<array>
<string>text/plain</string>
</array>
</dict>
</dict>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.data</string>
</array>
<key>UTTypeDescription</key>
<string>AmneziaVPN backup file</string>
<key>UTTypeIconFiles</key>
<array/>
<key>UTTypeIdentifier</key>
<string>org.amnezia.AmneziaVPN.backup-config</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>backup</string>
</array>
<key>public.mime-type</key>
<array>
<string>text/plain</string>
</array>
</dict>
</dict>
</array>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeName</key>
<string>Amnezia VPN config</string>
<key>LSHandlerRank</key>
<string>Alternate</string>
<key>LSItemContentTypes</key>
<array>
<string>org.amnezia.AmneziaVPN.amnezia-config</string>
<string>org.amnezia.AmneziaVPN.wireguard-config</string>
<string>org.amnezia.AmneziaVPN.openvpn-config</string>
<string>org.amnezia.AmneziaVPN.backup-config</string>
</array>
</dict>
</array>
</dict>
</plist>

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 767 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

@@ -0,0 +1,290 @@
{
"images" : [
{
"filename" : "40.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "20x20"
},
{
"filename" : "60.png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "20x20"
},
{
"filename" : "29.png",
"idiom" : "iphone",
"scale" : "1x",
"size" : "29x29"
},
{
"filename" : "58.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "29x29"
},
{
"filename" : "87.png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "29x29"
},
{
"filename" : "80.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "40x40"
},
{
"filename" : "120.png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "40x40"
},
{
"filename" : "57.png",
"idiom" : "iphone",
"scale" : "1x",
"size" : "57x57"
},
{
"filename" : "114.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "57x57"
},
{
"filename" : "120.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "60x60"
},
{
"filename" : "180.png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "60x60"
},
{
"filename" : "20.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "20x20"
},
{
"filename" : "40.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "20x20"
},
{
"filename" : "29.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "29x29"
},
{
"filename" : "58.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "29x29"
},
{
"filename" : "40.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "40x40"
},
{
"filename" : "80.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "40x40"
},
{
"filename" : "50.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "50x50"
},
{
"filename" : "100.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "50x50"
},
{
"filename" : "72.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "72x72"
},
{
"filename" : "144.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "72x72"
},
{
"filename" : "76.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "76x76"
},
{
"filename" : "152.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "76x76"
},
{
"filename" : "167.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "83.5x83.5"
},
{
"filename" : "1024.png",
"idiom" : "ios-marketing",
"scale" : "1x",
"size" : "1024x1024"
},
{
"idiom" : "watch",
"role" : "notificationCenter",
"scale" : "2x",
"size" : "24x24",
"subtype" : "38mm"
},
{
"idiom" : "watch",
"role" : "notificationCenter",
"scale" : "2x",
"size" : "27.5x27.5",
"subtype" : "42mm"
},
{
"idiom" : "watch",
"role" : "companionSettings",
"scale" : "2x",
"size" : "29x29"
},
{
"idiom" : "watch",
"role" : "companionSettings",
"scale" : "3x",
"size" : "29x29"
},
{
"idiom" : "watch",
"role" : "notificationCenter",
"scale" : "2x",
"size" : "33x33",
"subtype" : "45mm"
},
{
"idiom" : "watch",
"role" : "appLauncher",
"scale" : "2x",
"size" : "40x40",
"subtype" : "38mm"
},
{
"idiom" : "watch",
"role" : "appLauncher",
"scale" : "2x",
"size" : "44x44",
"subtype" : "40mm"
},
{
"idiom" : "watch",
"role" : "appLauncher",
"scale" : "2x",
"size" : "46x46",
"subtype" : "41mm"
},
{
"idiom" : "watch",
"role" : "appLauncher",
"scale" : "2x",
"size" : "50x50",
"subtype" : "44mm"
},
{
"idiom" : "watch",
"role" : "appLauncher",
"scale" : "2x",
"size" : "51x51",
"subtype" : "45mm"
},
{
"idiom" : "watch",
"role" : "appLauncher",
"scale" : "2x",
"size" : "54x54",
"subtype" : "49mm"
},
{
"idiom" : "watch",
"role" : "quickLook",
"scale" : "2x",
"size" : "86x86",
"subtype" : "38mm"
},
{
"idiom" : "watch",
"role" : "quickLook",
"scale" : "2x",
"size" : "98x98",
"subtype" : "42mm"
},
{
"idiom" : "watch",
"role" : "quickLook",
"scale" : "2x",
"size" : "108x108",
"subtype" : "44mm"
},
{
"idiom" : "watch",
"role" : "quickLook",
"scale" : "2x",
"size" : "117x117",
"subtype" : "45mm"
},
{
"idiom" : "watch",
"role" : "quickLook",
"scale" : "2x",
"size" : "129x129",
"subtype" : "49mm"
},
{
"idiom" : "watch-marketing",
"scale" : "1x",
"size" : "1024x1024"
},
{
"idiom" : "car",
"scale" : "2x",
"size" : "60"
},
{
"idiom" : "car",
"scale" : "3x",
"size" : "60"
},
{
"idiom" : "watch",
"role" : "longLook",
"scale" : "2x",
"size" : "44x44",
"subtype" : "42mm"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSPrivacyAccessedAPITypes</key>
<array>
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategoryFileTimestamp</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>C617.1</string>
</array>
</dict>
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategoryUserDefaults</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>1C8F.1</string>
</array>
</dict>
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategorySystemBootTime</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>35F9.1</string>
</array>
</dict>
</array>
</dict>
</plist>

BIN
client/macos/app/launch.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 583 KiB

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.developer.networking.networkextension</key>
<array>
<string>packet-tunnel-provider</string>
</array>
<key>com.apple.security.application-groups</key>
<array>
<string>group.org.amnezia.AmneziaVPN</string>
</array>
<key>com.apple.security.files.user-selected.read-write</key>
<true/>
<key>keychain-access-groups</key>
<array>
<string>$(AppIdentifierPrefix)group.org.amnezia.AmneziaVPN</string>
</array>
</dict>
</plist>

View File

@@ -3,40 +3,26 @@
<plist version="1.0">
<dict>
<key>com.apple.application-identifier</key>
<string>$(DEVELOPMENT_TEAM).$(NETEXT_ID_MACOS)</string>
<string>X7UJ388FXK.org.amnezia.AmneziaVPN.network-extension</string>
<key>com.apple.developer.networking.networkextension</key>
<array>
<string>packet-tunnel-provider</string>
</array>
<key>keychain-access-groups</key>
<array>
<string>$(DEVELOPMENT_TEAM).*</string>
</array>
<key>com.apple.developer.team-identifier</key>
<string>$(DEVELOPMENT_TEAM)</string>
<key>com.apple.developer.system-extension.install</key>
<true/>
<string>X7UJ388FXK</string>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.application-groups</key>
<array>
<string>$(DEVELOPMENT_TEAM).$(GROUP_ID_MACOS)</string>
<string>group.org.amnezia.AmneziaVPN</string>
</array>
<key>com.apple.security.network.client</key>
<true/>
<key>com.apple.security.network.server</key>
<true/>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.private.network.socket-delegate</key>
<true/>
<key>keychain-access-groups</key>
<array>
<string>$(AppIdentifierPrefix)org.amnezia.AmneziaVPN.network-extension</string>
</array>
</dict>
</plist>

View File

@@ -0,0 +1,207 @@
enable_language(Swift)
message("Client message >> macos build >> networkextension")
set(CLIENT_ROOT_DIR ${CMAKE_CURRENT_LIST_DIR}/../..)
add_executable(networkextension)
configure_file(
${CMAKE_CURRENT_LIST_DIR}/Info.plist.in
${CMAKE_CURRENT_BINARY_DIR}/Info.plist
)
if(MACOS_NE)
message("MACOS_NE is ON")
add_definitions(-DQ_OS_IOS)
add_definitions(-DMACOS_NE)
message("Add macros for MacOS Network Extension")
else()
message("MACOS_NE is OFF")
endif()
set_target_properties(networkextension PROPERTIES
XCODE_PRODUCT_TYPE com.apple.product-type.app-extension
BUNDLE_EXTENSION appex
#MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_BINARY_DIR}/Info.plist
MACOSX_BUNDLE_SHORT_VERSION_STRING "${APPLE_PROJECT_VERSION}"
XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER "${BUILD_IOS_APP_IDENTIFIER}.network-extension"
XCODE_ATTRIBUTE_PRODUCT_BUNDLE_NAME "${BUILD_IOS_APP_IDENTIFIER}.network-extension"
XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS ${CMAKE_CURRENT_SOURCE_DIR}/AmneziaVPNNetworkExtension.entitlements
XCODE_ATTRIBUTE_MARKETING_VERSION "${APP_MAJOR_VERSION}"
XCODE_ATTRIBUTE_CURRENT_PROJECT_VERSION "${BUILD_ID}"
XCODE_ATTRIBUTE_PRODUCT_NAME "AmneziaVPNNetworkExtension"
XCODE_ATTRIBUTE_APPLICATION_EXTENSION_API_ONLY "YES"
XCODE_ATTRIBUTE_ENABLE_BITCODE "NO"
XCODE_ATTRIBUTE_TARGETED_DEVICE_FAMILY "1,2"
XCODE_ATTRIBUTE_LD_RUNPATH_SEARCH_PATHS "@executable_path/../../Frameworks"
XCODE_ATTRIBUTE_CODE_SIGN_STYLE Automatic
# #XCODE_ATTRIBUTE_CODE_SIGN_STYLE Manual
# #XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "Apple Distribution: Privacy Technologies OU (X7UJ388FXK)"
# #XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY[variant=Debug] "Apple Development"
# #XCODE_ATTRIBUTE_PROVISIONING_PROFILE_SPECIFIER "Mac AppStore AmneziaVPN.network-extension"
# #XCODE_ATTRIBUTE_PROVISIONING_PROFILE_SPECIFIER[variant=Debug] "Mac AppStore AmneziaVPN.network-extension"
XCODE_ATTRIBUTE_INFOPLIST_FILE "${CMAKE_CURRENT_BINARY_DIR}/Info.plist"
XCODE_ATTRIBUTE_LD_RUNPATH_SEARCH_PATHS "@executable_path/../../../../Frameworks @loader_path/../../../../Frameworks"
)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set_target_properties(networkextension PROPERTIES
XCODE_ATTRIBUTE_CODE_SIGN_STYLE Automatic
)
endif()
if(CMAKE_BUILD_TYPE STREQUAL "Release")
set_target_properties(networkextension PROPERTIES
XCODE_ATTRIBUTE_CODE_SIGN_STYLE Automatic
#XCODE_ATTRIBUTE_CODE_SIGN_STYLE Manual
#XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "Apple Distribution: Privacy Technologies OU (X7UJ388FXK)"
#XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY[variant=Debug] "Apple Development"
#XCODE_ATTRIBUTE_PROVISIONING_PROFILE_SPECIFIER "Mac AppStore AmneziaVPN.network-extension"
#XCODE_ATTRIBUTE_PROVISIONING_PROFILE_SPECIFIER[variant=Debug] "Mac AppStore AmneziaVPN.network-extension"
)
endif()
set_target_properties(networkextension PROPERTIES
XCODE_ATTRIBUTE_SWIFT_VERSION "5.0"
XCODE_ATTRIBUTE_CLANG_ENABLE_MODULES "YES"
XCODE_ATTRIBUTE_SWIFT_OBJC_BRIDGING_HEADER "${CMAKE_CURRENT_SOURCE_DIR}/WireGuardNetworkExtension-Bridging-Header.h"
XCODE_ATTRIBUTE_SWIFT_OPTIMIZATION_LEVEL "-Onone"
XCODE_ATTRIBUTE_SWIFT_PRECOMPILE_BRIDGING_HEADER "NO"
)
set_target_properties("networkextension" PROPERTIES
XCODE_ATTRIBUTE_DEVELOPMENT_TEAM "X7UJ388FXK"
)
find_library(FW_ASSETS_LIBRARY AssetsLibrary)
find_library(FW_MOBILE_CORE MobileCoreServices)
find_library(FW_UI_KIT UIKit)
find_library(FW_LIBRESOLV libresolv.9.tbd)
# set(OpenVPNAdapter_DIR "${CLIENT_ROOT_DIR}/3rd/")
# find_library(OPENVPN_ADAPTER_LIBRARY OpenVPNAdapter PATHS ${OpenVPNAdapter_DIR})
# target_link_libraries(networkextension PRIVATE ${OPENVPN_ADAPTER_LIBRARY})
# add_custom_command(TARGET networkextension PRE_BUILD
# COMMAND ${CMAKE_COMMAND} -E make_directory $<TARGET_FILE_DIR:networkextension>/../Frameworks
# )
# add_custom_command(TARGET networkextension POST_BUILD
# COMMAND ${CMAKE_COMMAND} -E echo "Copying ${OPENVPN_ADAPTER_LIBRARY} to $<TARGET_FILE_DIR:networkextension>/../Frameworks/"
# COMMAND ${CMAKE_COMMAND} -E copy_if_different
# ${OPENVPN_ADAPTER_LIBRARY}
# $<TARGET_FILE_DIR:networkextension>/../Frameworks/
# COMMAND ${CMAKE_COMMAND} -E echo "Copy complete"
# )
# Set the root directory
set(CLIENT_ROOT_DIR ${CMAKE_CURRENT_LIST_DIR}/../..)
# Embedding the framework using CLIENT_ROOT_DIR
set_property(TARGET networkextension PROPERTY XCODE_EMBED_FRAMEWORKS
"${CLIENT_ROOT_DIR}/3rd/OpenVPNAdapter/build/Release-macos/OpenVPNAdapter.framework"
)
# Setting the framework search paths using CLIENT_ROOT_DIR
set(CMAKE_XCODE_ATTRIBUTE_FRAMEWORK_SEARCH_PATHS "${CLIENT_ROOT_DIR}/3rd/OpenVPNAdapter/build/Release-macos")
# Linking the framework using CLIENT_ROOT_DIR
target_link_libraries("networkextension" PRIVATE "${CLIENT_ROOT_DIR}/3rd/OpenVPNAdapter/build/Release-macos/OpenVPNAdapter.framework")
#target_link_libraries(networkextension PRIVATE ${FW_ASSETS_LIBRARY})
#target_link_libraries(networkextension PRIVATE ${FW_MOBILE_CORE})
#target_link_libraries(networkextension PRIVATE ${FW_UI_KIT})
target_link_libraries(networkextension PRIVATE ${FW_LIBRESOLV})
target_compile_options(networkextension PRIVATE -DGROUP_ID=\"${BUILD_IOS_GROUP_IDENTIFIER}\")
target_compile_options(networkextension PRIVATE -DNETWORK_EXTENSION=1)
set(WG_APPLE_SOURCE_DIR ${CLIENT_ROOT_DIR}/3rd/amneziawg-apple/Sources)
message("WG_APPLE_SOURCE_DIR is: ${WG_APPLE_SOURCE_DIR}")
message("CLIENT_ROOT_DIR is: ${CLIENT_ROOT_DIR}")
target_sources(networkextension PRIVATE
${WG_APPLE_SOURCE_DIR}/WireGuardKit/WireGuardAdapter.swift
${WG_APPLE_SOURCE_DIR}/WireGuardKit/PacketTunnelSettingsGenerator.swift
${WG_APPLE_SOURCE_DIR}/WireGuardKit/DNSResolver.swift
${WG_APPLE_SOURCE_DIR}/WireGuardNetworkExtension/ErrorNotifier.swift
${WG_APPLE_SOURCE_DIR}/Shared/Keychain.swift
${WG_APPLE_SOURCE_DIR}/Shared/Model/TunnelConfiguration+WgQuickConfig.swift
${WG_APPLE_SOURCE_DIR}/Shared/Model/NETunnelProviderProtocol+Extension.swift
${WG_APPLE_SOURCE_DIR}/Shared/Model/String+ArrayConversion.swift
${WG_APPLE_SOURCE_DIR}/WireGuardKit/TunnelConfiguration.swift
${WG_APPLE_SOURCE_DIR}/WireGuardKit/IPAddressRange.swift
${WG_APPLE_SOURCE_DIR}/WireGuardKit/Endpoint.swift
${WG_APPLE_SOURCE_DIR}/WireGuardKit/DNSServer.swift
${WG_APPLE_SOURCE_DIR}/WireGuardKit/InterfaceConfiguration.swift
${WG_APPLE_SOURCE_DIR}/WireGuardKit/PeerConfiguration.swift
${WG_APPLE_SOURCE_DIR}/Shared/FileManager+Extension.swift
${WG_APPLE_SOURCE_DIR}/WireGuardKitC/x25519.c
${WG_APPLE_SOURCE_DIR}/WireGuardKit/Array+ConcurrentMap.swift
${WG_APPLE_SOURCE_DIR}/WireGuardKit/IPAddress+AddrInfo.swift
${WG_APPLE_SOURCE_DIR}/WireGuardKit/PrivateKey.swift
${CLIENT_ROOT_DIR}/platforms/ios/HevSocksTunnel.swift
${CLIENT_ROOT_DIR}/platforms/ios/NELogController.swift
${CLIENT_ROOT_DIR}/platforms/ios/Log.swift
${CLIENT_ROOT_DIR}/platforms/ios/LogRecord.swift
${CLIENT_ROOT_DIR}/platforms/ios/PacketTunnelProvider.swift
${CLIENT_ROOT_DIR}/platforms/ios/PacketTunnelProvider+WireGuard.swift
${CLIENT_ROOT_DIR}/platforms/ios/PacketTunnelProvider+OpenVPN.swift
${CLIENT_ROOT_DIR}/platforms/ios/PacketTunnelProvider+Xray.swift
${CLIENT_ROOT_DIR}/platforms/ios/WGConfig.swift
${CLIENT_ROOT_DIR}/platforms/ios/iosglue.mm
)
target_sources(networkextension PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/PrivacyInfo.xcprivacy
)
set_property(TARGET networkextension APPEND PROPERTY RESOURCE
${CMAKE_CURRENT_SOURCE_DIR}/PrivacyInfo.xcprivacy
)
## Build wireguard-go-version.h
execute_process(
COMMAND go list -m golang.zx2c4.com/wireguard
WORKING_DIRECTORY ${CLIENT_ROOT_DIR}/3rd/wireguard-apple/Sources/WireGuardKitGo
OUTPUT_VARIABLE WG_VERSION_FULL
)
string(REGEX REPLACE ".*v\([0-9.]*\).*" "\\1" WG_VERSION_STRING 1.1.1)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/wireguard-go-version.h.in
${CMAKE_CURRENT_BINARY_DIR}/wireguard-go-version.h)
target_sources(networkextension PRIVATE
${CMAKE_CURRENT_BINARY_DIR}/wireguard-go-version.h)
target_include_directories(networkextension PRIVATE ${CLIENT_ROOT_DIR})
target_include_directories(networkextension PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
target_link_libraries(networkextension PRIVATE ${CLIENT_ROOT_DIR}/3rd-prebuilt/3rd-prebuilt/wireguard/macos/x86_64/libwg-go.a)
# Print the root directory for debugging purposes
message("---------")
message(${CLIENT_ROOT_DIR})
message(${CLIENT_ROOT_DIR}/3rd-prebuilt/3rd-prebuilt/xray/HevSocks5Tunnel.xcframework/macos-arm64_x86_64/libhev-socks5-tunnel.a)
target_link_libraries("networkextension" PRIVATE "${CLIENT_ROOT_DIR}/3rd-prebuilt/3rd-prebuilt/xray/HevSocks5Tunnel.xcframework/macos-arm64_x86_64/libhev-socks5-tunnel.a")
target_include_directories(networkextension PRIVATE ${CLIENT_ROOT_DIR}/3rd-prebuilt/3rd-prebuilt/xray/HevSocks5Tunnel.xcframework/macos-arm64_x86_64/Headers)

View File

@@ -3,27 +3,32 @@
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>AmneziaVPNNetworkExtension</string>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<string>AmneziaVPNNetworkExtension</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<string>${BUILD_IOS_APP_IDENTIFIER}.network-extension</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<string>AmneziaVPNNetworkExtension</string>
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<string>${APPLE_PROJECT_VERSION}</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<string>${CMAKE_PROJECT_VERSION_TWEAK}</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<string>${CMAKE_OSX_DEPLOYMENT_TARGET}</string>
<key>CFBundleDisplayName</key>
<string>AmneziaVPNNetworkExtension</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionPointIdentifier</key>
@@ -31,5 +36,11 @@
<key>NSExtensionPrincipalClass</key>
<string>$(PRODUCT_MODULE_NAME).PacketTunnelProvider</string>
</dict>
<key>com.wireguard.ios.app_group_id</key>
<string>group.org.amnezia.AmneziaVPN</string>
<key>com.wireguard.macos.app_group_id</key>
<string>${BUILD_VPN_DEVELOPMENT_TEAM}.group.org.amnezia.AmneziaVPN</string>
</dict>
</plist>

View File

@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSPrivacyAccessedAPITypes</key>
<array>
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategoryUserDefaults</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>1C8F.1</string>
</array>
</dict>
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategoryFileTimestamp</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>C617.1</string>
</array>
</dict>
</array>
</dict>
</plist>

View File

@@ -1,10 +1,6 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "macos/gobridge/wireguard.h"
#include "wireguard-go-version.h"
#include "3rd/awg-apple/Sources/WireGuardKitC/WireGuardKitC.h"
#include "3rd/amneziawg-apple/Sources/WireGuardKitGo/wireguard.h"
#include "3rd/amneziawg-apple/Sources/WireGuardKitC/WireGuardKitC.h"
#include <stdbool.h>
#include <stdint.h>
@@ -23,3 +19,8 @@ bool key_from_hex(uint8_t key[WG_KEY_LEN], const char* hex);
bool key_eq(const uint8_t key1[WG_KEY_LEN], const uint8_t key2[WG_KEY_LEN]);
void write_msg_to_log(const char* tag, const char* msg);
// Khai báo hàm C để Swift có thể sử dụng
void hev_socks5_tunnel_quit(void);
// Updated function definition in C
int hev_socks5_tunnel_main(const char* configFile, int fd);

View File

@@ -0,0 +1,3 @@
#ifndef WIREGUARD_GO_VERSION
#define WIREGUARD_GO_VERSION "@WG_VERSION_STRING@"
#endif // WIREGUARD_GO_VERSION

View File

@@ -0,0 +1,19 @@
#!/bin/sh
# go/clangwrap_macos.sh
# Lấy đường dẫn SDK cho macOS
SDK_PATH=`xcrun --sdk macosx --show-sdk-path`
# Tìm đường dẫn đến `clang` cho macOS
CLANG=`xcrun --sdk macosx --find clang`
# Xác định kiến trúc máy dựa trên biến GOARCH
if [ "$GOARCH" == "amd64" ]; then
CARCH="x86_64"
elif [ "$GOARCH" == "arm64" ]; then
CARCH="arm64"
fi
# Thực thi `clang` với các tùy chọn cụ thể cho macOS
exec $CLANG -arch $CARCH -isysroot $SDK_PATH -mmacosx-version-min=10.15 "$@"

View File

@@ -0,0 +1,39 @@
#!/bin/bash
XCODEBUILD="/usr/bin/xcodebuild"
WORKINGDIR=`pwd`
PATCH="/usr/bin/patch"
echo "Building OpenVPNAdapter for macOS Network Extension (MacNE)..."
# Copy the Project-MacNE.xcconfig settings to amnezia.xcconfig
cat $WORKINGDIR/3rd/OpenVPNAdapter/Configuration/Project-MacNE.xcconfig > $WORKINGDIR/3rd/OpenVPNAdapter/Configuration/amnezia.xcconfig
# Append macOS-specific build directory configurations to amnezia.xcconfig
cat << EOF >> $WORKINGDIR/3rd/OpenVPNAdapter/Configuration/amnezia.xcconfig
PROJECT_TEMP_DIR = $WORKINGDIR/3rd/OpenVPNAdapter/build/OpenVPNAdapter.build
CONFIGURATION_BUILD_DIR = $WORKINGDIR/3rd/OpenVPNAdapter/build/Release-macos
BUILT_PRODUCTS_DIR = $WORKINGDIR/3rd/OpenVPNAdapter/build/Release-macos
EOF
# Exclude UIKit, include Cocoa for macOS
# echo "OTHER_LDFLAGS = -framework Cocoa" >> $WORKINGDIR/3rd/OpenVPNAdapter/Configuration/amnezia.xcconfig
# Fetch the current macOS SDK version dynamically
MACOSX_SDK=$(xcrun --sdk macosx --show-sdk-path | sed -E 's/.*MacOSX([0-9]+\.[0-9]+)\.sdk/\1/')
echo "Using macOS SDK version: $MACOSX_SDK"
cd 3rd/OpenVPNAdapter
# Build for macOS using the correct SDK and destination
if $XCODEBUILD -scheme OpenVPNAdapter -configuration Release -xcconfig Configuration/amnezia.xcconfig -sdk macosx$MACOSX_SDK -destination 'generic/platform=macOS' -project OpenVPNAdapter.xcodeproj ; then
echo "OpenVPNAdapter built successfully for macOS Network Extension (MacNE)"
else
echo "OpenVPNAdapter macOS Network Extension (MacNE) build failed..."
fi
# Remove CodeSignature if needed for macOS
rm -rf ./build/Release-macos/OpenVPNAdapter.framework/Versions/A/_CodeSignature
cd ../../

View File

@@ -34,8 +34,8 @@ LocalSocketController::LocalSocketController() {
m_socket = new QLocalSocket(this);
connect(m_socket, &QLocalSocket::connected, this,
&LocalSocketController::daemonConnected);
connect(m_socket, &QLocalSocket::disconnected, this,
[&] { errorOccurred(QLocalSocket::PeerClosedError); });
connect(m_socket, &QLocalSocket::disconnected, this,
&LocalSocketController::disconnected);
connect(m_socket, &QLocalSocket::errorOccurred, this,
&LocalSocketController::errorOccurred);
connect(m_socket, &QLocalSocket::readyRead, this,

View File

@@ -47,7 +47,7 @@ extension PacketTunnelProvider {
let configuration = OpenVPNConfiguration()
configuration.fileContent = ovpnConfiguration
if str.contains("cloak") {
configuration.setPTCloak()
// configuration.setPTCloak()
}
let evaluation: OpenVPNConfigurationEvaluation?

View File

@@ -1,10 +1,196 @@
//import Foundation
//import NetworkExtension
//import WireGuardKitGo
//
//enum XrayErrors: Error {
// case noXrayConfig
// case xrayConfigIsWrong
// case cantSaveXrayConfig
// case cantParseListenAndPort
// case cantSaveHevSocksConfig
//}
//
//extension Constants {
// static let cachesDirectory: URL = {
// if let cachesDirectoryURL = FileManager.default.urls(for: .cachesDirectory,
// in: .userDomainMask).first {
// return cachesDirectoryURL
// } else {
// fatalError("Unable to retrieve caches directory.")
// }
// }()
//}
//
//extension PacketTunnelProvider {
// func startXray(completionHandler: @escaping (Error?) -> Void) {
//
// // Xray configuration
// guard let protocolConfiguration = self.protocolConfiguration as? NETunnelProviderProtocol,
// let providerConfiguration = protocolConfiguration.providerConfiguration,
// let configData = providerConfiguration[Constants.xrayConfigKey] as? Data else {
// xrayLog(.error, message: "Can't get xray configuration")
// completionHandler(XrayErrors.noXrayConfig)
// return
// }
//
// // Tunnel settings
// let ipv6Enabled = false
// let hideVPNIcon = false
//
// let settings = NEPacketTunnelNetworkSettings(tunnelRemoteAddress: "254.1.1.1")
// settings.mtu = 9000
//
// settings.ipv4Settings = {
// let settings = NEIPv4Settings(addresses: ["198.18.0.1"], subnetMasks: ["255.255.0.0"])
// settings.includedRoutes = [NEIPv4Route.default()]
// return settings
// }()
//
// settings.ipv6Settings = {
// guard ipv6Enabled else {
// return nil
// }
// let settings = NEIPv6Settings(addresses: ["fd6e:a81b:704f:1211::1"], networkPrefixLengths: [64])
// settings.includedRoutes = [NEIPv6Route.default()]
// if hideVPNIcon {
// settings.excludedRoutes = [NEIPv6Route(destinationAddress: "::", networkPrefixLength: 128)]
// }
// return settings
// }()
//
// do {
// let xrayConfig = try JSONDecoder().decode(XrayConfig.self,
// from: configData)
//
// var dnsArray = [String]()
// if let dns1 = xrayConfig.dns1 {
// dnsArray.append(dns1)
// }
// if let dns2 = xrayConfig.dns2 {
// dnsArray.append(dns2)
// }
//
// settings.dnsSettings = !dnsArray.isEmpty
// ? NEDNSSettings(servers: dnsArray)
// : NEDNSSettings(servers: ["1.1.1.1"])
//
// let xrayConfigData = xrayConfig.config.data(using: .utf8)
//
// guard let xrayConfigData else {
// xrayLog(.error, message: "Can't encode config to data")
// completionHandler(XrayErrors.xrayConfigIsWrong)
// return
// }
//
// let jsonDict = try JSONSerialization.jsonObject(with: xrayConfigData,
// options: []) as? [String: Any]
//
// guard var jsonDict else {
// xrayLog(.error, message: "Can't parse address and port for hevSocks")
// completionHandler(XrayErrors.cantParseListenAndPort)
// return
// }
//
// let port = 10808
// let address = "::1"
//
// if var inboundsArray = jsonDict["inbounds"] as? [[String: Any]], !inboundsArray.isEmpty {
// inboundsArray[0]["port"] = port
// inboundsArray[0]["listen"] = address
// jsonDict["inbounds"] = inboundsArray
// }
//
// let updatedData = try JSONSerialization.data(withJSONObject: jsonDict, options: [])
//
// setTunnelNetworkSettings(settings) { [weak self] error in
// if let error {
// completionHandler(error)
// return
// }
//
// // Launch xray
// self?.setupAndStartXray(configData: updatedData) { xrayError in
// if let xrayError {
// completionHandler(xrayError)
// return
// }
//
// // Launch hevSocks
// self?.setupAndRunTun2socks(configData: updatedData,
// address: address,
// port: port,
// completionHandler: completionHandler)
// }
// }
// } catch {
// completionHandler(error)
// return
// }
// }
//
// func stopXray(completionHandler: () -> Void) {
// Socks5Tunnel.quit()
// LibXrayStopXray()
// completionHandler()
// }
//
// private func setupAndStartXray(configData: Data,
// completionHandler: @escaping (Error?) -> Void) {
// let path = Constants.cachesDirectory.appendingPathComponent("config.json", isDirectory: false).path
// guard FileManager.default.createFile(atPath: path, contents: configData) else {
// xrayLog(.error, message: "Can't save xray configuration")
// completionHandler(XrayErrors.cantSaveXrayConfig)
// return
// }
//
// LibXrayRunXray(nil,
// path,
// Int64.max)
//
// completionHandler(nil)
// xrayLog(.info, message: "Xray started")
// }
//
// private func setupAndRunTun2socks(configData: Data,
// address: String,
// port: Int,
// completionHandler: @escaping (Error?) -> Void) {
// let config = """
// tunnel:
// mtu: 9000
// socks5:
// port: \(port)
// address: \(address)
// udp: 'udp'
// misc:
// task-stack-size: 20480
// connect-timeout: 5000
// read-write-timeout: 60000
// log-file: stderr
// log-level: error
// limit-nofile: 65535
// """
//
// let configurationFilePath = Constants.cachesDirectory.appendingPathComponent("config.yml", isDirectory: false).path
// guard FileManager.default.createFile(atPath: configurationFilePath, contents: config.data(using: .utf8)!) else {
// xrayLog(.info, message: "Cant save hevSocks configuration")
// completionHandler(XrayErrors.cantSaveHevSocksConfig)
// return
// }
//
// DispatchQueue.global().async {
// xrayLog(.info, message: "Hev socks started")
// completionHandler(nil)
// Socks5Tunnel.run(withConfig: configurationFilePath)
// }
// }
//}
import Foundation
import NetworkExtension
import WireGuardKitGo
enum XrayErrors: Error {
case noXrayConfig
case xrayConfigIsWrong
case cantSaveXrayConfig
case cantParseListenAndPort
case cantSaveHevSocksConfig
@@ -27,14 +213,14 @@ extension PacketTunnelProvider {
// Xray configuration
guard let protocolConfiguration = self.protocolConfiguration as? NETunnelProviderProtocol,
let providerConfiguration = protocolConfiguration.providerConfiguration,
let configData = providerConfiguration[Constants.xrayConfigKey] as? Data else {
let xrayConfigData = providerConfiguration[Constants.xrayConfigKey] as? Data else {
xrayLog(.error, message: "Can't get xray configuration")
completionHandler(XrayErrors.noXrayConfig)
return
}
// Tunnel settings
let ipv6Enabled = false
let ipv6Enabled = true
let hideVPNIcon = false
let settings = NEPacketTunnelNetworkSettings(tunnelRemoteAddress: "254.1.1.1")
@@ -58,29 +244,12 @@ extension PacketTunnelProvider {
return settings
}()
let dns = ["8.8.4.4","1.1.1.1"]
settings.dnsSettings = NEDNSSettings(servers: dns)
do {
let xrayConfig = try JSONDecoder().decode(XrayConfig.self,
from: configData)
var dnsArray = [String]()
if let dns1 = xrayConfig.dns1 {
dnsArray.append(dns1)
}
if let dns2 = xrayConfig.dns2 {
dnsArray.append(dns2)
}
settings.dnsSettings = !dnsArray.isEmpty
? NEDNSSettings(servers: dnsArray)
: NEDNSSettings(servers: ["1.1.1.1"])
let xrayConfigData = xrayConfig.config.data(using: .utf8)
guard let xrayConfigData else {
xrayLog(.error, message: "Can't encode config to data")
completionHandler(XrayErrors.xrayConfigIsWrong)
return
}
let port = 10808
let address = "::1"
let jsonDict = try JSONSerialization.jsonObject(with: xrayConfigData,
options: []) as? [String: Any]
@@ -91,9 +260,6 @@ extension PacketTunnelProvider {
return
}
let port = 10808
let address = "::1"
if var inboundsArray = jsonDict["inbounds"] as? [[String: Any]], !inboundsArray.isEmpty {
inboundsArray[0]["port"] = port
inboundsArray[0]["listen"] = address

View File

@@ -1,3 +1,4 @@
#if !MACOS_NE
#include "QRCodeReaderBase.h"
#import <UIKit/UIKit.h>
@@ -108,3 +109,19 @@ void QRCodeReader::startReading() {
void QRCodeReader::stopReading() {
[m_qrCodeReader stopReading];
}
#else
#include "QRCodeReaderBase.h"
QRCodeReader::QRCodeReader()
{
}
QRect QRCodeReader::cameraSize() {
return QRect();
}
void QRCodeReader::startReading() {}
void QRCodeReader::stopReading() {}
void QRCodeReader::setCameraSize(QRect) {}
#endif

View File

@@ -1,5 +1,6 @@
#if !MACOS_NE
#import <UIKit/UIKit.h>
#endif
@interface QIOSApplicationDelegate
@end

View File

@@ -5,7 +5,7 @@
@implementation QIOSApplicationDelegate (AmneziaVPNDelegate)
#if !MACOS_NE
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[application setMinimumBackgroundFetchInterval: UIApplicationBackgroundFetchIntervalMinimum];
@@ -57,5 +57,5 @@
}
return NO;
}
#endif
@end

View File

@@ -1,3 +1,13 @@
#if MACOS_NE
public func toggleScreenshots(_ isEnabled: Bool) {
}
class ScreenProtection {
}
#else
import UIKit
public func toggleScreenshots(_ isEnabled: Bool) {
@@ -85,3 +95,4 @@ struct ProtectionPair {
textField.removeFromSuperview()
}
}
#endif

View File

@@ -27,6 +27,7 @@ const char* MessageKey::isOnDemand = "is-on-demand";
const char* MessageKey::SplitTunnelType = "SplitTunnelType";
const char* MessageKey::SplitTunnelSites = "SplitTunnelSites";
#if !MACOS_NE
static UIViewController* getViewController() {
NSArray *windows = [[UIApplication sharedApplication]windows];
for (UIWindow *window in windows) {
@@ -36,6 +37,7 @@ static UIViewController* getViewController() {
}
return nil;
}
#endif
Vpn::ConnectionState iosStatusToState(NEVPNStatus status) {
switch (status) {
@@ -789,14 +791,14 @@ bool IosController::shareText(const QStringList& filesToSend) {
NSURL *logFileUrl = [[NSURL alloc] initFileURLWithPath:filesToSend[i].toNSString()];
[sharingItems addObject:logFileUrl];
}
#if !MACOS_NE
UIViewController *qtController = getViewController();
if (!qtController) return;
UIActivityViewController *activityController = [[UIActivityViewController alloc] initWithActivityItems:sharingItems applicationActivities:nil];
#endif
__block bool isAccepted = false;
#if !MACOS_NE
[activityController setCompletionWithItemsHandler:^(NSString *activityType, BOOL completed, NSArray *returnedItems, NSError *activityError) {
isAccepted = completed;
emit finished();
@@ -808,7 +810,7 @@ bool IosController::shareText(const QStringList& filesToSend) {
popController.sourceView = qtController.view;
popController.sourceRect = CGRectMake(100, 100, 100, 100);
}
#endif
QEventLoop wait;
QObject::connect(this, &IosController::finished, &wait, &QEventLoop::quit);
wait.exec();
@@ -817,6 +819,7 @@ bool IosController::shareText(const QStringList& filesToSend) {
}
QString IosController::openFile() {
#if !MACOS_NE
UIDocumentPickerViewController *documentPicker = [[UIDocumentPickerViewController alloc] initWithDocumentTypes:@[@"public.item"] inMode:UIDocumentPickerModeOpen];
DocumentPickerDelegate *documentPickerDelegate = [[DocumentPickerDelegate alloc] init];
@@ -826,9 +829,9 @@ QString IosController::openFile() {
if (!qtController) return;
[qtController presentViewController:documentPicker animated:YES completion:nil];
#endif
__block QString filePath;
#if !MACOS_NE
documentPickerDelegate.documentPickerClosedCallback = ^(NSString *path) {
if (path) {
filePath = QString::fromUtf8(path.UTF8String);
@@ -837,7 +840,7 @@ QString IosController::openFile() {
}
emit finished();
};
#endif
QEventLoop wait;
QObject::connect(this, &IosController::finished, &wait, &QEventLoop::quit);
wait.exec();
@@ -863,3 +866,4 @@ void IosController::requestInetAccess() {
}];
[task resume];
}

View File

@@ -1,7 +1,11 @@
#import <NetworkExtension/NetworkExtension.h>
#import <NetworkExtension/NETunnelProviderSession.h>
#import <Foundation/Foundation.h>
#if !MACOS_NE
#include <UIKit/UIKit.h>
#endif
#include <Security/Security.h>
class IosController;
@@ -17,9 +21,10 @@ class IosController;
@end
typedef void (^DocumentPickerClosedCallback)(NSString *path);
#if !MACOS_NE
@interface DocumentPickerDelegate : NSObject <UIDocumentPickerDelegate>
@property (nonatomic, copy) DocumentPickerClosedCallback documentPickerClosedCallback;
@end
#endif

View File

@@ -26,7 +26,8 @@
@end
@implementation DocumentPickerDelegate
#if !MACOS_NE
@implementation DocumentPickerDelegate
- (void)documentPicker:(UIDocumentPickerViewController *)controller didPickDocumentsAtURLs:(NSArray<NSURL *> *)urls {
for (NSURL *url in urls) {
@@ -42,4 +43,5 @@
}
}
@end
@end
#endif

View File

@@ -6,6 +6,8 @@
#import <UserNotifications/UserNotifications.h>
#import <Foundation/Foundation.h>
#if !MACOS_NE
#import <UIKit/UIKit.h>
@interface IOSNotificationDelegate
@@ -87,3 +89,86 @@ void IOSNotificationHandler::notify(NotificationHandler::Message type, const QSt
}
}];
}
#else
// Removed the UIResponder and UIApplicationDelegate references as these are not available in macOS
@interface IOSNotificationDelegate
: NSObject <UNUserNotificationCenterDelegate> {
IOSNotificationHandler* m_iosNotificationHandler;
}
@end
@implementation IOSNotificationDelegate
- (id)initWithObject:(IOSNotificationHandler*)notification {
self = [super init]; // Removed `super init` as it refers to UIResponder, which is iOS specific
if (self) {
m_iosNotificationHandler = notification;
}
return self;
}
- (void)userNotificationCenter:(UNUserNotificationCenter*)center
willPresentNotification:(UNNotification*)notification
withCompletionHandler:
(void (^)(UNNotificationPresentationOptions options))completionHandler {
Q_UNUSED(center)
completionHandler(UNNotificationPresentationOptionList | UNNotificationPresentationOptionBanner);
}
- (void)userNotificationCenter:(UNUserNotificationCenter*)center
didReceiveNotificationResponse:(UNNotificationResponse*)response
withCompletionHandler:(void (^)())completionHandler {
Q_UNUSED(center)
Q_UNUSED(response)
completionHandler();
}
@end
IOSNotificationHandler::IOSNotificationHandler(QObject* parent) : NotificationHandler(parent) {
UNUserNotificationCenter* center = [UNUserNotificationCenter currentNotificationCenter];
[center requestAuthorizationWithOptions:(UNAuthorizationOptionSound | UNAuthorizationOptionAlert |
UNAuthorizationOptionBadge)
completionHandler:^(BOOL granted, NSError* _Nullable error) {
Q_UNUSED(granted);
if (!error) {
m_delegate = [[IOSNotificationDelegate alloc] initWithObject:this];
}
}];
}
IOSNotificationHandler::~IOSNotificationHandler() { }
void IOSNotificationHandler::notify(NotificationHandler::Message type, const QString& title,
const QString& message, int timerMsec) {
Q_UNUSED(type);
if (!m_delegate) {
return;
}
UNMutableNotificationContent* content = [[UNMutableNotificationContent alloc] init];
content.title = title.toNSString();
content.body = message.toNSString();
content.sound = [UNNotificationSound defaultSound];
int timerSec = timerMsec / 1000;
UNTimeIntervalNotificationTrigger* trigger =
[UNTimeIntervalNotificationTrigger triggerWithTimeInterval:timerSec repeats:NO];
UNNotificationRequest* request = [UNNotificationRequest requestWithIdentifier:@"amneziavpn"
content:content
trigger:trigger];
UNUserNotificationCenter* center = [UNUserNotificationCenter currentNotificationCenter];
center.delegate = (id<UNUserNotificationCenterDelegate>)m_delegate;
[center addNotificationRequest:request
withCompletionHandler:^(NSError* _Nullable error) {
if (error) {
NSLog(@"Local Notification failed");
}
}];
}
#endif

View File

@@ -22,6 +22,7 @@ class LinuxDaemon final : public Daemon {
protected:
WireguardUtils* wgutils() const override { return m_wgutils; }
bool supportDnsUtils() const override { return true; }
DnsUtils* dnsutils() override { return m_dnsutils; }
bool supportIPUtils() const override { return true; }
IPUtils* iputils() override { return m_iputils; }

View File

@@ -21,6 +21,7 @@ class MacOSDaemon final : public Daemon {
protected:
WireguardUtils* wgutils() const override { return m_wgutils; }
bool supportDnsUtils() const override { return true; }
DnsUtils* dnsutils() override { return m_dnsutils; }
bool supportIPUtils() const override { return true; }
IPUtils* iputils() override { return m_iputils; }

View File

@@ -26,6 +26,7 @@ class WindowsDaemon final : public Daemon {
protected:
bool run(Op op, const InterfaceConfig& config) override;
WireguardUtils* wgutils() const override { return m_wgutils; }
bool supportDnsUtils() const override { return true; }
DnsUtils* dnsutils() override { return m_dnsutils; }
private:

View File

@@ -502,7 +502,7 @@ QString WindowsSplitTunnel::convertPath(const QString& path) {
// device should contain : for e.g C:
return "";
}
QByteArray buffer(2048, 0xFFu);
QByteArray buffer(2048, 0xFF);
auto ok = QueryDosDeviceW(qUtf16Printable(driveLetter),
(wchar_t*)buffer.data(), buffer.size() / 2);

View File

@@ -248,7 +248,7 @@ bool WireguardUtilsWindows::updateRoutePrefix(const IPAddress& prefix) {
}
if (result != NO_ERROR) {
logger.error() << "Failed to create route to"
<< prefix.toString()
<< logger.sensitive(prefix.toString())
<< "result:" << result;
}
return result == NO_ERROR;
@@ -265,7 +265,7 @@ bool WireguardUtilsWindows::deleteRoutePrefix(const IPAddress& prefix) {
}
if (result != NO_ERROR) {
logger.error() << "Failed to delete route to"
<< prefix.toString()
<< logger.sensitive(prefix.toString())
<< "result:" << result;
}
return result == NO_ERROR;

View File

@@ -21,7 +21,7 @@
#include "platforms/windows/windowsutils.h"
constexpr const char* VPN_NAME = "AmneziaVPN";
constexpr const char* WIREGUARD_DIR = "AmneziaWG";
constexpr const char* WIREGUARD_DIR = "WireGuard";
constexpr const char* DATA_DIR = "Data";
namespace {

View File

@@ -4,7 +4,7 @@
#include "core/errorstrings.h"
#include "vpnprotocol.h"
#if defined(Q_OS_WINDOWS) || defined(Q_OS_MACX) || (defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID))
#if defined(Q_OS_WINDOWS) || defined(Q_OS_MACX) and !defined MACOS_NE || (defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID))
#include "openvpnovercloakprotocol.h"
#include "openvpnprotocol.h"
#include "shadowsocksvpnprotocol.h"
@@ -109,7 +109,7 @@ VpnProtocol *VpnProtocol::factory(DockerContainer container, const QJsonObject &
#if defined(Q_OS_WINDOWS)
case DockerContainer::Ipsec: return new Ikev2Protocol(configuration);
#endif
#if defined(Q_OS_WINDOWS) || defined(Q_OS_MACX) || (defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID))
#if defined(Q_OS_WINDOWS) || defined(Q_OS_MACX) and !defined MACOS_NE || (defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID))
case DockerContainer::OpenVpn: return new OpenVpnProtocol(configuration);
case DockerContainer::Cloak: return new OpenVpnOverCloakProtocol(configuration);
case DockerContainer::ShadowSocks: return new ShadowSocksVpnProtocol(configuration);

View File

@@ -1,3 +1,2 @@
echo $LC_MESSAGES | grep -qE "en_US.UTF-8|C.UTF-8" || export LC_MESSAGES=C.UTF-8;\
CUR_USER=$(whoami);\
groups $CUR_USER | grep sudo && sudo -nu $CUR_USER sudo -n uname > /dev/null
groups $CUR_USER

View File

@@ -258,18 +258,18 @@ Can&apos;t be disabled for current server</source>
<translation>غير قادر علي فتح الملف</translation>
</message>
<message>
<location filename="../ui/controllers/importController.cpp" line="187"/>
<location filename="../ui/controllers/importController.cpp" line="192"/>
<location filename="../ui/controllers/importController.cpp" line="191"/>
<location filename="../ui/controllers/importController.cpp" line="196"/>
<source>Invalid configuration file</source>
<translation>ملف تكوين غير صحيح</translation>
</message>
<message>
<location filename="../ui/controllers/importController.cpp" line="617"/>
<location filename="../ui/controllers/importController.cpp" line="622"/>
<source>Scanned %1 of %2.</source>
<translation>تم فحص%1 من %2.</translation>
</message>
<message>
<location filename="../ui/controllers/importController.cpp" line="652"/>
<location filename="../ui/controllers/importController.cpp" line="657"/>
<source>In the imported configuration, potentially dangerous lines were found:</source>
<translation>في التكوين المستورد، تم العثور على سطور يحتمل أن تكون خطرة:</translation>
</message>
@@ -401,28 +401,28 @@ Already installed containers were found on the server. All installed containers
<context>
<name>NotificationHandler</name>
<message>
<location filename="../ui/notificationhandler.cpp" line="63"/>
<location filename="../ui/notificationhandler.cpp" line="70"/>
<location filename="../ui/notificationhandler.cpp" line="66"/>
<location filename="../ui/notificationhandler.cpp" line="73"/>
<source>AmneziaVPN</source>
<translation>AmneziaVPN</translation>
</message>
<message>
<location filename="../ui/notificationhandler.cpp" line="64"/>
<location filename="../ui/notificationhandler.cpp" line="67"/>
<source>VPN Connected</source>
<translation>تم الاتصال</translation>
</message>
<message>
<location filename="../ui/notificationhandler.cpp" line="71"/>
<location filename="../ui/notificationhandler.cpp" line="74"/>
<source>VPN Disconnected</source>
<translation>تم إنهاء الاتصال</translation>
</message>
<message>
<location filename="../ui/notificationhandler.cpp" line="94"/>
<location filename="../ui/notificationhandler.cpp" line="97"/>
<source>AmneziaVPN notification</source>
<translation>إشعار من AmneziaVPN</translation>
</message>
<message>
<location filename="../ui/notificationhandler.cpp" line="95"/>
<location filename="../ui/notificationhandler.cpp" line="98"/>
<source>Unsecured network detected: </source>
<translation>تم العثور علي شبكة غير مؤمنة: </translation>
</message>
@@ -2426,12 +2426,12 @@ Already installed containers were found on the server. All installed containers
<translation>عنوان خادم IP [:منفذ]</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="116"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="113"/>
<source>Continue</source>
<translation>واصل</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="144"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="141"/>
<source>All data you enter will remain strictly confidential and will not be shared or disclosed to the Amnezia or any third parties</source>
<translation>ستظل جميع البيانات التي تدخلها سرية للغاية ولن تتم مشاركتها أو الكشف عنها ل Amnezia أو أي طرف ثالث</translation>
</message>
@@ -2441,42 +2441,42 @@ Already installed containers were found on the server. All installed containers
<translation></translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="78"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="75"/>
<source>SSH Username</source>
<translation></translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="94"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="91"/>
<source>Password or SSH private key</source>
<translation>كلمة مرور او مفتاح SSH خاص</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="153"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="150"/>
<source>How to run your VPN server</source>
<translation>كيف تقوم بتشغيل خادم ال VPN الخاص بك</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="154"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="151"/>
<source>Where to get connection data, step-by-step instructions for buying a VPS</source>
<translation>اين تحصل علي بيانات الاتصال, تعليمات خطوة ب خطوة لشراء VPS</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="170"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="167"/>
<source>Ip address cannot be empty</source>
<translation>لا يمكن لعنوان IP ان يكون فارغ</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="173"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="170"/>
<source>Enter the address in the format 255.255.255.255:88</source>
<translation>ادخل العنوان في شكل 255.255.255.255:88</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="177"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="174"/>
<source>Login cannot be empty</source>
<translation>تسجيل دخول لا يمكن ان يكون فارغ</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="181"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="178"/>
<source>Password/private key cannot be empty</source>
<translation>كلمة مرور/مفتاح خاص لأ يمكن ان يكونو فارغين</translation>
</message>
@@ -2791,42 +2791,47 @@ Already installed containers were found on the server. All installed containers
<translation>البيانات المٌرسلة: %1</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="862"/>
<location filename="../ui/qml/Pages2/PageShare.qml" line="849"/>
<source>Allowed IPs: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="870"/>
<source>Rename</source>
<translation>إعادة التسمية</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="908"/>
<location filename="../ui/qml/Pages2/PageShare.qml" line="916"/>
<source>Client name</source>
<translation>اسم العميل</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="921"/>
<location filename="../ui/qml/Pages2/PageShare.qml" line="929"/>
<source>Save</source>
<translation>احفظ</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="955"/>
<location filename="../ui/qml/Pages2/PageShare.qml" line="963"/>
<source>Revoke</source>
<translation>سحب وإبطال</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="959"/>
<location filename="../ui/qml/Pages2/PageShare.qml" line="967"/>
<source>Revoke the config for a user - %1?</source>
<translation>سحب وإبطال للمستخدم - %1?</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="960"/>
<location filename="../ui/qml/Pages2/PageShare.qml" line="968"/>
<source>The user will no longer be able to connect to your server.</source>
<translation>المستخدم لن يكون قادر علي الاتصال بعد الان.</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="961"/>
<location filename="../ui/qml/Pages2/PageShare.qml" line="969"/>
<source>Continue</source>
<translation>واصل</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="962"/>
<location filename="../ui/qml/Pages2/PageShare.qml" line="970"/>
<source>Cancel</source>
<translation>إلغاء</translation>
</message>
@@ -4100,12 +4105,12 @@ While it offers a blend of security, stability, and speed, it&apos;s essential t
<context>
<name>main2</name>
<message>
<location filename="../ui/qml/main2.qml" line="162"/>
<location filename="../ui/qml/main2.qml" line="163"/>
<source>Private key passphrase</source>
<translation>عبارة المرور الخاصة بالمفتاح</translation>
</message>
<message>
<location filename="../ui/qml/main2.qml" line="185"/>
<location filename="../ui/qml/main2.qml" line="186"/>
<source>Save</source>
<translation>احفظ</translation>
</message>

View File

@@ -263,18 +263,18 @@ Can&apos;t be disabled for current server</source>
<translation>نمیتوان فایل را باز کرد.</translation>
</message>
<message>
<location filename="../ui/controllers/importController.cpp" line="187"/>
<location filename="../ui/controllers/importController.cpp" line="192"/>
<location filename="../ui/controllers/importController.cpp" line="191"/>
<location filename="../ui/controllers/importController.cpp" line="196"/>
<source>Invalid configuration file</source>
<translation>فایل پیکربندی نامعتبر است.</translation>
</message>
<message>
<location filename="../ui/controllers/importController.cpp" line="617"/>
<location filename="../ui/controllers/importController.cpp" line="622"/>
<source>Scanned %1 of %2.</source>
<translation>ارزیابی %1 از %2.</translation>
</message>
<message>
<location filename="../ui/controllers/importController.cpp" line="652"/>
<location filename="../ui/controllers/importController.cpp" line="657"/>
<source>In the imported configuration, potentially dangerous lines were found:</source>
<translation>در پیکربندی وارد شده، خطوطی که ممکن است خطرناک باشند، یافت شدند:</translation>
</message>
@@ -405,28 +405,28 @@ Already installed containers were found on the server. All installed containers
<context>
<name>NotificationHandler</name>
<message>
<location filename="../ui/notificationhandler.cpp" line="63"/>
<location filename="../ui/notificationhandler.cpp" line="70"/>
<location filename="../ui/notificationhandler.cpp" line="66"/>
<location filename="../ui/notificationhandler.cpp" line="73"/>
<source>AmneziaVPN</source>
<translation>AmneziaVPN</translation>
</message>
<message>
<location filename="../ui/notificationhandler.cpp" line="64"/>
<location filename="../ui/notificationhandler.cpp" line="67"/>
<source>VPN Connected</source>
<translation>ویپیان وصل شد</translation>
</message>
<message>
<location filename="../ui/notificationhandler.cpp" line="71"/>
<location filename="../ui/notificationhandler.cpp" line="74"/>
<source>VPN Disconnected</source>
<translation>ویپیان قطع شد</translation>
</message>
<message>
<location filename="../ui/notificationhandler.cpp" line="94"/>
<location filename="../ui/notificationhandler.cpp" line="97"/>
<source>AmneziaVPN notification</source>
<translation>اخطار AmneziaVPN</translation>
</message>
<message>
<location filename="../ui/notificationhandler.cpp" line="95"/>
<location filename="../ui/notificationhandler.cpp" line="98"/>
<source>Unsecured network detected: </source>
<translation>شبکه ناامن شناسایی شد: </translation>
</message>
@@ -2544,12 +2544,12 @@ It&apos;s okay as long as it&apos;s from someone you trust.</source>
<translation>آدرس آیپی سرور (:پورت)</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="116"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="113"/>
<source>Continue</source>
<translation>ادامه</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="173"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="170"/>
<source>Enter the address in the format 255.255.255.255:88</source>
<translation>آدرس را با فرمت 255.255.255.255:88 وارد کنید</translation>
</message>
@@ -2564,42 +2564,42 @@ It&apos;s okay as long as it&apos;s from someone you trust.</source>
<translation></translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="78"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="75"/>
<source>SSH Username</source>
<translation></translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="94"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="91"/>
<source>Password or SSH private key</source>
<translation>رمز عبور یا کلید خصوصی SSH</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="144"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="141"/>
<source>All data you enter will remain strictly confidential and will not be shared or disclosed to the Amnezia or any third parties</source>
<translation>تمام دادههایی که شما وارد میکنید به شدت محرمانه است و با Amnezia یا هر شخص ثالث دیگری به اشتراک گذاشته نمیشود</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="153"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="150"/>
<source>How to run your VPN server</source>
<translation>چگونه سرور VPN خود را اجرا کنید</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="154"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="151"/>
<source>Where to get connection data, step-by-step instructions for buying a VPS</source>
<translation>دادههای اتصال را از کجا دریافت کنید و دستورالعملهای مرحله به مرحله برای خرید یک VPS</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="170"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="167"/>
<source>Ip address cannot be empty</source>
<translation>آدرس آیپی نمیتواند خالی باشد</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="177"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="174"/>
<source>Login cannot be empty</source>
<translation>نامکاربری نمیتواند خالی باشد</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="181"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="178"/>
<source>Password/private key cannot be empty</source>
<translation>پسورد یا کلید خصوصی نمیتواند خالی باشد</translation>
</message>
@@ -2958,47 +2958,52 @@ It&apos;s okay as long as it&apos;s from someone you trust.</source>
<source>Data sent: %1</source>
<translation>دادههای ارسال شده: %1</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="849"/>
<source>Allowed IPs: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Creation date: </source>
<translation type="vanished">تاریخ ایجاد: </translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="862"/>
<location filename="../ui/qml/Pages2/PageShare.qml" line="870"/>
<source>Rename</source>
<translation>تغییر نام</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="908"/>
<location filename="../ui/qml/Pages2/PageShare.qml" line="916"/>
<source>Client name</source>
<translation>نام کلاینت</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="921"/>
<location filename="../ui/qml/Pages2/PageShare.qml" line="929"/>
<source>Save</source>
<translation>ذخیره</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="955"/>
<location filename="../ui/qml/Pages2/PageShare.qml" line="963"/>
<source>Revoke</source>
<translation>ابطال</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="959"/>
<location filename="../ui/qml/Pages2/PageShare.qml" line="967"/>
<source>Revoke the config for a user - %1?</source>
<translation>لغو پیکربندی برای یک کاربر - %1?</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="960"/>
<location filename="../ui/qml/Pages2/PageShare.qml" line="968"/>
<source>The user will no longer be able to connect to your server.</source>
<translation>کاربر دیگر نمیتواند به سرور وصل شود.</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="961"/>
<location filename="../ui/qml/Pages2/PageShare.qml" line="969"/>
<source>Continue</source>
<translation>ادامه</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="962"/>
<location filename="../ui/qml/Pages2/PageShare.qml" line="970"/>
<source>Cancel</source>
<translation>کنسل</translation>
</message>
@@ -4316,12 +4321,12 @@ For more detailed information, you can
<context>
<name>main2</name>
<message>
<location filename="../ui/qml/main2.qml" line="162"/>
<location filename="../ui/qml/main2.qml" line="163"/>
<source>Private key passphrase</source>
<translation>عبارت کلید خصوصی</translation>
</message>
<message>
<location filename="../ui/qml/main2.qml" line="185"/>
<location filename="../ui/qml/main2.qml" line="186"/>
<source>Save</source>
<translation>ذخیره</translation>
</message>

View File

@@ -259,18 +259,18 @@ Can&apos;t be disabled for current server</source>
<translation> </translation>
</message>
<message>
<location filename="../ui/controllers/importController.cpp" line="187"/>
<location filename="../ui/controllers/importController.cpp" line="192"/>
<location filename="../ui/controllers/importController.cpp" line="191"/>
<location filename="../ui/controllers/importController.cpp" line="196"/>
<source>Invalid configuration file</source>
<translation> ि </translation>
</message>
<message>
<location filename="../ui/controllers/importController.cpp" line="617"/>
<location filename="../ui/controllers/importController.cpp" line="622"/>
<source>Scanned %1 of %2.</source>
<translation>%2 %1 ि .</translation>
</message>
<message>
<location filename="../ui/controllers/importController.cpp" line="652"/>
<location filename="../ui/controllers/importController.cpp" line="657"/>
<source>In the imported configuration, potentially dangerous lines were found:</source>
<translation type="unfinished"></translation>
</message>
@@ -401,28 +401,28 @@ Already installed containers were found on the server. All installed containers
<context>
<name>NotificationHandler</name>
<message>
<location filename="../ui/notificationhandler.cpp" line="63"/>
<location filename="../ui/notificationhandler.cpp" line="70"/>
<location filename="../ui/notificationhandler.cpp" line="66"/>
<location filename="../ui/notificationhandler.cpp" line="73"/>
<source>AmneziaVPN</source>
<translation>AmneziaVPN</translation>
</message>
<message>
<location filename="../ui/notificationhandler.cpp" line="64"/>
<location filename="../ui/notificationhandler.cpp" line="67"/>
<source>VPN Connected</source>
<translation></translation>
</message>
<message>
<location filename="../ui/notificationhandler.cpp" line="71"/>
<location filename="../ui/notificationhandler.cpp" line="74"/>
<source>VPN Disconnected</source>
<translation></translation>
</message>
<message>
<location filename="../ui/notificationhandler.cpp" line="94"/>
<location filename="../ui/notificationhandler.cpp" line="97"/>
<source>AmneziaVPN notification</source>
<translation>AmneziaVPN ि</translation>
</message>
<message>
<location filename="../ui/notificationhandler.cpp" line="95"/>
<location filename="../ui/notificationhandler.cpp" line="98"/>
<source>Unsecured network detected: </source>
<translation>ि : </translation>
</message>
@@ -2494,12 +2494,12 @@ Already installed containers were found on the server. All installed containers
<translation> [:]</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="116"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="113"/>
<source>Continue</source>
<translation> </translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="144"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="141"/>
<source>All data you enter will remain strictly confidential and will not be shared or disclosed to the Amnezia or any third parties</source>
<translation> ि ि ि ि </translation>
</message>
@@ -2509,42 +2509,42 @@ Already installed containers were found on the server. All installed containers
<translation>255.255.255.255:22</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="78"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="75"/>
<source>SSH Username</source>
<translation>SSH </translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="94"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="91"/>
<source>Password or SSH private key</source>
<translation> SSH ि </translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="153"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="150"/>
<source>How to run your VPN server</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="154"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="151"/>
<source>Where to get connection data, step-by-step instructions for buying a VPS</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="170"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="167"/>
<source>Ip address cannot be empty</source>
<translation> </translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="173"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="170"/>
<source>Enter the address in the format 255.255.255.255:88</source>
<translation> 255.255.255.255:88 </translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="177"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="174"/>
<source>Login cannot be empty</source>
<translation>ि </translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="181"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="178"/>
<source>Password/private key cannot be empty</source>
<translation>/ि </translation>
</message>
@@ -2876,47 +2876,52 @@ Already installed containers were found on the server. All installed containers
<source>Data sent: %1</source>
<translation> : %1</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="849"/>
<source>Allowed IPs: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Creation date: </source>
<translation type="vanished">ि िि: </translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="862"/>
<location filename="../ui/qml/Pages2/PageShare.qml" line="870"/>
<source>Rename</source>
<translation> </translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="908"/>
<location filename="../ui/qml/Pages2/PageShare.qml" line="916"/>
<source>Client name</source>
<translation> </translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="921"/>
<location filename="../ui/qml/Pages2/PageShare.qml" line="929"/>
<source>Save</source>
<translation></translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="955"/>
<location filename="../ui/qml/Pages2/PageShare.qml" line="963"/>
<source>Revoke</source>
<translation>ि </translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="959"/>
<location filename="../ui/qml/Pages2/PageShare.qml" line="967"/>
<source>Revoke the config for a user - %1?</source>
<translation>ि ि ि ि - %1?</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="960"/>
<location filename="../ui/qml/Pages2/PageShare.qml" line="968"/>
<source>The user will no longer be able to connect to your server.</source>
<translation> .</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="961"/>
<location filename="../ui/qml/Pages2/PageShare.qml" line="969"/>
<source>Continue</source>
<translation> </translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="962"/>
<location filename="../ui/qml/Pages2/PageShare.qml" line="970"/>
<source>Cancel</source>
<translation> </translation>
</message>
@@ -4208,12 +4213,12 @@ While it offers a blend of security, stability, and speed, it&apos;s essential t
<context>
<name>main2</name>
<message>
<location filename="../ui/qml/main2.qml" line="162"/>
<location filename="../ui/qml/main2.qml" line="163"/>
<source>Private key passphrase</source>
<translation>ि </translation>
</message>
<message>
<location filename="../ui/qml/main2.qml" line="185"/>
<location filename="../ui/qml/main2.qml" line="186"/>
<source>Save</source>
<translation></translation>
</message>

View File

@@ -259,18 +259,18 @@ Can&apos;t be disabled for current server</source>
<translation>က</translation>
</message>
<message>
<location filename="../ui/controllers/importController.cpp" line="187"/>
<location filename="../ui/controllers/importController.cpp" line="192"/>
<location filename="../ui/controllers/importController.cpp" line="191"/>
<location filename="../ui/controllers/importController.cpp" line="196"/>
<source>Invalid configuration file</source>
<translation>Configuration က</translation>
</message>
<message>
<location filename="../ui/controllers/importController.cpp" line="617"/>
<location filename="../ui/controllers/importController.cpp" line="622"/>
<source>Scanned %1 of %2.</source>
<translation>%2 %1 က က.</translation>
</message>
<message>
<location filename="../ui/controllers/importController.cpp" line="652"/>
<location filename="../ui/controllers/importController.cpp" line="657"/>
<source>In the imported configuration, potentially dangerous lines were found:</source>
<translation> configuration က :</translation>
</message>
@@ -401,28 +401,28 @@ Already installed containers were found on the server. All installed containers
<context>
<name>NotificationHandler</name>
<message>
<location filename="../ui/notificationhandler.cpp" line="63"/>
<location filename="../ui/notificationhandler.cpp" line="70"/>
<location filename="../ui/notificationhandler.cpp" line="66"/>
<location filename="../ui/notificationhandler.cpp" line="73"/>
<source>AmneziaVPN</source>
<translation>AmneziaVPN</translation>
</message>
<message>
<location filename="../ui/notificationhandler.cpp" line="64"/>
<location filename="../ui/notificationhandler.cpp" line="67"/>
<source>VPN Connected</source>
<translation>VPN က</translation>
</message>
<message>
<location filename="../ui/notificationhandler.cpp" line="71"/>
<location filename="../ui/notificationhandler.cpp" line="74"/>
<source>VPN Disconnected</source>
<translation>VPN က</translation>
</message>
<message>
<location filename="../ui/notificationhandler.cpp" line="94"/>
<location filename="../ui/notificationhandler.cpp" line="97"/>
<source>AmneziaVPN notification</source>
<translation>AmneziaVPN </translation>
</message>
<message>
<location filename="../ui/notificationhandler.cpp" line="95"/>
<location filename="../ui/notificationhandler.cpp" line="98"/>
<source>Unsecured network detected: </source>
<translation>ကက က: </translation>
</message>
@@ -2430,12 +2430,12 @@ Already installed containers were found on the server. All installed containers
<translation> IP [:port]</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="116"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="113"/>
<source>Continue</source>
<translation>ကက</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="173"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="170"/>
<source>Enter the address in the format 255.255.255.255:88</source>
<translation>က 255.255.255.255:88 </translation>
</message>
@@ -2450,42 +2450,42 @@ Already installed containers were found on the server. All installed containers
<translation>255.255.255.255:22</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="78"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="75"/>
<source>SSH Username</source>
<translation>SSH </translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="94"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="91"/>
<source>Password or SSH private key</source>
<translation>ကက SSH private key</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="144"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="141"/>
<source>All data you enter will remain strictly confidential and will not be shared or disclosed to the Amnezia or any third parties</source>
<translation>က ကက Amnezia က </translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="153"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="150"/>
<source>How to run your VPN server</source>
<translation>က </translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="154"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="151"/>
<source>Where to get connection data, step-by-step instructions for buying a VPS</source>
<translation>ကက VPS က ကက</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="170"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="167"/>
<source>Ip address cannot be empty</source>
<translation>IP </translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="177"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="174"/>
<source>Login cannot be empty</source>
<translation>ကက </translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="181"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="178"/>
<source>Password/private key cannot be empty</source>
<translation>ကက/private key </translation>
</message>
@@ -2825,42 +2825,47 @@ Already installed containers were found on the server. All installed containers
<translation>က: %1</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="862"/>
<location filename="../ui/qml/Pages2/PageShare.qml" line="849"/>
<source>Allowed IPs: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="870"/>
<source>Rename</source>
<translation></translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="908"/>
<location filename="../ui/qml/Pages2/PageShare.qml" line="916"/>
<source>Client name</source>
<translation>က</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="921"/>
<location filename="../ui/qml/Pages2/PageShare.qml" line="929"/>
<source>Save</source>
<translation></translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="955"/>
<location filename="../ui/qml/Pages2/PageShare.qml" line="963"/>
<source>Revoke</source>
<translation></translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="959"/>
<location filename="../ui/qml/Pages2/PageShare.qml" line="967"/>
<source>Revoke the config for a user - %1?</source>
<translation> %1 က config က ?</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="960"/>
<location filename="../ui/qml/Pages2/PageShare.qml" line="968"/>
<source>The user will no longer be able to connect to your server.</source>
<translation> က.</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="961"/>
<location filename="../ui/qml/Pages2/PageShare.qml" line="969"/>
<source>Continue</source>
<translation>ကက</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="962"/>
<location filename="../ui/qml/Pages2/PageShare.qml" line="970"/>
<source>Cancel</source>
<translation>က</translation>
</message>
@@ -4105,12 +4110,12 @@ For more detailed information, you can
<context>
<name>main2</name>
<message>
<location filename="../ui/qml/main2.qml" line="162"/>
<location filename="../ui/qml/main2.qml" line="163"/>
<source>Private key passphrase</source>
<translation>က key ကက</translation>
</message>
<message>
<location filename="../ui/qml/main2.qml" line="185"/>
<location filename="../ui/qml/main2.qml" line="186"/>
<source>Save</source>
<translation></translation>
</message>

View File

@@ -263,18 +263,18 @@ Can&apos;t be disabled for current server</source>
<translation>Невозможно открыть файл</translation>
</message>
<message>
<location filename="../ui/controllers/importController.cpp" line="187"/>
<location filename="../ui/controllers/importController.cpp" line="192"/>
<location filename="../ui/controllers/importController.cpp" line="191"/>
<location filename="../ui/controllers/importController.cpp" line="196"/>
<source>Invalid configuration file</source>
<translation>Неверный файл конфигурации</translation>
</message>
<message>
<location filename="../ui/controllers/importController.cpp" line="617"/>
<location filename="../ui/controllers/importController.cpp" line="622"/>
<source>Scanned %1 of %2.</source>
<translation>Отсканировано %1 из %2.</translation>
</message>
<message>
<location filename="../ui/controllers/importController.cpp" line="652"/>
<location filename="../ui/controllers/importController.cpp" line="657"/>
<source>In the imported configuration, potentially dangerous lines were found:</source>
<translation>В импортированной конфигурации были обнаружены потенциально опасные строки:</translation>
</message>
@@ -405,28 +405,28 @@ Already installed containers were found on the server. All installed containers
<context>
<name>NotificationHandler</name>
<message>
<location filename="../ui/notificationhandler.cpp" line="63"/>
<location filename="../ui/notificationhandler.cpp" line="70"/>
<location filename="../ui/notificationhandler.cpp" line="66"/>
<location filename="../ui/notificationhandler.cpp" line="73"/>
<source>AmneziaVPN</source>
<translation>AmneziaVPN</translation>
</message>
<message>
<location filename="../ui/notificationhandler.cpp" line="64"/>
<location filename="../ui/notificationhandler.cpp" line="67"/>
<source>VPN Connected</source>
<translation>VPN подключен</translation>
</message>
<message>
<location filename="../ui/notificationhandler.cpp" line="71"/>
<location filename="../ui/notificationhandler.cpp" line="74"/>
<source>VPN Disconnected</source>
<translation>VPN выключен</translation>
</message>
<message>
<location filename="../ui/notificationhandler.cpp" line="94"/>
<location filename="../ui/notificationhandler.cpp" line="97"/>
<source>AmneziaVPN notification</source>
<translation>Уведомление AmneziaVPN</translation>
</message>
<message>
<location filename="../ui/notificationhandler.cpp" line="95"/>
<location filename="../ui/notificationhandler.cpp" line="98"/>
<source>Unsecured network detected: </source>
<translation>Обнаружена незащищенная сеть: </translation>
</message>
@@ -2628,7 +2628,7 @@ It&apos;s okay as long as it&apos;s from someone you trust.</source>
<translation type="vanished">Password / SSH private key</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="116"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="113"/>
<source>Continue</source>
<translation>Продолжить</translation>
</message>
@@ -2638,7 +2638,7 @@ and will not be shared or disclosed to the Amnezia or any third parties</source>
<translation type="vanished">Все данные, которые вы вводите, останутся строго конфиденциальными и не будут переданы или раскрыты Amnezia или каким-либо третьим лицам</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="173"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="170"/>
<source>Enter the address in the format 255.255.255.255:88</source>
<translation>Введите адрес в формате 255.255.255.255:88</translation>
</message>
@@ -2657,42 +2657,42 @@ and will not be shared or disclosed to the Amnezia or any third parties</source>
<translation>255.255.255.255:22</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="78"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="75"/>
<source>SSH Username</source>
<translation>Имя пользователя SSH</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="94"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="91"/>
<source>Password or SSH private key</source>
<translation>Пароль или закрытый ключ SSH</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="144"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="141"/>
<source>All data you enter will remain strictly confidential and will not be shared or disclosed to the Amnezia or any third parties</source>
<translation>Все данные, которые вы вводите, останутся строго конфиденциальными и не будут переданы или раскрыты Amnezia или каким-либо третьим лицам</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="153"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="150"/>
<source>How to run your VPN server</source>
<translation>Как создать VPN на собственном сервере</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="154"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="151"/>
<source>Where to get connection data, step-by-step instructions for buying a VPS</source>
<translation>Где взять данные для подключения, пошаговые инстуркции по покупке VPS</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="170"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="167"/>
<source>Ip address cannot be empty</source>
<translation>Поле с IP-адресом не может быть пустым</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="177"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="174"/>
<source>Login cannot be empty</source>
<translation>Поле с логином не может быть пустым</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="181"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="178"/>
<source>Password/private key cannot be empty</source>
<translation>Поле с паролем/закрытым ключом не может быть пустым</translation>
</message>
@@ -3087,47 +3087,52 @@ and will not be shared or disclosed to the Amnezia or any third parties</source>
<source>Data sent: %1</source>
<translation>Отправлено данных: %1</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="849"/>
<source>Allowed IPs: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Creation date: </source>
<translation type="vanished">Дата создания: </translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="862"/>
<location filename="../ui/qml/Pages2/PageShare.qml" line="870"/>
<source>Rename</source>
<translation>Переименовать</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="908"/>
<location filename="../ui/qml/Pages2/PageShare.qml" line="916"/>
<source>Client name</source>
<translation>Имя клиента</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="921"/>
<location filename="../ui/qml/Pages2/PageShare.qml" line="929"/>
<source>Save</source>
<translation>Сохранить</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="955"/>
<location filename="../ui/qml/Pages2/PageShare.qml" line="963"/>
<source>Revoke</source>
<translation>Отозвать</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="959"/>
<location filename="../ui/qml/Pages2/PageShare.qml" line="967"/>
<source>Revoke the config for a user - %1?</source>
<translation>Отозвать конфигурацию для пользователя - %1?</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="960"/>
<location filename="../ui/qml/Pages2/PageShare.qml" line="968"/>
<source>The user will no longer be able to connect to your server.</source>
<translation>Пользователь больше не сможет подключаться к вашему серверу.</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="961"/>
<location filename="../ui/qml/Pages2/PageShare.qml" line="969"/>
<source>Continue</source>
<translation>Продолжить</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="962"/>
<location filename="../ui/qml/Pages2/PageShare.qml" line="970"/>
<source>Cancel</source>
<translation>Отменить</translation>
</message>
@@ -4547,12 +4552,12 @@ This means that AmneziaWG keeps the fast performance of the original while addin
<context>
<name>main2</name>
<message>
<location filename="../ui/qml/main2.qml" line="162"/>
<location filename="../ui/qml/main2.qml" line="163"/>
<source>Private key passphrase</source>
<translation>Парольная фраза для закрытого ключа</translation>
</message>
<message>
<location filename="../ui/qml/main2.qml" line="185"/>
<location filename="../ui/qml/main2.qml" line="186"/>
<source>Save</source>
<translation>Сохранить</translation>
</message>

View File

@@ -290,18 +290,18 @@ Can&apos;t be disabled for current server</source>
<translation>Неможливо відкрити файл</translation>
</message>
<message>
<location filename="../ui/controllers/importController.cpp" line="187"/>
<location filename="../ui/controllers/importController.cpp" line="192"/>
<location filename="../ui/controllers/importController.cpp" line="191"/>
<location filename="../ui/controllers/importController.cpp" line="196"/>
<source>Invalid configuration file</source>
<translation>Недійсний файл конфігурації</translation>
</message>
<message>
<location filename="../ui/controllers/importController.cpp" line="617"/>
<location filename="../ui/controllers/importController.cpp" line="622"/>
<source>Scanned %1 of %2.</source>
<translation>Відскановано %1 з %2.</translation>
</message>
<message>
<location filename="../ui/controllers/importController.cpp" line="652"/>
<location filename="../ui/controllers/importController.cpp" line="657"/>
<source>In the imported configuration, potentially dangerous lines were found:</source>
<translation>У імпортованій конфігурації знайдено потенційно небезпечні рядки:</translation>
</message>
@@ -431,28 +431,28 @@ Already installed containers were found on the server. All installed containers
<context>
<name>NotificationHandler</name>
<message>
<location filename="../ui/notificationhandler.cpp" line="63"/>
<location filename="../ui/notificationhandler.cpp" line="70"/>
<location filename="../ui/notificationhandler.cpp" line="66"/>
<location filename="../ui/notificationhandler.cpp" line="73"/>
<source>AmneziaVPN</source>
<translation>AmneziaVPN</translation>
</message>
<message>
<location filename="../ui/notificationhandler.cpp" line="64"/>
<location filename="../ui/notificationhandler.cpp" line="67"/>
<source>VPN Connected</source>
<translation>VPN Підключено</translation>
</message>
<message>
<location filename="../ui/notificationhandler.cpp" line="71"/>
<location filename="../ui/notificationhandler.cpp" line="74"/>
<source>VPN Disconnected</source>
<translation>VPN Вимкнено</translation>
</message>
<message>
<location filename="../ui/notificationhandler.cpp" line="94"/>
<location filename="../ui/notificationhandler.cpp" line="97"/>
<source>AmneziaVPN notification</source>
<translation>Сповіщення AmneziaVPN</translation>
</message>
<message>
<location filename="../ui/notificationhandler.cpp" line="95"/>
<location filename="../ui/notificationhandler.cpp" line="98"/>
<source>Unsecured network detected: </source>
<translation>Знайдена не захищена мережа: </translation>
</message>
@@ -2714,7 +2714,7 @@ It&apos;s okay as long as it&apos;s from someone you trust.</source>
<translation type="vanished">Password / SSH private key</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="116"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="113"/>
<source>Continue</source>
<translation>Продовжити</translation>
</message>
@@ -2725,7 +2725,7 @@ and will not be shared or disclosed to the Amnezia or any third parties</source>
і не будуть передані чи розголошені Amnezia або будь-яким третім особам</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="173"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="170"/>
<source>Enter the address in the format 255.255.255.255:88</source>
<translation>Введіть адресу в форматі 255.255.255.255:88</translation>
</message>
@@ -2744,42 +2744,42 @@ and will not be shared or disclosed to the Amnezia or any third parties</source>
<translation>255.255.255.255:22</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="78"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="75"/>
<source>SSH Username</source>
<translation>SSH Username</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="94"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="91"/>
<source>Password or SSH private key</source>
<translation>Пароль або SSH ключ</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="144"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="141"/>
<source>All data you enter will remain strictly confidential and will not be shared or disclosed to the Amnezia or any third parties</source>
<translation>Усі дані, які ви вводите, залишатимуться суворо конфіденційними та не будуть передані чи розголошені Amnezia або будь-яким третім особам</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="153"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="150"/>
<source>How to run your VPN server</source>
<translation>Як запустити ваш VPN-сервер</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="154"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="151"/>
<source>Where to get connection data, step-by-step instructions for buying a VPS</source>
<translation>Де отримати дані для підключення: покрокові інструкції з придбання VPS</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="170"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="167"/>
<source>Ip address cannot be empty</source>
<translation>Поле IP address не може бути пустим</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="177"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="174"/>
<source>Login cannot be empty</source>
<translation>Поле Login не може бути пустим</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="181"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="178"/>
<source>Password/private key cannot be empty</source>
<translation>Поле Password/Private key не може бути пустим</translation>
</message>
@@ -3182,47 +3182,52 @@ and will not be shared or disclosed to the Amnezia or any third parties</source>
<source>Data sent: %1</source>
<translation>Відправлено даних: %1</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="849"/>
<source>Allowed IPs: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Creation date: </source>
<translation type="obsolete">Дата створення:</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="862"/>
<location filename="../ui/qml/Pages2/PageShare.qml" line="870"/>
<source>Rename</source>
<translation>Перейменувати</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="908"/>
<location filename="../ui/qml/Pages2/PageShare.qml" line="916"/>
<source>Client name</source>
<translation>Назва клієнта</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="921"/>
<location filename="../ui/qml/Pages2/PageShare.qml" line="929"/>
<source>Save</source>
<translation>Зберегти</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="955"/>
<location filename="../ui/qml/Pages2/PageShare.qml" line="963"/>
<source>Revoke</source>
<translation>Відкликати</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="959"/>
<location filename="../ui/qml/Pages2/PageShare.qml" line="967"/>
<source>Revoke the config for a user - %1?</source>
<translation>Відкликати доступ для користувача - %1?</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="960"/>
<location filename="../ui/qml/Pages2/PageShare.qml" line="968"/>
<source>The user will no longer be able to connect to your server.</source>
<translation>Користувач більше не зможе підключатись до вашого сервера </translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="961"/>
<location filename="../ui/qml/Pages2/PageShare.qml" line="969"/>
<source>Continue</source>
<translation>Продовжити</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="962"/>
<location filename="../ui/qml/Pages2/PageShare.qml" line="970"/>
<source>Cancel</source>
<translation>Відмінити</translation>
</message>
@@ -4624,12 +4629,12 @@ This means that AmneziaWG keeps the fast performance of the original while addin
<context>
<name>main2</name>
<message>
<location filename="../ui/qml/main2.qml" line="162"/>
<location filename="../ui/qml/main2.qml" line="163"/>
<source>Private key passphrase</source>
<translation>Пароль для особистого ключа</translation>
</message>
<message>
<location filename="../ui/qml/main2.qml" line="185"/>
<location filename="../ui/qml/main2.qml" line="186"/>
<source>Save</source>
<translation>Зберегти</translation>
</message>

View File

@@ -257,18 +257,18 @@ Can&apos;t be disabled for current server</source>
<translation>فائل کو کھولنے سے قاصر ہے</translation>
</message>
<message>
<location filename="../ui/controllers/importController.cpp" line="187"/>
<location filename="../ui/controllers/importController.cpp" line="192"/>
<location filename="../ui/controllers/importController.cpp" line="191"/>
<location filename="../ui/controllers/importController.cpp" line="196"/>
<source>Invalid configuration file</source>
<translation>غلط کنفیگریشن فائل</translation>
</message>
<message>
<location filename="../ui/controllers/importController.cpp" line="617"/>
<location filename="../ui/controllers/importController.cpp" line="622"/>
<source>Scanned %1 of %2.</source>
<translation>سکین%1 کی%2.</translation>
</message>
<message>
<location filename="../ui/controllers/importController.cpp" line="652"/>
<location filename="../ui/controllers/importController.cpp" line="657"/>
<source>In the imported configuration, potentially dangerous lines were found:</source>
<translation type="unfinished"></translation>
</message>
@@ -399,30 +399,30 @@ Already installed containers were found on the server. All installed containers
<context>
<name>NotificationHandler</name>
<message>
<location filename="../ui/notificationhandler.cpp" line="63"/>
<location filename="../ui/notificationhandler.cpp" line="70"/>
<location filename="../ui/notificationhandler.cpp" line="66"/>
<location filename="../ui/notificationhandler.cpp" line="73"/>
<source>AmneziaVPN</source>
<translation>The translation of &quot;AmneziaVPN&quot; in Urdu would be:
امنیزیا وی پی ای</translation>
</message>
<message>
<location filename="../ui/notificationhandler.cpp" line="64"/>
<location filename="../ui/notificationhandler.cpp" line="67"/>
<source>VPN Connected</source>
<translation>وی پی این متصل ہوگیا</translation>
</message>
<message>
<location filename="../ui/notificationhandler.cpp" line="71"/>
<location filename="../ui/notificationhandler.cpp" line="74"/>
<source>VPN Disconnected</source>
<translation>وی پی این منقطع ہوگیا</translation>
</message>
<message>
<location filename="../ui/notificationhandler.cpp" line="94"/>
<location filename="../ui/notificationhandler.cpp" line="97"/>
<source>AmneziaVPN notification</source>
<translation>امنیزیا وی پی این کی اطلاعات</translation>
</message>
<message>
<location filename="../ui/notificationhandler.cpp" line="95"/>
<location filename="../ui/notificationhandler.cpp" line="98"/>
<source>Unsecured network detected: </source>
<translation>غیر محفوظ نیٹ ورک کا پتہ لگایا گیا ہے: </translation>
</message>
@@ -2498,12 +2498,12 @@ Already installed containers were found on the server. All installed containers
<translation>سرور آئی پی پتہ [:پورٹ]</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="116"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="113"/>
<source>Continue</source>
<translation>براہ کرم جاری رکھیں</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="144"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="141"/>
<source>All data you enter will remain strictly confidential and will not be shared or disclosed to the Amnezia or any third parties</source>
<translation>آپ جو ڈیٹا داخل کریں گے وہ بالکل خفیہ رہے گا اور نہ تو امنیزیا یا کسی تیسری شخصیت کے ساتھ اشتراک کیا جائے گا</translation>
</message>
@@ -2513,42 +2513,42 @@ Already installed containers were found on the server. All installed containers
<translation></translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="78"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="75"/>
<source>SSH Username</source>
<translation>ایس ایس ایچ صارف نام</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="94"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="91"/>
<source>Password or SSH private key</source>
<translation>پاس ورڈ یا SSH نجی کلید</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="153"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="150"/>
<source>How to run your VPN server</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="154"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="151"/>
<source>Where to get connection data, step-by-step instructions for buying a VPS</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="170"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="167"/>
<source>Ip address cannot be empty</source>
<translation>آئی پی پتہ خالی نہیں ہو سکتا</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="173"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="170"/>
<source>Enter the address in the format 255.255.255.255:88</source>
<translation>ایڈریس درج کریں فارمیٹ 255.255.255.255:88</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="177"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="174"/>
<source>Login cannot be empty</source>
<translation>لاگ ان نام خالی نہیں ہو سکتا</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="181"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="178"/>
<source>Password/private key cannot be empty</source>
<translation>پاس ورڈ یا نجی کلید خالی نہیں ہو سکتی</translation>
</message>
@@ -2880,47 +2880,52 @@ Already installed containers were found on the server. All installed containers
<source>Data sent: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="849"/>
<source>Allowed IPs: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Creation date: </source>
<translation type="vanished">تخلیق کی تاریخ: </translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="862"/>
<location filename="../ui/qml/Pages2/PageShare.qml" line="870"/>
<source>Rename</source>
<translation>نام تبدیل</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="908"/>
<location filename="../ui/qml/Pages2/PageShare.qml" line="916"/>
<source>Client name</source>
<translation>کلائنٹ کا نام</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="921"/>
<location filename="../ui/qml/Pages2/PageShare.qml" line="929"/>
<source>Save</source>
<translation>محفوظ</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="955"/>
<location filename="../ui/qml/Pages2/PageShare.qml" line="963"/>
<source>Revoke</source>
<translation>واپس لین</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="959"/>
<location filename="../ui/qml/Pages2/PageShare.qml" line="967"/>
<source>Revoke the config for a user - %1?</source>
<translation>کیا آپ مستعمل کے لئے کنفیگ کو واپس لینا چاہتے ہیں - %1؟</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="960"/>
<location filename="../ui/qml/Pages2/PageShare.qml" line="968"/>
<source>The user will no longer be able to connect to your server.</source>
<translation>صارف آپ کے سرور سے متصل ہونے کا اختیار نہیں رہے گا.</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="961"/>
<location filename="../ui/qml/Pages2/PageShare.qml" line="969"/>
<source>Continue</source>
<translation>جاری رکھیں</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="962"/>
<location filename="../ui/qml/Pages2/PageShare.qml" line="970"/>
<source>Cancel</source>
<translation>منسوخ</translation>
</message>
@@ -4154,12 +4159,12 @@ While it offers a blend of security, stability, and speed, it&apos;s essential t
<context>
<name>main2</name>
<message>
<location filename="../ui/qml/main2.qml" line="162"/>
<location filename="../ui/qml/main2.qml" line="163"/>
<source>Private key passphrase</source>
<translation>نجی کلید پاس فریز</translation>
</message>
<message>
<location filename="../ui/qml/main2.qml" line="185"/>
<location filename="../ui/qml/main2.qml" line="186"/>
<source>Save</source>
<translation>محفوظ کریں</translation>
</message>

View File

@@ -262,18 +262,18 @@ Can&apos;t be disabled for current server</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/controllers/importController.cpp" line="187"/>
<location filename="../ui/controllers/importController.cpp" line="192"/>
<location filename="../ui/controllers/importController.cpp" line="191"/>
<location filename="../ui/controllers/importController.cpp" line="196"/>
<source>Invalid configuration file</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/controllers/importController.cpp" line="617"/>
<location filename="../ui/controllers/importController.cpp" line="622"/>
<source>Scanned %1 of %2.</source>
<translation> %1 of %2.</translation>
</message>
<message>
<location filename="../ui/controllers/importController.cpp" line="652"/>
<location filename="../ui/controllers/importController.cpp" line="657"/>
<source>In the imported configuration, potentially dangerous lines were found:</source>
<translation type="unfinished"></translation>
</message>
@@ -427,28 +427,28 @@ Already installed containers were found on the server. All installed containers
<context>
<name>NotificationHandler</name>
<message>
<location filename="../ui/notificationhandler.cpp" line="63"/>
<location filename="../ui/notificationhandler.cpp" line="70"/>
<location filename="../ui/notificationhandler.cpp" line="66"/>
<location filename="../ui/notificationhandler.cpp" line="73"/>
<source>AmneziaVPN</source>
<translation></translation>
</message>
<message>
<location filename="../ui/notificationhandler.cpp" line="64"/>
<location filename="../ui/notificationhandler.cpp" line="67"/>
<source>VPN Connected</source>
<translation>VPN</translation>
</message>
<message>
<location filename="../ui/notificationhandler.cpp" line="71"/>
<location filename="../ui/notificationhandler.cpp" line="74"/>
<source>VPN Disconnected</source>
<translation>VPN断开</translation>
</message>
<message>
<location filename="../ui/notificationhandler.cpp" line="94"/>
<location filename="../ui/notificationhandler.cpp" line="97"/>
<source>AmneziaVPN notification</source>
<translation>AmneziaVPN </translation>
</message>
<message>
<location filename="../ui/notificationhandler.cpp" line="95"/>
<location filename="../ui/notificationhandler.cpp" line="98"/>
<source>Unsecured network detected: </source>
<translation></translation>
</message>
@@ -2673,12 +2673,12 @@ It&apos;s okay as long as it&apos;s from someone you trust.</source>
<translation type="vanished"> </translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="116"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="113"/>
<source>Continue</source>
<translation></translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="144"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="141"/>
<source>All data you enter will remain strictly confidential and will not be shared or disclosed to the Amnezia or any third parties</source>
<translation> Amnezia </translation>
</message>
@@ -2694,42 +2694,42 @@ and will not be shared or disclosed to the Amnezia or any third parties</source>
<translation></translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="78"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="75"/>
<source>SSH Username</source>
<translation>SSH </translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="94"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="91"/>
<source>Password or SSH private key</source>
<translation> SSH </translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="153"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="150"/>
<source>How to run your VPN server</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="154"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="151"/>
<source>Where to get connection data, step-by-step instructions for buying a VPS</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="170"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="167"/>
<source>Ip address cannot be empty</source>
<translation>IP不能为空</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="173"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="170"/>
<source>Enter the address in the format 255.255.255.255:88</source>
<translation> 255.255.255.255:88</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="177"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="174"/>
<source>Login cannot be empty</source>
<translation></translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="181"/>
<location filename="../ui/qml/Pages2/PageSetupWizardCredentials.qml" line="178"/>
<source>Password/private key cannot be empty</source>
<translation></translation>
</message>
@@ -3086,47 +3086,52 @@ and will not be shared or disclosed to the Amnezia or any third parties</source>
<source>Data sent: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="849"/>
<source>Allowed IPs: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Creation date: </source>
<translation type="vanished">: </translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="862"/>
<location filename="../ui/qml/Pages2/PageShare.qml" line="870"/>
<source>Rename</source>
<translation></translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="908"/>
<location filename="../ui/qml/Pages2/PageShare.qml" line="916"/>
<source>Client name</source>
<translation></translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="921"/>
<location filename="../ui/qml/Pages2/PageShare.qml" line="929"/>
<source>Save</source>
<translation></translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="955"/>
<location filename="../ui/qml/Pages2/PageShare.qml" line="963"/>
<source>Revoke</source>
<translation></translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="959"/>
<location filename="../ui/qml/Pages2/PageShare.qml" line="967"/>
<source>Revoke the config for a user - %1?</source>
<translation>- %1?</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="960"/>
<location filename="../ui/qml/Pages2/PageShare.qml" line="968"/>
<source>The user will no longer be able to connect to your server.</source>
<translation>.</translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="961"/>
<location filename="../ui/qml/Pages2/PageShare.qml" line="969"/>
<source>Continue</source>
<translation></translation>
</message>
<message>
<location filename="../ui/qml/Pages2/PageShare.qml" line="962"/>
<location filename="../ui/qml/Pages2/PageShare.qml" line="970"/>
<source>Cancel</source>
<translation></translation>
</message>
@@ -4610,12 +4615,12 @@ While it offers a blend of security, stability, and speed, it&apos;s essential t
<context>
<name>main2</name>
<message>
<location filename="../ui/qml/main2.qml" line="162"/>
<location filename="../ui/qml/main2.qml" line="163"/>
<source>Private key passphrase</source>
<translation></translation>
</message>
<message>
<location filename="../ui/qml/main2.qml" line="185"/>
<location filename="../ui/qml/main2.qml" line="186"/>
<source>Save</source>
<translation></translation>
</message>

View File

@@ -34,13 +34,13 @@ ConnectionController::ConnectionController(const QSharedPointer<ServersModel> &s
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);
@@ -51,9 +51,6 @@ void ConnectionController::openConnection()
if (configVersion == ApiConfigSources::Telegram
&& !m_serversModel->data(serverIndex, ServersModel::Roles::HasInstalledContainers).toBool()) {
emit updateApiConfigFromTelegram();
} else if (configVersion == ApiConfigSources::AmneziaGateway
&& !m_serversModel->data(serverIndex, ServersModel::Roles::HasInstalledContainers).toBool()) {
emit updateApiConfigFromGateway();
} else if (configVersion && m_serversModel->isApiKeyExpired(serverIndex)) {
qDebug() << "attempt to update api config by end_date event";
if (configVersion == ApiConfigSources::Telegram) {

View File

@@ -39,12 +39,11 @@ namespace
const QString amneziaConfigPatternUserName = "userName";
const QString amneziaConfigPatternPassword = "password";
const QString amneziaFreeConfigPattern = "api_key";
const QString amneziaPremiumConfigPattern = "auth_data";
const QString backupPattern = "Servers/serversList";
if (config.contains(backupPattern)) {
return ConfigTypes::Backup;
} else if (config.contains(amneziaConfigPattern) || config.contains(amneziaFreeConfigPattern) || config.contains(amneziaPremiumConfigPattern)
} else if (config.contains(amneziaConfigPattern) || config.contains(amneziaFreeConfigPattern)
|| (config.contains(amneziaConfigPatternHostName) && config.contains(amneziaConfigPatternUserName)
&& config.contains(amneziaConfigPatternPassword))) {
return ConfigTypes::Amnezia;
@@ -85,7 +84,7 @@ bool ImportController::extractConfigFromFile(const QString &fileName)
return extractConfigFromData(data);
}
emit importErrorOccurred(ErrorCode::ImportOpenConfigError, false);
emit importErrorOccurred(tr("Unable to open file"), false);
return false;
}
@@ -189,12 +188,12 @@ bool ImportController::extractConfigFromData(QString data)
if (!m_serversModel->getServersCount()) {
emit restoreAppConfig(config.toUtf8());
} else {
emit importErrorOccurred(ErrorCode::ImportInvalidConfigError, false);
emit importErrorOccurred(tr("Invalid configuration file"), false);
}
break;
}
case ConfigTypes::Invalid: {
emit importErrorOccurred(ErrorCode::ImportInvalidConfigError, false);
emit importErrorOccurred(tr("Invalid configuration file"), false);
break;
}
}

View File

@@ -54,6 +54,7 @@ public slots:
signals:
void importFinished();
void importErrorOccurred(const QString &errorMessage, bool goToPageHome);
void importErrorOccurred(ErrorCode errorCode, bool goToPageHome);
void qrDecodingFinished();

48
client/ui/controllers/installController.cpp Executable file → Normal file
View File

@@ -32,8 +32,32 @@ namespace
constexpr char availableCountries[] = "available_countries";
constexpr char apiConfig[] = "api_config";
constexpr char authData[] = "auth_data";
}
#ifdef Q_OS_WINDOWS
QString getNextDriverLetter()
{
QProcess drivesProc;
drivesProc.start("wmic logicaldisk get caption");
drivesProc.waitForFinished();
QString drives = drivesProc.readAll();
qDebug() << drives;
QString letters = "CFGHIJKLMNOPQRSTUVWXYZ";
QString letter;
for (int i = letters.size() - 1; i > 0; i--) {
letter = letters.at(i);
if (!drives.contains(letter + ":"))
break;
}
if (letter == "C:") {
// set err info
qDebug() << "Can't find free drive letter";
return "";
}
return letter;
}
#endif
}
InstallController::InstallController(const QSharedPointer<ServersModel> &serversModel, const QSharedPointer<ContainersModel> &containersModel,
@@ -111,10 +135,10 @@ void InstallController::install(DockerContainer container, int port, TransportPr
containerConfig[config_key::transportPacketMagicHeader] = transportPacketMagicHeader;
} else if (container == DockerContainer::Sftp) {
containerConfig.insert(config_key::userName, protocols::sftp::defaultUserName);
containerConfig.insert(config_key::password, Utils::getRandomString(16));
containerConfig.insert(config_key::password, Utils::getRandomString(10));
} else if (container == DockerContainer::Socks5Proxy) {
containerConfig.insert(config_key::userName, protocols::socks5Proxy::defaultUserName);
containerConfig.insert(config_key::password, Utils::getRandomString(16));
containerConfig.insert(config_key::password, Utils::getRandomString(10));
}
config.insert(config_key::container, ContainerProps::containerToString(container));
@@ -643,7 +667,7 @@ void InstallController::mountSftpDrive(const QString &port, const QString &passw
QString hostname = serverCredentials.hostName;
#ifdef Q_OS_WINDOWS
mountPath = Utils::getNextDriverLetter() + ":";
mountPath = getNextDriverLetter() + ":";
// QString cmd = QString("net use \\\\sshfs\\%1@x.x.x.x!%2 /USER:%1 %3")
// .arg(labelTftpUserNameText())
// .arg(labelTftpPortText())
@@ -744,7 +768,7 @@ bool InstallController::checkSshConnection(QSharedPointer<ServerController> serv
} else {
if (output.contains(tr("Please login as the user"))) {
output.replace("\n", "");
emit wrongInstallationUser(output);
emit installationErrorOccurred(output);
return false;
}
}
@@ -802,7 +826,7 @@ bool InstallController::installServiceFromApi()
ErrorCode errorCode = apiController.getConfigForService(m_settings->getInstallationUuid(true), m_apiServicesModel->getCountryCode(),
m_apiServicesModel->getSelectedServiceType(),
m_apiServicesModel->getSelectedServiceProtocol(), "", QJsonObject(), serverConfig);
m_apiServicesModel->getSelectedServiceProtocol(), "", serverConfig);
if (errorCode != ErrorCode::NoError) {
emit installationErrorOccurred(errorCode);
return false;
@@ -829,26 +853,24 @@ bool InstallController::updateServiceFromApi(const int serverIndex, const QStrin
auto serverConfig = m_serversModel->getServerConfig(serverIndex);
auto apiConfig = serverConfig.value(configKey::apiConfig).toObject();
auto authData = serverConfig.value(configKey::authData).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,
authData, 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);
newServerConfig.insert(configKey::authData, authData);
newServerConfig.insert(config_key::crc, serverConfig.value(config_key::crc));
m_serversModel->editServer(newServerConfig, serverIndex);
if (reloadServiceConfig) {

View File

@@ -75,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);

Some files were not shown because too many files have changed in this diff Show More