Skip to content
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
10 changes: 1 addition & 9 deletions GhosttyTabs.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,7 @@
F9000000A1B2C3D4E5F60718 /* GhosttyEnsureFocusWindowActivationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F9000001A1B2C3D4E5F60718 /* GhosttyEnsureFocusWindowActivationTests.swift */; };
FA000000A1B2C3D4E5F60718 /* WorkspaceStressProfileTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA000001A1B2C3D4E5F60718 /* WorkspaceStressProfileTests.swift */; };
A5008381 /* BrowserFindJavaScriptTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5008380 /* BrowserFindJavaScriptTests.swift */; };
A5008383 /* CommandPaletteSearchEngineTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5008382 /* CommandPaletteSearchEngineTests.swift */; };
AB169902A1B2C3D4E5F60718 /* UpdateQuarantineRepairTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB169903A1B2C3D4E5F60718 /* UpdateQuarantineRepairTests.swift */; };
AB169900A1B2C3D4E5F60718 /* UpdateQuarantineRepair.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB169901A1B2C3D4E5F60718 /* UpdateQuarantineRepair.swift */; };
A5008383 /* CommandPaletteSearchEngineTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5008382 /* CommandPaletteSearchEngineTests.swift */; };
DA7A10CA710E000000000003 /* Localizable.xcstrings in Resources */ = {isa = PBXBuildFile; fileRef = DA7A10CA710E000000000001 /* Localizable.xcstrings */; };
DA7A10CA710E000000000004 /* InfoPlist.xcstrings in Resources */ = {isa = PBXBuildFile; fileRef = DA7A10CA710E000000000002 /* InfoPlist.xcstrings */; };
A5001623 /* cmux.sdef in Resources */ = {isa = PBXBuildFile; fileRef = A5001622 /* cmux.sdef */; };
Expand Down Expand Up @@ -267,8 +265,6 @@
FA000001A1B2C3D4E5F60718 /* WorkspaceStressProfileTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WorkspaceStressProfileTests.swift; sourceTree = "<group>"; };
A5008380 /* BrowserFindJavaScriptTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BrowserFindJavaScriptTests.swift; sourceTree = "<group>"; };
A5008382 /* CommandPaletteSearchEngineTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommandPaletteSearchEngineTests.swift; sourceTree = "<group>"; };
AB169903A1B2C3D4E5F60718 /* UpdateQuarantineRepairTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UpdateQuarantineRepairTests.swift; sourceTree = "<group>"; };
AB169901A1B2C3D4E5F60718 /* UpdateQuarantineRepair.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Update/UpdateQuarantineRepair.swift; sourceTree = "<group>"; };
DA7A10CA710E000000000001 /* Localizable.xcstrings */ = {isa = PBXFileReference; lastKnownFileType = text.json.xcstrings; path = Localizable.xcstrings; sourceTree = "<group>"; };
DA7A10CA710E000000000002 /* InfoPlist.xcstrings */ = {isa = PBXFileReference; lastKnownFileType = text.json.xcstrings; path = InfoPlist.xcstrings; sourceTree = "<group>"; };
A5001622 /* cmux.sdef */ = {isa = PBXFileReference; lastKnownFileType = text.sdef; path = cmux.sdef; sourceTree = "<group>"; };
Expand Down Expand Up @@ -444,7 +440,6 @@
A5001221 /* UpdateTestSupport.swift */,
A5001224 /* UpdateTestURLProtocol.swift */,
A5001223 /* UpdateLogStore.swift */,
AB169901A1B2C3D4E5F60718 /* UpdateQuarantineRepair.swift */,
A5001217 /* UpdatePopoverView.swift */,
A5001218 /* UpdateTitlebarAccessory.swift */,
A5001219 /* WindowToolbarController.swift */,
Expand Down Expand Up @@ -524,7 +519,6 @@
FA000001A1B2C3D4E5F60718 /* WorkspaceStressProfileTests.swift */,
A5008380 /* BrowserFindJavaScriptTests.swift */,
A5008382 /* CommandPaletteSearchEngineTests.swift */,
AB169903A1B2C3D4E5F60718 /* UpdateQuarantineRepairTests.swift */,
970226F3C99D0D937CD00539 /* BrowserConfigTests.swift */,
58C7B1B978620BE162CC057E /* BrowserPanelTests.swift */,
02FC74F2C27127CC565B3E8C /* TerminalAndGhosttyTests.swift */,
Expand Down Expand Up @@ -737,7 +731,6 @@
A500120B /* UpdateTestSupport.swift in Sources */,
A500120E /* UpdateTestURLProtocol.swift in Sources */,
A500120D /* UpdateLogStore.swift in Sources */,
AB169900A1B2C3D4E5F60718 /* UpdateQuarantineRepair.swift in Sources */,
A5001207 /* UpdatePopoverView.swift in Sources */,
A5001208 /* UpdateTitlebarAccessory.swift in Sources */,
A5001209 /* WindowToolbarController.swift in Sources */,
Expand Down Expand Up @@ -785,7 +778,6 @@
FA000000A1B2C3D4E5F60718 /* WorkspaceStressProfileTests.swift in Sources */,
A5008381 /* BrowserFindJavaScriptTests.swift in Sources */,
A5008383 /* CommandPaletteSearchEngineTests.swift in Sources */,
AB169902A1B2C3D4E5F60718 /* UpdateQuarantineRepairTests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
21 changes: 0 additions & 21 deletions Sources/Update/UpdateDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -79,20 +79,6 @@ extension UpdateDriver: SPUUpdaterDelegate {
}
}

func updater(_ updater: SPUUpdater, willExtractUpdate item: SUAppcastItem) {
prepareQuarantineRepair(for: item.fileURL)
do {
let result = try UpdateQuarantineRepair.repairDownloadedArchiveIfNeeded(
hostName: UpdateQuarantineRepair.sparkleHostName(),
versionString: item.versionString,
dataURL: item.fileURL
)
logUpdateQuarantineRepair(stage: "download", result: result)
} catch {
UpdateLogStore.shared.append("quarantine repair download failed: \(error.localizedDescription)")
}
}

func updaterDidNotFindUpdate(_ updater: SPUUpdater, error: Error) {
viewModel.clearDetectedUpdate()
let nsError = error as NSError
Expand Down Expand Up @@ -125,13 +111,6 @@ extension UpdateDriver: SPUUpdaterDelegate {
}
}

private func logUpdateQuarantineRepair(stage: String, result: UpdateQuarantineRepairResult) {
let path = result.url?.path ?? "<not-found>"
let before = result.beforeRawValue ?? "<none>"
let after = result.afterRawValue ?? "<none>"
UpdateLogStore.shared.append("quarantine repair \(stage): \(result.outcome) path=\(path) before=\(before) after=\(after)")
}

private func describeNoUpdateFoundReason(_ reason: SPUNoUpdateFoundReason) -> String {
switch reason {
case .unknown:
Expand Down
27 changes: 0 additions & 27 deletions Sources/Update/UpdateDriver.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ class UpdateDriver: NSObject, SPUUserDriver {
private var pendingCheckTransition: DispatchWorkItem?
private var checkTimeoutWorkItem: DispatchWorkItem?
private var lastFeedURLString: String?
private var updateFileURLForQuarantineRepair: URL?
private var finishedExtractedUpdateQuarantineRepair: Bool = false

init(viewModel: UpdateViewModel, hostBundle _: Bundle) {
self.viewModel = viewModel
Expand Down Expand Up @@ -120,13 +118,11 @@ class UpdateDriver: NSObject, SPUUserDriver {
func showDownloadDidStartExtractingUpdate() {
UpdateLogStore.shared.append("show extraction started")
setState(.extracting(.init(progress: 0)))
maybeRepairExtractedUpdateQuarantine()
}

func showExtractionReceivedProgress(_ progress: Double) {
UpdateLogStore.shared.append(String(format: "show extraction progress: %.2f", progress))
setState(.extracting(.init(progress: progress)))
maybeRepairExtractedUpdateQuarantine()
}

func showReady(toInstallAndRelaunch reply: @escaping @Sendable (SPUUserUpdateChoice) -> Void) {
Expand Down Expand Up @@ -258,11 +254,6 @@ class UpdateDriver: NSObject, SPUUserDriver {
UpdateLogStore.shared.append("feed url resolved\(suffix): \(feedURLString)")
}

func prepareQuarantineRepair(for updateFileURL: URL?) {
updateFileURLForQuarantineRepair = updateFileURL
finishedExtractedUpdateQuarantineRepair = false
}

func formatErrorForLog(_ error: Error) -> String {
let nsError = error as NSError
var parts: [String] = ["\(nsError.domain)(\(nsError.code))"]
Expand Down Expand Up @@ -311,24 +302,6 @@ class UpdateDriver: NSObject, SPUUserDriver {
}
}

private func maybeRepairExtractedUpdateQuarantine() {
guard !finishedExtractedUpdateQuarantineRepair else { return }

do {
let result = try UpdateQuarantineRepair.repairExtractedApplicationIfNeeded(dataURL: updateFileURLForQuarantineRepair)
guard result.outcome != .notFound else { return }

finishedExtractedUpdateQuarantineRepair = true
let path = result.url?.path ?? "<not-found>"
let before = result.beforeRawValue ?? "<none>"
let after = result.afterRawValue ?? "<none>"
UpdateLogStore.shared.append("quarantine repair extracted-app: \(result.outcome) path=\(path) before=\(before) after=\(after)")
} catch {
finishedExtractedUpdateQuarantineRepair = true
UpdateLogStore.shared.append("quarantine repair extracted-app failed: \(error.localizedDescription)")
}
}

private func runOnMain(_ action: @escaping () -> Void) {
if Thread.isMainThread {
action()
Expand Down
Loading
Loading