Skip to content
Merged
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
4 changes: 4 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,9 @@ let package = Package(
dependencies: ["GhostTileCore"],
exclude: ["Resources"]
),
.testTarget(
name: "GhostTileAppTests",
dependencies: ["GhostTileApp"]
),
]
)
4 changes: 2 additions & 2 deletions Resources/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>2.0.6</string>
<string>2.0.7</string>
<key>CFBundleVersion</key>
<string>23</string>
<string>24</string>
<key>LSMinimumSystemVersion</key>
<string>15.0</string>
<key>LSUIElement</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ enum AppManagementPermissionStatusReader {
private static let frameworkPath = "/System/Library/PrivateFrameworks/TCC.framework/TCC"
private static let preflightSymbolName = "TCCAccessPreflight"
private static let appManagementServiceSymbolName = "kTCCServiceSystemPolicyAppBundles"
private static let preflightGranted: Int32 = 0

private typealias TCCAccessPreflightFunction = @convention(c) (
CFString,
Expand All @@ -26,6 +27,10 @@ enum AppManagementPermissionStatusReader {
to: TCCAccessPreflightFunction.self
)
let service = serviceSymbol.assumingMemoryBound(to: CFString.self).pointee
return preflight(service, nil) != 0
return isAllowed(preflightResult: preflight(service, nil))
}

static func isAllowed(preflightResult: Int32) -> Bool {
preflightResult == preflightGranted
}
}
4 changes: 2 additions & 2 deletions Sources/GhostTileCore/BuildInfo.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
public enum BuildInfo {
public static let version = "2.0.6"
public static let build = "23"
public static let version = "2.0.7"
public static let build = "24"

public static let displayVersion = "\(version) (\(build))"

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
@testable import GhostTileApp
import Testing
Comment thread
hewigovens marked this conversation as resolved.

@Suite("AppManagementPermissionStatusReader")
struct AppManagementPermissionStatusReaderTests {
@Test func preflightResultZeroMeansAllowed() {
#expect(AppManagementPermissionStatusReader.isAllowed(preflightResult: 0))
}

@Test func nonZeroPreflightResultsAreNotAllowed() {
#expect(!AppManagementPermissionStatusReader.isAllowed(preflightResult: 1))
#expect(!AppManagementPermissionStatusReader.isAllowed(preflightResult: 2))
}
}
4 changes: 2 additions & 2 deletions VERSION
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
VERSION=2.0.6
BUILD=23
VERSION=2.0.7
BUILD=24
4 changes: 2 additions & 2 deletions project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ targets:
properties:
CFBundleDisplayName: GhostTile
CFBundleIconName: app
CFBundleShortVersionString: 2.0.6
CFBundleVersion: "23"
CFBundleShortVersionString: 2.0.7
CFBundleVersion: "24"
LSUIElement: false
LSMinimumSystemVersion: "15.0"
NSHighResolutionCapable: true
Expand Down
3 changes: 3 additions & 0 deletions releases/2.0.7.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<ul>
<li>Fixed App Management permission detection. GhostTile no longer keeps showing the permission alert after access has already been granted.</li>
</ul>
Loading