From c435d5ab50cbc94e7d8608e79bc7d7cebca86c2b Mon Sep 17 00:00:00 2001 From: Nindi Gill Date: Tue, 11 Jun 2024 22:28:39 +1000 Subject: [PATCH] Add macOS Sequoia support --- Mist/Model/AppIcon.swift | 3 ++- Mist/Model/CatalogType.swift | 25 +++++++++++++++---- Mist/Model/Firmware.swift | 4 ++- Mist/Model/Installer.swift | 4 ++- .../Settings/SettingsApplicationsView.swift | 1 + 5 files changed, 29 insertions(+), 8 deletions(-) diff --git a/Mist/Model/AppIcon.swift b/Mist/Model/AppIcon.swift index 8fadcef..76945fa 100644 --- a/Mist/Model/AppIcon.swift +++ b/Mist/Model/AppIcon.swift @@ -11,8 +11,9 @@ enum AppIcon: String, CaseIterable, Identifiable { case monterey = "Monterey" case ventura = "Ventura" case sonoma = "Sonoma" + case sequoia = "Sequoia" - static let `default`: AppIcon = .sonoma + static let `default`: AppIcon = .sequoia var id: String { rawValue diff --git a/Mist/Model/CatalogType.swift b/Mist/Model/CatalogType.swift index de94042..023566b 100644 --- a/Mist/Model/CatalogType.swift +++ b/Mist/Model/CatalogType.swift @@ -6,6 +6,7 @@ // enum CatalogType: String, CaseIterable, Comparable, Decodable { + case sequoia = "macOS Sequoia" case sonoma = "macOS Sonoma" case ventura = "macOS Ventura" case monterey = "macOS Monterey" @@ -21,14 +22,16 @@ enum CatalogType: String, CaseIterable, Comparable, Decodable { private var sortOrder: Int { switch self { - case .sonoma: + case .sequoia: 0 - case .ventura: + case .sonoma: 1 - case .monterey: + case .ventura: 2 - case .bigSur: + case .monterey: 3 + case .bigSur: + 4 } } @@ -36,9 +39,21 @@ enum CatalogType: String, CaseIterable, Comparable, Decodable { lhs.sortOrder < rhs.sortOrder } - // swiftlint:disable:next cyclomatic_complexity + // swiftlint:disable:next cyclomatic_complexity function_body_length func url(for seedType: CatalogSeedType) -> String { switch self { + case .sequoia: + switch seedType { + case .standard: + "https://swscan.apple.com/content/catalogs/others/index-15-14-13-12-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz" + case .customer: + // swiftlint:disable:next line_length + "https://swscan.apple.com/content/catalogs/others/index-15customerseed-15-14-13-12-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz" + case .developer: + "https://swscan.apple.com/content/catalogs/others/index-15seed-15-14-13-12-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz" + case .public: + "https://swscan.apple.com/content/catalogs/others/index-15beta-15-14-13-12-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz" + } case .sonoma: switch seedType { case .standard: diff --git a/Mist/Model/Firmware.swift b/Mist/Model/Firmware.swift index c6e4ebe..22690ac 100644 --- a/Mist/Model/Firmware.swift +++ b/Mist/Model/Firmware.swift @@ -51,7 +51,9 @@ struct Firmware: Decodable, Hashable, Identifiable { var name: String { var name: String = "" - if version.range(of: "^14", options: .regularExpression) != nil { + if version.range(of: "^15", options: .regularExpression) != nil { + name = "macOS Sequoia" + } else if version.range(of: "^14", options: .regularExpression) != nil { name = "macOS Sonoma" } else if version.range(of: "^13", options: .regularExpression) != nil { name = "macOS Ventura" diff --git a/Mist/Model/Installer.swift b/Mist/Model/Installer.swift index 67456d1..0a14eb7 100644 --- a/Mist/Model/Installer.swift +++ b/Mist/Model/Installer.swift @@ -655,7 +655,9 @@ struct Installer: Decodable, Hashable, Identifiable { var name: String { var name: String = "" - if version.range(of: "^14", options: .regularExpression) != nil { + if version.range(of: "^15", options: .regularExpression) != nil { + name = "macOS Sequoia" + } else if version.range(of: "^14", options: .regularExpression) != nil { name = "macOS Sonoma" } else if version.range(of: "^13", options: .regularExpression) != nil { name = "macOS Ventura" diff --git a/Mist/Views/Settings/SettingsApplicationsView.swift b/Mist/Views/Settings/SettingsApplicationsView.swift index 04803ad..84d97b8 100644 --- a/Mist/Views/Settings/SettingsApplicationsView.swift +++ b/Mist/Views/Settings/SettingsApplicationsView.swift @@ -10,6 +10,7 @@ import SwiftUI struct SettingsApplicationsView: View { private static let imageNames: [String] = [ + "Application - macOS Sequoia", "Application - macOS Sonoma", "Application - macOS Ventura", "Application - macOS Monterey",