From 0f939700e2d04fbfca69baad8b95242a499de19a Mon Sep 17 00:00:00 2001 From: Riley Testut Date: Tue, 31 Mar 2020 14:33:13 -0700 Subject: [PATCH] Fixes potentially incorrect bundle identifier when resigning AltStore with DEBUG build --- .../FetchProvisioningProfilesOperation.swift | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/AltStore/Operations/FetchProvisioningProfilesOperation.swift b/AltStore/Operations/FetchProvisioningProfilesOperation.swift index 9c8a9f0e..98dd8849 100644 --- a/AltStore/Operations/FetchProvisioningProfilesOperation.swift +++ b/AltStore/Operations/FetchProvisioningProfilesOperation.swift @@ -123,6 +123,10 @@ extension FetchProvisioningProfilesOperation let predicate = NSPredicate(format: "%K == %@", #keyPath(InstalledApp.bundleIdentifier), app.bundleIdentifier) if let installedApp = InstalledApp.first(satisfying: predicate, in: context) { + // Teams match if installedApp.team has same identifier as team, + // or if installedApp.team is nil but resignedBundleIdentifier contains the team's identifier. + let teamsMatch = installedApp.team?.identifier == team.identifier || (installedApp.team == nil && installedApp.resignedBundleIdentifier.contains(team.identifier)) + #if DEBUG if app.bundleIdentifier == StoreApp.altstoreAppID || app.bundleIdentifier == StoreApp.alternativeAltStoreAppID @@ -132,15 +136,11 @@ extension FetchProvisioningProfilesOperation } else { - preferredBundleID = installedApp.resignedBundleIdentifier + preferredBundleID = teamsMatch ? installedApp.resignedBundleIdentifier : nil } #else - // Teams match if installedApp.team has same identifier as team, - // or if installedApp.team is nil but resignedBundleIdentifier contains the team's identifier. - let teamsMatch = installedApp.team?.identifier == team.identifier || (installedApp.team == nil && installedApp.resignedBundleIdentifier.contains(team.identifier)) - if teamsMatch { // This app is already installed with the same team, so use the same resigned bundle identifier as before.