[AltServer] Prefers revoking existing AltStore certificate (if it exists)

This commit is contained in:
Riley Testut
2021-10-04 15:45:16 -07:00
parent 35ae81c76c
commit 5231ea1c1e

View File

@@ -346,7 +346,8 @@ private extension ALTDeviceManager
var isCancelled = false
// Check if there is another AltStore certificate, which means AltStore has been installed with this Apple ID before.
if let previousCertificate = certificates.first(where: { $0.machineName?.starts(with: "AltStore") == true })
let altstoreCertificate = certificates.first { $0.machineName?.starts(with: "AltStore") == true }
if let previousCertificate = altstoreCertificate
{
if FileManager.default.fileExists(atPath: certificateFileURL.path),
let data = try? Data(contentsOf: certificateFileURL),
@@ -419,7 +420,7 @@ private extension ALTDeviceManager
}
}
if let certificate = certificates.first
if let certificate = altstoreCertificate ?? certificates.first
{
if team.type != .free
{