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 to Finder an app whose system extensions Peel can't read

Țugui Dragoșd403504f1988
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4f631c27..4b4ff6ce 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -147,6 +147,8 @@ its changes the way [Keep a Changelog](https://keepachangelog.com/) suggests.
#### Applications
+- An app whose folder of system extensions Peel can't look into is left to Finder, as one whose extensions Peel can
+ name, since only Finder's move asks macOS to remove them; its page and `peel uninstall` say so.
- When many apps stay after a removal, as without App Management, the alert names the first few and counts the others,
so its Open System Settings button stays on the screen. It does the same with the apps to quit and the lines of your
shell startup files, and Copy Details, offered whenever the alert names only the first few, gives them all. Several
diff --git a/Localization/Peel/Localizable.xcstrings b/Localization/Peel/Localizable.xcstrings
index cef69470..9bc168af 100644
--- a/Localization/Peel/Localizable.xcstrings
+++ b/Localization/Peel/Localizable.xcstrings
@@ -69337,6 +69337,112 @@
}
}
},
+ "Left alone: Peel can’t look inside the app to see which system extensions it carries, and macOS removes those only when the app goes to the Trash in Finder." : {
+ "localizations" : {
+ "cs" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Nedotčeno: Peel nemůže nahlédnout do aplikace, aby zjistil, jaká rozšíření systému obsahuje, a systém macOS je odstraní jen tehdy, když se aplikace přesune do koše ve Finderu."
+ }
+ },
+ "de" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Unangetastet: Peel kann nicht in die App hineinsehen, um festzustellen, welche Systemerweiterungen darin enthalten sind, und macOS entfernt diese nur, wenn die App im Finder in den Papierkorb gelegt wird."
+ }
+ },
+ "es" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "No se toca: Peel no puede mirar dentro de la app para saber qué extensiones del sistema lleva, y macOS solo las elimina cuando la app va a la papelera en el Finder."
+ }
+ },
+ "fr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Laissé en place : Peel ne peut pas regarder dans l’app pour savoir quelles extensions système s’y trouvent, et macOS ne les supprime que lorsque l’app est placée dans la corbeille depuis le Finder."
+ }
+ },
+ "it" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Resta dov’è: Peel non può guardare all’interno dell’app per vedere quali estensioni di sistema contiene, e macOS le rimuove solo quando l’app viene spostata nel Cestino dal Finder."
+ }
+ },
+ "ja" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "対象外: Peelはこのアプリの中を調べられないため、どのシステム機能拡張が含まれているかを確認できません。macOSがこれらを削除するのは、Finderでアプリをゴミ箱に入れたときだけです。"
+ }
+ },
+ "ko" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "그대로 둠: Peel은 앱 안을 살펴볼 수 없어 어떤 시스템 확장 프로그램이 들어 있는지 알 수 없으며, macOS는 앱이 Finder에서 휴지통으로 이동될 때만 이 확장 프로그램들을 제거합니다."
+ }
+ },
+ "nl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Blijft staan: Peel kan niet in de app kijken om te zien welke systeemextensies erin zitten, en macOS verwijdert die alleen als de app in Finder naar de prullenmand gaat."
+ }
+ },
+ "pl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Nietknięte: Peel nie może zajrzeć do aplikacji, aby sprawdzić, jakie rozszerzenia systemowe zawiera, a macOS usuwa je tylko wtedy, gdy aplikacja zostanie przeniesiona do Kosza w Finderze."
+ }
+ },
+ "pt" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Preservado: o Peel não consegue examinar o conteúdo do app para ver quais extensões do sistema ele traz, e o macOS só as remove quando o app vai para o Lixo no Finder."
+ }
+ },
+ "ro" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Lăsat neatins: Peel nu poate căuta în interiorul aplicației pentru a vedea ce extensii de sistem conține, iar macOS le elimină doar când aplicația este mutată în Coș din Finder."
+ }
+ },
+ "ru" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Остается на месте: Peel не может заглянуть внутрь приложения, чтобы узнать, какие системные расширения в нем есть, а macOS удаляет их, только когда приложение перемещают в Корзину в Finder."
+ }
+ },
+ "sv" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Rörs inte: Peel kan inte titta inuti appen för att se vilka systemtillägg den innehåller, och macOS tar bort dem bara när appen flyttas till papperskorgen i Finder."
+ }
+ },
+ "tr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Yerinde kalır: Peel, hangi sistem genişletmelerini içerdiğini görmek için uygulamanın içine bakamıyor ve bunlar, yalnızca uygulama Finder’da Çöp Sepeti’ne taşındığında macOS tarafından kaldırılır."
+ }
+ },
+ "uk" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Лишається на місці: Peel не може зазирнути всередину програми, щоб побачити, які системні розширення вона містить, а macOS вилучає їх, лише коли програму переміщують у Смітник у Finder."
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "留在原处:Peel无法查看App内部以确定它附带了哪些系统扩展,而只有在“访达”中将App移到废纸篓时,macOS才会移除这些扩展。"
+ }
+ },
+ "zh-Hant" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "原地保留:Peel無法查看App的內容以得知它內含哪些系統延伸功能,而且只有在Finder中將App丟到「垃圾桶」時,macOS才會移除它們。"
+ }
+ }
+ }
+ },
"Left alone: Peel removes itself only from Settings." : {
"localizations" : {
"cs" : {
@@ -107366,6 +107472,112 @@
}
}
},
+ "Peel can’t look inside %@ to see which system extensions it carries, and macOS removes those only when the app goes to the Trash in Finder. So Peel leaves the app and its files where they are: move it to the Trash in Finder, and Orphaned Files then lists what it left." : {
+ "localizations" : {
+ "cs" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Peel nemůže nahlédnout do aplikace %@, aby zjistil, jaká rozšíření systému obsahuje, a systém macOS je odstraní jen tehdy, když se aplikace přesune do koše ve Finderu. Proto Peel aplikaci i její soubory ponechává na místě: přesuňte ji do koše ve Finderu a stránka Osiřelé soubory pak zobrazí, co po sobě aplikace zanechala."
+ }
+ },
+ "de" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Peel kann nicht in „%@“ hineinsehen, um festzustellen, welche Systemerweiterungen darin enthalten sind, und macOS entfernt diese nur, wenn die App im Finder in den Papierkorb gelegt wird. Daher lässt Peel die App und ihre Dateien dort, wo sie sind: Lege die App im Finder in den Papierkorb. Was sie hinterlassen hat, zeigt dann die Seite „Verwaiste Dateien“ an."
+ }
+ },
+ "es" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Peel no puede mirar dentro de %@ para saber qué extensiones del sistema lleva, y macOS solo las elimina cuando la app va a la papelera en el Finder. Por eso, Peel deja la app y sus archivos donde están: trasládala a la papelera en el Finder y, después, la página Archivos huérfanos mostrará lo que haya dejado."
+ }
+ },
+ "fr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Peel ne peut pas regarder dans %@ pour savoir quelles extensions système s’y trouvent, et macOS ne les supprime que lorsque l’app est placée dans la corbeille depuis le Finder. Peel laisse donc l’app là où elle est, avec ses fichiers : placez-la dans la corbeille depuis le Finder, et la page Fichiers orphelins liste ensuite ce que l’app a laissé derrière elle."
+ }
+ },
+ "it" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Peel non può guardare all’interno di %@ per vedere quali estensioni di sistema contiene, e macOS le rimuove solo quando l’app viene spostata nel Cestino dal Finder. Quindi Peel lascia l’app e i suoi file dove sono: spostala nel Cestino dal Finder, e poi “File orfani” elencherà ciò che l’app ha lasciato."
+ }
+ },
+ "ja" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Peelは“%@”の中を調べられないため、どのシステム機能拡張が含まれているかを確認できません。macOSがこれらを削除するのは、Finderでアプリをゴミ箱に入れたときだけです。そのため、Peelはこのアプリとそのファイルをそのままにします。Finderでアプリをゴミ箱に入れてください。その後、このアプリが残したものが“孤立ファイル”に表示されます。"
+ }
+ },
+ "ko" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Peel은 ‘%@’ 안을 살펴볼 수 없어 어떤 시스템 확장 프로그램이 들어 있는지 알 수 없으며, macOS는 앱이 Finder에서 휴지통으로 이동될 때만 이 확장 프로그램들을 제거합니다. 따라서 Peel은 앱과 앱의 파일을 그대로 둡니다. Finder에서 앱을 휴지통으로 이동하십시오. 그러면 주인 없는 파일 페이지에 앱이 남긴 항목이 나열됩니다."
+ }
+ },
+ "nl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Peel kan niet in %@ kijken om te zien welke systeemextensies erin zitten, en macOS verwijdert die alleen als de app in Finder naar de prullenmand gaat. Daarom laat Peel de app en de bestanden ervan staan: verplaats de app in Finder naar de prullenmand, en daarna toont de pagina 'Verweesde bestanden' wat de app heeft achtergelaten."
+ }
+ },
+ "pl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Peel nie może zajrzeć do aplikacji %@, aby sprawdzić, jakie rozszerzenia systemowe zawiera, a macOS usuwa je tylko wtedy, gdy aplikacja zostanie przeniesiona do Kosza w Finderze. Dlatego Peel zostawia aplikację i jej pliki na miejscu: przenieś ją do Kosza w Finderze, a strona Osierocone pliki wyświetli potem pozostałości po niej."
+ }
+ },
+ "pt" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "O Peel não consegue examinar o conteúdo de %@ para ver quais extensões do sistema ele traz, e o macOS só as remove quando o app vai para o Lixo no Finder. Por isso, o Peel deixa o app e os arquivos dele onde estão: mova-o para o Lixo no Finder, e depois a página Arquivos Órfãos lista o que ele deixou para trás."
+ }
+ },
+ "ro" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Peel nu poate căuta în interiorul aplicației %@ pentru a vedea ce extensii de sistem conține, iar macOS le elimină doar când aplicația este mutată în Coș din Finder. De aceea, Peel lasă aplicația și fișierele ei acolo unde sunt: mutați‑o în Coș din Finder, iar pagina Fișiere orfane listează apoi ce a lăsat aplicația în urmă."
+ }
+ },
+ "ru" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Peel не может заглянуть внутрь приложения «%@», чтобы узнать, какие системные расширения в нем есть, а macOS удаляет их, только когда приложение перемещают в Корзину в Finder. Поэтому Peel оставляет на месте и приложение, и его файлы: переместите его в Корзину в Finder, и затем раздел «Осиротевшие файлы» покажет его остатки."
+ }
+ },
+ "sv" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Peel kan inte titta inuti %@ för att se vilka systemtillägg appen innehåller, och macOS tar bort dem bara när appen flyttas till papperskorgen i Finder. Därför låter Peel appen och dess filer vara där de är: flytta den till papperskorgen i Finder, och sedan listar sidan Övergivna filer det som appen lämnade kvar."
+ }
+ },
+ "tr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Peel, hangi sistem genişletmelerini içerdiğini görmek için %@ uygulamasının içine bakamıyor ve bunlar, yalnızca uygulama Finder’da Çöp Sepeti’ne taşındığında macOS tarafından kaldırılır. Bu yüzden Peel uygulamaya ve dosyalarına dokunmaz: uygulamayı Finder’da Çöp Sepeti’ne taşıyın, ardından Sahipsiz Dosyalar, uygulamanın geride bıraktıklarını listeler."
+ }
+ },
+ "uk" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Peel не може зазирнути всередину програми «%@», щоб побачити, які системні розширення вона містить, а macOS вилучає їх, лише коли програму переміщують у Смітник у Finder. Тому Peel лишає програму та її файли на місці: перемістіть її в Смітник у Finder, і тоді розділ «Покинуті файли» покаже, що вона залишила по собі."
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Peel无法查看“%@”内部以确定它附带了哪些系统扩展,而只有在“访达”中将该App移到废纸篓时,macOS才会移除这些扩展。因此Peel会将该App及其文件留在原处:请在“访达”中将它移到废纸篓,之后“孤立文件”会列出它留下的文件。"
+ }
+ },
+ "zh-Hant" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Peel無法查看「%@」的內容以得知它內含哪些系統延伸功能,而且只有在Finder中將此App丟到「垃圾桶」時,macOS才會移除它們。因此Peel會將此App及其檔案原地保留:請在Finder中將它丟到「垃圾桶」,之後「孤立檔案」就會列出它留下的檔案。"
+ }
+ }
+ }
+ },
"Peel can’t read its list of app folders, so Orphaned Files lists nothing. Starting over keeps the old list beside a new one." : {
"localizations" : {
"cs" : {
diff --git a/Packages/PeelCore/Sources/PeelCommandLine/Commands/AppCommands.swift b/Packages/PeelCore/Sources/PeelCommandLine/Commands/AppCommands.swift
index 99efa4b0..b7be33c9 100644
--- a/Packages/PeelCore/Sources/PeelCommandLine/Commands/AppCommands.swift
+++ b/Packages/PeelCore/Sources/PeelCommandLine/Commands/AppCommands.swift
@@ -495,6 +495,8 @@ struct UninstallCommand: AsyncParsableCommand {
case .onItsDiskImage: "use the uninstaller on the disk image it came on"
}
throw CommandFailure("\(Output.plain(target.name)) is removed with \(uninstaller.maker)'s own uninstaller, which also takes what it keeps in the system: \(step). See \(uninstaller.instructions.absoluteString)")
+ case .byFinder(let carried) where !carried.isKnown:
+ throw CommandFailure("Peel can't look inside \(Output.plain(target.name)) to see which system extensions it carries, and macOS removes those only when the app goes to the Trash in Finder. Move the app to the Trash in Finder.")
case .byFinder(let carried):
let names = carried.names
let extensions = names.map(Output.plain).joined(separator: ", ")
diff --git a/Packages/PeelCore/Sources/PeelCore/Apps/AppInspector.swift b/Packages/PeelCore/Sources/PeelCore/Apps/AppInspector.swift
index c875baec..24a68c3d 100644
--- a/Packages/PeelCore/Sources/PeelCore/Apps/AppInspector.swift
+++ b/Packages/PeelCore/Sources/PeelCore/Apps/AppInspector.swift
@@ -127,7 +127,7 @@ public enum AppInspector {
updaterFolder: electronConfiguration.flatMap(ElectronUpdater.downloadsFolder(fromConfiguration:)),
productFolders: ProductFolders.of(appAt: url),
webApp: bundleIdentifier.flatMap { WebApp.of(identifier: $0, info: info) },
- carriesSystemExtensions: !AppExtensions.systemExtensions(carriedBy: url).isEmpty
+ carriesSystemExtensions: AppExtensions.systemExtensions(carriedBy: url).map { !$0.isEmpty } ?? true
)
}
diff --git a/Packages/PeelCore/Sources/PeelCore/Extensions/AppExtensions.swift b/Packages/PeelCore/Sources/PeelCore/Extensions/AppExtensions.swift
index 261c4c67..0bee7c20 100644
--- a/Packages/PeelCore/Sources/PeelCore/Extensions/AppExtensions.swift
+++ b/Packages/PeelCore/Sources/PeelCore/Extensions/AppExtensions.swift
@@ -108,15 +108,24 @@ extension AppExtension {
public struct CarriedSystemExtensions: Sendable, Hashable {
public let names: [String]
public let systemSettingsDeletesThem: Bool
+ /// False when Peel couldn't look into the app to name them.
+ public let isKnown: Bool
public init(names: [String], systemSettingsDeletesThem: Bool = false) {
+ self.init(names: names, systemSettingsDeletesThem: systemSettingsDeletesThem, isKnown: true)
+ }
+
+ private init(names: [String], systemSettingsDeletesThem: Bool, isKnown: Bool) {
self.names = names
self.systemSettingsDeletesThem = systemSettingsDeletesThem
+ self.isKnown = isKnown
}
public static let none = CarriedSystemExtensions(names: [])
+ /// What an app Peel couldn't look into may carry, which Finder's move asks macOS to remove.
+ public static let notKnown = CarriedSystemExtensions(names: [], systemSettingsDeletesThem: false, isKnown: false)
- public var isEmpty: Bool { names.isEmpty }
+ public var isEmpty: Bool { names.isEmpty && isKnown }
}
public enum AppExtensions {
@@ -286,7 +295,7 @@ public enum AppExtensions {
carriedBy app: InstalledApp,
asking answer: SystemExtensionsAnswer = askingMacOS
) async -> CarriedSystemExtensions {
- let carried = systemExtensions(carriedBy: app.url)
+ guard let carried = systemExtensions(carriedBy: app.url) else { return .notKnown }
guard !carried.isEmpty else { return .none }
guard let installed = await answer() else { return CarriedSystemExtensions(names: carried.map(\.name)) }
let identifiers = Set(carried.map(\.identifier))
@@ -301,20 +310,26 @@ public enum AppExtensions {
)
}
- /// A `.systemextension` keeps its `Info.plist` in `Contents`, and a `.dext` at its top.
- static func systemExtensions(carriedBy app: URL) -> [(identifier: String, name: String)] {
+ /// A `.systemextension` keeps its `Info.plist` in `Contents`, and a `.dext` at its top. Nil when the folder that
+ /// holds them, or one of them, can't be read.
+ static func systemExtensions(carriedBy app: URL) -> [(identifier: String, name: String)]? {
let folder = app.appending(path: "Contents/Library/SystemExtensions", directoryHint: .isDirectory)
- let names = (try? FileManager.default.contentsOfDirectory(atPath: folder.path(percentEncoded: false))) ?? []
- return names.sorted().compactMap { name in
+ guard let names = ProtectedData.names(in: folder.path(percentEncoded: false), followingLinks: true) else {
+ return nil
+ }
+ var carried: [(identifier: String, name: String)] = []
+ for name in names.sorted() {
let bundle = folder.appending(path: name, directoryHint: .isDirectory)
- let info: [String: Any]? = switch bundle.pathExtension {
- case "systemextension": AppInspector.infoDictionary(in: bundle.appending(path: "Contents"))
- case "dext": AppInspector.infoDictionary(in: bundle)
- default: nil
+ let info: [String: Any]?
+ switch bundle.pathExtension {
+ case "systemextension": info = AppInspector.infoDictionary(in: bundle.appending(path: "Contents"))
+ case "dext": info = AppInspector.infoDictionary(in: bundle)
+ default: continue
}
guard let identifier = info?["CFBundleIdentifier"] as? String else { return nil }
- return (identifier, Self.name(of: bundle, info: info))
+ carried.append((identifier, Self.name(of: bundle, info: info)))
}
+ return carried
}
/// Returns the system extensions, or nil when `systemextensionsctl` gave no answer Peel can read: its first
diff --git a/Packages/PeelCore/Sources/PeelCore/Removal/BulkUninstallation.swift b/Packages/PeelCore/Sources/PeelCore/Removal/BulkUninstallation.swift
index 0923dab5..d9a47150 100644
--- a/Packages/PeelCore/Sources/PeelCore/Removal/BulkUninstallation.swift
+++ b/Packages/PeelCore/Sources/PeelCore/Removal/BulkUninstallation.swift
@@ -101,7 +101,7 @@ public struct BulkUninstallation: Sendable {
systemExtensions: AppExtensions.SystemExtensionsAnswer = AppExtensions.askingMacOS,
environment: SearchEnvironment = .current
) async -> BulkUninstallation {
- let carriesOne = apps.contains { !AppExtensions.systemExtensions(carriedBy: $0.url).isEmpty }
+ let carriesOne = apps.contains { AppExtensions.systemExtensions(carriedBy: $0.url)?.isEmpty != true }
let installed = carriesOne ? await systemExtensions() : nil
var prepared: [Uninstallation] = []
for app in apps where !Task.isCancelled {
diff --git a/Packages/PeelCore/Tests/PeelCoreTests/AppExtensionsTests.swift b/Packages/PeelCore/Tests/PeelCoreTests/AppExtensionsTests.swift
index 1ab4eb8d..b18dc84c 100644
--- a/Packages/PeelCore/Tests/PeelCoreTests/AppExtensionsTests.swift
+++ b/Packages/PeelCore/Tests/PeelCoreTests/AppExtensionsTests.swift
@@ -361,7 +361,7 @@ struct AppExtensionsTests {
try directory.file("\(extensions)/org.example.driver.dext/Info.plist", contents: info("org.example.driver", "Example Driver"))
try directory.file("\(extensions)/notes.txt")
- let carried = AppExtensions.systemExtensions(carriedBy: app)
+ let carried = try #require(AppExtensions.systemExtensions(carriedBy: app))
#expect(carried.map(\.identifier) == ["org.example.driver", "org.example.filter"])
#expect(carried.map(\.name) == ["Example Driver", "Example Filter"])
diff --git a/Packages/PeelCore/Tests/PeelCoreTests/AppInspectorTests.swift b/Packages/PeelCore/Tests/PeelCoreTests/AppInspectorTests.swift
index a60965ad..4c0e2bc2 100644
--- a/Packages/PeelCore/Tests/PeelCoreTests/AppInspectorTests.swift
+++ b/Packages/PeelCore/Tests/PeelCoreTests/AppInspectorTests.swift
@@ -158,6 +158,20 @@ struct AppInspectorTests {
#expect(try #require(AppInspector.inspect(directory.url.appending(path: "Plain.app"))).carriesSystemExtensions == false)
}
+ @Test(.permissionsHold) func anAppItCannotLookIntoMayCarryASystemExtension() throws {
+ let directory = try TemporaryDirectory()
+ try plist(["CFBundleIdentifier": "org.example.guard"], at: "Guard.app/Contents/Info.plist", in: directory)
+ try plist(
+ ["CFBundleIdentifier": "org.example.guard.filter"],
+ at: "Guard.app/Contents/Library/SystemExtensions/org.example.guard.filter.systemextension/Contents/Info.plist",
+ in: directory
+ )
+ try directory.setPermissions(0, of: "Guard.app/Contents/Library/SystemExtensions")
+ defer { try? directory.setPermissions(0o755, of: "Guard.app/Contents/Library/SystemExtensions") }
+
+ #expect(try #require(AppInspector.inspect(directory.url.appending(path: "Guard.app"))).carriesSystemExtensions)
+ }
+
/// Spotlight does not index the temporary folder, and answers there with the bundle's modification date for when
/// it was last used.
@Test func anAppSpotlightDoesNotIndexHasNoRecordOfBeingOpened() throws {
diff --git a/Packages/PeelCore/Tests/PeelCoreTests/UninstallationTests.swift b/Packages/PeelCore/Tests/PeelCoreTests/UninstallationTests.swift
index 2777d71a..aa992d5d 100644
--- a/Packages/PeelCore/Tests/PeelCoreTests/UninstallationTests.swift
+++ b/Packages/PeelCore/Tests/PeelCoreTests/UninstallationTests.swift
@@ -120,6 +120,27 @@ struct UninstallationTests {
#expect(!unanswered.systemSettingsDeletesThem, "with no answer the category is not known")
}
+ /// What Peel can't look into may carry a system extension, which only Finder's move asks macOS to remove.
+ @Test(.permissionsHold) func leavesToFinderAnAppItCannotLookInto() async throws {
+ let directory = try TemporaryDirectory()
+ let app = try appCarryingAFilter(in: directory)
+ let extensions = "root/Applications/Example.app/Contents/Library/SystemExtensions"
+ try directory.setPermissions(0, of: extensions)
+ defer { try? directory.setPermissions(0o755, of: extensions) }
+
+ let carried = await AppExtensions.installed(carriedBy: app) { [] }
+ let several = await BulkUninstallation.prepare(
+ [app], installedApps: [app], systemExtensions: { [] },
+ environment: SearchEnvironment(
+ homeDirectory: directory.url.appending(path: "home", directoryHint: .isDirectory),
+ rootDirectory: directory.url.appending(path: "root", directoryHint: .isDirectory)
+ )
+ )
+
+ #expect(RemovedElsewhere.of(app, installedSystemExtensions: carried) == .byFinder(systemExtensions: .notKnown))
+ #expect(several.items.first?.removedElsewhere == .byFinder(systemExtensions: .notKnown))
+ }
+
@Test func listsAnAppsSignInPlugInAndNeverOffersIt() async throws {
let directory = try TemporaryDirectory()
let app = InstalledApp(
diff --git a/Peel/Views/Presentation.swift b/Peel/Views/Presentation.swift
index ee1e5ebf..0eaf1089 100644
--- a/Peel/Views/Presentation.swift
+++ b/Peel/Views/Presentation.swift
@@ -259,6 +259,9 @@ extension RemovedElsewhere {
}
private static func leftToFinder(_ carried: CarriedSystemExtensions) -> LocalizedStringResource {
+ guard carried.isKnown else {
+ return "Left alone: Peel can’t look inside the app to see which system extensions it carries, and macOS removes those only when the app goes to the Trash in Finder."
+ }
let names = carried.names.formatted(.list(type: .and))
if #available(macOS 27, *) {
return carried.systemSettingsDeletesThem
diff --git a/Peel/Views/VendorNotes.swift b/Peel/Views/VendorNotes.swift
index 50cda6a4..cd1e3609 100644
--- a/Peel/Views/VendorNotes.swift
+++ b/Peel/Views/VendorNotes.swift
@@ -21,6 +21,9 @@ struct SystemExtensionNotice: View {
// Each sentence is a literal of its own, so the string catalog finds every one.
private var detail: Text {
+ guard extensions.isKnown else {
+ return Text("Peel can’t look inside \(app.name) to see which system extensions it carries, and macOS removes those only when the app goes to the Trash in Finder. So Peel leaves the app and its files where they are: move it to the Trash in Finder, and Orphaned Files then lists what it left.")
+ }
let names = extensions.names.formatted(.list(type: .and))
let isOne = extensions.names.count == 1
if #available(macOS 27, *) {
diff --git a/SAFETY.md b/SAFETY.md
index bed24da4..1ec901c6 100644
--- a/SAFETY.md
+++ b/SAFETY.md
@@ -359,7 +359,8 @@ its move to the Trash in Finder asks macOS to remove it. Its page says so, with
network extension, how to delete it in System Settings if it stays; `peel uninstall` refuses it with the same reason.
Peel asks macOS which of the app's extensions it installed, and under which category (`systemextensionsctl`), leaves
out one macOS is already removing, and when macOS doesn't answer, counts every extension the app carries and names
-only Finder's step.
+only Finder's step. An app whose folder of system extensions Peel can't look into is left to Finder the same way,
+since what it carries isn't known.
Peel itself is listed on its own page with what it keeps, and nothing of it can be selected there or among other
apps. It is removed only from Settings: by Remove Peel, which takes its helper and login item away first, or,