Disable Home Button

Discussion in 'iOS Development' started by Jens1980, Mar 14, 2010.

  1. Jens1980

    Jens1980 Member

    Joined:
    Nov 5, 2009
    Messages:
    33
    Likes Received:
    0
    Device:
    2G iPod touch
    Hi,
    i want to disable the single tap of the home button, so that the user cant close a running app. to close the app i want to double click the home button.
    Is this possible?
    Thanks for help!
    Jens
  2. Theodosius

    Theodosius Active Member

    Joined:
    Jun 9, 2009
    Messages:
    3,071
    Likes Received:
    6
    Device:
    iPad 3
    It might be possible in Activator through Rock or Cydia.
  3. ipodmail09

    ipodmail09 Member

    Joined:
    Mar 13, 2009
    Messages:
    269
    Likes Received:
    0
    Device:
    2G iPod touch
    you would have to edit the frameworks of the function keys.
  4. lauNchD

    lauNchD Well-Known Member

    Joined:
    Jan 27, 2008
    Messages:
    1,844
    Likes Received:
    261
    Device:
    iPhone 5 (Black)
    WTFail?! Do you have _any_ idea?

    Please Register or Log in to view images



    You could register actions in libactivator when your app opens [ a) on single tap, do nothing and suppress SB's default action, closing the app; b) on double tap, actually quitting the app ].
    However, that would mean having to install Activator and adding another preference pane (or whatever it's called). IMO, the Activator approach would work fine, but is a little bloated (it's the easiest way, though).

    I think a better approach could be to inject a small dylib into SpringBoard that overrides the crucial home button methods. The dylib and your app can communicate easily using the Darwin/CF notification API.
  5. gojohnnyboi

    gojohnnyboi Well-Known Member

    Joined:
    Jan 25, 2008
    Messages:
    3,339
    Likes Received:
    55
    ROFL failnuggets.

    Create a MobileSubstrate library, and have it override(with an empty implementation of) -[SpringBoard menuButtonTapped] I'm not sure if that's the exact name of the method, but you can dump the app and find out.
  6. Jens1980

    Jens1980 Member

    Joined:
    Nov 5, 2009
    Messages:
    33
    Likes Received:
    0
    Device:
    2G iPod touch
    OK thank you.
    I am not so good in programming.How can i create this lib and in which folder must i save it?
  7. hyernado

    hyernado New Member

    Joined:
    Apr 13, 2009
    Messages:
    127
    Likes Received:
    0
    Device:
    2G iPod touch
    Oh, cmon, seriously. Your wasting our time. BECOME FAMILIAR WITH OBJC, OR AT LEAST C++. And don't come back until you have.
    There are MobileSubstrate tutorials /everywhere/. It's really not rocket science.
  8. jmwerkus

    jmwerkus Active Member

    Joined:
    Apr 9, 2009
    Messages:
    3,030
    Likes Received:
    17
    Device:
    iPhone 5S
    Hey calm down. Really. Just use activator.
  9. Jens1980

    Jens1980 Member

    Joined:
    Nov 5, 2009
    Messages:
    33
    Likes Received:
    0
    Device:
    2G iPod touch
    Hey thank you. Activator is the app which i need!
    The only thing which is not running is that when i am in my app an press the home button, that he do nothing. only by double click.
  10. lauNchD

    lauNchD Well-Known Member

    Joined:
    Jan 27, 2008
    Messages:
    1,844
    Likes Received:
    261
    Device:
    iPhone 5 (Black)
    I'm not exactly sure what your problem is. What doesn't work? Does nothing change at all? Does your device not react to any button presses anymore?
    FYI: To do anything like this obviously requires a jailbreak.

    (BTW: Sprichst du lieber Deutsch?)

    I think overriding the method with an empty implementation wouldn't be enough, since this behavior is only desired when the app is actually open. Probably Activator's "on-demand" listener feature would be easiest. (Or, as I previously mentioned, he can make a custom library that communicates with the app using notifications.)

Share This Page