Mobile Substrate LAUNCH Plugin

Discussion in 'iOS Development' started by frankmarco, Sep 20, 2010.

  1. frankmarco

    frankmarco New Member

    Aug 20, 2010
    Likes Received:
    iPhone 4 (Black)
    I am developing a Mobile Substrate Plugin that overrides the lock button to launch an application when pressed.

    At this point, I have it working so that it launches the application when the button is pressed however I am experiencing two issues that i can't seem to fix.

    1. If left running for more than approx 30 secs the device stops responding. The only way to reboot the device is to do a hard reset (menu button + lock button)

    2. If the menu button is pressed before issue #1 occurs the app does quit, however, the phone reboots and then drops into safe mode.

    Here is the hook method that gets executed when the lock button is pressed:

    static void __$ExampleHook_Application_LockButtonDown(SpringBoard<ExampleHook> *_SpringBoard) {

    // Create a SBApplication instance
    id application = class_createInstance(NSClassFromString(@"SBApplication"), 0);

    [application initWithBundleIdentifier

    Please Register or Log in to view images

    "" roleIdentifier:nil path

    Please Register or Log in to view images

    "/Applications/" bundle:nil infoDictionary:nil isSystemApplication:YES signerIdentity:nil provisioningProfileValidated:NO];

    // Create a SBApplicationIcon instance
    id applicationIcon = class_createInstance(NSClassFromString(@"SBApplicationIcon"), 0);

    [applicationIcon initWithApplication:application];

    [(SBApplicationIcon *)applicationIcon launch];


    The app mentioned above "" is a jailbroken based app that I wrote which executes fine (ie. no hang ups or problems closing) if launched by just tapping it's home screen icon.

    Any thoughts as to why I am experiencing these issues?

    I would appreciate any help or insight!

    Thank You,

Share This Page