From 683307b9af1aba7d04699da422c23ce249c7c6f3 Mon Sep 17 00:00:00 2001 From: Riley Testut Date: Mon, 4 Oct 2021 15:51:58 -0700 Subject: [PATCH] Prefers revoking existing AltStore certificate (if it exists) --- AltStore/Operations/AuthenticationOperation.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AltStore/Operations/AuthenticationOperation.swift b/AltStore/Operations/AuthenticationOperation.swift index d0055950..6c717ea9 100644 --- a/AltStore/Operations/AuthenticationOperation.swift +++ b/AltStore/Operations/AuthenticationOperation.swift @@ -507,7 +507,7 @@ private extension AuthenticationOperation func replaceCertificate(from certificates: [ALTCertificate]) { - guard let certificate = certificates.first else { return completionHandler(.failure(AuthenticationError.noCertificate)) } + guard let certificate = certificates.first(where: { $0.machineName?.starts(with: "AltStore") == true }) ?? certificates.first else { return completionHandler(.failure(AuthenticationError.noCertificate)) } ALTAppleAPI.shared.revoke(certificate, for: team, session: session) { (success, error) in if let error = error, !success