From 7970258d50ae573efb2dd632e36e458d65612a4a Mon Sep 17 00:00:00 2001 From: Riley Testut Date: Mon, 20 Mar 2023 18:52:16 -0500 Subject: [PATCH] =?UTF-8?q?Fixes=20=E2=80=9Cno=20provisioning=20profile=20?= =?UTF-8?q?with=20the=20requested=20identifier=E2=80=A6=E2=80=9D=20error?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As of March 20, 2023, deleting an app’s auto-generated free provisioning profile is no longer supported. However, fetching the provisioning profile now re-generates is every time, so there’s no need to delete it first. As a workaround, we now simply use the first profile we fetched if we receive an error when deleting it. This approach should continue to work even if Apple later reverses this change. --- .../Operations/FetchProvisioningProfilesOperation.swift | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/AltStore/Operations/FetchProvisioningProfilesOperation.swift b/AltStore/Operations/FetchProvisioningProfilesOperation.swift index c3c015f5..a23eaeb5 100644 --- a/AltStore/Operations/FetchProvisioningProfilesOperation.swift +++ b/AltStore/Operations/FetchProvisioningProfilesOperation.swift @@ -478,10 +478,13 @@ extension FetchProvisioningProfilesOperation ALTAppleAPI.shared.delete(profile, for: team, session: session) { (success, error) in switch Result(success, error) { - case .failure(let error): completionHandler(.failure(error)) - case .success: + case .failure: + // As of March 20, 2023, the free provisioning profile is re-generated each fetch, and you can no longer delete it. + // So instead, we just return the fetched profile from above. + completionHandler(.success(profile)) - // Fetch new provisiong profile + case .success: + // Fetch new provisioning profile ALTAppleAPI.shared.fetchProvisioningProfile(for: appID, deviceType: .iphone, team: team, session: session) { (profile, error) in completionHandler(Result(profile, error)) }