Formatting applied

This commit is contained in:
Yaroslav Yashin 2025-02-05 16:07:42 +01:00
parent c88150e059
commit 7035abd1fe
8 changed files with 14 additions and 99 deletions

View file

@ -413,19 +413,9 @@ 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

View file

@ -270,30 +270,6 @@ bool AmneziaApplication::parseCommands()
QCommandLineOption c_cleanup { { "c", "cleanup" }, "Cleanup logs" };
m_parser.addOption(c_cleanup);
#if defined(MACOS_NE)
// Handle positional arguments for MacOS NE
QStringList rawArgs = arguments(); // Get the full list of arguments
QStringList positionalArgs;
for (int i = 1; i < rawArgs.size(); ++i) {
if (!rawArgs[i].startsWith("-")) {
positionalArgs << rawArgs[i]; // Collect non-option arguments
}
}
if (!positionalArgs.isEmpty()) {
QString mode = positionalArgs.first();
qInfo() << "Running in mode:" << mode;
if (mode == "DebugMode") {
qInfo() << "Debug Mode activated for MacOS NE";
// Do something specific for DebugMode
} else {
qWarning() << "Unknown mode for MacOS NE:" << mode;
}
}
#endif
m_parser.process(*this);
if (m_parser.isSet(c_cleanup)) {

View file

@ -67,6 +67,7 @@ QString SshConfigurator::convertOpenSShKey(const QString &key)
#endif
}
// DEAD CODE.
void SshConfigurator::openSshTerminal(const ServerCredentials &credentials)
{
#if !defined(Q_OS_IOS) && !defined(MACOS_NE)
@ -101,10 +102,8 @@ QProcessEnvironment SshConfigurator::prepareEnv()
pathEnvVar.clear();
pathEnvVar.prepend(QDir::toNativeSeparators(QApplication::applicationDirPath()) + "\\cygwin;");
pathEnvVar.prepend(QDir::toNativeSeparators(QApplication::applicationDirPath()) + "\\openvpn;");
#elif defined(Q_OS_MAC)
#if !defined(MACOS_NE)
#elif defined(Q_OS_MAC) !defined(MACOS_NE)
pathEnvVar.prepend(QDir::toNativeSeparators(QApplication::applicationDirPath()) + "/Contents/MacOS");
#endif
#endif
env.insert("PATH", pathEnvVar);

View file

@ -3,56 +3,34 @@
<plist version="1.0">
<dict>
<key>com.apple.application-identifier</key>
<string>X7UJ388FXK.org.amnezia.AmneziaVPN.network-extension</string>
<string>$(AppIdentifierPrefix)org.amnezia.AmneziaVPN.network-extension</string>
<key>com.apple.developer.networking.networkextension</key>
<array>
<string>packet-tunnel-provider</string>
</array>
<key>com.apple.developer.team-identifier</key>
<string>X7UJ388FXK</string>
<string>$(AppIdentifierPrefix)</string>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.application-groups</key>
<array>
<string>group.org.amnezia.AmneziaVPN</string>
</array>
<key>com.apple.security.assets.movies.read-write</key>
<true/>
<key>com.apple.security.assets.music.read-write</key>
<true/>
<key>com.apple.security.assets.pictures.read-write</key>
<true/>
<key>com.apple.security.device.audio-input</key>
<true/>
<key>com.apple.security.device.bluetooth</key>
<true/>
<key>com.apple.security.device.camera</key>
<true/>
<key>com.apple.security.device.usb</key>
<true/>
<key>com.apple.security.files.downloads.read-write</key>
<true/>
<key>com.apple.security.files.user-selected.read-write</key>
<true/>
<key>com.apple.security.network.client</key>
<true/>
<key>com.apple.security.network.server</key>
<true/>
<!-- <key>com.apple.security.networkextension</key>
<true/> -->
<key>com.apple.security.personal-information.addressbook</key>
<true/>
<key>com.apple.security.personal-information.calendars</key>
<true/>
<key>com.apple.security.personal-information.location</key>
<true/>
<key>com.apple.security.print</key>
<true/>
<key>com.apple.developer.networking.networkextension</key>
<array>
<string>packet-tunnel-provider</string>
</array>
<key>keychain-access-groups</key>
<array>
<string>$(AppIdentifierPrefix)org.amnezia.AmneziaVPN.network-extension</string>
</array>
<!-- <key>com.apple.security.network.extension</key>
<true/> -->
</dict>
</plist>

View file

@ -118,7 +118,7 @@ extension PacketTunnelProvider {
if let lastHandshakeValue = lastHandshakeString, let handshakeValue = Int64(lastHandshakeValue) {
lastHandshake = handshakeValue
} else {
lastHandshake = -2 // Tr v li nếu không có giá tr last_handshake_time_sec
lastHandshake = -2 // Return an error if there is no value for `last_handshake_time_sec`
}
let response: [String: Any] = [

View file

@ -1,4 +1,3 @@
#if !MACOS_NE
#include "QRCodeReaderBase.h"
#import <UIKit/UIKit.h>
@ -109,19 +108,3 @@ void QRCodeReader::startReading() {
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

View file

@ -1,13 +1,3 @@
#if MACOS_NE
public func toggleScreenshots(_ isEnabled: Bool) {
}
class ScreenProtection {
}
#else
import UIKit
public func toggleScreenshots(_ isEnabled: Bool) {
@ -95,4 +85,3 @@ struct ProtectionPair {
textField.removeFromSuperview()
}
}
#endif