From 31fe7fed8c187958c2e9f493385ac2f54e7cd4af Mon Sep 17 00:00:00 2001 From: mahee96 <47920326+mahee96@users.noreply.github.com> Date: Sun, 22 Feb 2026 04:11:25 +0530 Subject: [PATCH] bug-fix: appEx bundleID when bundleID is overridden, wasn't handled correctly in PR #1158 --- AltStore/Operations/ResignAppOperation.swift | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/AltStore/Operations/ResignAppOperation.swift b/AltStore/Operations/ResignAppOperation.swift index 6d5ca496..2ab37d4d 100644 --- a/AltStore/Operations/ResignAppOperation.swift +++ b/AltStore/Operations/ResignAppOperation.swift @@ -118,12 +118,13 @@ private extension ResignAppOperation { let progress = Progress.discreteProgress(totalUnitCount: 1) + let bundleIdentifier = context.bundleIdentifier let openURL = InstalledApp.openAppURL(for: app) 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 var infoDictionary = bundle.completeInfoDictionary else { throw ALTError(.missingInfoPlist) } @@ -194,7 +195,7 @@ private extension ResignAppOperation var allURLSchemes = infoDictionary[Bundle.Info.urlTypes] as? [[String: Any]] ?? [] let altstoreURLScheme = ["CFBundleTypeRole": "Editor", - "CFBundleURLName": identifier, + "CFBundleURLName": bundleIdentifier, "CFBundleURLSchemes": [openURL.scheme!]] as [String : Any] allURLSchemes.append(altstoreURLScheme) @@ -247,7 +248,7 @@ private extension ResignAppOperation } // Prepare app - try prepare(appBundle, additionalInfoDictionaryValues: additionalValues) + try prepare(appBundle, bundleID: bundleIdentifier, additionalInfoDictionaryValues: additionalValues) try self.removeMissingAppExtensionReferences(from: appBundle) if let directory = appBundle.builtInPlugInsURL, let enumerator = FileManager.default.enumerator(at: directory, includingPropertiesForKeys: nil, options: [.skipsSubdirectoryDescendants]) @@ -264,7 +265,8 @@ private extension ResignAppOperation #endif 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) } }