mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-07-03 14:07:39 +02:00
Compare commits
19 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ad85424ccb | |||
| 3fc9edd346 | |||
| 1a1f75d873 | |||
| df02e0bf78 | |||
| 264d77463d | |||
| 0a37ffd5e3 | |||
| 1343d10aa7 | |||
| 6f96ebd8bf | |||
| cb531dacb3 | |||
| dfd0b4d0e5 | |||
| f978f55e7f | |||
| dc85a99e08 | |||
| ef06fcb4f4 | |||
| ffe2314d47 | |||
| 4e970322d0 | |||
| 8dee0d27cf | |||
| c520f9a2a4 | |||
| 003c3a23c4 | |||
| 9d531f5d74 |
+2
-2
@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.25.0 FATAL_ERROR)
|
||||
|
||||
set(PROJECT AmneziaVPN)
|
||||
|
||||
project(${PROJECT} VERSION 4.6.0.4
|
||||
project(${PROJECT} VERSION 4.6.1.0
|
||||
DESCRIPTION "AmneziaVPN"
|
||||
HOMEPAGE_URL "https://amnezia.org/"
|
||||
)
|
||||
@@ -11,7 +11,7 @@ string(TIMESTAMP CURRENT_DATE "%Y-%m-%d")
|
||||
set(RELEASE_DATE "${CURRENT_DATE}")
|
||||
|
||||
set(APP_MAJOR_VERSION ${CMAKE_PROJECT_VERSION_MAJOR}.${CMAKE_PROJECT_VERSION_MINOR}.${CMAKE_PROJECT_VERSION_PATCH})
|
||||
set(APP_ANDROID_VERSION_CODE 55)
|
||||
set(APP_ANDROID_VERSION_CODE 56)
|
||||
|
||||
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
|
||||
set(MZ_PLATFORM_NAME "linux")
|
||||
|
||||
@@ -154,9 +154,11 @@ The Android app has the following requirements:
|
||||
* Android platform SDK 33
|
||||
* CMake 3.25.0
|
||||
|
||||
After you have installed QT, QT Creator, and Android Studio, you need to configure QT Creator correctly. Click in the top menu bar on `QT Creator` -> `Preferences` -> `Devices` and select the tab `Android`.
|
||||
* set path to JDK 11
|
||||
* set path to Android SDK ($ANDROID_HOME)
|
||||
After you have installed QT, QT Creator, and Android Studio, you need to configure QT Creator correctly.
|
||||
|
||||
- Click in the top menu bar on `QT Creator` -> `Preferences` -> `Devices` and select the tab `Android`.
|
||||
- Set path to JDK 11
|
||||
- Set path to Android SDK (`$ANDROID_HOME`)
|
||||
|
||||
In case you get errors regarding missing SDK or 'SDK manager not running', you cannot fix them by correcting the paths. If you have some spare GBs on your disk, you can let QT Creator install all requirements by choosing an empty folder for `Android SDK location` and clicking on `Set Up SDK`. Be aware: This will install a second Android SDK and NDK on your machine!
|
||||
Double-check that the right CMake version is configured: Click on `QT Creator` -> `Preferences` and click on the side menu on `Kits`. Under the center content view's `Kits` tab, you'll find an entry for `CMake Tool`. If the default selected CMake version is lower than 3.25.0, install on your system CMake >= 3.25.0 and choose `System CMake at <path>` from the drop-down list. If this entry is missing, you either have not installed CMake yet or QT Creator hasn't found the path to it. In that case, click in the preferences window on the side menu item `CMake`, then on the tab `Tools` in the center content view, and finally on the button `Add` to set the path to your installed CMake.
|
||||
|
||||
+1
-1
Submodule client/3rd-prebuilt updated: ff8445c8aa...c38a587fcd
Vendored
+1
-1
Submodule client/3rd/OpenVPNAdapter updated: 7c821a8d5c...dea6040996
@@ -161,13 +161,15 @@ void AmneziaApplication::init()
|
||||
m_engine->load(url);
|
||||
m_systemController->setQmlRoot(m_engine->rootObjects().value(0));
|
||||
|
||||
bool enabled = m_settings->isSaveLogs();
|
||||
#ifndef Q_OS_ANDROID
|
||||
if (m_settings->isSaveLogs()) {
|
||||
if (enabled) {
|
||||
if (!Logger::init()) {
|
||||
qWarning() << "Initialization of debug subsystem failed";
|
||||
}
|
||||
}
|
||||
#endif
|
||||
Logger::setServiceLogsEnabled(enabled);
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
if (m_parser.isSet("a"))
|
||||
|
||||
@@ -11,6 +11,9 @@
|
||||
<uses-feature android:name="android.hardware.camera" android:required="false" />
|
||||
<uses-feature android:name="android.hardware.camera.any" android:required="false" />
|
||||
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />
|
||||
<!-- for TV -->
|
||||
<uses-feature android:name="android.software.leanback" android:required="false" />
|
||||
<uses-feature android:name="android.hardware.touchscreen" android:required="false" />
|
||||
|
||||
<!-- The following comment will be replaced upon deployment with default features based on the dependencies
|
||||
of the application. Remove the comment if you do not require these default features. -->
|
||||
@@ -31,9 +34,11 @@
|
||||
android:label="-- %%INSERT_APP_NAME%% --"
|
||||
android:icon="@mipmap/icon"
|
||||
android:roundIcon="@mipmap/icon_round"
|
||||
android:banner="@mipmap/ic_banner"
|
||||
android:theme="@style/NoActionBar"
|
||||
android:fullBackupContent="@xml/backup_content"
|
||||
android:dataExtractionRules="@xml/data_extraction_rules"
|
||||
android:hasFragileUserData="false"
|
||||
tools:targetApi="s">
|
||||
|
||||
<activity
|
||||
@@ -47,6 +52,7 @@
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
|
||||
</intent-filter>
|
||||
|
||||
<intent-filter>
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@color/ic_banner_background"/>
|
||||
<foreground android:drawable="@mipmap/ic_banner_foreground"/>
|
||||
</adaptive-icon>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="ic_banner_background">#1E1E1F</color>
|
||||
</resources>
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.amnezia.vpn
|
||||
|
||||
import android.Manifest
|
||||
import android.annotation.SuppressLint
|
||||
import android.app.AlertDialog
|
||||
import android.app.NotificationManager
|
||||
import android.content.BroadcastReceiver
|
||||
@@ -230,7 +231,10 @@ class AmneziaActivity : QtActivity() {
|
||||
override fun onStop() {
|
||||
Log.d(TAG, "Stop Amnezia activity")
|
||||
doUnbindService()
|
||||
QtAndroidController.onServiceDisconnected()
|
||||
mainScope.launch {
|
||||
qtInitialized.await()
|
||||
QtAndroidController.onServiceDisconnected()
|
||||
}
|
||||
super.onStop()
|
||||
}
|
||||
|
||||
@@ -542,7 +546,7 @@ class AmneziaActivity : QtActivity() {
|
||||
}
|
||||
}.also {
|
||||
startActivityForResult(it, OPEN_FILE_ACTION_CODE, ActivityResultHandler(
|
||||
onSuccess = {
|
||||
onAny = {
|
||||
val uri = it?.data?.toString() ?: ""
|
||||
Log.d(TAG, "Open file: $uri")
|
||||
mainScope.launch {
|
||||
@@ -556,8 +560,12 @@ class AmneziaActivity : QtActivity() {
|
||||
}
|
||||
|
||||
@Suppress("unused")
|
||||
@SuppressLint("UnsupportedChromeOsCameraSystemFeature")
|
||||
fun isCameraPresent(): Boolean = applicationContext.packageManager.hasSystemFeature(PackageManager.FEATURE_CAMERA)
|
||||
|
||||
@Suppress("unused")
|
||||
fun isOnTv(): Boolean = applicationContext.packageManager.hasSystemFeature(PackageManager.FEATURE_LEANBACK)
|
||||
|
||||
@Suppress("unused")
|
||||
fun startQrCodeReader() {
|
||||
Log.v(TAG, "Start camera")
|
||||
|
||||
@@ -88,16 +88,24 @@ class NetworkState(
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
|
||||
connectivityManager.registerBestMatchingNetworkCallback(networkRequest, networkCallback, handler)
|
||||
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
try {
|
||||
connectivityManager.requestNetwork(networkRequest, networkCallback, handler)
|
||||
} catch (e: SecurityException) {
|
||||
Log.e(TAG, "Failed to bind network listener: $e")
|
||||
// Android 11 bug: https://issuetracker.google.com/issues/175055271
|
||||
if (e.message?.startsWith("Package android does not belong to") == true) {
|
||||
delay(1000)
|
||||
val numberAttempts = 3
|
||||
var attemptCount = 0
|
||||
while(true) {
|
||||
try {
|
||||
connectivityManager.requestNetwork(networkRequest, networkCallback, handler)
|
||||
} else {
|
||||
throw e
|
||||
break
|
||||
} catch (e: SecurityException) {
|
||||
Log.e(TAG, "Failed to bind network listener: $e")
|
||||
// Android 11 bug: https://issuetracker.google.com/issues/175055271
|
||||
if (e.message?.startsWith("Package android does not belong to") == true) {
|
||||
if (++attemptCount > numberAttempts) {
|
||||
throw e
|
||||
}
|
||||
delay(1000)
|
||||
continue
|
||||
} else {
|
||||
throw e
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -119,18 +119,21 @@ QString OpenVpnConfigurator::processConfigWithLocalSettings(const QPair<QString,
|
||||
|
||||
if (!m_settings->isSitesSplitTunnelingEnabled()) {
|
||||
config.append("\nredirect-gateway def1 ipv6 bypass-dhcp\n");
|
||||
|
||||
#if !defined(Q_OS_ANDROID) && !defined(Q_OS_IOS)
|
||||
// Prevent ipv6 leak
|
||||
config.append("ifconfig-ipv6 fd15:53b6:dead::2/64 fd15:53b6:dead::1\n");
|
||||
#endif
|
||||
config.append("block-ipv6\n");
|
||||
} else if (m_settings->routeMode() == Settings::VpnOnlyForwardSites) {
|
||||
|
||||
// no redirect-gateway
|
||||
} else if (m_settings->routeMode() == Settings::VpnAllExceptSites) {
|
||||
#ifndef Q_OS_ANDROID
|
||||
#if !defined(Q_OS_ANDROID) && !defined(Q_OS_IOS)
|
||||
config.append("\nredirect-gateway ipv6 !ipv4 bypass-dhcp\n");
|
||||
#endif
|
||||
// Prevent ipv6 leak
|
||||
config.append("ifconfig-ipv6 fd15:53b6:dead::2/64 fd15:53b6:dead::1\n");
|
||||
#endif
|
||||
config.append("block-ipv6\n");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ QMap<DockerContainer, QString> ContainerProps::containerHumanNames()
|
||||
{ DockerContainer::Awg, "AmneziaWG" },
|
||||
{ DockerContainer::Xray, "XRay" },
|
||||
{ DockerContainer::Ipsec, QObject::tr("IPsec") },
|
||||
{ DockerContainer::SSXray, "ShadowSocks"},
|
||||
{ DockerContainer::SSXray, "Shadowsocks"},
|
||||
|
||||
{ DockerContainer::TorWebSite, QObject::tr("Website in Tor network") },
|
||||
{ DockerContainer::Dns, QObject::tr("AmneziaDNS") },
|
||||
|
||||
+26
-2
@@ -99,6 +99,29 @@ void Logger::deInit()
|
||||
m_file.close();
|
||||
}
|
||||
|
||||
bool Logger::setServiceLogsEnabled(bool enabled) {
|
||||
#ifdef AMNEZIA_DESKTOP
|
||||
IpcClient *m_IpcClient = new IpcClient;
|
||||
|
||||
if (!m_IpcClient->isSocketConnected()) {
|
||||
if (!IpcClient::init(m_IpcClient)) {
|
||||
qWarning() << "Error occurred when init IPC client";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (m_IpcClient->Interface()) {
|
||||
m_IpcClient->Interface()->setLogsEnabled(enabled);
|
||||
}
|
||||
else {
|
||||
qWarning() << "Error occurred setting up service logs";
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
QString Logger::userLogsDir()
|
||||
{
|
||||
return QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/log";
|
||||
@@ -141,7 +164,9 @@ bool Logger::openLogsFolder()
|
||||
bool Logger::openServiceLogsFolder()
|
||||
{
|
||||
QString path = Utils::systemLogPath();
|
||||
#ifdef Q_OS_WIN
|
||||
path = "file:///" + path;
|
||||
#endif
|
||||
QDesktopServices::openUrl(QUrl::fromLocalFile(path));
|
||||
return true;
|
||||
}
|
||||
@@ -184,8 +209,7 @@ void Logger::clearServiceLogs()
|
||||
}
|
||||
|
||||
if (m_IpcClient->Interface()) {
|
||||
m_IpcClient->Interface()->setLogsEnabled(false);
|
||||
m_IpcClient->Interface()->cleanUp();
|
||||
m_IpcClient->Interface()->clearLogs();
|
||||
}
|
||||
else {
|
||||
qWarning() << "Error occurred cleaning up service logs";
|
||||
|
||||
@@ -26,6 +26,7 @@ public:
|
||||
|
||||
static bool init();
|
||||
static void deInit();
|
||||
static bool setServiceLogsEnabled(bool enabled);
|
||||
static bool openLogsFolder();
|
||||
static bool openServiceLogsFolder();
|
||||
static QString appLogFileNamePath();
|
||||
|
||||
@@ -179,6 +179,11 @@ bool AndroidController::isCameraPresent()
|
||||
return callActivityMethod<jboolean>("isCameraPresent", "()Z");
|
||||
}
|
||||
|
||||
bool AndroidController::isOnTv()
|
||||
{
|
||||
return callActivityMethod<jboolean>("isOnTv", "()Z");
|
||||
}
|
||||
|
||||
void AndroidController::startQrReaderActivity()
|
||||
{
|
||||
callActivityMethod("startQrCodeReader", "()V");
|
||||
|
||||
@@ -35,6 +35,7 @@ public:
|
||||
void saveFile(const QString &fileName, const QString &data);
|
||||
QString openFile(const QString &filter);
|
||||
bool isCameraPresent();
|
||||
bool isOnTv();
|
||||
void startQrReaderActivity();
|
||||
void setSaveLogs(bool enabled);
|
||||
void exportLogsFile(const QString &fileName);
|
||||
|
||||
@@ -65,14 +65,14 @@ QString ProtocolProps::transportProtoToString(TransportProto proto, Proto p)
|
||||
QMap<amnezia::Proto, QString> ProtocolProps::protocolHumanNames()
|
||||
{
|
||||
return { { Proto::OpenVpn, "OpenVPN" },
|
||||
{ Proto::ShadowSocks, "ShadowSocks" },
|
||||
{ Proto::ShadowSocks, "Shadowsocks" },
|
||||
{ Proto::Cloak, "Cloak" },
|
||||
{ Proto::WireGuard, "WireGuard" },
|
||||
{ Proto::Awg, "AmneziaWG" },
|
||||
{ Proto::Ikev2, "IKEv2" },
|
||||
{ Proto::L2tp, "L2TP" },
|
||||
{ Proto::Xray, "XRay" },
|
||||
{ Proto::SSXray, "ShadowSocks"},
|
||||
{ Proto::SSXray, "Shadowsocks"},
|
||||
|
||||
|
||||
{ Proto::TorWebSite, "Website in Tor network" },
|
||||
|
||||
@@ -226,6 +226,8 @@ void Settings::setSaveLogs(bool enabled)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
Logger::setServiceLogsEnabled(enabled);
|
||||
|
||||
if (enabled) {
|
||||
setLogEnableDate(QDateTime::currentDateTime());
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -240,9 +240,9 @@ void ImportController::processNativeWireGuardConfig()
|
||||
auto containerConfig = container.value(ContainerProps::containerTypeToString(DockerContainer::WireGuard)).toObject();
|
||||
auto protocolConfig = QJsonDocument::fromJson(containerConfig.value(config_key::last_config).toString().toUtf8()).object();
|
||||
|
||||
QString junkPacketCount = QString::number(QRandomGenerator::global()->bounded(3, 10));
|
||||
QString junkPacketMinSize = QString::number(50);
|
||||
QString junkPacketMaxSize = QString::number(1000);
|
||||
QString junkPacketCount = QString::number(QRandomGenerator::global()->bounded(2, 5));
|
||||
QString junkPacketMinSize = QString::number(10);
|
||||
QString junkPacketMaxSize = QString::number(50);
|
||||
protocolConfig[config_key::junkPacketCount] = junkPacketCount;
|
||||
protocolConfig[config_key::junkPacketMinSize] = junkPacketMinSize;
|
||||
protocolConfig[config_key::junkPacketMaxSize] = junkPacketMaxSize;
|
||||
|
||||
@@ -85,9 +85,9 @@ void InstallController::install(DockerContainer container, int port, TransportPr
|
||||
containerConfig.insert(config_key::transport_proto, ProtocolProps::transportProtoToString(transportProto, protocol));
|
||||
|
||||
if (container == DockerContainer::Awg) {
|
||||
QString junkPacketCount = QString::number(QRandomGenerator::global()->bounded(3, 10));
|
||||
QString junkPacketMinSize = QString::number(50);
|
||||
QString junkPacketMaxSize = QString::number(1000);
|
||||
QString junkPacketCount = QString::number(QRandomGenerator::global()->bounded(2, 5));
|
||||
QString junkPacketMinSize = QString::number(10);
|
||||
QString junkPacketMaxSize = QString::number(50);
|
||||
|
||||
int s1 = QRandomGenerator::global()->bounded(15, 150);
|
||||
int s2 = QRandomGenerator::global()->bounded(15, 150);
|
||||
|
||||
@@ -20,7 +20,8 @@ Menu {
|
||||
MenuItem {
|
||||
text: qsTr("&Paste")
|
||||
shortcut: StandardKey.Paste
|
||||
enabled: textObj.canPaste
|
||||
// Fix calling paste from clipboard when launching app on android
|
||||
enabled: Qt.platform.os === "android" ? true : textObj.canPaste
|
||||
onTriggered: textObj.paste()
|
||||
}
|
||||
|
||||
|
||||
@@ -143,7 +143,7 @@ PageType {
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: 16
|
||||
|
||||
headerText: "Jc - Junk packet count"
|
||||
headerText: qsTr("Jc - Junk packet count")
|
||||
textFieldText: junkPacketCount
|
||||
textField.validator: IntValidator { bottom: 0 }
|
||||
parentFlickable: fl
|
||||
@@ -168,7 +168,7 @@ PageType {
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: 16
|
||||
|
||||
headerText: "Jmin - Junk packet minimum size"
|
||||
headerText: qsTr("Jmin - Junk packet minimum size")
|
||||
textFieldText: junkPacketMinSize
|
||||
textField.validator: IntValidator { bottom: 0 }
|
||||
parentFlickable: fl
|
||||
@@ -189,7 +189,7 @@ PageType {
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: 16
|
||||
|
||||
headerText: "Jmax - Junk packet maximum size"
|
||||
headerText: qsTr("Jmax - Junk packet maximum size")
|
||||
textFieldText: junkPacketMaxSize
|
||||
textField.validator: IntValidator { bottom: 0 }
|
||||
parentFlickable: fl
|
||||
@@ -210,7 +210,7 @@ PageType {
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: 16
|
||||
|
||||
headerText: "S1 - Init packet junk size"
|
||||
headerText: qsTr("S1 - Init packet junk size")
|
||||
textFieldText: initPacketJunkSize
|
||||
textField.validator: IntValidator { bottom: 0 }
|
||||
parentFlickable: fl
|
||||
@@ -231,7 +231,7 @@ PageType {
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: 16
|
||||
|
||||
headerText: "S2 - Response packet junk size"
|
||||
headerText: qsTr("S2 - Response packet junk size")
|
||||
textFieldText: responsePacketJunkSize
|
||||
textField.validator: IntValidator { bottom: 0 }
|
||||
parentFlickable: fl
|
||||
@@ -252,7 +252,7 @@ PageType {
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: 16
|
||||
|
||||
headerText: "H1 - Init packet magic header"
|
||||
headerText: qsTr("H1 - Init packet magic header")
|
||||
textFieldText: initPacketMagicHeader
|
||||
textField.validator: IntValidator { bottom: 0 }
|
||||
parentFlickable: fl
|
||||
@@ -273,7 +273,7 @@ PageType {
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: 16
|
||||
|
||||
headerText: "H2 - Response packet magic header"
|
||||
headerText: qsTr("H2 - Response packet magic header")
|
||||
textFieldText: responsePacketMagicHeader
|
||||
textField.validator: IntValidator { bottom: 0 }
|
||||
parentFlickable: fl
|
||||
@@ -294,7 +294,7 @@ PageType {
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: 16
|
||||
|
||||
headerText: "H4 - Transport packet magic header"
|
||||
headerText: qsTr("H4 - Transport packet magic header")
|
||||
textFieldText: transportPacketMagicHeader
|
||||
textField.validator: IntValidator { bottom: 0 }
|
||||
parentFlickable: fl
|
||||
@@ -316,7 +316,7 @@ PageType {
|
||||
Layout.topMargin: 16
|
||||
parentFlickable: fl
|
||||
|
||||
headerText: "H3 - Underload packet magic header"
|
||||
headerText: qsTr("H3 - Underload packet magic header")
|
||||
textFieldText: underloadPacketMagicHeader
|
||||
textField.validator: IntValidator { bottom: 0 }
|
||||
|
||||
|
||||
@@ -214,8 +214,8 @@ PageType {
|
||||
startY: 0
|
||||
|
||||
PathLine { x: width; y: 0 }
|
||||
PathLine { x: width; y: height - 1 }
|
||||
PathLine { x: 0; y: height - 1 }
|
||||
PathLine { x: width; y: tabBar.height - 1 }
|
||||
PathLine { x: 0; y: tabBar.height - 1 }
|
||||
PathLine { x: 0; y: 0 }
|
||||
|
||||
strokeWidth: 1
|
||||
|
||||
@@ -128,11 +128,8 @@ bool Utils::processIsRunning(const QString &fileName, const bool fullFlag)
|
||||
QProcess process;
|
||||
process.setReadChannel(QProcess::StandardOutput);
|
||||
process.setProcessChannelMode(QProcess::MergedChannels);
|
||||
process.start("wmic.exe",
|
||||
QStringList() << "/OUTPUT:STDOUT"
|
||||
<< "PROCESS"
|
||||
<< "get"
|
||||
<< "Caption");
|
||||
process.start("powershell.exe",
|
||||
QStringList() << "-Command" << "Get-Process | Select-Object -ExpandProperty Name");
|
||||
process.waitForStarted();
|
||||
process.waitForFinished();
|
||||
QString processData(process.readAll());
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
sc stop AmneziaWGTunnel$AmneziaVPN
|
||||
sc delete AmneziaWGTunnel$AmneziaVPN
|
||||
@REM sc stop AmneziaWGTunnel$AmneziaVPN
|
||||
@REM sc delete AmneziaWGTunnel$AmneziaVPN
|
||||
taskkill /IM "AmneziaVPN-service.exe" /F
|
||||
taskkill /IM "AmneziaVPN.exe" /F
|
||||
exit /b 0
|
||||
|
||||
@@ -21,6 +21,7 @@ class IpcInterface
|
||||
|
||||
SLOT( void cleanUp() );
|
||||
SLOT( void setLogsEnabled(bool enabled) );
|
||||
SLOT( void clearLogs() );
|
||||
|
||||
SLOT( bool createTun(const QString &dev, const QString &subnet) );
|
||||
SLOT( bool deleteTun(const QString &dev) );
|
||||
|
||||
@@ -162,6 +162,10 @@ void IpcServer::cleanUp()
|
||||
Logger::cleanUp();
|
||||
}
|
||||
|
||||
void IpcServer::clearLogs() {
|
||||
Logger::clearLogs();
|
||||
}
|
||||
|
||||
bool IpcServer::createTun(const QString &dev, const QString &subnet)
|
||||
{
|
||||
return Router::createTun(dev, subnet);
|
||||
|
||||
@@ -26,6 +26,7 @@ public:
|
||||
virtual bool checkAndInstallDriver() override;
|
||||
virtual QStringList getTapList() override;
|
||||
virtual void cleanUp() override;
|
||||
virtual void clearLogs() override;
|
||||
virtual void setLogsEnabled(bool enabled) override;
|
||||
virtual bool createTun(const QString &dev, const QString &subnet) override;
|
||||
virtual bool deleteTun(const QString &dev) override;
|
||||
|
||||
@@ -46,8 +46,6 @@ int main(int argc, char **argv)
|
||||
{
|
||||
Utils::initializePath(Utils::systemLogPath());
|
||||
|
||||
Logger::init();
|
||||
|
||||
if (argc >= 2) {
|
||||
qInfo() << "Started as console application";
|
||||
return runApplication(argc, argv);
|
||||
|
||||
Reference in New Issue
Block a user