Tweaks for APE Module Loading

October 6th, 2007 by Joe Ranieri

The Application Enhancer framework supports a number of Info.plist keys to change the behavior of APE modules, most of which are undocumented. Here are a handful:

  • APEVersionRequired (string)
    The minimum Application Enhancer framework required to run the APE.
  • APEHasIncludeList (bool)
    Does this APE module use an include list?
  • APEHasExcludeList (bool)
    Does this APE module use an exclude list?
  • APEMatchInfo (array)
    An APE module can also specify which applications it can be loaded into.

    • CFBundleIdentifier (array or string)
      The bundle IDs of specific applications that the APE module can load into.
    • APEMatchFlavor (string)
      The type of application the APE module can load into. Possible values are Carbon and Cocoa.
    • APEToolsID (string)
      A string in one of the following formats that lets you match by application name, creator/type, or path.

      • com.unknown.by-name.<name>
      • com.unknown.by-creator.<type in hex>.<creator in hex>
      • com.unknown.by-path.<path>

So, for some examples. Loading only into Safari, and disabling the include and exclude lists:

	&lt;key&gt;APEHasIncludeList&lt;/key&gt;
	&lt;false /&gt;
	&lt;key&gt;APEHasExcludeList&lt;/key&gt;
	&lt;false /&gt;
	&lt;key&gt;APEMatchInfo&lt;/key&gt;
	&lt;array&gt;
		&lt;key&gt;CFBundleIdentifier&lt;/key&gt;
		&lt;string&gt;com.apple.Safari&lt;/string&gt;
	&lt;/array&gt;

And loading into the Finder by creator (MACS) and type (FNDR), until Apple replaces it with a Cocoa application:

	&lt;key&gt;APEMatchInfo&lt;/key&gt;
	&lt;array&gt;
		&lt;key&gt;APEMatchFlavor&lt;/key&gt;
		&lt;string&gt;Carbon&lt;/string&gt;
		&lt;key&gt;APEToolsID&lt;/key&gt;
		&lt;string&gt;com.unknown.by-creator.0x464E4452.0x4D414353&lt;/string&gt;
	&lt;/array&gt;

Obviously, the creator/type matching method isn’t a good way of doing this, but in some cases it may be the only way.

Disclaimer: As several of these are undocumented, Unsanity might remove them or change their functionality in the future. It would not be wise to depend on them too much.

Ryan contributed to this post.


COMMENTS

Leave a Reply