Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/macox network extension to dev branch #1274

Open
wants to merge 85 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
1e60792
Merge to dev branch
Oct 4, 2024
b6601d0
error UIKet
Oct 4, 2024
f7aa823
final build network extension
Oct 5, 2024
b1ad874
refactor code for iOS and MacNE
Oct 6, 2024
7da585f
update final code and cmake build file
Oct 7, 2024
022444a
Removed OpenVPNAdapter.bk submodule
Oct 8, 2024
e2099b1
clean source code
Oct 8, 2024
5569524
update all lib
Oct 9, 2024
ae16b19
fix build on github
Oct 9, 2024
226f9b9
add build ci/cd for macos ne
Oct 9, 2024
0500f18
add qtmultimedia
Oct 9, 2024
b338a4f
update build.sh
Oct 9, 2024
3193889
update build.sh
Oct 9, 2024
7d186c3
fix bug QT_BIN_DIR
Oct 9, 2024
1e893c2
fix bug QT_BIN_DIR
Oct 9, 2024
9ddfa54
fix bug QIF_VERSION
Oct 9, 2024
b93c5f3
fix bug qt-cmake
Oct 9, 2024
56d6ab2
fix bug qt-cmake
Oct 9, 2024
3c3d425
fix bug qt-cmake
Oct 9, 2024
aaa8030
fix bug qt-cmake
Oct 9, 2024
d0db129
fix bug qt-cmake
Oct 9, 2024
4c9a249
chaneg version QT
Oct 10, 2024
c9b61f4
input QT_BIN_DIR
Oct 10, 2024
4287e5a
input QT_BIN_DIR
Oct 10, 2024
3368506
input QT_PATH
Oct 10, 2024
9fc1df3
add target
Oct 10, 2024
bfc2ac6
error: No profiles for NE
Oct 10, 2024
e1d23c6
test build Mac NE
Oct 11, 2024
4700947
test build Mac NE change build
Oct 11, 2024
ea1a7e8
test build Mac NE change build
Oct 11, 2024
f8b951a
test build Mac NE change build
Oct 11, 2024
e6c3ece
test build Mac NE change build
Oct 11, 2024
6ef03f9
test build Mac NE change build
Oct 11, 2024
e4679ff
test build Mac NE change build
Oct 11, 2024
1cdb8b3
test build Mac NE change build
Oct 11, 2024
b3cd6e0
test build Mac NE change build
Oct 11, 2024
484d33e
test build Mac NE change build
Oct 11, 2024
d0b8581
final clean code
Oct 13, 2024
26589d2
Final clean source code
Oct 13, 2024
3721d64
Final clean source code
Oct 13, 2024
bfbcb64
Final clean source code
Oct 13, 2024
d4f9acd
Clean code, comment
Oct 13, 2024
a33da40
revert PacketTunnelXray
Oct 13, 2024
d63bab3
revert deploy build action
Oct 13, 2024
5747eaf
revert build macne action
Oct 13, 2024
f064b9e
revert build android action
Oct 13, 2024
3dd7351
clean up code,build
Oct 14, 2024
1090570
revert build android because error build android action
Oct 14, 2024
beedfaf
Clean build file
Oct 19, 2024
364d4ab
handle macos ne
Oct 19, 2024
a6f2e5d
update clean build file
Oct 20, 2024
2be5bbc
add 3rd
Oct 21, 2024
9962131
fixbug crash build
Oct 29, 2024
7d6e83f
update
Oct 29, 2024
a2de7e0
fix bug Embedded Binary Bundle Identifier
Oct 29, 2024
771ef6e
fix bug NE
Oct 29, 2024
e104795
fix bug app icon
Oct 30, 2024
4532a91
merge with dev branch
Oct 30, 2024
599dad8
archive success
Nov 8, 2024
f777ad2
remove comment
Nov 8, 2024
b999a7a
xcode archive success
Nov 8, 2024
55202f2
validate success
Nov 8, 2024
6c53313
remove comment
Nov 10, 2024
a58fea6
update code sign
Nov 10, 2024
856e7e5
fix bug run error config
Nov 17, 2024
a40452d
change app logo
Nov 17, 2024
4dc9b3c
connect ssh success
Nov 21, 2024
3c5dee2
run success, build apple store success
Nov 23, 2024
445b90f
gitlab action for macne
Nov 27, 2024
9c2dd2d
rebuild macne
Nov 27, 2024
a399045
revert build ios, macos
Nov 27, 2024
5af77bd
Update build_ios.sh
AnhTVc Nov 27, 2024
01f4bb4
Update build macos gitaction
AnhTVc Nov 27, 2024
d4381e3
Update deploy.yml for build ios
AnhTVc Nov 27, 2024
27df915
Update deploy.yml for ios build: change xcode version
AnhTVc Nov 28, 2024
398ebac
update build for ios
Nov 28, 2024
5be1ac2
update
Nov 28, 2024
3611c33
change icon, handle last_handshake_time_sec, remove TODO
Dec 1, 2024
3f6370c
handle client/macos/app/Info.plist.in
Dec 1, 2024
46c0feb
remove QR for macos
Dec 1, 2024
e1287b2
remove QR for macos
Dec 1, 2024
cb544df
remove QR for macos
Dec 1, 2024
9f3fe5b
remove Q_OS_IOS on MacNE
Dec 2, 2024
0b2b7d7
add for sanbox
Dec 2, 2024
a54243d
change to manual sign
Dec 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 77 additions & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,10 @@ jobs:
# ------------------------------------------------------

Build-iOS:
runs-on: macos-13
runs-on: macos-latest

env:
QT_VERSION: 6.6.2
QT_VERSION: 6.8.0
CC: cc
CXX: c++
PROD_AGW_PUBLIC_KEY: ${{ secrets.PROD_AGW_PUBLIC_KEY }}
Expand All @@ -161,7 +161,7 @@ jobs:
- name: 'Setup xcode'
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '15.2'
xcode-version: '15.4.0'

- name: 'Install desktop Qt'
uses: jurplel/install-qt-action@v3
Expand Down Expand Up @@ -244,7 +244,7 @@ jobs:

env:
# Keep compat with MacOS 10.15 aka Catalina by Qt 6.4
QT_VERSION: 6.4.3
QT_VERSION: 6.8.0
QIF_VERSION: 4.6
PROD_AGW_PUBLIC_KEY: ${{ secrets.PROD_AGW_PUBLIC_KEY }}
PROD_S3_ENDPOINT: ${{ secrets.PROD_S3_ENDPOINT }}
Expand All @@ -256,7 +256,7 @@ jobs:
- name: 'Setup xcode'
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '14.3.1'
xcode-version: '15.4.0'

- name: 'Install Qt'
uses: jurplel/install-qt-action@v3
Expand Down Expand Up @@ -306,6 +306,78 @@ jobs:
path: deploy/build/client/AmneziaVPN.app
retention-days: 7

# ------------------------------------------------------
Build-MacOS-NE:
runs-on: macos-latest

env:
QT_VERSION: 6.8.0
QIF_VERSION: 4.6
QT_MIRROR: https://mirrors.ocf.berkeley.edu/qt/
PROD_AGW_PUBLIC_KEY: ${{ secrets.PROD_AGW_PUBLIC_KEY }}
DEV_AGW_PUBLIC_KEY: ${{ secrets.DEV_AGW_PUBLIC_KEY }}

steps:
- name: 'Setup Xcode'
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '16.1.0'

- name: 'Install desktop Qt'
uses: jurplel/install-qt-action@v3
with:
version: ${{ env.QT_VERSION }}
host: 'mac'
target: 'desktop'
modules: 'qtremoteobjects qt5compat qtshadertools qtmultimedia qtimageformats'
arch: 'clang_64'
dir: ${{ runner.temp }}
set-env: 'true'
extra: '--base ${{ env.QT_MIRROR }}'
- name: 'Install Qt Installer Framework ${{ env.QIF_VERSION }}'
run: |
mkdir -pv ${{ runner.temp }}/Qt/Tools/QtInstallerFramework
wget https://qt.amzsvc.com/tools/ifw/${{ env.QIF_VERSION }}.zip
unzip ${{ env.QIF_VERSION }}.zip -d ${{ runner.temp }}/Qt/Tools/QtInstallerFramework/
- name: 'Install Go'
uses: actions/setup-go@v5
with:
go-version: '1.22.1'
cache: false

- name: 'Get sources'
uses: actions/checkout@v4
with:
submodules: 'true'
fetch-depth: 10

- name: 'Install dependencies'
run: pip install jsonschema jinja2

- name: 'Set execute permissions for deploy script'
run: chmod +x deploy/build_macos_ne.sh

- name: 'Build and deploy macOS NE'
run: |
export QT_BIN_DIR="${{ runner.temp }}/Qt/${{ env.QT_VERSION }}/macos/bin"
export QT_MACOS_ROOT_DIR="${{ runner.temp }}/Qt/${{ env.QT_VERSION }}/macos"
bash deploy/build_macos_ne.sh
env:
MAC_TRUST_CERT_BASE64: ${{ secrets.MAC_TRUST_CERT_BASE64 }}
MAC_SIGNING_CERT_BASE64: ${{ secrets.MAC_SIGNING_CERT_BASE64 }}
MAC_SIGNING_CERT_PASSWORD: ${{ secrets.MAC_SIGNING_CERT_PASSWORD }}
APPSTORE_CONNECT_MAC_PROVISIONING_BASE64: ${{ secrets.APPSTORE_CONNECT_MAC_PROVISIONING }}
APPSTORE_CONNECT_MAC_NE_PROVISIONING_BASE64: ${{ secrets.APPSTORE_CONNECT_MAC_NE_PROVISIONING }}
APPSTORE_CONNECT_KEY_ID: ${{ secrets.APPSTORE_CONNECT_KEY_ID }}
APPSTORE_CONNECT_ISSUER_ID: ${{ secrets.APPSTORE_CONNECT_ISSUER_ID }}
APPSTORE_CONNECT_PRIVATE_KEY: ${{ secrets.APPSTORE_CONNECT_PRIVATE_KEY }}
- name: 'Upload macOS .dmg and dSYMs to artifacts'
uses: actions/upload-artifact@v4
with:
name: macos dmg & dsyms
path: |
${{ github.workspace }}/AmneziaVPN.dmg
retention-days: 7
# ------------------------------------------------------

Build-Android:
Expand Down
2 changes: 2 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[submodule "client/3rd/OpenVPNAdapter"]
path = client/3rd/OpenVPNAdapter
url = https://github.com/amnezia-vpn/OpenVPNAdapter.git
branch = macos-dirty-build
[submodule "client/3rd/qtkeychain"]
path = client/3rd/qtkeychain
url = https://github.com/frankosterfeld/qtkeychain.git
Expand All @@ -10,6 +11,7 @@
[submodule "client/3rd-prebuilt"]
path = client/3rd-prebuilt
url = https://github.com/amnezia-vpn/3rd-prebuilt
branch = fixbug/mac-network-extension
[submodule "client/3rd/amneziawg-apple"]
path = client/3rd/amneziawg-apple
url = https://github.com/amnezia-vpn/amneziawg-apple
Expand Down
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"files.associations": {
"complex": "cpp"
}
}
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ set(QT_BUILD_TOOLS_WHEN_CROSS_COMPILING ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

if(APPLE AND NOT IOS)
set(CMAKE_OSX_ARCHITECTURES "x86_64")
if((APPLE AND NOT IOS) OR (DEFINED MACOS_NE AND MACOS_NE AND NOT IOS))
set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64")
endif()

add_subdirectory(client)

if(NOT IOS AND NOT ANDROID)
if(NOT IOS AND NOT ANDROID AND NOT MACOS_NE)
add_subdirectory(service)

include(${CMAKE_SOURCE_DIR}/deploy/installer/config.cmake)
Expand Down
2 changes: 1 addition & 1 deletion client/3rd-prebuilt
Submodule 3rd-prebuilt updated 32 files
+ .DS_Store
+ 3rd-prebuilt/.DS_Store
+ 3rd-prebuilt/cloak/.DS_Store
+ 3rd-prebuilt/cloak/ios/.DS_Store
+ 3rd-prebuilt/cloak/ios/arm64/.DS_Store
+ 3rd-prebuilt/cloak/ios/arm64/ck-ovpn-plugin.a
+0 −1 3rd-prebuilt/cloak/ios/arm64/ck-ovpn-plugin.a.sha256
+0 −1 3rd-prebuilt/cloak/ios/arm64/ck-ovpn-plugin.h.sha256
+ 3rd-prebuilt/libssh/.DS_Store
+ 3rd-prebuilt/libssh/macos/.DS_Store
+ 3rd-prebuilt/libssh/macos/x86_64/.DS_Store
+16 −0 3rd-prebuilt/libssh/macos/x86_64/include/CMakeFiles/CMakeDirectoryInformation.cmake
+1 −0 3rd-prebuilt/libssh/macos/x86_64/include/CMakeFiles/progress.marks
+211 −0 3rd-prebuilt/libssh/macos/x86_64/include/Makefile
+45 −0 3rd-prebuilt/libssh/macos/x86_64/include/cmake_install.cmake
+16 −0 3rd-prebuilt/libssh/macos/x86_64/include/libssh/CMakeFiles/CMakeDirectoryInformation.cmake
+1 −0 3rd-prebuilt/libssh/macos/x86_64/include/libssh/CMakeFiles/progress.marks
+211 −0 3rd-prebuilt/libssh/macos/x86_64/include/libssh/Makefile
+55 −0 3rd-prebuilt/libssh/macos/x86_64/include/libssh/cmake_install.cmake
+2 −2 3rd-prebuilt/libssh/macos/x86_64/include/libssh/config.h
+ 3rd-prebuilt/libssh/macos/x86_64/libssh.a
+ 3rd-prebuilt/libssh/macos/x86_64/libssh_arm64.a
+ 3rd-prebuilt/libssh/macos/x86_64/libssh_x86_64.a
+ 3rd-prebuilt/libssh/macos/x86_64/libz.a
+ 3rd-prebuilt/libssh/macos/x86_64/libz_arm64.a
+ 3rd-prebuilt/libssh/macos/x86_64/libz_x86_64.a
+ 3rd-prebuilt/openssl/lib/libcrypto.a
+ 3rd-prebuilt/openssl/lib/libssl.a
+ 3rd-prebuilt/wireguard/.DS_Store
+ 3rd-prebuilt/wireguard/macos/.DS_Store
+ 3rd-prebuilt/wireguard/macos/x86_64/libwg-go.a
+1 −0 3rd-prebuilt/wireguard/macos/x86_64/libwg-go.a.sha256
2 changes: 1 addition & 1 deletion client/3rd/OpenVPNAdapter
Submodule OpenVPNAdapter updated 741 files
93 changes: 80 additions & 13 deletions client/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,12 @@ add_definitions(-DDEV_AGW_PUBLIC_KEY="$ENV{DEV_AGW_PUBLIC_KEY}")
add_definitions(-DDEV_AGW_ENDPOINT="$ENV{DEV_AGW_ENDPOINT}")
add_definitions(-DDEV_S3_ENDPOINT="$ENV{DEV_S3_ENDPOINT}")

if(IOS)
if(IOS OR MACOS_NE)
set(PACKAGES ${PACKAGES} Multimedia)
endif()

if(WIN32 OR (APPLE AND NOT IOS) OR (LINUX AND NOT ANDROID))
#Macos Network Extension doesn't need Widgets
if(WIN32 OR (APPLE AND NOT IOS AND NOT MACOS_NE) OR (LINUX AND NOT ANDROID))
set(PACKAGES ${PACKAGES} Widgets)
endif()

Expand All @@ -48,18 +49,20 @@ set(LIBS ${LIBS}
Qt6::Core5Compat Qt6::Concurrent
)

if(IOS)
if(IOS OR MACOS_NE)
set(LIBS ${LIBS} Qt6::Multimedia)
endif()

if(WIN32 OR (APPLE AND NOT IOS) OR (LINUX AND NOT ANDROID))
if(WIN32 OR (APPLE AND NOT IOS AND NOT MACOS_NE) OR (LINUX AND NOT ANDROID))
message("Run this block when MACOS_NE is not defined or set to FALSE")
set(LIBS ${LIBS} Qt6::Widgets)
endif()

qt_standard_project_setup()
qt_add_executable(${PROJECT} MANUAL_FINALIZATION)

if(WIN32 OR (APPLE AND NOT IOS) OR (LINUX AND NOT ANDROID))
if(WIN32 OR (APPLE AND NOT IOS AND NOT MACOS_NE) OR (LINUX AND NOT ANDROID))
message("Run this block when MACOS_NE is not defined or set to FALSE")
qt_add_repc_replicas(${PROJECT} ${CMAKE_CURRENT_LIST_DIR}/../ipc/ipc_interface.rep)
qt_add_repc_replicas(${PROJECT} ${CMAKE_CURRENT_LIST_DIR}/../ipc/ipc_process_interface.rep)
qt_add_repc_replicas(${PROJECT} ${CMAKE_CURRENT_LIST_DIR}/../ipc/ipc_process_tun2socks.rep)
Expand Down Expand Up @@ -97,10 +100,18 @@ qt6_add_resources(QRC ${I18NQRC} ${CMAKE_CURRENT_BINARY_DIR}/translations.qrc)
# -- i18n end

if(IOS)
message("Building for iOS")
execute_process(COMMAND bash ${CMAKE_CURRENT_LIST_DIR}/ios/scripts/openvpn.sh args
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR})
endif()

# Build openvpn adapter for MacOS Network Extension
if(MACOS_NE)
message("Building for MacOS Network Extension")
execute_process(COMMAND bash ${CMAKE_CURRENT_LIST_DIR}/macos/scripts/openvpn.sh args
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR})
endif()

set(IS_CI ${CI})
if(IS_CI)
message("Detected CI env")
Expand Down Expand Up @@ -161,12 +172,24 @@ include_directories(mozilla)
include_directories(mozilla/shared)
include_directories(mozilla/models)

if(NOT IOS)
if(MACOS_NE)
message("MACOS_NE is ON")
add_definitions(-DQ_OS_MAC)
add_definitions(-DMACOS_NE)
message("Add macros for MacOS Network Extension")
else()
message("MACOS_NE is OFF")
endif()


if(NOT IOS AND NOT MACOS_NE)
message(" Add header for non-IOS and non-MACOS_NE")
set(HEADERS ${HEADERS}
${CMAKE_CURRENT_LIST_DIR}/platforms/ios/QRCodeReaderBase.h
)
endif()


if(NOT ANDROID)
set(HEADERS ${HEADERS}
${CMAKE_CURRENT_LIST_DIR}/ui/notificationhandler.h
Expand Down Expand Up @@ -211,7 +234,7 @@ if(CMAKE_BUILD_TYPE STREQUAL "Debug")
target_compile_definitions(${PROJECT} PRIVATE "MZ_DEBUG")
endif()

if(NOT IOS)
if(NOT IOS AND NOT MACOS_NE)
set(SOURCES ${SOURCES}
${CMAKE_CURRENT_LIST_DIR}/platforms/ios/QRCodeReaderBase.cpp
)
Expand Down Expand Up @@ -312,17 +335,17 @@ if(APPLE)
set(CMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM ${BUILD_VPN_DEVELOPMENT_TEAM})
set(CMAKE_XCODE_ATTRIBUTE_GROUP_ID_IOS ${BUILD_IOS_GROUP_IDENTIFIER})

set(MACOSX_DEPLOYMENT_TARGET "12.0")
endif()

if(LINUX AND NOT ANDROID)
set(LIBS ${LIBS} -static-libstdc++ -static-libgcc -ldl)
link_directories(${CMAKE_CURRENT_LIST_DIR}/platforms/linux)
endif()

if(WIN32 OR (APPLE AND NOT IOS) OR (LINUX AND NOT ANDROID))
message("Client desktop build")
# Macos Network Extension doesn't need
if(WIN32 OR (APPLE AND NOT IOS AND NOT MACOS_NE) OR (LINUX AND NOT ANDROID))
add_compile_definitions(AMNEZIA_DESKTOP)

set(HEADERS ${HEADERS}
${CMAKE_CURRENT_LIST_DIR}/core/ipcclient.h
${CMAKE_CURRENT_LIST_DIR}/core/privileged_process.h
Expand Down Expand Up @@ -355,9 +378,12 @@ endif()
if(IOS)
include(cmake/ios.cmake)
include(cmake/ios-arch-fixup.cmake)
elseif(APPLE AND NOT IOS)
include(cmake/osxtools.cmake)
elseif(APPLE AND NOT IOS AND NOT DEFINED MACOS_NE)
# include(cmake/osxtools.cmake)
include(cmake/macos.cmake)
elseif(APPLE AND NOT IOS AND MACOS_NE)
include(cmake/osxtools.cmake)
include(cmake/macos_ne.cmake)
endif()

target_link_libraries(${PROJECT} PRIVATE ${LIBS})
Expand All @@ -376,7 +402,7 @@ elseif(APPLE AND NOT IOS)
set(DEPLOY_PLATFORM_PATH "macos")
endif()

if(NOT IOS AND NOT ANDROID)
if(NOT IOS AND NOT ANDROID AND NOT MACOS_NE)
add_custom_command(
TARGET ${PROJECT} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E $<IF:$<CONFIG:Debug>,copy_directory,true>
Expand All @@ -395,4 +421,45 @@ if(NOT IOS AND NOT ANDROID)
endif()

target_sources(${PROJECT} PRIVATE ${SOURCES} ${HEADERS} ${RESOURCES} ${QRC} ${I18NQRC})
if(MACOS_NE)
message("Copy MacOS Network Extension files")
# if(CMAKE_BUILD_TYPE STREQUAL "Release")
# add_custom_command(TARGET ${PROJECT} POST_BUILD
# COMMAND codesign --force --sign 'Apple Distribution: Privacy Technologies OU (X7UJ388FXK)' --timestamp --options runtime
# ${CMAKE_SOURCE_DIR}/client/3rd/OpenVPNAdapter/build/Release-macos/OpenVPNAdapter.framework
# )
# endif()

add_custom_command(TARGET ${PROJECT} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory
$<TARGET_BUNDLE_DIR:AmneziaVPN>/Contents/Frameworks
# COMMAND ${CMAKE_COMMAND} -E copy_directory
# $ENV{QT_MACOS_ROOT_DIR}/lib/QtConcurrent.framework
# $<TARGET_BUNDLE_DIR:AmneziaVPN>/Contents/Frameworks/QtConcurrent.framework

COMMAND ${CMAKE_COMMAND} -E echo "Copying OpenVPNAdapter.framework..."
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_SOURCE_DIR}/client/3rd/OpenVPNAdapter/build/Release-macos/OpenVPNAdapter.framework/Versions/A
$<TARGET_BUNDLE_DIR:AmneziaVPN>/Contents/Frameworks/OpenVPNAdapter.framework/Versions/A

COMMAND ${CMAKE_COMMAND} -E echo "OpenVPNAdapter.framework copied successfully."
)

# MacOS specific application deployment
add_custom_command(TARGET ${PROJECT} POST_BUILD
COMMAND ${QT_BIN_DIR_DETECTED}/macdeployqt $<TARGET_BUNDLE_DIR:AmneziaVPN> -appstore-compliant -qmldir=${CMAKE_CURRENT_SOURCE_DIR}
)

# MacOS specific code signing for Release
if(CMAKE_BUILD_TYPE STREQUAL "Release")
SET(SIGN_CMD codesign --deep --force --sign 'Apple Distribution: Privacy Technologies OU \(X7UJ388FXK\)' --timestamp --options runtime $<TARGET_BUNDLE_DIR:AmneziaVPN>)
message("Manual signing bundle...")
message(${SIGN_CMD})

add_custom_command(TARGET ${PROJECT} POST_BUILD
COMMAND ${SIGN_CMD}
)
endif()
endif()

qt_finalize_target(${PROJECT})
6 changes: 3 additions & 3 deletions client/amnezia_application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

#include "protocols/qml_register_protocols.h"

#if defined(Q_OS_IOS)
#if defined(Q_OS_IOS) || defined(MACOS_NE)
#include "platforms/ios/ios_controller.h"
#include <AmneziaVPN-Swift.h>
#endif
Expand Down Expand Up @@ -121,7 +121,7 @@ void AmneziaApplication::init()
m_engine->addImageProvider(QLatin1String("installedAppImage"), new InstalledAppsImageProvider);
#endif

#ifdef Q_OS_IOS
#if defined(Q_OS_IOS) || defined(MACOS_NE)
IosController::Instance()->initialize();
connect(IosController::Instance(), &IosController::importConfigFromOutside, this, [this](QString data) {
emit m_pageController->goToPageHome();
Expand Down Expand Up @@ -281,7 +281,7 @@ bool AmneziaApplication::parseCommands()
return true;
}

#if !defined(Q_OS_ANDROID) && !defined(Q_OS_IOS)
#if !defined(Q_OS_ANDROID) && !defined(Q_OS_IOS) && !defined(MACOS_NE)
void AmneziaApplication::startLocalServer() {
const QString serverName("AmneziaVPNInstance");
QLocalServer::removeServer(serverName);
Expand Down
Loading
Loading