[AltStore] Adds ALTAppGroup Info.plist entry for apps in app groups

This allows the apps to query at runtime what app groups they should actually use due to bundle identifiers changing.
This commit is contained in:
Riley Testut
2019-06-25 14:26:09 -07:00
parent 3537dd11b0
commit 84f564452b
2 changed files with 6 additions and 1 deletions

View File

@@ -13,6 +13,7 @@ public extension Bundle
struct Info struct Info
{ {
public static let deviceID = "ALTDeviceID" public static let deviceID = "ALTDeviceID"
public static let appGroups = "ALTAppGroups"
public static let urlTypes = "CFBundleURLTypes" public static let urlTypes = "CFBundleURLTypes"
} }

View File

@@ -409,6 +409,11 @@ private extension ResignAppOperation
infoDictionary[key] = value infoDictionary[key] = value
} }
if let appGroups = profile.entitlements[.appGroups] as? [String]
{
infoDictionary[Bundle.Info.appGroups] = appGroups
}
try (infoDictionary as NSDictionary).write(to: bundle.infoPlistURL) try (infoDictionary as NSDictionary).write(to: bundle.infoPlistURL)
} }
@@ -464,7 +469,6 @@ private extension ResignAppOperation
func resignAppBundle(at fileURL: URL, signer: ALTSigner, profiles: [ALTProvisioningProfile], completionHandler: @escaping (Result<URL, Error>) -> Void) -> Progress func resignAppBundle(at fileURL: URL, signer: ALTSigner, profiles: [ALTProvisioningProfile], completionHandler: @escaping (Result<URL, Error>) -> Void) -> Progress
{ {
let progress = signer.signApp(at: fileURL, provisioningProfiles: profiles) { (success, error) in let progress = signer.signApp(at: fileURL, provisioningProfiles: profiles) { (success, error) in
do do
{ {