Autojs4.1.0实战教程---快手极速版清理缓存

抖音极速版邀请码: 890992808 看文章加关注点分享都不用...加下邀请码就好

快手极速版邀请码: 2rvxaem 代码地址:https://blog.csdn.net/zy0412326/article/details/104788816

火山极速版邀请码:279116054  代码地址:https://blog.csdn.net/zy0412326/article/details/104913848

今日头条极速版邀请码:1849623318  代码地址:https://blog.csdn.net/zy0412326/article/details/105011375

不多说了很抖音的一样代码如下:

auto.waitFor();//判断和等待开启无障碍
app.launchApp('快手极速版');//只有一个快手极速版所以直接Launch就可以,不用包名
sleep(10000);//等待splash时间
console.show(); //开启日志(悬浮窗权限)
clearVideoCache();
home();//回到首页
exits();//退出js脚本
function clearVideoCache() {
    if (className("android.widget.ImageView").id("left_btn").exists()) {
        className("android.widget.ImageView").id("left_btn").findOnce().click();
        sleep(3000);
        if (className("android.widget.TextView").text("设置").exists()) {
            toastLog("点击设置");
            let b = className("android.widget.TextView").text("设置").findOne().bounds();
            click(b.centerX(), b.centerY());
            sleep(3000);
            if (className("android.widget.TextView").text("清除缓存").exists()) {
                let b = className("android.widget.TextView").text("清除缓存").findOnce().bounds();
                let result = click(b.centerX(), b.centerY());
                if (result) {
                    toastLog("清理成功");
                }
            }
        }
    }
}
function kuaishouCloseFriendTip() {
    if (id("close").exists()) {
        id("close").findOnce().click();
    }
}
/**
 * 关闭通知
 */
function kuaiShouCloseInvitationNotice() {
    if (className("android.widget.ImageButton").id("close").exists()) {
        className("android.widget.ImageButton").id("close").findOnce().click();
    }
}

/**
 * 快手关闭是否喜欢对话框
 */
function kuaiShouCloseIsLike() {
    if (className("android.widget.TextView").text("不影响").exists()) {
        className("android.widget.TextView").text("不影响").findOnce().click();
    }
}



原创文章 74 获赞 42 访问量 2万+

猜你喜欢

转载自blog.csdn.net/zy0412326/article/details/105498147