Android ignores screen unlock protection interface cracking

Source: Internet
Author: User

1 Principle

Android has three screen unlocking protections: Pattern unlocking, PIN password unlocking, and password unlocking.

The interface is as follows:

Chart 1 pattern unlocking page

Figure 2 PIN password unlock page

Figure 3 password unlock page

We can use java. lang. object. android. app. keyguardLock, a subclass of KeyguardManger, can control the Disable screen lock interface, so as to directly go through the screen lock interface without entering a password to use the mobile phone. disableKeyguard () and KeyguardLock. enableKeyguard () method for Disable and enable screen lock Interface

2. Code Description

The main code of the Demo program is as follows:

// Obtain KeyguardManagerKeyguardManager manager = (KeyguardManager) getSystemService (KEYGUARD_SERVICE );

If (manager. inKeyguardRestrictedInputMode ()){

// In the locked interface, the interface is unlocked through the KeyguardLock Class Method

KeyguardLock keyguard = manager. newKeyguardLock (getLocalClassName ());

Keyguard. disableKeyguard ();

}

Permission required:

  

3 conclusion

1. Use this method on the pattern lock Interface

After the disableKeyguard () method is called to lock the screen with the disable pattern, pressing the home key will trigger the screen lock Interface enable to re-display the screen lock interface.

2. Pin password lock interface using this method

After the disableKeyguard () method is called and the disable pattern interface is displayed, a pop-up screen is displayed when you press the home Key. Does not return to the home page

3. Use this method on the password lock Interface

After the disableKeyguard () method is called and the disable pattern interface is displayed, a pop-up screen is displayed when you press the home Key. Does not return to the home page

Although I don't know why Google provides such an api, developers can use this api to almost make the screen lock protection function of Android useless, the exception of the home key after this method is called should be a bug.

4 Demo

Because the screen lock can only install Apk through the software such as the pea pod on the computer at regular intervals, and cannot start apk, this Demo program is written as start-up, that is, when the screen lock is enabled, after installing the software, such as a computer pea pod, restart the software to implement the Pass screen lock interface.

Android 2.2, 2.3, and 4.0 platforms passed the test.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.