Create swift package

This commit is contained in:
Joe Mattiello
2023-03-01 00:48:36 -05:00
parent 4669227567
commit 493b3783f0
409 changed files with 13707 additions and 16923 deletions

View File

@@ -0,0 +1,28 @@
//
// NSXPCConnection+MachServices.swift
// AltStore
//
// Created by Riley Testut on 9/22/20.
// Copyright © 2020 Riley Testut. All rights reserved.
//
import Foundation
@objc private protocol XPCPrivateAPI {
init(machServiceName: String)
init(machServiceName: String, options: NSXPCConnection.Options)
}
public extension NSXPCConnection {
class func makeConnection(machServiceName: String) -> NSXPCConnection {
let connection = unsafeBitCast(self, to: XPCPrivateAPI.Type.self).init(machServiceName: machServiceName, options: .privileged)
return unsafeBitCast(connection, to: NSXPCConnection.self)
}
}
public extension NSXPCListener {
class func makeListener(machServiceName: String) -> NSXPCListener {
let listener = unsafeBitCast(self, to: XPCPrivateAPI.Type.self).init(machServiceName: machServiceName)
return unsafeBitCast(listener, to: NSXPCListener.self)
}
}