mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-07-03 14:07:39 +02:00
Compare commits
16 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5fe1f229a0 | |||
| d858adbcf4 | |||
| e5e8fa0ab4 | |||
| adcc74ac8e | |||
| 3e0085b4a4 | |||
| 17fb2a98d6 | |||
| 780efc2477 | |||
| 7f02fe4157 | |||
| f722576bf2 | |||
| 7fecc2cf4c | |||
| 3519e070b4 | |||
| 25d7e121c9 | |||
| 882077f0aa | |||
| b5b69ff369 | |||
| f0ad76fff6 | |||
| 230f44f4e6 |
@@ -2,3 +2,4 @@ deploy/data/windows/x64/tap/windows_7/OemVista.inf eol=crlf
|
||||
deploy/data/windows/x64/tap/windows_10/OemVista.inf eol=crlf
|
||||
deploy/data/windows/x32/tap/windows_7/OemVista.inf eol=crlf
|
||||
deploy/data/windows/x32/tap/windows_10/OemVista.inf eol=crlf
|
||||
client/3rd/* linguist-vendored
|
||||
|
||||
Vendored
+47
@@ -0,0 +1,47 @@
|
||||
FROM gitpod/workspace-full-vnc
|
||||
|
||||
USER gitpod
|
||||
|
||||
RUN sudo apt-get -q update \
|
||||
&& sudo apt-get install -yq \
|
||||
build-essential \
|
||||
libgl1-mesa-dev \
|
||||
libgstreamer-gl1.0-0 \
|
||||
libpulse-dev \
|
||||
libsecret-1-dev \
|
||||
libxcb-glx0 \
|
||||
libxcb-icccm4 \
|
||||
libxcb-image0 \
|
||||
libxcb-keysyms1 \
|
||||
libxcb-randr0 \
|
||||
libxcb-render-util0 \
|
||||
libxcb-render0 \
|
||||
libxcb-shape0 \
|
||||
libxcb-shm0 \
|
||||
libxcb-sync1 \
|
||||
libxcb-util1 \
|
||||
libxcb-xfixes0 \
|
||||
libxcb-xinerama0 \
|
||||
libxcb1 \
|
||||
libxkbcommon-dev \
|
||||
libxkbcommon-x11-0 \
|
||||
libxcb-xkb-dev \
|
||||
p7zip-full \
|
||||
&& sudo rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN sudo pip3 install aqtinstall
|
||||
|
||||
ARG QT_VERSION=6.4.1
|
||||
ARG QT_ARCH=gcc_64
|
||||
|
||||
ARG QT_DIR=/opt/qt
|
||||
RUN sudo aqt install-qt --outputdir ${QT_DIR} linux desktop ${QT_VERSION} ${QT_ARCH} --modules \
|
||||
qtremoteobjects \
|
||||
qt5compat \
|
||||
qtshadertools
|
||||
ENV QT_BIN_DIR=${QT_DIR}/${QT_VERSION}/${QT_ARCH}/bin
|
||||
|
||||
ARG QIF_VERSION=4.5
|
||||
ARG QIF_DIR=/opt/qif
|
||||
RUN sudo aqt install-tool --outputdir ${QIF_DIR} linux desktop tools_ifw
|
||||
ENV QIF_BIN_DIR=${QIF_DIR}/Tools/QtInstallerFramework/${QIF_VERSION}/bin
|
||||
@@ -0,0 +1,8 @@
|
||||
tasks:
|
||||
- init: >-
|
||||
deploy/build_linux.sh
|
||||
image:
|
||||
file: .gitpod.Dockerfile
|
||||
vscode:
|
||||
extensions:
|
||||
- llvm-vs-code-extensions.vscode-clangd
|
||||
+1
-1
@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.25.0 FATAL_ERROR)
|
||||
|
||||
set(PROJECT AmneziaVPN)
|
||||
|
||||
project(${PROJECT} VERSION 3.0.7.2
|
||||
project(${PROJECT} VERSION 3.0.7.4
|
||||
DESCRIPTION "AmneziaVPN"
|
||||
HOMEPAGE_URL "https://amnezia.org/"
|
||||
)
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
# Amnezia VPN
|
||||
## _The best client for self-hosted VPN_
|
||||
|
||||
[]
|
||||
[](https://github.com/amnezia-vpn/amnezia-client/actions/workflows/deploy.yml?query=branch:dev)
|
||||
[](https://gitpod.io/#https://github.com/amnezia-vpn/amnezia-client)
|
||||
|
||||
Amnezia is a VPN client with the key feature of deploying your own VPN server on you virtual server.
|
||||
|
||||
|
||||
@@ -214,7 +214,11 @@ if(APPLE)
|
||||
|
||||
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.15)
|
||||
add_compile_definitions(MVPN_MACOS)
|
||||
# ICON = $$PWD/images/app.icns
|
||||
|
||||
set(ICON_FILE ${CMAKE_CURRENT_SOURCE_DIR}/images/app.icns)
|
||||
set(MACOSX_BUNDLE_ICON_FILE app.icns)
|
||||
set_source_files_properties(${ICON_FILE} PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
|
||||
set(SOURCES ${SOURCES} ${ICON_FILE})
|
||||
|
||||
find_library(FW_COCOA Cocoa)
|
||||
find_library(FW_APPLICATIONSERVICES ApplicationServices)
|
||||
|
||||
@@ -42,11 +42,8 @@ QString CloakConfigurator::genCloakConfig(const ServerCredentials &credentials,
|
||||
config.insert("NumConn", 1);
|
||||
config.insert("BrowserSig", "chrome");
|
||||
config.insert("StreamTimeout", 300);
|
||||
|
||||
// transfer params to protocol runner
|
||||
config.insert(config_key::transport_proto, "tcp");
|
||||
config.insert(config_key::remote, credentials.hostName);
|
||||
config.insert(config_key::port, "$CLOAK_SERVER_PORT");
|
||||
config.insert("RemoteHost", credentials.hostName);
|
||||
config.insert("RemotePort", "$CLOAK_SERVER_PORT");
|
||||
|
||||
QString textCfg = serverController.replaceVars(QJsonDocument(config).toJson(),
|
||||
serverController.genVarsForScript(credentials, container, containerConfig));
|
||||
|
||||
@@ -257,7 +257,6 @@ namespace libssh {
|
||||
int bytesWritten = sftp_write(file, buffer, bufferSize);
|
||||
|
||||
std::string chunk(buffer, bufferSize);
|
||||
qDebug() << "sftp write: " << QString(chunk.c_str());
|
||||
|
||||
if (bytesWritten != bufferSize) {
|
||||
fin.close();
|
||||
@@ -272,7 +271,6 @@ namespace libssh {
|
||||
fin.read(buffer, lastChunkSize);
|
||||
|
||||
std::string chunk(buffer, lastChunkSize);
|
||||
qDebug() << "sftp write: " << QString(chunk.c_str());
|
||||
|
||||
int bytesWritten = sftp_write(file, buffer, lastChunkSize);
|
||||
|
||||
|
||||
@@ -80,6 +80,92 @@
|
||||
</array>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>UTTypeConformsTo</key>
|
||||
<array>
|
||||
<string>public.data</string>
|
||||
</array>
|
||||
<key>UTTypeDescription</key>
|
||||
<string>WireGuard config</string>
|
||||
<key>UTTypeIconFiles</key>
|
||||
<array/>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>org.amnezia.AmneziaVPN.wireguard-config</string>
|
||||
<key>UTTypeTagSpecification</key>
|
||||
<dict>
|
||||
<key>public.filename-extension</key>
|
||||
<array>
|
||||
<string>conf</string>
|
||||
<string>cfg</string>
|
||||
</array>
|
||||
<key>public.mime-type</key>
|
||||
<array>
|
||||
<string>text/plain</string>
|
||||
</array>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>UTTypeConformsTo</key>
|
||||
<array>
|
||||
<string>public.data</string>
|
||||
</array>
|
||||
<key>UTTypeDescription</key>
|
||||
<string>OpenVPN config</string>
|
||||
<key>UTTypeIconFiles</key>
|
||||
<array/>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>org.amnezia.AmneziaVPN.openvpn-config</string>
|
||||
<key>UTTypeTagSpecification</key>
|
||||
<dict>
|
||||
<key>public.filename-extension</key>
|
||||
<array>
|
||||
<string>ovpn</string>
|
||||
</array>
|
||||
<key>public.mime-type</key>
|
||||
<array>
|
||||
<string>text/plain</string>
|
||||
</array>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>UTTypeConformsTo</key>
|
||||
<array>
|
||||
<string>public.data</string>
|
||||
</array>
|
||||
<key>UTTypeDescription</key>
|
||||
<string>AmneziaVPN backup file</string>
|
||||
<key>UTTypeIconFiles</key>
|
||||
<array/>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>org.amnezia.AmneziaVPN.backup-config</string>
|
||||
<key>UTTypeTagSpecification</key>
|
||||
<dict>
|
||||
<key>public.filename-extension</key>
|
||||
<array>
|
||||
<string>backup</string>
|
||||
</array>
|
||||
<key>public.mime-type</key>
|
||||
<array>
|
||||
<string>text/plain</string>
|
||||
</array>
|
||||
</dict>
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleDocumentTypes</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>Amnezia VPN config</string>
|
||||
<key>LSHandlerRank</key>
|
||||
<string>Alternate</string>
|
||||
<key>LSItemContentTypes</key>
|
||||
<array>
|
||||
<string>org.amnezia.AmneziaVPN.amnezia-config</string>
|
||||
<string>org.amnezia.AmneziaVPN.wireguard-config</string>
|
||||
<string>org.amnezia.AmneziaVPN.openvpn-config</string>
|
||||
<string>org.amnezia.AmneziaVPN.backup-config</string>
|
||||
</array>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
</plist>
|
||||
|
||||
@@ -249,7 +249,7 @@ void AndroidController::cleanupBackendLogs() {
|
||||
}
|
||||
|
||||
void AndroidController::importConfig(const QString& data){
|
||||
m_startPageLogic->selectConfigFormat(data);
|
||||
m_startPageLogic->importAnyFile(data);
|
||||
}
|
||||
|
||||
const QJsonObject &AndroidController::vpnConfig() const
|
||||
|
||||
@@ -73,15 +73,13 @@
|
||||
NSLog(@"Application openURL: %@", url);
|
||||
if (url.fileURL) {
|
||||
QString filePath(url.path.UTF8String);
|
||||
qDebug() << "filePath:" << filePath;
|
||||
if (filePath.isEmpty()) return NO;
|
||||
|
||||
QFile file(filePath);
|
||||
bool isOpenFile = file.open(QIODevice::ReadOnly);
|
||||
qDebug() << "isOpenFile:" << isOpenFile;
|
||||
QByteArray data = file.readAll();
|
||||
|
||||
[QtAppDelegate sharedQtAppDelegate].startPageLogic->importConnectionFromCode(QString(data));
|
||||
[QtAppDelegate sharedQtAppDelegate].startPageLogic->importAnyFile(QString(data));
|
||||
return YES;
|
||||
}
|
||||
return NO;
|
||||
|
||||
@@ -18,10 +18,7 @@ OpenVpnOverCloakProtocol::~OpenVpnOverCloakProtocol()
|
||||
{
|
||||
qDebug() << "OpenVpnOverCloakProtocol::~OpenVpnOverCloakProtocol";
|
||||
OpenVpnOverCloakProtocol::stop();
|
||||
QThread::msleep(200);
|
||||
#ifndef Q_OS_IOS
|
||||
m_ckProcess.close();
|
||||
#endif
|
||||
}
|
||||
|
||||
ErrorCode OpenVpnOverCloakProtocol::start()
|
||||
@@ -30,11 +27,17 @@ ErrorCode OpenVpnOverCloakProtocol::start()
|
||||
setLastError(ErrorCode::CloakExecutableMissing);
|
||||
return lastError();
|
||||
}
|
||||
#ifndef Q_OS_IOS
|
||||
|
||||
if (Utils::processIsRunning(Utils::executable("ck-client", false))) {
|
||||
Utils::killProcessByName(Utils::executable("ck-client", false));
|
||||
}
|
||||
|
||||
// workaround for desktop releases >= 3.0.7
|
||||
if (!m_cloakConfig.contains("RemoteHost") && m_cloakConfig.contains(config_key::remote)) {
|
||||
m_cloakConfig["RemoteHost"] = m_cloakConfig.value(config_key::remote);
|
||||
m_cloakConfig["RemotePort"] = m_cloakConfig.value(config_key::port);
|
||||
}
|
||||
|
||||
#ifdef QT_DEBUG
|
||||
m_cloakCfgFile.setAutoRemove(false);
|
||||
#endif
|
||||
@@ -43,15 +46,8 @@ ErrorCode OpenVpnOverCloakProtocol::start()
|
||||
m_cloakCfgFile.close();
|
||||
|
||||
QStringList args = QStringList() << "-c" << m_cloakCfgFile.fileName()
|
||||
<< "-s" << m_cloakConfig.value(config_key::remote).toString()
|
||||
<< "-p" << m_cloakConfig.value(config_key::port).toString(amnezia::protocols::cloak::defaultPort)
|
||||
<< "-l" << amnezia::protocols::openvpn::defaultPort;
|
||||
|
||||
ProtocolEnumNS::TransportProto tp = ProtocolProps::transportProtoFromString(m_cloakConfig.value(config_key::transport_proto).toString());
|
||||
if (tp == ProtocolEnumNS::TransportProto::Udp) {
|
||||
args << "-u";
|
||||
}
|
||||
|
||||
qDebug().noquote() << "OpenVpnOverCloakProtocol::start()"
|
||||
<< cloakExecPath() << args.join(" ");
|
||||
|
||||
@@ -86,7 +82,6 @@ ErrorCode OpenVpnOverCloakProtocol::start()
|
||||
return OpenVpnProtocol::start();
|
||||
}
|
||||
else return ErrorCode::CloakExecutableMissing;
|
||||
#endif
|
||||
}
|
||||
|
||||
void OpenVpnOverCloakProtocol::stop()
|
||||
@@ -100,9 +95,12 @@ void OpenVpnOverCloakProtocol::stop()
|
||||
Utils::signalCtrl(m_ckProcess.processId(), CTRL_C_EVENT);
|
||||
#endif
|
||||
|
||||
#ifndef Q_OS_IOS
|
||||
m_ckProcess.terminate();
|
||||
#endif
|
||||
|
||||
if (Utils::processIsRunning(Utils::executable("ck-client", false))) {
|
||||
QThread::msleep(1000);
|
||||
Utils::killProcessByName(Utils::executable("ck-client", false));
|
||||
}
|
||||
}
|
||||
|
||||
QString OpenVpnOverCloakProtocol::cloakExecPath()
|
||||
|
||||
@@ -100,6 +100,11 @@ void ServerSettingsLogic::onLineEditDescriptionEditingFinished()
|
||||
uiLogic()->onUpdateAllPages();
|
||||
}
|
||||
|
||||
bool ServerSettingsLogic::isCurrentServerHasCredentials()
|
||||
{
|
||||
return m_settings->haveAuthData(uiLogic()->m_selectedServerIndex);
|
||||
}
|
||||
|
||||
#if defined(Q_OS_ANDROID)
|
||||
/* Auth result handler for Android */
|
||||
void authResultReceiver::handleActivityResult(int receiverRequestCode, int resultCode, const QJniObject &data)
|
||||
|
||||
@@ -31,6 +31,8 @@ public:
|
||||
Q_INVOKABLE void onPushButtonClearClientCacheClicked();
|
||||
Q_INVOKABLE void onLineEditDescriptionEditingFinished();
|
||||
|
||||
Q_INVOKABLE bool isCurrentServerHasCredentials();
|
||||
|
||||
public:
|
||||
explicit ServerSettingsLogic(UiLogic *uiLogic, QObject *parent = nullptr);
|
||||
~ServerSettingsLogic() = default;
|
||||
|
||||
@@ -192,7 +192,7 @@ void StartPageLogic::onPushButtonImportOpenFile()
|
||||
file.open(QIODevice::ReadOnly);
|
||||
QByteArray data = file.readAll();
|
||||
|
||||
selectConfigFormat(QString(data));
|
||||
importAnyFile(QString(data));
|
||||
}
|
||||
|
||||
#ifdef Q_OS_ANDROID
|
||||
@@ -202,7 +202,7 @@ void StartPageLogic::startQrDecoder()
|
||||
}
|
||||
#endif
|
||||
|
||||
void StartPageLogic::selectConfigFormat(QString configData)
|
||||
void StartPageLogic::importAnyFile(const QString &configData)
|
||||
{
|
||||
auto configFormat = checkConfigFormat(configData);
|
||||
if (configFormat == ConfigTypes::OpenVpn) {
|
||||
|
||||
@@ -23,7 +23,7 @@ class StartPageLogic : public PageLogicBase
|
||||
AUTO_PROPERTY(QString, labelWaitInfoText)
|
||||
AUTO_PROPERTY(bool, pushButtonBackFromStartVisible)
|
||||
|
||||
AUTO_PROPERTY(QString, privateKeyPassphrase);
|
||||
AUTO_PROPERTY(QString, privateKeyPassphrase)
|
||||
|
||||
READONLY_PROPERTY(QRegularExpression, ipAddressPortRegex)
|
||||
public:
|
||||
@@ -37,7 +37,7 @@ public:
|
||||
Q_INVOKABLE void startQrDecoder();
|
||||
#endif
|
||||
|
||||
void selectConfigFormat(QString configData);
|
||||
void importAnyFile(const QString &configData);
|
||||
|
||||
bool importConnection(const QJsonObject &profile);
|
||||
bool importConnectionFromCode(QString code);
|
||||
|
||||
@@ -13,12 +13,18 @@ Popup {
|
||||
|
||||
anchors.centerIn: Overlay.overlay
|
||||
modal: true
|
||||
closePolicy: Popup.NoAutoClose
|
||||
closePolicy: Popup.CloseOnEscape
|
||||
|
||||
width: parent.width - 20
|
||||
focus: true
|
||||
|
||||
onAboutToHide: {
|
||||
parent.forceActiveFocus(true)
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
width: parent.width
|
||||
|
||||
Text {
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
Layout.fillWidth: true
|
||||
@@ -28,9 +34,9 @@ Popup {
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
BlueButtonType {
|
||||
id: yesButton
|
||||
Layout.preferredWidth: parent.width / 2
|
||||
Layout.fillWidth: true
|
||||
text: yesText
|
||||
onClicked: {
|
||||
@@ -43,7 +49,6 @@ Popup {
|
||||
}
|
||||
BlueButtonType {
|
||||
id: noButton
|
||||
Layout.preferredWidth: parent.width / 2
|
||||
Layout.fillWidth: true
|
||||
text: noText
|
||||
onClicked: {
|
||||
|
||||
@@ -110,13 +110,18 @@ PageBase {
|
||||
Layout.topMargin: 10
|
||||
text: qsTr("Forget this server")
|
||||
onClicked: {
|
||||
if (ServerSettingsLogic.isCurrentServerHasCredentials()) {
|
||||
popupForgetServer.questionText = "Attention! This action will not remove any data from the server, it will just remove server from the list. Continue?"
|
||||
}
|
||||
else {
|
||||
popupForgetServer.questionText = "Remove server from the list?"
|
||||
}
|
||||
popupForgetServer.open()
|
||||
}
|
||||
}
|
||||
|
||||
PopupWithQuestion {
|
||||
id: popupForgetServer
|
||||
questionText: "Attention! This action will not remove the container on the server, it will only remove the container information from the application. Continue?"
|
||||
yesFunc: function() {
|
||||
ServerSettingsLogic.onPushButtonForgetServer()
|
||||
close()
|
||||
|
||||
@@ -233,9 +233,8 @@ PageBase {
|
||||
anchors.top: label_server_ip.bottom
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
text: StartPageLogic.lineEditIpText
|
||||
onEditingFinished: {
|
||||
StartPageLogic.lineEditIpText = text
|
||||
}
|
||||
onEditingFinished: { StartPageLogic.lineEditIpText = text }
|
||||
onTextEdited: { StartPageLogic.lineEditIpText = text }
|
||||
|
||||
validator: RegularExpressionValidator {
|
||||
regularExpression: StartPageLogic.ipAddressPortRegex
|
||||
@@ -253,9 +252,8 @@ PageBase {
|
||||
anchors.top: label_login.bottom
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
text: StartPageLogic.lineEditLoginText
|
||||
onEditingFinished: {
|
||||
StartPageLogic.lineEditLoginText = text
|
||||
}
|
||||
onEditingFinished: { StartPageLogic.lineEditLoginText = text }
|
||||
onTextEdited: { StartPageLogic.lineEditLoginText = text }
|
||||
}
|
||||
|
||||
LabelType {
|
||||
@@ -268,25 +266,29 @@ PageBase {
|
||||
id: new_server_password
|
||||
anchors.top: label_new_server_password.bottom
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
inputMethodHints: Qt.ImhSensitiveData
|
||||
echoMode: TextInput.Password
|
||||
text: StartPageLogic.lineEditPasswordText
|
||||
onEditingFinished: {
|
||||
StartPageLogic.lineEditPasswordText = text
|
||||
}
|
||||
onEditingFinished: { StartPageLogic.lineEditPasswordText = text }
|
||||
onTextEdited: { StartPageLogic.lineEditPasswordText = text }
|
||||
onAccepted: { StartPageLogic.onPushButtonConnect() }
|
||||
}
|
||||
TextFieldType {
|
||||
id: new_server_ssh_key
|
||||
anchors.top: label_new_server_password.bottom
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
visible: false
|
||||
height: 71
|
||||
font.pixelSize: 10
|
||||
verticalAlignment: Text.AlignTop
|
||||
inputMethodHints: Qt.ImhSensitiveData
|
||||
|
||||
text: StartPageLogic.textEditSshKeyText
|
||||
onEditingFinished: {
|
||||
StartPageLogic.textEditSshKeyText = text
|
||||
}
|
||||
visible: false
|
||||
onEditingFinished: { StartPageLogic.textEditSshKeyText = text }
|
||||
onTextEdited: { StartPageLogic.textEditSshKeyText = text }
|
||||
onAccepted: { StartPageLogic.onPushButtonConnect() }
|
||||
}
|
||||
|
||||
LabelType {
|
||||
|
||||
@@ -354,7 +354,7 @@ Window {
|
||||
}
|
||||
textArea.wrapMode: cbLogWrap.checked ? TextEdit.WordWrap: TextEdit.NoWrap
|
||||
|
||||
Keys.onPressed: {
|
||||
Keys.onPressed: function(event) {
|
||||
UiLogic.keyPressEvent(event.key)
|
||||
event.accepted = true
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ bool Utils::processIsRunning(const QString& fileName)
|
||||
QProcess process;
|
||||
process.setReadChannel(QProcess::StandardOutput);
|
||||
process.setProcessChannelMode(QProcess::MergedChannels);
|
||||
process.start(QString("wmic.exe /OUTPUT:STDOUT PROCESS get %1").arg("Caption"));
|
||||
process.start("wmic.exe", QStringList() << "/OUTPUT:STDOUT" << "PROCESS" << "get" << "Caption");
|
||||
process.waitForStarted();
|
||||
process.waitForFinished();
|
||||
QString processData(process.readAll());
|
||||
@@ -165,9 +165,8 @@ bool Utils::checkIpSubnetFormat(const QString &ip)
|
||||
void Utils::killProcessByName(const QString &name)
|
||||
{
|
||||
qDebug().noquote() << "Kill process" << name;
|
||||
qDebug() << "Hello";
|
||||
#ifdef Q_OS_WIN
|
||||
QProcess::execute(QString("taskkill /im %1 /f").arg(name));
|
||||
QProcess::execute("taskkill", QStringList() << "/IM" << name << "/F");
|
||||
#elif defined Q_OS_IOS
|
||||
return;
|
||||
#else
|
||||
|
||||
@@ -66,11 +66,9 @@ echo "____________________________________"
|
||||
echo "............Deploy.................."
|
||||
echo "____________________________________"
|
||||
|
||||
# Package
|
||||
# Package
|
||||
echo "Packaging ..."
|
||||
|
||||
#cd $DEPLOY_DIR
|
||||
|
||||
$QT_BIN_DIR/macdeployqt $OUT_APP_DIR/$APP_FILENAME -always-overwrite -qmldir=$PROJECT_DIR
|
||||
cp -av $BUILD_DIR/service/server/$APP_NAME-service $BUNDLE_DIR/Contents/macOS
|
||||
cp -Rv $PROJECT_DIR/deploy/data/macos/* $BUNDLE_DIR/Contents/macOS
|
||||
@@ -147,7 +145,7 @@ if [ "${MAC_CERT_PW+x}" ]; then
|
||||
fi
|
||||
|
||||
echo "Building DMG installer..."
|
||||
hdiutil create -volname $APP_NAME -srcfolder $BUILD_DIR/installer/$APP_NAME.app -ov -format UDZO $DMG_FILENAME
|
||||
hdiutil create -volname Amnezia -srcfolder $BUILD_DIR/installer/$APP_NAME.app -ov -format UDZO $DMG_FILENAME
|
||||
|
||||
if [ "${MAC_CERT_PW+x}" ]; then
|
||||
echo "Signing DMG installer..."
|
||||
|
||||
@@ -7,10 +7,6 @@ set(CMAKE_CXX_STANDARD 20)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
if(NOT IOS AND NOT ANDROID)
|
||||
#include(common.cmake)
|
||||
#if (qtservice-uselib)
|
||||
# add_subdirectory(buildlib)
|
||||
#endif()
|
||||
add_subdirectory(server)
|
||||
endif()
|
||||
|
||||
|
||||
@@ -94,11 +94,16 @@ include_directories(
|
||||
add_executable(${PROJECT} ${SOURCES} ${HEADERS})
|
||||
target_link_libraries(${PROJECT} PRIVATE Qt6::Core Qt6::Network Qt6::RemoteObjects Qt6::Core5Compat ${LIBS})
|
||||
|
||||
qt_add_repc_sources(${PROJECT} ${CMAKE_CURRENT_LIST_DIR}/../../ipc/ipc_interface.rep)
|
||||
if(NOT IOS)
|
||||
qt_add_repc_sources(${PROJECT} ${CMAKE_CURRENT_LIST_DIR}/../../ipc/ipc_process_interface.rep)
|
||||
if(APPLE)
|
||||
set_target_properties(${PROJECT} PROPERTIES
|
||||
INSTALL_RPATH "@executable_path/../Frameworks"
|
||||
BUILD_WITH_INSTALL_RPATH TRUE
|
||||
)
|
||||
endif()
|
||||
|
||||
qt_add_repc_sources(${PROJECT} ${CMAKE_CURRENT_LIST_DIR}/../../ipc/ipc_interface.rep)
|
||||
qt_add_repc_sources(${PROJECT} ${CMAKE_CURRENT_LIST_DIR}/../../ipc/ipc_process_interface.rep)
|
||||
|
||||
# deploy artifacts required to run the application to the debug build folder
|
||||
if(WIN32)
|
||||
if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8")
|
||||
@@ -112,12 +117,10 @@ elseif(APPLE AND NOT IOS)
|
||||
set(DEPLOY_ARTIFACT_PATH "macos")
|
||||
endif()
|
||||
|
||||
if(NOT IOS AND NOT ANDROID)
|
||||
add_custom_command(
|
||||
TARGET ${PROJECT} POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E $<IF:$<CONFIG:Debug>,copy_directory,true>
|
||||
${CMAKE_SOURCE_DIR}/deploy/data/${DEPLOY_ARTIFACT_PATH}
|
||||
$<TARGET_FILE_DIR:${PROJECT}>
|
||||
COMMAND_EXPAND_LISTS
|
||||
)
|
||||
endif()
|
||||
add_custom_command(
|
||||
TARGET ${PROJECT} POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E $<IF:$<CONFIG:Debug>,copy_directory,true>
|
||||
${CMAKE_SOURCE_DIR}/deploy/data/${DEPLOY_ARTIFACT_PATH}
|
||||
$<TARGET_FILE_DIR:${PROJECT}>
|
||||
COMMAND_EXPAND_LISTS
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user