[AltServer] Moves core ConnectionManager logic to AltKit

Refactors ConnectionManager to use arbitrary RequestHandlers and ConnectionHandlers. This allows the core AltServer request logic to be shared across different targets with different connection types.
This commit is contained in:
Riley Testut
2020-06-04 19:06:13 -07:00
parent 0b36214bb5
commit 70f897699c
23 changed files with 959 additions and 785 deletions

View File

@@ -0,0 +1,53 @@
//
// Bundle+AltStore.swift
// AltStore
//
// Created by Riley Testut on 5/30/19.
// Copyright © 2019 Riley Testut. All rights reserved.
//
import Foundation
public extension Bundle
{
struct Info
{
public static let deviceID = "ALTDeviceID"
public static let serverID = "ALTServerID"
public static let certificateID = "ALTCertificateID"
public static let appGroups = "ALTAppGroups"
public static let altBundleID = "ALTBundleIdentifier"
public static let urlTypes = "CFBundleURLTypes"
public static let exportedUTIs = "UTExportedTypeDeclarations"
}
}
public extension Bundle
{
static var baseAltStoreAppGroupID = "group.com.rileytestut.AltStore"
var infoPlistURL: URL {
let infoPlistURL = self.bundleURL.appendingPathComponent("Info.plist")
return infoPlistURL
}
var provisioningProfileURL: URL {
let infoPlistURL = self.bundleURL.appendingPathComponent("embedded.mobileprovision")
return infoPlistURL
}
var certificateURL: URL {
let infoPlistURL = self.bundleURL.appendingPathComponent("ALTCertificate.p12")
return infoPlistURL
}
var appGroups: [String] {
return self.infoDictionary?[Bundle.Info.appGroups] as? [String] ?? []
}
var altstoreAppGroup: String? {
let appGroup = self.appGroups.first { $0.contains(Bundle.baseAltStoreAppGroupID) }
return appGroup
}
}