diff --git a/AltKit/Extensions/Bundle+AltStore.swift b/AltKit/Extensions/Bundle+AltStore.swift index 37fe4374..c028b6bb 100644 --- a/AltKit/Extensions/Bundle+AltStore.swift +++ b/AltKit/Extensions/Bundle+AltStore.swift @@ -50,4 +50,9 @@ public extension Bundle let appGroup = self.appGroups.first { $0.contains(Bundle.baseAltStoreAppGroupID) } return appGroup } + + var completeInfoDictionary: [String : Any]? { + let infoPlistURL = self.infoPlistURL + return NSDictionary(contentsOf: infoPlistURL) as? [String : Any] + } } diff --git a/AltStore/Model/DatabaseManager.swift b/AltStore/Model/DatabaseManager.swift index 88d606ca..6a70c830 100644 --- a/AltStore/Model/DatabaseManager.swift +++ b/AltStore/Model/DatabaseManager.swift @@ -211,7 +211,7 @@ private extension DatabaseManager { let infoPlistURL = bundle.bundleURL.appendingPathComponent("Info.plist") - guard var infoDictionary = bundle.infoDictionary else { throw ALTError(.missingInfoPlist) } + guard var infoDictionary = bundle.completeInfoDictionary else { throw ALTError(.missingInfoPlist) } infoDictionary[kCFBundleIdentifierKey as String] = bundleID try (infoDictionary as NSDictionary).write(to: infoPlistURL) } diff --git a/AltStore/Operations/ResignAppOperation.swift b/AltStore/Operations/ResignAppOperation.swift index 314a59a1..f95b26d6 100644 --- a/AltStore/Operations/ResignAppOperation.swift +++ b/AltStore/Operations/ResignAppOperation.swift @@ -109,7 +109,7 @@ private extension ResignAppOperation { guard let identifier = bundle.bundleIdentifier else { throw ALTError(.missingAppBundle) } guard let profile = profiles[identifier] else { throw ALTError(.missingProvisioningProfile) } - guard var infoDictionary = bundle.infoDictionary else { throw ALTError(.missingInfoPlist) } + guard var infoDictionary = bundle.completeInfoDictionary else { throw ALTError(.missingInfoPlist) } infoDictionary[kCFBundleIdentifierKey as String] = profile.bundleIdentifier infoDictionary[Bundle.Info.altBundleID] = identifier @@ -148,7 +148,7 @@ private extension ResignAppOperation progress.becomeCurrent(withPendingUnitCount: 1) guard let appBundle = Bundle(url: appBundleURL) else { throw ALTError(.missingAppBundle) } - guard let infoDictionary = appBundle.infoDictionary else { throw ALTError(.missingInfoPlist) } + guard let infoDictionary = appBundle.completeInfoDictionary else { throw ALTError(.missingInfoPlist) } var allURLSchemes = infoDictionary[Bundle.Info.urlTypes] as? [[String: Any]] ?? []