Compare commits

...

71 Commits

Author SHA1 Message Date
ronoaer e6ecfaf171 adapted awg-questiondrawer with drawer2type 2023-10-21 16:11:54 +08:00
ronoaer 4551cf0a21 Merge pull request #370 from amnezia-vpn/feature/custom_drawer_component
added new drawer2type for replacing drawertype
2023-10-21 09:34:21 +08:00
ronoaer 023c3474d2 Merge branch 'dev' into feature/custom_drawer_component 2023-10-21 09:28:41 +08:00
pokamest 2a4cefb4bf Merge pull request #387 from amnezia-vpn/bugfix/awg-mtu-len-fix
Fix MTU len for Win WG/AWG
2023-10-20 15:02:29 -07:00
Mykola Baibuz 09305724fa Fix MTU len for Win WG/AWG 2023-10-20 16:44:30 -04:00
pokamest 360fda1ba7 Merge pull request #386 from amnezia-vpn/bugfix/minor-ui-fixes-4-version
Bugfix/minor UI fixes 4 version
2023-10-20 12:23:03 -07:00
vladimir.kuznetsov dadf0cf96e Merge branch 'dev' of github.com:amnezia-vpn/amnezia-client into dev 2023-10-20 21:51:40 +05:00
vladimir.kuznetsov 3d60ac751e removed the default protocol/server change if connected to VPN 2023-10-20 20:52:14 +05:00
pokamest 32793eef8c Merge pull request #385 from amnezia-vpn/bugfix/translated_new_source_strings_to_chinese
translated new source strings to chinese
2023-10-20 06:36:17 -07:00
ronoaer da1cdfd6fa translated new source strings to chinese 2023-10-20 18:01:57 +08:00
vladimir.kuznetsov 58ad7dc161 removed the "remove protocol" buttons from where they shouldn't be 2023-10-20 14:10:04 +05:00
ronoaer 0a15f44193 removed states 'opened', 'closed' 2023-10-20 10:38:12 +08:00
pokamest e1dec3c1ba Merge pull request #384 from amnezia-vpn/bugfix/startCentos7docker
Restoring autostart and enable docker for CentOS 7
2023-10-19 18:30:45 -07:00
pokamest 7834860245 Merge pull request #383 from amnezia-vpn/feature/awg-random-values
Feature/awg random values
2023-10-19 18:28:13 -07:00
pokamest 2da1025f26 Random port on install 2023-10-20 02:25:40 +01:00
ronoaer 6c78b4ec8f enabled drag-pagehome-drawer in tabBar 2023-10-19 23:01:03 +08:00
ronoaer a6949bd3ae resized questiondrawer of page serverdata 2023-10-19 19:45:22 +08:00
ronoaer f7bed04ab2 removed invalid function code 2023-10-19 19:32:15 +08:00
ronoaer 6ec773079c added hovering effect of button 2023-10-19 11:22:52 +08:00
ronoaer 366e27a321 re-adatped pagehome 2023-10-19 09:27:39 +08:00
vladimir.kuznetsov 338499247d changed the display order of containers 2023-10-19 01:16:36 +05:00
vladimir.kuznetsov 79e1761c1f added generation of random values for awg parameters 2023-10-19 01:14:09 +05:00
pokamest e2ae341ba9 AndroidManifest fix 2023-10-18 14:01:06 +01:00
pokamest de03435bac Merge pull request #381 from amnezia-vpn/bugfix/minor-ui-fixes-4-version
Bugfix/minor UI fixes 4 version
2023-10-18 04:05:18 -07:00
pokamest e16c425f87 PageHome.qml fix 2023-10-18 12:04:39 +01:00
ronoaer c461e00c5c keeping parent's cusorshape and Drawer2Type's close-animation 2023-10-18 16:17:57 +08:00
vladimir.kuznetsov a46e55d5c2 added a dash for drawerType 2023-10-18 01:11:41 +05:00
vladimir.kuznetsov 4b64bfaec0 fixed questionDrawer height 2023-10-18 00:37:15 +05:00
vladimir.kuznetsov 2f0c1eeecc fixed selection of default container after installing a new server 2023-10-18 00:36:40 +05:00
lunardunno 160d88f002 Restoring autostart and enable docker for CentOS 7 2023-10-17 21:26:50 +04:00
ronoaer a83cd29f72 fixed the cursorShape, and some minor issues 2023-10-17 22:00:19 +08:00
pokamest 94304b5777 Version bump 2023-10-17 14:47:31 +01:00
pokamest 61ddfe01a1 macos build script updated [no ci] 2023-10-17 06:39:49 -07:00
pokamest 00d334f704 Merge pull request #377 from amnezia-vpn/bugfix/minor-ui-fixes-4-version
disabled the ability to change the protocol/server when a vpn connection is active
2023-10-17 05:39:51 -07:00
pokamest f4a4979997 Merge pull request #378 from amnezia-vpn/bugfix/updated_chinese_translations
updated Chinese translations for updating source strings
2023-10-17 05:11:19 -07:00
ronoaer 03171e4743 update background color and drag-effect, moved dulicated code 2023-10-17 19:34:34 +08:00
ronoaer 5369e68267 updated Chinese translations for updating source strings 2023-10-17 14:30:59 +08:00
vladimir.kuznetsov 9eb23e38bd disabled the ability to change the protocol/server when a vpn connection is active 2023-10-16 22:57:12 +05:00
pokamest 36ba3758db Translation updates 2023-10-16 15:27:26 +01:00
ronoaer 7cc0f39d3c adapted pagehome by new custom drawer type 2023-10-16 22:21:01 +08:00
pokamest 81f835458f Merge pull request #375 from amnezia-vpn/bugfix/minor-ui-fixes-4-version
Bugfix/minor UI fixes 4 version
2023-10-16 03:10:53 -07:00
vladimir.kuznetsov e01b1db706 text corrections 2023-10-16 14:34:03 +05:00
vladimir.kuznetsov cdb18de305 brought back the ability to share wireguard native format configs 2023-10-16 13:43:27 +05:00
vladimir.kuznetsov 8e0eef3316 fixed selection of default container after installing a new container 2023-10-16 13:40:43 +05:00
vladimir.kuznetsov 221d45f564 fixed pageSettingsDns width 2023-10-16 13:32:56 +05:00
ronoaer cb5c09d967 adapted questionDrawer 2023-10-15 21:29:01 +08:00
pokamest a01ba5909c Version bump 2023-10-15 12:53:44 +01:00
pokamest 1c4678af95 Merge pull request #373 from amnezia-vpn/fix/update_ru_ts
Updated ru ts #2
2023-10-15 04:43:04 -07:00
pokamest 5f5435c645 Updated ru ts 2023-10-15 12:41:01 +01:00
pokamest 2f7dc2c46c Merge pull request #372 from amnezia-vpn/fix/update_ru_ts
Update ru translation
2023-10-15 04:38:29 -07:00
pokamest 9bc1c9dd03 Merge branch 'dev' into fix/update_ru_ts 2023-10-15 12:30:13 +01:00
pokamest 4c81cdb4a2 Update translation 2023-10-15 12:29:41 +01:00
pokamest 3406ffa7a2 Merge pull request #371 from amnezia-vpn/bugfix/minor-ui-fixes-4-version
Minor UI fixes 4 version
2023-10-15 02:54:27 -07:00
pokamest 6d05b6845e VPN protocol descriptions updated 2023-10-15 10:53:09 +01:00
ronoaer 29b4966119 shown ConnectionTypeSelectionDrawer on top level alway 2023-10-15 17:34:35 +08:00
ronoaer d0f8358431 removed invalid code, and fixed top button hidden-shown 2023-10-15 17:29:22 +08:00
ronoaer a75bd07cd8 fixed the clicked event 2023-10-15 15:54:05 +08:00
ronoaer 8c1835950b added transparent-background, for blocking clicked event 2023-10-15 15:17:04 +08:00
pokamest c7cd8e4c80 Minor ui fixes and refactoring 2023-10-15 02:30:42 +01:00
pokamest f65e4066e3 ui fixes 2023-10-14 23:59:46 +01:00
vladimir.kuznetsov 37c18c5d3c Merge branch 'dev' of github.com:amnezia-vpn/amnezia-client into dev 2023-10-14 21:25:09 +05:00
vladimir.kuznetsov 8885f580b2 added notification after saving backup and logs files 2023-10-14 21:18:38 +05:00
vladimir.kuznetsov 512ac74ee6 temporarily disabled the drawer close button 2023-10-14 20:59:03 +05:00
ronoaer 384ce9853b added new drawer2type for replacing drawertype 2023-10-14 23:00:31 +08:00
pokamest b6d2030041 Ru translation 2023-10-14 15:55:52 +01:00
pokamest 3ac09181c6 Text lables fixes 2023-10-14 15:55:07 +01:00
vladimir.kuznetsov ffc9e5823a text corrections 2023-10-14 18:21:49 +05:00
vladimir.kuznetsov f5448fed59 Merge branch 'dev' of github.com:amnezia-vpn/amnezia-client into dev 2023-10-14 16:58:14 +05:00
vladimir.kuznetsov 8163e51434 fixes on page split tunneling according to the design layout 2023-10-14 16:52:22 +05:00
pokamest 3836836c72 Change easySetupOrder 2023-10-14 02:15:49 +01:00
vladimir.kuznetsov a4624c7377 removed the close button for the app for mobile platforms 2023-10-12 10:57:13 +05:00
63 changed files with 2353 additions and 1403 deletions
+1 -1
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.0.8.1 project(${PROJECT} VERSION 4.0.8.5
DESCRIPTION "AmneziaVPN" DESCRIPTION "AmneziaVPN"
HOMEPAGE_URL "https://amnezia.org/" HOMEPAGE_URL "https://amnezia.org/"
) )
-1
View File
@@ -74,7 +74,6 @@ qt6_add_resources(QRC ${I18NQRC} ${CMAKE_CURRENT_BINARY_DIR}/translations.qrc)
# -- i18n end # -- i18n end
if(IOS) if(IOS)
#execute_process(COMMAND bash ${CMAKE_CURRENT_LIST_DIR}/scripts/run-build-cloak.sh)
execute_process(COMMAND bash ${CMAKE_CURRENT_LIST_DIR}/ios/scripts/openvpn.sh args execute_process(COMMAND bash ${CMAKE_CURRENT_LIST_DIR}/ios/scripts/openvpn.sh args
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}) WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR})
endif() endif()
+2
View File
@@ -286,6 +286,8 @@ void AmneziaApplication::initModels()
m_engine->rootContext()->setContextProperty("ServersModel", m_serversModel.get()); m_engine->rootContext()->setContextProperty("ServersModel", m_serversModel.get());
connect(m_serversModel.get(), &ServersModel::currentlyProcessedServerIndexChanged, m_containersModel.get(), connect(m_serversModel.get(), &ServersModel::currentlyProcessedServerIndexChanged, m_containersModel.get(),
&ContainersModel::setCurrentlyProcessedServerIndex); &ContainersModel::setCurrentlyProcessedServerIndex);
connect(m_serversModel.get(), &ServersModel::defaultServerIndexChanged, m_containersModel.get(),
&ContainersModel::setCurrentlyProcessedServerIndex);
m_languageModel.reset(new LanguageModel(m_settings, this)); m_languageModel.reset(new LanguageModel(m_settings, this));
m_engine->rootContext()->setContextProperty("LanguageModel", m_languageModel.get()); m_engine->rootContext()->setContextProperty("LanguageModel", m_languageModel.get());
+1
View File
@@ -45,6 +45,7 @@
android:label="-- %%INSERT_APP_NAME%% --" android:label="-- %%INSERT_APP_NAME%% --"
android:screenOrientation="unspecified" android:screenOrientation="unspecified"
android:launchMode="singleInstance" android:launchMode="singleInstance"
android:windowSoftInputMode="adjustResize"
android:exported="true"> android:exported="true">
<!-- android:theme="@style/splashScreenTheme"--> <!-- android:theme="@style/splashScreenTheme"-->
+1 -1
View File
@@ -138,7 +138,7 @@ android {
resConfig "en" resConfig "en"
minSdkVersion = 24 minSdkVersion = 24
targetSdkVersion = 34 targetSdkVersion = 34
versionCode 36 // Change to a higher number versionCode 37 // Change to a higher number
versionName "4.0.8" // Change to a higher number versionName "4.0.8" // Change to a higher number
javaCompileOptions.annotationProcessorOptions.arguments = [ javaCompileOptions.annotationProcessorOptions.arguments = [
+100 -36
View File
@@ -89,7 +89,6 @@ QMap<DockerContainer, QString> ContainerProps::containerHumanNames()
{ DockerContainer::TorWebSite, QObject::tr("Website in Tor network") }, { DockerContainer::TorWebSite, QObject::tr("Website in Tor network") },
{ DockerContainer::Dns, QObject::tr("Amnezia DNS") }, { DockerContainer::Dns, QObject::tr("Amnezia DNS") },
//{DockerContainer::FileShare, QObject::tr("SMB file sharing service")},
{ DockerContainer::Sftp, QObject::tr("Sftp file sharing service") } }; { DockerContainer::Sftp, QObject::tr("Sftp file sharing service") } };
} }
@@ -109,7 +108,8 @@ QMap<DockerContainer, QString> ContainerProps::containerDescriptions()
QObject::tr("WireGuard - New popular VPN protocol with high performance, high speed and low power " QObject::tr("WireGuard - New popular VPN protocol with high performance, high speed and low power "
"consumption. Recommended for regions with low levels of censorship.") }, "consumption. Recommended for regions with low levels of censorship.") },
{ DockerContainer::Awg, { DockerContainer::Awg,
QObject::tr("AmneziaWG - Special protocol from Amnezia, based on WireGuard. It's fast like WireGuard, but very resistant to blockages. " QObject::tr("AmneziaWG - Special protocol from Amnezia, based on WireGuard. It's fast like WireGuard, "
"but very resistant to blockages. "
"Recommended for regions with high levels of censorship.") }, "Recommended for regions with high levels of censorship.") },
{ DockerContainer::Ipsec, { DockerContainer::Ipsec,
QObject::tr("IKEv2 - Modern stable protocol, a bit faster than others, restores connection after " QObject::tr("IKEv2 - Modern stable protocol, a bit faster than others, restores connection after "
@@ -118,44 +118,108 @@ QMap<DockerContainer, QString> ContainerProps::containerDescriptions()
{ DockerContainer::TorWebSite, QObject::tr("Deploy a WordPress site on the Tor network in two clicks.") }, { DockerContainer::TorWebSite, QObject::tr("Deploy a WordPress site on the Tor network in two clicks.") },
{ DockerContainer::Dns, { DockerContainer::Dns,
QObject::tr("Replace the current DNS server with your own. This will increase your privacy level.") }, QObject::tr("Replace the current DNS server with your own. This will increase your privacy level.") },
//{DockerContainer::FileShare, QObject::tr("SMB file sharing service - is Window file sharing protocol")},
{ DockerContainer::Sftp, { DockerContainer::Sftp,
QObject::tr("Creates a file vault on your server to securely store and transfer files.") } }; QObject::tr("Creates a file vault on your server to securely store and transfer files.") } };
} }
QMap<DockerContainer, QString> ContainerProps::containerDetailedDescriptions() QMap<DockerContainer, QString> ContainerProps::containerDetailedDescriptions()
{ {
return { { DockerContainer::OpenVpn, QObject::tr("OpenVPN container") }, return {
{ DockerContainer::ShadowSocks, QObject::tr("Container with OpenVpn and ShadowSocks") }, { DockerContainer::OpenVpn,
QObject::tr(
"OpenVPN stands as one of the most popular and time-tested VPN protocols available.\n"
"It employs its unique security protocol, "
"leveraging the strength of SSL/TLS for encryption and key exchange. "
"Furthermore, OpenVPN's support for a multitude of authentication methods makes it versatile and adaptable, "
"catering to a wide range of devices and operating systems. "
"Due to its open-source nature, OpenVPN benefits from extensive scrutiny by the global community, "
"which continually reinforces its security. "
"With a strong balance of performance, security, and compatibility, "
"OpenVPN remains a top choice for privacy-conscious individuals and businesses alike.\n\n"
"* Available in the AmneziaVPN across all platforms\n"
"* Normal power consumption on mobile devices\n"
"* Flexible customisation to suit user needs to work with different operating systems and devices\n"
"* Recognised by DPI analysis systems and therefore susceptible to blocking\n"
"* Can operate over both TCP and UDP network protocols.") },
{ DockerContainer::ShadowSocks,
QObject::tr("Shadowsocks, inspired by the SOCKS5 protocol, safeguards the connection using the AEAD cipher. "
"Although Shadowsocks is designed to be discreet and challenging to identify, it isn't identical to a standard HTTPS connection."
"However, certain traffic analysis systems might still detect a Shadowsocks connection. "
"Due to limited support in Amnezia, it's recommended to use AmneziaWG protocol.\n\n"
"* Available in the AmneziaVPN only on desktop platforms\n"
"* Normal power consumption on mobile devices\n\n"
"* Configurable encryption protocol\n"
"* Detectable by some DPI systems\n"
"* Works over TCP network protocol.") },
{ DockerContainer::Cloak, { DockerContainer::Cloak,
QObject::tr("Container with OpenVpn and ShadowSocks protocols " QObject::tr("This is a combination of the OpenVPN protocol and the Cloak plugin designed specifically for "
"configured with traffic masking by Cloak plugin") }, "blocking protection.\n\n"
{ DockerContainer::WireGuard, QObject::tr("WireGuard container") }, "OpenVPN provides a secure VPN connection by encrypting all Internet traffic between the client "
{ DockerContainer::WireGuard, QObject::tr("AmneziaWG container") }, "and the server.\n\n"
{ DockerContainer::Ipsec, QObject::tr("IPsec container") }, "Cloak protects OpenVPN from detection and blocking. \n\n"
"Cloak can modify packet metadata so that it completely masks VPN traffic as normal web traffic, "
"and also protects the VPN from detection by Active Probing. This makes it very resistant to "
"being detected\n\n"
"Immediately after receiving the first data packet, Cloak authenticates the incoming connection. "
"If authentication fails, the plugin masks the server as a fake website and your VPN becomes "
"invisible to analysis systems.\n\n"
"If there is a extreme level of Internet censorship in your region, we advise you to use only "
"OpenVPN over Cloak from the first connection\n\n"
"* Available in the AmneziaVPN across all platforms\n"
"* High power consumption on mobile devices\n"
"* Flexible settings\n"
"* Not recognised by DPI analysis systems\n"
"* Works over TCP network protocol, 443 port.\n") },
{ DockerContainer::WireGuard,
QObject::tr("A relatively new popular VPN protocol with a simplified architecture.\n"
"Provides stable VPN connection, high performance on all devices. Uses hard-coded encryption "
"settings. WireGuard compared to OpenVPN has lower latency and better data transfer throughput.\n"
"WireGuard is very susceptible to blocking due to its distinct packet signatures. "
"Unlike some other VPN protocols that employ obfuscation techniques, "
"the consistent signature patterns of WireGuard packets can be more easily identified and "
"thus blocked by advanced Deep Packet Inspection (DPI) systems and other network monitoring tools.\n\n"
"* Available in the AmneziaVPN across all platforms\n"
"* Low power consumption\n"
"* Minimum number of settings\n"
"* Easily recognised by DPI analysis systems, susceptible to blocking\n"
"* Works over UDP network protocol.") },
{ DockerContainer::Awg,
QObject::tr("A modern iteration of the popular VPN protocol, "
"AmneziaWG builds upon the foundation set by WireGuard, "
"retaining its simplified architecture and high-performance capabilities across devices.\n"
"While WireGuard is known for its efficiency, "
"it had issues with being easily detected due to its distinct packet signatures. "
"AmneziaWG solves this problem by using better obfuscation methods, "
"making its traffic blend in with regular internet traffic.\n"
"This means that AmneziaWG keeps the fast performance of the original "
"while adding an extra layer of stealth, "
"making it a great choice for those wanting a fast and discreet VPN connection.\n\n"
"* Available in the AmneziaVPN across all platforms\n"
"* Low power consumption\n"
"* Minimum number of settings\n"
"* Not recognised by DPI analysis systems, resistant to blocking\n"
"* Works over UDP network protocol.") },
{ DockerContainer::Ipsec,
QObject::tr("IKEv2, paired with the IPSec encryption layer, stands as a modern and stable VPN protocol.\n"
"One of its distinguishing features is its ability to swiftly switch between networks and devices, "
"making it particularly adaptive in dynamic network environments. \n"
"While it offers a blend of security, stability, and speed, "
"it's essential to note that IKEv2 can be easily detected and is susceptible to blocking.\n\n"
"* Available in the AmneziaVPN only on Windows\n"
"* Low power consumption, on mobile devices\n"
"* Minimal configuration\n"
"* Recognised by DPI analysis systems\n"
"* Works over UDP network protocol, ports 500 and 4500.") },
{ DockerContainer::TorWebSite, QObject::tr("Website in Tor network") }, { DockerContainer::TorWebSite, QObject::tr("Website in Tor network") },
{ DockerContainer::Dns, QObject::tr("DNS Service") }, { DockerContainer::Dns, QObject::tr("DNS Service") },
//{DockerContainer::FileShare, QObject::tr("SMB file sharing service - is Window file sharing protocol")}, { DockerContainer::Sftp, QObject::tr("Sftp file sharing service - is secure FTP service") }
{ DockerContainer::Sftp, QObject::tr("Sftp file sharing service - is secure FTP service") } }; };
} }
amnezia::ServiceType ContainerProps::containerService(DockerContainer c) amnezia::ServiceType ContainerProps::containerService(DockerContainer c)
{ {
switch (c) { return ProtocolProps::protocolService(defaultProtocol(c));
case DockerContainer::None: return ServiceType::None;
case DockerContainer::OpenVpn: return ServiceType::Vpn;
case DockerContainer::Cloak: return ServiceType::Vpn;
case DockerContainer::ShadowSocks: return ServiceType::Vpn;
case DockerContainer::WireGuard: return ServiceType::Vpn;
case DockerContainer::Awg: return ServiceType::Vpn;
case DockerContainer::Ipsec: return ServiceType::Vpn;
case DockerContainer::TorWebSite: return ServiceType::Other;
case DockerContainer::Dns: return ServiceType::Other;
// case DockerContainer::FileShare : return ServiceType::Other;
case DockerContainer::Sftp: return ServiceType::Other;
default: return ServiceType::Other;
}
} }
Proto ContainerProps::defaultProtocol(DockerContainer c) Proto ContainerProps::defaultProtocol(DockerContainer c)
@@ -171,7 +235,6 @@ Proto ContainerProps::defaultProtocol(DockerContainer c)
case DockerContainer::TorWebSite: return Proto::TorWebSite; case DockerContainer::TorWebSite: return Proto::TorWebSite;
case DockerContainer::Dns: return Proto::Dns; case DockerContainer::Dns: return Proto::Dns;
// case DockerContainer::FileShare : return Protocol::FileShare;
case DockerContainer::Sftp: return Proto::Sftp; case DockerContainer::Sftp: return Proto::Sftp;
default: return Proto::Any; default: return Proto::Any;
} }
@@ -233,8 +296,8 @@ bool ContainerProps::isEasySetupContainer(DockerContainer container)
{ {
switch (container) { switch (container) {
case DockerContainer::WireGuard: return true; case DockerContainer::WireGuard: return true;
case DockerContainer::Awg: return true;
case DockerContainer::Cloak: return true; case DockerContainer::Cloak: return true;
case DockerContainer::OpenVpn: return true;
default: return false; default: return false;
} }
} }
@@ -243,8 +306,8 @@ QString ContainerProps::easySetupHeader(DockerContainer container)
{ {
switch (container) { switch (container) {
case DockerContainer::WireGuard: return tr("Low"); case DockerContainer::WireGuard: return tr("Low");
case DockerContainer::Cloak: return tr("High"); case DockerContainer::Awg: return tr("Medium or High");
case DockerContainer::OpenVpn: return tr("Medium"); case DockerContainer::Cloak: return tr("Extreme");
default: return ""; default: return "";
} }
} }
@@ -252,9 +315,10 @@ QString ContainerProps::easySetupHeader(DockerContainer container)
QString ContainerProps::easySetupDescription(DockerContainer container) QString ContainerProps::easySetupDescription(DockerContainer container)
{ {
switch (container) { switch (container) {
case DockerContainer::WireGuard: return tr("I just want to increase the level of privacy"); case DockerContainer::WireGuard: return tr("I just want to increase the level of my privacy.");
case DockerContainer::Cloak: return tr("Many foreign websites and VPN providers are blocked"); case DockerContainer::Awg: return tr("I want to bypass censorship. This option recommended in most cases.");
case DockerContainer::OpenVpn: return tr("Some foreign sites are blocked, but VPN providers are not blocked"); case DockerContainer::Cloak:
return tr("Most VPN protocols are blocked. Recommended if other options are not working.");
default: return ""; default: return "";
} }
} }
@@ -262,9 +326,9 @@ QString ContainerProps::easySetupDescription(DockerContainer container)
int ContainerProps::easySetupOrder(DockerContainer container) int ContainerProps::easySetupOrder(DockerContainer container)
{ {
switch (container) { switch (container) {
case DockerContainer::WireGuard: return 1; case DockerContainer::WireGuard: return 3;
case DockerContainer::Cloak: return 3; case DockerContainer::Awg: return 2;
case DockerContainer::OpenVpn: return 2; case DockerContainer::Cloak: return 1;
default: return 0; default: return 0;
} }
} }
+4 -5
View File
@@ -16,17 +16,16 @@ namespace amnezia
Q_NAMESPACE Q_NAMESPACE
enum DockerContainer { enum DockerContainer {
None = 0, None = 0,
OpenVpn,
ShadowSocks,
Cloak,
WireGuard,
Awg, Awg,
WireGuard,
OpenVpn,
Cloak,
ShadowSocks,
Ipsec, Ipsec,
// non-vpn // non-vpn
TorWebSite, TorWebSite,
Dns, Dns,
// FileShare,
Sftp Sftp
}; };
Q_ENUM_NS(DockerContainer) Q_ENUM_NS(DockerContainer)
-1
View File
@@ -16,7 +16,6 @@ QString amnezia::scriptFolder(amnezia::DockerContainer container)
case DockerContainer::TorWebSite: return QLatin1String("website_tor"); case DockerContainer::TorWebSite: return QLatin1String("website_tor");
case DockerContainer::Dns: return QLatin1String("dns"); case DockerContainer::Dns: return QLatin1String("dns");
// case DockerContainer::FileShare: return QLatin1String("file_share");
case DockerContainer::Sftp: return QLatin1String("sftp"); case DockerContainer::Sftp: return QLatin1String("sftp");
default: return ""; default: return "";
} }
+11 -24
View File
@@ -490,8 +490,7 @@ ServerController::Vars ServerController::genVarsForScript(const ServerCredential
const QJsonObject &cloakConfig = config.value(ProtocolProps::protoToString(Proto::Cloak)).toObject(); const QJsonObject &cloakConfig = config.value(ProtocolProps::protoToString(Proto::Cloak)).toObject();
const QJsonObject &ssConfig = config.value(ProtocolProps::protoToString(Proto::ShadowSocks)).toObject(); const QJsonObject &ssConfig = config.value(ProtocolProps::protoToString(Proto::ShadowSocks)).toObject();
const QJsonObject &wireguarConfig = config.value(ProtocolProps::protoToString(Proto::WireGuard)).toObject(); const QJsonObject &wireguarConfig = config.value(ProtocolProps::protoToString(Proto::WireGuard)).toObject();
const QJsonObject &amneziaWireguarConfig = const QJsonObject &amneziaWireguarConfig = config.value(ProtocolProps::protoToString(Proto::Awg)).toObject();
config.value(ProtocolProps::protoToString(Proto::Awg)).toObject();
const QJsonObject &sftpConfig = config.value(ProtocolProps::protoToString(Proto::Sftp)).toObject(); const QJsonObject &sftpConfig = config.value(ProtocolProps::protoToString(Proto::Sftp)).toObject();
Vars vars; Vars vars;
@@ -591,33 +590,21 @@ ServerController::Vars ServerController::genVarsForScript(const ServerCredential
// Amnezia wireguard vars // Amnezia wireguard vars
vars.append({ { "$AWG_SERVER_PORT", vars.append({ { "$AWG_SERVER_PORT",
amneziaWireguarConfig.value(config_key::port).toString(protocols::awg::defaultPort) } }); amneziaWireguarConfig.value(config_key::port).toString(protocols::awg::defaultPort) } });
vars.append({ { "$JUNK_PACKET_COUNT",
amneziaWireguarConfig.value(config_key::junkPacketCount) vars.append({ { "$JUNK_PACKET_COUNT", amneziaWireguarConfig.value(config_key::junkPacketCount).toString() } });
.toString(protocols::awg::defaultJunkPacketCount) } }); vars.append({ { "$JUNK_PACKET_MIN_SIZE", amneziaWireguarConfig.value(config_key::junkPacketMinSize).toString() } });
vars.append({ { "$JUNK_PACKET_MIN_SIZE", vars.append({ { "$JUNK_PACKET_MAX_SIZE", amneziaWireguarConfig.value(config_key::junkPacketMaxSize).toString() } });
amneziaWireguarConfig.value(config_key::junkPacketMinSize) vars.append({ { "$INIT_PACKET_JUNK_SIZE", amneziaWireguarConfig.value(config_key::initPacketJunkSize).toString() } });
.toString(protocols::awg::defaultJunkPacketMinSize) } });
vars.append({ { "$JUNK_PACKET_MAX_SIZE",
amneziaWireguarConfig.value(config_key::junkPacketMaxSize)
.toString(protocols::awg::defaultJunkPacketMaxSize) } });
vars.append({ { "$INIT_PACKET_JUNK_SIZE",
amneziaWireguarConfig.value(config_key::initPacketJunkSize)
.toString(protocols::awg::defaultInitPacketJunkSize) } });
vars.append({ { "$RESPONSE_PACKET_JUNK_SIZE", vars.append({ { "$RESPONSE_PACKET_JUNK_SIZE",
amneziaWireguarConfig.value(config_key::responsePacketJunkSize) amneziaWireguarConfig.value(config_key::responsePacketJunkSize).toString() } });
.toString(protocols::awg::defaultResponsePacketJunkSize) } });
vars.append({ { "$INIT_PACKET_MAGIC_HEADER", vars.append({ { "$INIT_PACKET_MAGIC_HEADER",
amneziaWireguarConfig.value(config_key::initPacketMagicHeader) amneziaWireguarConfig.value(config_key::initPacketMagicHeader).toString() } });
.toString(protocols::awg::defaultInitPacketMagicHeader) } });
vars.append({ { "$RESPONSE_PACKET_MAGIC_HEADER", vars.append({ { "$RESPONSE_PACKET_MAGIC_HEADER",
amneziaWireguarConfig.value(config_key::responsePacketMagicHeader) amneziaWireguarConfig.value(config_key::responsePacketMagicHeader).toString() } });
.toString(protocols::awg::defaultResponsePacketMagicHeader) } });
vars.append({ { "$UNDERLOAD_PACKET_MAGIC_HEADER", vars.append({ { "$UNDERLOAD_PACKET_MAGIC_HEADER",
amneziaWireguarConfig.value(config_key::underloadPacketMagicHeader) amneziaWireguarConfig.value(config_key::underloadPacketMagicHeader).toString() } });
.toString(protocols::awg::defaultUnderloadPacketMagicHeader) } });
vars.append({ { "$TRANSPORT_PACKET_MAGIC_HEADER", vars.append({ { "$TRANSPORT_PACKET_MAGIC_HEADER",
amneziaWireguarConfig.value(config_key::transportPacketMagicHeader) amneziaWireguarConfig.value(config_key::transportPacketMagicHeader).toString() } });
.toString(protocols::awg::defaultTransportPacketMagicHeader) } });
QString serverIp = Utils::getIPAddress(credentials.hostName); QString serverIp = Utils::getIPAddress(credentials.hostName);
if (!serverIp.isEmpty()) { if (!serverIp.isEmpty()) {
+27 -14
View File
@@ -1,5 +1,7 @@
#include "protocols_defs.h" #include "protocols_defs.h"
#include <QRandomGenerator>
using namespace amnezia; using namespace amnezia;
QDebug operator<<(QDebug debug, const amnezia::ProtocolEnumNS::Proto &p) QDebug operator<<(QDebug debug, const amnezia::ProtocolEnumNS::Proto &p)
@@ -66,13 +68,12 @@ QMap<amnezia::Proto, QString> ProtocolProps::protocolHumanNames()
{ Proto::ShadowSocks, "ShadowSocks" }, { Proto::ShadowSocks, "ShadowSocks" },
{ Proto::Cloak, "Cloak" }, { Proto::Cloak, "Cloak" },
{ Proto::WireGuard, "WireGuard" }, { Proto::WireGuard, "WireGuard" },
{ Proto::WireGuard, "AmneziaWG" }, { Proto::Awg, "AmneziaWG" },
{ Proto::Ikev2, "IKEv2" }, { Proto::Ikev2, "IKEv2" },
{ Proto::L2tp, "L2TP" }, { Proto::L2tp, "L2TP" },
{ Proto::TorWebSite, "Website in Tor network" }, { Proto::TorWebSite, "Website in Tor network" },
{ Proto::Dns, "DNS Service" }, { Proto::Dns, "DNS Service" },
{ Proto::FileShare, "File Sharing Service" },
{ Proto::Sftp, QObject::tr("Sftp service") } }; { Proto::Sftp, QObject::tr("Sftp service") } };
} }
@@ -90,28 +91,42 @@ amnezia::ServiceType ProtocolProps::protocolService(Proto p)
case Proto::ShadowSocks: return ServiceType::Vpn; case Proto::ShadowSocks: return ServiceType::Vpn;
case Proto::WireGuard: return ServiceType::Vpn; case Proto::WireGuard: return ServiceType::Vpn;
case Proto::Awg: return ServiceType::Vpn; case Proto::Awg: return ServiceType::Vpn;
case Proto::Ikev2: return ServiceType::Vpn;
case Proto::TorWebSite: return ServiceType::Other; case Proto::TorWebSite: return ServiceType::Other;
case Proto::Dns: return ServiceType::Other; case Proto::Dns: return ServiceType::Other;
case Proto::FileShare: return ServiceType::Other; case Proto::Sftp: return ServiceType::Other;
default: return ServiceType::Other; default: return ServiceType::Other;
} }
} }
int ProtocolProps::getPortForInstall(Proto p)
{
switch (p) {
case Awg:
case WireGuard:
case ShadowSocks:
case OpenVpn:
return QRandomGenerator::global()->bounded(30000, 50000);
default:
return defaultPort(p);
}
}
int ProtocolProps::defaultPort(Proto p) int ProtocolProps::defaultPort(Proto p)
{ {
switch (p) { switch (p) {
case Proto::Any: return -1; case Proto::Any: return -1;
case Proto::OpenVpn: return 1194; case Proto::OpenVpn: return QString(protocols::openvpn::defaultPort).toInt();
case Proto::Cloak: return 443; case Proto::Cloak: return QString(protocols::cloak::defaultPort).toInt();
case Proto::ShadowSocks: return 6789; case Proto::ShadowSocks: return QString(protocols::shadowsocks::defaultPort).toInt();
case Proto::WireGuard: return 51820; case Proto::WireGuard: return QString(protocols::wireguard::defaultPort).toInt();
case Proto::Awg: return 55424; case Proto::Awg: return QString(protocols::awg::defaultPort).toInt();
case Proto::Ikev2: return -1; case Proto::Ikev2: return -1;
case Proto::L2tp: return -1; case Proto::L2tp: return -1;
case Proto::TorWebSite: return -1; case Proto::TorWebSite: return -1;
case Proto::Dns: return 53; case Proto::Dns: return 53;
case Proto::FileShare: return 139;
case Proto::Sftp: return 222; case Proto::Sftp: return 222;
default: return -1; default: return -1;
} }
@@ -129,10 +144,10 @@ bool ProtocolProps::defaultPortChangeable(Proto p)
case Proto::Ikev2: return false; case Proto::Ikev2: return false;
case Proto::L2tp: return false; case Proto::L2tp: return false;
case Proto::TorWebSite: return true; case Proto::TorWebSite: return false;
case Proto::Dns: return false; case Proto::Dns: return false;
case Proto::FileShare: return false; case Proto::Sftp: return true;
default: return -1; default: return false;
} }
} }
@@ -150,7 +165,6 @@ TransportProto ProtocolProps::defaultTransportProto(Proto p)
// non-vpn // non-vpn
case Proto::TorWebSite: return TransportProto::Tcp; case Proto::TorWebSite: return TransportProto::Tcp;
case Proto::Dns: return TransportProto::Udp; case Proto::Dns: return TransportProto::Udp;
case Proto::FileShare: return TransportProto::Udp;
case Proto::Sftp: return TransportProto::Tcp; case Proto::Sftp: return TransportProto::Tcp;
} }
} }
@@ -169,7 +183,6 @@ bool ProtocolProps::defaultTransportProtoChangeable(Proto p)
// non-vpn // non-vpn
case Proto::TorWebSite: return false; case Proto::TorWebSite: return false;
case Proto::Dns: return false; case Proto::Dns: return false;
case Proto::FileShare: return false;
case Proto::Sftp: return false; case Proto::Sftp: return false;
default: return false; default: return false;
} }
+2 -1
View File
@@ -195,7 +195,6 @@ namespace amnezia
// non-vpn // non-vpn
TorWebSite, TorWebSite,
Dns, Dns,
FileShare,
Sftp Sftp
}; };
Q_ENUM_NS(Proto) Q_ENUM_NS(Proto)
@@ -229,6 +228,8 @@ namespace amnezia
Q_INVOKABLE static ServiceType protocolService(Proto p); Q_INVOKABLE static ServiceType protocolService(Proto p);
Q_INVOKABLE static int getPortForInstall(Proto p);
Q_INVOKABLE static int defaultPort(Proto p); Q_INVOKABLE static int defaultPort(Proto p);
Q_INVOKABLE static bool defaultPortChangeable(Proto p); Q_INVOKABLE static bool defaultPortChangeable(Proto p);
+1
View File
@@ -216,6 +216,7 @@
<file>ui/qml/Pages2/PageServiceDnsSettings.qml</file> <file>ui/qml/Pages2/PageServiceDnsSettings.qml</file>
<file>ui/qml/Controls2/TopCloseButtonType.qml</file> <file>ui/qml/Controls2/TopCloseButtonType.qml</file>
<file>images/controls/x-circle.svg</file> <file>images/controls/x-circle.svg</file>
<file>ui/qml/Controls2/Drawer2Type.qml</file>
<file>ui/qml/Pages2/PageProtocolAwgSettings.qml</file> <file>ui/qml/Pages2/PageProtocolAwgSettings.qml</file>
<file>server_scripts/awg/template.conf</file> <file>server_scripts/awg/template.conf</file>
<file>server_scripts/awg/start.sh</file> <file>server_scripts/awg/start.sh</file>
+1 -1
View File
@@ -8,7 +8,7 @@ if ! command -v sudo > /dev/null 2>&1; then $pm update -yq; $pm install -yq sudo
if ! command -v fuser > /dev/null 2>&1; then sudo $pm install -yq psmisc; fi;\ if ! command -v fuser > /dev/null 2>&1; then sudo $pm install -yq psmisc; fi;\
if ! command -v lsof > /dev/null 2>&1; then sudo $pm install -yq lsof; fi;\ if ! command -v lsof > /dev/null 2>&1; then sudo $pm install -yq lsof; fi;\
if ! command -v docker > /dev/null 2>&1; then sudo $pm update -yq; sudo $pm install -yq $docker_pkg;\ if ! command -v docker > /dev/null 2>&1; then sudo $pm update -yq; sudo $pm install -yq $docker_pkg;\
if [ "$dist" = "fedora" ] || [ "$dist" = "debian" ]; then sudo systemctl enable docker && sudo systemctl start docker; fi;\ if [ "$dist" = "fedora" ] || [ "$dist" = "centos" ] || [ "$dist" = "debian" ]; then sudo systemctl enable docker && sudo systemctl start docker; fi;\
fi;\ fi;\
if [ "$dist" = "debian" ]; then \ if [ "$dist" = "debian" ]; then \
docker_service=$(systemctl list-units --full --all | grep docker.service | grep -v inactive | grep -v dead | grep -v failed);\ docker_service=$(systemctl list-units --full --all | grep docker.service | grep -v inactive | grep -v dead | grep -v failed);\
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -144,8 +144,6 @@ void ImportController::importConfig()
if (credentials.isValid() || m_config.contains(config_key::containers)) { if (credentials.isValid() || m_config.contains(config_key::containers)) {
m_serversModel->addServer(m_config); m_serversModel->addServer(m_config);
m_serversModel->setDefaultServerIndex(m_serversModel->getServersCount() - 1);
emit importFinished(); emit importFinished();
} else { } else {
qDebug() << "Failed to import profile"; qDebug() << "Failed to import profile";
+35 -3
View File
@@ -5,6 +5,7 @@
#include <QEventLoop> #include <QEventLoop>
#include <QJsonObject> #include <QJsonObject>
#include <QStandardPaths> #include <QStandardPaths>
#include <QRandomGenerator>
#include "core/errorstrings.h" #include "core/errorstrings.h"
#include "core/servercontroller.h" #include "core/servercontroller.h"
@@ -73,6 +74,38 @@ void InstallController::install(DockerContainer container, int port, TransportPr
containerConfig.insert(config_key::transport_proto, containerConfig.insert(config_key::transport_proto,
ProtocolProps::transportProtoToString(transportProto, protocol)); ProtocolProps::transportProtoToString(transportProto, protocol));
if (container == DockerContainer::Awg) {
QString junkPacketCount = QString::number(QRandomGenerator::global()->bounded(3, 10));
QString junkPacketMinSize = QString::number(50);
QString junkPacketMaxSize = QString::number(1000);
QString initPacketJunkSize = QString::number(QRandomGenerator::global()->bounded(15, 150));
QString responsePacketJunkSize = QString::number(QRandomGenerator::global()->bounded(15, 150));
QSet<QString> headersValue;
while (headersValue.size() != 4) {
auto max = (std::numeric_limits<qint32>::max)();
headersValue.insert(QString::number(QRandomGenerator::global()->bounded(1, max)));
}
auto headersValueList = headersValue.values();
QString initPacketMagicHeader = headersValueList.at(0);
QString responsePacketMagicHeader = headersValueList.at(1);
QString underloadPacketMagicHeader = headersValueList.at(2);
QString transportPacketMagicHeader = headersValueList.at(3);
containerConfig[config_key::junkPacketCount] = junkPacketCount;
containerConfig[config_key::junkPacketMinSize] = junkPacketMinSize;
containerConfig[config_key::junkPacketMaxSize] = junkPacketMaxSize;
containerConfig[config_key::initPacketJunkSize] = initPacketJunkSize;
containerConfig[config_key::responsePacketJunkSize] = responsePacketJunkSize;
containerConfig[config_key::initPacketMagicHeader] = initPacketMagicHeader;
containerConfig[config_key::responsePacketMagicHeader] = responsePacketMagicHeader;
containerConfig[config_key::underloadPacketMagicHeader] = underloadPacketMagicHeader;
containerConfig[config_key::transportPacketMagicHeader] = transportPacketMagicHeader;
}
if (container == DockerContainer::Sftp) { if (container == DockerContainer::Sftp) {
containerConfig.insert(config_key::userName, protocols::sftp::defaultUserName); containerConfig.insert(config_key::userName, protocols::sftp::defaultUserName);
containerConfig.insert(config_key::password, Utils::getRandomString(10)); containerConfig.insert(config_key::password, Utils::getRandomString(10));
@@ -132,7 +165,6 @@ void InstallController::installServer(DockerContainer container, QJsonObject &co
server.insert(config_key::defaultContainer, ContainerProps::containerToString(container)); server.insert(config_key::defaultContainer, ContainerProps::containerToString(container));
m_serversModel->addServer(server); m_serversModel->addServer(server);
m_serversModel->setDefaultServerIndex(m_serversModel->getServersCount() - 1);
emit installServerFinished(finishMessage); emit installServerFinished(finishMessage);
return; return;
@@ -183,7 +215,6 @@ void InstallController::installContainer(DockerContainer container, QJsonObject
"All installed containers have been added to the application"); "All installed containers have been added to the application");
} }
m_containersModel->setData(m_containersModel->index(0, 0), container, ContainersModel::Roles::IsDefaultRole);
emit installContainerFinished(finishMessage, ContainerProps::containerService(container) == ServiceType::Other); emit installContainerFinished(finishMessage, ContainerProps::containerService(container) == ServiceType::Other);
return; return;
} }
@@ -473,8 +504,9 @@ void InstallController::addEmptyServer()
server.insert(config_key::port, m_currentlyInstalledServerCredentials.port); server.insert(config_key::port, m_currentlyInstalledServerCredentials.port);
server.insert(config_key::description, m_settings->nextAvailableServerName()); server.insert(config_key::description, m_settings->nextAvailableServerName());
server.insert(config_key::defaultContainer, ContainerProps::containerToString(DockerContainer::None));
m_serversModel->addServer(server); m_serversModel->addServer(server);
m_serversModel->setDefaultServerIndex(m_serversModel->getServersCount() - 1);
emit installServerFinished(tr("Server added successfully")); emit installServerFinished(tr("Server added successfully"));
} }
+8 -1
View File
@@ -41,7 +41,7 @@ bool ContainersModel::setData(const QModelIndex &index, const QVariant &value, i
// return container; // return container;
case IsInstalledRole: case IsInstalledRole:
// return m_settings->containers(m_currentlyProcessedServerIndex).contains(container); // return m_settings->containers(m_currentlyProcessedServerIndex).contains(container);
case IsDefaultRole: { case IsDefaultRole: { //todo remove
m_settings->setDefaultContainer(m_currentlyProcessedServerIndex, container); m_settings->setDefaultContainer(m_currentlyProcessedServerIndex, container);
m_defaultContainerIndex = container; m_defaultContainerIndex = container;
emit defaultContainerChanged(); emit defaultContainerChanged();
@@ -117,6 +117,13 @@ QString ContainersModel::getDefaultContainerName()
return ContainerProps::containerHumanNames().value(m_defaultContainerIndex); return ContainerProps::containerHumanNames().value(m_defaultContainerIndex);
} }
void ContainersModel::setDefaultContainer(DockerContainer container)
{
m_settings->setDefaultContainer(m_currentlyProcessedServerIndex, container);
m_defaultContainerIndex = container;
emit defaultContainerChanged();
}
int ContainersModel::getCurrentlyProcessedContainerIndex() int ContainersModel::getCurrentlyProcessedContainerIndex()
{ {
return m_currentlyProcessedContainerIndex; return m_currentlyProcessedContainerIndex;
+1
View File
@@ -46,6 +46,7 @@ public:
public slots: public slots:
DockerContainer getDefaultContainer(); DockerContainer getDefaultContainer();
QString getDefaultContainerName(); QString getDefaultContainerName();
void setDefaultContainer(DockerContainer container);
void setCurrentlyProcessedServerIndex(const int index); void setCurrentlyProcessedServerIndex(const int index);
+4 -5
View File
@@ -78,12 +78,11 @@ PageLoader::PageEnum ProtocolsModel::protocolPage(Proto protocol) const
case Proto::ShadowSocks: return PageLoader::PageEnum::PageProtocolShadowSocksSettings; case Proto::ShadowSocks: return PageLoader::PageEnum::PageProtocolShadowSocksSettings;
case Proto::WireGuard: return PageLoader::PageEnum::PageProtocolWireGuardSettings; case Proto::WireGuard: return PageLoader::PageEnum::PageProtocolWireGuardSettings;
case Proto::Ikev2: return PageLoader::PageEnum::PageProtocolIKev2Settings; case Proto::Ikev2: return PageLoader::PageEnum::PageProtocolIKev2Settings;
case Proto::L2tp: return PageLoader::PageEnum::PageProtocolOpenVpnSettings; case Proto::L2tp: return PageLoader::PageEnum::PageProtocolIKev2Settings;
// non-vpn // non-vpn
case Proto::TorWebSite: return PageLoader::PageEnum::PageProtocolOpenVpnSettings; case Proto::TorWebSite: return PageLoader::PageEnum::PageServiceTorWebsiteSettings;
case Proto::Dns: return PageLoader::PageEnum::PageProtocolOpenVpnSettings; case Proto::Dns: return PageLoader::PageEnum::PageServiceDnsSettings;
case Proto::FileShare: return PageLoader::PageEnum::PageProtocolOpenVpnSettings; case Proto::Sftp: return PageLoader::PageEnum::PageServiceSftpSettings;
case Proto::Sftp: return PageLoader::PageEnum::PageProtocolOpenVpnSettings;
default: return PageLoader::PageEnum::PageProtocolOpenVpnSettings; default: return PageLoader::PageEnum::PageProtocolOpenVpnSettings;
} }
} }
+1 -1
View File
@@ -96,7 +96,7 @@ void ServersModel::setDefaultServerIndex(const int index)
{ {
m_settings->setDefaultServer(index); m_settings->setDefaultServer(index);
m_defaultServerIndex = m_settings->defaultServerIndex(); m_defaultServerIndex = m_settings->defaultServerIndex();
emit defaultServerIndexChanged(); emit defaultServerIndexChanged(m_defaultServerIndex);
} }
const int ServersModel::getDefaultServerIndex() const int ServersModel::getDefaultServerIndex()
+1 -1
View File
@@ -64,7 +64,7 @@ protected:
signals: signals:
void currentlyProcessedServerIndexChanged(const int index); void currentlyProcessedServerIndexChanged(const int index);
void defaultServerIndexChanged(); void defaultServerIndexChanged(const int index);
void defaultServerNameChanged(); void defaultServerNameChanged();
private: private:
@@ -142,6 +142,7 @@ Button {
PageController.setTriggeredBtConnectButton(true) PageController.setTriggeredBtConnectButton(true)
ServersModel.currentlyProcessedIndex = ServersModel.getDefaultServerIndex() ServersModel.currentlyProcessedIndex = ServersModel.getDefaultServerIndex()
InstallController.setShouldCreateServer(false)
PageController.goToPage(PageEnum.PageSetupWizardEasy) PageController.goToPage(PageEnum.PageSetupWizardEasy)
return return
@@ -8,28 +8,29 @@ import "../Controls2"
import "../Controls2/TextTypes" import "../Controls2/TextTypes"
import "../Config" import "../Config"
DrawerType { Drawer2Type {
id: root id: root
width: parent.width width: parent.width
height: parent.height * 0.4375 height: parent.height
contentHeight: parent.height * 0.4375
ColumnLayout { ColumnLayout {
parent: root.contentParent
anchors.top: parent.top anchors.top: parent.top
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
spacing: 0 spacing: 0
Header2TextType { Header2Type {
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 24 Layout.topMargin: 24
Layout.rightMargin: 16 Layout.rightMargin: 16
Layout.leftMargin: 16 Layout.leftMargin: 16
Layout.bottomMargin: 32 Layout.bottomMargin: 16
Layout.alignment: Qt.AlignHCenter
text: qsTr("Connection data") headerText: qsTr("Add new connection")
wrapMode: Text.WordWrap
} }
LabelWithButtonType { LabelWithButtonType {
@@ -37,7 +38,7 @@ DrawerType {
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 16 Layout.topMargin: 16
text: qsTr("Server IP, login and password") text: qsTr("Configure your server")
rightImageSource: "qrc:/images/controls/chevron-right.svg" rightImageSource: "qrc:/images/controls/chevron-right.svg"
clickedFunction: function() { clickedFunction: function() {
@@ -51,7 +52,7 @@ DrawerType {
LabelWithButtonType { LabelWithButtonType {
Layout.fillWidth: true Layout.fillWidth: true
text: qsTr("QR code, key or configuration file") text: qsTr("Open config file, key or QR code")
rightImageSource: "qrc:/images/controls/chevron-right.svg" rightImageSource: "qrc:/images/controls/chevron-right.svg"
clickedFunction: function() { clickedFunction: function() {
@@ -50,34 +50,26 @@ ListView {
imageSource: "qrc:/images/controls/download.svg" imageSource: "qrc:/images/controls/download.svg"
showImage: !isInstalled showImage: !isInstalled
checkable: isInstalled checkable: isInstalled && !ConnectionController.isConnected && isSupported
checked: isDefault checked: isDefault
onPressed: function(mouse) {
if (!isSupported) {
PageController.showErrorMessage(qsTr("The selected protocol is not supported on the current platform"))
}
}
onClicked: { onClicked: {
if (checked) { if (ConnectionController.isConnected && isInstalled) {
var needReconnected = false PageController.showNotificationMessage(qsTr("Unable change protocol while there is an active connection"))
if (!isDefault) { return
needReconnected = true
} }
if (checked) {
isDefault = true isDefault = true
menuContent.currentIndex = index menuContent.currentIndex = index
containersDropDown.menuVisible = false containersDropDown.menu.close()
if (needReconnected && (ConnectionController.isConnected || ConnectionController.isConnectionInProgress)) {
PageController.showNotificationMessage(qsTr("Reconnect via VPN Procotol: ") + name)
PageController.goToPageHome()
ConnectionController.openConnection()
}
} else { } else {
if (!isSupported && isInstalled) {
PageController.showErrorMessage(qsTr("The selected protocol is not supported on the current platform"))
return
}
ContainersModel.setCurrentlyProcessedContainerIndex(proxyContainersModel.mapToSource(index)) ContainersModel.setCurrentlyProcessedContainerIndex(proxyContainersModel.mapToSource(index))
InstallController.setShouldCreateServer(false) InstallController.setShouldCreateServer(false)
PageController.goToPage(PageEnum.PageSetupWizardProtocolSettings) PageController.goToPage(PageEnum.PageSetupWizardProtocolSettings)
+8 -2
View File
@@ -5,7 +5,7 @@ import QtQuick.Layouts
import "../Controls2" import "../Controls2"
import "../Controls2/TextTypes" import "../Controls2/TextTypes"
DrawerType { Drawer2Type {
id: root id: root
property string headerText property string headerText
@@ -15,11 +15,15 @@ DrawerType {
property var yesButtonFunction property var yesButtonFunction
property var noButtonFunction property var noButtonFunction
property real drawerHeight: 0.5
width: parent.width width: parent.width
height: parent.height * 0.5 height: parent.height
contentHeight: parent.height * drawerHeight
ColumnLayout { ColumnLayout {
parent: root.contentParent
anchors.top: parent.top anchors.top: parent.top
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
@@ -27,6 +31,8 @@ DrawerType {
anchors.rightMargin: 16 anchors.rightMargin: 16
anchors.leftMargin: 16 anchors.leftMargin: 16
// visible: false
spacing: 8 spacing: 8
Header2TextType { Header2TextType {
@@ -5,15 +5,18 @@ import QtQuick.Layouts
import "../Controls2" import "../Controls2"
import "../Controls2/TextTypes" import "../Controls2/TextTypes"
DrawerType { Drawer2Type {
id: root id: root
width: parent.width width: parent.width
height: parent.height * 0.9 height: parent.height
contentHeight: parent.height * 0.9
ColumnLayout { ColumnLayout {
id: backButton id: backButton
parent: root.contentParent
anchors.top: parent.top anchors.top: parent.top
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
@@ -28,6 +31,7 @@ DrawerType {
} }
FlickableType { FlickableType {
parent: root.contentParent
anchors.top: backButton.bottom anchors.top: backButton.bottom
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
@@ -16,7 +16,7 @@ import "../Controls2/TextTypes"
import "../Config" import "../Config"
import "../Components" import "../Components"
DrawerType { Drawer2Type {
id: root id: root
property alias headerText: header.headerText property alias headerText: header.headerText
@@ -28,9 +28,10 @@ DrawerType {
property string configFileName: "amnezia_config.vpn" property string configFileName: "amnezia_config.vpn"
width: parent.width width: parent.width
height: parent.height * 0.9 height: parent.height
contentHeight: parent.height * 0.9
onClosed: { onDrawerClosed: {
configExtension = ".vpn" configExtension = ".vpn"
configCaption = qsTr("Save AmneziaVPN config") configCaption = qsTr("Save AmneziaVPN config")
configFileName = "amnezia_config" configFileName = "amnezia_config"
@@ -41,6 +42,9 @@ DrawerType {
Header2Type { Header2Type {
id: header id: header
parent: root.contentParent
anchors.top: parent.top anchors.top: parent.top
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
@@ -50,6 +54,8 @@ DrawerType {
} }
FlickableType { FlickableType {
parent: root.contentParent
anchors.top: header.bottom anchors.top: header.bottom
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
contentHeight: content.height + 32 contentHeight: content.height + 32
@@ -126,30 +132,37 @@ DrawerType {
text: qsTr("Show connection settings") text: qsTr("Show connection settings")
onClicked: { onClicked: {
configContentDrawer.visible = true configContentDrawer.open()
} }
} }
DrawerType { Drawer2Type {
id: configContentDrawer id: configContentDrawer
parent: root
width: parent.width width: parent.width
height: parent.height * 0.9 height: parent.height
contentHeight: parent.height * 0.9
BackButtonType { BackButtonType {
id: backButton id: backButton
parent: configContentDrawer.contentParent
anchors.top: parent.top anchors.top: parent.top
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
anchors.topMargin: 16 anchors.topMargin: 16
backButtonFunction: function() { backButtonFunction: function() {
configContentDrawer.visible = false configContentDrawer.close()
} }
} }
FlickableType { FlickableType {
parent: configContentDrawer.contentParent
anchors.top: backButton.bottom anchors.top: backButton.bottom
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
+12
View File
@@ -26,4 +26,16 @@ Item {
} }
return false return false
} }
TextEdit{
id: clipboard
visible: false
}
function copyToClipBoard(text) {
clipboard.text = text
clipboard.selectAll()
clipboard.copy()
clipboard.select(0, 0)
}
} }
+2
View File
@@ -81,6 +81,7 @@ RadioButton {
Text { Text {
text: root.headerText text: root.headerText
wrapMode: Text.WordWrap
color: "#D7D8DB" color: "#D7D8DB"
font.pixelSize: 25 font.pixelSize: 25
font.weight: 700 font.weight: 700
@@ -110,6 +111,7 @@ RadioButton {
Text { Text {
text: root.footerText text: root.footerText
wrapMode: Text.WordWrap
visible: root.footerText !== "" visible: root.footerText !== ""
color: "#878B91" color: "#878B91"
font.pixelSize: 13 font.pixelSize: 13
+314
View File
@@ -0,0 +1,314 @@
import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
import QtQuick.Shapes
Item {
id: root
Connections {
target: PageController
function onForceCloseDrawer() {
if (root.expanded()) {
collapse()
}
}
}
signal drawerClosed
signal collapsedEntered
signal collapsedExited
signal collapsedEnter
signal collapsedPressChanged
visible: false
property bool needCloseButton: true
property string defaultColor: "#1C1D21"
property string borderColor: "#2C2D30"
property string semitransparentColor: "#90000000"
property bool needCollapsed: false
property int contentHeight: 0
property Item contentParent: contentArea
property bool dragActive: dragArea.drag.active
property int collapsedHeight: 0
property bool fullMouseAreaVisible: true
property MouseArea drawerDragArea: dragArea
state: "collapsed"
Rectangle {
id: draw2Background
anchors.fill: parent
height: parent.height
width: parent.width
radius: 16
color: "transparent"
border.color: "transparent"
border.width: 1
visible: true
MouseArea {
id: fullMouseArea
anchors.fill: parent
enabled: root.expanded()
hoverEnabled: true
visible: fullMouseAreaVisible
onClicked: {
if (root.expanded()) {
collapse()
}
}
}
Rectangle {
id: placeAreaHolder
// for apdating home drawer, normal drawer will reset it
height: 0
anchors.right: parent.right
anchors.left: parent.left
visible: true
color: "transparent"
Drag.active: dragArea.drag.active
}
Rectangle {
id: contentArea
anchors.top: placeAreaHolder.bottom
height: contentHeight
radius: 16
color: root.defaultColor
border.width: 1
border.color: root.borderColor
width: parent.width
visible: true
Rectangle {
width: parent.radius
height: parent.radius
anchors.bottom: parent.bottom
anchors.right: parent.right
anchors.left: parent.left
color: parent.color
}
MouseArea {
id: dragArea
anchors.fill: parent
cursorShape: root.collapsed() ? Qt.PointingHandCursor : Qt.ArrowCursor
hoverEnabled: true
drag.target: placeAreaHolder
drag.axis: Drag.YAxis
drag.maximumY: root.height - root.collapsedHeight
drag.minimumY: root.collapsedHeight > 0 ? root.height - root.height * 0.9 : 0
/** If drag area is released at any point other than min or max y, transition to the other state */
onReleased: {
if (root.collapsed() && placeAreaHolder.y < drag.maximumY) {
root.state = "expanded"
return
}
if (root.expanded() && placeAreaHolder.y > drag.minimumY) {
root.state = "collapsed"
return
}
}
onClicked: {
if (root.expanded()) {
collapse()
return
}
if (root.collapsed()) {
root.state = "expanded"
}
}
onExited: {
collapsedExited()
}
onEntered: {
collapsedEnter()
}
onPressedChanged: {
collapsedPressChanged()
}
}
}
}
onStateChanged: {
if (root.collapsed()) {
var initialPageNavigationBarColor = PageController.getInitialPageNavigationBarColor()
if (initialPageNavigationBarColor !== 0xFF1C1D21) {
PageController.updateNavigationBarColor(initialPageNavigationBarColor)
}
if (needCloseButton) {
PageController.drawerClose()
}
drawerClosed()
return
}
if (root.expanded()) {
if (PageController.getInitialPageNavigationBarColor() !== 0xFF1C1D21) {
PageController.updateNavigationBarColor(0xFF1C1D21)
}
if (needCloseButton) {
PageController.drawerOpen()
}
return
}
}
/** Two states of buttonContent, great place to add any future animations for the drawer */
states: [
State {
name: "collapsed"
PropertyChanges {
target: placeAreaHolder
y: dragArea.drag.maximumY
}
},
State {
name: "expanded"
PropertyChanges {
target: placeAreaHolder
y: dragArea.drag.minimumY
}
}
]
transitions: [
Transition {
from: "expanded"
to: "collapsed"
PropertyAnimation {
target: placeAreaHolder
properties: "y"
duration: 200
}
onRunningChanged: {
if (!running) {
draw2Background.color = "transparent"
fullMouseArea.visible = false
}
}
},
Transition {
from: "collapsed"
to: "expanded"
PropertyAnimation {
target: placeAreaHolder
properties: "y"
duration: 200
}
onRunningChanged: {
if (!running) {
draw2Background.color = semitransparentColor
fullMouseArea.visible = true
}
}
}
]
NumberAnimation {
id: animationVisible
target: placeAreaHolder
property: "y"
from: parent.height
to: 0
duration: 200
}
// for normal drawer
function open() {
if (root.expanded()) {
return
}
draw2Background.color = semitransparentColor
fullMouseArea.visible = true
collapsedHeight = 0
root.y = 0
root.state = "expanded"
root.visible = true
root.height = parent.height
contentArea.height = contentHeight
placeAreaHolder.y = 0
placeAreaHolder.height = root.height - contentHeight
animationVisible.running = true
}
function close() {
collapse()
}
function collapse() {
draw2Background.color = "transparent"
root.state = "collapsed"
}
// for page home
function expand() {
draw2Background.color = semitransparentColor
root.state = "expanded"
}
function expanded() {
return root.state === "expanded" ? true : false
}
function collapsed() {
return root.state === "collapsed" ? true : false
}
onVisibleChanged: {
// e.g cancel, ......
if (!visible) {
if (root.expanded()) {
if (needCloseButton) {
PageController.drawerClose()
}
close()
}
}
}
}
+14
View File
@@ -1,6 +1,8 @@
import QtQuick import QtQuick
import QtQuick.Controls import QtQuick.Controls
import "../Config"
Drawer { Drawer {
id: drawer id: drawer
property bool needCloseButton: true property bool needCloseButton: true
@@ -39,6 +41,18 @@ Drawer {
border.color: "#2C2D30" border.color: "#2C2D30"
border.width: 1 border.width: 1
Rectangle {
visible: GC.isMobile()
anchors.top: parent.top
anchors.horizontalCenter: parent.horizontalCenter
anchors.topMargin: 10
width: 20
height: 2
color: "#2C2D30"
}
} }
Overlay.modal: Rectangle { Overlay.modal: Rectangle {
+16 -5
View File
@@ -40,6 +40,10 @@ Item {
property alias menuVisible: menu.visible property alias menuVisible: menu.visible
property Item drawerParent: root
property Drawer2Type menu: menu
implicitWidth: rootButtonContent.implicitWidth implicitWidth: rootButtonContent.implicitWidth
implicitHeight: rootButtonContent.implicitHeight implicitHeight: rootButtonContent.implicitHeight
@@ -155,21 +159,26 @@ Item {
onClicked: { onClicked: {
if (rootButtonClickedFunction && typeof rootButtonClickedFunction === "function") { if (rootButtonClickedFunction && typeof rootButtonClickedFunction === "function") {
rootButtonClickedFunction() rootButtonClickedFunction()
} else {
menu.visible = true
} }
menu.open()
} }
} }
DrawerType { Drawer2Type {
id: menu id: menu
parent: drawerParent
width: parent.width width: parent.width
height: parent.height * drawerHeight height: parent.height
contentHeight: parent.height * drawerHeight
ColumnLayout { ColumnLayout {
id: header id: header
parent: menu.contentParent
anchors.top: parent.top anchors.top: parent.top
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
@@ -178,12 +187,14 @@ Item {
BackButtonType { BackButtonType {
backButtonImage: root.headerBackButtonImage backButtonImage: root.headerBackButtonImage
backButtonFunction: function() { backButtonFunction: function() {
root.menuVisible = false menu.close()
} }
} }
} }
FlickableType { FlickableType {
parent: menu.contentParent
anchors.top: header.bottom anchors.top: header.bottom
anchors.topMargin: 16 anchors.topMargin: 16
contentHeight: col.implicitHeight contentHeight: col.implicitHeight
@@ -20,7 +20,9 @@ Item {
property bool isLeftImageHoverEnabled: true //todo separete this qml file to 3 property bool isLeftImageHoverEnabled: true //todo separete this qml file to 3
property string textColor: "#d7d8db" property string textColor: "#d7d8db"
property string textDisabledColor: "#878B91"
property string descriptionColor: "#878B91" property string descriptionColor: "#878B91"
property string descriptionDisabledColor: "#494B50"
property real textOpacity: 1.0 property real textOpacity: 1.0
property string rightImageColor: "#d7d8db" property string rightImageColor: "#d7d8db"
@@ -71,7 +73,14 @@ Item {
ListItemTitleType { ListItemTitleType {
text: root.text text: root.text
color: root.descriptionOnTop ? root.descriptionColor : root.textColor color: {
if (root.enabled) {
return root.descriptionOnTop ? root.descriptionColor : root.textColor
} else {
return root.descriptionOnTop ? root.descriptionDisabledColor : root.textDisabledColor
}
}
maximumLineCount: root.textMaximumLineCount maximumLineCount: root.textMaximumLineCount
elide: root.textElide elide: root.textElide
@@ -96,7 +105,13 @@ Item {
id: description id: description
text: root.descriptionText text: root.descriptionText
color: root.descriptionOnTop ? root.textColor : root.descriptionColor color: {
if (root.enabled) {
return root.descriptionOnTop ? root.textColor : root.descriptionColor
} else {
return root.descriptionOnTop ? root.textDisabledColor : root.descriptionDisabledColor
}
}
opacity: root.textOpacity opacity: root.textOpacity
@@ -157,7 +172,7 @@ Item {
MouseArea { MouseArea {
anchors.fill: parent anchors.fill: parent
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
hoverEnabled: true hoverEnabled: root.enabled
onEntered: { onEntered: {
if (rightImageSource) { if (rightImageSource) {
+4 -7
View File
@@ -30,17 +30,13 @@ Switch {
property string hoveredIndicatorBackgroundColor: Qt.rgba(1, 1, 1, 0.08) property string hoveredIndicatorBackgroundColor: Qt.rgba(1, 1, 1, 0.08)
property string defaultIndicatorBackgroundColor: "transparent" property string defaultIndicatorBackgroundColor: "transparent"
implicitWidth: content.implicitWidth + switcher.implicitWidth
implicitHeight: content.implicitHeight
hoverEnabled: enabled ? true : false hoverEnabled: enabled ? true : false
indicator: Rectangle { indicator: Rectangle {
id: switcher id: switcher
anchors.left: content.right anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.leftMargin: 4
implicitWidth: 52 implicitWidth: 52
implicitHeight: 32 implicitHeight: 32
@@ -90,11 +86,11 @@ Switch {
contentItem: ColumnLayout { contentItem: ColumnLayout {
id: content id: content
anchors.fill: parent anchors.verticalCenter: parent.verticalCenter
anchors.rightMargin: switcher.implicitWidth
ListItemTitleType { ListItemTitleType {
Layout.fillWidth: true Layout.fillWidth: true
rightPadding: indicator.width
text: root.text text: root.text
color: root.enabled ? root.textColor : root.textDisabledColor color: root.enabled ? root.textColor : root.textDisabledColor
@@ -104,6 +100,7 @@ Switch {
id: description id: description
Layout.fillWidth: true Layout.fillWidth: true
rightPadding: indicator.width
color: root.enabled ? root.descriptionTextColor : root.descriptionTextDisabledColor color: root.enabled ? root.descriptionTextColor : root.descriptionTextDisabledColor
+109 -155
View File
@@ -30,13 +30,13 @@ PageType {
target: PageController target: PageController
function onRestorePageHomeState(isContainerInstalled) { function onRestorePageHomeState(isContainerInstalled) {
buttonContent.state = "expanded" buttonContent.collapse()
if (isContainerInstalled) { if (isContainerInstalled) {
containersDropDown.menuVisible = true containersDropDown.menuVisible = true
} }
} }
function onForceCloseDrawer() { function onForceCloseDrawer() {
buttonContent.state = "collapsed" buttonContent.collapse()
} }
} }
@@ -73,14 +73,8 @@ PageType {
expandedServersMenuDescription.text = description + root.defaultServerHostName expandedServersMenuDescription.text = description + root.defaultServerHostName
} }
Component.onCompleted: updateDescriptions() Component.onCompleted: {
updateDescriptions()
MouseArea {
anchors.fill: parent
enabled: buttonContent.state === "expanded"
onClicked: {
buttonContent.state = "collapsed"
}
} }
Item { Item {
@@ -92,56 +86,10 @@ PageType {
} }
} }
MouseArea {
id: dragArea
anchors.fill: buttonBackground
cursorShape: buttonContent.state === "collapsed" ? Qt.PointingHandCursor : Qt.ArrowCursor
hoverEnabled: true
drag.target: buttonContent
drag.axis: Drag.YAxis
drag.maximumY: root.height - buttonContent.collapsedHeight
drag.minimumY: root.height - root.height * 0.9
/** If drag area is released at any point other than min or max y, transition to the other state */
onReleased: {
if (buttonContent.state === "collapsed" && buttonContent.y < dragArea.drag.maximumY) {
buttonContent.state = "expanded"
return
}
if (buttonContent.state === "expanded" && buttonContent.y > dragArea.drag.minimumY) {
buttonContent.state = "collapsed"
return
}
}
onEntered: {
collapsedButtonChevron.backgroundColor = collapsedButtonChevron.hoveredColor
collapsedButtonHeader.opacity = 0.8
}
onExited: {
collapsedButtonChevron.backgroundColor = collapsedButtonChevron.defaultColor
collapsedButtonHeader.opacity = 1
}
onPressedChanged: {
collapsedButtonChevron.backgroundColor = pressed ? collapsedButtonChevron.pressedColor : entered ? collapsedButtonChevron.hoveredColor : collapsedButtonChevron.defaultColor
collapsedButtonHeader.opacity = 0.7
}
onClicked: {
if (buttonContent.state === "collapsed") {
buttonContent.state = "expanded"
}
}
}
Rectangle { Rectangle {
id: buttonBackground id: buttonBackground
anchors { left: buttonContent.left; right: buttonContent.right; top: buttonContent.top } anchors { left: buttonContent.left; right: buttonContent.right; top: buttonContent.top }
height: root.height
radius: 16 radius: 16
color: root.defaultColor color: root.defaultColor
border.color: root.borderColor border.color: root.borderColor
@@ -157,133 +105,91 @@ PageType {
} }
} }
ColumnLayout { Drawer2Type {
id: buttonContent id: buttonContent
visible: true
fullMouseAreaVisible: false
/** Initial height of button content */
property int collapsedHeight: 0
/** True when expanded objects should be visible */ /** True when expanded objects should be visible */
property bool expandedVisibility: buttonContent.state === "expanded" || (buttonContent.state === "collapsed" && dragArea.drag.active === true) property bool expandedVisibility: buttonContent.expanded() || (buttonContent.collapsed() && buttonContent.dragActive)
/** True when collapsed objects should be visible */ /** True when collapsed objects should be visible */
property bool collapsedVisibility: buttonContent.state === "collapsed" && dragArea.drag.active === false property bool collapsedVisibility: buttonContent.collapsed() && !buttonContent.dragActive
Drag.active: dragArea.drag.active width: parent.width
anchors.right: root.right height: parent.height
anchors.left: root.left contentHeight: parent.height * 0.9
y: root.height - buttonContent.height
Component.onCompleted: {
buttonContent.state = "collapsed"
}
/** Set once based on first implicit height change once all children are layed out */ ColumnLayout {
id: collapsedButtonContent
parent: buttonContent.contentParent
visible: buttonContent.collapsedVisibility
anchors.right: parent.right
anchors.left: parent.left
anchors.top: parent.top
onImplicitHeightChanged: { onImplicitHeightChanged: {
if (buttonContent.state === "collapsed" && collapsedHeight == 0) { if (buttonContent.collapsed() && buttonContent.collapsedHeight === 0) {
collapsedHeight = implicitHeight buttonContent.collapsedHeight = implicitHeight
} }
} }
onStateChanged: { DividerType {
if (buttonContent.state === "collapsed") { Layout.topMargin: 10
var initialPageNavigationBarColor = PageController.getInitialPageNavigationBarColor() Layout.fillWidth: false
if (initialPageNavigationBarColor !== 0xFF1C1D21) { Layout.preferredWidth: 20
PageController.updateNavigationBarColor(initialPageNavigationBarColor) Layout.preferredHeight: 2
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
} }
PageController.drawerClose()
return
}
if (buttonContent.state === "expanded") {
if (PageController.getInitialPageNavigationBarColor() !== 0xFF1C1D21) {
PageController.updateNavigationBarColor(0xFF1C1D21)
}
PageController.drawerOpen()
return
}
}
/** Two states of buttonContent, great place to add any future animations for the drawer */
states: [
State {
name: "collapsed"
PropertyChanges {
target: buttonContent
y: root.height - collapsedHeight
}
},
State {
name: "expanded"
PropertyChanges {
target: buttonContent
y: dragArea.drag.minimumY
}
}
]
transitions: [
Transition {
from: "collapsed"
to: "expanded"
PropertyAnimation {
target: buttonContent
properties: "y"
duration: 200
}
},
Transition {
from: "expanded"
to: "collapsed"
PropertyAnimation {
target: buttonContent
properties: "y"
duration: 200
}
}
]
RowLayout { RowLayout {
Layout.topMargin: 24 Layout.topMargin: 14
Layout.leftMargin: 24 Layout.leftMargin: 24
Layout.rightMargin: 24 Layout.rightMargin: 24
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
visible: buttonContent.collapsedVisibility
spacing: 0
Header1TextType { Header1TextType {
id: collapsedButtonHeader id: collapsedButtonHeader
Layout.maximumWidth: buttonContent.width - 48 - 18 - 12 // todo Layout.maximumWidth: root.width - 48 - 18 - 12 // todo
maximumLineCount: 2 maximumLineCount: 2
elide: Qt.ElideRight elide: Qt.ElideRight
text: root.defaultServerName text: root.defaultServerName
horizontalAlignment: Qt.AlignHCenter
Behavior on opacity { Layout.alignment: Qt.AlignLeft
PropertyAnimation { duration: 200 }
}
} }
ImageButtonType { ImageButtonType {
id: collapsedButtonChevron id: collapsedButtonChevron
Layout.leftMargin: 8
hoverEnabled: false hoverEnabled: false
image: "qrc:/images/controls/chevron-down.svg" image: "qrc:/images/controls/chevron-down.svg"
imageColor: "#d7d8db" imageColor: "#d7d8db"
icon.width: 18 horizontalPadding: 0
icon.height: 18 padding: 0
backgroundRadius: 16 spacing: 0
horizontalPadding: 4
topPadding: 4 Rectangle {
bottomPadding: 3 id: rightImageBackground
anchors.fill: parent
radius: 16
color: "transparent"
Behavior on color {
PropertyAnimation { duration: 200 }
}
}
onClicked: { onClicked: {
if (buttonContent.state === "collapsed") { if (buttonContent.collapsed()) {
buttonContent.state = "expanded" buttonContent.expand()
} }
} }
} }
@@ -295,17 +201,34 @@ PageType {
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
visible: buttonContent.collapsedVisibility visible: buttonContent.collapsedVisibility
} }
}
Component.onCompleted: {
buttonContent.collapse()
}
ColumnLayout { ColumnLayout {
id: serversMenuHeader id: serversMenuHeader
Layout.alignment: Qt.AlignTop | Qt.AlignHCenter parent: buttonContent.contentParent
Layout.fillWidth: true
anchors.top: parent.top
anchors.right: parent.right
anchors.left: parent.left
visible: buttonContent.expandedVisibility visible: buttonContent.expandedVisibility
DividerType {
Layout.topMargin: 10
Layout.fillWidth: false
Layout.preferredWidth: 20
Layout.preferredHeight: 2
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
}
Header1TextType { Header1TextType {
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 24 Layout.topMargin: 14
Layout.leftMargin: 16 Layout.leftMargin: 16
Layout.rightMargin: 16 Layout.rightMargin: 16
@@ -330,6 +253,8 @@ PageType {
DropDownType { DropDownType {
id: containersDropDown id: containersDropDown
drawerParent: root
rootButtonImageColor: "#0E0E11" rootButtonImageColor: "#0E0E11"
rootButtonBackgroundColor: "#D7D8DB" rootButtonBackgroundColor: "#D7D8DB"
rootButtonBackgroundHoveredColor: Qt.rgba(215, 216, 219, 0.8) rootButtonBackgroundHoveredColor: Qt.rgba(215, 216, 219, 0.8)
@@ -391,12 +316,18 @@ PageType {
Flickable { Flickable {
id: serversContainer id: serversContainer
Layout.alignment: Qt.AlignTop | Qt.AlignHCenter
Layout.fillWidth: true parent: buttonContent.contentParent
Layout.topMargin: 16
anchors.top: serversMenuHeader.bottom
anchors.right: parent.right
anchors.left: parent.left
anchors.bottom: parent.bottom
anchors.topMargin: 16
contentHeight: col.implicitHeight contentHeight: col.implicitHeight
implicitHeight: root.height - (root.height * 0.1) - serversMenuHeader.implicitHeight - 52 //todo 52 is tabbar height
visible: buttonContent.expandedVisibility visible: buttonContent.expandedVisibility
clip: true clip: true
ScrollBar.vertical: ScrollBar { ScrollBar.vertical: ScrollBar {
@@ -471,10 +402,16 @@ PageType {
} }
checked: index === serversMenuContent.currentIndex checked: index === serversMenuContent.currentIndex
checkable: !ConnectionController.isConnected
ButtonGroup.group: serversRadioButtonGroup ButtonGroup.group: serversRadioButtonGroup
onClicked: { onClicked: {
if (ConnectionController.isConnected) {
PageController.showNotificationMessage(qsTr("Unable change server while there is an active connection"))
return
}
serversMenuContent.currentIndex = index serversMenuContent.currentIndex = index
ServersModel.currentlyProcessedIndex = index ServersModel.currentlyProcessedIndex = index
@@ -500,7 +437,7 @@ PageType {
onClicked: function() { onClicked: function() {
ServersModel.currentlyProcessedIndex = index ServersModel.currentlyProcessedIndex = index
PageController.goToPage(PageEnum.PageSettingsServerInfo) PageController.goToPage(PageEnum.PageSettingsServerInfo)
buttonContent.state = "collapsed" buttonContent.collapse()
} }
} }
} }
@@ -515,5 +452,22 @@ PageType {
} }
} }
} }
onCollapsedEnter: {
collapsedButtonChevron.backgroundColor = collapsedButtonChevron.hoveredColor
collapsedButtonHeader.opacity = 0.8
}
onCollapsedExited: {
collapsedButtonChevron.backgroundColor = collapsedButtonChevron.defaultColor
collapsedButtonHeader.opacity = 1
}
onCollapsedPressChanged: {
collapsedButtonChevron.backgroundColor = buttonContent.drawerDragArea.pressed ?
collapsedButtonChevron.pressedColor : buttonContent.drawerDragArea.entered ?
collapsedButtonChevron.hoveredColor : collapsedButtonChevron.defaultColor
collapsedButtonHeader.opacity = 0.7
}
} }
} }
@@ -286,9 +286,9 @@ PageType {
InstallController.removeCurrentlyProcessedContainer() InstallController.removeCurrentlyProcessedContainer()
} }
questionDrawer.noButtonFunction = function() { questionDrawer.noButtonFunction = function() {
questionDrawer.visible = false questionDrawer.close()
} }
questionDrawer.visible = true questionDrawer.open()
} }
} }
@@ -324,6 +324,7 @@ PageType {
QuestionDrawer { QuestionDrawer {
id: questionDrawer id: questionDrawer
parent: root
} }
} }
} }
@@ -117,6 +117,8 @@ PageType {
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 16 Layout.topMargin: 16
drawerParent: root
descriptionText: qsTr("Cipher") descriptionText: qsTr("Cipher")
headerText: qsTr("Cipher") headerText: qsTr("Cipher")
@@ -5,6 +5,7 @@ import QtQuick.Layouts
import SortFilterProxyModel 0.2 import SortFilterProxyModel 0.2
import PageEnum 1.0 import PageEnum 1.0
import ContainerEnum 1.0
import "./" import "./"
import "../Controls2" import "../Controls2"
@@ -156,6 +157,8 @@ PageType {
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 20 Layout.topMargin: 20
drawerParent: root
enabled: !autoNegotiateEncryprionSwitcher.checked enabled: !autoNegotiateEncryprionSwitcher.checked
descriptionText: qsTr("Hash") descriptionText: qsTr("Hash")
@@ -202,6 +205,8 @@ PageType {
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 16 Layout.topMargin: 16
drawerParent: root
enabled: !autoNegotiateEncryprionSwitcher.checked enabled: !autoNegotiateEncryprionSwitcher.checked
descriptionText: qsTr("Cipher") descriptionText: qsTr("Cipher")
@@ -252,6 +257,8 @@ PageType {
ColumnLayout { ColumnLayout {
id: checkboxLayout id: checkboxLayout
anchors.fill: parent
CheckBoxType { CheckBoxType {
Layout.fillWidth: true Layout.fillWidth: true
@@ -351,6 +358,8 @@ PageType {
Layout.leftMargin: -8 Layout.leftMargin: -8
implicitHeight: 32 implicitHeight: 32
visible: ContainersModel.getCurrentlyProcessedContainerIndex() === ContainerEnum.OpenVpn
defaultColor: "transparent" defaultColor: "transparent"
hoveredColor: Qt.rgba(1, 1, 1, 0.08) hoveredColor: Qt.rgba(1, 1, 1, 0.08)
pressedColor: Qt.rgba(1, 1, 1, 0.12) pressedColor: Qt.rgba(1, 1, 1, 0.12)
@@ -365,14 +374,14 @@ PageType {
questionDrawer.noButtonText = qsTr("Cancel") questionDrawer.noButtonText = qsTr("Cancel")
questionDrawer.yesButtonFunction = function() { questionDrawer.yesButtonFunction = function() {
questionDrawer.visible = false questionDrawer.close()
PageController.goToPage(PageEnum.PageDeinstalling) PageController.goToPage(PageEnum.PageDeinstalling)
InstallController.removeCurrentlyProcessedContainer() InstallController.removeCurrentlyProcessedContainer()
} }
questionDrawer.noButtonFunction = function() { questionDrawer.noButtonFunction = function() {
questionDrawer.visible = false questionDrawer.close()
} }
questionDrawer.visible = true questionDrawer.open()
} }
} }
@@ -397,6 +406,7 @@ PageType {
QuestionDrawer { QuestionDrawer {
id: questionDrawer id: questionDrawer
parent: root
} }
} }
} }
+12 -5
View File
@@ -90,15 +90,19 @@ PageType {
DividerType {} DividerType {}
DrawerType { Drawer2Type {
id: configContentDrawer id: configContentDrawer
parent: root
width: parent.width width: parent.width
height: parent.height * 0.9 height: parent.height
contentHeight: parent.height * 0.9
BackButtonType { BackButtonType {
id: backButton id: backButton
parent: configContentDrawer.contentParent
anchors.top: parent.top anchors.top: parent.top
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
@@ -169,6 +173,8 @@ PageType {
width: parent.width width: parent.width
visible: ServersModel.isCurrentlyProcessedServerHasWriteAccess()
text: qsTr("Remove ") + ContainersModel.getCurrentlyProcessedContainerName() text: qsTr("Remove ") + ContainersModel.getCurrentlyProcessedContainerName()
textColor: "#EB5757" textColor: "#EB5757"
@@ -179,14 +185,14 @@ PageType {
questionDrawer.noButtonText = qsTr("Cancel") questionDrawer.noButtonText = qsTr("Cancel")
questionDrawer.yesButtonFunction = function() { questionDrawer.yesButtonFunction = function() {
questionDrawer.visible = false questionDrawer.close()
PageController.goToPage(PageEnum.PageDeinstalling) PageController.goToPage(PageEnum.PageDeinstalling)
InstallController.removeCurrentlyProcessedContainer() InstallController.removeCurrentlyProcessedContainer()
} }
questionDrawer.noButtonFunction = function() { questionDrawer.noButtonFunction = function() {
questionDrawer.visible = false questionDrawer.close()
} }
questionDrawer.visible = true questionDrawer.open()
} }
MouseArea { MouseArea {
@@ -201,6 +207,7 @@ PageType {
QuestionDrawer { QuestionDrawer {
id: questionDrawer id: questionDrawer
parent: root
} }
} }
} }
@@ -95,6 +95,8 @@ PageType {
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 20 Layout.topMargin: 20
drawerParent: root
descriptionText: qsTr("Cipher") descriptionText: qsTr("Cipher")
headerText: qsTr("Cipher") headerText: qsTr("Cipher")
@@ -68,14 +68,14 @@ PageType {
questionDrawer.noButtonText = qsTr("Cancel") questionDrawer.noButtonText = qsTr("Cancel")
questionDrawer.yesButtonFunction = function() { questionDrawer.yesButtonFunction = function() {
questionDrawer.visible = false questionDrawer.close()
PageController.goToPage(PageEnum.PageDeinstalling) PageController.goToPage(PageEnum.PageDeinstalling)
InstallController.removeCurrentlyProcessedContainer() InstallController.removeCurrentlyProcessedContainer()
} }
questionDrawer.noButtonFunction = function() { questionDrawer.noButtonFunction = function() {
questionDrawer.visible = false questionDrawer.close()
} }
questionDrawer.visible = true questionDrawer.open()
} }
MouseArea { MouseArea {
@@ -89,6 +89,7 @@ PageType {
QuestionDrawer { QuestionDrawer {
id: questionDrawer id: questionDrawer
parent: root
} }
} }
} }
@@ -96,7 +96,7 @@ PageType {
rightImageColor: "#D7D8DB" rightImageColor: "#D7D8DB"
clickedFunction: function() { clickedFunction: function() {
col.copyToClipBoard(descriptionText) GC.copyToClipBoard(descriptionText)
PageController.showNotificationMessage(qsTr("Copied")) PageController.showNotificationMessage(qsTr("Copied"))
} }
} }
@@ -113,7 +113,7 @@ PageType {
rightImageColor: "#D7D8DB" rightImageColor: "#D7D8DB"
clickedFunction: function() { clickedFunction: function() {
col.copyToClipBoard(descriptionText) GC.copyToClipBoard(descriptionText)
PageController.showNotificationMessage(qsTr("Copied")) PageController.showNotificationMessage(qsTr("Copied"))
} }
} }
@@ -130,7 +130,7 @@ PageType {
rightImageColor: "#D7D8DB" rightImageColor: "#D7D8DB"
clickedFunction: function() { clickedFunction: function() {
col.copyToClipBoard(descriptionText) GC.copyToClipBoard(descriptionText)
PageController.showNotificationMessage(qsTr("Copied")) PageController.showNotificationMessage(qsTr("Copied"))
} }
} }
@@ -147,23 +147,11 @@ PageType {
rightImageColor: "#D7D8DB" rightImageColor: "#D7D8DB"
clickedFunction: function() { clickedFunction: function() {
col.copyToClipBoard(descriptionText) GC.copyToClipBoard(descriptionText)
PageController.showNotificationMessage(qsTr("Copied")) PageController.showNotificationMessage(qsTr("Copied"))
} }
} }
TextEdit{
id: clipboard
visible: false
}
function copyToClipBoard(text) {
clipboard.text = text
clipboard.selectAll()
clipboard.copy()
clipboard.select(0, 0)
}
BasicButtonType { BasicButtonType {
visible: !GC.isMobile() visible: !GC.isMobile()
@@ -265,14 +253,14 @@ PageType {
questionDrawer.noButtonText = qsTr("Cancel") questionDrawer.noButtonText = qsTr("Cancel")
questionDrawer.yesButtonFunction = function() { questionDrawer.yesButtonFunction = function() {
questionDrawer.visible = false questionDrawer.close()
PageController.goToPage(PageEnum.PageDeinstalling) PageController.goToPage(PageEnum.PageDeinstalling)
InstallController.removeCurrentlyProcessedContainer() InstallController.removeCurrentlyProcessedContainer()
} }
questionDrawer.noButtonFunction = function() { questionDrawer.noButtonFunction = function() {
questionDrawer.visible = false questionDrawer.close()
} }
questionDrawer.visible = true questionDrawer.open()
} }
} }
} }
@@ -282,6 +270,7 @@ PageType {
QuestionDrawer { QuestionDrawer {
id: questionDrawer id: questionDrawer
parent: root
} }
} }
} }
@@ -78,23 +78,11 @@ PageType {
rightImageColor: "#D7D8DB" rightImageColor: "#D7D8DB"
clickedFunction: function() { clickedFunction: function() {
content.copyToClipBoard(descriptionText) GC.copyToClipBoard(descriptionText)
PageController.showNotificationMessage(qsTr("Copied")) PageController.showNotificationMessage(qsTr("Copied"))
} }
} }
TextEdit{
id: clipboard
visible: false
}
function copyToClipBoard(text) {
clipboard.text = text
clipboard.selectAll()
clipboard.copy()
clipboard.select(0, 0)
}
ParagraphTextType { ParagraphTextType {
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 40 Layout.topMargin: 40
@@ -121,7 +109,7 @@ PageType {
Layout.leftMargin: 16 Layout.leftMargin: 16
Layout.rightMargin: 16 Layout.rightMargin: 16
text: qsTr("When configuring WordPress set the domain as this onion address.") text: qsTr("When configuring WordPress set the this onion address as domain.")
} }
BasicButtonType { BasicButtonType {
@@ -143,20 +131,21 @@ PageType {
questionDrawer.noButtonText = qsTr("Cancel") questionDrawer.noButtonText = qsTr("Cancel")
questionDrawer.yesButtonFunction = function() { questionDrawer.yesButtonFunction = function() {
questionDrawer.visible = false questionDrawer.close()
PageController.goToPage(PageEnum.PageDeinstalling) PageController.goToPage(PageEnum.PageDeinstalling)
InstallController.removeCurrentlyProcessedContainer() InstallController.removeCurrentlyProcessedContainer()
} }
questionDrawer.noButtonFunction = function() { questionDrawer.noButtonFunction = function() {
questionDrawer.visible = false questionDrawer.close()
} }
questionDrawer.visible = true questionDrawer.open()
} }
} }
} }
QuestionDrawer { QuestionDrawer {
id: questionDrawer id: questionDrawer
parent: root
} }
} }
} }
+4 -1
View File
@@ -110,6 +110,7 @@ PageType {
DividerType {} DividerType {}
LabelWithButtonType { LabelWithButtonType {
visible: GC.isDesktop()
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredHeight: about.height Layout.preferredHeight: about.height
@@ -122,7 +123,9 @@ PageType {
} }
} }
DividerType {} DividerType {
visible: GC.isDesktop()
}
} }
} }
} }
@@ -70,7 +70,7 @@ PageType {
Layout.margins: 16 Layout.margins: 16
text: qsTr("Auto start") text: qsTr("Auto start")
descriptionText: qsTr("Launch the application every time %1 starts").arg(Qt.platform.os) descriptionText: qsTr("Launch the application every time the device is starts")
checked: SettingsController.isAutoStartEnabled() checked: SettingsController.isAutoStartEnabled()
onCheckedChanged: { onCheckedChanged: {
@@ -119,6 +119,7 @@ PageType {
SelectLanguageDrawer { SelectLanguageDrawer {
id: selectLanguageDrawer id: selectLanguageDrawer
parent: root
} }
@@ -151,14 +152,14 @@ PageType {
questionDrawer.noButtonText = qsTr("Cancel") questionDrawer.noButtonText = qsTr("Cancel")
questionDrawer.yesButtonFunction = function() { questionDrawer.yesButtonFunction = function() {
questionDrawer.visible = false questionDrawer.close()
SettingsController.clearSettings() SettingsController.clearSettings()
PageController.replaceStartPage() PageController.replaceStartPage()
} }
questionDrawer.noButtonFunction = function() { questionDrawer.noButtonFunction = function() {
questionDrawer.visible = false questionDrawer.close()
} }
questionDrawer.visible = true questionDrawer.open()
} }
} }
@@ -166,6 +167,7 @@ PageType {
QuestionDrawer { QuestionDrawer {
id: questionDrawer id: questionDrawer
parent: root
} }
} }
} }
+5 -3
View File
@@ -103,6 +103,7 @@ PageType {
PageController.showBusyIndicator(true) PageController.showBusyIndicator(true)
SettingsController.backupAppConfig(fileName) SettingsController.backupAppConfig(fileName)
PageController.showBusyIndicator(false) PageController.showBusyIndicator(false)
PageController.showNotificationMessage(qsTr("Backup file saved"))
} }
} }
} }
@@ -138,18 +139,19 @@ PageType {
questionDrawer.noButtonText = qsTr("Cancel") questionDrawer.noButtonText = qsTr("Cancel")
questionDrawer.yesButtonFunction = function() { questionDrawer.yesButtonFunction = function() {
questionDrawer.visible = false questionDrawer.close()
PageController.showBusyIndicator(true) PageController.showBusyIndicator(true)
SettingsController.restoreAppConfig(filePath) SettingsController.restoreAppConfig(filePath)
PageController.showBusyIndicator(false) PageController.showBusyIndicator(false)
} }
questionDrawer.noButtonFunction = function() { questionDrawer.noButtonFunction = function() {
questionDrawer.visible = false questionDrawer.close()
} }
questionDrawer.visible = true questionDrawer.open()
} }
QuestionDrawer { QuestionDrawer {
id: questionDrawer id: questionDrawer
parent: root
} }
} }
@@ -94,6 +94,8 @@ PageType {
DividerType {} DividerType {}
LabelWithButtonType { LabelWithButtonType {
visible: GC.isDesktop()
Layout.fillWidth: true Layout.fillWidth: true
text: qsTr("Site-based split tunneling") text: qsTr("Site-based split tunneling")
@@ -105,12 +107,15 @@ PageType {
} }
} }
DividerType {} DividerType {
visible: GC.isDesktop()
}
LabelWithButtonType { LabelWithButtonType {
Layout.fillWidth: true
visible: false visible: false
Layout.fillWidth: true
text: qsTr("App-based split tunneling") text: qsTr("App-based split tunneling")
descriptionText: qsTr("Allows you to use the VPN only for certain applications") descriptionText: qsTr("Allows you to use the VPN only for certain applications")
rightImageSource: "qrc:/images/controls/chevron-right.svg" rightImageSource: "qrc:/images/controls/chevron-right.svg"
@@ -119,7 +124,9 @@ PageType {
} }
} }
// DividerType {} DividerType {
visible: false
}
} }
} }
} }
+5 -3
View File
@@ -46,6 +46,7 @@ PageType {
} }
ParagraphTextType { ParagraphTextType {
Layout.fillWidth: true
text: qsTr("If AmneziaDNS is not used or installed") text: qsTr("If AmneziaDNS is not used or installed")
} }
@@ -91,7 +92,7 @@ PageType {
questionDrawer.noButtonText = qsTr("Cancel") questionDrawer.noButtonText = qsTr("Cancel")
questionDrawer.yesButtonFunction = function() { questionDrawer.yesButtonFunction = function() {
questionDrawer.visible = false questionDrawer.close()
SettingsController.primaryDns = "1.1.1.1" SettingsController.primaryDns = "1.1.1.1"
primaryDns.textFieldText = SettingsController.primaryDns primaryDns.textFieldText = SettingsController.primaryDns
SettingsController.secondaryDns = "1.0.0.1" SettingsController.secondaryDns = "1.0.0.1"
@@ -99,9 +100,9 @@ PageType {
PageController.showNotificationMessage(qsTr("Settings have been reset")) PageController.showNotificationMessage(qsTr("Settings have been reset"))
} }
questionDrawer.noButtonFunction = function() { questionDrawer.noButtonFunction = function() {
questionDrawer.visible = false questionDrawer.close()
} }
questionDrawer.visible = true questionDrawer.open()
} }
} }
@@ -123,6 +124,7 @@ PageType {
} }
QuestionDrawer { QuestionDrawer {
id: questionDrawer id: questionDrawer
parent: root
} }
} }
} }
+5 -3
View File
@@ -115,6 +115,7 @@ PageType {
PageController.showBusyIndicator(true) PageController.showBusyIndicator(true)
SettingsController.exportLogsFile(fileName) SettingsController.exportLogsFile(fileName)
PageController.showBusyIndicator(false) PageController.showBusyIndicator(false)
PageController.showNotificationMessage(qsTr("Logs file saved"))
} }
} }
} }
@@ -146,16 +147,16 @@ PageType {
questionDrawer.noButtonText = qsTr("Cancel") questionDrawer.noButtonText = qsTr("Cancel")
questionDrawer.yesButtonFunction = function() { questionDrawer.yesButtonFunction = function() {
questionDrawer.visible = false questionDrawer.close()
PageController.showBusyIndicator(true) PageController.showBusyIndicator(true)
SettingsController.clearLogs() SettingsController.clearLogs()
PageController.showBusyIndicator(false) PageController.showBusyIndicator(false)
PageController.showNotificationMessage(qsTr("Logs have been cleaned up")) PageController.showNotificationMessage(qsTr("Logs have been cleaned up"))
} }
questionDrawer.noButtonFunction = function() { questionDrawer.noButtonFunction = function() {
questionDrawer.visible = false questionDrawer.close()
} }
questionDrawer.visible = true questionDrawer.open()
} }
} }
@@ -171,6 +172,7 @@ PageType {
QuestionDrawer { QuestionDrawer {
id: questionDrawer id: questionDrawer
parent: root
} }
} }
} }
@@ -14,6 +14,8 @@ import "../Components"
PageType { PageType {
id: root id: root
property Item questionDrawerParent
Connections { Connections {
target: InstallController target: InstallController
@@ -94,15 +96,15 @@ PageType {
questionDrawer.noButtonText = qsTr("Cancel") questionDrawer.noButtonText = qsTr("Cancel")
questionDrawer.yesButtonFunction = function() { questionDrawer.yesButtonFunction = function() {
questionDrawer.visible = false questionDrawer.close()
PageController.showBusyIndicator(true) PageController.showBusyIndicator(true)
SettingsController.clearCachedProfiles() SettingsController.clearCachedProfiles()
PageController.showBusyIndicator(false) PageController.showBusyIndicator(false)
} }
questionDrawer.noButtonFunction = function() { questionDrawer.noButtonFunction = function() {
questionDrawer.visible = false questionDrawer.close()
} }
questionDrawer.visible = true questionDrawer.open()
} }
} }
@@ -141,7 +143,7 @@ PageType {
questionDrawer.noButtonText = qsTr("Cancel") questionDrawer.noButtonText = qsTr("Cancel")
questionDrawer.yesButtonFunction = function() { questionDrawer.yesButtonFunction = function() {
questionDrawer.visible = false questionDrawer.close()
PageController.showBusyIndicator(true) PageController.showBusyIndicator(true)
if (ServersModel.isDefaultServerCurrentlyProcessed() && ConnectionController.isConnected) { if (ServersModel.isDefaultServerCurrentlyProcessed() && ConnectionController.isConnected) {
ConnectionController.closeConnection() ConnectionController.closeConnection()
@@ -150,9 +152,9 @@ PageType {
PageController.showBusyIndicator(false) PageController.showBusyIndicator(false)
} }
questionDrawer.noButtonFunction = function() { questionDrawer.noButtonFunction = function() {
questionDrawer.visible = false questionDrawer.close()
} }
questionDrawer.visible = true questionDrawer.open()
} }
} }
@@ -172,7 +174,7 @@ PageType {
questionDrawer.noButtonText = qsTr("Cancel") questionDrawer.noButtonText = qsTr("Cancel")
questionDrawer.yesButtonFunction = function() { questionDrawer.yesButtonFunction = function() {
questionDrawer.visible = false questionDrawer.close()
PageController.goToPage(PageEnum.PageDeinstalling) PageController.goToPage(PageEnum.PageDeinstalling)
if (ServersModel.isDefaultServerCurrentlyProcessed() && ConnectionController.isConnected) { if (ServersModel.isDefaultServerCurrentlyProcessed() && ConnectionController.isConnected) {
ConnectionController.closeConnection() ConnectionController.closeConnection()
@@ -180,9 +182,9 @@ PageType {
InstallController.removeAllContainers() InstallController.removeAllContainers()
} }
questionDrawer.noButtonFunction = function() { questionDrawer.noButtonFunction = function() {
questionDrawer.visible = false questionDrawer.close()
} }
questionDrawer.visible = true questionDrawer.open()
} }
} }
@@ -192,6 +194,10 @@ PageType {
QuestionDrawer { QuestionDrawer {
id: questionDrawer id: questionDrawer
drawerHeight: 0.5
parent: questionDrawerParent
} }
} }
} }
@@ -71,15 +71,17 @@ PageType {
} }
actionButtonFunction: function() { actionButtonFunction: function() {
serverNameEditDrawer.visible = true serverNameEditDrawer.open()
} }
} }
DrawerType { Drawer2Type {
id: serverNameEditDrawer id: serverNameEditDrawer
parent: root
width: root.width width: root.width
height: root.height * 0.35 height: root.height // * 0.35
contentHeight: root.height * 0.35
onVisibleChanged: { onVisibleChanged: {
if (serverNameEditDrawer.visible) { if (serverNameEditDrawer.visible) {
@@ -88,6 +90,8 @@ PageType {
} }
ColumnLayout { ColumnLayout {
parent: serverNameEditDrawer.contentParent
anchors.top: parent.top anchors.top: parent.top
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
@@ -95,6 +99,7 @@ PageType {
anchors.leftMargin: 16 anchors.leftMargin: 16
anchors.rightMargin: 16 anchors.rightMargin: 16
TextFieldWithHeaderType { TextFieldWithHeaderType {
id: serverName id: serverName
@@ -164,6 +169,7 @@ PageType {
} }
PageSettingsServerData { PageSettingsServerData {
stackView: root.stackView stackView: root.stackView
questionDrawerParent: root
} }
} }
} }
@@ -119,14 +119,14 @@ PageType {
questionDrawer.noButtonText = qsTr("Cancel") questionDrawer.noButtonText = qsTr("Cancel")
questionDrawer.yesButtonFunction = function() { questionDrawer.yesButtonFunction = function() {
questionDrawer.visible = false questionDrawer.close()
PageController.goToPage(PageEnum.PageDeinstalling) PageController.goToPage(PageEnum.PageDeinstalling)
InstallController.removeCurrentlyProcessedContainer() InstallController.removeCurrentlyProcessedContainer()
} }
questionDrawer.noButtonFunction = function() { questionDrawer.noButtonFunction = function() {
questionDrawer.visible = false questionDrawer.close()
} }
questionDrawer.visible = true questionDrawer.open()
} }
MouseArea { MouseArea {
@@ -141,6 +141,7 @@ PageType {
QuestionDrawer { QuestionDrawer {
id: questionDrawer id: questionDrawer
parent: root
} }
} }
} }
@@ -20,6 +20,10 @@ import "../Components"
PageType { PageType {
id: root id: root
property bool pageEnabled: {
return !ConnectionController.isConnected
}
Connections { Connections {
target: SitesController target: SitesController
@@ -78,6 +82,8 @@ PageType {
RowLayout { RowLayout {
HeaderType { HeaderType {
enabled: root.pageEnabled
Layout.fillWidth: true Layout.fillWidth: true
Layout.leftMargin: 16 Layout.leftMargin: 16
@@ -89,6 +95,8 @@ PageType {
property int lastActiveRouteMode: routeMode.onlyForwardSites property int lastActiveRouteMode: routeMode.onlyForwardSites
enabled: root.pageEnabled
Layout.fillWidth: true Layout.fillWidth: true
Layout.rightMargin: 16 Layout.rightMargin: 16
@@ -108,6 +116,8 @@ PageType {
DropDownType { DropDownType {
id: selector id: selector
drawerParent: root
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 32 Layout.topMargin: 32
Layout.leftMargin: 16 Layout.leftMargin: 16
@@ -115,7 +125,7 @@ PageType {
drawerHeight: 0.4375 drawerHeight: 0.4375
enabled: switcher.checked enabled: switcher.checked && root.pageEnabled
headerText: qsTr("Mode") headerText: qsTr("Mode")
@@ -155,9 +165,9 @@ PageType {
FlickableType { FlickableType {
anchors.top: header.bottom anchors.top: header.bottom
anchors.topMargin: 16 anchors.topMargin: 16
contentHeight: col.implicitHeight + connectButton.implicitHeight + connectButton.anchors.bottomMargin + connectButton.anchors.topMargin contentHeight: col.implicitHeight + addSiteButton.implicitHeight + addSiteButton.anchors.bottomMargin + addSiteButton.anchors.topMargin
enabled: switcher.checked enabled: switcher.checked && root.pageEnabled
Column { Column {
id: col id: col
@@ -200,13 +210,13 @@ PageType {
questionDrawer.noButtonText = qsTr("Cancel") questionDrawer.noButtonText = qsTr("Cancel")
questionDrawer.yesButtonFunction = function() { questionDrawer.yesButtonFunction = function() {
questionDrawer.visible = false questionDrawer.close()
SitesController.removeSite(index) SitesController.removeSite(index)
} }
questionDrawer.noButtonFunction = function() { questionDrawer.noButtonFunction = function() {
questionDrawer.visible = false questionDrawer.close()
} }
questionDrawer.visible = true questionDrawer.open()
} }
} }
@@ -214,6 +224,7 @@ PageType {
QuestionDrawer { QuestionDrawer {
id: questionDrawer id: questionDrawer
parent: root
} }
} }
} }
@@ -221,8 +232,17 @@ PageType {
} }
} }
Rectangle {
anchors.fill: addSiteButton
anchors.bottomMargin: -24
color: "#0E0E11"
opacity: 0.8
}
RowLayout { RowLayout {
id: connectButton id: addSiteButton
enabled: root.pageEnabled
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.left: parent.left anchors.left: parent.left
@@ -259,13 +279,18 @@ PageType {
} }
} }
DrawerType { Drawer2Type {
id: moreActionsDrawer id: moreActionsDrawer
width: parent.width width: parent.width
height: parent.height * 0.4375 height: parent.height
contentHeight: parent.height * 0.4375
parent: root
FlickableType { FlickableType {
parent: moreActionsDrawer.contentParent
anchors.fill: parent anchors.fill: parent
contentHeight: moreActionsDrawerContent.height contentHeight: moreActionsDrawerContent.height
ColumnLayout { ColumnLayout {
@@ -324,15 +349,20 @@ PageType {
} }
} }
DrawerType { Drawer2Type {
id: importSitesDrawer id: importSitesDrawer
width: parent.width width: parent.width
height: parent.height * 0.4375 height: parent.height
contentHeight: parent.height * 0.4375
parent: root
BackButtonType { BackButtonType {
id: importSitesDrawerBackButton id: importSitesDrawerBackButton
parent: importSitesDrawer.contentParent
anchors.top: parent.top anchors.top: parent.top
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
@@ -344,6 +374,8 @@ PageType {
} }
FlickableType { FlickableType {
parent: importSitesDrawer.contentParent
anchors.top: importSitesDrawerBackButton.bottom anchors.top: importSitesDrawerBackButton.bottom
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
@@ -41,7 +41,7 @@ PageType {
HeaderType { HeaderType {
Layout.fillWidth: true Layout.fillWidth: true
headerText: qsTr("Server connection") headerText: qsTr("Configure your server")
} }
TextFieldWithHeaderType { TextFieldWithHeaderType {
@@ -107,6 +107,14 @@ PageType {
PageController.goToPage(PageEnum.PageSetupWizardEasy) PageController.goToPage(PageEnum.PageSetupWizardEasy)
} }
} }
LabelTextType {
Layout.fillWidth: true
Layout.topMargin: 12
text: qsTr("All data you enter will remain strictly confidential
and will not be shared or disclosed to the Amnezia or any third parties")
}
} }
} }
@@ -24,6 +24,10 @@ PageType {
target: InstallController target: InstallController
function onInstallContainerFinished(finishedMessage, isServiceInstall) { function onInstallContainerFinished(finishedMessage, isServiceInstall) {
if (!ConnectionController.isConnected && !isServiceInstall) {
ContainersModel.setDefaultContainer(ContainersModel.getCurrentlyProcessedContainerIndex)
}
PageController.goToStartPage() PageController.goToStartPage()
if (stackView.currentItem.objectName === PageController.getPagePath(PageEnum.PageHome)) { if (stackView.currentItem.objectName === PageController.getPagePath(PageEnum.PageHome)) {
PageController.restorePageHomeState(true) PageController.restorePageHomeState(true)
@@ -41,6 +45,10 @@ PageType {
} }
function onInstallServerFinished(finishedMessage) { function onInstallServerFinished(finishedMessage) {
if (!ConnectionController.isConnected) {
ServersModel.setDefaultServerIndex(ServersModel.getServersCount() - 1);
}
PageController.goToStartPage() PageController.goToStartPage()
if (stackView.currentItem.objectName === PageController.getPagePath(PageEnum.PageSetupWizardStart)) { if (stackView.currentItem.objectName === PageController.getPagePath(PageEnum.PageSetupWizardStart)) {
PageController.replaceStartPage() PageController.replaceStartPage()
@@ -59,8 +67,8 @@ PageType {
function onServerIsBusy(isBusy) { function onServerIsBusy(isBusy) {
if (isBusy) { if (isBusy) {
root.progressBarText = qsTr("Amnesia has detected that your server is currently ") + root.progressBarText = qsTr("Amnezia has detected that your server is currently ") +
qsTr("busy installing other software. Amnesia installation ") + qsTr("busy installing other software. Amnezia installation ") +
qsTr("will pause until the server finishes installing other software") qsTr("will pause until the server finishes installing other software")
root.isTimerRunning = false root.isTimerRunning = false
} else { } else {
@@ -97,15 +97,20 @@ PageType {
} }
} }
DrawerType { Drawer2Type {
id: showDetailsDrawer id: showDetailsDrawer
width: parent.width width: parent.width
height: parent.height * 0.9 height: parent.height
contentHeight: parent.height * 0.9
parent: root
BackButtonType { BackButtonType {
id: showDetailsBackButton id: showDetailsBackButton
parent: showDetailsDrawer.contentParent
anchors.top: parent.top anchors.top: parent.top
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
@@ -117,6 +122,8 @@ PageType {
} }
FlickableType { FlickableType {
parent: showDetailsDrawer.contentParent
anchors.top: showDetailsBackButton.bottom anchors.top: showDetailsBackButton.bottom
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
@@ -144,33 +151,16 @@ PageType {
headerText: name headerText: name
} }
TextField { ParagraphTextType {
implicitWidth: parent.width
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 16 Layout.topMargin: 16
Layout.bottomMargin: 16 Layout.bottomMargin: 16
padding: 0
leftPadding: 0
height: 24
color: "#D7D8DB"
font.pixelSize: 16
font.weight: Font.Medium
font.family: "PT Root UI VF"
text: detailedDescription text: detailedDescription
textFormat: Text.MarkdownText
wrapMode: Text.WordWrap
readOnly: true
background: Rectangle {
anchors.fill: parent
color: "transparent"
}
} }
Rectangle { Rectangle {
Layout.fillHeight: true Layout.fillHeight: true
color: "transparent" color: "transparent"
@@ -241,7 +231,7 @@ PageType {
if (ProtocolProps.defaultPort(defaultContainerProto) < 0) { if (ProtocolProps.defaultPort(defaultContainerProto) < 0) {
port.visible = false port.visible = false
} else { } else {
port.textFieldText = ProtocolProps.defaultPort(defaultContainerProto) port.textFieldText = ProtocolProps.getPortForInstall(defaultContainerProto)
} }
transportProtoSelector.currentIndex = ProtocolProps.defaultTransportProto(defaultContainerProto) transportProtoSelector.currentIndex = ProtocolProps.defaultTransportProto(defaultContainerProto)
@@ -115,7 +115,7 @@ PageType {
text: qsTr("I have the data to connect") text: qsTr("I have the data to connect")
onClicked: { onClicked: {
connectionTypeSelection.visible = true connectionTypeSelection.open()
} }
} }
@@ -140,6 +140,7 @@ PageType {
ConnectionTypeSelectionDrawer { ConnectionTypeSelectionDrawer {
id: connectionTypeSelection id: connectionTypeSelection
parent: root
} }
} }
@@ -24,6 +24,10 @@ PageType {
} }
function onImportFinished() { function onImportFinished() {
if (ConnectionController.isConnected) {
ServersModel.setDefaultServerIndex(ServersModel.getServersCount() - 1);
}
PageController.goToStartPage() PageController.goToStartPage()
if (stackView.currentItem.objectName === PageController.getPagePath(PageEnum.PageSetupWizardStart)) { if (stackView.currentItem.objectName === PageController.getPagePath(PageEnum.PageSetupWizardStart)) {
PageController.replaceStartPage() PageController.replaceStartPage()
+9 -2
View File
@@ -172,13 +172,15 @@ PageType {
Layout.bottomMargin: 24 Layout.bottomMargin: 24
text: accessTypeSelector.currentIndex === 0 ? qsTr("VPN access without the ability to manage the server") : text: accessTypeSelector.currentIndex === 0 ? qsTr("VPN access without the ability to manage the server") :
qsTr("Access to server management. The user with whom you share full access to the connection will be able to add and remove your protocols and services to the servers, as well as change settings.") qsTr("Access to server management. The user with whom you share full access to the connection will be able to add and remove your protocols and services to the server, as well as change settings.")
color: "#878B91" color: "#878B91"
} }
DropDownType { DropDownType {
id: serverSelector id: serverSelector
drawerParent: root
signal severSelectorIndexChanged signal severSelectorIndexChanged
property int currentIndex: 0 property int currentIndex: 0
@@ -241,6 +243,8 @@ PageType {
DropDownType { DropDownType {
id: protocolSelector id: protocolSelector
drawerParent: root
visible: accessTypeSelector.currentIndex === 0 visible: accessTypeSelector.currentIndex === 0
Layout.fillWidth: true Layout.fillWidth: true
@@ -320,7 +324,7 @@ PageType {
if (index === ContainerProps.containerFromString("amnezia-openvpn")) { if (index === ContainerProps.containerFromString("amnezia-openvpn")) {
root.connectionTypesModel.push(openVpnConnectionFormat) root.connectionTypesModel.push(openVpnConnectionFormat)
} else if (index === ContainerProps.containerFromString("amnezia-awg")) { } else if (index === ContainerProps.containerFromString("amnezia-wireguard")) {
root.connectionTypesModel.push(wireGuardConnectionFormat) root.connectionTypesModel.push(wireGuardConnectionFormat)
} }
} }
@@ -330,6 +334,8 @@ PageType {
DropDownType { DropDownType {
id: exportTypeSelector id: exportTypeSelector
drawerParent: root
property int currentIndex: 0 property int currentIndex: 0
Layout.fillWidth: true Layout.fillWidth: true
@@ -371,6 +377,7 @@ PageType {
ShareConnectionDrawer { ShareConnectionDrawer {
id: shareConnectionDrawer id: shareConnectionDrawer
parent: root
} }
BasicButtonType { BasicButtonType {
+24 -13
View File
@@ -44,9 +44,9 @@ PageType {
tabBar.enabled = !visible tabBar.enabled = !visible
} }
function onShowTopCloseButton(visible) { // function onShowTopCloseButton(visible) {
topCloseButton.visible = visible // topCloseButton.visible = visible
} // }
function onEnableTabBar(enabled) { function onEnableTabBar(enabled) {
tabBar.enabled = enabled tabBar.enabled = enabled
@@ -135,12 +135,14 @@ PageType {
var pagePath = PageController.getPagePath(PageEnum.PageHome) var pagePath = PageController.getPagePath(PageEnum.PageHome)
ServersModel.currentlyProcessedIndex = ServersModel.defaultIndex ServersModel.currentlyProcessedIndex = ServersModel.defaultIndex
tabBarStackView.push(pagePath, { "objectName" : pagePath }) tabBarStackView.push(pagePath, { "objectName" : pagePath })
connectionTypeSelection.parent = tabBarStackView
} }
onWidthChanged: { // onWidthChanged: {
topCloseButton.x = tabBarStackView.x + tabBarStackView.width - // topCloseButton.x = tabBarStackView.x + tabBarStackView.width -
topCloseButton.buttonWidth - topCloseButton.rightPadding // topCloseButton.buttonWidth - topCloseButton.rightPadding
} // }
} }
TabBar { TabBar {
@@ -174,6 +176,12 @@ PageType {
strokeColor: "#2C2D30" strokeColor: "#2C2D30"
fillColor: "#1C1D21" fillColor: "#1C1D21"
} }
MouseArea {
id: noPropagateMouseEvent
anchors.fill: parent
enabled: true
}
} }
TabImageButtonType { TabImageButtonType {
@@ -234,16 +242,19 @@ PageType {
z: 1 z: 1
} }
TopCloseButtonType { // TopCloseButtonType {
id: topCloseButton // id: topCloseButton
x: tabBarStackView.width - topCloseButton.buttonWidth - topCloseButton.rightPadding
z: 1 // x: tabBarStackView.width - topCloseButton.buttonWidth - topCloseButton.rightPadding
} // z: 1
// }
ConnectionTypeSelectionDrawer { ConnectionTypeSelectionDrawer {
id: connectionTypeSelection id: connectionTypeSelection
onAboutToHide: { z: 1
onDrawerClosed: {
tabBar.setCurrentIndex(tabBar.previousIndex) tabBar.setCurrentIndex(tabBar.previousIndex)
} }
} }
+9 -9
View File
@@ -96,16 +96,16 @@ if [ "${MAC_CERT_PW+x}" ]; then
security find-identity -p codesigning security find-identity -p codesigning
echo "Signing App bundle..." echo "Signing App bundle..."
/usr/bin/codesign --deep --force --verbose --timestamp -o runtime --sign "Developer ID Application: Privacy Technologies OU (X7UJ388FXK)" $BUNDLE_DIR /usr/bin/codesign --deep --force --verbose --timestamp -o runtime --sign "$MAC_SIGNER_ID" $BUNDLE_DIR
/usr/bin/codesign --verify -vvvv $BUNDLE_DIR || true /usr/bin/codesign --verify -vvvv $BUNDLE_DIR || true
spctl -a -vvvv $BUNDLE_DIR || true spctl -a -vvvv $BUNDLE_DIR || true
if [ "${NOTARIZE_APP+x}" ]; then if [ "${NOTARIZE_APP+x}" ]; then
echo "Notarizing App bundle..." echo "Notarizing App bundle..."
/usr/bin/ditto -c -k --keepParent $BUNDLE_DIR $PROJECT_DIR/Bundle_to_notarize.zip /usr/bin/ditto -c -k --keepParent $BUNDLE_DIR $PROJECT_DIR/Bundle_to_notarize.zip
xcrun altool --notarize-app -f $PROJECT_DIR/Bundle_to_notarize.zip -t osx --primary-bundle-id "$APP_DOMAIN" -u "$APPLE_DEV_EMAIL" -p $APPLE_DEV_PASSWORD xcrun notarytool submit $PROJECT_DIR/Bundle_to_notarize.zip --apple-id $APPLE_DEV_EMAIL --team-id $MAC_TEAM_ID --password $APPLE_DEV_PASSWORD
rm $PROJECT_DIR/Bundle_to_notarize.zip rm $PROJECT_DIR/Bundle_to_notarize.zip
sleep 600 sleep 300
xcrun stapler staple $BUNDLE_DIR xcrun stapler staple $BUNDLE_DIR
xcrun stapler validate $BUNDLE_DIR xcrun stapler validate $BUNDLE_DIR
spctl -a -vvvv $BUNDLE_DIR || true spctl -a -vvvv $BUNDLE_DIR || true
@@ -130,15 +130,15 @@ $QIF_BIN_DIR/binarycreator --offline-only -v -c $BUILD_DIR/installer/config/maco
if [ "${MAC_CERT_PW+x}" ]; then if [ "${MAC_CERT_PW+x}" ]; then
echo "Signing installer bundle..." echo "Signing installer bundle..."
security unlock-keychain -p $TEMP_PASS $KEYCHAIN security unlock-keychain -p $TEMP_PASS $KEYCHAIN
/usr/bin/codesign --deep --force --verbose --timestamp -o runtime --sign "Developer ID Application: Privacy Technologies OU (X7UJ388FXK)" $INSTALLER_BUNDLE_DIR /usr/bin/codesign --deep --force --verbose --timestamp -o runtime --sign "$MAC_SIGNER_ID" $INSTALLER_BUNDLE_DIR
/usr/bin/codesign --verify -vvvv $INSTALLER_BUNDLE_DIR || true /usr/bin/codesign --verify -vvvv $INSTALLER_BUNDLE_DIR || true
if [ "${NOTARIZE_APP+x}" ]; then if [ "${NOTARIZE_APP+x}" ]; then
echo "Notarizing installer bundle..." echo "Notarizing installer bundle..."
/usr/bin/ditto -c -k --keepParent $INSTALLER_BUNDLE_DIR $PROJECT_DIR/Installer_bundle_to_notarize.zip /usr/bin/ditto -c -k --keepParent $INSTALLER_BUNDLE_DIR $PROJECT_DIR/Installer_bundle_to_notarize.zip
xcrun altool --notarize-app -f $PROJECT_DIR/Installer_bundle_to_notarize.zip -t osx --primary-bundle-id "$APP_DOMAIN" -u "$APPLE_DEV_EMAIL" -p $APPLE_DEV_PASSWORD xcrun notarytool submit $PROJECT_DIR/Installer_bundle_to_notarize.zip --apple-id $APPLE_DEV_EMAIL --team-id $MAC_TEAM_ID --password $APPLE_DEV_PASSWORD
rm $PROJECT_DIR/Installer_bundle_to_notarize.zip rm $PROJECT_DIR/Installer_bundle_to_notarize.zip
sleep 600 sleep 300
xcrun stapler staple $INSTALLER_BUNDLE_DIR xcrun stapler staple $INSTALLER_BUNDLE_DIR
xcrun stapler validate $INSTALLER_BUNDLE_DIR xcrun stapler validate $INSTALLER_BUNDLE_DIR
spctl -a -vvvv $INSTALLER_BUNDLE_DIR || true spctl -a -vvvv $INSTALLER_BUNDLE_DIR || true
@@ -151,13 +151,13 @@ hdiutil create -volname AmneziaVPN -srcfolder $BUILD_DIR/installer/$APP_NAME.app
if [ "${MAC_CERT_PW+x}" ]; then if [ "${MAC_CERT_PW+x}" ]; then
echo "Signing DMG installer..." echo "Signing DMG installer..."
security unlock-keychain -p $TEMP_PASS $KEYCHAIN security unlock-keychain -p $TEMP_PASS $KEYCHAIN
/usr/bin/codesign --deep --force --verbose --timestamp -o runtime --sign "Developer ID Application: Privacy Technologies OU (X7UJ388FXK)" $DMG_FILENAME /usr/bin/codesign --deep --force --verbose --timestamp -o runtime --sign "$MAC_SIGNER_ID" $DMG_FILENAME
/usr/bin/codesign --verify -vvvv $DMG_FILENAME || true /usr/bin/codesign --verify -vvvv $DMG_FILENAME || true
if [ "${NOTARIZE_APP+x}" ]; then if [ "${NOTARIZE_APP+x}" ]; then
echo "Notarizing DMG installer..." echo "Notarizing DMG installer..."
xcrun altool --notarize-app -f $DMG_FILENAME -t osx --primary-bundle-id $APP_DOMAIN -u $APPLE_DEV_EMAIL -p $APPLE_DEV_PASSWORD xcrun notarytool submit $DMG_FILENAME --apple-id $APPLE_DEV_EMAIL --team-id $MAC_TEAM_ID --password $APPLE_DEV_PASSWORD
sleep 600 sleep 300
xcrun stapler staple $DMG_FILENAME xcrun stapler staple $DMG_FILENAME
xcrun stapler validate $DMG_FILENAME xcrun stapler validate $DMG_FILENAME
fi fi