i am working on a jailbreak Tweak, and i need to open a special view of Settings
i googled a lot and after iOS5.1,
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"prefs://"]];
does not work anymore. how can i do this?
i am working on a jailbreak Tweak, and i need to open a special view of Settings
i googled a lot and after iOS5.1,
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"prefs://"]];
does not work anymore. how can i do this?
If this code is running on a jailbroken phone, you can use the technique I show in this answer to programmatically open an app by its bundle identifier.
Basically, you are using the SBSLaunchApplicationWithIdentifier()
private API in the SpringBoardServices.framework.
If this is for an app, be sure to follow the instructions in my answer to add the com.apple.springboard.launchapplications
entitlement to your app.
If your code is injected into SpringBoard itself as some sort of a tweak, then I don't think you need to worry about adding the entitlement.
The bundle identifier for the Preferences.app is com.apple.Preferences
, so that's the string you pass to SBSLaunchApplicationWithIdentifier()
, as shown in my linked answer.
Note: my assumption is that you are asking this question for iOS 6, since there isn't a stable jailbreak out for iOS 7 yet.
The settings app url schemes are gone in iOs 5.1, you should recreate the desired URL scheme hooking the method - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
for the preference app. Using pseudo-code it should be
if(url contain @"general") { go to general section } else %orig;
you could go to a section by calling the didSelect method of the preferences' tableView for example