MacOS NE dirty build
This commit is contained in:
parent
0612f70c06
commit
6f58f19958
43 changed files with 7454 additions and 3976 deletions
|
|
@ -1 +1 @@
|
|||
Subproject commit ff8445c8aa1cda38497bb6f6cb0e520f5a3c8de0
|
||||
Subproject commit eab32a8e63494517fdb5644fbd7235343b937052
|
||||
2
client/3rd/OpenVPNAdapter
vendored
2
client/3rd/OpenVPNAdapter
vendored
|
|
@ -1 +1 @@
|
|||
Subproject commit 7c821a8d5c1ad5ad94e0763b4f25a875b5a6fe1b
|
||||
Subproject commit b7d88501b1bb8bcb7088cdf927f2b401c130d4c7
|
||||
|
|
@ -3,6 +3,7 @@ cmake_minimum_required(VERSION 3.25.0 FATAL_ERROR)
|
|||
set(PROJECT AmneziaVPN)
|
||||
project(${PROJECT})
|
||||
|
||||
set(IOS 1)
|
||||
|
||||
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||
set_property(GLOBAL PROPERTY AUTOGEN_TARGETS_FOLDER "Autogen")
|
||||
|
|
@ -384,4 +385,5 @@ if(NOT IOS AND NOT ANDROID)
|
|||
endif()
|
||||
|
||||
target_sources(${PROJECT} PRIVATE ${SOURCES} ${HEADERS} ${RESOURCES} ${QRC} ${I18NQRC})
|
||||
set(IOS 0)
|
||||
qt_finalize_target(${PROJECT})
|
||||
|
|
|
|||
|
|
@ -217,7 +217,7 @@ void AmneziaApplication::registerTypes()
|
|||
declareQmlProtocolEnum();
|
||||
declareQmlContainerEnum();
|
||||
|
||||
qmlRegisterType<QRCodeReader>("QRCodeReader", 1, 0, "QRCodeReader");
|
||||
// qmlRegisterType<QRCodeReader>("QRCodeReader", 1, 0, "QRCodeReader");
|
||||
|
||||
m_containerProps.reset(new ContainerProps());
|
||||
qmlRegisterSingletonInstance("ContainerProps", 1, 0, "ContainerProps", m_containerProps.get());
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
#ifndef AMNEZIA_APPLICATION_H
|
||||
#define AMNEZIA_APPLICATION_H
|
||||
|
||||
#define Q_OS_IOS 1
|
||||
|
||||
#include <QCommandLineParser>
|
||||
#include <QNetworkAccessManager>
|
||||
#include <QQmlApplicationEngine>
|
||||
|
|
|
|||
|
|
@ -38,12 +38,12 @@ elseif(APPLE AND NOT IOS)
|
|||
set(OPENSSL_LIB_SSL_PATH "${OPENSSL_ROOT_DIR}/macos/lib/libssl.a")
|
||||
set(OPENSSL_LIB_CRYPTO_PATH "${OPENSSL_ROOT_DIR}/macos/lib/libcrypto.a")
|
||||
elseif(IOS)
|
||||
set(LIBSSH_INCLUDE_DIR "${LIBSSH_ROOT_DIR}/ios/arm64")
|
||||
set(LIBSSH_LIB_PATH "${LIBSSH_ROOT_DIR}/ios/arm64/libssh.a")
|
||||
set(ZLIB_LIB_PATH "${LIBSSH_ROOT_DIR}/ios/arm64/libz.a")
|
||||
set(OPENSSL_INCLUDE_DIR "${OPENSSL_ROOT_DIR}/ios/iphone/include")
|
||||
set(OPENSSL_LIB_SSL_PATH "${OPENSSL_ROOT_DIR}/ios/iphone/lib/libssl.a")
|
||||
set(OPENSSL_LIB_CRYPTO_PATH "${OPENSSL_ROOT_DIR}/ios/iphone/lib/libcrypto.a")
|
||||
set(LIBSSH_INCLUDE_DIR "${LIBSSH_ROOT_DIR}/macos/x86_64")
|
||||
set(LIBSSH_LIB_PATH "${LIBSSH_ROOT_DIR}/macos/x86_64/libssh.a")
|
||||
set(ZLIB_LIB_PATH "${LIBSSH_ROOT_DIR}/macos/x86_64/libz.a")
|
||||
set(OPENSSL_INCLUDE_DIR "${OPENSSL_ROOT_DIR}/macos/include")
|
||||
set(OPENSSL_LIB_SSL_PATH "${OPENSSL_ROOT_DIR}/macos/lib/libssl.a")
|
||||
set(OPENSSL_LIB_CRYPTO_PATH "${OPENSSL_ROOT_DIR}/macos/lib/libcrypto.a")
|
||||
elseif(ANDROID)
|
||||
set(abi ${CMAKE_ANDROID_ARCH_ABI})
|
||||
set(LIBSSH_INCLUDE_DIR "${LIBSSH_ROOT_DIR}/android/${abi}")
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ while(IOS_TARGETS)
|
|||
## I just want to say it's amazing this doesn't explode with syntax errors.
|
||||
message("Patching architectures for ${TARGET_NAME}")
|
||||
set_target_properties(${TARGET_NAME} PROPERTIES
|
||||
XCODE_ATTRIBUTE_ARCHS[sdk=iphoneos*] "arm64"
|
||||
XCODE_ATTRIBUTE_ARCHS[sdk=macosx*] "x86_64"
|
||||
XCODE_ATTRIBUTE_ARCHS[sdk=iphonesimulator*] "x86_64"
|
||||
)
|
||||
endwhile()
|
||||
|
|
@ -11,7 +11,7 @@ find_package(Qt6 REQUIRED COMPONENTS ShaderTools)
|
|||
set(LIBS ${LIBS} Qt6::ShaderTools)
|
||||
|
||||
find_library(FW_AUTHENTICATIONSERVICES AuthenticationServices)
|
||||
find_library(FW_UIKIT UIKit)
|
||||
#find_library(FW_UIKIT UIKit)
|
||||
find_library(FW_AVFOUNDATION AVFoundation)
|
||||
find_library(FW_FOUNDATION Foundation)
|
||||
find_library(FW_STOREKIT StoreKit)
|
||||
|
|
@ -20,7 +20,7 @@ find_library(FW_NETWORKEXTENSION NetworkExtension)
|
|||
|
||||
set(LIBS ${LIBS}
|
||||
${FW_AUTHENTICATIONSERVICES}
|
||||
${FW_UIKIT}
|
||||
# ${FW_UIKIT}
|
||||
${FW_AVFOUNDATION}
|
||||
${FW_FOUNDATION}
|
||||
${FW_STOREKIT}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
#include "openvpn_configurator.h"
|
||||
|
||||
#define Q_OS_IOS 1
|
||||
|
||||
#include <QDebug>
|
||||
#include <QJsonDocument>
|
||||
#include <QJsonObject>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
#include "ssh_configurator.h"
|
||||
|
||||
#define Q_OS_IOS 1
|
||||
|
||||
#include <QDebug>
|
||||
#include <QObject>
|
||||
#include <QProcess>
|
||||
|
|
@ -101,8 +103,8 @@ QProcessEnvironment SshConfigurator::prepareEnv()
|
|||
pathEnvVar.clear();
|
||||
pathEnvVar.prepend(QDir::toNativeSeparators(QApplication::applicationDirPath()) + "\\cygwin;");
|
||||
pathEnvVar.prepend(QDir::toNativeSeparators(QApplication::applicationDirPath()) + "\\openvpn;");
|
||||
#elif defined(Q_OS_MACX)
|
||||
pathEnvVar.prepend(QDir::toNativeSeparators(QApplication::applicationDirPath()) + "/Contents/MacOS");
|
||||
//#elif defined(Q_OS_MACX)
|
||||
// pathEnvVar.prepend(QDir::toNativeSeparators(QApplication::applicationDirPath()) + "/Contents/MacOS");
|
||||
#endif
|
||||
|
||||
env.insert("PATH", pathEnvVar);
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
#define Q_OS_IOS 1
|
||||
|
||||
#include "apiController.h"
|
||||
|
||||
#include <QEventLoop>
|
||||
|
|
|
|||
|
|
@ -5,10 +5,12 @@
|
|||
#include <QObject>
|
||||
|
||||
#include "ipc.h"
|
||||
#include "rep_ipc_interface_replica.h"
|
||||
//#include "rep_ipc_interface_replica.h"
|
||||
|
||||
#include "privileged_process.h"
|
||||
|
||||
/*
|
||||
|
||||
class IpcClient : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
|
@ -46,6 +48,6 @@ private:
|
|||
bool m_isSocketConnected {false};
|
||||
|
||||
static IpcClient *m_instance;
|
||||
};
|
||||
}; */
|
||||
|
||||
#endif // IPCCLIENT_H
|
||||
|
|
|
|||
|
|
@ -3,21 +3,21 @@
|
|||
|
||||
#include <QObject>
|
||||
|
||||
#include "rep_ipc_process_interface_replica.h"
|
||||
// #include "rep_ipc_process_interface_replica.h"
|
||||
// This class is dangerous - instance of this class casted from base class,
|
||||
// so it support only functions
|
||||
// Do not add any members into it
|
||||
//
|
||||
class PrivilegedProcess : public IpcProcessInterfaceReplica
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
PrivilegedProcess();
|
||||
~PrivilegedProcess() override;
|
||||
//class PrivilegedProcess : public IpcProcessInterfaceReplica
|
||||
//{
|
||||
// Q_OBJECT
|
||||
//public:
|
||||
// PrivilegedProcess();
|
||||
// ~PrivilegedProcess() override;
|
||||
|
||||
void waitForFinished(int msecs);
|
||||
// void waitForFinished(int msecs);
|
||||
|
||||
};
|
||||
//};
|
||||
|
||||
#endif // PRIVILEGED_PROCESS_H
|
||||
|
||||
|
|
|
|||
|
|
@ -52,9 +52,9 @@ find_library(FW_MOBILE_CORE MobileCoreServices)
|
|||
find_library(FW_UI_KIT UIKit)
|
||||
find_library(FW_LIBRESOLV libresolv.9.tbd)
|
||||
|
||||
target_link_libraries(networkextension PRIVATE ${FW_ASSETS_LIBRARY})
|
||||
target_link_libraries(networkextension PRIVATE ${FW_MOBILE_CORE})
|
||||
target_link_libraries(networkextension PRIVATE ${FW_UI_KIT})
|
||||
#target_link_libraries(networkextension PRIVATE ${FW_ASSETS_LIBRARY})
|
||||
#target_link_libraries(networkextension PRIVATE ${FW_MOBILE_CORE})
|
||||
#target_link_libraries(networkextension PRIVATE ${FW_UI_KIT})
|
||||
target_link_libraries(networkextension PRIVATE ${FW_LIBRESOLV})
|
||||
|
||||
target_compile_options(networkextension PRIVATE -DGROUP_ID=\"${BUILD_IOS_GROUP_IDENTIFIER}\")
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ EOF
|
|||
|
||||
|
||||
cd 3rd/OpenVPNAdapter
|
||||
if $XCODEBUILD -scheme OpenVPNAdapter -configuration Release -xcconfig Configuration/amnezia.xcconfig -sdk iphoneos -destination 'generic/platform=iOS' -project OpenVPNAdapter.xcodeproj ; then
|
||||
if $XCODEBUILD -scheme OpenVPNAdapter -configuration Release -xcconfig Configuration/amnezia.xcconfig -sdk macosx14.2 -destination 'generic/platform=MacOS' -project OpenVPNAdapter.xcodeproj ; then
|
||||
echo "OpenVPNAdapter built successfully"
|
||||
else
|
||||
echo "OpenVPNAdapter build failed"
|
||||
|
|
|
|||
|
|
@ -8,14 +8,6 @@ class QRCodeReader: public QObject {
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QRCodeReader();
|
||||
|
||||
QRect cameraSize();
|
||||
|
||||
public slots:
|
||||
void startReading();
|
||||
void stopReading();
|
||||
void setCameraSize(QRect value);
|
||||
|
||||
signals:
|
||||
void codeReaded(QString code);
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
#include "QRCodeReaderBase.h"
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
//#import <UIKit/UIKit.h>
|
||||
#import <AVFoundation/AVFoundation.h>
|
||||
|
||||
@interface QRCodeReaderImpl : UIViewController
|
||||
@end
|
||||
//@interface QRCodeReaderImpl : UIViewController
|
||||
//@end
|
||||
|
||||
@interface QRCodeReaderImpl () <AVCaptureMetadataOutputObjectsDelegate>
|
||||
/*@interface QRCodeReaderImpl () <AVCaptureMetadataOutputObjectsDelegate>
|
||||
@property (nonatomic) QRCodeReader* qrCodeReader;
|
||||
@property (nonatomic, strong) AVCaptureSession *captureSession;
|
||||
@property (nonatomic, strong) AVCaptureVideoPreviewLayer *videoPreviewPlayer;
|
||||
|
|
@ -15,15 +15,15 @@
|
|||
|
||||
@implementation QRCodeReaderImpl
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
//- (void)viewDidLoad {
|
||||
// [super viewDidLoad];
|
||||
|
||||
_captureSession = nil;
|
||||
}
|
||||
// _captureSession = nil;
|
||||
//}
|
||||
|
||||
- (void)setQrCodeReader: (QRCodeReader*)value {
|
||||
_qrCodeReader = value;
|
||||
}
|
||||
//- (void)setQrCodeReader: (QRCodeReader*)value {
|
||||
// _qrCodeReader = value;
|
||||
//}
|
||||
|
||||
- (BOOL)startReading {
|
||||
NSError *error;
|
||||
|
|
@ -49,7 +49,7 @@
|
|||
|
||||
_videoPreviewPlayer = [[AVCaptureVideoPreviewLayer alloc] initWithSession: _captureSession];
|
||||
|
||||
CGFloat statusBarHeight = [UIApplication sharedApplication].statusBarFrame.size.height;
|
||||
//CGFloat statusBarHeight = [UIApplication sharedApplication].statusBarFrame.size.height;
|
||||
|
||||
QRect cameraRect = _qrCodeReader->cameraSize();
|
||||
CGRect cameraCGRect = CGRectMake(cameraRect.x(),
|
||||
|
|
@ -60,7 +60,7 @@
|
|||
[_videoPreviewPlayer setVideoGravity: AVLayerVideoGravityResizeAspectFill];
|
||||
[_videoPreviewPlayer setFrame: cameraCGRect];
|
||||
|
||||
CALayer* layer = [UIApplication sharedApplication].keyWindow.layer;
|
||||
// CALayer* layer = [UIApplication sharedApplication].keyWindow.layer;
|
||||
[layer addSublayer: _videoPreviewPlayer];
|
||||
|
||||
[_captureSession startRunning];
|
||||
|
|
@ -107,4 +107,4 @@ void QRCodeReader::startReading() {
|
|||
|
||||
void QRCodeReader::stopReading() {
|
||||
[m_qrCodeReader stopReading];
|
||||
}
|
||||
}*/
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#import <UIKit/UIKit.h>
|
||||
//#import <UIKit/UIKit.h>
|
||||
|
||||
@interface QIOSApplicationDelegate
|
||||
@end
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
@implementation QIOSApplicationDelegate (AmneziaVPNDelegate)
|
||||
|
||||
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
|
||||
/*- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
|
||||
{
|
||||
[application setMinimumBackgroundFetchInterval: UIApplicationBackgroundFetchIntervalMinimum];
|
||||
// Override point for customization after application launch.
|
||||
|
|
@ -56,6 +56,6 @@
|
|||
return YES;
|
||||
}
|
||||
return NO;
|
||||
}
|
||||
}*/
|
||||
|
||||
@end
|
||||
|
|
|
|||
|
|
@ -1,87 +1,10 @@
|
|||
import UIKit
|
||||
//import UIKit
|
||||
|
||||
public func toggleScreenshots(_ isEnabled: Bool) {
|
||||
let window = UIApplication.shared.keyWindows.first!
|
||||
|
||||
if isEnabled {
|
||||
ScreenProtection.shared.disable(for: window.rootViewController!.view)
|
||||
} else {
|
||||
ScreenProtection.shared.enable(for: window.rootViewController!.view)
|
||||
}
|
||||
}
|
||||
|
||||
extension UIApplication {
|
||||
var keyWindows: [UIWindow] {
|
||||
connectedScenes
|
||||
.compactMap {
|
||||
if #available(iOS 15.0, *) {
|
||||
($0 as? UIWindowScene)?.keyWindow
|
||||
} else {
|
||||
($0 as? UIWindowScene)?.windows.first { $0.isKeyWindow }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class ScreenProtection {
|
||||
public static let shared = ScreenProtection()
|
||||
|
||||
var pairs = [ProtectionPair]()
|
||||
|
||||
private var blurView: UIVisualEffectView?
|
||||
private var recordingObservation: NSKeyValueObservation?
|
||||
|
||||
public func enable(for view: UIView) {
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) {
|
||||
view.subviews.forEach {
|
||||
self.pairs.append(ProtectionPair(from: $0))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public func disable(for view: UIView) {
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) {
|
||||
self.pairs.forEach {
|
||||
$0.removeProtection()
|
||||
}
|
||||
|
||||
self.pairs.removeAll()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct ProtectionPair {
|
||||
let textField: UITextField
|
||||
let layer: CALayer
|
||||
|
||||
init(from view: UIView) {
|
||||
let secureTextField = UITextField()
|
||||
secureTextField.backgroundColor = .clear
|
||||
secureTextField.translatesAutoresizingMaskIntoConstraints = false
|
||||
secureTextField.isSecureTextEntry = true
|
||||
|
||||
view.insertSubview(secureTextField, at: 0)
|
||||
secureTextField.isUserInteractionEnabled = false
|
||||
|
||||
view.layer.superlayer?.addSublayer(secureTextField.layer)
|
||||
secureTextField.layer.sublayers?.last?.addSublayer(view.layer)
|
||||
|
||||
secureTextField.topAnchor.constraint(equalTo: view.topAnchor, constant: 0).isActive = true
|
||||
secureTextField.bottomAnchor.constraint(equalTo: view.bottomAnchor, constant: 0).isActive = true
|
||||
secureTextField.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 0).isActive = true
|
||||
secureTextField.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: 0).isActive = true
|
||||
|
||||
self.init(textField: secureTextField, layer: view.layer)
|
||||
}
|
||||
|
||||
init(textField: UITextField, layer: CALayer) {
|
||||
self.textField = textField
|
||||
self.layer = layer
|
||||
}
|
||||
|
||||
func removeProtection() {
|
||||
textField.superview?.superview?.layer.addSublayer(layer)
|
||||
textField.layer.removeFromSuperlayer()
|
||||
textField.removeFromSuperview()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,15 +27,15 @@ const char* MessageKey::isOnDemand = "is-on-demand";
|
|||
const char* MessageKey::SplitTunnelType = "SplitTunnelType";
|
||||
const char* MessageKey::SplitTunnelSites = "SplitTunnelSites";
|
||||
|
||||
static UIViewController* getViewController() {
|
||||
NSArray *windows = [[UIApplication sharedApplication]windows];
|
||||
for (UIWindow *window in windows) {
|
||||
if (window.isKeyWindow) {
|
||||
return window.rootViewController;
|
||||
}
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
//static UIViewController* getViewController() {
|
||||
// NSArray *windows = [[UIApplication sharedApplication]windows];
|
||||
// for (UIWindow *window in windows) {
|
||||
// if (window.isKeyWindow) {
|
||||
// return window.rootViewController;
|
||||
// }
|
||||
// }
|
||||
// return nil;
|
||||
//}
|
||||
|
||||
Vpn::ConnectionState iosStatusToState(NEVPNStatus status) {
|
||||
switch (status) {
|
||||
|
|
@ -748,24 +748,24 @@ bool IosController::shareText(const QStringList& filesToSend) {
|
|||
[sharingItems addObject:logFileUrl];
|
||||
}
|
||||
|
||||
UIViewController *qtController = getViewController();
|
||||
if (!qtController) return;
|
||||
// UIViewController *qtController = getViewController();
|
||||
// if (!qtController) return;
|
||||
|
||||
UIActivityViewController *activityController = [[UIActivityViewController alloc] initWithActivityItems:sharingItems applicationActivities:nil];
|
||||
// UIActivityViewController *activityController = [[UIActivityViewController alloc] initWithActivityItems:sharingItems applicationActivities:nil];
|
||||
|
||||
__block bool isAccepted = false;
|
||||
|
||||
[activityController setCompletionWithItemsHandler:^(NSString *activityType, BOOL completed, NSArray *returnedItems, NSError *activityError) {
|
||||
isAccepted = completed;
|
||||
emit finished();
|
||||
}];
|
||||
// [activityController setCompletionWithItemsHandler:^(NSString *activityType, BOOL completed, NSArray *returnedItems, NSError *activityError) {
|
||||
// isAccepted = completed;
|
||||
// emit finished();
|
||||
// }];
|
||||
|
||||
[qtController presentViewController:activityController animated:YES completion:nil];
|
||||
UIPopoverPresentationController *popController = activityController.popoverPresentationController;
|
||||
if (popController) {
|
||||
popController.sourceView = qtController.view;
|
||||
popController.sourceRect = CGRectMake(100, 100, 100, 100);
|
||||
}
|
||||
// [qtController presentViewController:activityController animated:YES completion:nil];
|
||||
// UIPopoverPresentationController *popController = activityController.popoverPresentationController;
|
||||
// if (popController) {
|
||||
// popController.sourceView = qtController.view;
|
||||
// popController.sourceRect = CGRectMake(100, 100, 100, 100);
|
||||
// }
|
||||
|
||||
QEventLoop wait;
|
||||
QObject::connect(this, &IosController::finished, &wait, &QEventLoop::quit);
|
||||
|
|
@ -775,26 +775,26 @@ bool IosController::shareText(const QStringList& filesToSend) {
|
|||
}
|
||||
|
||||
QString IosController::openFile() {
|
||||
UIDocumentPickerViewController *documentPicker = [[UIDocumentPickerViewController alloc] initWithDocumentTypes:@[@"public.item"] inMode:UIDocumentPickerModeOpen];
|
||||
// UIDocumentPickerViewController *documentPicker = [[UIDocumentPickerViewController alloc] initWithDocumentTypes:@[@"public.item"] inMode:UIDocumentPickerModeOpen];
|
||||
|
||||
DocumentPickerDelegate *documentPickerDelegate = [[DocumentPickerDelegate alloc] init];
|
||||
documentPicker.delegate = documentPickerDelegate;
|
||||
// DocumentPickerDelegate *documentPickerDelegate = [[DocumentPickerDelegate alloc] init];
|
||||
// documentPicker.delegate = documentPickerDelegate;
|
||||
|
||||
UIViewController *qtController = getViewController();
|
||||
if (!qtController) return;
|
||||
// UIViewController *qtController = getViewController();
|
||||
// if (!qtController) return;
|
||||
|
||||
[qtController presentViewController:documentPicker animated:YES completion:nil];
|
||||
// [qtController presentViewController:documentPicker animated:YES completion:nil];
|
||||
|
||||
__block QString filePath;
|
||||
|
||||
documentPickerDelegate.documentPickerClosedCallback = ^(NSString *path) {
|
||||
if (path) {
|
||||
filePath = QString::fromUtf8(path.UTF8String);
|
||||
} else {
|
||||
filePath = QString();
|
||||
}
|
||||
emit finished();
|
||||
};
|
||||
// documentPickerDelegate.documentPickerClosedCallback = ^(NSString *path) {
|
||||
// if (path) {
|
||||
// filePath = QString::fromUtf8(path.UTF8String);
|
||||
// } else {
|
||||
// filePath = QString();
|
||||
// }
|
||||
// emit finished();
|
||||
// };
|
||||
|
||||
QEventLoop wait;
|
||||
QObject::connect(this, &IosController::finished, &wait, &QEventLoop::quit);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#import <NetworkExtension/NetworkExtension.h>
|
||||
#import <NetworkExtension/NETunnelProviderSession.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
#include <UIKit/UIKit.h>
|
||||
//#include <UIKit/UIKit.h>
|
||||
#include <Security/Security.h>
|
||||
|
||||
class IosController;
|
||||
|
|
@ -18,8 +18,8 @@ class IosController;
|
|||
|
||||
typedef void (^DocumentPickerClosedCallback)(NSString *path);
|
||||
|
||||
@interface DocumentPickerDelegate : NSObject <UIDocumentPickerDelegate>
|
||||
//@interface DocumentPickerDelegate : NSObject <UIDocumentPickerDelegate>
|
||||
|
||||
@property (nonatomic, copy) DocumentPickerClosedCallback documentPickerClosedCallback;
|
||||
//@property (nonatomic, copy) DocumentPickerClosedCallback documentPickerClosedCallback;
|
||||
|
||||
@end
|
||||
//@end
|
||||
|
|
|
|||
|
|
@ -26,20 +26,20 @@
|
|||
|
||||
@end
|
||||
|
||||
@implementation DocumentPickerDelegate
|
||||
//@implementation DocumentPickerDelegate
|
||||
|
||||
- (void)documentPicker:(UIDocumentPickerViewController *)controller didPickDocumentsAtURLs:(NSArray<NSURL *> *)urls {
|
||||
for (NSURL *url in urls) {
|
||||
if (self.documentPickerClosedCallback) {
|
||||
self.documentPickerClosedCallback([url path]);
|
||||
}
|
||||
}
|
||||
}
|
||||
//- (void)documentPicker:(UIDocumentPickerViewController *)controller didPickDocumentsAtURLs:(NSArray<NSURL *> *)urls {
|
||||
// for (NSURL *url in urls) {
|
||||
// if (self.documentPickerClosedCallback) {
|
||||
// self.documentPickerClosedCallback([url path]);
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
- (void)documentPickerWasCancelled:(UIDocumentPickerViewController *)controller {
|
||||
if (self.documentPickerClosedCallback) {
|
||||
self.documentPickerClosedCallback(nil);
|
||||
}
|
||||
}
|
||||
//- (void)documentPickerWasCancelled:(UIDocumentPickerViewController *)controller {
|
||||
// if (self.documentPickerClosedCallback) {
|
||||
// self.documentPickerClosedCallback(nil);
|
||||
// }
|
||||
//}
|
||||
|
||||
@end
|
||||
//@end
|
||||
|
|
|
|||
|
|
@ -6,8 +6,9 @@
|
|||
|
||||
#import <UserNotifications/UserNotifications.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <UIKit/UIKit.h>
|
||||
//#import <UIKit/UIKit.h>
|
||||
|
||||
/*
|
||||
@interface IOSNotificationDelegate
|
||||
: UIResponder <UIApplicationDelegate, UNUserNotificationCenterDelegate> {
|
||||
IOSNotificationHandler* m_iosNotificationHandler;
|
||||
|
|
@ -86,4 +87,4 @@ void IOSNotificationHandler::notify(NotificationHandler::Message type, const QSt
|
|||
NSLog(@"Local Notification failed");
|
||||
}
|
||||
}];
|
||||
}
|
||||
}*/
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ private:
|
|||
#ifndef Q_OS_IOS
|
||||
QProcess m_ckProcess;
|
||||
#endif
|
||||
QTemporaryFile m_cloakCfgFile;
|
||||
// QTemporaryFile m_cloakCfgFile;
|
||||
QMetaObject::Connection m_errorHandlerConnection;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ private:
|
|||
ManagementServer m_managementServer;
|
||||
QString m_configFileName;
|
||||
QJsonObject m_configData;
|
||||
QTemporaryFile m_configFile;
|
||||
// QTemporaryFile m_configFile;
|
||||
|
||||
uint selectMgmtPort();
|
||||
|
||||
|
|
@ -53,7 +53,7 @@ private:
|
|||
void updateRouteGateway(QString line);
|
||||
void updateVpnGateway(const QString &line);
|
||||
|
||||
QSharedPointer<PrivilegedProcess> m_openVpnProcess;
|
||||
// QSharedPointer<PrivilegedProcess> m_openVpnProcess;
|
||||
};
|
||||
|
||||
#endif // OPENVPNPROTOCOL_H
|
||||
|
|
|
|||
|
|
@ -5,6 +5,8 @@
|
|||
#include "QProcess"
|
||||
#include "containers/containers_defs.h"
|
||||
|
||||
#define Q_OS_IOS 1
|
||||
|
||||
class ShadowSocksVpnProtocol : public OpenVpnProtocol
|
||||
{
|
||||
public:
|
||||
|
|
@ -27,7 +29,7 @@ private:
|
|||
#ifndef Q_OS_IOS
|
||||
QProcess m_ssProcess;
|
||||
#endif
|
||||
QTemporaryFile m_shadowSocksCfgFile;
|
||||
// QTemporaryFile m_shadowSocksCfgFile;
|
||||
};
|
||||
|
||||
#endif // SHADOWSOCKSVPNPROTOCOL_H
|
||||
|
|
|
|||
|
|
@ -1,16 +1,11 @@
|
|||
#include <QDebug>
|
||||
#include <QTimer>
|
||||
|
||||
#define Q_OS_IOS 1
|
||||
|
||||
#include "core/errorstrings.h"
|
||||
#include "vpnprotocol.h"
|
||||
|
||||
#if defined(Q_OS_WINDOWS) || defined(Q_OS_MACX) || (defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID))
|
||||
#include "openvpnovercloakprotocol.h"
|
||||
#include "openvpnprotocol.h"
|
||||
#include "shadowsocksvpnprotocol.h"
|
||||
#include "wireguardprotocol.h"
|
||||
#include "xrayprotocol.h"
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_WINDOWS
|
||||
#include "ikev2_vpn_protocol_windows.h"
|
||||
|
|
@ -108,15 +103,6 @@ VpnProtocol *VpnProtocol::factory(DockerContainer container, const QJsonObject &
|
|||
switch (container) {
|
||||
#if defined(Q_OS_WINDOWS)
|
||||
case DockerContainer::Ipsec: return new Ikev2Protocol(configuration);
|
||||
#endif
|
||||
#if defined(Q_OS_WINDOWS) || defined(Q_OS_MACX) || (defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID))
|
||||
case DockerContainer::OpenVpn: return new OpenVpnProtocol(configuration);
|
||||
case DockerContainer::Cloak: return new OpenVpnOverCloakProtocol(configuration);
|
||||
case DockerContainer::ShadowSocks: return new ShadowSocksVpnProtocol(configuration);
|
||||
case DockerContainer::WireGuard: return new WireguardProtocol(configuration);
|
||||
case DockerContainer::Awg: return new WireguardProtocol(configuration);
|
||||
case DockerContainer::Xray: return new XrayProtocol(configuration);
|
||||
case DockerContainer::SSXray: return new XrayProtocol(configuration);
|
||||
#endif
|
||||
default: return nullptr;
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -1,5 +1,7 @@
|
|||
#include "connectionController.h"
|
||||
|
||||
#define Q_OS_IOS 1
|
||||
|
||||
#if defined(Q_OS_ANDROID) || defined(Q_OS_IOS)
|
||||
#include <QGuiApplication>
|
||||
#else
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@
|
|||
#include "utils/converter.h"
|
||||
#include "core/errorstrings.h"
|
||||
|
||||
#define Q_OS_IOS 1
|
||||
|
||||
#if defined(Q_OS_ANDROID) || defined(Q_OS_IOS)
|
||||
#include <QGuiApplication>
|
||||
#else
|
||||
|
|
@ -37,8 +39,8 @@ PageController::PageController(const QSharedPointer<ServersModel> &serversModel,
|
|||
#endif
|
||||
|
||||
#if defined Q_OS_MACX
|
||||
connect(this, &PageController::raiseMainWindow, []() { setDockIconVisible(true); });
|
||||
connect(this, &PageController::hideMainWindow, []() { setDockIconVisible(false); });
|
||||
// connect(this, &PageController::raiseMainWindow, []() { setDockIconVisible(true); });
|
||||
// connect(this, &PageController::hideMainWindow, []() { setDockIconVisible(false); });
|
||||
#endif
|
||||
|
||||
connect(this, qOverload<ErrorCode>(&PageController::showErrorMessage), this, &PageController::onShowErrorMessage);
|
||||
|
|
@ -134,7 +136,7 @@ void PageController::showOnStartup()
|
|||
#ifdef Q_OS_WIN
|
||||
emit hideMainWindow();
|
||||
#elif defined Q_OS_MACX
|
||||
setDockIconVisible(false);
|
||||
// setDockIconVisible(false);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,8 @@
|
|||
#include <QDebug>
|
||||
#include "notificationhandler.h"
|
||||
|
||||
#define Q_OS_IOS 1
|
||||
|
||||
#if defined(Q_OS_IOS)
|
||||
# include "platforms/ios/iosnotificationhandler.h"
|
||||
#else
|
||||
|
|
@ -14,7 +16,7 @@
|
|||
// static
|
||||
NotificationHandler* NotificationHandler::create(QObject* parent) {
|
||||
#if defined(Q_OS_IOS)
|
||||
return new IOSNotificationHandler(parent);
|
||||
return nullptr;//new IOSNotificationHandler(parent);
|
||||
#else
|
||||
|
||||
# if defined(Q_OS_LINUX)
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ import QtQuick.Layouts
|
|||
import QtQuick.Dialogs
|
||||
|
||||
import PageEnum 1.0
|
||||
import QRCodeReader 1.0
|
||||
|
||||
import "./"
|
||||
import "../Controls2"
|
||||
|
|
@ -63,23 +62,5 @@ PageType {
|
|||
color: "transparent"
|
||||
//radius: 16
|
||||
|
||||
QRCodeReader {
|
||||
id: qrCodeReader
|
||||
|
||||
onCodeReaded: function(code) {
|
||||
ImportController.parseQrCodeChunk(code)
|
||||
progressBar.value = ImportController.getQrCodeScanProgressBarValue()
|
||||
header.progressString = ImportController.getQrCodeScanProgressString()
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
qrCodeReader.setCameraSize(Qt.rect(qrCodeRectange.x,
|
||||
qrCodeRectange.y,
|
||||
qrCodeRectange.width,
|
||||
qrCodeRectange.height))
|
||||
qrCodeReader.startReading()
|
||||
}
|
||||
Component.onDestruction: qrCodeReader.stopReading()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,9 +7,6 @@
|
|||
|
||||
#include "notificationhandler.h"
|
||||
|
||||
#include <QMenu>
|
||||
#include <QSystemTrayIcon>
|
||||
|
||||
class SystemTrayNotificationHandler : public NotificationHandler {
|
||||
Q_OBJECT
|
||||
|
||||
|
|
|
|||
|
|
@ -12,6 +12,8 @@
|
|||
#include <configurators/wireguard_configurator.h>
|
||||
#include "core/controllers/serverController.h"
|
||||
|
||||
#define Q_OS_IOS 1
|
||||
|
||||
#ifdef AMNEZIA_DESKTOP
|
||||
#include "core/ipcclient.h"
|
||||
#include "ipc.h"
|
||||
|
|
|
|||
18
networkextensionDebug.entitlements
Normal file
18
networkextensionDebug.entitlements
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>com.apple.developer.networking.networkextension</key>
|
||||
<array>
|
||||
<string>packet-tunnel-provider</string>
|
||||
</array>
|
||||
<key>com.apple.security.application-groups</key>
|
||||
<array>
|
||||
<string>group.org.amnezia.AmneziaVPN</string>
|
||||
</array>
|
||||
<key>keychain-access-groups</key>
|
||||
<array>
|
||||
<string>$(AppIdentifierPrefix)group.org.amnezia.AmneziaVPN</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
Loading…
Add table
Add a link
Reference in a new issue