How to unlock iOS screen programmatically?

I am currently studying the creation of a jailbreak. I want to unlock the phone screen. How it's done? What private API can I use to achieve this on iOS 7?

+7
jailbreak iphone-privateapi
source share
4 answers

If we're talking about jailbreaking, you can write a SpringBoard setting that does this (iOS 7 only)

[[objc_getClass("SBBacklightController") sharedInstance] turnOnScreenFullyWithBacklightSource:0]; [[objc_getClass("SBLockScreenManager") sharedInstance] unlockUIFromSource:0 withOptions:nil]; 

Without a password lock, the code will turn on the screen and unlock the device. With an access code, he will turn on the screen and request an access code.

+9
source share

My solution has two parts, but it could be better:

  • Turn on the screen by pressing the power button with this code:

     VNCSendHIDEvent(IOHIDEventCreateKeyboardEvent(kCFAllocatorDefault, mach_absolute_time(), kHIDPage_Consumer, kHIDUsage_Csmr_Power, 1, 0)); // Power button down VNCSendHIDEvent(IOHIDEventCreateKeyboardEvent(kCFAllocatorDefault, mach_absolute_time(), kHIDPage_Consumer, kHIDUsage_Csmr_Power, 0, 0)); // Power button up 
  • After 1, the screen lights up, and then you can use the SimulateTouch sweepstake tool to simulate scrolling from the line command.

For 1 above, your code must have com.apple.private.hid.client.event-dispatch right .

In addition, you can also learn how Activator performs an unlock screen listener.

+3
source share

Perhaps this is not a direct solution. You can use this setting and the https://github.com/iolate/SimulateTouch library to simulate a user scroll on a locked screen to unlock the device.

+2
source share

I use Cydia's Activator to wake and unlock the device via SSH. It works on iOS 10.1.

 activator send libactivator.system.homebutton activator send libactivator.system.homebutton 

the lock command is here:

 activator send libactivator.system.sleepbutton 

Good luck Good luck :)

+1
source share

All Articles