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.

Leave an app's audio plug-ins unselected, since other apps load them

Țugui Dragoșfbda82cba7d8
diff --git a/Localization/Peel/Localizable.xcstrings b/Localization/Peel/Localizable.xcstrings
index 3e63c658..d62213eb 100644
--- a/Localization/Peel/Localizable.xcstrings
+++ b/Localization/Peel/Localizable.xcstrings
@@ -105936,6 +105936,113 @@
}
}
},
+ "Not selected: other apps can load it on their own, such as music apps." : {
+ "comment" : "Why an audio plug-in (Audio Unit, VST, VST3, CLAP, AAX or MAS) an app left is listed and not selected: music apps and other hosts load such plug-ins by themselves, whatever became of the app. A click still selects it.",
+ "localizations" : {
+ "cs" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Nevybráno: mohou ho samy načítat jiné aplikace, například hudební aplikace."
+ }
+ },
+ "de" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Nicht ausgewählt: Andere Apps, etwa Musik-Apps, können es von sich aus laden."
+ }
+ },
+ "es" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Sin seleccionar: otras apps, como las de música, pueden cargarlo por su cuenta."
+ }
+ },
+ "fr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Non sélectionné : d’autres apps peuvent le charger d’elles-mêmes, comme les apps de musique."
+ }
+ },
+ "it" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Non selezionato: altre app, come le app musicali, possono caricarlo da sole."
+ }
+ },
+ "ja" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "未選択: 音楽アプリなど、ほかのアプリがこれを独自に読み込む場合があります。"
+ }
+ },
+ "ko" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "선택되지 않음: 음악 앱 등 다른 앱이 이 항목을 자체적으로 로드할 수 있습니다."
+ }
+ },
+ "nl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Niet geselecteerd: andere apps, zoals muziekapps, kunnen het zelf laden."
+ }
+ },
+ "pl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Nie zaznaczono: inne aplikacje, na przykład aplikacje muzyczne, mogą wczytywać ją samodzielnie."
+ }
+ },
+ "pt" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Não selecionado: outros apps podem carregá-lo por conta própria, como os apps de música."
+ }
+ },
+ "ro" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Neselectat: alte aplicații, cum ar fi cele de muzică, îl pot încărca singure."
+ }
+ },
+ "ru" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Не выбрано: другие приложения, например музыкальные, могут загружать его сами."
+ }
+ },
+ "sv" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Inte markerad: andra appar, till exempel musikappar, kan läsa in den på egen hand."
+ }
+ },
+ "tr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Seçilmedi: müzik uygulamaları gibi başka uygulamalar onu kendi başlarına yükleyebilir."
+ }
+ },
+ "uk" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Не вибрано: інші програми, як-от музичні, можуть завантажувати його самостійно."
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "未选择:其他App(例如音乐App)可以自行载入它。"
+ }
+ },
+ "zh-Hant" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "未選取:其他App(例如音樂App)可以自行載入它。"
+ }
+ }
+ }
+ },
"Not selected: reading which files Git tracks here took too long, so this folder may be part of the project. Rescan to try again." : {
"comment" : "The note beside a row in Build Artifacts. Peel reads Git's own list of the files it tracks, and that read ran out of time. Rescan is the toolbar button that scans the page again.",
"localizations" : {
@@ -117825,6 +117932,113 @@
}
}
},
+ "Other apps can load these on their own, such as music apps" : {
+ "comment" : "Why Peel is unsure a group of orphaned files is unused: it holds an audio plug-in, which music apps and other hosts load by themselves.",
+ "localizations" : {
+ "cs" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Mohou je samy načítat jiné aplikace, například hudební aplikace"
+ }
+ },
+ "de" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Andere Apps, etwa Musik-Apps, können diese von sich aus laden"
+ }
+ },
+ "es" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Otras apps, como las de música, pueden cargarlos por su cuenta"
+ }
+ },
+ "fr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "D’autres apps peuvent charger ces fichiers d’elles-mêmes, comme les apps de musique"
+ }
+ },
+ "it" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Altre app, come le app musicali, possono caricarli da sole"
+ }
+ },
+ "ja" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "音楽アプリなど、ほかのアプリがこれらを独自に読み込む場合があります"
+ }
+ },
+ "ko" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "음악 앱 등 다른 앱이 이 항목들을 자체적으로 로드할 수 있음"
+ }
+ },
+ "nl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Andere apps, zoals muziekapps, kunnen deze zelf laden"
+ }
+ },
+ "pl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Inne aplikacje, na przykład aplikacje muzyczne, mogą wczytywać je samodzielnie"
+ }
+ },
+ "pt" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Outros apps podem carregá-los por conta própria, como os apps de música"
+ }
+ },
+ "ro" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Alte aplicații, cum ar fi cele de muzică, le pot încărca singure"
+ }
+ },
+ "ru" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Другие приложения, например музыкальные, могут загружать их сами"
+ }
+ },
+ "sv" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Andra appar, till exempel musikappar, kan läsa in de här på egen hand"
+ }
+ },
+ "tr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Müzik uygulamaları gibi başka uygulamalar bunları kendi başlarına yükleyebilir"
+ }
+ },
+ "uk" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Інші програми, як-от музичні, можуть завантажувати їх самостійно"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "其他App(例如音乐App)可以自行载入这些项目"
+ }
+ },
+ "zh-Hant" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "其他App(例如音樂App)可以自行載入這些項目"
+ }
+ }
+ }
+ },
"Outside the app, Peel found nothing that belongs to this package alone." : {
"localizations" : {
"cs" : {
diff --git a/Packages/PeelCore/Sources/PeelCommandLine/Support/Output.swift b/Packages/PeelCore/Sources/PeelCommandLine/Support/Output.swift
index a37f631e..41626242 100644
--- a/Packages/PeelCore/Sources/PeelCommandLine/Support/Output.swift
+++ b/Packages/PeelCore/Sources/PeelCommandLine/Support/Output.swift
@@ -389,6 +389,7 @@ extension HoldBack {
case .deletableSystemExtension:
"a network extension macOS installed; System Settings deletes it: in General > Login Items & Extensions, choose By Category, click the Info button beside Network Extensions, then click the More button beside it and choose Delete Extension"
case .signInPlugIn: "a plug-in macOS may load at login, left to its maker's uninstaller"
+ case .loadedByOtherApps: "other apps can load it on their own, such as music apps"
case .keptByMacOS: "macOS keeps it for its own services"
case .openedFromMail: "an attachment opened from Mail, which may be the only copy"
case .crashReport: "a crash report, which the app's developer may still ask for"
@@ -453,6 +454,7 @@ extension OrphanConfidence {
case .nothingClaimsIt, nil: "nothing installed claims these"
case .installedForAnAppThatIsGone(let name): "macOS installed these for \(Output.plain(name)), which is gone"
case .startsAProgramThatIsGone: "these start a program that is no longer there"
+ case .loadedByOtherApps: "other apps can load these on their own, such as music apps"
}
}
diff --git a/Packages/PeelCore/Sources/PeelCore/Leftovers/Leftover.swift b/Packages/PeelCore/Sources/PeelCore/Leftovers/Leftover.swift
index 4de0b938..78d48232 100644
--- a/Packages/PeelCore/Sources/PeelCore/Leftovers/Leftover.swift
+++ b/Packages/PeelCore/Sources/PeelCore/Leftovers/Leftover.swift
@@ -126,6 +126,8 @@ public enum HoldBack: String, Sendable, Hashable {
case deletableSystemExtension
/// An authorization plug-in macOS may load at login (`SignInPlugIns`), left to its maker's uninstaller.
case signInPlugIn
+ /// An audio plug-in, which music apps and other hosts load on their own whatever became of its app.
+ case loadedByOtherApps
/// What macOS keeps for its own services, which may be using it at any moment (`MacOSsOwnItems`).
case keptByMacOS
/// A copy Mail keeps of an attachment that was opened. One that was edited may exist nowhere else.
@@ -405,6 +407,19 @@ public struct LeftoverScan: Sendable {
)
}
+ /// Holds back each audio plug-in other apps load on their own, unless something else already holds it back.
+ func holdingBack(plugInsOtherAppsLoadIn environment: SearchEnvironment) -> LeftoverScan {
+ LeftoverScan(
+ leftovers: leftovers.map {
+ $0.match.heldBack == nil && Plugins.isLoadedByOtherApps($0.url, environment: environment)
+ ? $0.heldBack(.loadedByOtherApps) : $0
+ },
+ unreadableLocations: unreadableLocations,
+ cutShortLocations: cutShortLocations,
+ needsFullDiskAccess: needsFullDiskAccess
+ )
+ }
+
func leavingToItsUninstaller(_ app: UninstallsItself) -> LeftoverScan {
LeftoverScan(
leftovers: leftovers.map { app.removes($0.url) ? $0.heldBack(.leftToItsUninstaller) : $0 },
diff --git a/Packages/PeelCore/Sources/PeelCore/Orphans/OrphanConfidence.swift b/Packages/PeelCore/Sources/PeelCore/Orphans/OrphanConfidence.swift
index a6844806..8a9d5602 100644
--- a/Packages/PeelCore/Sources/PeelCore/Orphans/OrphanConfidence.swift
+++ b/Packages/PeelCore/Sources/PeelCore/Orphans/OrphanConfidence.swift
@@ -44,6 +44,8 @@ public struct OrphanConfidence: Sendable, Hashable {
case installedForAnAppThatIsGone(name: String)
/// Browser manifests whose program is gone, so they start nothing.
case startsAProgramThatIsGone
+ /// Music apps and other hosts load these plug-ins on their own, whatever became of the app they came with.
+ case loadedByOtherApps
}
/// A write this recent means something may still be running. A week covers a Mac left unused over a weekend.
@@ -70,6 +72,9 @@ public struct OrphanConfidence: Sendable, Hashable {
if running.contains(where: { isOneApp($0.lowercased(), group.identifier.lowercased()) }) {
return OrphanConfidence(level: .unsure, reasons: [.running])
}
+ if group.items.contains(where: { $0.heldBack == .loadedByOtherApps }) {
+ return OrphanConfidence(level: .unsure, reasons: [.loadedByOtherApps])
+ }
// Links into an app that is gone lead nowhere, whatever their dates or the maker's other apps suggest.
if group.items.allSatisfy(\.kind.isForLinks) {
return OrphanConfidence(level: .certain, reasons: [.leadsIntoAnAppThatIsGone])
diff --git a/Packages/PeelCore/Sources/PeelCore/Orphans/OrphanScanner.swift b/Packages/PeelCore/Sources/PeelCore/Orphans/OrphanScanner.swift
index f8845e82..453732f4 100644
--- a/Packages/PeelCore/Sources/PeelCore/Orphans/OrphanScanner.swift
+++ b/Packages/PeelCore/Sources/PeelCore/Orphans/OrphanScanner.swift
@@ -181,6 +181,9 @@ public struct OrphanScanner: Sendable {
item.heldBack = .signInPlugIn
return (entry.identifier, item)
}
+ if item.heldBack == nil, Plugins.isLoadedByOtherApps(item.url, environment: environment) {
+ item.heldBack = .loadedByOtherApps
+ }
if item.leftAlone == nil, entry.holds == nil {
item.heldBack = .couldNotLookInside
}
diff --git a/Packages/PeelCore/Sources/PeelCore/Plugins/Plugins.swift b/Packages/PeelCore/Sources/PeelCore/Plugins/Plugins.swift
index ae8428a9..4ea5e1f9 100644
--- a/Packages/PeelCore/Sources/PeelCore/Plugins/Plugins.swift
+++ b/Packages/PeelCore/Sources/PeelCore/Plugins/Plugins.swift
@@ -53,6 +53,11 @@ public struct Plugin: Sendable, Hashable, Identifiable {
}
extension Plugin.Category {
+ /// The formats music apps and other hosts load on their own.
+ var isLoadedByOtherApps: Bool {
+ [.audioUnits, .vst, .vst3, .clap, .aax, .mas].contains(self)
+ }
+
init?(_ folder: LibraryFolder) {
switch folder {
case .audioUnits: self = .audioUnits
@@ -102,6 +107,18 @@ public enum Plugins {
Plugin.Category(folder).map { (folder.rawValue, $0) }
}
+ /// Whether `url` is at or inside a folder of plug-ins music apps and other hosts load on their own, in the home's
+ /// Library or the Mac's.
+ static func isLoadedByOtherApps(_ url: URL, environment: SearchEnvironment) -> Bool {
+ let path = PathPattern.comparablePath(of: url)
+ return [environment.homeDirectory, environment.rootDirectory].contains { base in
+ folders.contains { folder, category in
+ let place = PathPattern.comparablePath(of: base.appending(path: "Library/\(folder)"))
+ return category.isLoadedByOtherApps && PathComponents.isPath(path, inside: place)
+ }
+ }
+ }
+
/// Returns the `CFBundleIdentifier` in the plug-in's `Info.plist`. A plug-in is named for what it does, not
/// for who made it, so this is its only identifier. It is only a claim, so callers match it like a file name.
static func declaredIdentifier(at url: URL) -> String? {
diff --git a/Packages/PeelCore/Sources/PeelCore/Removal/Uninstallation.swift b/Packages/PeelCore/Sources/PeelCore/Removal/Uninstallation.swift
index 6c09445c..546c98ed 100644
--- a/Packages/PeelCore/Sources/PeelCore/Removal/Uninstallation.swift
+++ b/Packages/PeelCore/Sources/PeelCore/Removal/Uninstallation.swift
@@ -88,6 +88,7 @@ public struct Uninstallation: Sendable {
scan = scan.leavingToItsUninstaller(uninstallsItself)
}
scan = scan.holdingBack(signInPlugInsUnder: environment.rootDirectory)
+ .holdingBack(plugInsOtherAppsLoadIn: environment)
let reach = HelperReach(environment: environment)
scan = scan.holdingBack(beyond: reach, leaving: app.url)
let appRequiresPrivileges = FileAccess.requiresPrivilegesToRemove(app.url)
diff --git a/Packages/PeelCore/Tests/PeelCoreTests/OrphanScannerTests.swift b/Packages/PeelCore/Tests/PeelCoreTests/OrphanScannerTests.swift
index 96326165..0ab5a575 100644
--- a/Packages/PeelCore/Tests/PeelCoreTests/OrphanScannerTests.swift
+++ b/Packages/PeelCore/Tests/PeelCoreTests/OrphanScannerTests.swift
@@ -1239,6 +1239,23 @@ struct OrphanScannerTests {
#expect(Set(scan.groups.flatMap(\.items).map(\.url.lastPathComponent)) == ["Gone.vst3", "Gone Reverb.component"])
}
+ /// Music apps still load a gone app's audio plug-in on their own, so its group is unsure, and the item says why.
+ @Test func aGoneAppsAudioPlugInMakesItsGroupUnsure() async throws {
+ let directory = try TemporaryDirectory()
+ let info = #"<?xml version="1.0" encoding="UTF-8"?><plist version="1.0"><dict><key>CFBundleIdentifier</key><string>com.gonevendor.gone.vst3</string></dict></plist>"#
+ try directory.file("home/Library/Audio/Plug-Ins/VST3/Gone.vst3/Contents/Info.plist", contents: Data(info.utf8))
+ let gone = RememberedApp(
+ bundleIdentifier: "com.gonevendor.gone", name: "Gone", teamIdentifier: nil, lastSeen: .now, lastPath: "/Applications/Gone.app"
+ )
+
+ let scan = await scanner(in: directory).scan(installedApps: installed, remembered: [gone])
+
+ let group = try #require(scan.groups.first { $0.items.contains { $0.url.lastPathComponent == "Gone.vst3" } })
+ #expect(group.items.map(\.heldBack) == [.loadedByOtherApps])
+ #expect(group.confidence.level == .unsure)
+ #expect(group.confidence.reasons == [.loadedByOtherApps])
+ }
+
@Test func listsAGoneAppsSignInPlugInAndNeverOffersIt() async throws {
let directory = try TemporaryDirectory()
let info = #"<?xml version="1.0" encoding="UTF-8"?><plist version="1.0"><dict><key>CFBundleIdentifier</key><string>com.gonevendor.AuthorizationPlugin</string></dict></plist>"#
diff --git a/Packages/PeelCore/Tests/PeelCoreTests/UninstallationTests.swift b/Packages/PeelCore/Tests/PeelCoreTests/UninstallationTests.swift
index a0c4ee14..1b270dbd 100644
--- a/Packages/PeelCore/Tests/PeelCoreTests/UninstallationTests.swift
+++ b/Packages/PeelCore/Tests/PeelCoreTests/UninstallationTests.swift
@@ -181,6 +181,32 @@ struct UninstallationTests {
#expect(!plan.selectable(canUseHelper: true).contains(leftover.url))
}
+ /// Music apps and other hosts load an audio plug-in on their own, so an uninstall lists it unselected, and a click
+ /// still selects it.
+ @Test func holdsBackAnAudioPlugInOtherAppsLoad() async throws {
+ let directory = try TemporaryDirectory()
+ let app = InstalledApp(
+ url: try directory.directory("root/Applications/Surge XT.app"), bundleIdentifier: "org.example.surgext",
+ name: "Surge XT"
+ )
+ let plugIn = try directory.file(
+ "root/Library/Audio/Plug-Ins/VST3/Surge XT.vst3/Contents/Info.plist",
+ contents: Data(#"<?xml version="1.0" encoding="UTF-8"?><plist version="1.0"><dict><key>CFBundleIdentifier</key><string>org.example.surgext.vst3</string></dict></plist>"#.utf8)
+ ).deletingLastPathComponent().deletingLastPathComponent()
+ let environment = SearchEnvironment(
+ homeDirectory: directory.url.appending(path: "home", directoryHint: .isDirectory),
+ rootDirectory: directory.url.appending(path: "root", directoryHint: .isDirectory)
+ )
+
+ let plan = await Uninstallation.prepare(app, installedApps: [app], environment: environment)
+
+ let place = PathPattern.comparablePath(of: plugIn)
+ let leftover = try #require(plan.scan.leftovers.first { PathPattern.comparablePath(of: $0.url) == place })
+ #expect(leftover.match.heldBack == .loadedByOtherApps)
+ #expect(!plan.suggestedSelection(canUseHelper: true).contains(leftover.url))
+ #expect(plan.selectable(canUseHelper: true).contains(leftover.url))
+ }
+
@Test func leavesToFinderAnAppWhoseSystemExtensionMacOSInstalled() async throws {
let directory = try TemporaryDirectory()
let app = try appCarryingAFilter(in: directory)
diff --git a/Peel/Views/Presentation.swift b/Peel/Views/Presentation.swift
index e2a37195..c0c78a34 100644
--- a/Peel/Views/Presentation.swift
+++ b/Peel/Views/Presentation.swift
@@ -399,6 +399,8 @@ extension HoldBack {
"Left alone: macOS installed this system extension, and only macOS removes it. In System Settings > General > Login Items & Extensions, choose By Category, click the Info button beside Network Extensions, then click the More button beside it and choose Delete Extension."
case .signInPlugIn:
"Left alone: macOS may load this plug-in when someone logs in, and taking it away could keep anyone from logging in, so only its maker’s uninstaller removes it."
+ case .loadedByOtherApps:
+ "Not selected: other apps can load it on their own, such as music apps."
case .keptByMacOS:
"Not selected: macOS keeps this for its own services, which may be using it right now."
case .openedFromMail:
@@ -487,6 +489,8 @@ extension OrphanConfidence {
Text("macOS installed these for \(name), which is gone")
case .startsAProgramThatIsGone:
Text("These start a program that is no longer there")
+ case .loadedByOtherApps:
+ Text("Other apps can load these on their own, such as music apps")
}
}
diff --git a/SAFETY.md b/SAFETY.md
index 8985d3b7..a3814018 100644
--- a/SAFETY.md
+++ b/SAFETY.md
@@ -316,6 +316,9 @@ Only matches Peel is `certain` or `likely` about, and only when nothing else ins
- **A plug-in goes by what it declares.** Its name says what it does rather than who made it, so a plug-in called
like the app is selected only when the identifier it declares is the app's or its maker's: another maker's plug-in
with the app's name is never selected.
+- **An audio plug-in is never selected for you.** Music apps and other hosts load an Audio Unit, VST, VST3, CLAP, AAX
+ or MAS plug-in on their own, whatever became of the app it came with, so the app's page lists it unselected, and in
+ Orphaned Files it leaves its group unsure. A click still selects it.
- **What the app's updater downloaded goes with it.** electron-updater, which many Electron apps ship, keeps an app's
downloads in the folder the app's own settings name, the app's name and `-updater`, in `~/Library/Caches` or, before
electron-updater 6, in `~/Library/Application Support/Caches`. That folder is the app's whatever the app is called,