4

Set of three questions, last one is the desired goal:

1) It is possible to use a GraphicsServices method and link the binary from private framework. Why is it not possible to do similar with SpringBoard SBUIController?

2) Is there no way to use SBUIController without jail breaking?

3) How to launch an app by bundle ID (through private API but without jailbreaking) on iOS 6?

Cœur
  • 37,241
  • 25
  • 195
  • 267
TorukMakto
  • 2,066
  • 2
  • 24
  • 38

3 Answers3

4

Application vs Framework

GraphicServices is framework. It's specifically designed to be linked to and user by 3rd party apps. As I remember SBUIController is part of Springboard, which is standalone app (which is not designed to be linked to)

Even in the case, if you somehow able to link/load the code from Springboard, the code won't work, because you are missing entitlements to talk to other services.

Entitlements

Jailbreak allows you to inject code into 3rd party apps (including Springboard) and this way the code is executed in Springboard and has proper entitlements.

Actually, for the jailbreak device you can add entitlements to your code and sign it. However, you won't be able to do this for non jailbroken device.

So, I would say, that you should drop SBUIController approach for non jailbroken devices.

Attempts to launch an app

I had the same question about half year ago and I spend a lot of time on it. I tried following things without success:

  • SBSLaunchApplicationWithIdentifier
  • SBReturnToPreviousAppAtSpecifiedTime
  • Tried to use BKSWorkspace

and couple of other approaches.

Some additional thoughts

If 3rd party application handles some URL scheme, you can use it to launch this 3rd party app.

Community
  • 1
  • 1
Victor Ronin
  • 22,758
  • 18
  • 92
  • 184
  • Victor - Thanks for clarifying. One more question though - I have a way to inject touch event/swipes at specified location on screen. I always want to invoke user installed App. Is there a way to detect at which location(x,y) the icon of app(bundle ID) exists? Then I can artificially inject touch and invoke the app.. – TorukMakto May 06 '13 at 23:57
  • I had this idea too, but I don't have a way of knowing location of each app in springboard. Also, icon could be in folder or another screen. So, this solution isn't usable as is. – Victor Ronin May 07 '13 at 00:47
3

As I know, only private api can do this.

@interface PrivateApi_LSApplicationWorkspace
- (bool)openApplicationWithBundleID:(id)arg1;
@end

PrivateApi_LSApplicationWorkspace* _workspace;
_workspace = [NSClassFromString(@"LSApplicationWorkspace") new];
[_workspace openApplicationWithBundleID:bundleIdentifier];

You can check https://github.com/wujianguo/iOSAppsInfo.

justin
  • 231
  • 2
  • 8
0

You can try to use RTLD_LAZY or objc_getClass. I've used both to access BluetoothManager on my non-jailbroken iPhone 5.

WrightsCS
  • 50,551
  • 22
  • 134
  • 186
  • Wrights - Thanks. I tried the answer given by you on http://stackoverflow.com/questions/11693796/launch-other-application-without-url-schema-in-iphone - It is having objc_getClass but I am not able to compile it unless I remove %c. And the it gives linker error.. – TorukMakto May 06 '13 at 23:32
  • You need to import the objective-c runtime. `#import ` – WrightsCS May 06 '13 at 23:35
  • ok - I have this code.SBApplication *app = [[objc_getClass("SBApplicationController") sharedInstance] applicationWithDisplayIdentifier:@"com.apple.MobileAddressBook"]; I get app as nil after execution.. (I am executing this on iOS 5 right now..).. I have used a fake declaration of SBApplication as @interface SBApplication : NSObject @property(retain, nonatomic) SBProcess *process; -(NSString *)displayName; -(NSString *)bundleIdentifier; -(id)applicationWithDisplayIdentifier:(NSString*)bundleIdentifier; @end; – TorukMakto May 06 '13 at 23:44