Skip to content

Commit

Permalink
v1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
alienator88 committed Jul 30, 2024
1 parent abad2f5 commit efa66cf
Show file tree
Hide file tree
Showing 16 changed files with 187 additions and 591 deletions.
47 changes: 35 additions & 12 deletions Sentinel.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
C733F76B29CA59AE00DADADD /* Script.swift in Sources */ = {isa = PBXBuildFile; fileRef = C733F76A29CA59AE00DADADD /* Script.swift */; };
C733F76F29CA65AC00DADADD /* AppState.swift in Sources */ = {isa = PBXBuildFile; fileRef = C733F76E29CA65AC00DADADD /* AppState.swift */; };
C766D28C2C34D10500F51BB9 /* Builds in Resources */ = {isa = PBXBuildFile; fileRef = C766D28B2C34D10500F51BB9 /* Builds */; };
C78AAAAF2BB33F3C002AD918 /* UpdateView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C78AAAAE2BB33F3C002AD918 /* UpdateView.swift */; };
C78AAAB12BB33F56002AD918 /* NewWin.swift in Sources */ = {isa = PBXBuildFile; fileRef = C78AAAB02BB33F56002AD918 /* NewWin.swift */; };
C78AAAB32BB33F84002AD918 /* UpdateSettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C78AAAB22BB33F84002AD918 /* UpdateSettingsView.swift */; };
C78AAAB52BB33F9A002AD918 /* Styles.swift in Sources */ = {isa = PBXBuildFile; fileRef = C78AAAB42BB33F9A002AD918 /* Styles.swift */; };
C78AAAB72BB3400B002AD918 /* Utilities.swift in Sources */ = {isa = PBXBuildFile; fileRef = C78AAAB62BB3400B002AD918 /* Utilities.swift */; };
C78AAAB92BB3418E002AD918 /* SettingsWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = C78AAAB82BB3418E002AD918 /* SettingsWindow.swift */; };
C78AAABB2BB399DD002AD918 /* BundleExt.swift in Sources */ = {isa = PBXBuildFile; fileRef = C78AAABA2BB399DD002AD918 /* BundleExt.swift */; };
C7BB802A29CA28B400006CDB /* Dashboard.swift in Sources */ = {isa = PBXBuildFile; fileRef = C7BB802929CA28B400006CDB /* Dashboard.swift */; };
C7BB802C29CA299700006CDB /* CmdRunner.swift in Sources */ = {isa = PBXBuildFile; fileRef = C7BB802B29CA299700006CDB /* CmdRunner.swift */; };
C7EB1E0A2C594BD50085B695 /* AlinFoundation in Frameworks */ = {isa = PBXBuildFile; productRef = C7EB1E092C594BD50085B695 /* AlinFoundation */; };
C7EB1E0C2C5956F80085B695 /* GK.mobileconfig in Resources */ = {isa = PBXBuildFile; fileRef = C7EB1E0B2C5956F80085B695 /* GK.mobileconfig */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand All @@ -37,22 +37,22 @@
C733F76A29CA59AE00DADADD /* Script.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Script.swift; sourceTree = "<group>"; };
C733F76E29CA65AC00DADADD /* AppState.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppState.swift; sourceTree = "<group>"; };
C766D28B2C34D10500F51BB9 /* Builds */ = {isa = PBXFileReference; lastKnownFileType = folder; path = Builds; sourceTree = SOURCE_ROOT; };
C78AAAAE2BB33F3C002AD918 /* UpdateView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UpdateView.swift; sourceTree = "<group>"; };
C78AAAB02BB33F56002AD918 /* NewWin.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NewWin.swift; sourceTree = "<group>"; };
C78AAAB22BB33F84002AD918 /* UpdateSettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UpdateSettingsView.swift; sourceTree = "<group>"; };
C78AAAB42BB33F9A002AD918 /* Styles.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Styles.swift; sourceTree = "<group>"; };
C78AAAB62BB3400B002AD918 /* Utilities.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Utilities.swift; sourceTree = "<group>"; };
C78AAAB82BB3418E002AD918 /* SettingsWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsWindow.swift; sourceTree = "<group>"; };
C78AAABA2BB399DD002AD918 /* BundleExt.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BundleExt.swift; sourceTree = "<group>"; };
C7BB802929CA28B400006CDB /* Dashboard.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Dashboard.swift; sourceTree = "<group>"; };
C7BB802B29CA299700006CDB /* CmdRunner.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CmdRunner.swift; sourceTree = "<group>"; };
C7EB1E0B2C5956F80085B695 /* GK.mobileconfig */ = {isa = PBXFileReference; lastKnownFileType = file; path = GK.mobileconfig; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
4180AEA72839753E0054FEA9 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
C7EB1E0A2C594BD50085B695 /* AlinFoundation in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -88,6 +88,7 @@
C7BB802929CA28B400006CDB /* Dashboard.swift */,
C733F76E29CA65AC00DADADD /* AppState.swift */,
C78AAAB42BB33F9A002AD918 /* Styles.swift */,
C7EB1E0B2C5956F80085B695 /* GK.mobileconfig */,
);
path = Sentinel;
sourceTree = "<group>";
Expand Down Expand Up @@ -116,8 +117,6 @@
C78AAAAD2BB33F2E002AD918 /* Updater */ = {
isa = PBXGroup;
children = (
C78AAAAE2BB33F3C002AD918 /* UpdateView.swift */,
C78AAAB02BB33F56002AD918 /* NewWin.swift */,
C78AAAB22BB33F84002AD918 /* UpdateSettingsView.swift */,
C78AAAB82BB3418E002AD918 /* SettingsWindow.swift */,
);
Expand All @@ -140,6 +139,9 @@
dependencies = (
);
name = Sentinel;
packageProductDependencies = (
C7EB1E092C594BD50085B695 /* AlinFoundation */,
);
productName = SidebarApp;
productReference = 4180AEAA2839753E0054FEA9 /* Sentinel.app */;
productType = "com.apple.product-type.application";
Expand Down Expand Up @@ -168,6 +170,9 @@
Base,
);
mainGroup = 4180AEA12839753E0054FEA9;
packageReferences = (
C7EB1E082C594BD50085B695 /* XCRemoteSwiftPackageReference "AlinFoundation" */,
);
productRefGroup = 4180AEAB2839753E0054FEA9 /* Products */;
projectDirPath = "";
projectRoot = "";
Expand All @@ -184,6 +189,7 @@
files = (
4180AEB22839753F0054FEA9 /* Assets.xcassets in Resources */,
C766D28C2C34D10500F51BB9 /* Builds in Resources */,
C7EB1E0C2C5956F80085B695 /* GK.mobileconfig in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -199,9 +205,7 @@
C78AAABB2BB399DD002AD918 /* BundleExt.swift in Sources */,
C733F76F29CA65AC00DADADD /* AppState.swift in Sources */,
C78AAAB72BB3400B002AD918 /* Utilities.swift in Sources */,
C78AAAAF2BB33F3C002AD918 /* UpdateView.swift in Sources */,
C7BB802C29CA299700006CDB /* CmdRunner.swift in Sources */,
C78AAAB12BB33F56002AD918 /* NewWin.swift in Sources */,
4180AEF92839A21F0054FEA9 /* AboutWindow.swift in Sources */,
C78AAAB52BB33F9A002AD918 /* Styles.swift in Sources */,
4180AEEB2839A0280054FEA9 /* AboutCommand.swift in Sources */,
Expand Down Expand Up @@ -346,7 +350,7 @@
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Developer ID Application";
CODE_SIGN_STYLE = Manual;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 6;
CURRENT_PROJECT_VERSION = 7;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_ASSET_PATHS = "";
DEVELOPMENT_TEAM = "";
Expand All @@ -362,7 +366,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 12.0;
MARKETING_VERSION = 1.5;
MARKETING_VERSION = 1.6;
PRODUCT_BUNDLE_IDENTIFIER = com.alienator88.Sentinel;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand All @@ -382,7 +386,7 @@
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Developer ID Application";
CODE_SIGN_STYLE = Manual;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 6;
CURRENT_PROJECT_VERSION = 7;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_ASSET_PATHS = "";
DEVELOPMENT_TEAM = "";
Expand All @@ -398,7 +402,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 12.0;
MARKETING_VERSION = 1.5;
MARKETING_VERSION = 1.6;
PRODUCT_BUNDLE_IDENTIFIER = com.alienator88.Sentinel;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -430,6 +434,25 @@
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */

/* Begin XCRemoteSwiftPackageReference section */
C7EB1E082C594BD50085B695 /* XCRemoteSwiftPackageReference "AlinFoundation" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/alienator88/AlinFoundation";
requirement = {
branch = main;
kind = branch;
};
};
/* End XCRemoteSwiftPackageReference section */

/* Begin XCSwiftPackageProductDependency section */
C7EB1E092C594BD50085B695 /* AlinFoundation */ = {
isa = XCSwiftPackageProductDependency;
package = C7EB1E082C594BD50085B695 /* XCRemoteSwiftPackageReference "AlinFoundation" */;
productName = AlinFoundation;
};
/* End XCSwiftPackageProductDependency section */
};
rootObject = 4180AEA22839753E0054FEA9 /* Project object */;
}

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
@@ -0,0 +1,15 @@
{
"originHash" : "50739d16fb3b1c36e28568d832b61475022b29d5c6dad4328005a7afcef102b7",
"pins" : [
{
"identity" : "alinfoundation",
"kind" : "remoteSourceControl",
"location" : "https://github.com/alienator88/AlinFoundation",
"state" : {
"branch" : "main",
"revision" : "c23d071049676e849036bbfecfd6ea48ef3bbe94"
}
}
],
"version" : 3
}
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction">
<ActionContent
title = "Run Script"
scriptText = "#/Users/alin/Projects/Bash/xcode-release.sh Work:false Project:&quot;/Users/alin/GitHub/Sentinel&quot; Name:&quot;Sentinel&quot; Log:false&#10;"
scriptText = "/Users/alin/Projects/Bash/xcode-release.sh Work:false Project:&quot;/Users/alin/GitHub/Sentinel&quot; Name:&quot;Sentinel&quot; Log:true&#10;"
shellToInvoke = "/bin/sh">
<EnvironmentBuildable>
<BuildableReference
Expand Down
7 changes: 5 additions & 2 deletions Sentinel/About Window/AboutCommand.swift
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import SwiftUI
import AlinFoundation

struct AboutCommand: Commands {
let appState: AppState
init(appState: AppState) {
let updater: Updater
init(appState: AppState, updater: Updater) {
self.appState = appState
self.updater = updater
}

var body: some Commands {
Expand All @@ -16,7 +19,7 @@ struct AboutCommand: Commands {
}

Button {
loadGithubReleases(appState: appState, manual: true)
updater.checkForUpdates(showSheet: false)
} label: {
Text("Check for Updates")
}
Expand Down
8 changes: 0 additions & 8 deletions Sentinel/AppState.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,12 @@ class AppState: ObservableObject {
@Published var isGatekeeperEnabled: Bool = true
@Published var isGatekeeperEnabledState: Bool = true
@Published var status: String = ""
@Published var releases = [Release]()
@Published var progressBar: (String, Double) = ("Ready", 0.0)



}


enum NewWindow:Int
{
case update
case no_update
}

enum CurrentTabView:Int
{
case general
Expand Down
70 changes: 55 additions & 15 deletions Sentinel/Dashboard.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,28 @@

import SwiftUI
import UniformTypeIdentifiers
import AlinFoundation

private let dropTypes = [UTType.fileURL]

struct Dashboard: View {

@EnvironmentObject var appState: AppState
@State private var bounce = false
@EnvironmentObject var updater: Updater
@EnvironmentObject var themeManager: ThemeManager
// @State private var bounce = false

var body: some View {
VStack(alignment: .center, spacing: 30) {

// LOGO - TITLEBAR //////////////////////////////////////////////////////
HStack(alignment: .center, spacing: 0) {
Spacer()

if updater.updateAvailable {
UpdateBadge(updater: updater)
.frame(width: 250)
} else {
Text("Sentinel")
.font(.title2)
.foregroundStyle(
Expand All @@ -30,6 +38,9 @@ struct Dashboard: View {
endPoint: .trailing
)
)

}

// Spacer()

}
Expand All @@ -38,7 +49,6 @@ struct Dashboard: View {
// Drop Zones //////////////////////////////////////////////////////



VStack(alignment: .center, spacing: 20) {

HStack() {
Expand All @@ -48,15 +58,15 @@ struct Dashboard: View {
.resizable()
.aspectRatio(contentMode: .fit)
.frame(width: 14)
.offset(y: bounce ? -2 : 2)
.animation(
.easeInOut(duration: 0.4)
.repeatCount(7, autoreverses: true),
value: bounce
)
.onAppear {
bounce = true
}
// .offset(y: bounce ? -2 : 2)
// .animation(
// .easeInOut(duration: 0.4)
// .repeatCount(7, autoreverses: true),
// value: bounce
// )
// .onAppear {
// bounce = true
// }
}


Expand Down Expand Up @@ -90,17 +100,47 @@ struct Dashboard: View {


// GK STATUS //////////////////////////////////////////////////////
Toggle("", isOn: $appState.isGatekeeperEnabled)
.toggleStyle(RedGreenShield())
.help("Your Gatekeeper assessments are \(appState.isGatekeeperEnabled ? "enabled" : "disabled")")

Spacer()

if #available(macOS 15, *) { //MARK: Change this to 15 after testing is done
InfoButton(text: "macOS Sequoia and up does not allow gatekeeper control via command line anymore. The only way to control this now is by adding a configuration profile.\n\nClick the install button and double click the 'Disable Gatekeeper' profile in the Settings pane to install it", color: .orange, label: "Please Read", warning: true)
HStack {

Button(action: {
openFileAndSystemPreferences(filename: "GK", withExtension: "mobileconfig", appState: appState)
}) {
Text("Install Profile")
.padding(5)
}

Button(action: {
CmdRunSudo(cmd: "profiles -R -p com.alienator88.Sentinel", type: "profile", appState: appState)
}) {
Text("Remove Profile")
.padding(5)
}



}

} else {
Toggle("", isOn: $appState.isGatekeeperEnabled)
.toggleStyle(RedGreenShield())
.help("Your Gatekeeper assessments are \(appState.isGatekeeperEnabled ? "enabled" : "disabled")")
}


// Spacer()

HStack(alignment: .center){
Text(appState.status)
.font(.system(size: 12))
.opacity(0.8)
.padding(.vertical)
}
.padding(.bottom)
.padding(.vertical)

}
.padding()
Expand Down
Binary file added Sentinel/GK.mobileconfig
Binary file not shown.
Loading

0 comments on commit efa66cf

Please sign in to comment.