mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-09 06:43:25 +01:00
[AltXPC] Initial version
AltXPC uses the private com.apple.authkit.client.internal entitlement to retrieve anisette data.
This commit is contained in:
7
AltXPC/AltXPC-Bridging-Header.h
Normal file
7
AltXPC/AltXPC-Bridging-Header.h
Normal file
@@ -0,0 +1,7 @@
|
||||
//
|
||||
// Use this file to import your target's public headers that you would like to expose to Swift.
|
||||
//
|
||||
|
||||
#import "ALTAnisetteData.h"
|
||||
#import "AltXPCProtocol.h"
|
||||
#import "ALTPluginService.h"
|
||||
8
AltXPC/AltXPC.entitlements
Normal file
8
AltXPC/AltXPC.entitlements
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>com.apple.authkit.client.internal</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
24
AltXPC/AltXPC.swift
Normal file
24
AltXPC/AltXPC.swift
Normal file
@@ -0,0 +1,24 @@
|
||||
//
|
||||
// AltXPC.swift
|
||||
// AltXPC
|
||||
//
|
||||
// Created by Riley Testut on 12/3/20.
|
||||
// Copyright © 2020 Riley Testut. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
@objc(AltXPC)
|
||||
class AltXPC: NSObject, AltXPCProtocol
|
||||
{
|
||||
func ping(_ completionHandler: @escaping () -> Void)
|
||||
{
|
||||
completionHandler()
|
||||
}
|
||||
|
||||
func requestAnisetteData(completionHandler: @escaping (ALTAnisetteData?, Error?) -> Void)
|
||||
{
|
||||
let anisetteData = ALTPluginService.shared.requestAnisetteData()
|
||||
completionHandler(anisetteData, nil)
|
||||
}
|
||||
}
|
||||
31
AltXPC/Info.plist
Normal file
31
AltXPC/Info.plist
Normal file
@@ -0,0 +1,31 @@
|
||||
<?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>CFBundleDevelopmentRegion</key>
|
||||
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>AltXPC</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>$(PRODUCT_NAME)</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>Copyright © 2020 Riley Testut. All rights reserved.</string>
|
||||
<key>XPCService</key>
|
||||
<dict>
|
||||
<key>ServiceType</key>
|
||||
<string>Application</string>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
||||
31
AltXPC/main.swift
Normal file
31
AltXPC/main.swift
Normal file
@@ -0,0 +1,31 @@
|
||||
//
|
||||
// main.swift
|
||||
// AltXPC
|
||||
//
|
||||
// Created by Riley Testut on 12/3/20.
|
||||
// Copyright © 2020 Riley Testut. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
class ServiceDelegate : NSObject, NSXPCListenerDelegate
|
||||
{
|
||||
func listener(_ listener: NSXPCListener, shouldAcceptNewConnection newConnection: NSXPCConnection) -> Bool
|
||||
{
|
||||
newConnection.exportedInterface = NSXPCInterface(with: AltXPCProtocol.self)
|
||||
|
||||
let exportedObject = AltXPC()
|
||||
newConnection.exportedObject = exportedObject
|
||||
newConnection.resume()
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
let serviceDelegate = ServiceDelegate()
|
||||
|
||||
let listener = NSXPCListener.service()
|
||||
listener.delegate = serviceDelegate
|
||||
listener.resume()
|
||||
|
||||
RunLoop.main.run()
|
||||
|
||||
Reference in New Issue
Block a user