@@ -12,7 +12,7 @@ import TableProPluginKit
1212@MainActor @Observable
1313final class PluginManager {
1414 static let shared = PluginManager ( )
15- static let currentPluginKitVersion = 1
15+ static let currentPluginKitVersion = 2
1616 private static let disabledPluginsKey = " com.TablePro.disabledPlugins "
1717 private static let legacyDisabledPluginsKey = " disabledPlugins "
1818
@@ -161,6 +161,15 @@ final class PluginManager {
161161 }
162162
163163 if source == . userInstalled {
164+ // User-installed plugins compiled against an older DriverPlugin protocol
165+ // have stale witness tables — accessing protocol properties crashes with
166+ // EXC_BAD_ACCESS. Reject them before loading the bundle.
167+ if pluginKitVersion < Self . currentPluginKitVersion {
168+ throw PluginError . incompatibleVersion (
169+ required: Self . currentPluginKitVersion,
170+ current: pluginKitVersion
171+ )
172+ }
164173 try verifyCodeSignature ( bundle: bundle)
165174 }
166175
@@ -191,6 +200,12 @@ final class PluginManager {
191200 }
192201
193202 if source == . userInstalled {
203+ if pluginKitVersion < Self . currentPluginKitVersion {
204+ throw PluginError . incompatibleVersion (
205+ required: Self . currentPluginKitVersion,
206+ current: pluginKitVersion
207+ )
208+ }
194209 try verifyCodeSignature ( bundle: bundle)
195210 }
196211
0 commit comments