当前位置:网站首页>Auto. JS to realize automatic unlocking screen

Auto. JS to realize automatic unlocking screen

2022-06-24 21:23:00 C colony

Write it at the front :

        This article records my own development process , Basic problems encountered , It is also convenient for future development .

        If you're a beginner Auto.js Development , I suggest you read this article Auto.js introduction 【 Hyperbasic 】, This article is the work I read when I started , Overall, I felt very good , The basic content has been mentioned , It is completely suitable for novices to make some simple scripts for their own use .

One 、 Advanced method

1、 Define methods ( Personal advice only )

        Follow the advice of the first article , It is also recommended to store all custom functions separately , Post call use .

2、 Code

//  Unlock screen 
function unlock()
{
    if(!device.isScreenOn())
    {
        device.wakeUp();
        sleep(500);
        swipe(500,2000,500,1000,210);
        sleep(500)
        var password = "00000"  // Enter the password of your mobile phone here 
        for(var i = 0; i < password.length; i++)
        {
            var p = text(password[i].toString()).findOne().bounds();
            click(p.centerX(), p.centerY());
            sleep(100);
        }
    }
}

        This method is only used for mobile phones unlocked by digital password , Because the mobile phone of the subject uses a digital password , So other unlocking methods have not been tried , Interested partners can try it by themselves . Enter the password in the code , Not particularly smart , I look forward to your exchange and improvement with me .

          The code here is relatively simple , I won't go into that , If you don't understand, you can read the development documents , The content and usage are very detailed :Auto.js official API Document gate , You can learn by yourself , You can also send me a private letter to answer .

3、 ... and 、 Last  

        1、 What's wrong , Welcome to discuss .

        2、 If you have any questions, please let me know , You can also pay attention to me , We will update other advanced methods later .

原网站

版权声明
本文为[C colony]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202211316377446.html