views:

2935

answers:

4

I'm getting conflicting reports from various places. Engadget's review says InputManager plug-ins being completely ignored (and causing strange behaviour if the application is loaded in 32-bit mode), but this mailing list thread says they will work if the 32/64-bit compatibility is right.

So I have two questions:

  • Do we get to use InputManagers in Snow Leopard?
  • If yes, will it work the same way as in Leopard. And if no, what is good a workaround (because 1Password is apparently working on a fix)?
+3  A: 

http://developer.apple.com/releasenotes/Cocoa/AppKit.html#NSInputManager

The automatic loading of bundles located in InputManagers folders is now officially unsupported. The conditions for valid input manager bundle is further tightened. This functionality is likely to be disabled in a future release.

  1. The valid installation is now restricted to the /Library/InputManagers folder only. Bundles in other locations are silently ignored.

  2. All the files in the bundle and /Library/InputManagers folder itself must be owned by the root user and admin group. No files inside the bundle can have group or other write permissions.

  3. Processes running with the root privilege (getuid() == 0 or geteuid() == 0) cannot load any bundle input manager.

  4. Processes running with the wheel group privilege cannot load any bundle input manager.

  5. The process must be in the active workspace session at the time of loading the bundles.

  6. The process must not be tainted by changing user or group id (checked by issetugid()).

  7. No 64-bit processes can load any bundle input managers.

apphacker
And the second question?
aditya
apphacker
+3  A: 

If you really need to inject code into applications to accomplish what you're trying to do, use mach_inject.

And please file a bug requesting hooks so you can implement your software in a safer way in future.

Nicholas Riley
When I tried the mach_info link, I got a 'page not found' kind of error. Here's another link: http://rentzsch.com/mach_inject/
johne
Sorry, this is a bug in the Stack Overflow code (http://meta.stackoverflow.com/questions/3657/can-an-unescaped-underscore-be-included-in-a-link) which I accidentally triggered again. Sigh.
Nicholas Riley
+1  A: 

It looks like Chax (an InputManager plugin for iChat) has switched now to being an app launcher for iChat: you run Chax.app and it loads iChat with extra UI hacks.

Quickly looking at the strings in the tiny launcher binary Chax.app/Contents/MacOS/Chax, it seems like he's choosing an easier library interception technique than the already-mentioned mach_inject: instead you just set the DYLD_INSERT_LIBRARIES environment variable before launching your target app (like LD_PRELOAD in Linux).

Of course, this doesn't make my favorite InputManagers, MultiClutch and Afloat, work again in Snow Leopard — they were most useful because they worked with all Cocoa apps. Still not sure what the best workaround would be for these apps.

I didn't download the 1Password 3 beta to try and see what they were doing, because it looked like you have to sign a virtual NDA first.

cce
+1  A: 

1Password 3.0 works around the need for an InputManager by piggybacking on Safari’s browser plug-in API instead. The linked article also provides a very pragmatic comparison of various code-injection alternatives to InputManagers.

Kevin Yank