Skip to content

armgit / peel

Public Imported from GitHub
0

Uninstall Mac apps with every file they leave behind, and see why each belongs. Free up space, fine-tune macOS, and set up Terminal.

List the update Google's updater keeps for each app

Țugui Dragoșb61372c6ebf4
diff --git a/GUIDE.md b/GUIDE.md
index 25530598..e4691487 100644
--- a/GUIDE.md
+++ b/GUIDE.md
@@ -81,9 +81,9 @@ Space shows what fills your disk, area by area, and what each area is.
<br>
**Developer:** the caches of Xcode, package managers, build systems, editors, cloud and virtual machine tools, game
-engines, and AI models. It also lists the graphics caches of Chrome, Chromium, Brave, and Opera, the web caches of
-apps built on Electron, such as Slack or Discord, and the browser profiles a Playwright run left in the temporary
-folder when it ended early. It never lists what a browser or an app keeps for you, a profile a browser still has
+engines, and AI models. It also lists the graphics caches of Chrome, Chromium, Brave, and Opera, the last update
+Google's updater downloaded for each of its apps, the web caches of apps built on Electron, such as Slack or Discord,
+and the browser profiles a Playwright run left in the temporary folder when it ended early. It never lists what a browser or an app keeps for you, a profile a browser still has
open, a toolchain, or anything holding an account.
Some of what it lists you may want again, so Select Recommended passes it by: Xcode's archives and the symbols it
diff --git a/Packages/PeelCore/Sources/PeelCore/Developer/DeveloperCaches.swift b/Packages/PeelCore/Sources/PeelCore/Developer/DeveloperCaches.swift
index c97df8d4..36b6bd24 100644
--- a/Packages/PeelCore/Sources/PeelCore/Developer/DeveloperCaches.swift
+++ b/Packages/PeelCore/Sources/PeelCore/Developer/DeveloperCaches.swift
@@ -1052,6 +1052,16 @@ public enum DeveloperCaches {
chromiumFolders(in: "Library/Application Support/Google/\($0)")
}
),
+ // Google's updater, which keeps Chrome and Google's other apps up to date, keeps the last update it downloaded
+ // for each app, and only that one (Chromium's `components/update_client/crx_cache.h`), in `crx_cache` inside
+ // its own folder, `Application Support/<company>/<product>` (`chrome/updater/util/mac_path_util.mm`).
+ Definition(
+ id: "googleupdater", name: "Google Updater", systemImage: "shippingbox",
+ appBundleIdentifiers: ["com.google.GoogleUpdater"],
+ folders: [
+ Folder("Library/Application Support/Google/GoogleUpdater/crx_cache", .downloads, source: "https://github.com/chromium/chromium/blob/54cc36437b23cee8aaffa1289c8bc31bf2f520b9/chrome/updater/util/util.cc#L112-L115"),
+ ]
+ ),
Definition(
id: "chromium", name: "Chromium", systemImage: "globe", appBundleIdentifiers: ["org.chromium.Chromium"],
folders: chromiumFolders(in: "Library/Application Support/Chromium")
diff --git a/Packages/PeelCore/Tests/PeelCoreTests/DeveloperCachesTests.swift b/Packages/PeelCore/Tests/PeelCoreTests/DeveloperCachesTests.swift
index 934f3c17..f2ac9366 100644
--- a/Packages/PeelCore/Tests/PeelCoreTests/DeveloperCachesTests.swift
+++ b/Packages/PeelCore/Tests/PeelCoreTests/DeveloperCachesTests.swift
@@ -1023,6 +1023,22 @@ struct DeveloperCachesTests {
#expect(Set(locations.map(\.url.lastPathComponent)) == ["cache", "build-cache"])
}
+ @Test func offersTheUpdatesGooglesUpdaterKeptAndNothingElseOfItsFolder() async throws {
+ let directory = try TemporaryDirectory()
+ let updater = "Library/Application Support/Google/GoogleUpdater"
+ try directory.file("\(updater)/crx_cache/1a7aef6023dd1d6f6d25ae2ff53a9d2956498bb8", bytes: 400_000)
+ try directory.file("\(updater)/crx_cache/metadata.json", bytes: 130)
+ try directory.file("\(updater)/156.0.8067.0/GoogleUpdater.app/Contents/MacOS/GoogleUpdater", bytes: 400_000)
+ try directory.file("\(updater)/prefs.json", bytes: 4_096)
+ try directory.file("\(updater)/updater.log", bytes: 4_096)
+ let googleUpdater = DeveloperCaches.definitions.filter { $0.id == "googleupdater" }
+
+ let locations = await DeveloperCaches.scan(googleUpdater, homeDirectory: directory.url).flatMap(\.locations)
+
+ #expect(locations.map(\.url.lastPathComponent) == ["crx_cache"])
+ #expect(googleUpdater.first?.appBundleIdentifiers == ["com.google.GoogleUpdater"])
+ }
+
@Test func offersTheImagesTartKeepsAndNeverItsMachines() async throws {
let directory = try TemporaryDirectory()
try directory.file(".tart/cache/OCIs/ghcr.io/cirruslabs/macos/disk.img", bytes: 400_000)