10000 Add patchable cryptex disk image handling by pennig · Pull Request #430 · XcodesOrg/xcodes · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add patchable cryptex disk image handling #430

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Sources/XcodesKit/Models+Runtimes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ extension DownloadableRuntime {
case diskImage = "diskImage"
case package = "package"
case cryptexDiskImage = "cryptexDiskImage"
case patchableCryptexDiskImage = "patchableCryptexDiskImage"
}

enum Platform: String, Decodable {
Expand Down Expand Up @@ -133,6 +134,7 @@ extension InstalledRuntime {
case cryptexDiskImage = "Cryptex Disk Image"
case diskImage = "Disk Image"
case legacyDownload = "Legacy Download"
case patchableCryptexDiskImage = "Patchable Cryptex Disk Image"
}

enum Platform: String, Decodable {
Expand Down
21 changes: 12 additions & 9 deletions Sources/XcodesKit/RuntimeInstaller.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class RuntimeInstaller {
betaNumber: downloadable.betaNumber,
version: downloadable.simulatorVersion.version,
build: downloadable.simulatorVersion.buildUpdate,
state: $0.kind))
kind: $0.kind))
}
} else {
mappedRuntimes.append(PrintableRuntime(platform: downloadable.platform,
Expand All @@ -47,7 +47,7 @@ public class RuntimeInstaller {
betaNumber: resolvedBetaNumber,
version: runtime.version,
build: runtime.build,
state: runtime.kind)
kind: runtime.kind)

mappedRuntimes.indices {
result.visibleIdentifier == $0.visibleIdentifier
Expand All @@ -71,17 +71,20 @@ public class RuntimeInstaller {
}

for runtime in sortedRuntimes {
if !includeBetas && runtime.betaNumber != nil && runtime.state == nil {
if !includeBetas && runtime.betaNumber != nil && runtime.kind == nil {
continue
}
var str = runtime.visibleIdentifier
if runtime.hasDuplicateVersion {
str += " (\(runtime.build))"
}
if runtime.state == .legacyDownload || runtime.state == .diskImage || runtime.state == .cryptexDiskImage {
str += " (Installed)"
} else if runtime.state == .bundled {
str += " (Bundled with selected Xcode)"
if let kind = runtime.kind {
switch kind {
case .bundled:
str += " (Bundled with selected Xcode)"
case .legacyDownload, .diskImage, .cryptexDiskImage, .patchableCryptexDiskImage:
str += " (Installed)"
}
}
Current.logging.log(str)
}
Expand Down Expand Up @@ -118,7 +121,7 @@ public class RuntimeInstaller {
let dmgUrl = try await downloadOrUseExistingArchive(runtime: matchedRuntime, to: destinationDirectory, downloader: downloader)
try await installFromImage(dmgUrl: dmgUrl)
deleteIfNeeded(dmgUrl)
case .cryptexDiskImage:
case .cryptexDiskImage, .patchableCryptexDiskImage:
try await downloadAndInstallUsingXcodeBuild(runtime: matchedRuntime)
}
}
Expand Down Expand Up @@ -379,7 +382,7 @@ fileprivate struct PrintableRuntime {
let betaNumber: Int?
let version: String
let build: String
var state: InstalledRuntime.Kind? = nil
var kind: InstalledRuntime.Kind? = nil
var hasDuplicateVersion = false

var completeVersion: String {
Expand Down
Loading
0