3

TO start off with - this app doesn't need to get into the App Store.

I'm thinking something along the lines of the following should work:

    mach_port_t *p;
void *uikit = dlopen(UIKITPATH, RTLD_LAZY);
int (*SBSSpringBoardServerPort)() = 
dlsym(uikit, "SBSSpringBoardServerPort");
p = (mach_port_t *)SBSSpringBoardServerPort(); 
dlclose(uikit);

void *sbserv = dlopen(SBSERVPATH, RTLD_LAZY);
int (*setAPMode)(mach_port_t* port, const char* appID, BOOL suspended, void* unknown, void* unknown2) = 
dlsym(sbserv, "SBSLaunchApplicationWithIdentifier");
setAPMode(p, "com.apple.weather", NO, nil, nil);
dlclose(sbserv);

However I'm getting exc_bad_access, which is likely due to the fact that it needs an auth token - I could be wrong though.

Alternatively I'm trying using the following:

Class $SBApplicationController=objc_getClass("SBApplicationController");

NSLog(@"[$SBApplicationController sharedInstance], %@", [$SBApplicationController sharedInstance]);

Sadly the output is null - so I guess this can't be done within the application.

Any ideas? This is driving me crazy - thanks!

Victor Ronin
  • 22,758
  • 18
  • 92
  • 184
Luke Rhodes
  • 293
  • 3
  • 13
  • Do you have any solution now? – adruzh Jul 09 '11 at 16:30
  • @rhodesy22 Hello,can you help me how to use SBSSpringBoardServerPort? [here](http://stackoverflow.com/questions/10204785/special-api-to-launch-an-app-from-my-application) is my question – ilhnctn Apr 18 '12 at 10:35

1 Answers1

1

The iOS sandbox will block or kill any process which isn't started by iOS.

hotpaw2
  • 70,107
  • 14
  • 90
  • 153
  • Thanks for that, but using something like the SBSSpringBoardServerPort method is technically having the spring board service action the launch isn't it? I can dim the screen, lock the phone, turn aeroplane mode on and suspend the foremost app using that method. – Luke Rhodes Jan 10 '11 at 13:55
  • 2rhodesy22: SBSLaunchApplicationWithIdentifier and other methods like this require entitlement "com.apple.springboard.launchapplications", which springboard has and custom application doesn't have. – Victor Ronin Aug 09 '12 at 15:11