閃電盒子邀請碼: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);
}
}
}