Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Major changes #2

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
Binary file added wifiname/.DS_Store
Binary file not shown.

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<?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/>
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0920"
version = "1.7">
LastUpgradeVersion = "1540"
version = "1.8">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
Expand All @@ -15,9 +15,9 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "41076D301FF3EA1900A16B13"
BuildableName = "wifiname.app"
BlueprintName = "wifiname"
ReferencedContainer = "container:wifiname.xcodeproj">
BuildableName = "Wifilicious.app"
BlueprintName = "Wifilicious"
ReferencedContainer = "container:Wifilicious.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
Expand All @@ -26,28 +26,24 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "41076D301FF3EA1900A16B13"
BuildableName = "wifiname.app"
BlueprintName = "wifiname"
ReferencedContainer = "container:wifiname.xcodeproj">
BuildableName = "Wifilicious.app"
BlueprintName = "Wifilicious"
ReferencedContainer = "container:Wifilicious.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
enableAddressSanitizer = "YES"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
Expand All @@ -60,13 +56,11 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "41076D301FF3EA1900A16B13"
BuildableName = "wifiname.app"
BlueprintName = "wifiname"
ReferencedContainer = "container:wifiname.xcodeproj">
BuildableName = "Wifilicious.app"
BlueprintName = "Wifilicious"
ReferencedContainer = "container:Wifilicious.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
<LocationScenarioReference
identifier = "com.apple.dt.IDEFoundation.CurrentLocationScenarioIdentifier"
referenceType = "1">
Expand All @@ -83,9 +77,9 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "41076D301FF3EA1900A16B13"
BuildableName = "wifiname.app"
BlueprintName = "wifiname"
ReferencedContainer = "container:wifiname.xcodeproj">
BuildableName = "Wifilicious.app"
BlueprintName = "Wifilicious"
ReferencedContainer = "container:Wifilicious.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
Expand Down
47 changes: 47 additions & 0 deletions wifiname/Wifilicious/App.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
//
// App.swift
// wifiname
//
// Created by Brian Clark on 12/27/17.
// Copyright © 2024 Clarkio. All rights reserved.
// www.clarkio.com

import SwiftUI
import CoreWLAN
import CoreLocation

@main
struct Wifiname: App {
@NSApplicationDelegateAdaptor(AppDelegate.self) var appDelegate
var body: some Scene {
Settings {
EmptyView()
}
}
}

class AppDelegate: NSObject, NSApplicationDelegate {

static private (set) var instance: AppDelegate?

lazy var statusBarItem = NSStatusBar.system.statusItem(withLength: NSStatusItem.variableLength)
let locationManager = CLLocationManager()
let wifiClient = CWWiFiClient.shared()
var visible = true

let prompt = Prompt()

func applicationDidFinishLaunching(_ aNotification: Notification) {
locationManager.delegate = self
AppDelegate.instance = self
checkAuthorizationStatus()
}

func applicationWillTerminate(_ aNotification: Notification) {
do {
try wifiClient.stopMonitoringEvent(with: .ssidDidChange)
} catch {
print(error.localizedDescription)
}
}
}
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"images" : [
{
"filename" : "16x16.png",
"idiom" : "mac",
"scale" : "1x",
"size" : "16x16"
},
{
"filename" : "[email protected]",
"idiom" : "mac",
"scale" : "2x",
"size" : "16x16"
},
{
"filename" : "32x32.png",
"idiom" : "mac",
"scale" : "1x",
"size" : "32x32"
},
{
"filename" : "[email protected]",
"idiom" : "mac",
"scale" : "2x",
"size" : "32x32"
},
{
"filename" : "128x128.png",
"idiom" : "mac",
"scale" : "1x",
"size" : "128x128"
},
{
"filename" : "[email protected]",
"idiom" : "mac",
"scale" : "2x",
"size" : "128x128"
},
{
"filename" : "256x256.png",
"idiom" : "mac",
"scale" : "1x",
"size" : "256x256"
},
{
"filename" : "256x256@2x 1.png",
"idiom" : "mac",
"scale" : "2x",
"size" : "256x256"
},
{
"filename" : "512x512.png",
"idiom" : "mac",
"scale" : "1x",
"size" : "512x512"
},
{
"filename" : "[email protected]",
"idiom" : "mac",
"scale" : "2x",
"size" : "512x512"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
6 changes: 6 additions & 0 deletions wifiname/Wifilicious/Assets.xcassets/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "connected.svg",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "disconnected.svg",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 33 additions & 0 deletions wifiname/Wifilicious/Authorization.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
//
// Authorization.swift
// wifiname
//
// Created by Dhanish on 16/05/2024.
// Copyright © 2024 Clarkio. All rights reserved.
//

import SwiftUI
import CoreLocation

extension AppDelegate: CLLocationManagerDelegate {

func checkAuthorizationStatus() {
let currentStatus = locationManager.authorizationStatus
switch currentStatus {
case .authorizedWhenInUse, .authorizedAlways:
listenForSsidChanges()
updateStatusBar()
constructMenu()
case .denied, .restricted:
prompt.toEnableLocationServices()
case .notDetermined:
locationManager.requestWhenInUseAuthorization()
@unknown default:
break
}
}

func locationManager(_ manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus) {
checkAuthorizationStatus()
}
}
8 changes: 8 additions & 0 deletions wifiname/Wifilicious/Credits.rtf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{\rtf1\ansi\ansicpg1252\cocoartf2761
\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;}
{\*\expandedcolortbl;;}
\margl1440\margr1440\vieww9000\viewh8400\viewkind0
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\qc\partightenfactor0
{\field{\*\fldinst{HYPERLINK "http://www.clarkio.com"}}{\fldrslt
\f0\fs24 \cf0 www.clarkio.com}}}
Loading