Add macOS Sequoia support

This commit is contained in:
Nindi Gill 2024-06-11 22:28:39 +10:00
parent de3c7b5570
commit c435d5ab50
No known key found for this signature in database
5 changed files with 29 additions and 8 deletions

View file

@ -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

View file

@ -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:

View file

@ -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"

View file

@ -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"

View file

@ -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",