iosobjective-cjailbreaktheos

MobileSubstrate - checking which bundle an object is in


I'm making a MobileSubstrate plug-in which is supposed to: a) hook instance methods of a specific class/classes and b) do different things depending on the bundle ID of the application containing the object (which is an UIResponder subclass, to be specific).

Any suggestions on how to implement this?


Solution

  • You said calling [[NSBundle mainBundle] bundleIdentifier] always returns com.apple.springboard and only that. Which means your code is only running inside SpringBoard.

    MobileSubstrate tweaks are only injected into some, not all, processes. You control this via it's filter (loaded from a .plist file).

    If you want to have your code inject itself into all instances of the class then modify your filter to "com.apple.UIKit" rather then "com.apple.springboard" all apps will now your code.