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.

Peel's own page offers nothing of Peel, and points to Settings

Țugui Dragoș4ef141dad28f
diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md
index 64a992c8..ad1e479b 100644
--- a/ARCHITECTURE.md
+++ b/ARCHITECTURE.md
@@ -162,7 +162,9 @@ prints goes through `Output`, in plain ASCII, so scripts can read it.
| Peel's preferences | Settings, the totals Home shows, and the last answer of each update check. |
Remove Peel, in Settings, takes all of it to the Trash except the helper's ledger, which only the helper could
-move, and it unregisters the helper first.
+move, and it unregisters the helper first. It is the only way Peel is removed: Peel's own page in Applications, and
+Peel among several chosen apps, list it and select nothing of it (`Uninstallation.isPeel`), and `peel uninstall`
+refuses it.
## Testing
diff --git a/Localization/Peel/Localizable.xcstrings b/Localization/Peel/Localizable.xcstrings
index e124cd1c..1373cf31 100644
--- a/Localization/Peel/Localizable.xcstrings
+++ b/Localization/Peel/Localizable.xcstrings
@@ -46887,6 +46887,112 @@
}
}
},
+ "Left alone: Peel removes itself only from Settings." : {
+ "localizations" : {
+ "cs" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Nedotčeno: Peel se odstraňuje jen v Nastavení."
+ }
+ },
+ "de" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Unangetastet: Peel entfernt sich selbst nur in den Einstellungen."
+ }
+ },
+ "es" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "No se toca: Peel solo se elimina desde Ajustes."
+ }
+ },
+ "fr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Laissé en place : Peel ne se supprime que depuis les Réglages."
+ }
+ },
+ "it" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Resta dov’è: Peel si rimuove solo nelle Impostazioni."
+ }
+ },
+ "ja" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "対象外: Peel自身のアンインストールは“設定”からのみ行えます。"
+ }
+ },
+ "ko" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "그대로 둠: Peel은 설정에서만 자신을 제거합니다."
+ }
+ },
+ "nl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Blijft staan: Peel verwijdert zichzelf alleen vanuit Instellingen."
+ }
+ },
+ "pl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Nietknięte: Peel odinstalowuje się tylko w Ustawieniach."
+ }
+ },
+ "pt" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Preservado: o Peel só se remove nos Ajustes."
+ }
+ },
+ "ro" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Lăsat neatins: Peel se elimină doar din Configurări."
+ }
+ },
+ "ru" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Остается на месте: Peel удаляет себя только в Настройках."
+ }
+ },
+ "sv" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Rörs inte: Peel tar bort sig själv bara i Inställningar."
+ }
+ },
+ "tr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Yerinde kalır: Peel kendini yalnızca Ayarlar’dan kaldırır."
+ }
+ },
+ "uk" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Лишається на місці: Peel вилучає себе лише в Параметрах."
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "留在原处:Peel只会在“设置”中移除自己。"
+ }
+ },
+ "zh-Hant" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "原地保留:Peel只會在「設定」中移除自己。"
+ }
+ }
+ }
+ },
"Left alone: Peel won’t move this, because of where it sits or what is inside it." : {
"localizations" : {
"cs" : {
@@ -77042,6 +77148,112 @@
}
}
},
+ "Peel removes itself in Settings" : {
+ "localizations" : {
+ "cs" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Peel se odstraňuje v Nastavení"
+ }
+ },
+ "de" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Peel entfernt sich selbst in den Einstellungen"
+ }
+ },
+ "es" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Peel se elimina en Ajustes"
+ }
+ },
+ "fr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Peel se supprime dans les Réglages"
+ }
+ },
+ "it" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Peel si rimuove nelle Impostazioni"
+ }
+ },
+ "ja" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Peel自身のアンインストールは“設定”で行います"
+ }
+ },
+ "ko" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Peel은 설정에서 자신을 제거함"
+ }
+ },
+ "nl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Peel verwijdert zichzelf in Instellingen"
+ }
+ },
+ "pl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Peel odinstalowuje się w Ustawieniach"
+ }
+ },
+ "pt" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "O Peel se remove nos Ajustes"
+ }
+ },
+ "ro" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Peel se elimină din Configurări"
+ }
+ },
+ "ru" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Peel удаляет себя в Настройках"
+ }
+ },
+ "sv" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Peel tar bort sig själv i Inställningar"
+ }
+ },
+ "tr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Peel kendini Ayarlar’da kaldırır"
+ }
+ },
+ "uk" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Peel вилучає себе в Параметрах"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Peel在“设置”中移除自己"
+ }
+ },
+ "zh-Hant" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Peel會在「設定」中移除自己"
+ }
+ }
+ }
+ },
"Peel removes nothing and puts nothing back until you start the list over in Settings." : {
"localizations" : {
"cs" : {
@@ -84389,6 +84601,112 @@
}
}
},
+ "Remove Peel, in Settings > General, removes its helper and login item as well. Moved from here, Peel would leave them behind." : {
+ "localizations" : {
+ "cs" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Volba „Odstranit Peel“ v Nastavení > Obecné odstraní také pomocníka Peelu a jeho položku přihlášení. Kdyby byl Peel odtud přesunut do koše, zanechal by je po sobě."
+ }
+ },
+ "de" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Mit „Peel entfernen“ unter „Einstellungen“ > „Allgemein“ werden auch das Hilfsprogramm und das Anmeldeobjekt von Peel entfernt. Von hier aus verschoben, würde Peel beide hinterlassen."
+ }
+ },
+ "es" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "“Eliminar Peel”, en Ajustes > General, también elimina su asistente y su ítem de inicio. Si se trasladara desde aquí, Peel los dejaría atrás."
+ }
+ },
+ "fr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Dans Réglages > Général, « Supprimer Peel » supprime aussi son utilitaire et son élément d’ouverture. Placé dans la corbeille depuis cette page, Peel les laisserait derrière lui."
+ }
+ },
+ "it" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "“Rimuovi Peel”, in Impostazioni > Generali, rimuove anche l’assistente e l’elemento login di Peel. Spostato da qui, Peel se li lascerebbe dietro."
+ }
+ },
+ "ja" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "“設定”>“一般”にある“Peelをアンインストール”を使うと、ヘルパーとログイン項目も一緒に取り除かれます。ここからゴミ箱に入れた場合、Peelはそれらを残していくことになります。"
+ }
+ },
+ "ko" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "설정 > 일반에 있는 ‘Peel 제거’는 보조 프로그램과 로그인 항목도 함께 제거합니다. 여기에서 휴지통으로 이동하면 Peel이 이 두 가지를 남기게 됩니다."
+ }
+ },
+ "nl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Met 'Verwijder Peel' in Instellingen > Algemeen worden ook het hulpprogramma en het inlogonderdeel van Peel verwijderd. Als Peel hier naar de prullenmand werd verplaatst, zou Peel ze achterlaten."
+ }
+ },
+ "pl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "„Odinstaluj Peel” w Ustawieniach > Ogólne odinstalowuje także pomocnika Peel i usuwa rzecz otwieraną podczas logowania. Przeniesiony stąd do Kosza, Peel pozostawiłby po sobie jedno i drugie."
+ }
+ },
+ "pt" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "“Remover o Peel”, em Ajustes > Geral, também remove o auxiliar e o item de início de sessão. Se fosse movido daqui, o Peel os deixaria para trás."
+ }
+ },
+ "ro" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "„Eliminați Peel”, din Configurări > General, elimină și instrumentul de ajutor și articolul de lansat la login. Dacă ar fi mutat în Coș de aici, Peel le‑ar lăsa în urmă."
+ }
+ },
+ "ru" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Пункт «Удалить Peel» в разделе «Настройки» > «Основные» удаляет также помощника Peel и объект входа. Если бы Peel переместили отсюда, он оставил бы их после себя."
+ }
+ },
+ "sv" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "”Ta bort Peel” i Inställningar > Allmänt tar även bort Peels hjälpprogram och startobjekt. Om Peel flyttades härifrån skulle de lämnas kvar."
+ }
+ },
+ "tr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Ayarlar > Genel’deki “Peel’i Kaldır”, Peel’in yardımcısını ve oturum açma öğesini de kaldırır. Peel buradan Çöp Sepeti’ne taşınsaydı, bunları geride bırakırdı."
+ }
+ },
+ "uk" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Команда «Вилучити Peel» у розділі Параметри > Загальні вилучає також помічника й елемент автозапуску Peel. Якби Peel перемістили звідси, вона залишила б їх по собі."
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "“设置”>“通用”中的“移除Peel”还会一并移除Peel的帮助程序和登录项。如果从此处移走,Peel会将它们留下。"
+ }
+ },
+ "zh-Hant" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "「設定」>「一般」中的「移除Peel」也會一併移除Peel的輔助程式和登入項目。若從這裡移動Peel,就會留下它們。"
+ }
+ }
+ }
+ },
"Remove apps and the files they leave behind." : {
"localizations" : {
"cs" : {
diff --git a/Packages/PeelCore/Sources/PeelCore/Removal/BulkUninstallation.swift b/Packages/PeelCore/Sources/PeelCore/Removal/BulkUninstallation.swift
index 46d00003..78fdb9dc 100644
--- a/Packages/PeelCore/Sources/PeelCore/Removal/BulkUninstallation.swift
+++ b/Packages/PeelCore/Sources/PeelCore/Removal/BulkUninstallation.swift
@@ -21,11 +21,13 @@ public struct BulkUninstallation: Sendable {
public var isMeasured = true
/// Needs administrator rights, and the helper may not move it. Shown, never selected, never moved.
public var isBeyondTheHelper = false
+ /// Peel or a file of Peel's: Peel is removed only from its own Settings. Shown, never selected, never moved.
+ public var isPeels = false
public var id: URL { url }
public var isApplication: Bool { match == nil }
public var isRecommended: Bool {
- guard !isExcluded, !isKeptByMacOS, !isBeyondTheHelper else { return false }
+ guard !isExcluded, !isPeels, !isKeptByMacOS, !isBeyondTheHelper else { return false }
guard let match else { return true }
return sharedWithOthers.isEmpty && match.confidence >= .likely && match.heldBack == nil
}
@@ -40,7 +42,7 @@ public struct BulkUninstallation: Sendable {
/// as zero: it makes the total incomplete.
public var total: SizeTotal {
SizeTotal(items
- .filter { !$0.isExcluded && !($0.isApplication && $0.isKeptByMacOS) && !$0.isBeyondTheHelper && $0.match?.heldBack?.cannotBeMoved != true }
+ .filter { !$0.isExcluded && !$0.isPeels && !($0.isApplication && $0.isKeptByMacOS) && !$0.isBeyondTheHelper && $0.match?.heldBack?.cannotBeMoved != true }
.map { $0.isMeasured ? $0.size : nil })
}
public var unreadableLocations: [SearchLocation] {
@@ -78,12 +80,13 @@ public struct BulkUninstallation: Sendable {
}
public var privilegedURLs: Set<URL> {
- Set(items.filter { $0.requiresPrivileges && !$0.isExcluded && !$0.isBeyondTheHelper && !($0.isApplication && $0.isKeptByMacOS) }.map(\.url))
+ Set(items.filter { $0.requiresPrivileges && !$0.isExcluded && !$0.isPeels && !$0.isBeyondTheHelper && !($0.isApplication && $0.isKeptByMacOS) }.map(\.url))
}
- /// Returns the selection in the order it is moved: leftovers first, then the apps. Excluded items are left out.
+ /// Returns the selection in the order it is moved: leftovers first, then the apps. Excluded items and Peel's
+ /// are left out.
public func removalOrder(of selection: Set<URL>) -> [URL] {
- let movable = items.filter { !$0.isExcluded && selection.contains($0.url) }
+ let movable = items.filter { !$0.isExcluded && !$0.isPeels && selection.contains($0.url) }
return movable.filter { !$0.isApplication }.map(\.url) + movable.filter(\.isApplication).map(\.url)
}
@@ -105,7 +108,8 @@ public struct BulkUninstallation: Sendable {
isExcluded: existing.isExcluded || item.isExcluded,
isKeptByMacOS: existing.isKeptByMacOS || item.isKeptByMacOS,
isMeasured: existing.isMeasured || item.isMeasured,
- isBeyondTheHelper: existing.isBeyondTheHelper || item.isBeyondTheHelper
+ isBeyondTheHelper: existing.isBeyondTheHelper || item.isBeyondTheHelper,
+ isPeels: existing.isPeels || item.isPeels
)
} else {
byURL[item.url] = item
@@ -127,7 +131,8 @@ public struct BulkUninstallation: Sendable {
isExcluded: leftover.match.heldBack == .holdsAnExclusion,
isKeptByMacOS: uninstallation.app.isSystemProtected,
isMeasured: leftover.isMeasured,
- isBeyondTheHelper: leftover.match.heldBack == .beyondTheHelper
+ isBeyondTheHelper: leftover.match.heldBack == .beyondTheHelper,
+ isPeels: uninstallation.isPeel
))
}
add(Item(
@@ -141,7 +146,8 @@ public struct BulkUninstallation: Sendable {
isExcluded: uninstallation.isExcluded,
isKeptByMacOS: uninstallation.app.isSystemProtected,
isMeasured: uninstallation.isAppMeasured,
- isBeyondTheHelper: uninstallation.isAppBeyondTheHelper
+ isBeyondTheHelper: uninstallation.isAppBeyondTheHelper,
+ isPeels: uninstallation.isPeel
))
}
diff --git a/Packages/PeelCore/Sources/PeelCore/Removal/Uninstallation.swift b/Packages/PeelCore/Sources/PeelCore/Removal/Uninstallation.swift
index 49abf539..29e9000c 100644
--- a/Packages/PeelCore/Sources/PeelCore/Removal/Uninstallation.swift
+++ b/Packages/PeelCore/Sources/PeelCore/Removal/Uninstallation.swift
@@ -14,6 +14,9 @@ public struct Uninstallation: Sendable {
/// True when the app needs administrator rights and the helper may not move it. The app is then never
/// selected: its leftovers would move first, and the app would stay without them.
public var isAppBeyondTheHelper = false
+ /// True for Peel, which is removed only from its own Settings, where its helper and login item go first. Its
+ /// files are listed, and nothing of it is selected or moved anywhere else: `unreviewedSelection` is that way.
+ public var isPeel: Bool { app.isPeelItself }
@concurrent
public static func prepare(
@@ -144,11 +147,11 @@ public struct Uninstallation: Sendable {
return (inside.kind, components)
}
- /// True when the app itself would stay: excluded, kept by macOS, beyond the helper, or needing the helper
- /// while it is not there. Nothing of it is then selected for the user: what it left behind would go first,
- /// and it would stay without its settings. For an app macOS keeps, what it holds is data in use.
+ /// True when the app itself would stay: excluded, Peel, kept by macOS, beyond the helper, or needing the
+ /// helper while it is not there. Nothing of it is then selected for the user: what it left behind would go
+ /// first, and it would stay without its settings. For an app macOS keeps, what it holds is data in use.
public func appStays(canUseHelper: Bool) -> Bool {
- isExcluded || app.isSystemProtected || isAppBeyondTheHelper || (appRequiresPrivileges && !canUseHelper)
+ isExcluded || isPeel || app.isSystemProtected || isAppBeyondTheHelper || (appRequiresPrivileges && !canUseHelper)
}
/// What is selected for the user at first: the app and the recommended leftovers that can move. Empty for
@@ -171,12 +174,13 @@ public struct Uninstallation: Sendable {
leftover.match.isRecommended && !leftover.requiresPrivileges
&& (leftover.match.confidence == .certain || leftover.url.lastPathComponent.lowercased().hasPrefix(namespace))
}
- return removalOrder(of: Set(own.map(\.url)).union([app.url]))
+ return order(of: Set(own.map(\.url)).union([app.url]))
}
/// How many items could move once selected, and their total size: what a section header shows and the
/// page's total adds up. Rows Peel leaves alone are not counted.
public func movable(among leftovers: [Leftover], withApp: Bool) -> (count: Int, size: SizeTotal) {
+ guard !isPeel else { return (0, SizeTotal([])) }
var sizes: [Int64?] = leftovers
.filter { $0.match.heldBack?.cannotBeMoved != true && $0.match.heldBack != .holdsAnExclusion }
.map { $0.isMeasured ? $0.size : nil }
@@ -187,7 +191,7 @@ public struct Uninstallation: Sendable {
}
public var privilegedURLs: Set<URL> {
- guard !isExcluded else { return [] }
+ guard !isExcluded, !isPeel else { return [] }
var urls = Set(scan.leftovers.filter { $0.requiresPrivileges && $0.match.heldBack != .beyondTheHelper }.map(\.url))
if appRequiresPrivileges, !app.isSystemProtected, !isAppBeyondTheHelper {
urls.insert(app.url)
@@ -197,7 +201,11 @@ public struct Uninstallation: Sendable {
/// The selected leftovers, then the app itself.
public func removalOrder(of selection: Set<URL>) -> [URL] {
- guard !isExcluded else { return [] }
- return scan.leftovers.map(\.url).filter(selection.contains) + (selection.contains(app.url) ? [app.url] : [])
+ guard !isExcluded, !isPeel else { return [] }
+ return order(of: selection)
+ }
+
+ private func order(of selection: Set<URL>) -> [URL] {
+ scan.leftovers.map(\.url).filter(selection.contains) + (selection.contains(app.url) ? [app.url] : [])
}
}
diff --git a/Packages/PeelCore/Tests/PeelCoreTests/UninstallationTests.swift b/Packages/PeelCore/Tests/PeelCoreTests/UninstallationTests.swift
index 9f2dea4a..bdc2f7a6 100644
--- a/Packages/PeelCore/Tests/PeelCoreTests/UninstallationTests.swift
+++ b/Packages/PeelCore/Tests/PeelCoreTests/UninstallationTests.swift
@@ -89,6 +89,29 @@ struct UninstallationTests {
#expect(bulk.suggestedSelection(canUseHelper: true).isSuperset(of: [app.url, own.url, shared.url, other.url]))
}
+ /// Peel is removed only from its own Settings, where its helper and login item go first. Its page lists its
+ /// files, but nothing of it can be selected or moved there, alone or among other apps. Remove Peel still takes
+ /// what is certainly its own.
+ @Test func peelIsRemovedOnlyFromItsOwnSettings() {
+ let peel = InstalledApp(url: URL(filePath: "/Applications/Peel.app"), bundleIdentifier: "com.tuguidragos.Peel", name: "Peel")
+ let own = leftover("com.tuguidragos.Peel")
+ let plan = uninstallation(app: peel, leftovers: [own])
+
+ #expect(plan.isPeel)
+ #expect(plan.suggestedSelection(canUseHelper: true).isEmpty)
+ #expect(plan.removalOrder(of: [peel.url, own.url]).isEmpty)
+ #expect(plan.movable(among: [own], withApp: true).count == 0)
+ #expect(plan.privilegedURLs.isEmpty)
+ #expect(plan.unreviewedSelection == [own.url, peel.url], "Remove Peel no longer takes what is Peel's")
+
+ let example = leftover("com.example.app")
+ let bulk = BulkUninstallation(uninstallations: [plan, uninstallation(leftovers: [example])])
+ #expect(bulk.suggestedSelection(canUseHelper: true) == [app.url, example.url])
+ #expect(bulk.removalOrder(of: [peel.url, own.url, app.url, example.url]) == [example.url, app.url])
+ #expect(Set(bulk.items.filter(\.isPeels).map(\.url)) == [peel.url, own.url])
+ #expect(bulk.total.known == 11_000, "Peel's files were counted as something to remove")
+ }
+
/// Leftovers move before the app. If the helper then refused the app, it would stay without them, so an app
/// the helper may not move is never offered. Neither is an app macOS keeps, wherever it sits.
@Test func anAppTheHelperMayNotMoveIsNeverOffered() async throws {
diff --git a/Peel/Model/RemovalPlan.swift b/Peel/Model/RemovalPlan.swift
index 99c7925c..2416b3ba 100644
--- a/Peel/Model/RemovalPlan.swift
+++ b/Peel/Model/RemovalPlan.swift
@@ -58,6 +58,11 @@ final class RemovalPlan {
uninstallation?.isAppBeyondTheHelper ?? false
}
+ /// Known before the scan, so the page says from the start that Peel removes itself in Settings.
+ var isPeel: Bool {
+ app.isPeelItself
+ }
+
/// False when the size of something selected is unknown, so the bar shows the sum as "Over" that amount.
var isSelectionMeasured: Bool {
(!selectedURLs.contains(app.url) || isAppMeasured) && selectedURLs.allSatisfy { leftoverSizes[$0]?.isMeasured ?? true }
diff --git a/Peel/Views/AppDetailView.swift b/Peel/Views/AppDetailView.swift
index 1bc4e406..93f586c6 100644
--- a/Peel/Views/AppDetailView.swift
+++ b/Peel/Views/AppDetailView.swift
@@ -108,6 +108,18 @@ struct AppDetailView: View {
}
.listRowSeparator(.hidden)
}
+ if plan.isPeel {
+ Notice(
+ title: Text("Peel removes itself in Settings"),
+ detail: Text("Remove Peel, in Settings > General, removes its helper and login item as well. Moved from here, Peel would leave them behind."),
+ kind: .note
+ ) {
+ SettingsLink {
+ Text("Open Peel Settings")
+ }
+ }
+ .listRowSeparator(.hidden)
+ }
if let scan = plan.scan {
if !scan.unreadableLocations.isEmpty {
FullDiskAccessBanner()
@@ -225,7 +237,7 @@ struct AppDetailView: View {
isMeasured: plan.isAppMeasured,
isLocked: plan.appRequiresPrivileges && !helper.canAct,
isExcluded: plan.isExcluded,
- isLeftAlone: plan.app.isSystemProtected || plan.isAppBeyondTheHelper,
+ isLeftAlone: plan.app.isSystemProtected || plan.isAppBeyondTheHelper || plan.isPeel,
appIdentifier: plan.app.bundleIdentifier,
selection: plan, isSelected: plan.isSelected(plan.app.url)
)
@@ -249,7 +261,7 @@ struct AppDetailView: View {
/// The Recommended rows a checkbox can select, for its Select All. Review Before Removing has no Select All,
/// because nothing there should be selected without being read.
private var recommendedSelectable: [URL] {
- let isAppSelectable = !(plan.appRequiresPrivileges && !helper.canAct) && !plan.isExcluded
+ let isAppSelectable = !(plan.appRequiresPrivileges && !helper.canAct) && !plan.isExcluded && !plan.isPeel
&& !plan.app.isSystemProtected && !plan.isAppBeyondTheHelper
return (isAppSelectable ? [plan.app.url] : []) + plan.recommended.filter(canSelect).map(\.url)
}
@@ -276,6 +288,9 @@ struct AppDetailView: View {
}
private var appWarning: String? {
+ if plan.isPeel {
+ return String(localized: "Left alone: Peel removes itself only from Settings.")
+ }
if plan.app.isSystemProtected {
return String(localized: "macOS keeps this app, so it stays where it is.")
}
@@ -505,14 +520,14 @@ struct AppDetailView: View {
isMeasured: leftover.isMeasured,
isLocked: leftover.requiresPrivileges && !helper.canAct,
isExcluded: leftover.match.heldBack == .holdsAnExclusion,
- isLeftAlone: leftover.match.heldBack?.cannotBeMoved == true,
+ isLeftAlone: leftover.match.heldBack?.cannotBeMoved == true || plan.isPeel,
selection: plan, isSelected: plan.isSelected(leftover.url)
)
}
private func canSelect(_ leftover: Leftover) -> Bool {
!(leftover.requiresPrivileges && !helper.canAct) && leftover.match.heldBack != .holdsAnExclusion
- && leftover.match.heldBack?.cannotBeMoved != true
+ && leftover.match.heldBack?.cannotBeMoved != true && !plan.isPeel
}
/// What the row has to say for itself beyond the match: who else uses it, and why Peel left the checkmark off.
@@ -525,6 +540,9 @@ struct AppDetailView: View {
if let heldBack = leftover.match.heldBack {
lines.append(String(localized: heldBack.explanation))
}
+ if plan.isPeel {
+ lines.append(String(localized: "Left alone: Peel removes itself only from Settings."))
+ }
return lines.isEmpty ? nil : lines.joined(separator: "\n\n")
}
diff --git a/Peel/Views/MultipleAppsView.swift b/Peel/Views/MultipleAppsView.swift
index 259b3bcf..cf32d94f 100644
--- a/Peel/Views/MultipleAppsView.swift
+++ b/Peel/Views/MultipleAppsView.swift
@@ -157,7 +157,8 @@ struct MultipleAppsView: View {
isMeasured: item.isMeasured,
isLocked: item.requiresPrivileges && !helper.canAct,
isExcluded: item.isExcluded,
- isLeftAlone: item.match?.heldBack?.cannotBeMoved == true || item.isBeyondTheHelper || (item.isApplication && item.isKeptByMacOS),
+ isLeftAlone: item.match?.heldBack?.cannotBeMoved == true || item.isBeyondTheHelper || (item.isApplication && item.isKeptByMacOS)
+ || item.isPeels,
appIdentifier: item.isApplication ? item.apps.first : nil,
isFirst: isFirst,
selection: plan, isSelected: plan.isSelected(item.url)
@@ -178,6 +179,9 @@ struct MultipleAppsView: View {
if item.isApplication, item.isBeyondTheHelper {
lines.append(String(localized: HoldBack.beyondTheHelper.explanation))
}
+ if item.isPeels {
+ lines.append(String(localized: "Left alone: Peel removes itself only from Settings."))
+ }
if item.isKeptByMacOS {
// Two literals, so the string catalog finds both.
lines.append(item.isApplication
diff --git a/SAFETY.md b/SAFETY.md
index a7b60ef4..f407314b 100644
--- a/SAFETY.md
+++ b/SAFETY.md
@@ -133,6 +133,9 @@ this one; so is something matched by name alone at the top of your home folder o
only a guess. And nothing at all is selected for an app that would stay: one macOS keeps, one the helper may not
move, or one that needs the helper while it cannot act.
+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 by Remove Peel, in Settings, which takes its helper and login item away first.
+
Never selected for you, even when found: model weights, virtual environments, `/Users/Shared` (it belongs to
every account, not just yours), a project you worked on this week, a folder with a repository, a wallet, or a
signing key inside, a folder macOS would not let Peel read, and a folder Peel could not measure in time. Those