這是一個系列分享,我會逐步開放更多的分享。
基於AutoJs實現的薅羊毛App專業版源碼大分享。我分享的源碼,全是正在商業使用的功能源碼。源碼的質量你們能夠本身平衡。android
功能覆蓋全部版本,今天分享基礎版本,不包含智能版,下期分享智能搶福袋,智能防止風控。webpack
ui.layout( <vertical padding="16" id="parent"> <TextView text="搶福袋" gravity="center" textSize="24sp" /> <Switch id="autoService" text="無障礙服務" checked="{{auto.service != null}}" padding="8 8 8 8" textSize="15sp" /> <horizontal> <TextView w="auto" text="只查看" /> <input w="auto" id="maxWait" minWidth="50" inputType="number" text="180" /> <TextView w="auto" text="秒之內" /> </horizontal> <horizontal> <TextView w="auto" text="中獎機率大於"/> <input w="auto" id="gl" minWidth="50" inputType="number" text="0.1" /> </horizontal> <horizontal> <button w="*" id="openapp" text="開始工做" /> </horizontal> </vertical> );
qfd.checkYgl = function (time) { waitTime(3) var txtwg = textMatches(/^[1-9][0-9]*.*[1-9][0-9]*人/).findOnce(); if (txtwg == null) { return false; } var nu = textMatches(/^\d+$/).className("android.view.View").findOnce(); if (nu == null) { return false; } if (!this.checkedfsp()) { var txt = txtwg.text(); txt = txt.replace("鑽石", "") txt = txt.replace("(", "") txt = txt.replace(")", "") txt = txt.replace("抖幣:", "|") log(txt) var totaldb = parseInt(txt.split('|')[0]) var total = parseInt(txt.split('|')[1]) total = total == 0 ? 1 : total; var average = totaldb / total; var gl = total * time * 1.0 / (parseInt(nu.text()) * 600); ydb = average * gl log("能夠得到" + average * gl + "抖幣") var ms = average * gl > 1.0; if (!ms) { log("-------虧本生意,放棄------") } } else { return true; } return ms; } qfd.qfd = function () { var mswg = textMatches(/^([0-1]{1}\d|2[0-3]):([0-5]\d)$/).find(); var size = mswg.length if (size != 0) { var had=false; for (let index = size - 1; index >= 0; index--) { if(had){ break; } had=false; const txtwg = mswg[index]; var txt = txtwg.text(); var time =timeToSec(txt); if(txtwg.parent()==null){ continue; } if (qfd.ouTime(time)) { log("超出時間範圍" + txt); continue; } txtwg.parent().parent().click(); waitTime(3, "加載...") if (!text("福袋").exists()) { click(device.width * 0.1, device.height * 0.3); waitTime(0.5) continue; } had=true; //檢測是否知足福袋要求 if (!qfd.checkYgl(time)) { click(device.width * 0.1, device.height * 0.3); waitTime(0.5) continue; } //知足 textStartsWith("一鍵參與").findOne().click(); qfd.randomsend(time / 5); waitTime(time+2, "等待福袋"); click(device.width * 0.1, device.height * 0.3); waitTime(3, "---") log(txt); break; } } nextVideo(); waitTime(6); }
qfd.sentMsg = function (msg) { waitTime(1, "隨機發消息:" + msg); click(device.width * 0.1, device.height * 0.97) waitTime(1, "發送"); var wg = className("android.widget.EditText").findOnce(); if (wg != null) { wg.setText(msg); } waitTime(1, "發送"); var wg2 = className("android.widget.Button").desc("發送").findOnce() if (wg2 != null) { wg2.click(); } waitTime(1, "發送完成"); }
開源代碼地址:
https://github.com/kkevsekk1/...
注意:本代碼只兼容 autox.js 4.2.8 以上,auto.js 4.1 和auto.pro 都不兼容哦,由於使用了最新的特性。git
若是有興趣須要代碼打包好的apk能夠提問,(其實你本身打包也是幾分鐘的事情) github
最後分享幾張效果圖web