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.

Say which root certificate an app or a tool leaves trusted

Țugui Dragoș3191e568349e
diff --git a/GUIDE.md b/GUIDE.md
index a1969d43..f0e1b4a2 100644
--- a/GUIDE.md
+++ b/GUIDE.md
@@ -75,6 +75,9 @@ and how to get it, [SAFETY.md](SAFETY.md) what it protects, [PRIVACY.md](PRIVACY
moved to the Trash loses its icon once the files it left behind move, and History doesn't put that icon back.
- **When macOS needs more.** After a removal, Peel says when macOS keeps using what moved: an audio driver until
you restart your Mac, and, on macOS 27, an app's login items, which macOS starts from the Trash until you empty it.
+- **A root certificate stays trusted.** Before an app such as Charles or Proxyman goes, or a tool such as mkcert,
+ Caddy, or mitmproxy is uninstalled on the Homebrew page, Peel says that the root certificate it added stays trusted
+ on this Mac, and how its maker, or Keychain Access, stops trusting it. Peel never changes a keychain.
- **Lines that still point to what moved.** After a removal, Peel reads the files your shell runs when it starts
(`.zshrc` and the others zsh, bash, and fish read) and names each line that still points to what moved, such as a
`PATH` entry or an alias into the app, so a new shell stops printing an error once you edit it. Peel changes none
diff --git a/Localization/Peel/Localizable.xcstrings b/Localization/Peel/Localizable.xcstrings
index 17e70407..72b08240 100644
--- a/Localization/Peel/Localizable.xcstrings
+++ b/Localization/Peel/Localizable.xcstrings
@@ -228,6 +228,112 @@
}
}
},
+ "%@ added a root certificate to the certificates this Mac trusts, and Homebrew leaves it trusted." : {
+ "localizations" : {
+ "cs" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Balíček %@ přidal kořenový certifikát mezi certifikáty, kterým tento Mac důvěřuje, a Homebrew ho ponechá jako důvěryhodný."
+ }
+ },
+ "de" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "„%@“ hat den Zertifikaten, denen dieser Mac vertraut, ein Root-Zertifikat hinzugefügt, und Homebrew entzieht diesem Zertifikat das Vertrauen nicht."
+ }
+ },
+ "es" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "%@ añadió un certificado raíz a los certificados en los que confía este Mac, y Homebrew deja que siga siendo de confianza."
+ }
+ },
+ "fr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "%@ a ajouté un certificat racine aux certificats de confiance de ce Mac, et Homebrew ne l’en retire pas."
+ }
+ },
+ "it" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "%@ ha aggiunto un certificato root ai certificati considerati attendibili da questo Mac, e Homebrew lo lascia attendibile."
+ }
+ },
+ "ja" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "“%@”は、このMacが信頼する証明書にルート証明書を追加しています。Homebrewでアンインストールしても、この証明書は信頼されたまま残ります。"
+ }
+ },
+ "ko" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "‘%@’이(가) 이 Mac이 신뢰하는 인증서에 루트 인증서를 추가했으며, Homebrew는 이 인증서를 신뢰된 상태로 남겨 둡니다."
+ }
+ },
+ "nl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "%@ heeft een rootcertificaat toegevoegd aan de certificaten die deze Mac vertrouwt, en Homebrew verandert daar niets aan."
+ }
+ },
+ "pl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Pakiet %@ dodał certyfikat główny do certyfikatów, którym ufa ten Mac, a Homebrew nie cofa tego zaufania."
+ }
+ },
+ "pt" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "%@ adicionou um certificado raiz aos certificados em que este Mac confia, e o Homebrew o mantém como confiável."
+ }
+ },
+ "ro" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "%@ a adăugat un certificat rădăcină la certificatele în care acest Mac are încredere, iar Homebrew nu îi retrage încrederea."
+ }
+ },
+ "ru" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Пакет «%@» добавил корневой сертификат к сертификатам, которым доверяет этот Mac, и Homebrew оставит его доверенным."
+ }
+ },
+ "sv" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "%@ har lagt till ett rotcertifikat bland de certifikat som den här datorn litar på, och Homebrew låter det förbli betrott."
+ }
+ },
+ "tr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "%@, bu Mac’in güvendiği sertifikalara bir kök sertifika ekledi ve Homebrew onu güvenilir olarak bırakır."
+ }
+ },
+ "uk" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Пакет «%@» додав кореневий сертифікат до сертифікатів, яким довіряє цей Mac, і Homebrew не скасує довіри до нього."
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "“%@”将一个根证书添加到了这台Mac信任的证书中,而Homebrew会让它保持受信任状态。"
+ }
+ },
+ "zh-Hant" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "「%@」已將一個根憑證加入這部Mac信任的憑證中,而Homebrew會讓它繼續受信任。"
+ }
+ }
+ }
+ },
"%@ and other apps that use it may stop working." : {
"comment" : "In the question before a plug-in moves to the Trash. %@ is the installed app the plug-in came with.",
"localizations" : {
@@ -10334,6 +10440,112 @@
}
}
},
+ "%@’s root certificate stays trusted on this Mac after the app goes." : {
+ "localizations" : {
+ "cs" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Kořenový certifikát aplikace %@ zůstane v tomto Macu důvěryhodný i po odstranění aplikace."
+ }
+ },
+ "de" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Das Root-Zertifikat von „%@“ bleibt auf diesem Mac vertrauenswürdig, auch nachdem die App entfernt wurde."
+ }
+ },
+ "es" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "El certificado raíz de %@ sigue siendo de confianza en este Mac después de eliminar la app."
+ }
+ },
+ "fr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Ce Mac continue de se fier au certificat racine de %@ après la disparition de l’app."
+ }
+ },
+ "it" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Il certificato root di %@ resta attendibile su questo Mac anche dopo la rimozione dell’app."
+ }
+ },
+ "ja" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "“%@”のルート証明書は、アプリをゴミ箱に入れた後も、このMacで信頼されたまま残ります。"
+ }
+ },
+ "ko" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "‘%@’의 루트 인증서는 앱이 제거된 후에도 이 Mac에서 계속 신뢰됩니다."
+ }
+ },
+ "nl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Het rootcertificaat van %@ blijft vertrouwd op deze Mac nadat de app weg is."
+ }
+ },
+ "pl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Certyfikat główny aplikacji %@ pozostanie zaufany na tym Macu także po przeniesieniu aplikacji do Kosza."
+ }
+ },
+ "pt" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "O certificado raiz do %@ continua confiável neste Mac depois que o app for removido."
+ }
+ },
+ "ro" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Certificatul rădăcină al aplicației %@ rămâne de încredere pe acest Mac după eliminarea ei."
+ }
+ },
+ "ru" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Корневой сертификат приложения «%@» останется доверенным на этом Mac после удаления приложения."
+ }
+ },
+ "sv" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Rotcertifikatet från %@ förblir betrott på den här datorn efter att appen är borta."
+ }
+ },
+ "tr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "%@ uygulamasının kök sertifikası, uygulama gittikten sonra da bu Mac’te güvenilir olarak kalır."
+ }
+ },
+ "uk" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Цей Mac і далі довірятиме кореневому сертифікату програми «%@» після її вилучення."
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "“%@”的根证书在App移走后仍会在这台Mac上受信任。"
+ }
+ },
+ "zh-Hant" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "「%@」的根憑證在App移除後,仍會受到這部Mac信任。"
+ }
+ }
+ }
+ },
"%@’s uninstaller for %@" : {
"localizations" : {
"cs" : {
@@ -212690,6 +212902,330 @@
}
}
},
+ "To stop trusting it, choose %@ in %@ first." : {
+ "localizations" : {
+ "cs" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Chcete-li mu přestat důvěřovat, nejdřív v aplikaci %2$@ zvolte %1$@."
+ }
+ },
+ "de" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Um ihm das Vertrauen zu entziehen, wähle zuerst %1$@ in „%2$@“."
+ }
+ },
+ "en" : {
+ "stringUnit" : {
+ "state" : "new",
+ "value" : "To stop trusting it, choose %1$@ in %2$@ first."
+ }
+ },
+ "es" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Para dejar de confiar en él, elige primero %1$@ en %2$@."
+ }
+ },
+ "fr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Pour que ce Mac ne s’y fie plus, choisissez d’abord %@ dans %@."
+ }
+ },
+ "it" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Per non considerarlo più attendibile, scegli prima %@ in %@."
+ }
+ },
+ "ja" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "この証明書が信頼されないようにするには、先に%2$@で%1$@と選択してください。"
+ }
+ },
+ "ko" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "이 인증서를 더 이상 신뢰하지 않으려면 먼저 ‘%2$@’에서 %1$@을(를) 선택하십시오."
+ }
+ },
+ "nl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Om het niet langer te vertrouwen, kies je eerst %@ in %@."
+ }
+ },
+ "pl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Aby przestać mu ufać, najpierw wybierz w aplikacji %2$@ polecenie %1$@."
+ }
+ },
+ "pt" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Para deixar de confiar nele, escolha primeiro %@ no %@."
+ }
+ },
+ "ro" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Pentru a‑i retrage încrederea, alegeți mai întâi %@ din %@."
+ }
+ },
+ "ru" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Чтобы перестать ему доверять, сначала выберите %@ в приложении «%@»."
+ }
+ },
+ "sv" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Om du vill sluta lita på det väljer du först %1$@ i %2$@."
+ }
+ },
+ "tr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Bu sertifikaya artık güvenilmemesi için önce %2$@ uygulamasında %1$@ komutunu seçin."
+ }
+ },
+ "uk" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Щоб скасувати довіру до нього, спершу виберіть %@ у програмі «%@»."
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "若要停止信任它,请先在“%2$@”中选取%1$@。"
+ }
+ },
+ "zh-Hant" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "若要停止信任它,請先在「%2$@」中選擇%1$@。"
+ }
+ }
+ }
+ },
+ "To stop trusting it, open the certificate whose name begins with %@ in Keychain Access and change its trust settings." : {
+ "localizations" : {
+ "cs" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Chcete-li mu přestat důvěřovat, otevřete v Klíčence certifikát, jehož název začíná na %@, a změňte jeho nastavení důvěryhodnosti."
+ }
+ },
+ "de" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Um ihm das Vertrauen zu entziehen, öffne das Zertifikat, dessen Name mit „%@“ beginnt, in der Schlüsselbund­verwaltung und ändere seine Vertrauenseinstellungen."
+ }
+ },
+ "es" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Para dejar de confiar en él, abre en Acceso a Llaveros el certificado cuyo nombre empieza por %@ y modifica sus ajustes de confianza."
+ }
+ },
+ "fr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Pour que ce Mac ne s’y fie plus, ouvrez le certificat dont le nom commence par %@ dans Trousseaux d’accès, puis modifiez ses réglages de confiance."
+ }
+ },
+ "it" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Per non considerarlo più attendibile, apri in Accesso Portachiavi il certificato il cui nome inizia con %@ e modificane le impostazioni di attendibilità."
+ }
+ },
+ "ja" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "この証明書が信頼されないようにするには、キーチェーンアクセスで名前が“%@”で始まる証明書を開き、信頼設定を変更してください。"
+ }
+ },
+ "ko" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "이 인증서를 더 이상 신뢰하지 않으려면 키체인 접근에서 이름이 ‘%@’(으)로 시작하는 인증서를 열고 신뢰 설정을 변경하십시오."
+ }
+ },
+ "nl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Om het niet langer te vertrouwen, open je in Sleutelhanger­toegang het certificaat waarvan de naam begint met %@ en pas je de vertrouwensinstellingen ervan aan."
+ }
+ },
+ "pl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Aby przestać mu ufać, otwórz w aplikacji Dostęp do pęku kluczy certyfikat, którego nazwa zaczyna się od %@, i zmień jego ustawienia zaufania."
+ }
+ },
+ "pt" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Para deixar de confiar nele, abra no Acesso às Chaves o certificado cujo nome começa com %@ e altere os ajustes de confiança dele."
+ }
+ },
+ "ro" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Pentru a‑i retrage încrederea, deschideți în Acces portchei certificatul al cărui nume începe cu %@ și modificați‑i configurările de încredere."
+ }
+ },
+ "ru" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Чтобы перестать ему доверять, откройте в Связке ключей сертификат, имя которого начинается с «%@», и измените его настройки доверия."
+ }
+ },
+ "sv" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Om du vill sluta lita på det öppnar du certifikatet vars namn börjar med %@ i Nyckelhanterare och ändrar dess tillförlitlighetsinställningar."
+ }
+ },
+ "tr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Bu sertifikaya artık güvenilmemesi için, adı %@ ile başlayan sertifikayı Anahtar Zinciri Erişimi’nde açın ve güven ayarlarını değiştirin."
+ }
+ },
+ "uk" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Щоб скасувати довіру до нього, відкрийте в програмі «Ключар» сертифікат, назва якого починається з «%@», і змініть його параметри довіри."
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "若要停止信任它,请在“钥匙串访问”中打开名称以“%@”开头的证书,然后更改它的信任设置。"
+ }
+ },
+ "zh-Hant" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "若要停止信任它,請用「鑰匙圈存取」打開名稱以「%@」開頭的憑證,然後更改其信任設定。"
+ }
+ }
+ }
+ },
+ "To stop trusting it, run `%@` first." : {
+ "localizations" : {
+ "cs" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Chcete-li mu přestat důvěřovat, nejdřív spusťte příkaz `%@`."
+ }
+ },
+ "de" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Um ihm das Vertrauen zu entziehen, führe zuerst `%@` aus."
+ }
+ },
+ "es" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Para dejar de confiar en él, ejecuta primero `%@`."
+ }
+ },
+ "fr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Pour que ce Mac ne s’y fie plus, exécutez d’abord `%@`."
+ }
+ },
+ "it" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Per non considerarlo più attendibile, esegui prima `%@`."
+ }
+ },
+ "ja" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "この証明書が信頼されないようにするには、先に`%@`を実行してください。"
+ }
+ },
+ "ko" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "이 인증서를 더 이상 신뢰하지 않으려면 먼저 `%@` 명령을 실행하십시오."
+ }
+ },
+ "nl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Om het niet langer te vertrouwen, voer je eerst `%@` uit."
+ }
+ },
+ "pl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Aby przestać mu ufać, najpierw uruchom `%@`."
+ }
+ },
+ "pt" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Para deixar de confiar nele, execute `%@` primeiro."
+ }
+ },
+ "ro" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Pentru a‑i retrage încrederea, rulați mai întâi `%@`."
+ }
+ },
+ "ru" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Чтобы перестать ему доверять, сначала выполните `%@`."
+ }
+ },
+ "sv" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Om du vill sluta lita på det kör du först `%@`."
+ }
+ },
+ "tr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Bu sertifikaya artık güvenilmemesi için önce `%@` komutunu çalıştırın."
+ }
+ },
+ "uk" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Щоб скасувати довіру до нього, спершу виконайте `%@`."
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "若要停止信任它,请先运行`%@`。"
+ }
+ },
+ "zh-Hant" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "若要停止信任它,請先執行`%@`。"
+ }
+ }
+ }
+ },
"Too large to tell when it last changed" : {
"localizations" : {
"cs" : {
diff --git a/Packages/PeelCore/Sources/PeelCommandLine/Commands/AppCommands.swift b/Packages/PeelCore/Sources/PeelCommandLine/Commands/AppCommands.swift
index c3409644..b4f03f13 100644
--- a/Packages/PeelCore/Sources/PeelCommandLine/Commands/AppCommands.swift
+++ b/Packages/PeelCore/Sources/PeelCommandLine/Commands/AppCommands.swift
@@ -518,7 +518,8 @@ struct UninstallCommand: AsyncParsableCommand {
?? AppInspector.knownName(forBundleIdentifier: identifier)
}
- /// What the removal does that the Trash can't bring back, said before the question.
+ /// What the removal does that the Trash can't bring back, and a root certificate the app leaves trusted, said
+ /// before the question.
static func warnings(
moving urls: Set<URL>,
of app: InstalledApp,
@@ -539,6 +540,15 @@ struct UninstallCommand: AsyncParsableCommand {
warnings.append("Once \(app.app.name) leaves the Applications folder, its own uninstaller opens and asks to remove the components it keeps in the system. If you continue there, it deletes them, which the Trash can't bring back.")
}
}
+ if urls.contains(app.url), let root = TrustedRoot.of(app) {
+ let step = switch root.step {
+ case .command(let command): "run `\(command)` first"
+ case .menu(let menu): "choose \(menu) in \(app.name) first"
+ case .keychainAccess:
+ "open the certificate whose name begins with \(root.certificate) in Keychain Access and change its trust settings"
+ }
+ warnings.append("\(app.name)'s root certificate stays trusted on this Mac after the app goes. To stop trusting it, \(step).")
+ }
return warnings
}
diff --git a/Packages/PeelCore/Sources/PeelCore/Removal/TrustedRoot.swift b/Packages/PeelCore/Sources/PeelCore/Removal/TrustedRoot.swift
new file mode 100644
index 00000000..da509796
--- /dev/null
+++ b/Packages/PeelCore/Sources/PeelCore/Removal/TrustedRoot.swift
@@ -0,0 +1,53 @@
+/// A root certificate a tool or an app adds to the certificates the Mac trusts, which stays trusted after it goes
+/// until its maker's step takes it out. Peel never reads or changes a keychain: it names the certificate and the step.
+public struct TrustedRoot: Sendable, Hashable {
+ public enum Step: Sendable, Hashable {
+ /// A command of the tool's own, run before it goes.
+ case command(String)
+ /// A command in the app's own menus, chosen before it goes.
+ case menu(String)
+ /// Keychain Access, where Apple's Keychain Access User Guide changes a certificate's trust settings.
+ case keychainAccess
+ }
+
+ /// How the certificate's name begins in Keychain Access.
+ public let certificate: String
+ public let step: Step
+
+ /// What a package Homebrew installed leaves trusted once `brew uninstall` has removed it.
+ public static func of(_ package: HomebrewPackage) -> TrustedRoot? {
+ switch package.kind {
+ case .formula: byFormula[package.fullName]
+ case .cask: byCask[package.fullName]
+ }
+ }
+
+ /// What an app leaves trusted once Peel has moved it to the Trash, which runs none of a cask's uninstall steps.
+ public static func of(_ app: InstalledApp) -> TrustedRoot? {
+ app.bundleIdentifier.flatMap { byApp[$0] }
+ }
+
+ private static let byFormula: [String: TrustedRoot] = [
+ // Caddy's "Automatic HTTPS" and "Command Line" pages.
+ "caddy": TrustedRoot(certificate: "Caddy Local Authority", step: .command("caddy untrust")),
+ // mkcert's README and usage text.
+ "mkcert": TrustedRoot(certificate: "mkcert", step: .command("mkcert -uninstall")),
+ // puma-dev's README and its `Uninstall` on macOS.
+ "puma/puma/puma-dev": TrustedRoot(certificate: "Puma-dev CA", step: .command("puma-dev -uninstall")),
+ ]
+
+ /// Casks whose own uninstall steps leave their certificate, which Charles's and Proxyman's delete.
+ private static let byCask: [String: TrustedRoot] = [
+ // mitmproxy's "Certificates" page puts it in the System keychain, and its cask removes no certificate.
+ "mitmproxy": TrustedRoot(certificate: "mitmproxy", step: .keychainAccess),
+ ]
+
+ private static let byApp: [String: TrustedRoot] = [
+ // Charles's "SSL Certificates" page.
+ "com.xk72.Charles": TrustedRoot(certificate: "Charles Proxy", step: .keychainAccess),
+ // Proxyman's "Install & Trust Proxyman Certificates on your Mac".
+ "com.proxyman.NSProxy": TrustedRoot(
+ certificate: "Proxyman CA", step: .menu("Certificate > Reset all Proxyman Certificates")
+ ),
+ ]
+}
diff --git a/Packages/PeelCore/Tests/PeelCoreTests/CommandLineTests.swift b/Packages/PeelCore/Tests/PeelCoreTests/CommandLineTests.swift
index b48963f8..e1a222e2 100644
--- a/Packages/PeelCore/Tests/PeelCoreTests/CommandLineTests.swift
+++ b/Packages/PeelCore/Tests/PeelCoreTests/CommandLineTests.swift
@@ -143,6 +143,25 @@ struct CommandLineTests {
#expect(UninstallCommand.warnings(moving: [], of: mullvad, resettingPrivacy: false).isEmpty)
}
+ @Test func saysWhatRootCertificateStaysTrustedOnceTheAppGoes() {
+ let proxyman = InstalledApp(
+ url: URL(filePath: "/Applications/Proxyman.app", directoryHint: .isDirectory),
+ bundleIdentifier: "com.proxyman.NSProxy", name: "Proxyman"
+ )
+ let charles = InstalledApp(
+ url: URL(filePath: "/Applications/Charles.app", directoryHint: .isDirectory),
+ bundleIdentifier: "com.xk72.Charles", name: "Charles"
+ )
+
+ #expect(UninstallCommand.warnings(moving: [proxyman.url], of: proxyman, resettingPrivacy: false) == [
+ "Proxyman's root certificate stays trusted on this Mac after the app goes. To stop trusting it, choose Certificate > Reset all Proxyman Certificates in Proxyman first.",
+ ])
+ #expect(UninstallCommand.warnings(moving: [charles.url], of: charles, resettingPrivacy: false) == [
+ "Charles's root certificate stays trusted on this Mac after the app goes. To stop trusting it, open the certificate whose name begins with Charles Proxy in Keychain Access and change its trust settings.",
+ ])
+ #expect(UninstallCommand.warnings(moving: [], of: proxyman, resettingPrivacy: false).isEmpty)
+ }
+
/// Like the app, `peel uninstall` takes the app's icon out of the Dock once the app is in the Trash, unless told
/// to keep it, and says so before it asks.
@Test func takesTheAppsIconOutOfTheDockOnceItIsInTheTrash() {
diff --git a/Packages/PeelCore/Tests/PeelCoreTests/TrustedRootTests.swift b/Packages/PeelCore/Tests/PeelCoreTests/TrustedRootTests.swift
new file mode 100644
index 00000000..50dd289b
--- /dev/null
+++ b/Packages/PeelCore/Tests/PeelCoreTests/TrustedRootTests.swift
@@ -0,0 +1,30 @@
+import Foundation
+@testable import PeelCore
+import Testing
+
+@Suite struct TrustedRootTests {
+ @Test func namesTheRootAToolLeavesTrustedAfterHomebrewRemovesIt() {
+ func root(_ name: String, _ kind: HomebrewPackage.Kind, fullName: String? = nil) -> TrustedRoot? {
+ TrustedRoot.of(HomebrewPackage(name: name, kind: kind, fullName: fullName))
+ }
+
+ #expect(root("caddy", .formula)?.step == .command("caddy untrust"))
+ #expect(root("mkcert", .formula)?.step == .command("mkcert -uninstall"))
+ #expect(root("puma-dev", .formula, fullName: "puma/puma/puma-dev")?.step == .command("puma-dev -uninstall"))
+ #expect(root("mitmproxy", .cask) == TrustedRoot(certificate: "mitmproxy", step: .keychainAccess))
+ #expect(root("caddy", .formula, fullName: "example/tap/caddy") == nil)
+ #expect(root("mitmproxy", .formula) == nil)
+ #expect(root("charles", .cask) == nil, "Homebrew's uninstall deletes Charles's certificate")
+ #expect(root("proxyman", .cask) == nil)
+ }
+
+ @Test func namesTheRootAnAppLeavesTrustedOncePeelHasMovedIt() {
+ func root(_ identifier: String) -> TrustedRoot? {
+ TrustedRoot.of(InstalledApp(url: URL(filePath: "/Applications/Example.app"), bundleIdentifier: identifier, name: "Example"))
+ }
+
+ #expect(root("com.xk72.Charles") == TrustedRoot(certificate: "Charles Proxy", step: .keychainAccess))
+ #expect(root("com.proxyman.NSProxy")?.step == .menu("Certificate > Reset all Proxyman Certificates"))
+ #expect(root("org.example.charles") == nil)
+ }
+}
diff --git a/Peel/Views/AppDetailView.swift b/Peel/Views/AppDetailView.swift
index 0d420dae..8be31e3f 100644
--- a/Peel/Views/AppDetailView.swift
+++ b/Peel/Views/AppDetailView.swift
@@ -470,7 +470,7 @@ struct AppDetailView: View {
}
/// The confirmation's message: the privacy reset, which History can't undo, an app that uninstalls itself once
- /// it moves, and Homebrew's own record of the app when it stays.
+ /// it moves, a root certificate it leaves trusted, and Homebrew's own record of the app when it stays.
private var removalNote: Text? {
let urls = plan.question.request?.urls ?? []
var lines: [Text] = []
@@ -478,6 +478,10 @@ struct AppDetailView: View {
lines.append(Text("The app’s privacy permissions are cleared first, and History can’t bring them back."))
}
lines += UninstallsItself.when(moving: urls, among: [plan.app]).map(\.warning)
+ if urls.contains(plan.app.url), let root = TrustedRoot.of(plan.app) {
+ lines.append(Text("\(plan.app.name)’s root certificate stays trusted on this Mac after the app goes."))
+ lines.append(root.step(in: plan.app.name))
+ }
let movesItsReceipt = plan.uninstallation?.scan.leftovers.contains {
$0.kind == .homebrewReceipt && urls.contains($0.url)
} == true
diff --git a/Peel/Views/Homebrew/HomebrewDetailView.swift b/Peel/Views/Homebrew/HomebrewDetailView.swift
index 67be6ac9..a7f3bb39 100644
--- a/Peel/Views/Homebrew/HomebrewDetailView.swift
+++ b/Peel/Views/Homebrew/HomebrewDetailView.swift
@@ -294,11 +294,19 @@ struct HomebrewDetailView: View {
return whatUsesIt.map { Text("\($0)\n\n\(deletesAndLeaves)") } ?? deletesAndLeaves
}
- /// What Homebrew leaves of a formula, which it says nothing of before it deletes the rest.
+ /// What Homebrew leaves of a package, which it says nothing of before it deletes the rest.
private var whatStays: Text? {
- guard let folders = inUse?.dataFolders, !folders.isEmpty else { return nil }
- let places = folders.map(\.abbreviatedPath).formatted(.list(type: .and))
- return Text("Homebrew leaves \(places), with any data or settings the formula kept there.")
+ var lines: [Text] = []
+ if let folders = inUse?.dataFolders, !folders.isEmpty {
+ let places = folders.map(\.abbreviatedPath).formatted(.list(type: .and))
+ lines.append(Text("Homebrew leaves \(places), with any data or settings the formula kept there."))
+ }
+ if let root = TrustedRoot.of(package) {
+ lines.append(Text("\(package.name) added a root certificate to the certificates this Mac trusts, and Homebrew leaves it trusted."))
+ lines.append(root.step(in: package.name))
+ }
+ guard let first = lines.first else { return nil }
+ return lines.dropFirst().reduce(first) { Text("\($0)\n\n\($1)") }
}
/// What Homebrew won't look at before it deletes a formula, said before it does.
diff --git a/Peel/Views/MultipleAppsView.swift b/Peel/Views/MultipleAppsView.swift
index 79a9ae62..38cec225 100644
--- a/Peel/Views/MultipleAppsView.swift
+++ b/Peel/Views/MultipleAppsView.swift
@@ -316,8 +316,9 @@ struct MultipleAppsView: View {
return lines.isEmpty ? nil : lines.joined(separator: "\n\n")
}
- /// Under the question: which of the chosen apps go and which stay, the privacy reset, which History can't undo, and
- /// Homebrew's record of an app that goes while its record stays.
+ /// Under the question: which of the chosen apps go and which stay, the privacy reset, which History can't undo, a
+ /// root certificate an app that goes leaves trusted, and Homebrew's record of an app that goes while its record
+ /// stays.
private func note(about urls: Set<URL>) -> Text {
let going = plan.apps.filter { urls.contains($0.url) }
let staying = plan.apps.filter { !urls.contains($0.url) && !plan.appsInTheTrash.contains($0.url) }
@@ -332,6 +333,11 @@ struct MultipleAppsView: View {
lines.append(Text("The selected apps’ privacy permissions are cleared first, and History can’t bring them back."))
}
lines += UninstallsItself.when(moving: urls, among: plan.apps).map(\.warning)
+ for app in going {
+ guard let root = TrustedRoot.of(app) else { continue }
+ lines.append(Text("\(app.name)’s root certificate stays trusted on this Mac after the app goes."))
+ lines.append(root.step(in: app.name))
+ }
for app in going {
let movesItsReceipt = plan.items.contains {
$0.kind == .homebrewReceipt && $0.apps.contains(app.reference) && urls.contains($0.url)
diff --git a/Peel/Views/Presentation.swift b/Peel/Views/Presentation.swift
index a816a222..577b6a16 100644
--- a/Peel/Views/Presentation.swift
+++ b/Peel/Views/Presentation.swift
@@ -142,6 +142,18 @@ extension UninstallsItself {
}
}
+extension TrustedRoot {
+ /// What stops the Mac trusting the certificate, as its maker or Apple says; `app` names the app whose menu it is.
+ func step(in app: String) -> Text {
+ switch step {
+ case .command(let command): Text("To stop trusting it, run `\(command)` first.")
+ case .menu(let menu): Text("To stop trusting it, choose \(menu) in \(app) first.")
+ case .keychainAccess:
+ Text("To stop trusting it, open the certificate whose name begins with \(certificate) in Keychain Access and change its trust settings.")
+ }
+ }
+}
+
/// What Peel says beside a kernel extension it lists.
enum KernelExtensionNotes {
static func lines(onAppleSilicon: Bool = HostArchitecture.isAppleSilicon) -> [String] {