mirror of
https://github.com/maxgoedjen/secretive.git
synced 2025-09-15 08:50:57 +00:00
.
This commit is contained in:
parent
ce4af2deca
commit
6d56d841d3
@ -1,32 +1,16 @@
|
||||
import Foundation
|
||||
import XPC
|
||||
|
||||
@_silgen_name("xpc_session_set_peer_code_signing_requirement")
|
||||
func xpc_session_set_peer_code_signing_requirement(_ session: Any, _ requirement: UnsafePointer<CChar>) -> Int32
|
||||
|
||||
public struct XPCTypedSession<ResponseType: Codable & Sendable, ErrorType: Error & Codable>: Sendable {
|
||||
|
||||
private let session: XPCSession
|
||||
|
||||
public init(serviceName: String, warmup: Bool = false) throws {
|
||||
// if #available(macOS 26.0, *) {
|
||||
// session = try XPCSession(xpcService: serviceName, requirement: .isFromSameTeam())
|
||||
// } else {
|
||||
session = try XPCSession(xpcService: serviceName, options: .inactive)
|
||||
let test = Mirror(reflecting: session)
|
||||
for case let (label?, value) in test.children {
|
||||
if label == "_session" {
|
||||
print("HIT")
|
||||
"anchor apple".utf8CString.withUnsafeBufferPointer { x in
|
||||
_ = xpc_session_set_peer_code_signing_requirement(
|
||||
value,
|
||||
x.baseAddress!
|
||||
)
|
||||
}
|
||||
}
|
||||
if #available(macOS 26.0, *) {
|
||||
session = try XPCSession(xpcService: serviceName, requirement: .isFromSameTeam())
|
||||
} else {
|
||||
session = try XPCSession(xpcService: serviceName)
|
||||
}
|
||||
// try session.activate()
|
||||
// }
|
||||
if warmup {
|
||||
Task { [self] in
|
||||
_ = try? await send()
|
||||
|
@ -51,6 +51,7 @@
|
||||
5066A6C82516FE6E004B5A36 /* CopyableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5066A6C72516FE6E004B5A36 /* CopyableView.swift */; };
|
||||
506772C72424784600034DED /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 506772C62424784600034DED /* Credits.rtf */; };
|
||||
506772C92425BB8500034DED /* NoStoresView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 506772C82425BB8500034DED /* NoStoresView.swift */; };
|
||||
50692C5B2E6EB8D40043C7BB /* LaunchConstraints.coderequirement in Resources */ = {isa = PBXBuildFile; fileRef = 50692C5A2E6EB8D40043C7BB /* LaunchConstraints.coderequirement */; };
|
||||
5079BA0F250F29BF00EA86F4 /* StoreListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5079BA0E250F29BF00EA86F4 /* StoreListView.swift */; };
|
||||
508A58AA241E06B40069DC07 /* PreviewUpdater.swift in Sources */ = {isa = PBXBuildFile; fileRef = 508A58A9241E06B40069DC07 /* PreviewUpdater.swift */; };
|
||||
508A58B3241ED2180069DC07 /* AgentStatusChecker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 508A58B2241ED2180069DC07 /* AgentStatusChecker.swift */; };
|
||||
@ -201,6 +202,7 @@
|
||||
5066A6C72516FE6E004B5A36 /* CopyableView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CopyableView.swift; sourceTree = "<group>"; };
|
||||
506772C62424784600034DED /* Credits.rtf */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; path = Credits.rtf; sourceTree = "<group>"; };
|
||||
506772C82425BB8500034DED /* NoStoresView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NoStoresView.swift; sourceTree = "<group>"; };
|
||||
50692C5A2E6EB8D40043C7BB /* LaunchConstraints.coderequirement */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = LaunchConstraints.coderequirement; sourceTree = "<group>"; };
|
||||
5079BA0E250F29BF00EA86F4 /* StoreListView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StoreListView.swift; sourceTree = "<group>"; };
|
||||
508A58A9241E06B40069DC07 /* PreviewUpdater.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PreviewUpdater.swift; sourceTree = "<group>"; };
|
||||
508A58AB241E121B0069DC07 /* Config.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Config.xcconfig; sourceTree = "<group>"; };
|
||||
@ -381,6 +383,7 @@
|
||||
50617D8E23FCE48E0099B055 /* Info.plist */,
|
||||
508BF28D25B4F005009EFB7E /* InternetAccessPolicy.plist */,
|
||||
50617D8F23FCE48E0099B055 /* Secretive.entitlements */,
|
||||
50692C5A2E6EB8D40043C7BB /* LaunchConstraints.coderequirement */,
|
||||
506772C62424784600034DED /* Credits.rtf */,
|
||||
5008C23D2E525D8200507AC2 /* Localizable.xcstrings */,
|
||||
50617D8823FCE48E0099B055 /* Preview Content */,
|
||||
@ -639,6 +642,7 @@
|
||||
5008C23E2E525D8900507AC2 /* Localizable.xcstrings in Resources */,
|
||||
50617D8723FCE48E0099B055 /* Assets.xcassets in Resources */,
|
||||
506772C72424784600034DED /* Credits.rtf in Resources */,
|
||||
50692C5B2E6EB8D40043C7BB /* LaunchConstraints.coderequirement in Resources */,
|
||||
508BF28E25B4F005009EFB7E /* InternetAccessPolicy.plist in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
@ -1151,6 +1155,7 @@
|
||||
ENABLE_RESOURCE_ACCESS_PRINTING = NO;
|
||||
ENABLE_RESOURCE_ACCESS_USB = NO;
|
||||
INFOPLIST_FILE = Secretive/Info.plist;
|
||||
LAUNCH_CONSTRAINT_RESPONSIBLE = "$(SRCROOT)/Secretive/LaunchConstraints.coderequirement";
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/../Frameworks",
|
||||
@ -1191,6 +1196,7 @@
|
||||
ENABLE_RESOURCE_ACCESS_PRINTING = NO;
|
||||
ENABLE_RESOURCE_ACCESS_USB = NO;
|
||||
INFOPLIST_FILE = Secretive/Info.plist;
|
||||
LAUNCH_CONSTRAINT_RESPONSIBLE = "$(SRCROOT)/Secretive/LaunchConstraints.coderequirement";
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/../Frameworks",
|
||||
@ -1303,6 +1309,7 @@
|
||||
ENABLE_RESOURCE_ACCESS_PRINTING = NO;
|
||||
ENABLE_RESOURCE_ACCESS_USB = NO;
|
||||
INFOPLIST_FILE = Secretive/Info.plist;
|
||||
LAUNCH_CONSTRAINT_RESPONSIBLE = "$(SRCROOT)/Secretive/LaunchConstraints.coderequirement";
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/../Frameworks",
|
||||
@ -1336,6 +1343,7 @@
|
||||
ENABLE_RESOURCE_ACCESS_PRINTING = NO;
|
||||
ENABLE_RESOURCE_ACCESS_USB = NO;
|
||||
INFOPLIST_FILE = SecretAgent/Info.plist;
|
||||
LAUNCH_CONSTRAINT_RESPONSIBLE = "$(SRCROOT)/Secretive/LaunchConstraints.coderequirement";
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/../Frameworks",
|
||||
@ -1371,6 +1379,7 @@
|
||||
ENABLE_RESOURCE_ACCESS_PRINTING = NO;
|
||||
ENABLE_RESOURCE_ACCESS_USB = NO;
|
||||
INFOPLIST_FILE = SecretAgent/Info.plist;
|
||||
LAUNCH_CONSTRAINT_RESPONSIBLE = "$(SRCROOT)/Secretive/LaunchConstraints.coderequirement";
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/../Frameworks",
|
||||
@ -1407,6 +1416,7 @@
|
||||
ENABLE_RESOURCE_ACCESS_PRINTING = NO;
|
||||
ENABLE_RESOURCE_ACCESS_USB = NO;
|
||||
INFOPLIST_FILE = SecretAgent/Info.plist;
|
||||
LAUNCH_CONSTRAINT_RESPONSIBLE = "$(SRCROOT)/Secretive/LaunchConstraints.coderequirement";
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/../Frameworks",
|
||||
|
8
Sources/Secretive/LaunchConstraints.coderequirement
Normal file
8
Sources/Secretive/LaunchConstraints.coderequirement
Normal file
@ -0,0 +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>
|
||||
<key>team-identifier</key>
|
||||
<string>Z72PRUAWF6</string>
|
||||
</dict>
|
||||
</plist>
|
Loading…
Reference in New Issue
Block a user