求助关于device.isScreenOn()出错问题
autojs吧
全部回复
仅看楼主
level 1
lon9451 楼主
系统版本:鸿蒙4.2.0.180,无法root
经测试,屏幕关闭时,执行if(!device.isScreenOn()),返回的是false,进而导致无法自动解锁,这是为何?
2025年07月28日 05点07分 1
level 1
lon9451 楼主
function password_input()
{
var password = "111111"
for(var i = 0; i < password.length; i++)
{
var p = text(password[i].toString()).findOne().bounds();
click(p.centerX(), p.centerY());
sleep(100);
}
}
function unlock()
{
if(!device.isScreenOn())
{
console.log("1")
device.wakeUp();
sleep(1000);
swipe(500,2000,500,1000,210);
password_input();
}
else{
console.log("2")
}
}
unlock();
屏幕关闭时,运行日志输出2
2025年07月28日 05点07分 2
level 1
lon9451 楼主
自顶
2025年07月28日 06点07分 3
1