mirror of
https://github.com/maxgoedjen/secretive.git
synced 2026-03-06 17:57:23 +01:00
.
This commit is contained in:
@@ -35,6 +35,13 @@ class AppDelegate: NSObject, NSApplicationDelegate {
|
||||
logger.debug("SecretAgent finished launching")
|
||||
Task {
|
||||
let inputParser = try XPCAgentInputParser()
|
||||
Task {
|
||||
try? await Task.sleep(for: .seconds(1))
|
||||
var len = (5 as UInt32).littleEndian
|
||||
var raw = SSHAgent.Request.requestIdentities.protocolID
|
||||
let data = Data(bytes: &len, count: MemoryLayout<UInt32>.size) + Data(bytes: &raw, count: MemoryLayout<UInt8>.size)
|
||||
print(try? await inputParser.parse(data: data))
|
||||
}
|
||||
for await session in socketController.sessions {
|
||||
Task {
|
||||
do {
|
||||
|
||||
@@ -4,13 +4,15 @@ import SecretAgentKit
|
||||
public final class XPCAgentInputParser: SSHAgentInputParserProtocol {
|
||||
|
||||
private let session: XPCSession
|
||||
private let queue = DispatchQueue(label: "com.maxgoedjen.Secretive.AgentRequestParser", qos: .userInteractive)
|
||||
|
||||
public init() throws {
|
||||
if #available(macOS 26.0, *) {
|
||||
session = try XPCSession(xpcService: "com.maxgoedjen.Secretive.AgentRequestParser", requirement: .isFromSameTeam())
|
||||
session = try XPCSession(xpcService: "com.maxgoedjen.Secretive.AgentRequestParser", targetQueue: queue, options: .inactive, requirement: .isFromSameTeam())
|
||||
} else {
|
||||
session = try XPCSession(xpcService: "com.maxgoedjen.Secretive.AgentRequestParser")
|
||||
session = try XPCSession(xpcService: "com.maxgoedjen.Secretive.AgentRequestParser", targetQueue: queue, options: .inactive)
|
||||
}
|
||||
try session.activate()
|
||||
}
|
||||
|
||||
public func parse(data: Data) async throws -> SSHAgent.Request {
|
||||
|
||||
Reference in New Issue
Block a user