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 where an Intel plug-in can still load

Țugui Dragoșb10301df3294
diff --git a/Localization/Peel/Localizable.xcstrings b/Localization/Peel/Localizable.xcstrings
index ab96c2c6..d5ba9219 100644
--- a/Localization/Peel/Localizable.xcstrings
+++ b/Localization/Peel/Localizable.xcstrings
@@ -181923,6 +181923,218 @@
}
}
},
+ "This plug-in is Intel only. It loads only in an app that runs through Rosetta, or that asks macOS to load it in a process of its own." : {
+ "localizations" : {
+ "cs" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Tento plug-in je jen pro procesory Intel. Načte se jen v aplikaci, která běží v prostředí Rosetta, nebo která systém macOS požádá, aby ho načetl v samostatném procesu."
+ }
+ },
+ "de" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Dieses Plug-in ist nur für Intel. Es wird nur in einer App geladen, die über Rosetta läuft oder macOS auffordert, es in einem eigenen Prozess zu laden."
+ }
+ },
+ "es" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Este módulo es solo para Intel. Solo se carga en una app que se ejecute mediante Rosetta, o que pida a macOS que lo cargue en un proceso propio."
+ }
+ },
+ "fr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Ce module n’existe qu’en version Intel. Il ne se charge que dans une app qui s’exécute grâce à Rosetta, ou qui demande à macOS de le charger dans un processus distinct."
+ }
+ },
+ "it" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Questo plugin è solo per Intel. Si carica solo in un’app che funziona tramite Rosetta, o che chiede a macOS di caricarlo in un processo separato."
+ }
+ },
+ "ja" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "このプラグインはIntel専用です。Rosetta経由で動作するアプリか、独立したプロセスで読み込むようmacOSに要求するアプリでのみ読み込まれます。"
+ }
+ },
+ "ko" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "이 플러그인은 Intel 전용입니다. Rosetta를 통해 실행되는 앱이나, macOS에 이 플러그인을 별도의 프로세스에서 로드하도록 요청하는 앱에서만 로드됩니다."
+ }
+ },
+ "nl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Deze plug-in is alleen voor Intel. Die wordt alleen geladen in een app die via Rosetta werkt, of in een app die macOS vraagt om de plug-in in een apart proces te laden."
+ }
+ },
+ "pl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Ta wtyczka jest tylko dla procesorów Intel. Wczytuje się tylko w aplikacji działającej za pomocą Rosetty albo w takiej, która prosi macOS o wczytanie jej w osobnym procesie."
+ }
+ },
+ "pt" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Este plug-in é só para Intel. Ele só é carregado em um app executado pelo Rosetta, ou que peça ao macOS para carregá-lo em um processo próprio."
+ }
+ },
+ "ro" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Acest plug-in este doar pentru Intel. Se încarcă doar într‑o aplicație care rulează prin Rosetta sau care îi cere sistemului macOS să îl încarce într‑un proces propriu."
+ }
+ },
+ "ru" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Этот плагин собран только для Intel. Он загружается только в приложении, которое работает через Rosetta или просит macOS загрузить плагин в отдельном процессе."
+ }
+ },
+ "sv" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Den här insticksfilen är bara för Intel. Den läses bara in i en app som körs via Rosetta, eller som ber macOS att läsa in den i en egen process."
+ }
+ },
+ "tr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Bu yazılım eki yalnızca Intel içindir. Yalnızca Rosetta ile çalışan bir uygulamada veya onu kendi ayrı işleminde yüklemesini macOS’ten isteyen bir uygulamada yüklenir."
+ }
+ },
+ "uk" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Цей плагін призначений лише для Intel. Він завантажується лише в програмі, яка працює через Rosetta або просить macOS завантажити його в окремому процесі."
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "此插件仅支持Intel。它只能在通过Rosetta运行的App中载入,或者在要求macOS于独立进程中载入它的App中载入。"
+ }
+ },
+ "zh-Hant" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "此外掛模組僅支援Intel。它只能在透過Rosetta執行的App中載入,或是由App要求macOS在獨立程序中載入它。"
+ }
+ }
+ }
+ },
+ "This plug-in is Intel only. It loads only inside an app that itself runs through Rosetta." : {
+ "localizations" : {
+ "cs" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Tento plug-in je jen pro procesory Intel. Načte se jen v aplikaci, která sama běží v prostředí Rosetta."
+ }
+ },
+ "de" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Dieses Plug-in ist nur für Intel. Es wird nur in einer App geladen, die selbst über Rosetta läuft."
+ }
+ },
+ "es" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Este módulo es solo para Intel. Solo se carga dentro de una app que a su vez se ejecute mediante Rosetta."
+ }
+ },
+ "fr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Ce module n’existe qu’en version Intel. Il ne se charge que dans une app qui s’exécute elle-même grâce à Rosetta."
+ }
+ },
+ "it" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Questo plugin è solo per Intel. Si carica solo all’interno di un’app che a sua volta funziona tramite Rosetta."
+ }
+ },
+ "ja" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "このプラグインはIntel専用です。それ自体がRosetta経由で動作するアプリの中でのみ読み込まれます。"
+ }
+ },
+ "ko" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "이 플러그인은 Intel 전용입니다. 앱 자체가 Rosetta를 통해 실행되는 경우에만 그 앱 안에서 로드됩니다."
+ }
+ },
+ "nl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Deze plug-in is alleen voor Intel. Die wordt alleen geladen in een app die zelf via Rosetta werkt."
+ }
+ },
+ "pl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Ta wtyczka jest tylko dla procesorów Intel. Wczytuje się tylko w aplikacji, która sama działa za pomocą Rosetty."
+ }
+ },
+ "pt" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Este plug-in é só para Intel. Ele só é carregado dentro de um app que seja, ele próprio, executado pelo Rosetta."
+ }
+ },
+ "ro" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Acest plug-in este doar pentru Intel. Se încarcă doar într‑o aplicație care rulează ea însăși prin Rosetta."
+ }
+ },
+ "ru" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Этот плагин собран только для Intel. Он загружается только внутри приложения, которое само работает через Rosetta."
+ }
+ },
+ "sv" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Den här insticksfilen är bara för Intel. Den läses bara in i en app som själv körs via Rosetta."
+ }
+ },
+ "tr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Bu yazılım eki yalnızca Intel içindir. Yalnızca kendisi de Rosetta ile çalışan bir uygulamanın içinde yüklenir."
+ }
+ },
+ "uk" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Цей плагін призначений лише для Intel. Він завантажується лише всередині програми, яка сама працює через Rosetta."
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "此插件仅支持Intel。它只能在本身通过Rosetta运行的App内载入。"
+ }
+ },
+ "zh-Hant" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "此外掛模組僅支援Intel。它只會在本身透過Rosetta執行的App中載入。"
+ }
+ }
+ }
+ },
"This plug-in is Intel only. On this Intel Mac it loads natively." : {
"localizations" : {
"cs" : {
@@ -217832,6 +218044,112 @@
}
}
},
+ "macOS 27 opens an app natively even if you set it to open using Rosetta." : {
+ "localizations" : {
+ "cs" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Systém macOS 27 otevře aplikaci nativně, i když jste u ní zaškrtli políčko Otevřít pomocí Rosetty."
+ }
+ },
+ "de" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "macOS 27 öffnet eine App nativ, auch wenn du „Mit Rosetta öffnen“ für sie aktiviert hast."
+ }
+ },
+ "es" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "macOS 27 abre una app de forma nativa aunque la hayas configurado para abrirse con Rosetta."
+ }
+ },
+ "fr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "macOS 27 ouvre une app en natif, même si vous avez coché « Ouvrir avec Rosetta » pour celle-ci."
+ }
+ },
+ "it" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "macOS 27 apre un’app in modo nativo anche se hai selezionato “Apri con Rosetta”."
+ }
+ },
+ "ja" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "“Rosettaを使用して開く”を選択していても、macOS 27はアプリをネイティブで開きます。"
+ }
+ },
+ "ko" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "macOS 27은 ‘Rosetta를 사용하여 열기’를 선택한 앱도 네이티브로 엽니다."
+ }
+ },
+ "nl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "macOS 27 opent een app native, ook als je voor die app 'Open met Rosetta' hebt geselecteerd."
+ }
+ },
+ "pl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "macOS 27 otwiera aplikację natywnie, nawet jeśli zaznaczysz dla niej opcję „Otwórz, używając Rosetty”."
+ }
+ },
+ "pt" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "O macOS 27 abre um app nativamente mesmo que você tenha marcado “Abrir com Rosetta” para ele."
+ }
+ },
+ "ro" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "macOS 27 deschide nativ o aplicație chiar dacă ați setat‑o să se deschidă utilizând Rosetta."
+ }
+ },
+ "ru" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "macOS 27 открывает приложение нативно, даже если Вы установили для него флажок «Открыть с помощью Rosetta»."
+ }
+ },
+ "sv" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "macOS 27 öppnar en app utan Rosetta även om du har markerat Öppna med Rosetta för appen."
+ }
+ },
+ "tr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "macOS 27, bir uygulama için “Rosetta’yı kullanarak aç” seçeneğini seçmiş olsanız bile uygulamayı yerel olarak açar."
+ }
+ },
+ "uk" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "macOS 27 відкриває програму нативно, навіть якщо ви вибрали для неї «Відкрити за допомогою Rosetta»."
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "即使你将App设为“使用Rosetta打开”,macOS 27也会以原生方式打开它。"
+ }
+ },
+ "zh-Hant" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "即使你已將App設為「使用Rosetta打開」,macOS 27仍會以原生方式打開它。"
+ }
+ }
+ }
+ },
"macOS Didn’t Answer" : {
"localizations" : {
"cs" : {
diff --git a/Packages/PeelCore/Sources/PeelCore/Apps/IntelInspector.swift b/Packages/PeelCore/Sources/PeelCore/Apps/IntelInspector.swift
index 5504b5b4..202b321c 100644
--- a/Packages/PeelCore/Sources/PeelCore/Apps/IntelInspector.swift
+++ b/Packages/PeelCore/Sources/PeelCore/Apps/IntelInspector.swift
@@ -20,6 +20,8 @@ public struct IntelFinding: Sendable, Hashable, Identifiable {
public let owner: String?
/// Nil when the size is not known because measuring it timed out or was refused. Unknown is not zero.
public let size: Int64?
+ /// For a plug-in, its kind, which says where its Intel code can load (`Plugin.Category.intelHost`).
+ public var pluginCategory: Plugin.Category?
public var id: URL { url }
}
@@ -148,6 +150,7 @@ public enum IntelInspector {
name: plugin.name,
owner: nil,
size: plugin.size,
+ pluginCategory: plugin.category,
))
}
diff --git a/Packages/PeelCore/Sources/PeelCore/Plugins/IntelPluginHost.swift b/Packages/PeelCore/Sources/PeelCore/Plugins/IntelPluginHost.swift
new file mode 100644
index 00000000..13c29506
--- /dev/null
+++ b/Packages/PeelCore/Sources/PeelCore/Plugins/IntelPluginHost.swift
@@ -0,0 +1,32 @@
+extension Plugin.Category {
+ /// Where an Intel copy of a plug-in of this kind can load on a Mac with Apple silicon. Rosetta translates a whole
+ /// process, and a process never mixes Intel code with Apple silicon code ("About the Rosetta translation
+ /// environment"), so a plug-in loaded into an app's own process loads only while that app runs through Rosetta.
+ public enum IntelHost: Sendable, Hashable {
+ /// In an Intel process macOS keeps for plug-ins of this kind (`intelHostPrograms`).
+ case aProcessOfItsOwn
+ /// In such a process when the app asks macOS to load it outside its own, and otherwise inside the app.
+ case outsideTheAppWhenAsked
+ /// Inside the app that uses it.
+ case insideTheApp
+ case notKnown
+ }
+
+ public var intelHost: IntelHost {
+ switch self {
+ case .audioDrivers, .screenSavers, .preferencePanes, .spotlight: .aProcessOfItsOwn
+ case .audioUnits: .outsideTheAppWhenAsked
+ case .vst, .vst3, .clap, .aax, .mas, .colorPickers, .imageUnits, .mailBundles, .contactsPlugIns: .insideTheApp
+ default: .notKnown
+ }
+ }
+
+ /// The Intel program macOS keeps to load plug-ins of each kind it hosts, which is what proves it.
+ static let intelHostPrograms: [Plugin.Category: String] = [
+ .audioDrivers: "/System/Library/Frameworks/CoreAudio.framework/Versions/A/XPCServices/com.apple.audio.Core-Audio-Driver-Service.xpc/Contents/MacOS/com.apple.audio.Core-Audio-Driver-Service",
+ .screenSavers: "/System/Library/Frameworks/ScreenSaver.framework/PlugIns/legacyScreenSaver-x86_64.appex/Contents/MacOS/legacyScreenSaver-x86_64",
+ .preferencePanes: "/System/Library/Frameworks/PreferencePanes.framework/Versions/A/XPCServices/legacyLoader-x86_64.xpc/Contents/MacOS/legacyLoader-x86_64",
+ .spotlight: "/System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Versions/A/Support/mdworker_shared",
+ .audioUnits: "/System/Library/Frameworks/AudioToolbox.framework/XPCServices/AUHostingServiceXPC.xpc/Contents/MacOS/AUHostingServiceXPC",
+ ]
+}
diff --git a/Packages/PeelCore/Tests/PeelCoreTests/IntelPluginHostTests.swift b/Packages/PeelCore/Tests/PeelCoreTests/IntelPluginHostTests.swift
new file mode 100644
index 00000000..8ef6207f
--- /dev/null
+++ b/Packages/PeelCore/Tests/PeelCoreTests/IntelPluginHostTests.swift
@@ -0,0 +1,23 @@
+import Foundation
+@testable import PeelCore
+import Testing
+
+struct IntelPluginHostTests {
+ @Test func saysWhereAnIntelPlugInCanStillLoad() {
+ #expect(Plugin.Category.audioDrivers.intelHost == .aProcessOfItsOwn)
+ #expect(Plugin.Category.screenSavers.intelHost == .aProcessOfItsOwn)
+ #expect(Plugin.Category.audioUnits.intelHost == .outsideTheAppWhenAsked)
+ #expect(Plugin.Category.vst3.intelHost == .insideTheApp)
+ #expect(Plugin.Category.colorPickers.intelHost == .insideTheApp)
+ #expect(Plugin.Category.services.intelHost == .notKnown)
+ }
+
+ @Test func everyHostMacOSKeepsForIntelPlugInsIsInTheSealedSystem() {
+ let ownProcess = Plugin.Category.allCases.filter { $0.intelHost == .aProcessOfItsOwn || $0 == .audioUnits }
+ #expect(Set(Plugin.Category.intelHostPrograms.keys) == Set(ownProcess))
+ for (category, program) in Plugin.Category.intelHostPrograms {
+ let architectures = MachOHeader.architectures(ofExecutableAt: URL(filePath: program))
+ #expect(architectures.contains(.x86_64), "\(category): \(program)")
+ }
+ }
+}
diff --git a/Peel/Model/IntelLibrary.swift b/Peel/Model/IntelLibrary.swift
index 5f7bd6e7..8243543f 100644
--- a/Peel/Model/IntelLibrary.swift
+++ b/Peel/Model/IntelLibrary.swift
@@ -88,3 +88,23 @@ extension IntelFinding.Kind {
}
}
}
+
+extension IntelFinding {
+ /// Explains the finding, a plug-in by where its Intel code can load (`Plugin.Category.intelHost`).
+ func explanation(onAppleSilicon: Bool) -> LocalizedStringResource {
+ guard onAppleSilicon, kind == .plugin else { return kind.explanation(onAppleSilicon: onAppleSilicon) }
+ return switch pluginCategory?.intelHost {
+ case .insideTheApp:
+ "This plug-in is Intel only. It loads only inside an app that itself runs through Rosetta."
+ case .outsideTheAppWhenAsked:
+ "This plug-in is Intel only. It loads only in an app that runs through Rosetta, or that asks macOS to load it in a process of its own."
+ default:
+ kind.explanation(onAppleSilicon: onAppleSilicon)
+ }
+ }
+
+ /// Whether an app that loads the plug-in decides whether it loads, as for a plug-in loaded inside the app.
+ var loadsThroughAnApp: Bool {
+ kind == .plugin && [.insideTheApp, .outsideTheAppWhenAsked].contains(pluginCategory?.intelHost)
+ }
+}
diff --git a/Peel/Views/Intel/IntelDetailView.swift b/Peel/Views/Intel/IntelDetailView.swift
index 14dee8ab..b6b9a925 100644
--- a/Peel/Views/Intel/IntelDetailView.swift
+++ b/Peel/Views/Intel/IntelDetailView.swift
@@ -25,8 +25,13 @@ struct IntelDetailView: View {
}
Section {
- Text(finding.kind.explanation(onAppleSilicon: HostArchitecture.isAppleSilicon))
+ Text(finding.explanation(onAppleSilicon: HostArchitecture.isAppleSilicon))
.font(.callout)
+ if #available(macOS 27, *), HostArchitecture.isAppleSilicon, finding.loadsThroughAnApp {
+ Text("macOS 27 opens an app natively even if you set it to open using Rosetta.")
+ .font(.callout)
+ .foregroundStyle(.secondary)
+ }
if !HostArchitecture.isAppleSilicon {
Text("On an Apple silicon Mac it would need Rosetta.")
.font(.callout)
diff --git a/PeelTests/IntelExplanationTests.swift b/PeelTests/IntelExplanationTests.swift
new file mode 100644
index 00000000..66e98e4f
--- /dev/null
+++ b/PeelTests/IntelExplanationTests.swift
@@ -0,0 +1,24 @@
+import Foundation
+@testable import Peel
+@testable import PeelCore
+import Testing
+
+@MainActor
+struct IntelExplanationTests {
+ private func plugin(_ category: Plugin.Category) -> IntelFinding {
+ IntelFinding(
+ url: URL(filePath: "/Library/Audio/Plug-Ins/Components/Synth.component"), kind: .plugin, name: "Synth",
+ owner: nil, size: 10, pluginCategory: category
+ )
+ }
+
+ @Test func saysWhereAnIntelPlugInCanLoad() {
+ let words = { (finding: IntelFinding) in String(localized: finding.explanation(onAppleSilicon: true)) }
+
+ #expect(words(plugin(.vst3)) == String(localized: "This plug-in is Intel only. It loads only inside an app that itself runs through Rosetta."))
+ #expect(words(plugin(.audioDrivers)) == String(localized: "This plug-in is Intel only, so it needs Rosetta to load."))
+ #expect(plugin(.vst3).loadsThroughAnApp && plugin(.audioUnits).loadsThroughAnApp)
+ #expect(!plugin(.screenSavers).loadsThroughAnApp)
+ #expect(String(localized: plugin(.vst3).explanation(onAppleSilicon: false)) == String(localized: "This plug-in is Intel only. On this Intel Mac it loads natively."))
+ }
+}