Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I know there are many questions: "How to open setting app programatically?" and the answer is "BIG NO". I know that Apple does not support opening Settings from any other app after iOS 5.0.

But there are some apps like MapMyFitness which can open Settings, and they are available in the App Store and have been approved by Apple. MapMyFitness opens the Bluetooth settings if Bluetooth is turned off. I have checked this in iOS 6 and iOS 5.1.

I want to know how can these apps are able to open Settings legally and bypassed Apple security because as per my information there is no legal way to do it?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
320 views
Welcome To Ask or Share your Answers For Others

1 Answer

Well, on iOS 5.0, there's the prefs:// URL scheme.

From iOS 5.1, that was removed. It's still possible to use private APIs and obfuscation to bypass the static analysis of the binary. Example:

void (*openApp)(CFStringRef, Boolean);
void *hndl = dlopen("/System/Library/PrivateFrameworks/SpringBoardServices.framework/SpringBoardServices");
openApp = dlsym(hndl, "SBSLaunchApplicationWithIdentifier");
openApp(CFSTR("com.apple.Preferences"), FALSE);

By playing with the strings (splitting and concatenating them, etc.) you can eventually make it to the AppStore. It's still disallowed, though.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...