Technical HAKRZ
Technical HAKRZ

Reputation: 29

Programmatically put an iOS device to sleep

I was wondering if there was a way to programmatically put an iDevice to sleep, for my jailbreak tweak. I would also like to test if iphone is on too. Is there any way (public or private API) that could do this? Even simulating the press would be cool. I know activator cydia tweak can do this, just wondering how.

Upvotes: 0

Views: 549

Answers (1)

creker
creker

Reputation: 9570

All methods from private SpringBoardServices.framework:

void* SBSSpringBoardServerPort();
void SBLockDevice(void*);

To lock device use this:

SBLockDevice(SBSSpringBoardServerPort());

Upvotes: 1

Related Questions