bug-fix: appEx bundleID when bundleID is overridden, wasn't handled correctly in PR #1158

This commit is contained in:
mahee96
2026-02-22 04:11:25 +05:30
parent dbc20391e5
commit 31fe7fed8c

View File

@@ -118,12 +118,13 @@ private extension ResignAppOperation
{ {
let progress = Progress.discreteProgress(totalUnitCount: 1) let progress = Progress.discreteProgress(totalUnitCount: 1)
let bundleIdentifier = context.bundleIdentifier
let openURL = InstalledApp.openAppURL(for: app) let openURL = InstalledApp.openAppURL(for: app)
let fileURL = app.fileURL let fileURL = app.fileURL
let identifier = context.bundleIdentifier
func prepare(_ bundle: Bundle, additionalInfoDictionaryValues: [String: Any] = [:]) throws func prepare(_ bundle: Bundle, bundleID identifier: String?, additionalInfoDictionaryValues: [String: Any] = [:]) throws
{ {
guard let identifier else { throw ALTError(.missingAppBundle) }
guard let profile = context.useMainProfile ? profiles.values.first : 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) }
@@ -194,7 +195,7 @@ private extension ResignAppOperation
var allURLSchemes = infoDictionary[Bundle.Info.urlTypes] as? [[String: Any]] ?? [] var allURLSchemes = infoDictionary[Bundle.Info.urlTypes] as? [[String: Any]] ?? []
let altstoreURLScheme = ["CFBundleTypeRole": "Editor", let altstoreURLScheme = ["CFBundleTypeRole": "Editor",
"CFBundleURLName": identifier, "CFBundleURLName": bundleIdentifier,
"CFBundleURLSchemes": [openURL.scheme!]] as [String : Any] "CFBundleURLSchemes": [openURL.scheme!]] as [String : Any]
allURLSchemes.append(altstoreURLScheme) allURLSchemes.append(altstoreURLScheme)
@@ -247,7 +248,7 @@ private extension ResignAppOperation
} }
// Prepare app // Prepare app
try prepare(appBundle, additionalInfoDictionaryValues: additionalValues) try prepare(appBundle, bundleID: bundleIdentifier, additionalInfoDictionaryValues: additionalValues)
try self.removeMissingAppExtensionReferences(from: appBundle) try self.removeMissingAppExtensionReferences(from: appBundle)
if let directory = appBundle.builtInPlugInsURL, let enumerator = FileManager.default.enumerator(at: directory, includingPropertiesForKeys: nil, options: [.skipsSubdirectoryDescendants]) if let directory = appBundle.builtInPlugInsURL, let enumerator = FileManager.default.enumerator(at: directory, includingPropertiesForKeys: nil, options: [.skipsSubdirectoryDescendants])
@@ -264,7 +265,8 @@ private extension ResignAppOperation
#endif #endif
guard let appExtension = Bundle(url: fileURL) else { throw ALTError(.missingAppBundle) } guard let appExtension = Bundle(url: fileURL) else { throw ALTError(.missingAppBundle) }
try prepare(appExtension) let updatedAppExBundleId = appExtension.bundleIdentifier?.replacingOccurrences(of: app.bundleIdentifier, with: bundleIdentifier)
try prepare(appExtension, bundleID: updatedAppExBundleId)
} }
} }