Compare commits
No commits in common. "55c0957511e872b1635dc487fad97ce3a57d42d7" and "1378eb7eb389ef8c7c3ebc14ed274f20f49ebf99" have entirely different histories.
55c0957511
...
1378eb7eb3
13 changed files with 10 additions and 320 deletions
BIN
Apple/.DS_Store
vendored
BIN
Apple/.DS_Store
vendored
Binary file not shown.
|
|
@ -2,10 +2,6 @@
|
|||
<!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>$(APP_GROUP_IDENTIFIER)</string>
|
||||
|
|
|
|||
|
|
@ -2,14 +2,9 @@
|
|||
<!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>$(APP_GROUP_IDENTIFIER)</string>
|
||||
<string>group.ThomasStubblefield.Unifriend.onesignal</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
|
|
|
|||
|
|
@ -1,14 +0,0 @@
|
|||
#if os(macOS)
|
||||
import AppKit
|
||||
import FluidMenuBarExtra
|
||||
|
||||
class AppDelegate: NSObject, NSApplicationDelegate {
|
||||
private var menuBarExtra: FluidMenuBarExtra?
|
||||
|
||||
func applicationDidFinishLaunching(_ notification: Notification) {
|
||||
self.menuBarExtra = FluidMenuBarExtra(title: "Burrow", systemImage: "network.badge.shield.half.filled") {
|
||||
ContentView()
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "hackClubLogo.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 22 KiB |
|
|
@ -1,34 +1,10 @@
|
|||
//
|
||||
// burrow_barApp.swift
|
||||
// burrow-bar
|
||||
//
|
||||
// Created by Thomas Stubblefield on 4/19/23.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import NetworkExtension
|
||||
|
||||
@main
|
||||
struct burrowBarApp: App {
|
||||
#if os(macOS)
|
||||
@NSApplicationDelegateAdaptor private var appDelegate: AppDelegate
|
||||
#endif
|
||||
|
||||
struct BurrowApp: App {
|
||||
var body: some Scene {
|
||||
WindowGroup {
|
||||
PermissionView()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct PermissionView: View {
|
||||
@ObservedObject
|
||||
var configuration = NetworkConfiguration()
|
||||
|
||||
|
||||
var body: some View {
|
||||
VStack {
|
||||
Text(verbatim: "Status is \(configuration.status)")
|
||||
ContentView()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,68 +1,14 @@
|
|||
import SwiftUI
|
||||
|
||||
struct ContentView: View {
|
||||
|
||||
@ObservedObject var viewModel = NetworkConfiguration()
|
||||
|
||||
var body: some View {
|
||||
VStack(alignment: .leading) {
|
||||
|
||||
HStack {
|
||||
Text(verbatim: "Networks \(viewModel.model.status)")
|
||||
.font(.title3)
|
||||
Spacer()
|
||||
Image(systemName: "badge.plus.radiowaves.forward")
|
||||
.symbolRenderingMode(.palette)
|
||||
.foregroundStyle(.blue, .black)
|
||||
.opacity(0.4)
|
||||
.imageScale(.large) }
|
||||
Divider()
|
||||
VStack(alignment: .leading) {
|
||||
Text("Burrows")
|
||||
.padding(.top, 2)
|
||||
.font(.subheadline.weight(.bold))
|
||||
HStack {
|
||||
if (viewModel.status == .unknown) {
|
||||
|
||||
|
||||
Image("hackClubLogo")
|
||||
.resizable()
|
||||
.frame(width: 32, height: 32)
|
||||
.cornerRadius(100).onTapGesture {
|
||||
viewModel.connectToBurrow()
|
||||
print(viewModel.status)
|
||||
}
|
||||
|
||||
} else if (viewModel.status == .loading) {
|
||||
ZStack {
|
||||
Image("hackClubLogo")
|
||||
.resizable()
|
||||
.frame(width: 32, height: 32)
|
||||
.cornerRadius(100)
|
||||
.overlay(Color.white.opacity(0.6).cornerRadius(100))
|
||||
|
||||
ProgressView()
|
||||
.progressViewStyle(CircularProgressViewStyle())
|
||||
.scaleEffect(0.6)
|
||||
}
|
||||
}
|
||||
VStack(alignment: .leading) {
|
||||
|
||||
Text("Hack Club Network")
|
||||
.fontWeight(.medium)
|
||||
|
||||
|
||||
Text(" Recently Validated Certificate")
|
||||
.font(.caption2)
|
||||
.foregroundColor(.blue)
|
||||
}.onTapGesture {
|
||||
print(true)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
VStack {
|
||||
Image(systemName: "globe")
|
||||
.imageScale(.large)
|
||||
.foregroundColor(.accentColor)
|
||||
Text("Hello, world!")
|
||||
}
|
||||
.padding()
|
||||
.padding()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,42 +0,0 @@
|
|||
//
|
||||
// MemoryGame.swift
|
||||
// Memorize
|
||||
//
|
||||
// Created by Thomas Stubblefield on 3/12/23.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
struct Model {
|
||||
|
||||
var status: Status = .unknown
|
||||
|
||||
mutating func connectToBurrow() {
|
||||
print("let's get this working")
|
||||
status = .valid
|
||||
print(status)
|
||||
}
|
||||
}
|
||||
|
||||
enum Status: CustomStringConvertible {
|
||||
case unknown
|
||||
case blank
|
||||
case valid
|
||||
case error
|
||||
case loading
|
||||
|
||||
var description: String {
|
||||
switch self {
|
||||
case .unknown:
|
||||
return "Unknown"
|
||||
case .blank:
|
||||
return "Blank"
|
||||
case .valid:
|
||||
return "Valid"
|
||||
case .loading:
|
||||
return "Loading"
|
||||
default:
|
||||
return "Default"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,87 +0,0 @@
|
|||
import SwiftUI
|
||||
import NetworkExtension
|
||||
|
||||
@MainActor
|
||||
class NetworkConfiguration: ObservableObject {
|
||||
func connectToBurrow() {
|
||||
objectWillChange.send()
|
||||
model.connectToBurrow()
|
||||
}
|
||||
|
||||
@Published var model = Model()
|
||||
|
||||
@Published
|
||||
var status: Status = .unknown
|
||||
|
||||
init() {
|
||||
update()
|
||||
|
||||
|
||||
}
|
||||
|
||||
func connectToNetwork() {
|
||||
print(self.status)
|
||||
self.status = .loading
|
||||
print(self.status)
|
||||
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 3) {
|
||||
let random = Int.random(in: 0...1)
|
||||
if random == 0 {
|
||||
self.status = .valid
|
||||
print(self.status)
|
||||
|
||||
} else {
|
||||
self.status = .error
|
||||
print(self.status)
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func update() {
|
||||
Task {
|
||||
do {
|
||||
let configurations = try await NETunnelProviderManager.loadAll()
|
||||
|
||||
await MainActor.run {
|
||||
self.status = configurations.isEmpty ? .blank : .valid
|
||||
print(self.status)
|
||||
self.objectWillChange.send()
|
||||
}
|
||||
} catch {
|
||||
await MainActor.run {
|
||||
self.status = .error
|
||||
self.objectWillChange.send()
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func request() {
|
||||
let configuration = NETunnelProviderProtocol()
|
||||
configuration.providerBundleIdentifier = ""
|
||||
configuration.serverAddress = "Hack Club"
|
||||
|
||||
let manager = NETunnelProviderManager()
|
||||
manager.protocolConfiguration = configuration
|
||||
manager.localizedDescription = "Hack Club Burrow"
|
||||
manager.saveToPreferences { error in
|
||||
print(error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extension NETunnelProviderManager {
|
||||
static func loadAll() async throws -> [NETunnelProviderManager] {
|
||||
try await withUnsafeThrowingContinuation { continuation in
|
||||
NETunnelProviderManager.loadAllFromPreferences { managers, error in
|
||||
if let error = error {
|
||||
continuation.resume(throwing: error)
|
||||
} else {
|
||||
continuation.resume(returning: managers ?? [])
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -7,10 +7,6 @@
|
|||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
43E50D6D29FA050600BD2280 /* FluidMenuBarExtra in Frameworks */ = {isa = PBXBuildFile; platformFilters = (macos, ); productRef = 43E50D6C29FA050600BD2280 /* FluidMenuBarExtra */; };
|
||||
43EBDB2B29FD7557005D8CFF /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43EBDB2A29FD754A005D8CFF /* AppDelegate.swift */; };
|
||||
43EBDB2D29FD759E005D8CFF /* NetworkConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43EBDB2C29FD759E005D8CFF /* NetworkConfiguration.swift */; };
|
||||
43EBDB2F29FDE85F005D8CFF /* Model.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43EBDB2E29FDE85F005D8CFF /* Model.swift */; };
|
||||
D020F65829E4A697002790F6 /* PacketTunnelProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = D020F65729E4A697002790F6 /* PacketTunnelProvider.swift */; };
|
||||
D020F65D29E4A697002790F6 /* BurrowNetworkExtension.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = D020F65329E4A697002790F6 /* BurrowNetworkExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
|
||||
D05B9F7629E39EEC008CB1F9 /* BurrowApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = D05B9F7529E39EEC008CB1F9 /* BurrowApp.swift */; };
|
||||
|
|
@ -43,9 +39,6 @@
|
|||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
43EBDB2A29FD754A005D8CFF /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||
43EBDB2C29FD759E005D8CFF /* NetworkConfiguration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkConfiguration.swift; sourceTree = "<group>"; };
|
||||
43EBDB2E29FDE85F005D8CFF /* Model.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Model.swift; sourceTree = "<group>"; };
|
||||
D020F63D29E4A1FF002790F6 /* Identity.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Identity.xcconfig; sourceTree = "<group>"; };
|
||||
D020F64029E4A1FF002790F6 /* Compiler.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Compiler.xcconfig; sourceTree = "<group>"; };
|
||||
D020F64229E4A1FF002790F6 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
|
|
@ -78,7 +71,6 @@
|
|||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
43E50D6D29FA050600BD2280 /* FluidMenuBarExtra in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
|
@ -132,10 +124,7 @@
|
|||
isa = PBXGroup;
|
||||
children = (
|
||||
D05B9F7529E39EEC008CB1F9 /* BurrowApp.swift */,
|
||||
43EBDB2A29FD754A005D8CFF /* AppDelegate.swift */,
|
||||
D05B9F7729E39EEC008CB1F9 /* ContentView.swift */,
|
||||
43EBDB2C29FD759E005D8CFF /* NetworkConfiguration.swift */,
|
||||
43EBDB2E29FDE85F005D8CFF /* Model.swift */,
|
||||
D05B9F7929E39EED008CB1F9 /* Assets.xcassets */,
|
||||
D020F66829E4AA74002790F6 /* App-iOS.entitlements */,
|
||||
D020F66929E4AA74002790F6 /* App-macOS.entitlements */,
|
||||
|
|
@ -179,9 +168,6 @@
|
|||
D020F65C29E4A697002790F6 /* PBXTargetDependency */,
|
||||
);
|
||||
name = Burrow;
|
||||
packageProductDependencies = (
|
||||
43E50D6C29FA050600BD2280 /* FluidMenuBarExtra */,
|
||||
);
|
||||
productName = Burrow;
|
||||
productReference = D05B9F7229E39EEC008CB1F9 /* Burrow.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
|
|
@ -213,9 +199,6 @@
|
|||
Base,
|
||||
);
|
||||
mainGroup = D05B9F6929E39EEC008CB1F9;
|
||||
packageReferences = (
|
||||
43E50D6B29FA050600BD2280 /* XCRemoteSwiftPackageReference "fluid-menu-bar-extra" */,
|
||||
);
|
||||
productRefGroup = D05B9F7329E39EEC008CB1F9 /* Products */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
|
|
@ -257,11 +240,8 @@
|
|||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
43EBDB2F29FDE85F005D8CFF /* Model.swift in Sources */,
|
||||
43EBDB2B29FD7557005D8CFF /* AppDelegate.swift in Sources */,
|
||||
D05B9F7829E39EEC008CB1F9 /* ContentView.swift in Sources */,
|
||||
D05B9F7629E39EEC008CB1F9 /* BurrowApp.swift in Sources */,
|
||||
43EBDB2D29FD759E005D8CFF /* NetworkConfiguration.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
|
@ -280,7 +260,6 @@
|
|||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = D020F66229E4A6E5002790F6 /* NetworkExtension.xcconfig */;
|
||||
buildSettings = {
|
||||
DEVELOPMENT_TEAM = 2H4LMN3ZLG;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
|
|
@ -288,7 +267,6 @@
|
|||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = D020F66229E4A6E5002790F6 /* NetworkExtension.xcconfig */;
|
||||
buildSettings = {
|
||||
DEVELOPMENT_TEAM = 2H4LMN3ZLG;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
|
|
@ -310,8 +288,6 @@
|
|||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = D020F64929E4A34B002790F6 /* Burrow.xcconfig */;
|
||||
buildSettings = {
|
||||
DEVELOPMENT_TEAM = 2H4LMN3ZLG;
|
||||
MACOSX_DEPLOYMENT_TARGET = 13.0;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
|
|
@ -319,8 +295,6 @@
|
|||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = D020F64929E4A34B002790F6 /* Burrow.xcconfig */;
|
||||
buildSettings = {
|
||||
DEVELOPMENT_TEAM = 2H4LMN3ZLG;
|
||||
MACOSX_DEPLOYMENT_TARGET = 13.0;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
|
|
@ -355,25 +329,6 @@
|
|||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
|
||||
/* Begin XCRemoteSwiftPackageReference section */
|
||||
43E50D6B29FA050600BD2280 /* XCRemoteSwiftPackageReference "fluid-menu-bar-extra" */ = {
|
||||
isa = XCRemoteSwiftPackageReference;
|
||||
repositoryURL = "https://github.com/lfroms/fluid-menu-bar-extra.git";
|
||||
requirement = {
|
||||
branch = main;
|
||||
kind = branch;
|
||||
};
|
||||
};
|
||||
/* End XCRemoteSwiftPackageReference section */
|
||||
|
||||
/* Begin XCSwiftPackageProductDependency section */
|
||||
43E50D6C29FA050600BD2280 /* FluidMenuBarExtra */ = {
|
||||
isa = XCSwiftPackageProductDependency;
|
||||
package = 43E50D6B29FA050600BD2280 /* XCRemoteSwiftPackageReference "fluid-menu-bar-extra" */;
|
||||
productName = FluidMenuBarExtra;
|
||||
};
|
||||
/* End XCSwiftPackageProductDependency section */
|
||||
};
|
||||
rootObject = D05B9F6A29E39EEC008CB1F9 /* Project object */;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,14 +0,0 @@
|
|||
{
|
||||
"pins" : [
|
||||
{
|
||||
"identity" : "fluid-menu-bar-extra",
|
||||
"kind" : "remoteSourceControl",
|
||||
"location" : "https://github.com/lfroms/fluid-menu-bar-extra.git",
|
||||
"state" : {
|
||||
"branch" : "main",
|
||||
"revision" : "b8d41bc1c2609c3943c47d00fb539de38f90b817"
|
||||
}
|
||||
}
|
||||
],
|
||||
"version" : 2
|
||||
}
|
||||
|
|
@ -1,2 +1,2 @@
|
|||
DEVELOPMENT_TEAM = 2H4LMN3ZLG
|
||||
APP_BUNDLE_IDENTIFIER = com.ThomasStubblefield.burrow
|
||||
DEVELOPMENT_TEAM = 87PW93R2ZR
|
||||
APP_BUNDLE_IDENTIFIER = com.hackclub.burrow
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue