Compare commits

..

7 Commits

Author SHA1 Message Date
pokamest f844351afd wip 2024-08-28 18:46:01 -07:00
Garegin866 7b1df79da5 Fixed ui bug on qt6.7 2024-08-27 10:24:31 -07:00
pokamest ddfb60a047 build fix 2024-08-23 15:14:46 -07:00
pokamest c96b268a09 WIP 2024-07-15 17:29:07 -07:00
pokamest 82f5903574 Request permissions for NE 2024-07-11 05:56:35 -07:00
pokamest a2ec75219e build fix 2024-07-09 15:49:49 -07:00
Mykola Baibuz 6f58f19958 MacOS NE dirty build 2024-07-08 08:16:18 -07:00
128 changed files with 8081 additions and 4588 deletions
+24
View File
@@ -0,0 +1,24 @@
<?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.app-sandbox</key>
<true/>
<key>com.apple.security.application-groups</key>
<array>
<string>group.org.amnezia.AmneziaVPN</string>
</array>
<key>com.apple.security.network.client</key>
<true/>
<key>com.apple.security.network.server</key>
<true/>
<key>keychain-access-groups</key>
<array>
<string>$(AppIdentifierPrefix)org.amnezia.AmneziaVPN.network-extension</string>
</array>
</dict>
</plist>
+4 -9
View File
@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.25.0 FATAL_ERROR)
set(PROJECT AmneziaVPN) set(PROJECT AmneziaVPN)
project(${PROJECT} VERSION 4.6.0.3 project(${PROJECT} VERSION 4.6.0.1
DESCRIPTION "AmneziaVPN" DESCRIPTION "AmneziaVPN"
HOMEPAGE_URL "https://amnezia.org/" HOMEPAGE_URL "https://amnezia.org/"
) )
@@ -11,7 +11,7 @@ string(TIMESTAMP CURRENT_DATE "%Y-%m-%d")
set(RELEASE_DATE "${CURRENT_DATE}") set(RELEASE_DATE "${CURRENT_DATE}")
set(APP_MAJOR_VERSION ${CMAKE_PROJECT_VERSION_MAJOR}.${CMAKE_PROJECT_VERSION_MINOR}.${CMAKE_PROJECT_VERSION_PATCH}) set(APP_MAJOR_VERSION ${CMAKE_PROJECT_VERSION_MAJOR}.${CMAKE_PROJECT_VERSION_MINOR}.${CMAKE_PROJECT_VERSION_PATCH})
set(APP_ANDROID_VERSION_CODE 55) set(APP_ANDROID_VERSION_CODE 54)
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
set(MZ_PLATFORM_NAME "linux") set(MZ_PLATFORM_NAME "linux")
@@ -31,14 +31,9 @@ set(QT_BUILD_TOOLS_WHEN_CROSS_COMPILING ON)
set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD_REQUIRED ON)
if(APPLE AND NOT IOS)
set(CMAKE_OSX_ARCHITECTURES "x86_64") set(CMAKE_OSX_ARCHITECTURES "x86_64")
endif()
add_subdirectory(client) add_subdirectory(client)
if(NOT IOS AND NOT ANDROID)
add_subdirectory(service)
include(${CMAKE_SOURCE_DIR}/deploy/installer/config.cmake)
endif()
+4 -6
View File
@@ -19,8 +19,6 @@ Amnezia is an open-source VPN client, with a key feature that enables you to dep
[https://amnezia.org](https://amnezia.org) - project website [https://amnezia.org](https://amnezia.org) - project website
[https://www.reddit.com/r/AmneziaVPN](https://www.reddit.com/r/AmneziaVPN) - Reddit [https://www.reddit.com/r/AmneziaVPN](https://www.reddit.com/r/AmneziaVPN) - Reddit
[https://t.me/amnezia_vpn_en](https://t.me/amnezia_vpn_en) - Telegram support channel (English) [https://t.me/amnezia_vpn_en](https://t.me/amnezia_vpn_en) - Telegram support channel (English)
[https://t.me/amnezia_vpn_ir](https://t.me/amnezia_vpn_ir) - Telegram support channel (Farsi)
[https://t.me/amnezia_vpn_mm](https://t.me/amnezia_vpn_mm) - Telegram support channel (Myanmar)
[https://t.me/amnezia_vpn](https://t.me/amnezia_vpn) - Telegram support channel (Russian) [https://t.me/amnezia_vpn](https://t.me/amnezia_vpn) - Telegram support channel (Russian)
## Tech ## Tech
@@ -54,7 +52,7 @@ Check deploy folder for build scripts.
1. First, make sure you have [XCode](https://developer.apple.com/xcode/) installed, at least version 14 or higher. 1. First, make sure you have [XCode](https://developer.apple.com/xcode/) installed, at least version 14 or higher.
2. We use QT to generate the XCode project. We need QT version 6.6.2. Install QT for MacOS [here](https://doc.qt.io/qt-6/macos.html) or [QT Online Installer](https://www.qt.io/download-open-source). Required modules: 2. We use QT to generate the XCode project. We need QT version 6.6.1. Install QT for MacOS [here](https://doc.qt.io/qt-6/macos.html) or [QT Online Installer](https://www.qt.io/download-open-source). Required modules:
- MacOS - MacOS
- iOS - iOS
- Qt 5 Compatibility Module - Qt 5 Compatibility Module
@@ -144,10 +142,10 @@ GPL v3.0
## Donate ## Donate
Patreon: [https://www.patreon.com/amneziavpn](https://www.patreon.com/amneziavpn) Bitcoin: bc1qn9rhsffuxwnhcuuu4qzrwp4upkrq94xnh8r26u
USDT BEP20: 0x6abD576765a826f87D1D95183438f9408C901bE4
USDT TRC20: TELAitazF1MZGmiNjTcnxDjEiH5oe7LC9d
XMR: 48spms39jt1L2L5vyw2RQW6CXD6odUd4jFu19GZcDyKKQV9U88wsJVjSbL4CfRys37jVMdoaWVPSvezCQPhHXUW5UKLqUp3 XMR: 48spms39jt1L2L5vyw2RQW6CXD6odUd4jFu19GZcDyKKQV9U88wsJVjSbL4CfRys37jVMdoaWVPSvezCQPhHXUW5UKLqUp3
payeer.com: P2561305
ko-fi.com: [https://ko-fi.com/amnezia_vpn](https://ko-fi.com/amnezia_vpn)
## Acknowledgments ## Acknowledgments
+3 -1
View File
@@ -3,6 +3,7 @@ cmake_minimum_required(VERSION 3.25.0 FATAL_ERROR)
set(PROJECT AmneziaVPN) set(PROJECT AmneziaVPN)
project(${PROJECT}) project(${PROJECT})
set(IOS 1)
set_property(GLOBAL PROPERTY USE_FOLDERS ON) set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set_property(GLOBAL PROPERTY AUTOGEN_TARGETS_FOLDER "Autogen") set_property(GLOBAL PROPERTY AUTOGEN_TARGETS_FOLDER "Autogen")
@@ -343,7 +344,7 @@ endif()
if(IOS) if(IOS)
include(cmake/ios.cmake) include(cmake/ios.cmake)
include(cmake/ios-arch-fixup.cmake) #include(cmake/ios-arch-fixup.cmake)
elseif(APPLE AND NOT IOS) elseif(APPLE AND NOT IOS)
include(cmake/osxtools.cmake) include(cmake/osxtools.cmake)
include(cmake/macos.cmake) include(cmake/macos.cmake)
@@ -384,4 +385,5 @@ if(NOT IOS AND NOT ANDROID)
endif() endif()
target_sources(${PROJECT} PRIVATE ${SOURCES} ${HEADERS} ${RESOURCES} ${QRC} ${I18NQRC}) target_sources(${PROJECT} PRIVATE ${SOURCES} ${HEADERS} ${RESOURCES} ${QRC} ${I18NQRC})
set(IOS 0)
qt_finalize_target(${PROJECT}) qt_finalize_target(${PROJECT})
+1 -2
View File
@@ -157,7 +157,6 @@ void AmneziaApplication::init()
connect(this, &AmneziaApplication::translationsUpdated, m_notificationHandler.get(), &NotificationHandler::onTranslationsUpdated); connect(this, &AmneziaApplication::translationsUpdated, m_notificationHandler.get(), &NotificationHandler::onTranslationsUpdated);
#endif #endif
m_engine->addImportPath("qrc:/ui/qml/Modules/");
m_engine->load(url); m_engine->load(url);
m_systemController->setQmlRoot(m_engine->rootObjects().value(0)); m_systemController->setQmlRoot(m_engine->rootObjects().value(0));
@@ -218,7 +217,7 @@ void AmneziaApplication::registerTypes()
declareQmlProtocolEnum(); declareQmlProtocolEnum();
declareQmlContainerEnum(); declareQmlContainerEnum();
qmlRegisterType<QRCodeReader>("QRCodeReader", 1, 0, "QRCodeReader"); // qmlRegisterType<QRCodeReader>("QRCodeReader", 1, 0, "QRCodeReader");
m_containerProps.reset(new ContainerProps()); m_containerProps.reset(new ContainerProps());
qmlRegisterSingletonInstance("ContainerProps", 1, 0, "ContainerProps", m_containerProps.get()); qmlRegisterSingletonInstance("ContainerProps", 1, 0, "ContainerProps", m_containerProps.get());
+2
View File
@@ -1,6 +1,8 @@
#ifndef AMNEZIA_APPLICATION_H #ifndef AMNEZIA_APPLICATION_H
#define AMNEZIA_APPLICATION_H #define AMNEZIA_APPLICATION_H
#define Q_OS_IOS 1
#include <QCommandLineParser> #include <QCommandLineParser>
#include <QNetworkAccessManager> #include <QNetworkAccessManager>
#include <QQmlApplicationEngine> #include <QQmlApplicationEngine>
@@ -384,8 +384,7 @@ class AmneziaActivity : QtActivity() {
getVpnProto(vpnConfig)?.let { proto -> getVpnProto(vpnConfig)?.let { proto ->
Log.d(TAG, "Proto from config: $proto, current proto: $vpnProto") Log.d(TAG, "Proto from config: $proto, current proto: $vpnProto")
if (isServiceConnected) { if (isServiceConnected) {
if (proto.serviceClass == vpnProto?.serviceClass) { if (proto == vpnProto) {
vpnProto = proto
connectToVpn(vpnConfig) connectToVpn(vpnConfig)
return return
} }
@@ -49,15 +49,7 @@ enum class VpnProto(
"org.amnezia.vpn:amneziaXrayService", "org.amnezia.vpn:amneziaXrayService",
XrayService::class.java XrayService::class.java
) { ) {
override fun createProtocol(): Protocol = Xray.instance override fun createProtocol(): Protocol = Xray()
},
SSXRAY(
"SSXRay",
"org.amnezia.vpn:amneziaXrayService",
XrayService::class.java
) {
override fun createProtocol(): Protocol = Xray.instance
}; };
private var _protocol: Protocol? = null private var _protocol: Protocol? = null
+9 -11
View File
@@ -5,7 +5,6 @@ import android.net.VpnService.Builder
import java.io.File import java.io.File
import java.io.IOException import java.io.IOException
import go.Seq import go.Seq
import org.amnezia.vpn.protocol.BadConfigException
import org.amnezia.vpn.protocol.Protocol import org.amnezia.vpn.protocol.Protocol
import org.amnezia.vpn.protocol.ProtocolState.CONNECTED import org.amnezia.vpn.protocol.ProtocolState.CONNECTED
import org.amnezia.vpn.protocol.ProtocolState.DISCONNECTED import org.amnezia.vpn.protocol.ProtocolState.DISCONNECTED
@@ -115,14 +114,17 @@ class Xray : Protocol() {
return return
} }
val xrayJsonConfig = config.optJSONObject("xray_config_data") val xrayJsonConfig = config.getJSONObject("xray_config_data")
?: config.optJSONObject("ssxray_config_data")
?: throw BadConfigException("config_data not found")
val xrayConfig = parseConfig(config, xrayJsonConfig) val xrayConfig = parseConfig(config, xrayJsonConfig)
(xrayJsonConfig.optJSONObject("log") ?: JSONObject().also { xrayJsonConfig.put("log", it) }) // for debug
.put("loglevel", "warning") // xrayJsonConfig.getJSONObject("log").put("loglevel", "debug")
.put("access", "none") // disable access log xrayJsonConfig.getJSONObject("log").put("loglevel", "warning")
// disable access log
xrayJsonConfig.getJSONObject("log").put("access", "none")
// replace socks address
// (xrayJsonConfig.getJSONArray("inbounds")[0] as JSONObject).put("listen", "::1")
start(xrayConfig, xrayJsonConfig.toString(), vpnBuilder, protect) start(xrayConfig, xrayJsonConfig.toString(), vpnBuilder, protect)
state.value = CONNECTED state.value = CONNECTED
@@ -226,10 +228,6 @@ class Xray : Protocol() {
throw VpnStartException("Failed to start tun2socks: $err") throw VpnStartException("Failed to start tun2socks: $err")
} }
} }
companion object {
val instance: Xray by lazy { Xray() }
}
} }
private fun String?.isNotNullOrBlank(block: (String) -> Unit) { private fun String?.isNotNullOrBlank(block: (String) -> Unit) {
+6 -6
View File
@@ -38,12 +38,12 @@ elseif(APPLE AND NOT IOS)
set(OPENSSL_LIB_SSL_PATH "${OPENSSL_ROOT_DIR}/macos/lib/libssl.a") set(OPENSSL_LIB_SSL_PATH "${OPENSSL_ROOT_DIR}/macos/lib/libssl.a")
set(OPENSSL_LIB_CRYPTO_PATH "${OPENSSL_ROOT_DIR}/macos/lib/libcrypto.a") set(OPENSSL_LIB_CRYPTO_PATH "${OPENSSL_ROOT_DIR}/macos/lib/libcrypto.a")
elseif(IOS) elseif(IOS)
set(LIBSSH_INCLUDE_DIR "${LIBSSH_ROOT_DIR}/ios/arm64") set(LIBSSH_INCLUDE_DIR "${LIBSSH_ROOT_DIR}/macos/x86_64")
set(LIBSSH_LIB_PATH "${LIBSSH_ROOT_DIR}/ios/arm64/libssh.a") set(LIBSSH_LIB_PATH "${LIBSSH_ROOT_DIR}/macos/x86_64/libssh.a")
set(ZLIB_LIB_PATH "${LIBSSH_ROOT_DIR}/ios/arm64/libz.a") set(ZLIB_LIB_PATH "${LIBSSH_ROOT_DIR}/macos/x86_64/libz.a")
set(OPENSSL_INCLUDE_DIR "${OPENSSL_ROOT_DIR}/ios/iphone/include") set(OPENSSL_INCLUDE_DIR "${OPENSSL_ROOT_DIR}/macos/include")
set(OPENSSL_LIB_SSL_PATH "${OPENSSL_ROOT_DIR}/ios/iphone/lib/libssl.a") set(OPENSSL_LIB_SSL_PATH "${OPENSSL_ROOT_DIR}/macos/lib/libssl.a")
set(OPENSSL_LIB_CRYPTO_PATH "${OPENSSL_ROOT_DIR}/ios/iphone/lib/libcrypto.a") set(OPENSSL_LIB_CRYPTO_PATH "${OPENSSL_ROOT_DIR}/macos/lib/libcrypto.a")
elseif(ANDROID) elseif(ANDROID)
set(abi ${CMAKE_ANDROID_ARCH_ABI}) set(abi ${CMAKE_ANDROID_ARCH_ABI})
set(LIBSSH_INCLUDE_DIR "${LIBSSH_ROOT_DIR}/android/${abi}") set(LIBSSH_INCLUDE_DIR "${LIBSSH_ROOT_DIR}/android/${abi}")
+1 -1
View File
@@ -37,7 +37,7 @@ while(IOS_TARGETS)
## I just want to say it's amazing this doesn't explode with syntax errors. ## I just want to say it's amazing this doesn't explode with syntax errors.
message("Patching architectures for ${TARGET_NAME}") message("Patching architectures for ${TARGET_NAME}")
set_target_properties(${TARGET_NAME} PROPERTIES set_target_properties(${TARGET_NAME} PROPERTIES
XCODE_ATTRIBUTE_ARCHS[sdk=iphoneos*] "arm64" XCODE_ATTRIBUTE_ARCHS[sdk=macosx*] "x86_64"
XCODE_ATTRIBUTE_ARCHS[sdk=iphonesimulator*] "x86_64" XCODE_ATTRIBUTE_ARCHS[sdk=iphonesimulator*] "x86_64"
) )
endwhile() endwhile()
+63 -16
View File
@@ -1,17 +1,21 @@
message("Client iOS build") message("Client iOS build")
set(CMAKE_OSX_DEPLOYMENT_TARGET 13.0)
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}) set(APPLE_PROJECT_VERSION ${CMAKE_PROJECT_VERSION_MAJOR}.${CMAKE_PROJECT_VERSION_MINOR}.${CMAKE_PROJECT_VERSION_PATCH})
enable_language(OBJC) enable_language(OBJC)
enable_language(OBJCXX) # enable_language(OBJCXX)
enable_language(Swift) enable_language(Swift)
find_package(Qt6 REQUIRED COMPONENTS ShaderTools) find_package(Qt6 REQUIRED COMPONENTS ShaderTools)
set(LIBS ${LIBS} Qt6::ShaderTools) set(LIBS ${LIBS} Qt6::ShaderTools)
find_library(FW_AUTHENTICATIONSERVICES AuthenticationServices) find_library(FW_AUTHENTICATIONSERVICES AuthenticationServices)
find_library(FW_UIKIT UIKit) #find_library(FW_UIKIT UIKit)
find_library(FW_AVFOUNDATION AVFoundation) find_library(FW_AVFOUNDATION AVFoundation)
find_library(FW_FOUNDATION Foundation) find_library(FW_FOUNDATION Foundation)
find_library(FW_STOREKIT StoreKit) find_library(FW_STOREKIT StoreKit)
@@ -20,7 +24,7 @@ find_library(FW_NETWORKEXTENSION NetworkExtension)
set(LIBS ${LIBS} set(LIBS ${LIBS}
${FW_AUTHENTICATIONSERVICES} ${FW_AUTHENTICATIONSERVICES}
${FW_UIKIT} # ${FW_UIKIT}
${FW_AVFOUNDATION} ${FW_AVFOUNDATION}
${FW_FOUNDATION} ${FW_FOUNDATION}
${FW_STOREKIT} ${FW_STOREKIT}
@@ -48,6 +52,19 @@ set(SOURCES ${SOURCES}
${CMAKE_CURRENT_SOURCE_DIR}/platforms/ios/QtAppDelegate.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}) target_include_directories(${PROJECT} PRIVATE ${Qt6Gui_PRIVATE_INCLUDE_DIRS})
@@ -55,10 +72,9 @@ target_include_directories(${PROJECT} PRIVATE ${Qt6Gui_PRIVATE_INCLUDE_DIRS})
set_target_properties(${PROJECT} PROPERTIES set_target_properties(${PROJECT} PROPERTIES
XCODE_LINK_BUILD_PHASE_MODE KNOWN_LOCATION XCODE_LINK_BUILD_PHASE_MODE KNOWN_LOCATION
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/ios/app/Info.plist.in MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/ios/app/Info.plist.in
MACOSX_BUNDLE_ICON_FILE "AppIcon" #MACOSX_BUNDLE_ICON_FILE "AppIcon"
MACOSX_BUNDLE_INFO_STRING "AmneziaVPN" MACOSX_BUNDLE_INFO_STRING "AmneziaVPN"
MACOSX_BUNDLE_BUNDLE_NAME "AmneziaVPN" MACOSX_BUNDLE_BUNDLE_NAME "AmneziaVPN"
MACOSX_BUNDLE_GUI_IDENTIFIER "${BUILD_IOS_APP_IDENTIFIER}"
MACOSX_BUNDLE_BUNDLE_VERSION "${CMAKE_PROJECT_VERSION_TWEAK}" MACOSX_BUNDLE_BUNDLE_VERSION "${CMAKE_PROJECT_VERSION_TWEAK}"
MACOSX_BUNDLE_LONG_VERSION_STRING "${APPLE_PROJECT_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}" MACOSX_BUNDLE_SHORT_VERSION_STRING "${APPLE_PROJECT_VERSION}"
@@ -70,17 +86,25 @@ set_target_properties(${PROJECT} PROPERTIES
XCODE_ATTRIBUTE_BUNDLE_INFO_STRING "AmneziaVPN" XCODE_ATTRIBUTE_BUNDLE_INFO_STRING "AmneziaVPN"
XCODE_GENERATE_SCHEME TRUE XCODE_GENERATE_SCHEME TRUE
XCODE_ATTRIBUTE_ENABLE_BITCODE "NO" XCODE_ATTRIBUTE_ENABLE_BITCODE "NO"
XCODE_ATTRIBUTE_ASSETCATALOG_COMPILER_APPICON_NAME "AppIcon" #XCODE_ATTRIBUTE_ASSETCATALOG_COMPILER_APPICON_NAME "AppIcon"
XCODE_ATTRIBUTE_TARGETED_DEVICE_FAMILY "1,2" XCODE_ATTRIBUTE_TARGETED_DEVICE_FAMILY "1,2"
XCODE_EMBED_FRAMEWORKS_CODE_SIGN_ON_COPY ON XCODE_EMBED_FRAMEWORKS_CODE_SIGN_ON_COPY "NO"
XCODE_EMBED_FRAMEWORKS_REMOVE_HEADERS_ON_COPY "YES"
XCODE_LINK_BUILD_PHASE_MODE KNOWN_LOCATION XCODE_LINK_BUILD_PHASE_MODE KNOWN_LOCATION
XCODE_ATTRIBUTE_LD_RUNPATH_SEARCH_PATHS "@executable_path/Frameworks" XCODE_ATTRIBUTE_LD_RUNPATH_SEARCH_PATHS "@executable_path/../Frameworks"
XCODE_EMBED_APP_EXTENSIONS networkextension XCODE_EMBED_APP_EXTENSIONS networkextension
XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "Apple Distribution"
XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY[variant=Debug] "Apple Development" XCODE_ATTRIBUTE_CODE_SIGN_STYLE Automatic
XCODE_ATTRIBUTE_CODE_SIGN_STYLE Manual #XCODE_ATTRIBUTE_CODE_SIGN_STYLE Manual
XCODE_ATTRIBUTE_PROVISIONING_PROFILE_SPECIFIER "match AppStore org.amnezia.AmneziaVPN"
XCODE_ATTRIBUTE_PROVISIONING_PROFILE_SPECIFIER[variant=Debug] "match Development org.amnezia.AmneziaVPN" #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 set_target_properties(${PROJECT} PROPERTIES
XCODE_ATTRIBUTE_SWIFT_VERSION "5.0" XCODE_ATTRIBUTE_SWIFT_VERSION "5.0"
@@ -111,13 +135,13 @@ target_sources(${PROJECT} PRIVATE
) )
target_sources(${PROJECT} PRIVATE target_sources(${PROJECT} PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/ios/app/AmneziaVPNLaunchScreen.storyboard #${CMAKE_CURRENT_SOURCE_DIR}/ios/app/AmneziaVPNLaunchScreen.storyboard
${CMAKE_CURRENT_SOURCE_DIR}/ios/app/Media.xcassets ${CMAKE_CURRENT_SOURCE_DIR}/ios/app/Media.xcassets
${CMAKE_CURRENT_SOURCE_DIR}/ios/app/PrivacyInfo.xcprivacy ${CMAKE_CURRENT_SOURCE_DIR}/ios/app/PrivacyInfo.xcprivacy
) )
set_property(TARGET ${PROJECT} APPEND PROPERTY RESOURCE set_property(TARGET ${PROJECT} APPEND PROPERTY RESOURCE
${CMAKE_CURRENT_SOURCE_DIR}/ios/app/AmneziaVPNLaunchScreen.storyboard #${CMAKE_CURRENT_SOURCE_DIR}/ios/app/AmneziaVPNLaunchScreen.storyboard
${CMAKE_CURRENT_SOURCE_DIR}/ios/app/Media.xcassets ${CMAKE_CURRENT_SOURCE_DIR}/ios/app/Media.xcassets
${CMAKE_CURRENT_SOURCE_DIR}/ios/app/PrivacyInfo.xcprivacy ${CMAKE_CURRENT_SOURCE_DIR}/ios/app/PrivacyInfo.xcprivacy
) )
@@ -129,6 +153,29 @@ set_property(TARGET ${PROJECT} PROPERTY XCODE_EMBED_FRAMEWORKS
"${CMAKE_CURRENT_SOURCE_DIR}/3rd/OpenVPNAdapter/build/Release-iphoneos/OpenVPNAdapter.framework" "${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) 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") 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()
@@ -1,5 +1,7 @@
#include "openvpn_configurator.h" #include "openvpn_configurator.h"
#define Q_OS_IOS 1
#include <QDebug> #include <QDebug>
#include <QJsonDocument> #include <QJsonDocument>
#include <QJsonObject> #include <QJsonObject>
+4 -2
View File
@@ -1,5 +1,7 @@
#include "ssh_configurator.h" #include "ssh_configurator.h"
#define Q_OS_IOS 1
#include <QDebug> #include <QDebug>
#include <QObject> #include <QObject>
#include <QProcess> #include <QProcess>
@@ -101,8 +103,8 @@ QProcessEnvironment SshConfigurator::prepareEnv()
pathEnvVar.clear(); pathEnvVar.clear();
pathEnvVar.prepend(QDir::toNativeSeparators(QApplication::applicationDirPath()) + "\\cygwin;"); pathEnvVar.prepend(QDir::toNativeSeparators(QApplication::applicationDirPath()) + "\\cygwin;");
pathEnvVar.prepend(QDir::toNativeSeparators(QApplication::applicationDirPath()) + "\\openvpn;"); pathEnvVar.prepend(QDir::toNativeSeparators(QApplication::applicationDirPath()) + "\\openvpn;");
#elif defined(Q_OS_MACX) //#elif defined(Q_OS_MACX)
pathEnvVar.prepend(QDir::toNativeSeparators(QApplication::applicationDirPath()) + "/Contents/MacOS"); // pathEnvVar.prepend(QDir::toNativeSeparators(QApplication::applicationDirPath()) + "/Contents/MacOS");
#endif #endif
env.insert("PATH", pathEnvVar); env.insert("PATH", pathEnvVar);
+1 -2
View File
@@ -90,7 +90,7 @@ QMap<DockerContainer, QString> ContainerProps::containerHumanNames()
{ {
return { { DockerContainer::None, "Not installed" }, return { { DockerContainer::None, "Not installed" },
{ DockerContainer::OpenVpn, "OpenVPN" }, { DockerContainer::OpenVpn, "OpenVPN" },
{ DockerContainer::ShadowSocks, "OpenVPN over SS" }, { DockerContainer::ShadowSocks, "ShadowSocks" },
{ DockerContainer::Cloak, "OpenVPN over Cloak" }, { DockerContainer::Cloak, "OpenVPN over Cloak" },
{ DockerContainer::WireGuard, "WireGuard" }, { DockerContainer::WireGuard, "WireGuard" },
{ DockerContainer::Awg, "AmneziaWG" }, { DockerContainer::Awg, "AmneziaWG" },
@@ -306,7 +306,6 @@ bool ContainerProps::isSupportedByCurrentPlatform(DockerContainer c)
case DockerContainer::Awg: return true; case DockerContainer::Awg: return true;
case DockerContainer::Cloak: return true; case DockerContainer::Cloak: return true;
case DockerContainer::Xray: return true; case DockerContainer::Xray: return true;
case DockerContainer::SSXray: return true;
default: return false; default: return false;
} }
@@ -1,3 +1,5 @@
#define Q_OS_IOS 1
#include "apiController.h" #include "apiController.h"
#include <QEventLoop> #include <QEventLoop>
-1
View File
@@ -96,7 +96,6 @@ namespace amnezia
// import and install errors // import and install errors
ImportInvalidConfigError = 900, ImportInvalidConfigError = 900,
ImportQrDecodingError = 901,
// Android errors // Android errors
AndroidError = 1000, AndroidError = 1000,
-1
View File
@@ -50,7 +50,6 @@ QString errorString(ErrorCode code) {
case (ErrorCode::AddressPoolError): errorMessage = QObject::tr("VPN pool error: no available addresses"); break; 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::ImportInvalidConfigError): errorMessage = QObject::tr("The config does not contain any containers and credentials for connecting to the server"); break;
case (ErrorCode::ImportQrDecodingError): errorMessage = QObject::tr("Failed to decode qr-code"); break;
// Android errors // Android errors
case (ErrorCode::AndroidError): errorMessage = QObject::tr("VPN connection error"); break; case (ErrorCode::AndroidError): errorMessage = QObject::tr("VPN connection error"); break;
+4 -2
View File
@@ -5,10 +5,12 @@
#include <QObject> #include <QObject>
#include "ipc.h" #include "ipc.h"
#include "rep_ipc_interface_replica.h" //#include "rep_ipc_interface_replica.h"
#include "privileged_process.h" #include "privileged_process.h"
/*
class IpcClient : public QObject class IpcClient : public QObject
{ {
Q_OBJECT Q_OBJECT
@@ -46,6 +48,6 @@ private:
bool m_isSocketConnected {false}; bool m_isSocketConnected {false};
static IpcClient *m_instance; static IpcClient *m_instance;
}; }; */
#endif // IPCCLIENT_H #endif // IPCCLIENT_H
+9 -9
View File
@@ -3,21 +3,21 @@
#include <QObject> #include <QObject>
#include "rep_ipc_process_interface_replica.h" // #include "rep_ipc_process_interface_replica.h"
// This class is dangerous - instance of this class casted from base class, // This class is dangerous - instance of this class casted from base class,
// so it support only functions // so it support only functions
// Do not add any members into it // Do not add any members into it
// //
class PrivilegedProcess : public IpcProcessInterfaceReplica //class PrivilegedProcess : public IpcProcessInterfaceReplica
{ //{
Q_OBJECT // Q_OBJECT
public: //public:
PrivilegedProcess(); // PrivilegedProcess();
~PrivilegedProcess() override; // ~PrivilegedProcess() override;
void waitForFinished(int msecs); // void waitForFinished(int msecs);
}; //};
#endif // PRIVILEGED_PROCESS_H #endif // PRIVILEGED_PROCESS_H
+3 -16
View File
@@ -11,7 +11,7 @@
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string> <string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
<string>${MACOSX_BUNDLE_GUI_IDENTIFIER}</string> <string>org.amnezia.AmneziaVPN</string>
<key>CFBundleInfoDictionaryVersion</key> <key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string> <string>6.0</string>
<key>CFBundleName</key> <key>CFBundleName</key>
@@ -24,23 +24,10 @@
<string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string> <string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string>
<key>NSHumanReadableCopyright</key> <key>NSHumanReadableCopyright</key>
<string>${MACOSX_BUNDLE_COPYRIGHT}</string> <string>${MACOSX_BUNDLE_COPYRIGHT}</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.utilities</string>
<key>ITSAppUsesNonExemptEncryption</key> <key>ITSAppUsesNonExemptEncryption</key>
<false/> <false/>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>LSSupportsOpeningDocumentsInPlace</key>
<false/>
<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> <key>UISupportedInterfaceOrientations~ipad</key>
<array/> <array/>
<key>UIUserInterfaceStyle</key> <key>UIUserInterfaceStyle</key>
+11 -1
View File
@@ -2,19 +2,29 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>com.apple.application-identifier</key>
<string>X7UJ388FXK.org.amnezia.AmneziaVPN</string>
<key>com.apple.developer.networking.networkextension</key> <key>com.apple.developer.networking.networkextension</key>
<array> <array>
<string>packet-tunnel-provider</string> <string>packet-tunnel-provider</string>
</array> </array>
<key>com.apple.developer.team-identifier</key>
<string>X7UJ388FXK</string>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.application-groups</key> <key>com.apple.security.application-groups</key>
<array> <array>
<string>group.org.amnezia.AmneziaVPN</string> <string>group.org.amnezia.AmneziaVPN</string>
</array> </array>
<key>com.apple.security.files.user-selected.read-write</key> <key>com.apple.security.files.user-selected.read-write</key>
<true/> <true/>
<key>com.apple.security.network.client</key>
<true/>
<key>com.apple.security.network.server</key>
<true/>
<key>keychain-access-groups</key> <key>keychain-access-groups</key>
<array> <array>
<string>$(AppIdentifierPrefix)group.org.amnezia.AmneziaVPN</string> <string>$(AppIdentifierPrefix)org.amnezia.AmneziaVPN</string>
</array> </array>
</dict> </dict>
</plist> </plist>
@@ -2,17 +2,27 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>com.apple.application-identifier</key>
<string>X7UJ388FXK.org.amnezia.AmneziaVPN.network-extension</string>
<key>com.apple.developer.networking.networkextension</key> <key>com.apple.developer.networking.networkextension</key>
<array> <array>
<string>packet-tunnel-provider</string> <string>packet-tunnel-provider</string>
</array> </array>
<key>com.apple.developer.team-identifier</key>
<string>X7UJ388FXK</string>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.application-groups</key> <key>com.apple.security.application-groups</key>
<array> <array>
<string>group.org.amnezia.AmneziaVPN</string> <string>group.org.amnezia.AmneziaVPN</string>
</array> </array>
<key>com.apple.security.network.client</key>
<true/>
<key>com.apple.security.network.server</key>
<true/>
<key>keychain-access-groups</key> <key>keychain-access-groups</key>
<array> <array>
<string>$(AppIdentifierPrefix)group.org.amnezia.AmneziaVPN</string> <string>$(AppIdentifierPrefix)org.amnezia.AmneziaVPN.network-extension</string>
</array> </array>
</dict> </dict>
</plist> </plist>
+74 -14
View File
@@ -3,19 +3,22 @@ enable_language(Swift)
set(CLIENT_ROOT_DIR ${CMAKE_CURRENT_LIST_DIR}/../..) set(CLIENT_ROOT_DIR ${CMAKE_CURRENT_LIST_DIR}/../..)
add_executable(networkextension) add_executable(networkextension)
configure_file(
${CMAKE_CURRENT_LIST_DIR}/Info.plist.in
${CMAKE_CURRENT_BINARY_DIR}/Info.plist
)
set_target_properties(networkextension PROPERTIES set_target_properties(networkextension PROPERTIES
XCODE_PRODUCT_TYPE com.apple.product-type.app-extension XCODE_PRODUCT_TYPE com.apple.product-type.app-extension
BUNDLE_EXTENSION appex BUNDLE_EXTENSION appex
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist.in #MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_BINARY_DIR}/Info.plist
MACOSX_BUNDLE_INFO_STRING "AmneziaVPNNetworkExtension"
MACOSX_BUNDLE_BUNDLE_NAME "AmneziaVPNNetworkExtension"
MACOSX_BUNDLE_GUI_IDENTIFIER "${BUILD_IOS_APP_IDENTIFIER}.network-extension"
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}" MACOSX_BUNDLE_SHORT_VERSION_STRING "${APPLE_PROJECT_VERSION}"
XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER "${BUILD_IOS_APP_IDENTIFIER}.network-extension" 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_CODE_SIGN_ENTITLEMENTS ${CMAKE_CURRENT_SOURCE_DIR}/AmneziaVPNNetworkExtension.entitlements
XCODE_ATTRIBUTE_MARKETING_VERSION "${APP_MAJOR_VERSION}" XCODE_ATTRIBUTE_MARKETING_VERSION "${APP_MAJOR_VERSION}"
XCODE_ATTRIBUTE_CURRENT_PROJECT_VERSION "${BUILD_ID}" XCODE_ATTRIBUTE_CURRENT_PROJECT_VERSION "${BUILD_ID}"
@@ -27,14 +30,41 @@ set_target_properties(networkextension PROPERTIES
XCODE_ATTRIBUTE_LD_RUNPATH_SEARCH_PATHS "@executable_path/../../Frameworks" XCODE_ATTRIBUTE_LD_RUNPATH_SEARCH_PATHS "@executable_path/../../Frameworks"
XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "Apple Distribution" # XCODE_ATTRIBUTE_CODE_SIGN_STYLE Automatic
XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY[variant=Debug] "Apple Development" # #XCODE_ATTRIBUTE_CODE_SIGN_STYLE Manual
XCODE_ATTRIBUTE_CODE_SIGN_STYLE Manual # #XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "Apple Distribution: Privacy Technologies OU (X7UJ388FXK)"
XCODE_ATTRIBUTE_PROVISIONING_PROFILE_SPECIFIER "match AppStore org.amnezia.AmneziaVPN.network-extension" # #XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY[variant=Debug] "Apple Development"
XCODE_ATTRIBUTE_PROVISIONING_PROFILE_SPECIFIER[variant=Debug] "match Development org.amnezia.AmneziaVPN.network-extension"
# #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 set_target_properties(networkextension PROPERTIES
XCODE_ATTRIBUTE_SWIFT_VERSION "5.0" XCODE_ATTRIBUTE_SWIFT_VERSION "5.0"
XCODE_ATTRIBUTE_CLANG_ENABLE_MODULES "YES" XCODE_ATTRIBUTE_CLANG_ENABLE_MODULES "YES"
@@ -52,9 +82,39 @@ find_library(FW_MOBILE_CORE MobileCoreServices)
find_library(FW_UI_KIT UIKit) find_library(FW_UI_KIT UIKit)
find_library(FW_LIBRESOLV libresolv.9.tbd) find_library(FW_LIBRESOLV libresolv.9.tbd)
target_link_libraries(networkextension PRIVATE ${FW_ASSETS_LIBRARY}) # set(OpenVPNAdapter_DIR "${CLIENT_ROOT_DIR}/3rd/")
target_link_libraries(networkextension PRIVATE ${FW_MOBILE_CORE})
target_link_libraries(networkextension PRIVATE ${FW_UI_KIT}) # 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_property(TARGET networkextension 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")
#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_link_libraries(networkextension PRIVATE ${FW_LIBRESOLV})
target_compile_options(networkextension PRIVATE -DGROUP_ID=\"${BUILD_IOS_GROUP_IDENTIFIER}\") target_compile_options(networkextension PRIVATE -DGROUP_ID=\"${BUILD_IOS_GROUP_IDENTIFIER}\")
+8 -8
View File
@@ -5,20 +5,20 @@
<key>CFBundleDevelopmentRegion</key> <key>CFBundleDevelopmentRegion</key>
<string>en</string> <string>en</string>
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string> <string>AmneziaVPNNetworkExtension</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
<string>${MACOSX_BUNDLE_GUI_IDENTIFIER}</string> <string>${BUILD_IOS_APP_IDENTIFIER}.network-extension</string>
<key>CFBundleInfoDictionaryVersion</key> <key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string> <string>6.0</string>
<key>CFBundleName</key> <key>CFBundleName</key>
<string>${MACOSX_BUNDLE_BUNDLE_NAME}</string> <string>AmneziaVPNNetworkExtension</string>
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string> <string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>${MACOSX_BUNDLE_SHORT_VERSION_STRING}</string> <string>${APPLE_PROJECT_VERSION}</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string> <string>${CMAKE_PROJECT_VERSION_TWEAK}</string>
<key>ITSAppUsesNonExemptEncryption</key> <key>ITSAppUsesNonExemptEncryption</key>
<false/> <false/>
@@ -27,7 +27,7 @@
<string>${CMAKE_OSX_DEPLOYMENT_TARGET}</string> <string>${CMAKE_OSX_DEPLOYMENT_TARGET}</string>
<key>CFBundleDisplayName</key> <key>CFBundleDisplayName</key>
<string>${MACOSX_BUNDLE_INFO_STRING}</string> <string>AmneziaVPNNetworkExtension</string>
<key>NSExtension</key> <key>NSExtension</key>
<dict> <dict>
@@ -38,9 +38,9 @@
</dict> </dict>
<key>com.wireguard.ios.app_group_id</key> <key>com.wireguard.ios.app_group_id</key>
<string>group.${BUILD_IOS_APP_IDENTIFIER}</string> <string>group.org.amnezia.AmneziaVPN</string>
<key>com.wireguard.macos.app_group_id</key> <key>com.wireguard.macos.app_group_id</key>
<string>${BUILD_VPN_DEVELOPMENT_TEAM}.group.${BUILD_OSX_APP_IDENTIFIER}</string> <string>${BUILD_VPN_DEVELOPMENT_TEAM}.group.org.amnezia.AmneziaVPN</string>
</dict> </dict>
</plist> </plist>
+3 -1
View File
@@ -11,9 +11,11 @@ EOF
cd 3rd/OpenVPNAdapter cd 3rd/OpenVPNAdapter
if $XCODEBUILD -scheme OpenVPNAdapter -configuration Release -xcconfig Configuration/amnezia.xcconfig -sdk iphoneos -destination 'generic/platform=iOS' -project OpenVPNAdapter.xcodeproj ; then if $XCODEBUILD -scheme OpenVPNAdapter -configuration Release -xcconfig Configuration/amnezia.xcconfig -sdk macosx14.5 -destination 'generic/platform=MacOS' -project OpenVPNAdapter.xcodeproj ; then
echo "OpenVPNAdapter built successfully" echo "OpenVPNAdapter built successfully"
else else
echo "OpenVPNAdapter build failed" echo "OpenVPNAdapter build failed"
fi fi
rm -rf ./build/Release-iphoneos/OpenVPNAdapter.framework/Versions/A/_CodeSignature
cd ../../ cd ../../
@@ -4,7 +4,12 @@
<dict> <dict>
<key>com.apple.application-identifier</key> <key>com.apple.application-identifier</key>
<string>$(DEVELOPMENT_TEAM).$(NETEXT_ID_MACOS)</string> <string>$(DEVELOPMENT_TEAM).$(NETEXT_ID_MACOS)</string>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.network.client</key>
<true/>
<key>com.apple.security.network.server</key>
<true/>
<key>com.apple.developer.networking.networkextension</key> <key>com.apple.developer.networking.networkextension</key>
<array> <array>
<string>packet-tunnel-provider</string> <string>packet-tunnel-provider</string>
-8
View File
@@ -8,14 +8,6 @@ class QRCodeReader: public QObject {
Q_OBJECT Q_OBJECT
public: public:
QRCodeReader();
QRect cameraSize();
public slots:
void startReading();
void stopReading();
void setCameraSize(QRect value);
signals: signals:
void codeReaded(QString code); void codeReaded(QString code);
+14 -14
View File
@@ -1,12 +1,12 @@
#include "QRCodeReaderBase.h" #include "QRCodeReaderBase.h"
#import <UIKit/UIKit.h> //#import <UIKit/UIKit.h>
#import <AVFoundation/AVFoundation.h> #import <AVFoundation/AVFoundation.h>
@interface QRCodeReaderImpl : UIViewController //@interface QRCodeReaderImpl : UIViewController
@end //@end
@interface QRCodeReaderImpl () <AVCaptureMetadataOutputObjectsDelegate> /*@interface QRCodeReaderImpl () <AVCaptureMetadataOutputObjectsDelegate>
@property (nonatomic) QRCodeReader* qrCodeReader; @property (nonatomic) QRCodeReader* qrCodeReader;
@property (nonatomic, strong) AVCaptureSession *captureSession; @property (nonatomic, strong) AVCaptureSession *captureSession;
@property (nonatomic, strong) AVCaptureVideoPreviewLayer *videoPreviewPlayer; @property (nonatomic, strong) AVCaptureVideoPreviewLayer *videoPreviewPlayer;
@@ -15,15 +15,15 @@
@implementation QRCodeReaderImpl @implementation QRCodeReaderImpl
- (void)viewDidLoad { //- (void)viewDidLoad {
[super viewDidLoad]; // [super viewDidLoad];
_captureSession = nil; // _captureSession = nil;
} //}
- (void)setQrCodeReader: (QRCodeReader*)value { //- (void)setQrCodeReader: (QRCodeReader*)value {
_qrCodeReader = value; // _qrCodeReader = value;
} //}
- (BOOL)startReading { - (BOOL)startReading {
NSError *error; NSError *error;
@@ -49,7 +49,7 @@
_videoPreviewPlayer = [[AVCaptureVideoPreviewLayer alloc] initWithSession: _captureSession]; _videoPreviewPlayer = [[AVCaptureVideoPreviewLayer alloc] initWithSession: _captureSession];
CGFloat statusBarHeight = [UIApplication sharedApplication].statusBarFrame.size.height; //CGFloat statusBarHeight = [UIApplication sharedApplication].statusBarFrame.size.height;
QRect cameraRect = _qrCodeReader->cameraSize(); QRect cameraRect = _qrCodeReader->cameraSize();
CGRect cameraCGRect = CGRectMake(cameraRect.x(), CGRect cameraCGRect = CGRectMake(cameraRect.x(),
@@ -60,7 +60,7 @@
[_videoPreviewPlayer setVideoGravity: AVLayerVideoGravityResizeAspectFill]; [_videoPreviewPlayer setVideoGravity: AVLayerVideoGravityResizeAspectFill];
[_videoPreviewPlayer setFrame: cameraCGRect]; [_videoPreviewPlayer setFrame: cameraCGRect];
CALayer* layer = [UIApplication sharedApplication].keyWindow.layer; // CALayer* layer = [UIApplication sharedApplication].keyWindow.layer;
[layer addSublayer: _videoPreviewPlayer]; [layer addSublayer: _videoPreviewPlayer];
[_captureSession startRunning]; [_captureSession startRunning];
@@ -107,4 +107,4 @@ void QRCodeReader::startReading() {
void QRCodeReader::stopReading() { void QRCodeReader::stopReading() {
[m_qrCodeReader stopReading]; [m_qrCodeReader stopReading];
} }*/
+1 -1
View File
@@ -1,4 +1,4 @@
#import <UIKit/UIKit.h> //#import <UIKit/UIKit.h>
@interface QIOSApplicationDelegate @interface QIOSApplicationDelegate
@end @end
+2 -2
View File
@@ -6,7 +6,7 @@
@implementation QIOSApplicationDelegate (AmneziaVPNDelegate) @implementation QIOSApplicationDelegate (AmneziaVPNDelegate)
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions /*- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{ {
[application setMinimumBackgroundFetchInterval: UIApplicationBackgroundFetchIntervalMinimum]; [application setMinimumBackgroundFetchInterval: UIApplicationBackgroundFetchIntervalMinimum];
// Override point for customization after application launch. // Override point for customization after application launch.
@@ -56,6 +56,6 @@
return YES; return YES;
} }
return NO; return NO;
} }*/
@end @end
+1 -78
View File
@@ -1,87 +1,10 @@
import UIKit //import UIKit
public func toggleScreenshots(_ isEnabled: Bool) { public func toggleScreenshots(_ isEnabled: Bool) {
let window = UIApplication.shared.keyWindows.first!
if isEnabled {
ScreenProtection.shared.disable(for: window.rootViewController!.view)
} else {
ScreenProtection.shared.enable(for: window.rootViewController!.view)
}
}
extension UIApplication {
var keyWindows: [UIWindow] {
connectedScenes
.compactMap {
if #available(iOS 15.0, *) {
($0 as? UIWindowScene)?.keyWindow
} else {
($0 as? UIWindowScene)?.windows.first { $0.isKeyWindow }
}
}
}
} }
class ScreenProtection { class ScreenProtection {
public static let shared = ScreenProtection()
var pairs = [ProtectionPair]()
private var blurView: UIVisualEffectView?
private var recordingObservation: NSKeyValueObservation?
public func enable(for view: UIView) {
DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) {
view.subviews.forEach {
self.pairs.append(ProtectionPair(from: $0))
}
}
}
public func disable(for view: UIView) {
DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) {
self.pairs.forEach {
$0.removeProtection()
}
self.pairs.removeAll()
}
}
}
struct ProtectionPair {
let textField: UITextField
let layer: CALayer
init(from view: UIView) {
let secureTextField = UITextField()
secureTextField.backgroundColor = .clear
secureTextField.translatesAutoresizingMaskIntoConstraints = false
secureTextField.isSecureTextEntry = true
view.insertSubview(secureTextField, at: 0)
secureTextField.isUserInteractionEnabled = false
view.layer.superlayer?.addSublayer(secureTextField.layer)
secureTextField.layer.sublayers?.last?.addSublayer(view.layer)
secureTextField.topAnchor.constraint(equalTo: view.topAnchor, constant: 0).isActive = true
secureTextField.bottomAnchor.constraint(equalTo: view.bottomAnchor, constant: 0).isActive = true
secureTextField.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 0).isActive = true
secureTextField.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: 0).isActive = true
self.init(textField: secureTextField, layer: view.layer)
}
init(textField: UITextField, layer: CALayer) {
self.textField = textField
self.layer = layer
}
func removeProtection() {
textField.superview?.superview?.layer.addSublayer(layer)
textField.layer.removeFromSuperlayer()
textField.removeFromSuperview()
}
} }
+60 -33
View File
@@ -11,6 +11,8 @@
#include "../protocols/vpnprotocol.h" #include "../protocols/vpnprotocol.h"
#import "ios_controller_wrapper.h" #import "ios_controller_wrapper.h"
#include <Security/Security.h>
const char* Action::start = "start"; const char* Action::start = "start";
const char* Action::restart = "restart"; const char* Action::restart = "restart";
const char* Action::stop = "stop"; const char* Action::stop = "stop";
@@ -27,14 +29,34 @@ const char* MessageKey::isOnDemand = "is-on-demand";
const char* MessageKey::SplitTunnelType = "SplitTunnelType"; const char* MessageKey::SplitTunnelType = "SplitTunnelType";
const char* MessageKey::SplitTunnelSites = "SplitTunnelSites"; const char* MessageKey::SplitTunnelSites = "SplitTunnelSites";
static UIViewController* getViewController() { //static UIViewController* getViewController() {
NSArray *windows = [[UIApplication sharedApplication]windows]; // NSArray *windows = [[UIApplication sharedApplication]windows];
for (UIWindow *window in windows) { // for (UIWindow *window in windows) {
if (window.isKeyWindow) { // if (window.isKeyWindow) {
return window.rootViewController; // return window.rootViewController;
// }
// }
// return nil;
//}
OSStatus requestAuthorization() {
AuthorizationRef authRef;
OSStatus status = AuthorizationCreate(NULL, kAuthorizationEmptyEnvironment, kAuthorizationFlagDefaults, &authRef);
if (status != errAuthorizationSuccess) {
qDebug() << "Authorization failed with status:" << status;
return status;
} }
AuthorizationItem authItem = {kAuthorizationRightExecute, 0, NULL, 0};
AuthorizationRights authRights = {1, &authItem};
AuthorizationFlags flags = kAuthorizationFlagDefaults | kAuthorizationFlagInteractionAllowed | kAuthorizationFlagExtendRights;
status = AuthorizationCopyRights(authRef, &authRights, NULL, flags, NULL);
if (status != errAuthorizationSuccess) {
qDebug() << "Authorization rights copy failed with status:" << status;
} }
return nil;
return status;
} }
Vpn::ConnectionState iosStatusToState(NEVPNStatus status) { Vpn::ConnectionState iosStatusToState(NEVPNStatus status) {
@@ -84,6 +106,11 @@ IosController* IosController::Instance() {
bool IosController::initialize() bool IosController::initialize()
{ {
if (requestAuthorization() != errAuthorizationSuccess) {
emit connectionStateChanged(Vpn::ConnectionState::Error);
return false;
}
__block bool ok = true; __block bool ok = true;
[NETunnelProviderManager loadAllFromPreferencesWithCompletionHandler:^(NSArray<NETunnelProviderManager *> * _Nullable managers, NSError * _Nullable error) { [NETunnelProviderManager loadAllFromPreferencesWithCompletionHandler:^(NSArray<NETunnelProviderManager *> * _Nullable managers, NSError * _Nullable error) {
@try { @try {
@@ -748,24 +775,24 @@ bool IosController::shareText(const QStringList& filesToSend) {
[sharingItems addObject:logFileUrl]; [sharingItems addObject:logFileUrl];
} }
UIViewController *qtController = getViewController(); // UIViewController *qtController = getViewController();
if (!qtController) return; // if (!qtController) return;
UIActivityViewController *activityController = [[UIActivityViewController alloc] initWithActivityItems:sharingItems applicationActivities:nil]; // UIActivityViewController *activityController = [[UIActivityViewController alloc] initWithActivityItems:sharingItems applicationActivities:nil];
__block bool isAccepted = false; __block bool isAccepted = false;
[activityController setCompletionWithItemsHandler:^(NSString *activityType, BOOL completed, NSArray *returnedItems, NSError *activityError) { // [activityController setCompletionWithItemsHandler:^(NSString *activityType, BOOL completed, NSArray *returnedItems, NSError *activityError) {
isAccepted = completed; // isAccepted = completed;
emit finished(); // emit finished();
}]; // }];
[qtController presentViewController:activityController animated:YES completion:nil]; // [qtController presentViewController:activityController animated:YES completion:nil];
UIPopoverPresentationController *popController = activityController.popoverPresentationController; // UIPopoverPresentationController *popController = activityController.popoverPresentationController;
if (popController) { // if (popController) {
popController.sourceView = qtController.view; // popController.sourceView = qtController.view;
popController.sourceRect = CGRectMake(100, 100, 100, 100); // popController.sourceRect = CGRectMake(100, 100, 100, 100);
} // }
QEventLoop wait; QEventLoop wait;
QObject::connect(this, &IosController::finished, &wait, &QEventLoop::quit); QObject::connect(this, &IosController::finished, &wait, &QEventLoop::quit);
@@ -775,26 +802,26 @@ bool IosController::shareText(const QStringList& filesToSend) {
} }
QString IosController::openFile() { QString IosController::openFile() {
UIDocumentPickerViewController *documentPicker = [[UIDocumentPickerViewController alloc] initWithDocumentTypes:@[@"public.item"] inMode:UIDocumentPickerModeOpen]; // UIDocumentPickerViewController *documentPicker = [[UIDocumentPickerViewController alloc] initWithDocumentTypes:@[@"public.item"] inMode:UIDocumentPickerModeOpen];
DocumentPickerDelegate *documentPickerDelegate = [[DocumentPickerDelegate alloc] init]; // DocumentPickerDelegate *documentPickerDelegate = [[DocumentPickerDelegate alloc] init];
documentPicker.delegate = documentPickerDelegate; // documentPicker.delegate = documentPickerDelegate;
UIViewController *qtController = getViewController(); // UIViewController *qtController = getViewController();
if (!qtController) return; // if (!qtController) return;
[qtController presentViewController:documentPicker animated:YES completion:nil]; // [qtController presentViewController:documentPicker animated:YES completion:nil];
__block QString filePath; __block QString filePath;
documentPickerDelegate.documentPickerClosedCallback = ^(NSString *path) { // documentPickerDelegate.documentPickerClosedCallback = ^(NSString *path) {
if (path) { // if (path) {
filePath = QString::fromUtf8(path.UTF8String); // filePath = QString::fromUtf8(path.UTF8String);
} else { // } else {
filePath = QString(); // filePath = QString();
} // }
emit finished(); // emit finished();
}; // };
QEventLoop wait; QEventLoop wait;
QObject::connect(this, &IosController::finished, &wait, &QEventLoop::quit); QObject::connect(this, &IosController::finished, &wait, &QEventLoop::quit);
@@ -1,7 +1,7 @@
#import <NetworkExtension/NetworkExtension.h> #import <NetworkExtension/NetworkExtension.h>
#import <NetworkExtension/NETunnelProviderSession.h> #import <NetworkExtension/NETunnelProviderSession.h>
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
#include <UIKit/UIKit.h> //#include <UIKit/UIKit.h>
#include <Security/Security.h> #include <Security/Security.h>
class IosController; class IosController;
@@ -18,8 +18,8 @@ class IosController;
typedef void (^DocumentPickerClosedCallback)(NSString *path); typedef void (^DocumentPickerClosedCallback)(NSString *path);
@interface DocumentPickerDelegate : NSObject <UIDocumentPickerDelegate> //@interface DocumentPickerDelegate : NSObject <UIDocumentPickerDelegate>
@property (nonatomic, copy) DocumentPickerClosedCallback documentPickerClosedCallback; //@property (nonatomic, copy) DocumentPickerClosedCallback documentPickerClosedCallback;
@end //@end
+14 -14
View File
@@ -26,20 +26,20 @@
@end @end
@implementation DocumentPickerDelegate //@implementation DocumentPickerDelegate
- (void)documentPicker:(UIDocumentPickerViewController *)controller didPickDocumentsAtURLs:(NSArray<NSURL *> *)urls { //- (void)documentPicker:(UIDocumentPickerViewController *)controller didPickDocumentsAtURLs:(NSArray<NSURL *> *)urls {
for (NSURL *url in urls) { // for (NSURL *url in urls) {
if (self.documentPickerClosedCallback) { // if (self.documentPickerClosedCallback) {
self.documentPickerClosedCallback([url path]); // self.documentPickerClosedCallback([url path]);
} // }
} // }
} //}
- (void)documentPickerWasCancelled:(UIDocumentPickerViewController *)controller { //- (void)documentPickerWasCancelled:(UIDocumentPickerViewController *)controller {
if (self.documentPickerClosedCallback) { // if (self.documentPickerClosedCallback) {
self.documentPickerClosedCallback(nil); // self.documentPickerClosedCallback(nil);
} // }
} //}
@end //@end
@@ -6,8 +6,9 @@
#import <UserNotifications/UserNotifications.h> #import <UserNotifications/UserNotifications.h>
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
#import <UIKit/UIKit.h> //#import <UIKit/UIKit.h>
/*
@interface IOSNotificationDelegate @interface IOSNotificationDelegate
: UIResponder <UIApplicationDelegate, UNUserNotificationCenterDelegate> { : UIResponder <UIApplicationDelegate, UNUserNotificationCenterDelegate> {
IOSNotificationHandler* m_iosNotificationHandler; IOSNotificationHandler* m_iosNotificationHandler;
@@ -86,4 +87,4 @@ void IOSNotificationHandler::notify(NotificationHandler::Message type, const QSt
NSLog(@"Local Notification failed"); NSLog(@"Local Notification failed");
} }
}]; }];
} }*/
@@ -139,7 +139,7 @@ bool WireguardUtilsLinux::addInterface(const InterfaceConfig& config) {
if (config.m_killSwitchEnabled) { if (config.m_killSwitchEnabled) {
FirewallParams params { }; FirewallParams params { };
params.dnsServers.append(config.m_dnsServer); params.dnsServers.append(config.m_dnsServer);
if (config.m_allowedIPAddressRanges.contains(IPAddress("0.0.0.0/0"))) { if (config.m_allowedIPAddressRanges.at(0).toString() == "0.0.0.0/0"){
params.blockAll = true; params.blockAll = true;
if (config.m_excludedAddresses.size()) { if (config.m_excludedAddresses.size()) {
params.allowNets = true; params.allowNets = true;
@@ -137,8 +137,7 @@ bool WireguardUtilsMacos::addInterface(const InterfaceConfig& config) {
if (config.m_killSwitchEnabled) { if (config.m_killSwitchEnabled) {
FirewallParams params { }; FirewallParams params { };
params.dnsServers.append(config.m_dnsServer); params.dnsServers.append(config.m_dnsServer);
if (config.m_allowedIPAddressRanges.at(0).toString() == "0.0.0.0/0"){
if (config.m_allowedIPAddressRanges.contains(IPAddress("0.0.0.0/0"))) {
params.blockAll = true; params.blockAll = true;
if (config.m_excludedAddresses.size()) { if (config.m_excludedAddresses.size()) {
params.allowNets = true; params.allowNets = true;
+1 -1
View File
@@ -26,7 +26,7 @@ private:
#ifndef Q_OS_IOS #ifndef Q_OS_IOS
QProcess m_ckProcess; QProcess m_ckProcess;
#endif #endif
QTemporaryFile m_cloakCfgFile; // QTemporaryFile m_cloakCfgFile;
QMetaObject::Connection m_errorHandlerConnection; QMetaObject::Connection m_errorHandlerConnection;
}; };
+2 -2
View File
@@ -45,7 +45,7 @@ private:
ManagementServer m_managementServer; ManagementServer m_managementServer;
QString m_configFileName; QString m_configFileName;
QJsonObject m_configData; QJsonObject m_configData;
QTemporaryFile m_configFile; // QTemporaryFile m_configFile;
uint selectMgmtPort(); uint selectMgmtPort();
@@ -53,7 +53,7 @@ private:
void updateRouteGateway(QString line); void updateRouteGateway(QString line);
void updateVpnGateway(const QString &line); void updateVpnGateway(const QString &line);
QSharedPointer<PrivilegedProcess> m_openVpnProcess; // QSharedPointer<PrivilegedProcess> m_openVpnProcess;
}; };
#endif // OPENVPNPROTOCOL_H #endif // OPENVPNPROTOCOL_H
+3 -1
View File
@@ -5,6 +5,8 @@
#include "QProcess" #include "QProcess"
#include "containers/containers_defs.h" #include "containers/containers_defs.h"
#define Q_OS_IOS 1
class ShadowSocksVpnProtocol : public OpenVpnProtocol class ShadowSocksVpnProtocol : public OpenVpnProtocol
{ {
public: public:
@@ -27,7 +29,7 @@ private:
#ifndef Q_OS_IOS #ifndef Q_OS_IOS
QProcess m_ssProcess; QProcess m_ssProcess;
#endif #endif
QTemporaryFile m_shadowSocksCfgFile; // QTemporaryFile m_shadowSocksCfgFile;
}; };
#endif // SHADOWSOCKSVPNPROTOCOL_H #endif // SHADOWSOCKSVPNPROTOCOL_H
+2 -16
View File
@@ -1,16 +1,11 @@
#include <QDebug> #include <QDebug>
#include <QTimer> #include <QTimer>
#define Q_OS_IOS 1
#include "core/errorstrings.h" #include "core/errorstrings.h"
#include "vpnprotocol.h" #include "vpnprotocol.h"
#if defined(Q_OS_WINDOWS) || defined(Q_OS_MACX) || (defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID))
#include "openvpnovercloakprotocol.h"
#include "openvpnprotocol.h"
#include "shadowsocksvpnprotocol.h"
#include "wireguardprotocol.h"
#include "xrayprotocol.h"
#endif
#ifdef Q_OS_WINDOWS #ifdef Q_OS_WINDOWS
#include "ikev2_vpn_protocol_windows.h" #include "ikev2_vpn_protocol_windows.h"
@@ -108,15 +103,6 @@ VpnProtocol *VpnProtocol::factory(DockerContainer container, const QJsonObject &
switch (container) { switch (container) {
#if defined(Q_OS_WINDOWS) #if defined(Q_OS_WINDOWS)
case DockerContainer::Ipsec: return new Ikev2Protocol(configuration); 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))
case DockerContainer::OpenVpn: return new OpenVpnProtocol(configuration);
case DockerContainer::Cloak: return new OpenVpnOverCloakProtocol(configuration);
case DockerContainer::ShadowSocks: return new ShadowSocksVpnProtocol(configuration);
case DockerContainer::WireGuard: return new WireguardProtocol(configuration);
case DockerContainer::Awg: return new WireguardProtocol(configuration);
case DockerContainer::Xray: return new XrayProtocol(configuration);
case DockerContainer::SSXray: return new XrayProtocol(configuration);
#endif #endif
default: return nullptr; default: return nullptr;
} }
-2
View File
@@ -239,8 +239,6 @@
<file>images/controls/alert-circle.svg</file> <file>images/controls/alert-circle.svg</file>
<file>images/controls/file-check-2.svg</file> <file>images/controls/file-check-2.svg</file>
<file>ui/qml/Controls2/WarningType.qml</file> <file>ui/qml/Controls2/WarningType.qml</file>
<file>ui/qml/Modules/Style/qmldir</file>
<file>ui/qml/Modules/Style/AmneziaStyle.qml</file>
<file>ui/qml/Pages2/PageServiceSocksProxySettings.qml</file> <file>ui/qml/Pages2/PageServiceSocksProxySettings.qml</file>
<file>server_scripts/socks5_proxy/run_container.sh</file> <file>server_scripts/socks5_proxy/run_container.sh</file>
<file>server_scripts/socks5_proxy/Dockerfile</file> <file>server_scripts/socks5_proxy/Dockerfile</file>
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -1,5 +1,7 @@
#include "connectionController.h" #include "connectionController.h"
#define Q_OS_IOS 1
#if defined(Q_OS_ANDROID) || defined(Q_OS_IOS) #if defined(Q_OS_ANDROID) || defined(Q_OS_IOS)
#include <QGuiApplication> #include <QGuiApplication>
#else #else
+25 -19
View File
@@ -197,7 +197,19 @@ bool ImportController::extractConfigFromData(QString data)
bool ImportController::extractConfigFromQr(const QByteArray &data) bool ImportController::extractConfigFromQr(const QByteArray &data)
{ {
return extractConfigFromData(data.toBase64(QByteArray::Base64UrlEncoding | QByteArray::OmitTrailingEquals)); QJsonObject dataObj = QJsonDocument::fromJson(data).object();
if (!dataObj.isEmpty()) {
m_config = dataObj;
return true;
}
QByteArray ba_uncompressed = qUncompress(data);
if (!ba_uncompressed.isEmpty()) {
m_config = QJsonDocument::fromJson(ba_uncompressed).object();
return true;
}
return false;
} }
QString ImportController::getConfig() QString ImportController::getConfig()
@@ -521,12 +533,8 @@ void ImportController::startDecodingQr()
#endif #endif
} }
void ImportController::stopDecodingQr(const QByteArray &data) void ImportController::stopDecodingQr()
{ {
if (!extractConfigFromQr(data)) {
emit qrDecodingError(ErrorCode::ImportQrDecodingError);
return;
}
emit qrDecodingFinished(); emit qrDecodingFinished();
} }
@@ -563,27 +571,25 @@ bool ImportController::parseQrCodeChunk(const QString &code)
data.append(m_qrCodeChunks.value(i)); data.append(m_qrCodeChunks.value(i));
} }
data = qUncompress(data); bool ok = extractConfigFromQr(data);
auto format = checkConfigFormat(data); if (ok) {
if (format == ConfigTypes::Invalid) { m_isQrCodeProcessed = false;
qDebug() << "stopDecodingQr";
stopDecodingQr();
return true;
} else {
qDebug() << "error while extracting data from qr"; qDebug() << "error while extracting data from qr";
m_qrCodeChunks.clear(); m_qrCodeChunks.clear();
m_totalQrCodeChunksCount = 0; m_totalQrCodeChunksCount = 0;
m_receivedQrCodeChunksCount = 0; m_receivedQrCodeChunksCount = 0;
} else {
qDebug() << "stopDecodingQr";
m_isQrCodeProcessed = false;
stopDecodingQr(data);
return true;
} }
} }
} else { } else {
auto data = code.toUtf8(); bool ok = extractConfigFromQr(ba);
auto format = checkConfigFormat(data); if (ok) {
if (format != ConfigTypes::Invalid) {
qDebug() << "stopDecodingQr";
m_isQrCodeProcessed = false; m_isQrCodeProcessed = false;
stopDecodingQr(data); qDebug() << "stopDecodingQr";
stopDecodingQr();
return true; return true;
} }
} }
+1 -5
View File
@@ -61,10 +61,6 @@ signals:
void restoreAppConfig(const QByteArray &data); void restoreAppConfig(const QByteArray &data);
#if defined Q_OS_ANDROID || defined Q_OS_IOS
void qrDecodingError(ErrorCode errorCode);
#endif
private: private:
QJsonObject extractOpenVpnConfig(const QString &data); QJsonObject extractOpenVpnConfig(const QString &data);
QJsonObject extractWireGuardConfig(const QString &data); QJsonObject extractWireGuardConfig(const QString &data);
@@ -73,7 +69,7 @@ private:
void checkForMaliciousStrings(const QJsonObject &protocolConfig); void checkForMaliciousStrings(const QJsonObject &protocolConfig);
#if defined Q_OS_ANDROID || defined Q_OS_IOS #if defined Q_OS_ANDROID || defined Q_OS_IOS
void stopDecodingQr(const QByteArray &data); void stopDecodingQr();
#endif #endif
QSharedPointer<ServersModel> m_serversModel; QSharedPointer<ServersModel> m_serversModel;
+5 -3
View File
@@ -2,6 +2,8 @@
#include "utils/converter.h" #include "utils/converter.h"
#include "core/errorstrings.h" #include "core/errorstrings.h"
#define Q_OS_IOS 1
#if defined(Q_OS_ANDROID) || defined(Q_OS_IOS) #if defined(Q_OS_ANDROID) || defined(Q_OS_IOS)
#include <QGuiApplication> #include <QGuiApplication>
#else #else
@@ -37,8 +39,8 @@ PageController::PageController(const QSharedPointer<ServersModel> &serversModel,
#endif #endif
#if defined Q_OS_MACX #if defined Q_OS_MACX
connect(this, &PageController::raiseMainWindow, []() { setDockIconVisible(true); }); // connect(this, &PageController::raiseMainWindow, []() { setDockIconVisible(true); });
connect(this, &PageController::hideMainWindow, []() { setDockIconVisible(false); }); // connect(this, &PageController::hideMainWindow, []() { setDockIconVisible(false); });
#endif #endif
connect(this, qOverload<ErrorCode>(&PageController::showErrorMessage), this, &PageController::onShowErrorMessage); connect(this, qOverload<ErrorCode>(&PageController::showErrorMessage), this, &PageController::onShowErrorMessage);
@@ -134,7 +136,7 @@ void PageController::showOnStartup()
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
emit hideMainWindow(); emit hideMainWindow();
#elif defined Q_OS_MACX #elif defined Q_OS_MACX
setDockIconVisible(false); // setDockIconVisible(false);
#endif #endif
} }
} }
+3 -1
View File
@@ -5,6 +5,8 @@
#include <QDebug> #include <QDebug>
#include "notificationhandler.h" #include "notificationhandler.h"
#define Q_OS_IOS 1
#if defined(Q_OS_IOS) #if defined(Q_OS_IOS)
# include "platforms/ios/iosnotificationhandler.h" # include "platforms/ios/iosnotificationhandler.h"
#else #else
@@ -14,7 +16,7 @@
// static // static
NotificationHandler* NotificationHandler::create(QObject* parent) { NotificationHandler* NotificationHandler::create(QObject* parent) {
#if defined(Q_OS_IOS) #if defined(Q_OS_IOS)
return new IOSNotificationHandler(parent); return nullptr;//new IOSNotificationHandler(parent);
#else #else
# if defined(Q_OS_LINUX) # if defined(Q_OS_LINUX)
+10 -11
View File
@@ -6,14 +6,13 @@ import Qt5Compat.GraphicalEffects
import ConnectionState 1.0 import ConnectionState 1.0
import PageEnum 1.0 import PageEnum 1.0
import Style 1.0
Button { Button {
id: root id: root
property string defaultButtonColor: AmneziaStyle.color.white property string defaultButtonColor: "#D7D8DB"
property string progressButtonColor: AmneziaStyle.color.white property string progressButtonColor: "#D7D8DB"
property string connectedButtonColor: AmneziaStyle.color.orange property string connectedButtonColor: "#FBB26A"
implicitWidth: 190 implicitWidth: 190
implicitHeight: 190 implicitHeight: 190
@@ -50,13 +49,13 @@ Button {
verticalOffset: 0 verticalOffset: 0
radius: 10 radius: 10
samples: 25 samples: 25
color: root.activeFocus ? AmneziaStyle.color.white : AmneziaStyle.color.orange color: root.activeFocus ? "#D7D8DB" : "#FBB26A"
source: backgroundCircle source: backgroundCircle
} }
ShapePath { ShapePath {
fillColor: AmneziaStyle.color.transparent fillColor: "transparent"
strokeColor: AmneziaStyle.color.white strokeColor: "#D7D8DB"
strokeWidth: root.activeFocus ? 1 : 0 strokeWidth: root.activeFocus ? 1 : 0
capStyle: ShapePath.RoundCap capStyle: ShapePath.RoundCap
@@ -71,10 +70,10 @@ Button {
} }
ShapePath { ShapePath {
fillColor: AmneziaStyle.color.transparent fillColor: "transparent"
strokeColor: { strokeColor: {
if (ConnectionController.isConnectionInProgress) { if (ConnectionController.isConnectionInProgress) {
return AmneziaStyle.color.connectionInProgress return "#261E1A"
} else if (ConnectionController.isConnected) { } else if (ConnectionController.isConnected) {
return connectedButtonColor return connectedButtonColor
} else { } else {
@@ -114,8 +113,8 @@ Button {
visible: ConnectionController.isConnectionInProgress visible: ConnectionController.isConnectionInProgress
ShapePath { ShapePath {
fillColor: AmneziaStyle.color.transparent fillColor: "transparent"
strokeColor: AmneziaStyle.color.white strokeColor: "#D7D8DB"
strokeWidth: 3 strokeWidth: 3
capStyle: ShapePath.RoundCap capStyle: ShapePath.RoundCap
@@ -8,7 +8,6 @@ import "../Controls2/TextTypes"
import SortFilterProxyModel 0.2 import SortFilterProxyModel 0.2
import InstalledAppsModel 1.0 import InstalledAppsModel 1.0
import Style 1.0
DrawerType2 { DrawerType2 {
id: root id: root
@@ -134,7 +133,7 @@ DrawerType2 {
anchors.rightMargin: 16 anchors.rightMargin: 16
anchors.leftMargin: 16 anchors.leftMargin: 16
backgroundColor: AmneziaStyle.color.greyDark backgroundColor: "#2C2D30"
textFieldPlaceholderText: qsTr("application name") textFieldPlaceholderText: qsTr("application name")
} }
+5 -7
View File
@@ -2,8 +2,6 @@ import QtQuick
import QtQuick.Controls import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
import Style 1.0
import "../Controls2" import "../Controls2"
import "../Controls2/TextTypes" import "../Controls2/TextTypes"
@@ -88,11 +86,11 @@ DrawerType2 {
Layout.rightMargin: 16 Layout.rightMargin: 16
Layout.leftMargin: 16 Layout.leftMargin: 16
defaultColor: AmneziaStyle.color.transparent defaultColor: "transparent"
hoveredColor: AmneziaStyle.color.blackHovered hoveredColor: Qt.rgba(1, 1, 1, 0.08)
pressedColor: AmneziaStyle.color.blackPressed pressedColor: Qt.rgba(1, 1, 1, 0.12)
disabledColor: AmneziaStyle.color.grey disabledColor: "#878B91"
textColor: AmneziaStyle.color.white textColor: "#D7D8DB"
borderWidth: 1 borderWidth: 1
text: noButtonText text: noButtonText
@@ -2,8 +2,6 @@ import QtQuick
import QtQuick.Controls import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
import Style 1.0
import "../Controls2" import "../Controls2"
import "../Controls2/TextTypes" import "../Controls2/TextTypes"
import "../Config" import "../Config"
@@ -147,8 +145,8 @@ DrawerType2 {
indicator: Rectangle { indicator: Rectangle {
width: parent.width - 1 width: parent.width - 1
height: parent.height height: parent.height
color: radioButton.hovered ? AmneziaStyle.color.greyDark : AmneziaStyle.color.blackLight color: radioButton.hovered ? "#2C2D30" : "#1C1D21"
border.color: radioButton.focus ? AmneziaStyle.color.white : AmneziaStyle.color.transparent border.color: radioButton.focus ? "#D7D8DB" : "transparent"
border.width: radioButton.focus ? 1 : 0 border.width: radioButton.focus ? 1 : 0
Behavior on color { Behavior on color {
@@ -9,7 +9,6 @@ import SortFilterProxyModel 0.2
import PageEnum 1.0 import PageEnum 1.0
import ContainerProps 1.0 import ContainerProps 1.0
import Style 1.0
import "./" import "./"
import "../Controls2" import "../Controls2"
@@ -112,11 +111,11 @@ DrawerType2 {
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 8 Layout.topMargin: 8
defaultColor: AmneziaStyle.color.transparent defaultColor: "transparent"
hoveredColor: AmneziaStyle.color.blackHovered hoveredColor: Qt.rgba(1, 1, 1, 0.08)
pressedColor: AmneziaStyle.color.blackPressed pressedColor: Qt.rgba(1, 1, 1, 0.12)
disabledColor: AmneziaStyle.color.grey disabledColor: "#878B91"
textColor: AmneziaStyle.color.white textColor: "#D7D8DB"
borderWidth: 1 borderWidth: 1
text: qsTr("Copy") text: qsTr("Copy")
@@ -135,11 +134,11 @@ DrawerType2 {
visible: false visible: false
defaultColor: AmneziaStyle.color.transparent defaultColor: "transparent"
hoveredColor: AmneziaStyle.color.blackHovered hoveredColor: Qt.rgba(1, 1, 1, 0.08)
pressedColor: AmneziaStyle.color.blackPressed pressedColor: Qt.rgba(1, 1, 1, 0.12)
disabledColor: AmneziaStyle.color.grey disabledColor: "#878B91"
textColor: AmneziaStyle.color.white textColor: "#D7D8DB"
borderWidth: 1 borderWidth: 1
text: qsTr("Copy config string") text: qsTr("Copy config string")
@@ -154,11 +153,11 @@ DrawerType2 {
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 24 Layout.topMargin: 24
defaultColor: AmneziaStyle.color.transparent defaultColor: "transparent"
hoveredColor: AmneziaStyle.color.blackHovered hoveredColor: Qt.rgba(1, 1, 1, 0.08)
pressedColor: AmneziaStyle.color.blackPressed pressedColor: Qt.rgba(1, 1, 1, 0.12)
disabledColor: AmneziaStyle.color.grey disabledColor: "#878B91"
textColor: AmneziaStyle.color.white textColor: "#D7D8DB"
borderWidth: 1 borderWidth: 1
text: qsTr("Show connection settings") text: qsTr("Show connection settings")
@@ -282,9 +281,9 @@ DrawerType2 {
readOnly: true readOnly: true
activeFocusOnTab: false activeFocusOnTab: false
color: AmneziaStyle.color.white color: "#D7D8DB"
selectionColor: AmneziaStyle.color.brown selectionColor: "#633303"
selectedTextColor: AmneziaStyle.color.white selectedTextColor: "#D7D8DB"
font.pixelSize: 16 font.pixelSize: 16
font.weight: Font.Medium font.weight: Font.Medium
@@ -295,7 +294,7 @@ DrawerType2 {
wrapMode: Text.Wrap wrapMode: Text.Wrap
background: Rectangle { background: Rectangle {
color: AmneziaStyle.color.transparent color: "transparent"
} }
} }
} }
@@ -2,8 +2,6 @@ import QtQuick
import QtQuick.Controls import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
import Style 1.0
import "../Controls2" import "../Controls2"
import "../Controls2/TextTypes" import "../Controls2/TextTypes"
@@ -16,7 +14,7 @@ Rectangle {
implicitWidth: transportProtoButtonGroup.implicitWidth implicitWidth: transportProtoButtonGroup.implicitWidth
implicitHeight: transportProtoButtonGroup.implicitHeight implicitHeight: transportProtoButtonGroup.implicitHeight
color: AmneziaStyle.color.blackLight color: "#1C1D21"
radius: 16 radius: 16
onFocusChanged: { onFocusChanged: {
+2 -4
View File
@@ -2,8 +2,6 @@ import QtQuick
import QtQuick.Layouts import QtQuick.Layouts
import Qt5Compat.GraphicalEffects import Qt5Compat.GraphicalEffects
import Style 1.0
Item { Item {
id: root id: root
@@ -30,7 +28,7 @@ Item {
ImageButtonType { ImageButtonType {
id: backButton id: backButton
image: backButtonImage image: backButtonImage
imageColor: AmneziaStyle.color.white imageColor: "#D7D8DB"
implicitWidth: 40 implicitWidth: 40
implicitHeight: 40 implicitHeight: 40
@@ -48,7 +46,7 @@ Item {
id: background id: background
Layout.fillWidth: true Layout.fillWidth: true
color: AmneziaStyle.color.transparent color: "transparent"
} }
} }
+9 -11
View File
@@ -3,22 +3,20 @@ import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
import Qt5Compat.GraphicalEffects import Qt5Compat.GraphicalEffects
import Style 1.0
import "TextTypes" import "TextTypes"
Button { Button {
id: root id: root
property string hoveredColor: AmneziaStyle.color.whiteHovered property string hoveredColor: "#C1C2C5"
property string defaultColor: AmneziaStyle.color.white property string defaultColor: "#D7D8DB"
property string disabledColor: AmneziaStyle.color.greyDisabled property string disabledColor: "#494B50"
property string pressedColor: AmneziaStyle.color.grey property string pressedColor: "#979799"
property string textColor: AmneziaStyle.color.black property string textColor: "#0E0E11"
property string borderColor: AmneziaStyle.color.white property string borderColor: "#D7D8DB"
property string borderFocusedColor: AmneziaStyle.color.white property string borderFocusedColor: "#D7D8DB"
property int borderWidth: 0 property int borderWidth: 0
property int borderFocusedWidth: 1 property int borderFocusedWidth: 1
@@ -48,8 +46,8 @@ Button {
background: Rectangle { background: Rectangle {
id: focusBorder id: focusBorder
color: AmneziaStyle.color.transparent color: "transparent"
border.color: root.activeFocus ? root.borderFocusedColor : AmneziaStyle.color.transparent border.color: root.activeFocus ? root.borderFocusedColor : "transparent"
border.width: root.activeFocus ? root.borderFocusedWidth : 0 border.width: root.activeFocus ? root.borderFocusedWidth : 0
anchors.fill: parent anchors.fill: parent
@@ -2,8 +2,6 @@ import QtQuick
import QtQuick.Controls import QtQuick.Controls
import QtQuick.Shapes import QtQuick.Shapes
import Style 1.0
Popup { Popup {
id: root id: root
anchors.centerIn: parent anchors.centerIn: parent
@@ -18,7 +16,7 @@ Popup {
} }
background: Rectangle { background: Rectangle {
color: AmneziaStyle.color.transparent color: "transparent"
} }
BusyIndicator { BusyIndicator {
@@ -42,8 +40,8 @@ Popup {
layer.samples: 4 layer.samples: 4
ShapePath { ShapePath {
fillColor: AmneziaStyle.color.transparent fillColor: "transparent"
strokeColor: AmneziaStyle.color.greyDisabled strokeColor: "#787878"
strokeWidth: 3 strokeWidth: 3
capStyle: ShapePath.RoundCap capStyle: ShapePath.RoundCap
+11 -13
View File
@@ -2,8 +2,6 @@ import QtQuick
import QtQuick.Controls import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
import Style 1.0
RadioButton { RadioButton {
id: root id: root
@@ -11,17 +9,17 @@ RadioButton {
property string bodyText property string bodyText
property string footerText property string footerText
property string hoveredColor: AmneziaStyle.color.blackHovered property string hoveredColor: Qt.rgba(1, 1, 1, 0.05)
property string defaultColor: AmneziaStyle.color.transparent property string defaultColor: Qt.rgba(1, 1, 1, 0)
property string disabledColor: AmneziaStyle.color.transparent property string disabledColor: Qt.rgba(1, 1, 1, 0)
property string pressedColor: AmneziaStyle.color.blackPressed property string pressedColor: Qt.rgba(1, 1, 1, 0.05)
property string selectedColor: AmneziaStyle.color.transparent property string selectedColor: Qt.rgba(1, 1, 1, 0)
property string textColor: AmneziaStyle.color.black property string textColor: "#0E0E11"
property string pressedBorderColor: Qt.rgba(251/255, 178/255, 106/255, 0.3) property string pressedBorderColor: Qt.rgba(251/255, 178/255, 106/255, 0.3)
property string selectedBorderColor: AmneziaStyle.color.orange property string selectedBorderColor: "#FBB26A"
property string defaultBodredColor: AmneziaStyle.color.transparent property string defaultBodredColor: "transparent"
property int borderWidth: 0 property int borderWidth: 0
implicitWidth: content.implicitWidth implicitWidth: content.implicitWidth
@@ -84,7 +82,7 @@ RadioButton {
Text { Text {
text: root.headerText text: root.headerText
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
color: AmneziaStyle.color.white color: "#D7D8DB"
font.pixelSize: 25 font.pixelSize: 25
font.weight: 700 font.weight: 700
font.family: "PT Root UI VF" font.family: "PT Root UI VF"
@@ -99,7 +97,7 @@ RadioButton {
Text { Text {
text: root.bodyText text: root.bodyText
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
color: AmneziaStyle.color.white color: "#D7D8DB"
font.pixelSize: 16 font.pixelSize: 16
font.weight: 400 font.weight: 400
font.family: "PT Root UI VF" font.family: "PT Root UI VF"
@@ -115,7 +113,7 @@ RadioButton {
text: root.footerText text: root.footerText
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
visible: root.footerText !== "" visible: root.footerText !== ""
color: AmneziaStyle.color.grey color: "#878B91"
font.pixelSize: 13 font.pixelSize: 13
font.weight: 400 font.weight: 400
font.family: "PT Root UI VF" font.family: "PT Root UI VF"
+18 -20
View File
@@ -3,34 +3,32 @@ import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
import Qt5Compat.GraphicalEffects import Qt5Compat.GraphicalEffects
import Style 1.0
import "TextTypes" import "TextTypes"
CheckBox { CheckBox {
id: root id: root
property string descriptionText property string descriptionText
property string descriptionTextColor: AmneziaStyle.color.grey property string descriptionTextColor: "#878B91"
property string descriptionTextDisabledColor: AmneziaStyle.color.greyDisabled property string descriptionTextDisabledColor: "#494B50"
property string textColor: AmneziaStyle.color.white property string textColor: "#D7D8DB"
property string textDisabledColor: AmneziaStyle.color.grey property string textDisabledColor: "#878B91"
property string hoveredColor: AmneziaStyle.color.blackHovered property string hoveredColor: Qt.rgba(1, 1, 1, 0.05)
property string defaultColor: AmneziaStyle.color.transparent property string defaultColor: "transparent"
property string pressedColor: AmneziaStyle.color.blackPressed property string pressedColor: Qt.rgba(1, 1, 1, 0.05)
property string defaultBorderColor: AmneziaStyle.color.white property string defaultBorderColor: "#D7D8DB"
property string checkedBorderColor: AmneziaStyle.color.orange property string checkedBorderColor: "#FBB26A"
property string checkedBorderDisabledColor: AmneziaStyle.color.brownDark property string checkedBorderDisabledColor: "#402102"
property string borderFocusedColor: AmneziaStyle.color.white property string borderFocusedColor: "#D7D8DB"
property string checkedImageColor: AmneziaStyle.color.orange property string checkedImageColor: "#FBB26A"
property string pressedImageColor: AmneziaStyle.color.orangeDark property string pressedImageColor: "#A85809"
property string defaultImageColor: AmneziaStyle.color.transparent property string defaultImageColor: "transparent"
property string checkedDisabledImageColor: AmneziaStyle.color.brownLight property string checkedDisabledImageColor: "#84603D"
property string imageSource: "qrc:/images/controls/check.svg" property string imageSource: "qrc:/images/controls/check.svg"
@@ -47,8 +45,8 @@ CheckBox {
focusPolicy: Qt.NoFocus focusPolicy: Qt.NoFocus
background: Rectangle { background: Rectangle {
color: AmneziaStyle.color.transparent color: "transparent"
border.color: root.focus ? borderFocusedColor : AmneziaStyle.color.transparent border.color: root.focus ? borderFocusedColor : "transparent"
border.width: 1 border.width: 1
radius: 16 radius: 16
} }
@@ -79,7 +77,7 @@ CheckBox {
anchors.centerIn: parent anchors.centerIn: parent
width: 24 width: 24
height: 24 height: 24
color: AmneziaStyle.color.transparent color: "transparent"
border.color: root.checked ? border.color: root.checked ?
(root.enabled ? (root.enabled ?
checkedBorderColor : checkedBorderColor :
+1 -3
View File
@@ -1,8 +1,6 @@
import QtQuick import QtQuick
import QtQuick.Layouts import QtQuick.Layouts
import Style 1.0
Rectangle { Rectangle {
Layout.fillWidth: true Layout.fillWidth: true
@@ -10,5 +8,5 @@ Rectangle {
Layout.rightMargin: 16 Layout.rightMargin: 16
height: 1 height: 1
color: AmneziaStyle.color.greyDark color: "#2C2D30"
} }
+3 -5
View File
@@ -2,8 +2,6 @@ import QtQuick
import QtQuick.Controls import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
import Style 1.0
import "TextTypes" import "TextTypes"
Item { Item {
@@ -21,8 +19,8 @@ Item {
property Component collapsedContent property Component collapsedContent
property Component expandedContent property Component expandedContent
property string defaultColor: AmneziaStyle.color.blackLight property string defaultColor: "#1C1D21"
property string borderColor: AmneziaStyle.color.greyDark property string borderColor: "#2C2D30"
property real expandedHeight property real expandedHeight
property real collapsedHeight: 0 property real collapsedHeight: 0
@@ -92,7 +90,7 @@ Item {
id: background id: background
anchors.fill: parent anchors.fill: parent
color: root.isCollapsed ? AmneziaStyle.color.transparent : Qt.rgba(14/255, 14/255, 17/255, 0.8) color: root.isCollapsed ? "transparent" : Qt.rgba(14/255, 14/255, 17/255, 0.8)
Behavior on color { Behavior on color {
PropertyAnimation { duration: 200 } PropertyAnimation { duration: 200 }
+15 -17
View File
@@ -2,8 +2,6 @@ import QtQuick
import QtQuick.Controls import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
import Style 1.0
import "TextTypes" import "TextTypes"
import "../Config" import "../Config"
@@ -11,31 +9,31 @@ Item {
id: root id: root
property string text property string text
property string textColor: AmneziaStyle.color.white property string textColor: "#d7d8db"
property string textDisabledColor: AmneziaStyle.color.grey property string textDisabledColor: "#878B91"
property int textMaximumLineCount: 2 property int textMaximumLineCount: 2
property int textElide: Qt.ElideRight property int textElide: Qt.ElideRight
property string descriptionText property string descriptionText
property string descriptionTextColor: AmneziaStyle.color.grey property string descriptionTextColor: "#878B91"
property string descriptionTextDisabledColor: AmneziaStyle.color.greyDisabled property string descriptionTextDisabledColor: "#494B50"
property string headerText property string headerText
property string headerBackButtonImage property string headerBackButtonImage
property var rootButtonClickedFunction property var rootButtonClickedFunction
property string rootButtonImage: "qrc:/images/controls/chevron-down.svg" property string rootButtonImage: "qrc:/images/controls/chevron-down.svg"
property string rootButtonImageColor: AmneziaStyle.color.white property string rootButtonImageColor: "#D7D8DB"
property string rootButtonBackgroundColor: AmneziaStyle.color.blackLight property string rootButtonBackgroundColor: "#1C1D21"
property string rootButtonBackgroundHoveredColor: AmneziaStyle.color.blackLight property string rootButtonBackgroundHoveredColor: "#1C1D21"
property string rootButtonBackgroundPressedColor: AmneziaStyle.color.blackLight property string rootButtonBackgroundPressedColor: "#1C1D21"
property string borderFocusedColor: AmneziaStyle.color.white property string borderFocusedColor: "#D7D8DB"
property int borderFocusedWidth: 1 property int borderFocusedWidth: 1
property string rootButtonHoveredBorderColor: AmneziaStyle.color.greyDisabled property string rootButtonHoveredBorderColor: "#494B50"
property string rootButtonDefaultBorderColor: AmneziaStyle.color.greyDark property string rootButtonDefaultBorderColor: "#2C2D30"
property string rootButtonPressedBorderColor: AmneziaStyle.color.white property string rootButtonPressedBorderColor: "#D7D8DB"
property int rootButtonTextLeftMargins: 16 property int rootButtonTextLeftMargins: 16
property int rootButtonTextTopMargin: 16 property int rootButtonTextTopMargin: 16
@@ -77,8 +75,8 @@ Item {
Rectangle { Rectangle {
id: focusBorder id: focusBorder
color: AmneziaStyle.color.transparent color: "transparent"
border.color: root.activeFocus ? root.borderFocusedColor : AmneziaStyle.color.transparent border.color: root.activeFocus ? root.borderFocusedColor : "transparent"
border.width: root.activeFocus ? root.borderFocusedWidth : 0 border.width: root.activeFocus ? root.borderFocusedWidth : 0
anchors.fill: rootButtonContent anchors.fill: rootButtonContent
radius: 16 radius: 16
@@ -98,7 +96,7 @@ Item {
} }
return root.hovered ? root.rootButtonBackgroundHoveredColor : root.rootButtonBackgroundColor return root.hovered ? root.rootButtonBackgroundHoveredColor : root.rootButtonBackgroundColor
} else { } else {
return AmneziaStyle.color.transparent return "transparent"
} }
} }
+2 -4
View File
@@ -1,8 +1,6 @@
import QtQuick import QtQuick
import QtQuick.Layouts import QtQuick.Layouts
import Style 1.0
import "TextTypes" import "TextTypes"
Item { Item {
@@ -39,7 +37,7 @@ Item {
implicitHeight: 40 implicitHeight: 40
image: root.actionButtonImage image: root.actionButtonImage
imageColor: AmneziaStyle.color.white imageColor: "#D7D8DB"
visible: image ? true : false visible: image ? true : false
@@ -59,7 +57,7 @@ Item {
text: root.descriptionText text: root.descriptionText
color: AmneziaStyle.color.grey color: "#878B91"
visible: root.descriptionText !== "" visible: root.descriptionText !== ""
} }
+2 -4
View File
@@ -1,8 +1,6 @@
import QtQuick import QtQuick
import QtQuick.Layouts import QtQuick.Layouts
import Style 1.0
import "TextTypes" import "TextTypes"
Item { Item {
@@ -48,7 +46,7 @@ Item {
Layout.alignment: Qt.AlignRight Layout.alignment: Qt.AlignRight
image: root.actionButtonImage image: root.actionButtonImage
imageColor: AmneziaStyle.color.white imageColor: "#D7D8DB"
visible: image ? true : false visible: image ? true : false
@@ -68,7 +66,7 @@ Item {
text: root.descriptionText text: root.descriptionText
color: AmneziaStyle.color.grey color: "#878B91"
visible: root.descriptionText !== "" visible: root.descriptionText !== ""
} }
@@ -2,26 +2,24 @@ import QtQuick
import QtQuick.Controls import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
import Style 1.0
import "TextTypes" import "TextTypes"
RadioButton { RadioButton {
id: root id: root
property string hoveredColor: AmneziaStyle.color.blackHovered property string hoveredColor: Qt.rgba(1, 1, 1, 0.05)
property string defaultColor: AmneziaStyle.color.transparent property string defaultColor: Qt.rgba(1, 1, 1, 0)
property string checkedColor: AmneziaStyle.color.transparent property string checkedColor: Qt.rgba(1, 1, 1, 0)
property string disabledColor: AmneziaStyle.color.transparent property string disabledColor: "transparent"
property string textColor: AmneziaStyle.color.white property string textColor: "#D7D8DB"
property string textDisabledColor: AmneziaStyle.color.grey property string textDisabledColor: "#878B91"
property string pressedBorderColor: AmneziaStyle.color.greyDisabled property string pressedBorderColor: "#494B50"
property string checkedBorderColor: AmneziaStyle.color.orange property string checkedBorderColor: "#FBB26A"
property string defaultBodredColor: AmneziaStyle.color.transparent property string defaultBodredColor: "transparent"
property string checkedDisabledBorderColor: AmneziaStyle.color.brownLight property string checkedDisabledBorderColor: "#84603D"
property string borderFocusedColor: AmneziaStyle.color.white property string borderFocusedColor: "#D7D8DB"
property int borderWidth: 0 property int borderWidth: 0
implicitWidth: content.implicitWidth implicitWidth: content.implicitWidth
+8 -10
View File
@@ -2,25 +2,23 @@ import QtQuick
import QtQuick.Controls import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
import Style 1.0
Button { Button {
id: root id: root
property string image property string image
property string hoveredColor: AmneziaStyle.color.blackHovered property string hoveredColor: Qt.rgba(1, 1, 1, 0.08)
property string defaultColor: AmneziaStyle.color.transparent property string defaultColor: "transparent"
property string pressedColor: AmneziaStyle.color.blackPressed property string pressedColor: Qt.rgba(1, 1, 1, 0.12)
property string disableColor: AmneziaStyle.color.greyDark property string disableColor: "#2C2D30"
property string imageColor: AmneziaStyle.color.grey property string imageColor: "#878B91"
property string disableImageColor: AmneziaStyle.color.greyDark property string disableImageColor: "#2C2D30"
property alias backgroundColor: background.color property alias backgroundColor: background.color
property alias backgroundRadius: background.radius property alias backgroundRadius: background.radius
property string borderFocusedColor: AmneziaStyle.color.white property string borderFocusedColor: "#D7D8DB"
property int borderFocusedWidth: 1 property int borderFocusedWidth: 1
hoverEnabled: true hoverEnabled: true
@@ -48,7 +46,7 @@ Button {
id: background id: background
anchors.fill: parent anchors.fill: parent
border.color: root.activeFocus ? root.borderFocusedColor : AmneziaStyle.color.transparent border.color: root.activeFocus ? root.borderFocusedColor : "transparent"
border.width: root.activeFocus ? root.borderFocusedWidth : 0 border.width: root.activeFocus ? root.borderFocusedWidth : 0
color: { color: {
+11 -13
View File
@@ -2,8 +2,6 @@ import QtQuick
import QtQuick.Controls import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
import Style 1.0
import "TextTypes" import "TextTypes"
Item { Item {
@@ -26,16 +24,16 @@ Item {
property alias eyeButton: eyeImage property alias eyeButton: eyeImage
property FlickableType parentFlickable property FlickableType parentFlickable
property string textColor: AmneziaStyle.color.white property string textColor: "#d7d8db"
property string textDisabledColor: AmneziaStyle.color.grey property string textDisabledColor: "#878B91"
property string descriptionColor: AmneziaStyle.color.grey property string descriptionColor: "#878B91"
property string descriptionDisabledColor: AmneziaStyle.color.greyDisabled property string descriptionDisabledColor: "#494B50"
property real textOpacity: 1.0 property real textOpacity: 1.0
property string borderFocusedColor: AmneziaStyle.color.white property string borderFocusedColor: "#D7D8DB"
property int borderFocusedWidth: 1 property int borderFocusedWidth: 1
property string rightImageColor: AmneziaStyle.color.white property string rightImageColor: "#d7d8db"
property bool descriptionOnTop: false property bool descriptionOnTop: false
property bool hideDescription: true property bool hideDescription: true
@@ -119,7 +117,7 @@ Item {
Layout.rightMargin: rightImageSource || !isLeftImageHoverEnabled ? 16 : 0 Layout.rightMargin: rightImageSource || !isLeftImageHoverEnabled ? 16 : 0
radius: 12 radius: 12
color: AmneziaStyle.color.transparent color: "transparent"
Behavior on color { Behavior on color {
PropertyAnimation { duration: 200 } PropertyAnimation { duration: 200 }
@@ -222,7 +220,7 @@ Item {
id: eyeImageBackground id: eyeImageBackground
anchors.fill: parent anchors.fill: parent
radius: 12 radius: 12
color: AmneziaStyle.color.transparent color: "transparent"
Behavior on color { Behavior on color {
PropertyAnimation { duration: 200 } PropertyAnimation { duration: 200 }
@@ -259,7 +257,7 @@ Item {
id: rightImageBackground id: rightImageBackground
anchors.fill: parent anchors.fill: parent
radius: 12 radius: 12
color: AmneziaStyle.color.transparent color: "transparent"
Behavior on color { Behavior on color {
PropertyAnimation { duration: 200 } PropertyAnimation { duration: 200 }
@@ -276,9 +274,9 @@ Item {
Rectangle { Rectangle {
id: background id: background
anchors.fill: root anchors.fill: root
color: AmneziaStyle.color.transparent color: "transparent"
border.color: root.activeFocus ? root.borderFocusedColor : AmneziaStyle.color.transparent border.color: root.activeFocus ? root.borderFocusedColor : "transparent"
border.width: root.activeFocus ? root.borderFocusedWidth : 0 border.width: root.activeFocus ? root.borderFocusedWidth : 0
@@ -2,8 +2,6 @@ import QtQuick
import QtQuick.Controls import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
import Style 1.0
import "TextTypes" import "TextTypes"
ListView { ListView {
@@ -105,8 +103,8 @@ ListView {
indicator: Rectangle { indicator: Rectangle {
width: parent.width - 1 width: parent.width - 1
height: parent.height height: parent.height
color: radioButton.hovered ? AmneziaStyle.color.greyDark : AmneziaStyle.color.blackLight color: radioButton.hovered ? "#2C2D30" : "#1C1D21"
border.color: radioButton.focus ? AmneziaStyle.color.white : AmneziaStyle.color.transparent border.color: radioButton.focus ? "#D7D8DB" : "transparent"
border.width: radioButton.focus ? 1 : 0 border.width: radioButton.focus ? 1 : 0
Behavior on color { Behavior on color {
+4 -6
View File
@@ -2,8 +2,6 @@ import QtQuick
import QtQuick.Controls import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
import Style 1.0
import "TextTypes" import "TextTypes"
Popup { Popup {
@@ -84,11 +82,11 @@ Popup {
implicitHeight: 32 implicitHeight: 32
defaultColor: "white" defaultColor: "white"
hoveredColor: AmneziaStyle.color.whiteHovered hoveredColor: "#C1C2C5"
pressedColor: AmneziaStyle.color.whiteHovered pressedColor: "#AEB0B7"
disabledColor: AmneziaStyle.color.greyDisabled disabledColor: "#494B50"
textColor: AmneziaStyle.color.black textColor: "#0E0E11"
borderWidth: 0 borderWidth: 0
text: qsTr("Close") text: qsTr("Close")
+2 -4
View File
@@ -2,22 +2,20 @@ import QtQuick
import QtQuick.Controls import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
import Style 1.0
ProgressBar { ProgressBar {
id: root id: root
implicitHeight: 4 implicitHeight: 4
background: Rectangle { background: Rectangle {
color: AmneziaStyle.color.brown color: "#633303"
} }
contentItem: Item { contentItem: Item {
Rectangle { Rectangle {
width: root.visualPosition * parent.width width: root.visualPosition * parent.width
height: parent.height height: parent.height
color: AmneziaStyle.color.orange color: "#FBB26A"
} }
} }
} }
+17 -19
View File
@@ -2,38 +2,36 @@ import QtQuick
import QtQuick.Controls import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
import Style 1.0
import "TextTypes" import "TextTypes"
Switch { Switch {
id: root id: root
property alias descriptionText: description.text property alias descriptionText: description.text
property string descriptionTextColor: AmneziaStyle.color.grey property string descriptionTextColor: "#878B91"
property string descriptionTextDisabledColor: AmneziaStyle.color.greyDisabled property string descriptionTextDisabledColor: "#494B50"
property string textColor: AmneziaStyle.color.white property string textColor: "#D7D8DB"
property string textDisabledColor: AmneziaStyle.color.grey property string textDisabledColor: "#878B91"
property string checkedIndicatorColor: AmneziaStyle.color.brown property string checkedIndicatorColor: "#633303"
property string defaultIndicatorColor: AmneziaStyle.color.transparent property string defaultIndicatorColor: "transparent"
property string checkedDisabledIndicatorColor: AmneziaStyle.color.brownDark property string checkedDisabledIndicatorColor: "#402102"
property string borderFocusedColor: AmneziaStyle.color.white property string borderFocusedColor: "#D7D8DB"
property int borderFocusedWidth: 1 property int borderFocusedWidth: 1
property string checkedIndicatorBorderColor: AmneziaStyle.color.brown property string checkedIndicatorBorderColor: "#633303"
property string defaultIndicatorBorderColor: AmneziaStyle.color.greyDisabled property string defaultIndicatorBorderColor: "#494B50"
property string checkedDisabledIndicatorBorderColor: AmneziaStyle.color.brownDark property string checkedDisabledIndicatorBorderColor: "#402102"
property string checkedInnerCircleColor: AmneziaStyle.color.orange property string checkedInnerCircleColor: "#FBB26A"
property string defaultInnerCircleColor: AmneziaStyle.color.white property string defaultInnerCircleColor: "#D7D8DB"
property string checkedDisabledInnerCircleColor: AmneziaStyle.color.brownLight property string checkedDisabledInnerCircleColor: "#84603D"
property string defaultDisabledInnerCircleColor: AmneziaStyle.color.greyDisabled property string defaultDisabledInnerCircleColor: "#494B50"
property string hoveredIndicatorBackgroundColor: AmneziaStyle.color.blackHovered property string hoveredIndicatorBackgroundColor: Qt.rgba(1, 1, 1, 0.08)
property string defaultIndicatorBackgroundColor: AmneziaStyle.color.transparent property string defaultIndicatorBackgroundColor: "transparent"
hoverEnabled: enabled ? true : false hoverEnabled: enabled ? true : false
focusPolicy: Qt.TabFocus focusPolicy: Qt.TabFocus
+7 -9
View File
@@ -1,18 +1,16 @@
import QtQuick import QtQuick
import QtQuick.Controls import QtQuick.Controls
import Style 1.0
TabButton { TabButton {
id: root id: root
property string hoveredColor: AmneziaStyle.color.brown property string hoveredColor: "#633303"
property string defaultColor: AmneziaStyle.color.greyDark property string defaultColor: "#2C2D30"
property string selectedColor: AmneziaStyle.color.orange property string selectedColor: "#FBB26A"
property string textColor: AmneziaStyle.color.white property string textColor: "#D7D8DB"
property string borderFocusedColor: AmneziaStyle.color.white property string borderFocusedColor: "#D7D8DB"
property int borderFocusedWidth: 1 property int borderFocusedWidth: 1
property bool isSelected: false property bool isSelected: false
@@ -26,9 +24,9 @@ TabButton {
id: background id: background
anchors.fill: parent anchors.fill: parent
color: AmneziaStyle.color.transparent color: "transparent"
border.color: root.activeFocus ? root.borderFocusedColor : AmneziaStyle.color.transparent border.color: root.activeFocus ? root.borderFocusedColor : "transparent"
border.width: root.activeFocus ? root.borderFocusedWidth : 0 border.width: root.activeFocus ? root.borderFocusedWidth : 0
Rectangle { Rectangle {
@@ -1,20 +1,18 @@
import QtQuick import QtQuick
import QtQuick.Controls import QtQuick.Controls
import Style 1.0
TabButton { TabButton {
id: root id: root
property string hoveredColor: AmneziaStyle.color.brown property string hoveredColor: "#633303"
property string defaultColor: AmneziaStyle.color.white property string defaultColor: "#D7D8DB"
property string selectedColor: AmneziaStyle.color.orange property string selectedColor: "#FBB26A"
property string image property string image
property bool isSelected: false property bool isSelected: false
property string borderFocusedColor: AmneziaStyle.color.white property string borderFocusedColor: "#D7D8DB"
property int borderFocusedWidth: 1 property int borderFocusedWidth: 1
property var clickedFunc property var clickedFunc
@@ -28,10 +26,10 @@ TabButton {
background: Rectangle { background: Rectangle {
id: background id: background
anchors.fill: parent anchors.fill: parent
color: AmneziaStyle.color.transparent color: "transparent"
radius: 10 radius: 10
border.color: root.activeFocus ? root.borderFocusedColor : AmneziaStyle.color.transparent border.color: root.activeFocus ? root.borderFocusedColor : "transparent"
border.width: root.activeFocus ? root.borderFocusedWidth : 0 border.width: root.activeFocus ? root.borderFocusedWidth : 0
} }
+8 -10
View File
@@ -1,8 +1,6 @@
import QtQuick import QtQuick
import QtQuick.Controls import QtQuick.Controls
import Style 1.0
Rectangle { Rectangle {
id: root id: root
@@ -11,12 +9,12 @@ Rectangle {
property alias textArea: textArea property alias textArea: textArea
property alias textAreaText: textArea.text property alias textAreaText: textArea.text
property string borderHoveredColor: AmneziaStyle.color.greyDisabled property string borderHoveredColor: "#494B50"
property string borderNormalColor: AmneziaStyle.color.greyDark property string borderNormalColor: "#2C2D30"
property string borderFocusedColor: AmneziaStyle.color.white property string borderFocusedColor: "#d7d8db"
height: 148 height: 148
color: AmneziaStyle.color.blackLight color: "#1C1D21"
border.width: 1 border.width: 1
border.color: getBorderColor(borderNormalColor) border.color: getBorderColor(borderNormalColor)
radius: 16 radius: 16
@@ -54,10 +52,10 @@ Rectangle {
anchors.topMargin: 16 anchors.topMargin: 16
anchors.bottomMargin: 16 anchors.bottomMargin: 16
color: AmneziaStyle.color.white color: "#D7D8DB"
selectionColor: AmneziaStyle.color.brown selectionColor: "#633303"
selectedTextColor: AmneziaStyle.color.white selectedTextColor: "#D7D8DB"
placeholderTextColor: AmneziaStyle.color.grey placeholderTextColor: "#878B91"
font.pixelSize: 16 font.pixelSize: 16
font.weight: Font.Medium font.weight: Font.Medium
@@ -2,16 +2,14 @@ import QtQuick
import QtQuick.Controls import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
import Style 1.0
import "TextTypes" import "TextTypes"
Item { Item {
id: root id: root
property string headerText property string headerText
property string headerTextDisabledColor: AmneziaStyle.color.greyDisabled property string headerTextDisabledColor: "#494B50"
property string headerTextColor: AmneziaStyle.color.grey property string headerTextColor: "#878b91"
property alias errorText: errorField.text property alias errorText: errorField.text
property bool checkEmptyText: false property bool checkEmptyText: false
@@ -23,18 +21,18 @@ Item {
property alias textField: textField property alias textField: textField
property alias textFieldText: textField.text property alias textFieldText: textField.text
property string textFieldTextColor: AmneziaStyle.color.white property string textFieldTextColor: "#d7d8db"
property string textFieldTextDisabledColor: AmneziaStyle.color.grey property string textFieldTextDisabledColor: "#878B91"
property string textFieldPlaceholderText property string textFieldPlaceholderText
property bool textFieldEditable: true property bool textFieldEditable: true
property string borderColor: AmneziaStyle.color.greyDark property string borderColor: "#2C2D30"
property string borderFocusedColor: AmneziaStyle.color.white property string borderFocusedColor: "#d7d8db"
property string backgroundColor: AmneziaStyle.color.blackLight property string backgroundColor: "#1c1d21"
property string backgroundDisabledColor: AmneziaStyle.color.transparent property string backgroundDisabledColor: "transparent"
property string bgBorderHoveredColor: AmneziaStyle.color.greyDisabled property string bgBorderHoveredColor: "#494B50"
implicitWidth: content.implicitWidth implicitWidth: content.implicitWidth
implicitHeight: content.implicitHeight implicitHeight: content.implicitHeight
@@ -92,10 +90,10 @@ Item {
inputMethodHints: Qt.ImhNoAutoUppercase | Qt.ImhSensitiveData | Qt.ImhNoPredictiveText inputMethodHints: Qt.ImhNoAutoUppercase | Qt.ImhSensitiveData | Qt.ImhNoPredictiveText
placeholderText: root.textFieldPlaceholderText placeholderText: root.textFieldPlaceholderText
placeholderTextColor: AmneziaStyle.color.greyDisabled placeholderTextColor: "#494B50"
selectionColor: AmneziaStyle.color.brown selectionColor: "#633303"
selectedTextColor: AmneziaStyle.color.white selectedTextColor: "#D7D8DB"
font.pixelSize: 16 font.pixelSize: 16
font.weight: 400 font.weight: 400
@@ -149,7 +147,7 @@ Item {
text: root.errorText text: root.errorText
visible: root.errorText !== "" visible: root.errorText !== ""
color: AmneziaStyle.color.red color: "#EB5757"
} }
} }
@@ -1,12 +1,10 @@
import QtQuick import QtQuick
import Style 1.0
Text { Text {
lineHeight: 24 lineHeight: 24
lineHeightMode: Text.FixedHeight lineHeightMode: Text.FixedHeight
color: AmneziaStyle.color.white color: "#D7D8DB"
font.pixelSize: 16 font.pixelSize: 16
font.weight: 600 font.weight: 600
font.family: "PT Root UI VF" font.family: "PT Root UI VF"
@@ -1,12 +1,10 @@
import QtQuick import QtQuick
import Style 1.0
Text { Text {
lineHeight: 16 + LanguageModel.getLineHeightAppend() lineHeight: 16 + LanguageModel.getLineHeightAppend()
lineHeightMode: Text.FixedHeight lineHeightMode: Text.FixedHeight
color: AmneziaStyle.color.black color: "#0E0E11"
font.pixelSize: 13 font.pixelSize: 13
font.weight: 400 font.weight: 400
font.family: "PT Root UI VF" font.family: "PT Root UI VF"
@@ -1,12 +1,10 @@
import QtQuick import QtQuick
import Style 1.0
Text { Text {
lineHeight: 38 + LanguageModel.getLineHeightAppend() lineHeight: 38 + LanguageModel.getLineHeightAppend()
lineHeightMode: Text.FixedHeight lineHeightMode: Text.FixedHeight
color: AmneziaStyle.color.white color: "#D7D8DB"
font.pixelSize: 36 font.pixelSize: 36
font.weight: 700 font.weight: 700
font.family: "PT Root UI VF" font.family: "PT Root UI VF"
@@ -1,12 +1,10 @@
import QtQuick import QtQuick
import Style 1.0
Text { Text {
lineHeight: 30 + LanguageModel.getLineHeightAppend() lineHeight: 30 + LanguageModel.getLineHeightAppend()
lineHeightMode: Text.FixedHeight lineHeightMode: Text.FixedHeight
color: AmneziaStyle.color.white color: "#D7D8DB"
font.pixelSize: 25 font.pixelSize: 25
font.weight: 700 font.weight: 700
font.family: "PT Root UI VF" font.family: "PT Root UI VF"
@@ -1,12 +1,10 @@
import QtQuick import QtQuick
import Style 1.0
Text { Text {
lineHeight: 16 + LanguageModel.getLineHeightAppend() lineHeight: 16 + LanguageModel.getLineHeightAppend()
lineHeightMode: Text.FixedHeight lineHeightMode: Text.FixedHeight
color: AmneziaStyle.color.grey color: "#878B91"
font.pixelSize: 13 font.pixelSize: 13
font.weight: 400 font.weight: 400
font.family: "PT Root UI VF" font.family: "PT Root UI VF"
@@ -1,12 +1,10 @@
import QtQuick import QtQuick
import Style 1.0
Text { Text {
lineHeight: 21.6 + LanguageModel.getLineHeightAppend() lineHeight: 21.6 + LanguageModel.getLineHeightAppend()
lineHeightMode: Text.FixedHeight lineHeightMode: Text.FixedHeight
color: AmneziaStyle.color.white color: "#D7D8DB"
font.pixelSize: 18 font.pixelSize: 18
font.weight: 400 font.weight: 400
font.family: "PT Root UI VF" font.family: "PT Root UI VF"
@@ -1,11 +1,10 @@
import QtQuick import QtQuick
import Style 1.0
Text { Text {
lineHeight: 24 + LanguageModel.getLineHeightAppend() lineHeight: 24 + LanguageModel.getLineHeightAppend()
lineHeightMode: Text.FixedHeight lineHeightMode: Text.FixedHeight
color: AmneziaStyle.color.white color: "#D7D8DB"
font.pixelSize: 16 font.pixelSize: 16
font.weight: 400 font.weight: 400
font.family: "PT Root UI VF" font.family: "PT Root UI VF"
@@ -1,12 +1,10 @@
import QtQuick import QtQuick
import Style 1.0
Text { Text {
lineHeight: 20 + LanguageModel.getLineHeightAppend() lineHeight: 20 + LanguageModel.getLineHeightAppend()
lineHeightMode: Text.FixedHeight lineHeightMode: Text.FixedHeight
color: AmneziaStyle.color.white color: "#D7D8DB"
font.pixelSize: 14 font.pixelSize: 14
font.weight: 400 font.weight: 400
font.family: "PT Root UI VF" font.family: "PT Root UI VF"
@@ -18,14 +18,14 @@ Popup {
} }
background: Rectangle { background: Rectangle {
color: AmneziaStyle.color.transparent color: "transparent"
} }
ImageButtonType { ImageButtonType {
id: button id: button
image: "qrc:/images/svg/close_black_24dp.svg" image: "qrc:/images/svg/close_black_24dp.svg"
imageColor: AmneziaStyle.color.white imageColor: "#D7D8DB"
implicitWidth: 40 implicitWidth: 40
implicitHeight: 40 implicitHeight: 40
@@ -3,8 +3,6 @@ import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
import Qt5Compat.GraphicalEffects import Qt5Compat.GraphicalEffects
import Style 1.0
import "TextTypes" import "TextTypes"
RadioButton { RadioButton {
@@ -14,15 +12,15 @@ RadioButton {
property int textElide: Qt.ElideRight property int textElide: Qt.ElideRight
property string descriptionText property string descriptionText
property string hoveredColor: AmneziaStyle.color.blackHovered property string hoveredColor: Qt.rgba(1, 1, 1, 0.05)
property string defaultColor: AmneziaStyle.color.transparent property string defaultColor: Qt.rgba(1, 1, 1, 0)
property string disabledColor: AmneziaStyle.color.transparent property string disabledColor: Qt.rgba(1, 1, 1, 0)
property string selectedColor: AmneziaStyle.color.transparent property string selectedColor: Qt.rgba(1, 1, 1, 0)
property string textColor: AmneziaStyle.color.white property string textColor: "#D7D8DB"
property string selectedTextColor: AmneziaStyle.color.orange property string selectedTextColor: "#FBB26A"
property string borderFocusedColor: AmneziaStyle.color.white property string borderFocusedColor: "#D7D8DB"
property int borderFocusedWidth: 1 property int borderFocusedWidth: 1
property string imageSource property string imageSource
@@ -36,7 +34,7 @@ RadioButton {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
border.color: root.focus ? root.borderFocusedColor : AmneziaStyle.color.transparent border.color: root.focus ? root.borderFocusedColor : "transparent"
border.width: root.focus ? root.borderFocusedWidth : 0 border.width: root.focus ? root.borderFocusedWidth : 0
implicitWidth: 56 implicitWidth: 56
@@ -139,7 +137,7 @@ RadioButton {
CaptionTextType { CaptionTextType {
id: description id: description
color: AmneziaStyle.color.grey color: "#878B91"
text: root.descriptionText text: root.descriptionText
visible: root.descriptionText !== "" visible: root.descriptionText !== ""
+3 -5
View File
@@ -3,16 +3,14 @@ import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
import Qt5Compat.GraphicalEffects import Qt5Compat.GraphicalEffects
import Style 1.0
import "TextTypes" import "TextTypes"
Rectangle { Rectangle {
id: root id: root
property string textColor: AmneziaStyle.color.white property string textColor: "#D7D8DB"
property string backGroundColor: AmneziaStyle.color.blackLight property string backGroundColor: "#1C1D21"
property string imageColor: AmneziaStyle.color.white property string imageColor: "#D7D8DB"
property string textString property string textString
property int textFormat: Text.PlainText property int textFormat: Text.PlainText
@@ -1,26 +0,0 @@
pragma Singleton
import QtQuick
QtObject {
property QtObject color: QtObject {
readonly property color transparent: 'transparent'
readonly property color white: '#D7D8DB'
readonly property color whiteHovered: '#C1C2C5'
readonly property color grey: '#878B91'
readonly property color greyDisabled: '#494B50'
readonly property color greyDark: '#2C2D30'
readonly property color blackLight: '#1C1D21'
readonly property color blackHovered: '#01010114'
readonly property color blackPressed: '#0101011f'
readonly property color black: '#0E0E11'
readonly property color orange: '#FBB26A'
readonly property color orangeDark: '#A85809'
readonly property color brownLight: '#84603D'
readonly property color brown: '#633303'
readonly property color brownDark: '#402102'
readonly property color red: '#EB5757'
readonly property color connectionInProgress: '#261E1A'
}
}
-3
View File
@@ -1,3 +0,0 @@
module Style
singleton AmneziaStyle 1.0 AmneziaStyle.qml
+18 -19
View File
@@ -8,7 +8,6 @@ import PageEnum 1.0
import ProtocolEnum 1.0 import ProtocolEnum 1.0
import ContainerProps 1.0 import ContainerProps 1.0
import ContainersModelFilters 1.0 import ContainersModelFilters 1.0
import Style 1.0
import "./" import "./"
import "../Controls2" import "../Controls2"
@@ -56,11 +55,11 @@ PageType {
implicitHeight: 36 implicitHeight: 36
defaultColor: AmneziaStyle.color.transparent defaultColor: "transparent"
hoveredColor: AmneziaStyle.color.blackHovered hoveredColor: Qt.rgba(1, 1, 1, 0.08)
pressedColor: AmneziaStyle.color.blackPressed pressedColor: Qt.rgba(1, 1, 1, 0.12)
disabledColor: AmneziaStyle.color.grey disabledColor: "#878B91"
textColor: AmneziaStyle.color.grey textColor: "#878B91"
borderWidth: 0 borderWidth: 0
visible: isLoggingEnabled ? true : false visible: isLoggingEnabled ? true : false
@@ -92,12 +91,12 @@ PageType {
implicitHeight: 36 implicitHeight: 36
defaultColor: AmneziaStyle.color.transparent defaultColor: "transparent"
hoveredColor: AmneziaStyle.color.blackHovered hoveredColor: Qt.rgba(1, 1, 1, 0.08)
pressedColor: AmneziaStyle.color.blackPressed pressedColor: Qt.rgba(1, 1, 1, 0.12)
disabledColor: AmneziaStyle.color.grey disabledColor: "#878B91"
textColor: AmneziaStyle.color.grey textColor: "#878B91"
leftImageColor: AmneziaStyle.color.transparent leftImageColor: "transparent"
borderWidth: 0 borderWidth: 0
property bool isSplitTunnelingEnabled: SitesModel.isTunnelingEnabled || AppSplitTunnelingModel.isTunnelingEnabled || property bool isSplitTunnelingEnabled: SitesModel.isTunnelingEnabled || AppSplitTunnelingModel.isTunnelingEnabled ||
@@ -238,7 +237,7 @@ PageType {
hoverEnabled: false hoverEnabled: false
image: "qrc:/images/controls/chevron-down.svg" image: "qrc:/images/controls/chevron-down.svg"
imageColor: AmneziaStyle.color.white imageColor: "#d7d8db"
icon.width: 18 icon.width: 18
icon.height: 18 icon.height: 18
@@ -299,17 +298,17 @@ PageType {
DropDownType { DropDownType {
id: containersDropDown id: containersDropDown
rootButtonImageColor: AmneziaStyle.color.black rootButtonImageColor: "#0E0E11"
rootButtonBackgroundColor: AmneziaStyle.color.white rootButtonBackgroundColor: "#D7D8DB"
rootButtonBackgroundHoveredColor: Qt.rgba(215, 216, 219, 0.8) rootButtonBackgroundHoveredColor: Qt.rgba(215, 216, 219, 0.8)
rootButtonBackgroundPressedColor: Qt.rgba(215, 216, 219, 0.65) rootButtonBackgroundPressedColor: Qt.rgba(215, 216, 219, 0.65)
rootButtonHoveredBorderColor: AmneziaStyle.color.transparent rootButtonHoveredBorderColor: "transparent"
rootButtonDefaultBorderColor: AmneziaStyle.color.transparent rootButtonDefaultBorderColor: "transparent"
rootButtonTextTopMargin: 8 rootButtonTextTopMargin: 8
rootButtonTextBottomMargin: 8 rootButtonTextBottomMargin: 8
text: ServersModel.defaultServerDefaultContainerName text: ServersModel.defaultServerDefaultContainerName
textColor: AmneziaStyle.color.black textColor: "#0E0E11"
headerText: qsTr("VPN protocol") headerText: qsTr("VPN protocol")
headerBackButtonImage: "qrc:/images/controls/arrow-left.svg" headerBackButtonImage: "qrc:/images/controls/arrow-left.svg"
@@ -500,7 +499,7 @@ PageType {
ImageButtonType { ImageButtonType {
id: serverInfoButton id: serverInfoButton
image: "qrc:/images/controls/settings.svg" image: "qrc:/images/controls/settings.svg"
imageColor: AmneziaStyle.color.white imageColor: "#D7D8DB"
implicitWidth: 56 implicitWidth: 56
implicitHeight: 56 implicitHeight: 56
@@ -6,7 +6,6 @@ import SortFilterProxyModel 0.2
import PageEnum 1.0 import PageEnum 1.0
import ContainerEnum 1.0 import ContainerEnum 1.0
import Style 1.0
import "./" import "./"
import "../Controls2" import "../Controls2"
@@ -295,7 +294,7 @@ PageType {
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 32 Layout.topMargin: 32
Layout.preferredHeight: checkboxLayout.implicitHeight Layout.preferredHeight: checkboxLayout.implicitHeight
color: AmneziaStyle.color.blackLight color: "#1C1D21"
radius: 16 radius: 16
Connections { Connections {

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