0

我有开发两个 SIMBL 插件的经验。

目前这些都在 Mac OS X 10.6.6 上正常工作。

我打算制作一个新的SIMBL 插件来修改 Menu Extra 的行为。

Menu Extra 属于 SystemUIServer。

SystemUIServer 存在于这个地方:

/System/Library/CoreServices/SystemUIServer.app/Contents/MacOS/SystemUIServer

SystemUIServer 的捆绑标识符是 com.apple.systemuiserver。

所以我在 Info.plist 中添加了一个关键的 SIMBLTargetApplications,如下所示:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
 <key>CFBundleDevelopmentRegion</key>
 <string>English</string>
 <key>CFBundleExecutable</key>
 <string>${EXECUTABLE_NAME}</string>
 <key>CFBundleIconFile</key>
 <string></string>
 <key>CFBundleIdentifier</key>
 <string>com.yourcompany.${PRODUCT_NAME:rfc1034Identifier}</string>
 <key>CFBundleInfoDictionaryVersion</key>
 <string>6.0</string>
 <key>CFBundleName</key>
 <string>${PRODUCT_NAME}</string>
 <key>CFBundlePackageType</key>
 <string>BNDL</string>
 <key>CFBundleShortVersionString</key>
 <string>1.0</string>
 <key>CFBundleSignature</key>
 <string>????</string>
 <key>CFBundleVersion</key>
 <string>1</string>
 <key>NSPrincipalClass</key>
 <string></string>
 <key>SIMBLTargetApplications</key>
 <array>
  <dict>
   <key>BundleIdentifier</key>
   <string>com.apple.systemuiserver</string>
  </dict>
 </array>
</dict>
</plist>
  1. 构建一个 Foo.bundle。
  2. 复制到 $HOME/Library/Application Support/SIMBL/Plugins。
  3. 运行“killall SystemUIServer”。
  4. 使用 Console.app 仔细观察日志消息。

但是 Foo.bundle 在重新启动时不会加载到 SystemUIServer。

如果将 BundleIdentifier 更改为其他类型的通用应用程序名称,它可以正常工作。

那有什么问题?

--

莫亚希

ttp://hitoriblog.com/

4

1 回答 1

0

SIMBL 仅适用于可可应用程序。SystemUIServer 不是可可应用程序。检查其符号链接以获取更多证据。

于 2011-09-26T14:34:43.333 回答