mirror of
https://github.com/yggdrasil-network/yggdrasil-ios.git
synced 2025-04-28 06:05:09 +03:00
Various updates
This commit is contained in:
parent
1b9e84d056
commit
2eabf7f5ee
5 changed files with 53 additions and 50 deletions
|
@ -15,6 +15,7 @@ import Yggdrasil
|
||||||
import NetworkExtension
|
import NetworkExtension
|
||||||
import Foundation
|
import Foundation
|
||||||
import CoreData
|
import CoreData
|
||||||
|
import Combine
|
||||||
|
|
||||||
#if os(iOS)
|
#if os(iOS)
|
||||||
class PlatformItemSource: NSObject, UIActivityItemSource {
|
class PlatformItemSource: NSObject, UIActivityItemSource {
|
||||||
|
@ -34,12 +35,12 @@ class ConfigurationProxy: PlatformItemSource {
|
||||||
private var manager: NETunnelProviderManager?
|
private var manager: NETunnelProviderManager?
|
||||||
private var json: Data? = nil {
|
private var json: Data? = nil {
|
||||||
didSet {
|
didSet {
|
||||||
summary = MobileSummaryFromConfig(json)
|
//summary = MobileSummaryFromConfig(json)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private var dict: [String: Any]? = [:]
|
private var dict: [String: Any]? = [:]
|
||||||
private var timer: Timer?
|
private var timer: Timer?
|
||||||
public var summary: MobileParsedConfig?
|
//public var summary: MobileParsedConfig?
|
||||||
|
|
||||||
init(manager: NETunnelProviderManager) {
|
init(manager: NETunnelProviderManager) {
|
||||||
self.manager = manager
|
self.manager = manager
|
||||||
|
|
|
@ -74,7 +74,7 @@
|
||||||
39BF9FC12A2E9E51000E7269 /* YggdrasilNetworkExtension-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "YggdrasilNetworkExtension-Bridging-Header.h"; sourceTree = "<group>"; };
|
39BF9FC12A2E9E51000E7269 /* YggdrasilNetworkExtension-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "YggdrasilNetworkExtension-Bridging-Header.h"; sourceTree = "<group>"; };
|
||||||
39CC924B221DEDCE004960DC /* IPCResponses.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IPCResponses.swift; sourceTree = "<group>"; };
|
39CC924B221DEDCE004960DC /* IPCResponses.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IPCResponses.swift; sourceTree = "<group>"; };
|
||||||
39DB9BEC2BCF28FA009BF2A4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
|
39DB9BEC2BCF28FA009BF2A4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
|
||||||
39F0205B2996CD760093F603 /* YggdrasilSwiftUI.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = YggdrasilSwiftUI.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
39F0205B2996CD760093F603 /* Yggdrasil.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Yggdrasil.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
39F0205D2996CD760093F603 /* Application.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Application.swift; sourceTree = "<group>"; };
|
39F0205D2996CD760093F603 /* Application.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Application.swift; sourceTree = "<group>"; };
|
||||||
39F0205F2996CD760093F603 /* StatusView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StatusView.swift; sourceTree = "<group>"; };
|
39F0205F2996CD760093F603 /* StatusView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StatusView.swift; sourceTree = "<group>"; };
|
||||||
39F020612996CD770093F603 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
39F020612996CD770093F603 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||||
|
@ -165,7 +165,7 @@
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
E593CE971DF905AF00D7265D /* YggdrasilNetworkExtension.appex */,
|
E593CE971DF905AF00D7265D /* YggdrasilNetworkExtension.appex */,
|
||||||
39F0205B2996CD760093F603 /* YggdrasilSwiftUI.app */,
|
39F0205B2996CD760093F603 /* Yggdrasil.app */,
|
||||||
);
|
);
|
||||||
name = Products;
|
name = Products;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
|
@ -187,9 +187,9 @@
|
||||||
/* End PBXGroup section */
|
/* End PBXGroup section */
|
||||||
|
|
||||||
/* Begin PBXNativeTarget section */
|
/* Begin PBXNativeTarget section */
|
||||||
39F0205A2996CD760093F603 /* YggdrasilSwiftUI */ = {
|
39F0205A2996CD760093F603 /* Yggdrasil */ = {
|
||||||
isa = PBXNativeTarget;
|
isa = PBXNativeTarget;
|
||||||
buildConfigurationList = 39F020672996CD770093F603 /* Build configuration list for PBXNativeTarget "YggdrasilSwiftUI" */;
|
buildConfigurationList = 39F020672996CD770093F603 /* Build configuration list for PBXNativeTarget "Yggdrasil" */;
|
||||||
buildPhases = (
|
buildPhases = (
|
||||||
39F020572996CD760093F603 /* Sources */,
|
39F020572996CD760093F603 /* Sources */,
|
||||||
39F020582996CD760093F603 /* Frameworks */,
|
39F020582996CD760093F603 /* Frameworks */,
|
||||||
|
@ -201,9 +201,9 @@
|
||||||
dependencies = (
|
dependencies = (
|
||||||
39F99B362A48F70F0045BD10 /* PBXTargetDependency */,
|
39F99B362A48F70F0045BD10 /* PBXTargetDependency */,
|
||||||
);
|
);
|
||||||
name = YggdrasilSwiftUI;
|
name = Yggdrasil;
|
||||||
productName = YggdrasilSwiftUI;
|
productName = YggdrasilSwiftUI;
|
||||||
productReference = 39F0205B2996CD760093F603 /* YggdrasilSwiftUI.app */;
|
productReference = 39F0205B2996CD760093F603 /* Yggdrasil.app */;
|
||||||
productType = "com.apple.product-type.application";
|
productType = "com.apple.product-type.application";
|
||||||
};
|
};
|
||||||
E593CE961DF905AF00D7265D /* YggdrasilNetworkExtension */ = {
|
E593CE961DF905AF00D7265D /* YggdrasilNetworkExtension */ = {
|
||||||
|
@ -269,7 +269,7 @@
|
||||||
projectRoot = "";
|
projectRoot = "";
|
||||||
targets = (
|
targets = (
|
||||||
E593CE961DF905AF00D7265D /* YggdrasilNetworkExtension */,
|
E593CE961DF905AF00D7265D /* YggdrasilNetworkExtension */,
|
||||||
39F0205A2996CD760093F603 /* YggdrasilSwiftUI */,
|
39F0205A2996CD760093F603 /* Yggdrasil */,
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
/* End PBXProject section */
|
/* End PBXProject section */
|
||||||
|
@ -342,7 +342,7 @@
|
||||||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||||
CODE_SIGN_ENTITLEMENTS = YggdrasilSwiftUI/YggdrasilSwiftUI.entitlements;
|
CODE_SIGN_ENTITLEMENTS = YggdrasilSwiftUI/YggdrasilSwiftUI.entitlements;
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
CURRENT_PROJECT_VERSION = 1;
|
CURRENT_PROJECT_VERSION = 42;
|
||||||
DEAD_CODE_STRIPPING = YES;
|
DEAD_CODE_STRIPPING = YES;
|
||||||
DEVELOPMENT_ASSET_PATHS = "\"YggdrasilSwiftUI/Preview Content\"";
|
DEVELOPMENT_ASSET_PATHS = "\"YggdrasilSwiftUI/Preview Content\"";
|
||||||
DEVELOPMENT_TEAM = R9AV23TXF2;
|
DEVELOPMENT_TEAM = R9AV23TXF2;
|
||||||
|
@ -396,7 +396,7 @@
|
||||||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||||
CODE_SIGN_ENTITLEMENTS = YggdrasilSwiftUI/YggdrasilSwiftUI.entitlements;
|
CODE_SIGN_ENTITLEMENTS = YggdrasilSwiftUI/YggdrasilSwiftUI.entitlements;
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
CURRENT_PROJECT_VERSION = 1;
|
CURRENT_PROJECT_VERSION = 42;
|
||||||
DEAD_CODE_STRIPPING = YES;
|
DEAD_CODE_STRIPPING = YES;
|
||||||
DEVELOPMENT_ASSET_PATHS = "\"YggdrasilSwiftUI/Preview Content\"";
|
DEVELOPMENT_ASSET_PATHS = "\"YggdrasilSwiftUI/Preview Content\"";
|
||||||
DEVELOPMENT_TEAM = R9AV23TXF2;
|
DEVELOPMENT_TEAM = R9AV23TXF2;
|
||||||
|
@ -643,7 +643,7 @@
|
||||||
/* End XCBuildConfiguration section */
|
/* End XCBuildConfiguration section */
|
||||||
|
|
||||||
/* Begin XCConfigurationList section */
|
/* Begin XCConfigurationList section */
|
||||||
39F020672996CD770093F603 /* Build configuration list for PBXNativeTarget "YggdrasilSwiftUI" */ = {
|
39F020672996CD770093F603 /* Build configuration list for PBXNativeTarget "Yggdrasil" */ = {
|
||||||
isa = XCConfigurationList;
|
isa = XCConfigurationList;
|
||||||
buildConfigurations = (
|
buildConfigurations = (
|
||||||
39F020682996CD770093F603 /* Debug */,
|
39F020682996CD770093F603 /* Debug */,
|
||||||
|
|
|
@ -16,8 +16,8 @@
|
||||||
<BuildableReference
|
<BuildableReference
|
||||||
BuildableIdentifier = "primary"
|
BuildableIdentifier = "primary"
|
||||||
BlueprintIdentifier = "39F0205A2996CD760093F603"
|
BlueprintIdentifier = "39F0205A2996CD760093F603"
|
||||||
BuildableName = "YggdrasilSwiftUI.app"
|
BuildableName = "Yggdrasil.app"
|
||||||
BlueprintName = "YggdrasilSwiftUI"
|
BlueprintName = "Yggdrasil"
|
||||||
ReferencedContainer = "container:Yggdrasil Network.xcodeproj">
|
ReferencedContainer = "container:Yggdrasil Network.xcodeproj">
|
||||||
</BuildableReference>
|
</BuildableReference>
|
||||||
</BuildActionEntry>
|
</BuildActionEntry>
|
||||||
|
@ -45,8 +45,8 @@
|
||||||
<BuildableReference
|
<BuildableReference
|
||||||
BuildableIdentifier = "primary"
|
BuildableIdentifier = "primary"
|
||||||
BlueprintIdentifier = "39F0205A2996CD760093F603"
|
BlueprintIdentifier = "39F0205A2996CD760093F603"
|
||||||
BuildableName = "YggdrasilSwiftUI.app"
|
BuildableName = "Yggdrasil.app"
|
||||||
BlueprintName = "YggdrasilSwiftUI"
|
BlueprintName = "Yggdrasil"
|
||||||
ReferencedContainer = "container:Yggdrasil Network.xcodeproj">
|
ReferencedContainer = "container:Yggdrasil Network.xcodeproj">
|
||||||
</BuildableReference>
|
</BuildableReference>
|
||||||
</BuildableProductRunnable>
|
</BuildableProductRunnable>
|
||||||
|
@ -62,8 +62,8 @@
|
||||||
<BuildableReference
|
<BuildableReference
|
||||||
BuildableIdentifier = "primary"
|
BuildableIdentifier = "primary"
|
||||||
BlueprintIdentifier = "39F0205A2996CD760093F603"
|
BlueprintIdentifier = "39F0205A2996CD760093F603"
|
||||||
BuildableName = "YggdrasilSwiftUI.app"
|
BuildableName = "Yggdrasil.app"
|
||||||
BlueprintName = "YggdrasilSwiftUI"
|
BlueprintName = "Yggdrasil"
|
||||||
ReferencedContainer = "container:Yggdrasil Network.xcodeproj">
|
ReferencedContainer = "container:Yggdrasil Network.xcodeproj">
|
||||||
</BuildableReference>
|
</BuildableReference>
|
||||||
</BuildableProductRunnable>
|
</BuildableProductRunnable>
|
||||||
|
|
|
@ -4,37 +4,6 @@
|
||||||
<dict>
|
<dict>
|
||||||
<key>AvailableLibraries</key>
|
<key>AvailableLibraries</key>
|
||||||
<array>
|
<array>
|
||||||
<dict>
|
|
||||||
<key>BinaryPath</key>
|
|
||||||
<string>Yggdrasil.framework/Versions/A/Yggdrasil</string>
|
|
||||||
<key>LibraryIdentifier</key>
|
|
||||||
<string>ios-arm64</string>
|
|
||||||
<key>LibraryPath</key>
|
|
||||||
<string>Yggdrasil.framework</string>
|
|
||||||
<key>SupportedArchitectures</key>
|
|
||||||
<array>
|
|
||||||
<string>arm64</string>
|
|
||||||
</array>
|
|
||||||
<key>SupportedPlatform</key>
|
|
||||||
<string>ios</string>
|
|
||||||
</dict>
|
|
||||||
<dict>
|
|
||||||
<key>BinaryPath</key>
|
|
||||||
<string>Yggdrasil.framework/Versions/A/Yggdrasil</string>
|
|
||||||
<key>LibraryIdentifier</key>
|
|
||||||
<string>ios-arm64_x86_64-simulator</string>
|
|
||||||
<key>LibraryPath</key>
|
|
||||||
<string>Yggdrasil.framework</string>
|
|
||||||
<key>SupportedArchitectures</key>
|
|
||||||
<array>
|
|
||||||
<string>arm64</string>
|
|
||||||
<string>x86_64</string>
|
|
||||||
</array>
|
|
||||||
<key>SupportedPlatform</key>
|
|
||||||
<string>ios</string>
|
|
||||||
<key>SupportedPlatformVariant</key>
|
|
||||||
<string>simulator</string>
|
|
||||||
</dict>
|
|
||||||
<dict>
|
<dict>
|
||||||
<key>BinaryPath</key>
|
<key>BinaryPath</key>
|
||||||
<string>Yggdrasil.framework/Versions/A/Yggdrasil</string>
|
<string>Yggdrasil.framework/Versions/A/Yggdrasil</string>
|
||||||
|
@ -50,6 +19,20 @@
|
||||||
<key>SupportedPlatform</key>
|
<key>SupportedPlatform</key>
|
||||||
<string>macos</string>
|
<string>macos</string>
|
||||||
</dict>
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>BinaryPath</key>
|
||||||
|
<string>Yggdrasil.framework/Versions/A/Yggdrasil</string>
|
||||||
|
<key>LibraryIdentifier</key>
|
||||||
|
<string>ios-arm64</string>
|
||||||
|
<key>LibraryPath</key>
|
||||||
|
<string>Yggdrasil.framework</string>
|
||||||
|
<key>SupportedArchitectures</key>
|
||||||
|
<array>
|
||||||
|
<string>arm64</string>
|
||||||
|
</array>
|
||||||
|
<key>SupportedPlatform</key>
|
||||||
|
<string>ios</string>
|
||||||
|
</dict>
|
||||||
</array>
|
</array>
|
||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>XFWK</string>
|
<string>XFWK</string>
|
||||||
|
|
|
@ -13,6 +13,9 @@ struct PeersView: View {
|
||||||
@Environment(\.editMode) var editMode
|
@Environment(\.editMode) var editMode
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@State private var isAddingPeer = false
|
||||||
|
@State private var addPeerURI = ""
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
Form {
|
Form {
|
||||||
Section(content: {
|
Section(content: {
|
||||||
|
@ -97,7 +100,16 @@ struct PeersView: View {
|
||||||
.toolbar {
|
.toolbar {
|
||||||
if editMode!.wrappedValue.isEditing {
|
if editMode!.wrappedValue.isEditing {
|
||||||
Button("Add", systemImage: "plus") {
|
Button("Add", systemImage: "plus") {
|
||||||
appDelegate.yggdrasilConfig.peers.append("")
|
//appDelegate.yggdrasilConfig.peers.append("")
|
||||||
|
addPeerURI = ""
|
||||||
|
isAddingPeer.toggle()
|
||||||
|
}.alert("Add new peer", isPresented: $isAddingPeer) {
|
||||||
|
TextField("tls://host:port", text: $addPeerURI)
|
||||||
|
.textInputAutocapitalization(.never)
|
||||||
|
Button("Add", action: addPeer)
|
||||||
|
Button("Cancel", role: .cancel) { }
|
||||||
|
} message: {
|
||||||
|
Text("Specify the peer URI to add.")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
EditButton()
|
EditButton()
|
||||||
|
@ -110,6 +122,13 @@ struct PeersView: View {
|
||||||
.navigationBarTitleDisplayMode(.large)
|
.navigationBarTitleDisplayMode(.large)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func addPeer() {
|
||||||
|
if addPeerURI != "" {
|
||||||
|
appDelegate.yggdrasilConfig.peers.append(addPeerURI)
|
||||||
|
}
|
||||||
|
addPeerURI = ""
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
struct PeersView_Previews: PreviewProvider {
|
struct PeersView_Previews: PreviewProvider {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue