薅羊毛软件-抢福袋源码分享

  • Post author:
  • Post category:其他




概述

这是一个系列分享,我会逐步开放更多的分享。

基于AutoJs实现的薅羊毛App专业版源码大分享。我分享的源码,全是正在商业使用的功能源码。源码的质量大家可以自己平衡。



抢福袋(抖音、抖音极速、抖音火山)全部兼容

功能覆盖所有版本,今天分享基础版本,不包含智能版,下期分享智能抢福袋,智能防止风控。



界面


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/webpack-autojs

注意:本代码只兼容 autox.js 4.2.8 以上,auto.js 4.1 和auto.pro 都不兼容哦,因为使用了最新的特性。

如果有兴趣需要代码打包好的apk可以提问,(其实你自己打包也是几分钟的事情)

最后分享几张效果图



版权声明:本文为kkevsekk原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。