diff --git a/client/amnezia_application.cpp b/client/amnezia_application.cpp index 9a80777ae..f22d16a20 100644 --- a/client/amnezia_application.cpp +++ b/client/amnezia_application.cpp @@ -121,7 +121,8 @@ void AmneziaApplication::init() m_engine->addImageProvider(QLatin1String("installedAppImage"), new InstalledAppsImageProvider); #endif -#if defined(Q_OS_IOS) || defined(MACOS_NE) +#if defined(Q_OS_IOS) +#if defined(MACOS_NE) IosController::Instance()->initialize(); connect(IosController::Instance(), &IosController::importConfigFromOutside, this, [this](QString data) { emit m_pageController->goToPageHome(); @@ -134,6 +135,7 @@ void AmneziaApplication::init() m_pageController->goToPageSettingsBackup(); emit m_settingsController->importBackupFromOutside(filePath); }); +#endif QTimer::singleShot(0, this, [this]() { AmneziaVPN::toggleScreenshots(m_settings->isScreenshotsEnabled()); }); diff --git a/client/configurators/ssh_configurator.cpp b/client/configurators/ssh_configurator.cpp index ced5287c5..737529767 100644 --- a/client/configurators/ssh_configurator.cpp +++ b/client/configurators/ssh_configurator.cpp @@ -102,7 +102,7 @@ QProcessEnvironment SshConfigurator::prepareEnv() pathEnvVar.clear(); pathEnvVar.prepend(QDir::toNativeSeparators(QApplication::applicationDirPath()) + "\\cygwin;"); pathEnvVar.prepend(QDir::toNativeSeparators(QApplication::applicationDirPath()) + "\\openvpn;"); -#elif defined(Q_OS_MAC) !defined(MACOS_NE) +#elif defined(Q_OS_MAC) && !defined(MACOS_NE) pathEnvVar.prepend(QDir::toNativeSeparators(QApplication::applicationDirPath()) + "/Contents/MacOS"); #endif diff --git a/client/macos/networkextension/AmneziaVPNNetworkExtension.entitlements b/client/macos/networkextension/AmneziaVPNNetworkExtension.entitlements index 91243908e..724cf1bfe 100644 --- a/client/macos/networkextension/AmneziaVPNNetworkExtension.entitlements +++ b/client/macos/networkextension/AmneziaVPNNetworkExtension.entitlements @@ -3,34 +3,56 @@ com.apple.application-identifier - $(AppIdentifierPrefix)org.amnezia.AmneziaVPN.network-extension + X7UJ388FXK.org.amnezia.AmneziaVPN.network-extension com.apple.developer.networking.networkextension packet-tunnel-provider com.apple.developer.team-identifier - $(AppIdentifierPrefix) + X7UJ388FXK com.apple.security.app-sandbox com.apple.security.application-groups group.org.amnezia.AmneziaVPN + com.apple.security.assets.movies.read-write + + com.apple.security.assets.music.read-write + + com.apple.security.assets.pictures.read-write + + com.apple.security.device.audio-input + + com.apple.security.device.bluetooth + com.apple.security.device.camera + com.apple.security.device.usb + com.apple.security.files.downloads.read-write com.apple.security.files.user-selected.read-write com.apple.security.network.client - com.apple.developer.networking.networkextension - - packet-tunnel-provider - + com.apple.security.network.server + + + com.apple.security.personal-information.addressbook + + com.apple.security.personal-information.calendars + + com.apple.security.personal-information.location + + com.apple.security.print + keychain-access-groups $(AppIdentifierPrefix)org.amnezia.AmneziaVPN.network-extension + diff --git a/client/macos/scripts/openvpn.sh b/client/macos/scripts/openvpn.sh deleted file mode 100644 index a2937dd8c..000000000 --- a/client/macos/scripts/openvpn.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash - -XCODEBUILD="/usr/bin/xcodebuild" -WORKINGDIR=`pwd` -PATCH="/usr/bin/patch" - -echo "Building OpenVPNAdapter for macOS Network Extension (MacNE)..." - -# Copy the Project-MacNE.xcconfig settings to amnezia.xcconfig -cat $WORKINGDIR/3rd/OpenVPNAdapter/Configuration/Project-MacNE.xcconfig > $WORKINGDIR/3rd/OpenVPNAdapter/Configuration/amnezia.xcconfig - -# Append macOS-specific build directory configurations to amnezia.xcconfig -cat << EOF >> $WORKINGDIR/3rd/OpenVPNAdapter/Configuration/amnezia.xcconfig -PROJECT_TEMP_DIR = $WORKINGDIR/3rd/OpenVPNAdapter/build/OpenVPNAdapter.build -CONFIGURATION_BUILD_DIR = $WORKINGDIR/3rd/OpenVPNAdapter/build/Release-macos -BUILT_PRODUCTS_DIR = $WORKINGDIR/3rd/OpenVPNAdapter/build/Release-macos -EOF - -# Fetch the current macOS SDK version dynamically -MACOSX_SDK=$(xcrun --sdk macosx --show-sdk-path | sed -E 's/.*MacOSX([0-9]+\.[0-9]+)\.sdk/\1/') - -echo "Using macOS SDK version: $MACOSX_SDK" - -cd 3rd/OpenVPNAdapter - -# Build for macOS using the correct SDK and destination -if $XCODEBUILD -scheme OpenVPNAdapter -configuration Release -xcconfig Configuration/amnezia.xcconfig -sdk macosx$MACOSX_SDK -destination 'generic/platform=macOS' -project OpenVPNAdapter.xcodeproj ; then - echo "OpenVPNAdapter built successfully for macOS Network Extension (MacNE)" -else - echo "OpenVPNAdapter macOS Network Extension (MacNE) build failed..." -fi - -# Remove CodeSignature if needed for macOS -rm -rf ./build/Release-macos/OpenVPNAdapter.framework/Versions/A/_CodeSignature - -cd ../../ diff --git a/client/platforms/ios/QRCodeReaderBase.mm b/client/platforms/ios/QRCodeReaderBase.mm index af879e2f9..963c35a85 100644 --- a/client/platforms/ios/QRCodeReaderBase.mm +++ b/client/platforms/ios/QRCodeReaderBase.mm @@ -1,3 +1,4 @@ +#if !MACOS_NE #include "QRCodeReaderBase.h" #import @@ -108,3 +109,19 @@ - (void)captureOutput:(AVCaptureOutput *)output didOutputMetadataObjects:(NSArra void QRCodeReader::stopReading() { [m_qrCodeReader stopReading]; } +#else +#include "QRCodeReaderBase.h" + +QRCodeReader::QRCodeReader() +{ + +} + +QRect QRCodeReader::cameraSize() { + return QRect(); +} + +void QRCodeReader::startReading() {} +void QRCodeReader::stopReading() {} +void QRCodeReader::setCameraSize(QRect) {} +#endif diff --git a/client/platforms/ios/ScreenProtection.swift b/client/platforms/ios/ScreenProtection.swift index 1355dc13d..a2b5d7a3c 100644 --- a/client/platforms/ios/ScreenProtection.swift +++ b/client/platforms/ios/ScreenProtection.swift @@ -1,3 +1,13 @@ +#if MACOS_NE +public func toggleScreenshots(_ isEnabled: Bool) { + +} + +class ScreenProtection { + + +} +#else import UIKit public func toggleScreenshots(_ isEnabled: Bool) { @@ -85,3 +95,4 @@ struct ProtectionPair { textField.removeFromSuperview() } } +#endif