0

Jailbroken iPhone iOS 7: Is it possible to close all apps in the background directly from Springboard without opening the background switcher panel?

I'm trying to do that in this way:

SBAppSliderController* switcherController = MSHookIvar<SBAppSliderController*>(self, "_switcherController");

[_switcherController _quitAppAtIndex:0];

and then I make a for cycle in this way

- (void)_quitAppAtIndex:(unsigned int)arg1 {
   if (arg1 == 0) {
      for (NSString *appID in [self applicationList]) {
        if (![appID isEqualToString:@"com.apple.springboard"])
            [self _quitAppAtIndex:[[self applicationList] indexOfObject:appID]];
      }
   }
}
Nate
  • 31,017
  • 13
  • 83
  • 207
Usi Usi
  • 2,967
  • 5
  • 38
  • 69
  • 1
    This is most definitely possible. In fact, I wouldn't be surprised if it's been asked and answered already. What is not working in your code? – newenglander Jan 13 '14 at 18:41
  • The system crashed with a reboot – Usi Usi Jan 13 '14 at 18:48
  • You should be able to at least isolate the line causing the problem. Did you try any other answers here, like this one? http://stackoverflow.com/q/15008258/381233 – newenglander Jan 14 '14 at 11:00
  • Why is there an argument for `_quitAppAtIndex:`? If you want to get good, quick answers to your coding problems, post code that's well-formatted, clean, and clear, demonstrating *only* the problem you're asking about. Make it easy for us to help you. – Nate Jan 14 '14 at 21:12

1 Answers1

1

There's no %orig in your _quitAppAtIndex:, so it won't kill any app and may cause a respring (not reboot).

For my advice (not tested):

SBAppSliderController* switcherController = MSHookIvar<SBAppSliderController*>(self, "_switcherController");

for (int i = [switcherController applicationList].count; i > 0; i--)
    [switcherController _quitAppAtIndex:i];

Hope this can help, and this is what I actually did in Slide2Kill 7.

gturri
  • 13,807
  • 9
  • 40
  • 57
Suu
  • 56
  • 4