Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I use private system API?

I'd like to use a private/hidden iOS method, for example clearIdleTimer from the SpringBoard class (example here). How do I do this? A lot of information references much older iOS versions.

This is just for experimentation, I recognize that private API's are not App Store approved. Also, my iOS device is registered for development but not jailbroken.

Edit: I found these iOS-Runtime-Headers but the samples are not working for me.

like image 770
user924037 Avatar asked Oct 20 '25 04:10

user924037


1 Answers

Not all private APIs are the same.

Some of them you can use in any app ... you just won't get them approved for the App Store.

Some of them you can use, but only if your app runs with root privileges, which requires a jailbroken phone (plus other steps).

Some of them you can use, but you need to grant your app an entitlement, which I believe also requires a jailbroken phone.

In the case of this API:

@interface SpringBoard <UIApplicationDelegate, SBWiFiManagerDelegate>
{
}
- (void)clearIdleTimer;

You are trying to directly invoke a method in the SpringBoard application. You normally can't directly invoke other apps' methods.

One way you can do this is to use Mobile Substrate (now called Cydia Substrate). This is a powerful code injection platform that would allow you to hook into the SpringBoard application, and use clearIdleTimer. But, using Mobile/Cydia substrate requires jailbreaking your phone.

Some SpringBoard-type features are designed to be invoked by other apps, and those live in SpringBoardServices, which is different from the SpringBoard application. You can try searching SpringBoardServices for equivalent functionality. Those APIs are private, but might not require jailbreaking (I can't recall ... my phone is jailbroken so I don't have to worry about it).

Not the answer you wanted, I suspect :(

like image 96
Nate Avatar answered Oct 21 '25 18:10

Nate