Search code examples
iosobjective-cjailbreaktweak

close all apps directly from Springboard without opening the switcher panel?


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]];
      }
   }
}

Solution

  • 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.