闪电盒子邀请码:1341657285571。看文章加关注点分享都不用...加下邀请码就好。 抖音极速版邀请码: 890992808 看文章加关注点分享都不用...加下邀请码就好。 auto.waitFor();//判断和等待开启无障碍 app.launchApp('闪电盒子极速版');//只有一个快手极速版所以直接Launch就可以,不用包名 console.show(); //开启日志(悬浮窗权限) sleep(13000);//等待splash时间 if (className("android.widget.TextView").text("关闭广告").exists()) { sleep(30000);//等待30SAD时间 className("android.widget.TextView").text("关闭广告").findOnce().click(); } let hongBaoList=text("item_content").find(); if(hongBaoList.length>1){ clickScreen(); } let see_count = 100; let toutiao = className("android.widget.TextView").text("头条资讯").find(); toastLog(toutiao.length); if (toutiao.length >= 1) { let b = toutiao[toutiao.length - 1].bounds(); click(b.centerX(), b.centerY());//进入头条资讯页面 for (let i = 1; i < 120; i++) { let news = id("title").findOnce();//新闻列表的第一条 if (news != null) { try { let b = id("title").findOnce().bounds(); if (click(b.centerX(), b.centerY())) { for (var x = 1; x <= 10; x++) { toast("闪电盒子极速版读新闻第" + i + "次" + "滑动第" + x + "次"); swipe(303, 1200, 335, 150, 300); sleep(2500); } if (className("android.widget.ImageView").id("back").exists()) { toastLog("点击返回按钮"); className("android.widget.ImageView").id("back").findOnce().click(); } sleep(2000); closeHongBaoTip(); swipe(device.width / 2, device.height / 2, device.width / 2, device.height - 200, 300); sleep(3500); closeHongBaoTip(); swipe(device.width / 2, device.height / 2, device.width / 2, device.height - 200, 300); sleep(3000); } } catch (e) { } } sleep(3000); } back();//返回到首页 } else { toastLog("未找到头条资讯栏目......"); sleep(3000);//等一会 toastLog("在找一次......"); let toutiao = className("android.widget.TextView").text("头条资讯").find(); toastLog(toutiao.length); if (toutiao.length >= 1) { let b = toutiao[toutiao.length - 1].bounds(); click(b.centerX(), b.centerY());//进入头条资讯页面 for (let i = 1; i < 120; i++) { toastLog(i); let news = id("title").findOnce();//新闻列表的第一条 if (news != null) { try { let b = id("title").findOnce().bounds(); if (click(b.centerX(), b.centerY())) { for (var x = 1; x <= 10; x++) { toast("闪电盒子极速版读新闻第" + i + "次" + "滑动第" + x + "次"); swipe(303, 1200, 335, 150, 300); sleep(2500); } if (className("android.widget.ImageView").id("back").exists()) { toastLog("点击返回按钮"); className("android.widget.ImageView").id("back").findOnce().click(); } sleep(2000); closeHongBaoTip(); swipe(device.width / 2, device.height / 2, device.width / 2, device.height - 200, 300); sleep(3500); closeHongBaoTip(); swipe(device.width / 2, device.height / 2, device.width / 2, device.height - 200, 300); sleep(3000); } } catch (e) { } } sleep(3000); } back();//返回到首页 } } sleep(3000); //关闭当前程序 toastLog("程序5秒后即将关闭"); sleep(3000); home();//回到首页 /** *点击一下屏幕 */ function clickScreen() { var x = device.width - device.width * 0.2; var y = device.height - device.height * 0.2; toastLog("点击屏幕" + x + ":" + y); let clickResult = click(x, y); toastLog(clickResult); } /** * 关闭闪电盒子红包提升 */ function closeHongBaoTip() { if (className("android.widget.ImageView").id("img_close").exists()) { toastLog("点击关闭按钮"); className("android.widget.ImageView").id("img_close").findOnce().click(); } if (text("继续观看").exists()) { text("继续观看").findOnce().click(); } } /** * 屏幕向下滑动并延迟8至12秒 */ function slideScreenDown(startX, startY, endX, endY, pressTime) { swipe(startX, startY, endX, endY, pressTime); let delayTime = random(8000, 12000); sleep(delayTime);//模仿人类随机时间 } /** * 随机上滑(防止被判定是机器)上滑后停留时间至少是10S,造成假象表示是对内容感兴趣 * 点赞和关注先不搞。 */ function randomUpSildeScreen() { let randomIndex = random(1, 50); if (randomIndex == 1) { console.log("随机上滑被执行了!!!"); pressTime = random(200, 500); swipe(device.width / 2, 500, device.width / 2, device.height - 200, 300); delayTime = random(10000, 15000); sleep(delayTime); } } /** * 连续下滑对上一个无兴趣 * 其实得和上滑做个排他,既然无兴趣不要在上滑 */ function randomDownSildeScreen() { let randomIndex = random(1, 50); if (randomIndex == 1) { console.log("连续下滑被执行了"); swipe(device.width / 2, device.height - 200, device.width / 2, 200, 300); sleep(2000); swipe(device.width / 2, device.height - 200, device.width / 2, 200, 300); delayTime = random(8000, 10000); sleep(delayTime); } } /**随机点赞并休息一秒 */ function randomHeart() { index = random(1, 50); if (index == 6) { var target = id('layout_like').findOnce(); if (target == null) { return; } else { target.click(); sleep(1000); console.log("随机点赞并休息一秒"); } } } function randomFollow() { index = random(1, 100); if (index == 66) { var target = id('tv_attention').findOnce(); if (target == null) { return; } else { target.click(); sleep(1000); } } }