在iphone中启动没有URL架构的其他应用程序?

jew*_*wel 3 xcode jailbreak iphone-privateapi ios

我知道其他应用程序可以通过URL架构从您的应用程序调用.但并非所有应用程序都是注册的架构URL.那么我该如何启动该应用程序呢?我正在为iphone jaibroken开发.

Wri*_*sCS 6

您可以通过多种方式使用Bundle ID启动应用程序.

SBApplication

SBApplication *app = [[objc_getClass("SBApplicationController") sharedInstance] applicationWithDisplayIdentifier:@"com.wrightscs.someapp"];
[[objc_getClass("SBUIController") sharedInstance] activateApplicationFromSwitcher: app];
Run Code Online (Sandbox Code Playgroud)

SBApplicationController

SBUIController *uicontroller = (SBUIController *)[%c(SBUIController) sharedInstance];
SBApplicationController *appcontroller = (SBApplicationController *)[%c(SBApplicationController) sharedInstance];

if ([[UIDevice currentDevice] respondsToSelector:@selector(isMultitaskingSupported)])
{
    [uicontroller activateApplicationFromSwitcher:[[appcontroller applicationsWithBundleIdentifier:bundleID] objectAtIndex:0]];
}
else
{
    // doesn't work outside of Springboard
    [uicontroller activateApplicationAnimated:[[appcontroller applicationsWithBundleIdentifier:bundleID] objectAtIndex:0]];
}
Run Code Online (Sandbox Code Playgroud)

我在4.x中使用了另一种方法,SBUIController但是在5.0中停止了工作,所以我不打算发布它.