Formatting applied
This commit is contained in:
parent
c88150e059
commit
7035abd1fe
8 changed files with 14 additions and 99 deletions
|
|
@ -413,19 +413,9 @@ endif()
|
||||||
target_sources(${PROJECT} PRIVATE ${SOURCES} ${HEADERS} ${RESOURCES} ${QRC} ${I18NQRC})
|
target_sources(${PROJECT} PRIVATE ${SOURCES} ${HEADERS} ${RESOURCES} ${QRC} ${I18NQRC})
|
||||||
if(MACOS_NE)
|
if(MACOS_NE)
|
||||||
message("Copy MacOS Network Extension files")
|
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
|
add_custom_command(TARGET ${PROJECT} POST_BUILD
|
||||||
COMMAND ${CMAKE_COMMAND} -E make_directory
|
COMMAND ${CMAKE_COMMAND} -E make_directory
|
||||||
$<TARGET_BUNDLE_DIR:AmneziaVPN>/Contents/Frameworks
|
$<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 echo "Copying OpenVPNAdapter.framework..."
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||||
|
|
|
||||||
|
|
@ -270,30 +270,6 @@ bool AmneziaApplication::parseCommands()
|
||||||
QCommandLineOption c_cleanup { { "c", "cleanup" }, "Cleanup logs" };
|
QCommandLineOption c_cleanup { { "c", "cleanup" }, "Cleanup logs" };
|
||||||
m_parser.addOption(c_cleanup);
|
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);
|
m_parser.process(*this);
|
||||||
|
|
||||||
if (m_parser.isSet(c_cleanup)) {
|
if (m_parser.isSet(c_cleanup)) {
|
||||||
|
|
|
||||||
|
|
@ -67,6 +67,7 @@ QString SshConfigurator::convertOpenSShKey(const QString &key)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// DEAD CODE.
|
||||||
void SshConfigurator::openSshTerminal(const ServerCredentials &credentials)
|
void SshConfigurator::openSshTerminal(const ServerCredentials &credentials)
|
||||||
{
|
{
|
||||||
#if !defined(Q_OS_IOS) && !defined(MACOS_NE)
|
#if !defined(Q_OS_IOS) && !defined(MACOS_NE)
|
||||||
|
|
@ -101,10 +102,8 @@ QProcessEnvironment SshConfigurator::prepareEnv()
|
||||||
pathEnvVar.clear();
|
pathEnvVar.clear();
|
||||||
pathEnvVar.prepend(QDir::toNativeSeparators(QApplication::applicationDirPath()) + "\\cygwin;");
|
pathEnvVar.prepend(QDir::toNativeSeparators(QApplication::applicationDirPath()) + "\\cygwin;");
|
||||||
pathEnvVar.prepend(QDir::toNativeSeparators(QApplication::applicationDirPath()) + "\\openvpn;");
|
pathEnvVar.prepend(QDir::toNativeSeparators(QApplication::applicationDirPath()) + "\\openvpn;");
|
||||||
#elif defined(Q_OS_MAC)
|
#elif defined(Q_OS_MAC) !defined(MACOS_NE)
|
||||||
#if !defined(MACOS_NE)
|
|
||||||
pathEnvVar.prepend(QDir::toNativeSeparators(QApplication::applicationDirPath()) + "/Contents/MacOS");
|
pathEnvVar.prepend(QDir::toNativeSeparators(QApplication::applicationDirPath()) + "/Contents/MacOS");
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
env.insert("PATH", pathEnvVar);
|
env.insert("PATH", pathEnvVar);
|
||||||
|
|
|
||||||
|
|
@ -3,56 +3,34 @@
|
||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
<dict>
|
<dict>
|
||||||
<key>com.apple.application-identifier</key>
|
<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>
|
<key>com.apple.developer.networking.networkextension</key>
|
||||||
<array>
|
<array>
|
||||||
<string>packet-tunnel-provider</string>
|
<string>packet-tunnel-provider</string>
|
||||||
</array>
|
</array>
|
||||||
<key>com.apple.developer.team-identifier</key>
|
<key>com.apple.developer.team-identifier</key>
|
||||||
<string>X7UJ388FXK</string>
|
<string>$(AppIdentifierPrefix)</string>
|
||||||
<key>com.apple.security.app-sandbox</key>
|
<key>com.apple.security.app-sandbox</key>
|
||||||
<true/>
|
<true/>
|
||||||
<key>com.apple.security.application-groups</key>
|
<key>com.apple.security.application-groups</key>
|
||||||
<array>
|
<array>
|
||||||
<string>group.org.amnezia.AmneziaVPN</string>
|
<string>group.org.amnezia.AmneziaVPN</string>
|
||||||
</array>
|
</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>
|
<key>com.apple.security.device.camera</key>
|
||||||
<true/>
|
<true/>
|
||||||
<key>com.apple.security.device.usb</key>
|
|
||||||
<true/>
|
|
||||||
<key>com.apple.security.files.downloads.read-write</key>
|
<key>com.apple.security.files.downloads.read-write</key>
|
||||||
<true/>
|
<true/>
|
||||||
<key>com.apple.security.files.user-selected.read-write</key>
|
<key>com.apple.security.files.user-selected.read-write</key>
|
||||||
<true/>
|
<true/>
|
||||||
<key>com.apple.security.network.client</key>
|
<key>com.apple.security.network.client</key>
|
||||||
<true/>
|
<true/>
|
||||||
<key>com.apple.security.network.server</key>
|
<key>com.apple.developer.networking.networkextension</key>
|
||||||
<true/>
|
<array>
|
||||||
<!-- <key>com.apple.security.networkextension</key>
|
<string>packet-tunnel-provider</string>
|
||||||
<true/> -->
|
</array>
|
||||||
<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>keychain-access-groups</key>
|
<key>keychain-access-groups</key>
|
||||||
<array>
|
<array>
|
||||||
<string>$(AppIdentifierPrefix)org.amnezia.AmneziaVPN.network-extension</string>
|
<string>$(AppIdentifierPrefix)org.amnezia.AmneziaVPN.network-extension</string>
|
||||||
</array>
|
</array>
|
||||||
<!-- <key>com.apple.security.network.extension</key>
|
|
||||||
<true/> -->
|
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|
|
||||||
|
|
@ -118,7 +118,7 @@ extension PacketTunnelProvider {
|
||||||
if let lastHandshakeValue = lastHandshakeString, let handshakeValue = Int64(lastHandshakeValue) {
|
if let lastHandshakeValue = lastHandshakeString, let handshakeValue = Int64(lastHandshakeValue) {
|
||||||
lastHandshake = handshakeValue
|
lastHandshake = handshakeValue
|
||||||
} else {
|
} else {
|
||||||
lastHandshake = -2 // Trả về lỗi 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] = [
|
let response: [String: Any] = [
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
#if !MACOS_NE
|
|
||||||
#include "QRCodeReaderBase.h"
|
#include "QRCodeReaderBase.h"
|
||||||
|
|
||||||
#import <UIKit/UIKit.h>
|
#import <UIKit/UIKit.h>
|
||||||
|
|
@ -109,19 +108,3 @@ void QRCodeReader::startReading() {
|
||||||
void QRCodeReader::stopReading() {
|
void QRCodeReader::stopReading() {
|
||||||
[m_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
|
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,3 @@
|
||||||
#if MACOS_NE
|
|
||||||
public func toggleScreenshots(_ isEnabled: Bool) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
class ScreenProtection {
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
import UIKit
|
import UIKit
|
||||||
|
|
||||||
public func toggleScreenshots(_ isEnabled: Bool) {
|
public func toggleScreenshots(_ isEnabled: Bool) {
|
||||||
|
|
@ -95,4 +85,3 @@ struct ProtectionPair {
|
||||||
textField.removeFromSuperview()
|
textField.removeFromSuperview()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue