mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-22 02:01:08 +07:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| fdf4b8a5bd | |||
| 7da9539f2a | |||
| 12083c098a | |||
| dfdb89d7a9 |
@@ -233,7 +233,7 @@ jobs:
|
|||||||
- name: 'Setup xcode'
|
- name: 'Setup xcode'
|
||||||
uses: maxim-lobanov/setup-xcode@v1
|
uses: maxim-lobanov/setup-xcode@v1
|
||||||
with:
|
with:
|
||||||
xcode-version: '13.4'
|
xcode-version: '14.3.1'
|
||||||
|
|
||||||
- name: 'Install Qt'
|
- name: 'Install Qt'
|
||||||
uses: jurplel/install-qt-action@v3
|
uses: jurplel/install-qt-action@v3
|
||||||
|
|||||||
@@ -293,6 +293,23 @@ QQmlApplicationEngine *AmneziaApplication::qmlEngine() const
|
|||||||
return m_engine;
|
return m_engine;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef Q_OS_MACOS
|
||||||
|
bool AmneziaApplication::event(QEvent *event)
|
||||||
|
{
|
||||||
|
if (event->type() == QEvent::FileOpen) {
|
||||||
|
QFileOpenEvent *openEvent = static_cast<QFileOpenEvent *>(event);
|
||||||
|
const QUrl url = openEvent->url();
|
||||||
|
if (url.isLocalFile()) {
|
||||||
|
m_pageController->replaceStartPage();
|
||||||
|
m_importController->extractConfigFromFile(url.toLocalFile());
|
||||||
|
m_pageController->goToPageViewConfig();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return QApplication::event(event);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void AmneziaApplication::initModels()
|
void AmneziaApplication::initModels()
|
||||||
{
|
{
|
||||||
m_containersModel.reset(new ContainersModel(this));
|
m_containersModel.reset(new ContainersModel(this));
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
#include <QQmlApplicationEngine>
|
#include <QQmlApplicationEngine>
|
||||||
#include <QQmlContext>
|
#include <QQmlContext>
|
||||||
#include <QThread>
|
#include <QThread>
|
||||||
|
#include <QFileOpenEvent>
|
||||||
#if defined(Q_OS_ANDROID) || defined(Q_OS_IOS)
|
#if defined(Q_OS_ANDROID) || defined(Q_OS_IOS)
|
||||||
#include <QGuiApplication>
|
#include <QGuiApplication>
|
||||||
#else
|
#else
|
||||||
@@ -74,6 +75,10 @@ public:
|
|||||||
|
|
||||||
QQmlApplicationEngine *qmlEngine() const;
|
QQmlApplicationEngine *qmlEngine() const;
|
||||||
|
|
||||||
|
#ifdef Q_OS_MACOS
|
||||||
|
bool event(QEvent *event) override;
|
||||||
|
#endif
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void translationsUpdated();
|
void translationsUpdated();
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
message("MAC build")
|
message("MAC build")
|
||||||
|
|
||||||
|
set(APPLE_PROJECT_VERSION ${CMAKE_PROJECT_VERSION_MAJOR}.${CMAKE_PROJECT_VERSION_MINOR}.${CMAKE_PROJECT_VERSION_PATCH})
|
||||||
|
|
||||||
find_library(FW_SYSTEMCONFIG SystemConfiguration)
|
find_library(FW_SYSTEMCONFIG SystemConfiguration)
|
||||||
find_library(FW_SERVICEMGMT ServiceManagement)
|
find_library(FW_SERVICEMGMT ServiceManagement)
|
||||||
find_library(FW_SECURITY Security)
|
find_library(FW_SECURITY Security)
|
||||||
@@ -19,6 +21,17 @@ set(LIBS ${LIBS}
|
|||||||
)
|
)
|
||||||
|
|
||||||
set_target_properties(${PROJECT} PROPERTIES MACOSX_BUNDLE TRUE)
|
set_target_properties(${PROJECT} PROPERTIES MACOSX_BUNDLE TRUE)
|
||||||
|
|
||||||
|
set_target_properties(${PROJECT} PROPERTIES
|
||||||
|
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/macos/app/Info.plist
|
||||||
|
XCODE_ATTRIBUTE_PRODUCT_NAME "AmneziaVPN"
|
||||||
|
XCODE_ATTRIBUTE_BUNDLE_INFO_STRING "AmneziaVPN"
|
||||||
|
MACOSX_BUNDLE_GUI_IDENTIFIER "${BUILD_OSX_APP_IDENTIFIER}"
|
||||||
|
MACOSX_BUNDLE_BUNDLE_VERSION "${CMAKE_PROJECT_VERSION_TWEAK}"
|
||||||
|
MACOSX_BUNDLE_LONG_VERSION_STRING "${APPLE_PROJECT_VERSION}-${CMAKE_PROJECT_VERSION_TWEAK}"
|
||||||
|
MACOSX_BUNDLE_SHORT_VERSION_STRING "${APPLE_PROJECT_VERSION}"
|
||||||
|
)
|
||||||
|
|
||||||
set(CMAKE_OSX_ARCHITECTURES "x86_64" CACHE INTERNAL "" FORCE)
|
set(CMAKE_OSX_ARCHITECTURES "x86_64" CACHE INTERNAL "" FORCE)
|
||||||
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.15)
|
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.15)
|
||||||
|
|
||||||
|
|||||||
+51
-31
@@ -2,49 +2,69 @@
|
|||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
<dict>
|
<dict>
|
||||||
<key>CFBundleDevelopmentRegion</key>
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
<string>6.0</string>
|
||||||
|
<key>CFBundlePackageType</key>
|
||||||
|
<string>APPL</string>
|
||||||
|
|
||||||
<key>CFBundleAllowMixedLocalizations</key>
|
<key>CFBundleName</key>
|
||||||
<true/>
|
<string>${MACOSX_BUNDLE_BUNDLE_NAME}</string>
|
||||||
|
|
||||||
<key>CFBundleExecutable</key>
|
<key>CFBundleIdentifier</key>
|
||||||
<string>${EXECUTABLE_NAME}</string>
|
<string>${MACOSX_BUNDLE_GUI_IDENTIFIER}</string>
|
||||||
|
|
||||||
<key>CFBundleIdentifier</key>
|
<key>CFBundleExecutable</key>
|
||||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
<string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string>
|
||||||
|
|
||||||
<key>CFBundleInfoDictionaryVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>6.0</string>
|
<string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string>
|
||||||
|
|
||||||
<key>CFBundleName</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>$(PRODUCT_NAME)</string>
|
<string>${MACOSX_BUNDLE_SHORT_VERSION_STRING}</string>
|
||||||
|
|
||||||
<key>CFBundlePackageType</key>
|
<key>CFBundleDocumentTypes</key>
|
||||||
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>CFBundleTypeExtensions</key>
|
||||||
|
<array>
|
||||||
|
<string>conf</string>
|
||||||
|
<string>vpn</string>
|
||||||
|
<string>ovpn</string>
|
||||||
|
<string>backup</string>
|
||||||
|
</array>
|
||||||
|
<key>CFBundleTypeRole</key>
|
||||||
|
<string>Viewer</string>
|
||||||
|
<key>CFBundleTypeName</key>
|
||||||
|
<string>AmneziaVPN configuration file</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>
|
||||||
|
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>LSMinimumSystemVersion</key>
|
||||||
<string>$(MARKETING_VERSION)</string>
|
<string>${CMAKE_OSX_DEPLOYMENT_TARGET}</string>
|
||||||
|
|
||||||
<key>CFBundleVersion</key>
|
<key>NSHumanReadableCopyright</key>
|
||||||
<string>$(CURRENT_PROJECT_VERSION)</string>
|
<string>${MACOSX_BUNDLE_COPYRIGHT}</string>
|
||||||
|
|
||||||
<key>ITSAppUsesNonExemptEncryption</key>
|
<key>CFBundleIconFile</key>
|
||||||
<false/>
|
<string>${MACOSX_BUNDLE_ICON_FILE}</string>
|
||||||
|
|
||||||
<key>LSApplicationCategoryType</key>
|
<key>CFBundleDevelopmentRegion</key>
|
||||||
<string>public.app-category.utilities</string>
|
<string>en</string>
|
||||||
|
|
||||||
<key>LSMinimumSystemVersion</key>
|
<key>CFBundleAllowMixedLocalizations</key>
|
||||||
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
|
<true/>
|
||||||
|
|
||||||
<key>LSMultipleInstancesProhibited</key>
|
<key>NSPrincipalClass</key>
|
||||||
<true/>
|
<string>NSApplication</string>
|
||||||
|
|
||||||
<key>NSPrincipalClass</key>
|
<key>NSSupportsAutomaticGraphicsSwitching</key>
|
||||||
<string>NSApplication</string>
|
<true/>
|
||||||
|
|
||||||
<key>NSSupportsAutomaticGraphicsSwitching</key>
|
|
||||||
<true/>
|
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|||||||
@@ -84,6 +84,12 @@ Component.prototype.createOperations = function()
|
|||||||
console.log("Microsoft Visual C++ 2017 Redistributable already installed");
|
console.log("Microsoft Visual C++ 2017 Redistributable already installed");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
component.addElevatedOperation("GlobalConfig", "Classes\Applications\@Publisher@", "@Title@", "shell/open/command", "@TargetDir@/@Name@.exe")
|
||||||
|
component.addElevatedOperation("GlobalConfig", "Classes\Applications\@Publisher@", "@Title@", "SupportedTypes", ".vpn")
|
||||||
|
component.addElevatedOperation("GlobalConfig", "Classes\Applications\@Publisher@", "@Title@", "SupportedTypes", ".conf")
|
||||||
|
component.addElevatedOperation("GlobalConfig", "Classes\Applications\@Publisher@", "@Title@", "SupportedTypes", ".ovpn")
|
||||||
|
component.addElevatedOperation("GlobalConfig", "Classes\Applications\@Publisher@", "@Title@", "SupportedTypes", ".backup")
|
||||||
|
|
||||||
let pu_path = installer.value("TargetDir").replace(/\//g, '\\') + "\\"
|
let pu_path = installer.value("TargetDir").replace(/\//g, '\\') + "\\"
|
||||||
component.addElevatedOperation("Execute",
|
component.addElevatedOperation("Execute",
|
||||||
["sc", "create", serviceName(), "binpath=", pu_path + serviceName() + ".exe",
|
["sc", "create", serviceName(), "binpath=", pu_path + serviceName() + ".exe",
|
||||||
|
|||||||
Reference in New Issue
Block a user