mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-08 22:33:26 +01:00
Add option for using main bundle's profile for app extensions, update AltSign & libmd (#1012)
This commit is contained in:
2
.gitmodules
vendored
2
.gitmodules
vendored
@@ -30,7 +30,7 @@
|
|||||||
url = https://github.com/rileytestut/Roxas.git
|
url = https://github.com/rileytestut/Roxas.git
|
||||||
[submodule "Dependencies/libimobiledevice"]
|
[submodule "Dependencies/libimobiledevice"]
|
||||||
path = Dependencies/libimobiledevice
|
path = Dependencies/libimobiledevice
|
||||||
url = https://github.com/libimobiledevice/libimobiledevice
|
url = https://github.com/SideStore/libimobiledevice
|
||||||
[submodule "Dependencies/libusbmuxd"]
|
[submodule "Dependencies/libusbmuxd"]
|
||||||
path = Dependencies/libusbmuxd
|
path = Dependencies/libusbmuxd
|
||||||
url = https://github.com/libimobiledevice/libusbmuxd.git
|
url = https://github.com/libimobiledevice/libusbmuxd.git
|
||||||
|
|||||||
@@ -4158,8 +4158,8 @@
|
|||||||
isa = XCRemoteSwiftPackageReference;
|
isa = XCRemoteSwiftPackageReference;
|
||||||
repositoryURL = "https://github.com/SwiftPackageIndex/SemanticVersion";
|
repositoryURL = "https://github.com/SwiftPackageIndex/SemanticVersion";
|
||||||
requirement = {
|
requirement = {
|
||||||
kind = upToNextMajorVersion;
|
kind = exactVersion;
|
||||||
minimumVersion = 0.4.0;
|
version = 0.4.0;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
A8B645FD2D70C1AD00125819 /* XCRemoteSwiftPackageReference "MarkdownKit" */ = {
|
A8B645FD2D70C1AD00125819 /* XCRemoteSwiftPackageReference "MarkdownKit" */ = {
|
||||||
|
|||||||
@@ -1519,6 +1519,24 @@ private extension AppManager
|
|||||||
patchAppOperation.addDependency(deactivateAppsOperation)
|
patchAppOperation.addDependency(deactivateAppsOperation)
|
||||||
|
|
||||||
|
|
||||||
|
let modifyAppExBundleIdOperation = RSTAsyncBlockOperation { operation in
|
||||||
|
if !context.useMainProfile {
|
||||||
|
operation.finish()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if let app = context.app, let profile = context.provisioningProfiles?[app.bundleIdentifier] {
|
||||||
|
var appexBundleIds: [String: String] = [:]
|
||||||
|
for appex in app.appExtensions {
|
||||||
|
appexBundleIds[appex.bundleIdentifier] = appex.bundleIdentifier.replacingOccurrences(of: app.bundleIdentifier, with: profile.bundleIdentifier)
|
||||||
|
}
|
||||||
|
context.appexBundleIds = appexBundleIds
|
||||||
|
}
|
||||||
|
operation.finish()
|
||||||
|
|
||||||
|
}
|
||||||
|
modifyAppExBundleIdOperation.addDependency(fetchProvisioningProfilesOperation)
|
||||||
|
|
||||||
/* Resign */
|
/* Resign */
|
||||||
let resignAppOperation = ResignAppOperation(context: context)
|
let resignAppOperation = ResignAppOperation(context: context)
|
||||||
resignAppOperation.resultHandler = { (result) in
|
resignAppOperation.resultHandler = { (result) in
|
||||||
@@ -1533,6 +1551,7 @@ private extension AppManager
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
resignAppOperation.addDependency(patchAppOperation)
|
resignAppOperation.addDependency(patchAppOperation)
|
||||||
|
resignAppOperation.addDependency(modifyAppExBundleIdOperation)
|
||||||
progress.addChild(resignAppOperation.progress, withPendingUnitCount: 20)
|
progress.addChild(resignAppOperation.progress, withPendingUnitCount: 20)
|
||||||
|
|
||||||
|
|
||||||
@@ -1586,6 +1605,7 @@ private extension AppManager
|
|||||||
patchAppOperation,
|
patchAppOperation,
|
||||||
refreshAnisetteDataOperation,
|
refreshAnisetteDataOperation,
|
||||||
fetchProvisioningProfilesOperation,
|
fetchProvisioningProfilesOperation,
|
||||||
|
modifyAppExBundleIdOperation,
|
||||||
resignAppOperation,
|
resignAppOperation,
|
||||||
sendAppOperation,
|
sendAppOperation,
|
||||||
installOperation
|
installOperation
|
||||||
|
|||||||
@@ -67,20 +67,22 @@ class FetchProvisioningProfilesOperation: ResultOperation<[String: ALTProvisioni
|
|||||||
|
|
||||||
let dispatchGroup = DispatchGroup()
|
let dispatchGroup = DispatchGroup()
|
||||||
|
|
||||||
for appExtension in app.appExtensions
|
if !self.context.useMainProfile {
|
||||||
{
|
for appExtension in app.appExtensions
|
||||||
dispatchGroup.enter()
|
{
|
||||||
|
dispatchGroup.enter()
|
||||||
self.prepareProvisioningProfile(for: appExtension, parentApp: app, team: team, session: session) { (result) in
|
|
||||||
switch result
|
self.prepareProvisioningProfile(for: appExtension, parentApp: app, team: team, session: session) { (result) in
|
||||||
{
|
switch result
|
||||||
case .failure(let e): error = e
|
{
|
||||||
case .success(let profile): profiles[appExtension.bundleIdentifier] = profile
|
case .failure(let e): error = e
|
||||||
|
case .success(let profile): profiles[appExtension.bundleIdentifier] = profile
|
||||||
|
}
|
||||||
|
|
||||||
|
dispatchGroup.leave()
|
||||||
|
|
||||||
|
self.progress.completedUnitCount += 1
|
||||||
}
|
}
|
||||||
|
|
||||||
dispatchGroup.leave()
|
|
||||||
|
|
||||||
self.progress.completedUnitCount += 1
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -66,6 +66,8 @@ class AppOperationContext
|
|||||||
|
|
||||||
var app: ALTApplication?
|
var app: ALTApplication?
|
||||||
var provisioningProfiles: [String: ALTProvisioningProfile]?
|
var provisioningProfiles: [String: ALTProvisioningProfile]?
|
||||||
|
var appexBundleIds: [String: String]?
|
||||||
|
var useMainProfile = false
|
||||||
|
|
||||||
var isFinished = false
|
var isFinished = false
|
||||||
|
|
||||||
|
|||||||
@@ -136,7 +136,11 @@ final class RemoveAppExtensionsOperation: ResultOperation<Void>
|
|||||||
alertController.addAction(UIAlertAction(title: UIAlertAction.cancel.title, style: UIAlertAction.cancel.style, handler: { (action) in
|
alertController.addAction(UIAlertAction(title: UIAlertAction.cancel.title, style: UIAlertAction.cancel.style, handler: { (action) in
|
||||||
self.finish(.failure(OperationError.cancelled))
|
self.finish(.failure(OperationError.cancelled))
|
||||||
}))
|
}))
|
||||||
alertController.addAction(UIAlertAction(title: NSLocalizedString("Keep App Extensions", comment: ""), style: .default) { (action) in
|
alertController.addAction(UIAlertAction(title: NSLocalizedString("Keep App Extensions (Use Main Profile)", comment: ""), style: .default) { (action) in
|
||||||
|
self.context.useMainProfile = true
|
||||||
|
self.finish(.success(()))
|
||||||
|
})
|
||||||
|
alertController.addAction(UIAlertAction(title: NSLocalizedString("Keep App Extensions (Register App ID for Each Extension)", comment: ""), style: .default) { (action) in
|
||||||
self.finish(.success(()))
|
self.finish(.success(()))
|
||||||
})
|
})
|
||||||
alertController.addAction(UIAlertAction(title: NSLocalizedString("Remove App Extensions", comment: ""), style: .destructive) { (action) in
|
alertController.addAction(UIAlertAction(title: NSLocalizedString("Remove App Extensions", comment: ""), style: .destructive) { (action) in
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ final class ResignAppOperation: ResultOperation<ALTApplication>
|
|||||||
let prepareAppProgress = Progress.discreteProgress(totalUnitCount: 2)
|
let prepareAppProgress = Progress.discreteProgress(totalUnitCount: 2)
|
||||||
self.progress.addChild(prepareAppProgress, withPendingUnitCount: 3)
|
self.progress.addChild(prepareAppProgress, withPendingUnitCount: 3)
|
||||||
|
|
||||||
let prepareAppBundleProgress = self.prepareAppBundle(for: app, profiles: profiles) { (result) in
|
let prepareAppBundleProgress = self.prepareAppBundle(for: app, profiles: profiles, appexBundleIds: context.appexBundleIds ?? [:]) { (result) in
|
||||||
guard let appBundleURL = self.process(result) else { return }
|
guard let appBundleURL = self.process(result) else { return }
|
||||||
|
|
||||||
// Resign app bundle
|
// Resign app bundle
|
||||||
@@ -107,7 +107,7 @@ final class ResignAppOperation: ResultOperation<ALTApplication>
|
|||||||
|
|
||||||
private extension ResignAppOperation
|
private extension ResignAppOperation
|
||||||
{
|
{
|
||||||
func prepareAppBundle(for app: ALTApplication, profiles: [String: ALTProvisioningProfile], completionHandler: @escaping (Result<URL, Error>) -> Void) -> Progress
|
func prepareAppBundle(for app: ALTApplication, profiles: [String: ALTProvisioningProfile], appexBundleIds: [String: String], completionHandler: @escaping (Result<URL, Error>) -> Void) -> Progress
|
||||||
{
|
{
|
||||||
let progress = Progress.discreteProgress(totalUnitCount: 1)
|
let progress = Progress.discreteProgress(totalUnitCount: 1)
|
||||||
|
|
||||||
@@ -119,10 +119,15 @@ private extension ResignAppOperation
|
|||||||
func prepare(_ bundle: Bundle, additionalInfoDictionaryValues: [String: Any] = [:]) throws
|
func prepare(_ bundle: Bundle, additionalInfoDictionaryValues: [String: Any] = [:]) throws
|
||||||
{
|
{
|
||||||
guard let identifier = bundle.bundleIdentifier else { throw ALTError(.missingAppBundle) }
|
guard let identifier = bundle.bundleIdentifier else { throw ALTError(.missingAppBundle) }
|
||||||
guard let profile = profiles[identifier] else { throw ALTError(.missingProvisioningProfile) }
|
guard let profile = context.useMainProfile ? profiles.values.first : profiles[identifier] else { throw ALTError(.missingProvisioningProfile) }
|
||||||
guard var infoDictionary = bundle.completeInfoDictionary else { throw ALTError(.missingInfoPlist) }
|
guard var infoDictionary = bundle.completeInfoDictionary else { throw ALTError(.missingInfoPlist) }
|
||||||
|
|
||||||
infoDictionary[kCFBundleIdentifierKey as String] = profile.bundleIdentifier
|
if let forcedBundleIdentifier = appexBundleIds[identifier] {
|
||||||
|
infoDictionary[kCFBundleIdentifierKey as String] = forcedBundleIdentifier
|
||||||
|
} else {
|
||||||
|
infoDictionary[kCFBundleIdentifierKey as String] = profile.bundleIdentifier
|
||||||
|
}
|
||||||
|
|
||||||
infoDictionary[Bundle.Info.altBundleID] = identifier
|
infoDictionary[Bundle.Info.altBundleID] = identifier
|
||||||
infoDictionary[Bundle.Info.devicePairingString] = "<insert pairing file here>"
|
infoDictionary[Bundle.Info.devicePairingString] = "<insert pairing file here>"
|
||||||
infoDictionary.removeValue(forKey: "DTXcode")
|
infoDictionary.removeValue(forKey: "DTXcode")
|
||||||
|
|||||||
2
Dependencies/libimobiledevice
vendored
2
Dependencies/libimobiledevice
vendored
Submodule Dependencies/libimobiledevice updated: 04c023317f...e7cc53a65b
Submodule SideStore/AltSign updated: 5c278001cc...963066f3a6
Reference in New Issue
Block a user