栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

头条抢红包脚本源码

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

头条抢红包脚本源码

```javascript









































"ui";




var 软件 = [
    { 名称: "抖音火山版9.5.5", src: "https://pp.myapp.com/ma_icon/0/icon_42256978_1596972379/96", 下载链接: "https://file-history.liqucn.com/upload/2018/286/e/com.ss.android.ugc.live_9.5.5_liqucn.com.apk" },
    { 名称: "今日头条7.8.6", src: "http://w5.eydata.net/b6c59351ee917b7651s://images.liqucn.com/mini/120x120/img/h01/h74/img_localize_eae8bce835ca68920193ed7602b6fb9b_512x512_120x120.png", 下载链接: "http://w5.eydata.net/b6c59351ee917b7651s://file-history.liqucn.com/upload/2019/291/s/com.ss.android.article.news_7.8.6_liqucn.com.apk" }
];


var 下载线程, 下载平台名称, 下载平台图标, 下载平台链接, 下载平台路径, 当前页面 = "首页";
var 主程序线程, 悬浮窗线程, 屏幕遮盖悬浮线程, 运行状态 = false;
var 屏幕遮盖状态 = false;
var 已抢红包, 抢到红包, 已参与福袋;
var 卡密到期时间, 卡密剩余时间;
var 历史主播名称;

var 头条滑动切换直播次数 = 0;

var 脚本名称 = "开心助手 qq 21989834"

var 平台 = [];
for (x in 软件) {
    平台.push(软件[x].名称);
}



var 页面 = "设置";


var 版本名称 = "3.0.0";
var 当前版本号 = 829;

threads.start(function () {
    if (auto.service == null) {
        app.startActivity({
            action: "android.settings.ACCESSIBILITY_SETTINGS"
        });
        threads.start(function () {
            alert("无障碍服务", "此脚本由无障碍模式开发n务必开启无障碍服务");
        });
        exit();
    }

    if (floaty.checkPermission() != true) {
        toastLog("请授权悬浮窗权限");
        app.startActivity({
            action: "android.settings.action.MANAGE_OVERLAY_PERMISSION"
        });
        threads.start(function () {
            alert("悬浮窗权限", "请授权悬浮窗权限");
        });
        exit();
    }
    if (判断网络类型() == "没有网络") {
        toastLog("请连接网络再使用脚本");
        threads.start(function () {
            alert("网络异常", "请连接网络再使用脚本");
        });
        exit();
    }
    检查更新();
});








function 检查更新() {
    var 更新地址 = http_get("https://shimo.im/docs/PdQgKQx9HQjrGkDV/");
    if (更新地址 != null) {
        var 返回值 = 更新地址.match(/line="S+">S*

/g); if (返回值 != null) { for (var i = 0; i <= 返回值.length - 1; i++) { var 返回值处理 = 返回值[i].split("

"); 返回值处理 = 返回值处理[0].split(">")[1].trim(); if (返回值处理 != "
-1) { var 版本号 = parseInt(返回值处理.split("----")[1]); if (版本号 > 当前版本号) { app.openUrl(返回值处理.split("----")[2].trim()); threads.start(function () { alert("脚本更新", "检查到更新文件"); }); LocalStorage.put("oldNeedle", false); exit(); } else { toastLog("已是最新版本"); } return; } } } toastLog("无更新文件"); } else { toastLog("检查更新失败"); } } else { toastLog("检查更新失败"); } } var 本地存储 = storages.create("聚鲤科技"), 内容; var LocalStorage = storages.create("聚鲤科技6"); var DeveloperID = "13301"; var ApiPassword = "200361"; var SoftwareName = "kxkj"; var 登陆数据 = LocalStorage.get("oldNeedle"); if (登陆数据 == undefined || 登陆数据 == "" || 登陆数据 == false) { 登陆ui(); } else { 首页ui(); setTimeout(() => { threads.start(function () { SendHeartbeat(); }); }, 2000); } function 登陆ui() { ui.layout( {['ic_close_black_48dp']}}" layout_gravity="center_vertical|right" marginRight="20" /> {['ic_label_outline_black_48dp']}}" /> ); 内容 = 本地存储.get("CDK"); if (内容 != undefined) { ui.激活码.setText(内容); }; ui.激活码窗口.on("click", () => { ui.清空激活码.setAlpha(1); }) ui.激活码.on("click", () => { ui.清空激活码.setAlpha(1); }) ui.清空激活码.on("click", () => { if (ui.清空激活码.getAlpha() == 1) { ui.激活码.setText(""); } }) ui.bg.on("touch", () => { ui.清空激活码.setAlpha(0); }) ui.登陆.on("click", () => { toastLog("登录中请稍候。。。") var CDK = ui.激活码.getText() + "".trim(); 本地存储.put("CDK", CDK); var 返回登陆结果 = CDKLogin(); if (返回登陆结果[0] == true) { 首页ui(); setTimeout(() => { threads.start(function () { SendHeartbeat(); }); }, 3000) } else { dialogs.alert("登陆失败", 返回登陆结果[1]); } }) ui.获取卡密.on("click", function () { 浏览器ui("获取卡密", "http://2cccc.cc/verifyer2019/pub/card_sell/id/7212.html", "登陆ui"); }) ui.在线客服.on("click", function () { 客服ui("登陆ui"); }) } function 首页ui() { importClass(android.view.MenuItem); importClass(com.google.android.material.bottomnavigation.BottomNavigationView); importClass(com.google.android.material.bottomnavigation.LabelVisibilityMode); ui.layout( {} {} {软件[0].src}}" /> {} {} {软件[1].src}}" /> {} {} {['ic_keyboard_arrow_right_black_48dp']}}" /> {['ic_keyboard_arrow_right_black_48dp']}}" /> {['ic_keyboard_arrow_right_black_48dp']}}" /> {this.icon}}" tint="#696969" marginTop="2" /> ); var 登陆数据 = LocalStorage.get("oldNeedle"); if (登陆数据 == undefined || 登陆数据 == "" || 登陆数据 == false) { 登陆ui(); } else { ui.登录.attr("h", "0"); ui.激活码信息.attr("h", "90"); 内容 = 本地存储.get("CDK"); if (内容 != undefined) { ui.激活码_text.setText("激活码:" + 内容) }; ui.到期时间_text.setText("到期时间: " + 卡密到期时间); ui.剩余时间_text.setText("剩余时间: " + 卡密剩余时间); } 内容 = 本地存储.get("抢红包"); if (内容 == true) { ui.抢红包.checked = (true); } 内容 = 本地存储.get("参与福袋"); if (内容 == true) { ui.参与福袋.checked = (true); } 内容 = 本地存储.get("上限人数_box"); if (内容 == true) { ui.上限人数_box.checked = (true); } 内容 = 本地存储.get("上限人数"); if (内容 != undefined) { ui.上限人数.setText(内容) }; 内容 = 本地存储.get("提前抢"); if (内容 == true) { ui.提前抢.checked = (true); } 内容 = 本地存储.get("准时抢"); if (内容 == true) { ui.准时抢.checked = (true); } 内容 = 本地存储.get("找寻红包sj"); if (内容 != undefined) { ui.找寻红包sj.setText(内容) }; 内容 = 本地存储.get("红包上限sj_box"); if (内容 == true) { ui.红包上限sj_box.checked = (true); } 内容 = 本地存储.get("红包上限sj"); if (内容 != undefined) { ui.红包上限sj.setText(内容) }; 内容 = 本地存储.get("提前抢红包sj"); if (内容 != undefined) { ui.提前抢红包sj.setText(内容) }; 内容 = 本地存储.get("提前点开红包sj"); if (内容 != undefined) { ui.提前点开红包sj.setText(内容) }; 内容 = 本地存储.get("快速找寻"); if (内容 == true) { ui.快速找寻.checked = (true); } 内容 = 本地存储.get("普通找寻"); if (内容 == true) { ui.普通找寻.checked = (true); } 内容 = 本地存储.get("找寻福袋sj"); if (内容 != undefined) { ui.找寻福袋sj.setText(内容) }; 内容 = 本地存储.get("福袋上限sj_box"); if (内容 == true) { ui.福袋上限sj_box.checked = (true); } 内容 = 本地存储.get("福袋上限sj"); if (内容 != undefined) { ui.福袋上限sj.setText(内容) }; 内容 = 本地存储.get("等待开奖再离开_box"); if (内容 == true) { ui.等待开奖再离开_box.checked = (true); } 内容 = 本地存储.get("普通找寻限制次数_box"); if (内容 == true) { ui.普通找寻限制次数_box.checked = (true); } 内容 = 本地存储.get("普通找寻限制次数"); if (内容 != undefined) { ui.普通找寻限制次数.setText(内容) }; let bnv = ui.bnv; bnv.setLabelVisibilityMode(LabelVisibilityMode.LABEL_VISIBILITY_LABELED);//1 不开动画 0 动画 let menu = bnv.getMenu(); menu.add(0, 0, 0, "首页").setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM); menu.getItem(0).setIcon(getResID('ic_home_black_48dp', 'drawable')); menu.add(0, 1, 1, "设置").setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM); menu.getItem(1).setIcon(getResID('ic_settings_black_48dp', 'drawable')); menu.add(0, 2, 2, "我的").setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM); menu.getItem(2).setIcon(getResID('ic_person_black_48dp', 'drawable')); bnv.setOnNavigationItemSelectedListener({ onNavigationItemSelected: function (item) { //跳转到对应的页面 ui.vp.setCurrentItem(item.getItemId()); return true; } }); // 为ViewPager添加页面改变事件 ui.vp.addonPageChangeListener({ onPageSelected: function (position) { // 将当前的页面对应的底部标签设为选中状态 menu.getItem(position).setChecked(true); } }); ui.vp.addonPageChangeListener({ onPageSelected: function (position) { // 将当前的页面对应的底部标签设为选中状态 menu.getItem(position).setChecked(true); 当前页面 = menu.getItem(position); if (当前页面 == "首页") { ui.toolbar.setTitle(脚本名称); } else if (当前页面 == "设置") { ui.toolbar.setTitle(页面); if (页面 == "未选择平台") { alert("友情提示", "您尚未选择平台n1.进入首页选择平台后再运行"); } } else { ui.toolbar.setTitle(menu.getItem(position).getTitle()); } } }); // 初始化 设置ToolBar标题 ui.toolbar.setTitle(脚本名称); function getResID(name, type) { return context.getResources().getIdentifier(name, type, context.getPackageName()); } // 让工具栏左上角可以打开侧拉菜单 ui.toolbar.setupWithDrawer(ui.drawer); ui.menu.setDataSource([ { title: "无障碍服务", icon: "@drawable/ic_android_black_48dp" }, { title: "悬浮窗权限", icon: "@drawable/ic_extension_black_48dp" }, { title: "查看日志", icon: "@drawable/ic_assignment_black_48dp" }, { title: "提前/准时抢", icon: "@drawable/ic_developer_mode_black_48dp" }, { title: "指针位置", icon: "@drawable/ic_mouse_black_48dp" }, { title: "手机信息", icon: "@drawable/ic_tablet_android_black_48dp" }, { title: "意见反馈", icon: "@drawable/ic_rate_review_black_48dp" }, { title: "检查更新", icon: "@drawable/ic_cached_black_48dp" } ]); ui.menu.on("item_click", item => { switch (item.title) { case "无障碍服务": { alert("无障碍服务", "此脚本由无障碍模式开发n务必开启无障碍服务").then(() => { app.startActivity({ action: "android.settings.ACCESSIBILITY_SETTINGS" }); }); break; } case "悬浮窗权限": { alert("悬浮窗权限", "脚本需要悬浮窗权限n务必开启悬浮窗权限n1.进入脚本权限设置界面n2.找到《显示悬浮窗》《后台弹出界面》并给予权限").then(() => { app.startActivity({ action: "android.settings.action.MANAGE_OVERLAY_PERMISSION" }); }); break; }; case "查看日志": { log("查看日志"); app.startActivity("console"); break; }; case "提前/准时抢": { log("提前/准时抢") threads.start(function () { 奔放模式(); }); break; }; case "手机信息": { log("手机信息") 文本ui("手机信息", "手机信息", "首页ui") break; }; case "指针位置": { log("指针位置") threads.start(function () { 指针位置(); }); break; }; case "意见反馈": { log("意见反馈"); 浏览器ui("意见反馈", "https://shimo.im/forms/GJwxWJGTdKKcTYp8/fill", "首页ui") break; }; case "检查更新": { log("检查更新"); 检查更新(); break; } } }) ui.设置.on("click", () => { app.startActivity("settings"); }) ui.退出.on("click", () => { exit(); }) ui.平台_0.on("click", () => { 页面 = 平台[0] + "设置"; toastLog("设置" + 平台[0]); 本地存储.put("设置页面储存", "0"); ui.头条福袋.attr("h", "0dp"); ui.vp.setCurrentItem(1); menu.getItem(1).setChecked(true); }) ui.平台_1.on("click", () => { 页面 = 平台[1] + "设置"; toastLog("设置" + 平台[1]); 本地存储.put("设置页面储存", "1"); ui.头条福袋.attr("h", "500dp"); ui.vp.setCurrentItem(1); menu.getItem(1).setChecked(true); }) 内容 = 本地存储.get("设置页面储存"); if (内容 != undefined) { 内容 = parseInt(内容); if (内容 == 1) { ui.头条福袋.attr("h", "500dp"); } 页面 = 平台[内容] + "设置" } else { 页面 = "未选择平台"; }; ui.下载0.on("click", () => { 下载提示(0) }) ui.下载1.on("click", () => { 下载提示(1) }) ui.准时抢.on("click", () => { if (ui.准时抢.checked == true) { alert("友情提示", "准时抢模式请点击左上角<抽屉栏>,提前/准时抢进行切换再运行"); } ui.提前抢.checked = (false); }) ui.提前抢.on("click", () => { if (ui.提前抢.checked == true) { alert("友情提示", "提前抢模式需点击左上角<抽屉栏>,提前/准时抢进行切换再运行"); } ui.准时抢.checked = (false); }) ui.快速找寻.on("click", () => { ui.普通找寻.checked = (false); }) ui.普通找寻.on("click", () => { ui.快速找寻.checked = (false); }) ui.运行.on("click", () => { if (运行状态 == false) { toastLog("开始运行"); if (auto.service == null) { alert("无障碍服务", "此脚本由无障碍模式开发n务必开启无障碍服务").then(() => { app.startActivity({ action: "android.settings.ACCESSIBILITY_SETTINGS" }); }); return; } if (ui.抢红包.checked == true) { if (ui.提前抢.checked == false && ui.准时抢.checked == false) { alert("友情提示", "尚未选择抢红包模式").then(() => { }); return; } if (ui.红包上限sj_box.checked == true) { if (ui.红包上限sj.getText() == null || ui.红包上限sj.getText() == "" || ui.红包上限sj.getText() == undefined) { alert("友情提示", "您选择了,限制红包上限时间,但是未填写参数").then(() => { }); return; } } if (ui.提前点开红包sj.getText() == null || ui.提前点开红包sj.getText() == "" || ui.提前点开红包sj.getText() == undefined) { alert("友情提示", "您未填写提前点开红包参数").then(() => { }); return; } if (ui.提前抢红包sj.getText() == null || ui.提前抢红包sj.getText() == "" || ui.提前抢红包sj.getText() == undefined) { alert("友情提示", "您未填写提前抢红包参数").then(() => { }); return; } if (ui.找寻红包sj.getText() == null || ui.找寻红包sj.getText() == "" || ui.找寻红包sj.getText() == undefined) { alert("友情提示", "您未填写找寻红包时间").then(() => { }); return; } } if (ui.上限人数_box.checked == true) { if (ui.上限人数.getText() == null || ui.上限人数.getText() == "" || ui.上限人数.getText() == undefined) { alert("友情提示", "您选择了,上限人数限制,但未填写参数").then(() => { }); return; } } if (ui.参与福袋.checked == true) { if (ui.快速找寻.checked == false && ui.普通找寻.checked == false) { alert("友情提示", "尚未选择找寻福袋模式").then(() => { }); return; } if (ui.找寻福袋sj.getText() == null || ui.找寻福袋sj.getText() == "" || ui.找寻福袋sj.getText() == undefined) { alert("友情提示", "您未填写找福袋时间").then(() => { }); return; } if (ui.普通找寻限制次数_box.checked == true) { if (ui.普通找寻限制次数.getText() == "" || ui.普通找寻限制次数.getText() == null || ui.普通找寻限制次数.getText() == undefined) { alert("友情提示", "您选择了普通找寻限制刷新次数,但是未填写参数").then(() => { }); return; } } } 本地存储.put("上限人数_box", ui.上限人数_box.checked); 本地存储.put("上限人数", ui.上限人数.getText().toString()); 本地存储.put("抢红包", ui.抢红包.checked); 本地存储.put("提前抢", ui.提前抢.checked); 本地存储.put("准时抢", ui.准时抢.checked); 本地存储.put("找寻红包sj", ui.找寻红包sj.getText().toString()); 本地存储.put("红包上限sj_box", ui.红包上限sj_box.checked); 本地存储.put("红包上限sj", ui.红包上限sj.getText().toString()); 本地存储.put("提前点开红包sj", ui.提前点开红包sj.getText().toString()); 本地存储.put("提前抢红包sj", ui.提前抢红包sj.getText().toString()); 本地存储.put("参与福袋", ui.参与福袋.checked); 本地存储.put("快速找寻", ui.快速找寻.checked); 本地存储.put("普通找寻", ui.普通找寻.checked); 本地存储.put("找寻福袋sj", ui.找寻福袋sj.getText().toString()); 本地存储.put("福袋上限sj_box", ui.福袋上限sj_box.checked); 本地存储.put("福袋上限sj", ui.福袋上限sj.getText().toString()); 本地存储.put("等待开奖再离开_box", ui.等待开奖再离开_box.checked); 本地存储.put("普通找寻限制次数_box", ui.普通找寻限制次数_box.checked); 本地存储.put("普通找寻限制次数", ui.普通找寻限制次数.getText().toString()); 运行状态 = true; home(); 悬浮窗线程 = threads.start(悬浮窗); 主程序线程 = threads.start(主程序); ui.运行.attr("tint", "red"); ui.运行.attr("src", "ic_power_settings_new_black_48dp"); } else { toastLog("结束运行"); 运行状态 = false; 主程序线程.interrupt(); 悬浮窗线程.interrupt(); ui.运行.attr("tint", "#76EEC6"); ui.运行.attr("src", "ic_play_arrow_black_48dp"); } }) ui.登录.on("click", () => { console.log("登陆点击了"); 登陆ui(); }) ui.获取卡密.on("click", function () { 浏览器ui("获取卡密", "http://2cccc.cc/verifyer2019/pub/card_sell/code/RUXHBHH5XAUKLXKW.html", "首页ui"); }) ui.在线客服.on("click", function () { 客服ui("首页ui"); }) ui.退出登陆.on("click", () => { if (ui.激活码_text.getText() == "激活码:") { toastLog("操作太快啦!") return; } else { log("退出登陆"); var 退出登陆 = LogoutNeedle(); if (退出登陆[0] != false) { LocalStorage.put("oldNeedle", false); dialogs.alert("退出提示", 退出登陆[1]); exit(); } else { dialogs.alert("退出提示", 退出登陆[1]); } } }); } function 延迟(a) { if (ui.操作延迟_box.checked == true) { var 延迟; var 延迟小 = parseInt(ui.操作延迟小.getText()) * 1000; var 延迟大 = parseInt(ui.操作延迟大.getText()) * 1000; 延迟 = random(延迟小, 延迟大) * a; console.verbose('操作sj:' + 延迟); sleep(延迟); } } function 主程序() { var 包名; console.log(页面); sleep(3000); var 当前时间 = new Date();//创建时间 var 当前日期 = 当前时间.getDate(); 内容 = 本地存储.get("时间"); if (内容 == undefined || 内容 == "") { 本地存储.put("时间", 当前日期); 本地存储.put("已抢红包", 0); 本地存储.put("抢到红包", 0); 本地存储.put("已参与福袋", 0); } else { if (parseInt(内容) != 当前日期) { 本地存储.put("时间", 当前日期); 本地存储.put("已抢红包", 0); 本地存储.put("抢到红包", 0); 本地存储.put("已参与福袋", 0); } } 内容 = 本地存储.get("已抢红包"); if (内容 == undefined || 内容 == "") { 已抢红包 = 0 本地存储.put("已抢红包", 0); } else { 已抢红包 = 内容; } 内容 = 本地存储.get("抢到红包"); if (内容 == undefined || 内容 == "") { 抢到红包 = 0 本地存储.put("抢到红包", 0); } else { 抢到红包 = 内容; } 内容 = 本地存储.get("已参与福袋"); if (内容 == undefined || 内容 == "") { 已参与福袋 = 0 本地存储.put("已参与福袋", 0); } else { 已参与福袋 = 内容; } 悬浮窗文本设置("抢到红包", "抢到:" + 抢到红包, "灰色"); 悬浮窗文本设置("已抢红包", "已抢:" + 已抢红包, "灰色"); 悬浮窗文本设置("已参与福袋", "已参与:" + 已参与福袋, "灰色"); if (页面 == "抖音火山版9.5.5设置") { 悬浮窗文本设置("当前平台", "平台:火山短视频", "灰色"); 包名 = getPackageName("抖音火山版"); if (包名 != null) { if (获取指定应用版本号(包名) == "9.5.5") { threads.start(function () { 火山弹窗监控(); }); 火山红包(); } else { threads.start(function () { alert("友情提示", "<抖音火山版>版本错误,请下载指定版本<抖音火山版>"); }); exit(); } } else { threads.start(function () { alert("友情提示", "尚未安装指定版本<抖音火山版>"); }); exit(); } } else if (页面 == "今日头条7.8.6设置") { 悬浮窗文本设置("当前平台", "平台:今日头条", "灰色"); 包名 = getPackageName("今日头条"); if (包名 != null) { if (获取指定应用版本号(包名) == "7.8.6") { threads.start(function () { 头条弹窗监控(); }); 头条红包福袋(); } else { threads.start(function () { alert("友情提示", "<今日头条>版本错误,请下载指定版本<今日头条>"); }); exit(); } } else { threads.start(function () { alert("友情提示", "尚未安装指定版本<今日头条>"); }); exit(); } } } function http_get(网址) { try { var 访问网址 = http.get(网址) var 返回值 = 访问网址.body.string(); return 返回值; } catch (e) { } } function 获取指定应用版本号(packageName) { importPackage(android.content); var pckMan = context.getPackageManager(); var packageInfo = pckMan.getPackageInfo(packageName, 0); return packageInfo.versionName; } function 头条弹窗监控() { while (true) { var 赠送玫瑰 = id("com.ss.android.liveplugin:id/tv_send_gift").text("立即赠送").visibleToUser(true).findonce(); if (赠送玫瑰 != null) { toastLog('主播讨礼物啦,快跑'); 关闭直播间提示(); } var 关注提示 = id("com.ss.android.liveplugin:id/follow").textContains("立即关注").visibleToUser(true).findonce(); if (关注提示 != null) { toastLog('主播求关注啦') 关闭直播间提示(); } var 更新提示 = id("com.ss.android.article.news:id/ekf").visibleToUser(true).findonce(); if (更新提示 != null) { toastLog('关闭更新提示'); var 关闭更新 = id("com.ss.android.article.news:id/ekd").findOne(2000); if (关闭更新 != null) { 关闭更新.click(); } } sleep(500) } } function 返回头条首页(导航) { 悬浮窗文本设置("运行情况", '返回头条' + 导航, "红色"); while (true) { context.startActivity(app.intent({ action: "VIEW", className: "com.ss.android.article.news.activity.MainActivity", packageName: "com.ss.android.article.news" }).setFlags(335544320)); var 首页导航栏 = id("com.ss.android.article.news:id/bgr").text(导航).visibleToUser(true).findOne(8000); if (首页导航栏 != null) { if (首页导航栏.selected() != true) { 首页导航栏.parent().click(); } return; } } } function 进入头条直播间() { 头条滑动切换直播次数 = 0; 悬浮窗文本设置("运行情况", '进入头条直播间', "灰色"); while (true) { var 直播界面 = id("com.ss.android.liveplugin:id/entrance_text").text("更多直播").visibleToUser(true).findOne(3000); if (直播界面 != null) { 悬浮窗文本设置("运行情况", '进入头条直播间_成功进入直播间', "灰色"); return true; } else { 悬浮窗文本设置("运行情况", '进入头条直播间_未在直播间', "灰色"); var 西瓜视频界面 = id("com.ss.android.article.news:id/bgr").text("西瓜视频").visibleToUser(true).findOne(3000); if (西瓜视频界面) { if (西瓜视频界面.selected() != true) { 悬浮窗文本设置("运行情况", '进入头条直播间_进入西瓜视频', "灰色"); 西瓜视频界面.parent().click(); } else { 悬浮窗文本设置("运行情况", '进入头条直播间_已在西瓜视频界面', "灰色"); } var 西瓜视频直播大厅 = packageName("com.ss.android.article.news").desc("直播").visibleToUser(true).findOne(2000); if (西瓜视频直播大厅 != null) { 悬浮窗文本设置("运行情况", '进入头条直播间_进入直播大厅', "灰色"); if (西瓜视频直播大厅.selected()==true) { 西瓜视频直播大厅.click(); }else{ 西瓜视频直播大厅.click(); sleep(2000); 西瓜视频直播大厅.click(); } var 进入直播 = id("com.ss.android.article.news:id/bjp").visibleToUser(true).findOne(6000); if (进入直播 != null) { 悬浮窗文本设置("运行情况", '进入头条直播间_进入直播间', "灰色"); 进入直播.click(); sleep(7000); } } } else { 悬浮窗文本设置("运行情况", '进入头条直播间_进入西瓜视频界面失败', "灰色"); 返回头条首页("西瓜视频"); } } } } function 头条滑动切换直播间() { if (本地存储.get("普通找寻限制次数_box") == true) { 头条滑动切换直播次数++; 悬浮窗文本设置("运行情况", '切换直播间:' + 头条滑动切换直播次数 + "次", "灰色"); sleep(1000); if (头条滑动切换直播次数 >= 本地存储.get("普通找寻限制次数")) { 悬浮窗文本设置("运行情况", '切换直播间_刷新直播列表', "灰色"); sleep(1000); 返回头条首页("西瓜视频"); 进入头条直播间(); } } 悬浮窗文本设置("运行情况", '切换直播间', "灰色"); while (true) { var 切换直播间 = id("com.ss.android.liveplugin:id/viewpager").findOne(4000); if (切换直播间 != null) { 悬浮窗文本设置("运行情况", '切换直播间_开始切换', "灰色"); 切换直播间.scrollForward(); sleep(5000); var 直播界面 = id("com.ss.android.liveplugin:id/entrance_text").text("更多直播").visibleToUser(true).findOne(5000); if (直播界面 != null) { 悬浮窗文本设置("运行情况", '切换直播间_直播间加载成功', "灰色"); var 主播名称 = id("com.ss.android.article.news:id/ema").visibleToUser(true).findOne(4000); if (主播名称 != null) { var 当前主播名称 = 主播名称.text(); if (当前主播名称 == 历史主播名称) { 悬浮窗文本设置("运行情况", '直播间切换失败', "灰色"); 历史主播名称 = 当前主播名称; 返回头条首页("西瓜视频"); 进入头条直播间(); } else { 历史主播名称 = 当前主播名称; return true; } } else { 悬浮窗文本设置("运行情况", '直播间切换失败', "灰色"); 返回头条首页("西瓜视频"); 进入头条直播间(); } } else { 悬浮窗文本设置("运行情况", '切换直播间_直播间加载失败', "灰色"); } } else { 悬浮窗文本设置("运行情况", '切换直播间_未在直播间', "红色"); 进入头条直播间(); } } } function 头条快速切换直播间() { var 返回次数 = 0; 悬浮窗文本设置("运行情况", '快速切换直播间', "灰色"); while (true) { var 西瓜视频直播大厅 = packageName("com.ss.android.article.news").desc("直播").visibleToUser(true).findOne(2000); if (西瓜视频直播大厅 != null) { 悬浮窗文本设置("运行情况", '快速切换直播间_刷新直播大厅', "灰色"); if (西瓜视频直播大厅.selected()==true) { 西瓜视频直播大厅.click(); }else{ 西瓜视频直播大厅.click(); sleep(2000); 西瓜视频直播大厅.click(); } sleep(2000); 悬浮窗文本设置("运行情况", '快速切换直播间_找寻福袋', "灰色"); for (var i = 0; i < 4;) { var 进入福袋 = id("com.ss.android.article.news:id/bm2").findOne(2000); if (进入福袋 != null) { 悬浮窗文本设置("运行情况", '快速切换直播间_进入福袋', "灰色"); 进入福袋.parent().parent().click(); var 直播界面 = id("com.ss.android.liveplugin:id/entrance_text").text("更多直播").visibleToUser(true).findOne(8000); if (直播界面 != null) { 悬浮窗文本设置("运行情况", '快速切换直播间_成功', "灰色"); return true; } else { 悬浮窗文本设置("运行情况", '快速切换直播间_失败', "红色"); } break; } else { i++; 悬浮窗文本设置("运行情况", '快速切换直播间_翻阅直播大厅:' + i, "红色"); var 滑动直播大厅 = id("com.ss.android.article.news:id/d1a").visibleToUser(true).findOne(1000); if (滑动直播大厅 != null) { 滑动直播大厅.scrollForward(); } } } } else { if (返回次数 >= 2) { 返回头条首页("西瓜视频"); var 西瓜视频界面 = id("com.ss.android.article.news:id/bgr").text("西瓜视频").visibleToUser(true).findOne(3000); if (西瓜视频界面) { if (西瓜视频界面.selected() != true) { 悬浮窗文本设置("运行情况", '快速切换直播间_进入西瓜视频', "灰色"); 西瓜视频界面.parent().click(); } else { 悬浮窗文本设置("运行情况", '快速切换直播间_已在西瓜视频界面', "灰色"); } } } else { back(); 返回次数++; var 退出提示 = id("com.ss.android.liveplugin:id/live_dialog_btn_2").text("退出").findOne(2000); if (退出提示 != null) { 退出提示.click(); } } } } } function 头条红包福袋() { var 红包上限时间 = parseInt(本地存储.get("红包上限sj")); var 直播间人数上限 = parseInt(本地存储.get("上限人数")); var 找寻红包时间 = parseInt(本地存储.get("找寻红包sj")); var 找寻福袋时间 = parseInt(本地存储.get("找寻福袋sj")); var 福袋上限时间 = parseInt(本地存储.get("福袋上限sj")); var 福袋, 福袋开奖时间, 分, 秒, 延迟; if (本地存储.get("快速找寻") == true) { 头条快速切换直播间(); } else if (本地存储.get("普通找寻") == true) { 进入头条直播间(); } while (true) { var 直播界面 = id("com.ss.android.liveplugin:id/entrance_text").text("更多直播").visibleToUser(true).findOne(3000); if (直播界面 != null) { log("在直播间") if (本地存储.get("上限人数_box") == true) { var 直播间人数 = id("com.ss.android.liveplugin:id/online_info").findOne(3000); if (直播间人数 != null) { 直播间人数 = 直播间人数.text(); if (直播间人数.indexOf("万") > -1) { 直播间人数 = 直播间人数.split("万")[0]; 直播间人数 = 直播间人数 * 10000; } else { 直播间人数 = parseInt(直播间人数); } 悬浮窗文本设置("运行情况", '直播间人数:' + 直播间人数, "灰色"); sleep(1000); if (直播间人数 >= 直播间人数上限) { 悬浮窗文本设置("运行情况", '直播间人数上限', "红色"); sleep(1000); if (本地存储.get("快速找寻") == true) { 头条快速切换直播间(); } else if (本地存储.get("普通找寻") == true) { 头条滑动切换直播间(); } continue; } } } if (本地存储.get("参与福袋") == true) { 悬浮窗文本设置("运行情况", '搜寻福袋', "灰色"); 福袋 = id("com.ss.android.liveplugin:id/count_down").visibleToUser(true).findOne(找寻福袋时间 * 1000); if (福袋 != null) { log("找到福袋"); for (var i = 1; i <= 1; i++) { log(i + "i") if (本地存储.get("福袋上限sj_box") == true) { 福袋开奖时间 = 福袋.text().split(":"); 分 = 福袋开奖时间[0] * 60; 秒 = 福袋开奖时间[1] * 1; 延迟 = 分 + 秒; 悬浮窗文本设置("运行情况", '福袋开奖sj:' + 延迟 + "秒", "灰色"); sleep(1000); if (延迟 >= 福袋上限时间) { 悬浮窗文本设置("运行情况", '福袋等待时间上限', "红色"); sleep(1000); break; } } 悬浮窗文本设置("运行情况", '点开福袋', "灰色"); 福袋.parent().click() sleep(3000); var 一键参与福袋 = text("一键参与获取福袋").visibleToUser(true).findOne(4000); if (一键参与福袋 != null) { 悬浮窗文本设置("运行情况", '一键参与福袋', "灰色"); 已参与福袋++; 本地存储.put("已参与福袋", 已参与福袋); 悬浮窗文本设置("已参与福袋", "已参与:" + 已参与福袋, "灰色"); 一键参与福袋.click(); sleep(1000); if (本地存储.get("等待开奖再离开_box") == true) { while (true) { 福袋 = id("com.ss.android.liveplugin:id/count_down").visibleToUser(true).findOne(4000); if (福袋 != null) { 福袋开奖时间 = 福袋.text().split(":"); 分 = 福袋开奖时间[0] * 60; 秒 = 福袋开奖时间[1] * 1; 延迟 = 分 + 秒; 悬浮窗文本设置("运行情况", '福袋开奖sj:' + 延迟 + "秒", "灰色"); } else { 悬浮窗文本设置("运行情况", '福袋已开奖', "灰色"); var 福袋发放记录 = id("com.ss.android.liveplugin:id/web_browser_fragment").findOne(4000); if (福袋发放记录 != null) { sleep(2000); back(); } break; } sleep(1000); } } else { sleep(3000); } } else { 悬浮窗文本设置("运行情况", '收费福袋,不参与', "灰色"); sleep(1000); back(); } } } else { 悬浮窗文本设置("运行情况", '未搜寻到福袋', "红色"); sleep(1000); } } if (本地存储.get("抢红包") == true) { 悬浮窗文本设置("运行情况", '搜寻红包', "灰色"); var 直播间红包 = id("com.ss.android.article.news:id/e85").visibleToUser(true).findOne(找寻红包时间 * 1000); if (直播间红包 != null) { if (本地存储.get("红包上限sj_box") == true) { var 红包开抢时间 = 直播间红包.text().split(":"); 分 = 红包开抢时间[0] * 60; 秒 = 红包开抢时间[1] * 1; 延迟 = 分 + 秒; 悬浮窗文本设置("运行情况", '红包等待sj:' + 延迟 + "秒", "灰色"); if (延迟 >= 红包上限时间) { 悬浮窗文本设置("运行情况", '红包等待时间上限', "红色"); if (本地存储.get("快速找寻") == true) { 头条快速切换直播间(); } else if (本地存储.get("普通找寻") == true) { 头条滑动切换直播间(); } continue; } } 头条抢红包(); 悬浮窗文本设置("抢到红包", "抢到:" + 抢到红包, "不打印"); 悬浮窗文本设置("已抢红包", "已抢:" + 已抢红包, "不打印"); } else { 悬浮窗文本设置("运行情况", '未找到红包', "红色"); // sleep(1000); // 头条切换直播间(); } } if (本地存储.get("快速找寻") == true) { 头条快速切换直播间(); } else if (本地存储.get("普通找寻") == true) { 头条滑动切换直播间(); } } else { 悬浮窗文本设置("运行情况", '未在直播间,开始切换进入', "红色"); sleep(1000); if (本地存储.get("快速找寻") == true) { 头条快速切换直播间(); } else if (本地存储.get("普通找寻") == true) { 头条滑动切换直播间(); } } } } function 关闭直播间提示() { var X = random(998, 1080); var Y = random(550, 1295); var sj = random(10, 400); press(X, Y, sj); } function 头条抢红包() { var 红包; var 提前点开红包 = ui.提前点开红包sj.getText() * 1000; var 提前抢红包 = parseInt(ui.提前抢红包sj.getText()); while (true) { var 直播间红包 = id("com.ss.android.article.news:id/e85").visibleToUser(true).findOne(4000); if (直播间红包 != null) { var 红包开抢时间 = 直播间红包.text().split(":"); var 分 = 红包开抢时间[0]; var 秒 = 红包开抢时间[1]; var 延迟 = ((分 * 60) + (秒 * 1)) * 1000; 悬浮窗文本设置("运行情况", '红包等待sj:' + (延迟 / 1000) + "秒", "灰色"); if (延迟 <= 提前点开红包) { 延迟 = 延迟 - 300; 悬浮窗文本设置("运行情况", "点开红包", "灰色"); 直播间红包.parent().parent().click(); if (ui.提前抢.checked == true) { while (true) { if (延迟 <= 提前抢红包) { 红包 = id("com.ss.android.liveplugin:id/fl_rush").findOne(3000); if (红包 != null) { var 范围 = 红包.bounds() press(范围.centerX() + random(-30, 30), 范围.centerY() + random(-30, 30), 10); 已抢红包++; 本地存储.put("已抢红包", 已抢红包); var 抢到 = id("com.ss.android.liveplugin:id/tv_card_title").textContains("已抢到").visibleToUser(true).findOne(5000); if (抢到 != null) { 悬浮窗文本设置("运行情况", 抢到.text(), "灰色"); 抢到红包++; 本地存储.put("抢到红包", 抢到红包); } else { 悬浮窗文本设置("运行情况", "未抢到", "红色"); } 关闭直播间提示(); return; } else { 悬浮窗文本设置("运行情况", "抢红包出错", "红色"); return; } } else { 延迟 = 延迟 - 100; sleep(100); } } } else if (ui.准时抢.checked == true) { 红包 = id("com.ss.android.liveplugin:id/rush").clickable(true).findOne(提前点开红包 + 2000); if (红包 != null) { 红包.click(); 已抢红包++; 本地存储.put("已抢红包", 已抢红包); var 抢到 = id("com.ss.android.liveplugin:id/tv_card_title").textContains("已抢到").visibleToUser(true).findOne(5000); if (抢到 != null) { 悬浮窗文本设置("运行情况", 抢到.text(), "灰色"); 抢到红包++; 本地存储.put("抢到红包", 抢到红包); } else { 悬浮窗文本设置("运行情况", "未抢到", "红色"); } 关闭直播间提示(); return; } else { 悬浮窗文本设置("运行情况", "抢红包出错", "红色"); return; } } else { alert("友情提示", "您尚未选择抢红包模式,请重新配置后启动"); exit(); } } } else { 悬浮窗文本设置("运行情况", '红包等待开抢错误', "红色"); return; } sleep(500); } } function 火山弹窗监控() { while (true) { var 青少年模式 = id("com.ss.android.ugc.live:id/pm").text("进入儿童/青少年模式").visibleToUser(true).findonce(); if (青少年模式 != null) { toastLog('关闭青少年提示'); var 我知道了 = id("com.ss.android.ugc.live:id/x2").text("我知道了").findOne(3000); if (我知道了 != null) { 我知道了.click(); } } var 赠送玫瑰 = id("com.ss.android.ugc.live:id/eav").visibleToUser(true).text("立即赠送").findonce(); if (赠送玫瑰 != null) { toastLog('主播讨礼物啦,快跑'); 关闭直播间提示(); } var 关注提示 = id("com.ss.android.ugc.live:id/ss").textContains("关注主播").visibleToUser(true).findonce(); if (关注提示 != null) { toastLog('主播求关注,考虑要不要关注') var 随机关注 = random(1, 5); if (随机关注 == 1) { toastLog('看主播可怜关注它吧'); var 关注 = id("com.ss.android.ugc.live:id/avx").text("关注").visibleToUser(true).findOne(1000); if (关注 != null) { 关注.click(); } else { toastLog('关注失败'); 关闭直播间提示(); } } else { toastLog('不听它的,快跑!!!'); 关闭直播间提示(); } } sleep(500); } } function 返回火山首页(导航) { console.verbose('返回' + 导航); while (true) { context.startActivity(app.intent({ action: "VIEW", className: "com.ss.android.ugc.live.main.MainActivity", packageName: "com.ss.android.ugc.live" }).setFlags(335544320)); var 首页导航栏 = id("com.ss.android.ugc.live:id/title").text(导航).findOne(8000); if (首页导航栏 != null) { 首页导航栏.parent().click(); return; } } } function 火山红包() { var 红包上限时间 = parseInt(ui.红包上限sj.getText()); var 直播间人数上限 = parseInt(ui.上限人数.getText()); var 停留时间 = parseInt(ui.直播间停留sj.getText()); if (停留时间 == undefined || 停留时间 == "" || 停留时间 == null) { alert("友情提示", "您尚未选择抢红包模式,请重新配置后启动"); exit(); } while (true) { var 直播间红包 = id("com.ss.android.ugc.live:id/e3e").visibleToUser(true).findOne(停留时间 * 1000); if (直播间红包 != null) { if (ui.上限人数_box.checked == true) { var 直播间人数 = id("com.ss.android.ugc.live:id/ceg").findOne(1000); if (直播间人数 != null) { 直播间人数 = 直播间人数.text(); if (直播间人数.indexOf("万") > -1) { 直播间人数 = 直播间人数.split("万")[0]; 直播间人数 = 直播间人数 * 10000; } else { 直播间人数 = parseInt(直播间人数); } 悬浮窗文本设置("运行情况", '直播间人数:' + 直播间人数, "灰色"); if (直播间人数 >= 直播间人数上限) { 悬浮窗文本设置("运行情况", '直播间人数上限', "红色"); 火山切换直播间(); continue; } } } if (ui.红包上限sj_box.checked == true) { var 红包开抢时间 = 直播间红包.text().split(":"); var 分 = 红包开抢时间[0] * 60; var 秒 = 红包开抢时间[1] * 1; var 延迟 = 分 + 秒; 悬浮窗文本设置("运行情况", '红包等待sj:' + 延迟 + "秒", "不打印"); if (延迟 >= 红包上限时间) { 悬浮窗文本设置("运行情况", '红包等待时间上限', "红色"); 火山切换直播间(); continue; } } 火山抢红包(); 悬浮窗文本设置("抢到红包", "抢到:" + 抢到红包, "不打印"); 悬浮窗文本设置("已抢红包", "已抢:" + 已抢红包, "不打印"); } else { 火山切换直播间(); } } } function 火山切换直播间() { 悬浮窗文本设置("运行情况", '切换直播间', "红色"); 返回火山首页("直播"); sleep(2000); for (var i = 0; i < 4;) { var 红包 = id("com.ss.android.ugc.live:id/cw0").findOne(2000); if (红包 != null) { 悬浮窗文本设置("运行情况", '进入红包直播间', "灰色"); 红包.parent().parent().click(); sleep(4000); break; } else { i++; 悬浮窗文本设置("运行情况", '未找到红包:' + i, "红色"); var 滑动首页直播 = id("com.ss.android.ugc.live:id/lr").visibleToUser(true).findOne(1000); if (滑动首页直播 != null) { 滑动首页直播.scrollForward(); } } } } function 火山抢红包() { var 红包, 手慢了; var 提前点开红包 = 本地存储.get("提前点开红包sj") * 1000; var 提前抢红包 = parseInt(本地存储.get("提前抢红包sj")); while (true) { var 直播间红包 = id("com.ss.android.ugc.live:id/e3e").visibleToUser(true).findOne(4000); if (直播间红包 != null) { var 红包开抢时间 = 直播间红包.text().split(":"); var 分 = 红包开抢时间[0]; var 秒 = 红包开抢时间[1]; var 延迟 = ((分 * 60) + (秒 * 1)) * 1000; 悬浮窗文本设置("运行情况", '红包等待sj:' + (延迟 / 1000) + "秒", "不打印"); if (延迟 <= 提前点开红包) { 延迟 = 延迟 - 300; 悬浮窗文本设置("运行情况", "点开红包", "灰色"); 直播间红包.parent().parent().click(); if (ui.提前抢.checked == true) { while (true) { if (延迟 <= 提前抢红包) { 红包 = id("com.ss.android.ugc.live:id/as_").findOne(3000); if (红包 != null) { var 范围 = 红包.bounds() press(范围.centerX() + random(-30, 30), 范围.centerY() + random(-30, 30), 10); sleep(4000); 已抢红包++; 本地存储.put("已抢红包", 已抢红包); 手慢了 = id("com.ss.android.ugc.live:id/e2i").text("送你一个好运气").visibleToUser(true).findOne(3000); if (手慢了 != null) { 悬浮窗文本设置("运行情况", "未抢到红包", "红色"); } else { 悬浮窗文本设置("运行情况", '抢到红包啦', "灰色"); // sleep(3000); 抢到红包++; 本地存储.put("抢到红包", 抢到红包); } 关闭直播间提示(); return; } else { 悬浮窗文本设置("运行情况", "抢红包出错", "红色"); return; } } else { 延迟 = 延迟 - 100; sleep(100); } } } else if (ui.准时抢.checked == true) { 红包 = id("com.ss.android.ugc.live:id/d18").clickable(true).findOne(提前点开红包 + 2000); if (红包 != null) { 红包.click(); sleep(4000); 已抢红包++; 本地存储.put("已抢红包", 已抢红包); 手慢了 = id("com.ss.android.ugc.live:id/e2i").text("送你一个好运气").visibleToUser(true).findOne(3000); if (手慢了 != null) { 悬浮窗文本设置("运行情况", "未抢到红包", "红色"); } else { 悬浮窗文本设置("运行情况", '抢到红包啦', "灰色"); // sleep(3000); 抢到红包++; 本地存储.put("抢到红包", 抢到红包); } 关闭直播间提示(); return; } else { 悬浮窗文本设置("运行情况", "抢红包出错", "红色"); return; } } else { alert("友情提示", "您尚未选择抢红包模式,请重新配置后启动"); exit(); } } } else { 悬浮窗文本设置("运行情况", '红包等待开抢错误', "红色"); return; } sleep(500); } } function 判断网络类型() { var Service = context.getSystemService(context.CONNECTIVITY_SERVICE); var Network = Service.getActiveNetworkInfo(); if (Network != null && Network.isAvailable()) { var name = Network.getTypeName(); return (name == "MOBILE" ? "移动网络" : (name == "WIFI" ? "WIFI" : "未知网络")); } else { return "没有网络"; } } function 悬浮窗() { window = floaty.window( ); window.setPosition(0, device.height - 500); window.setSize(device.width + 100, -2); setInterval(() => { }, 1000); if (运行状态 == false) { ui.运行.attr("tint", "#76EEC6"); ui.运行.attr("src", "ic_play_arrow_black_48dp"); } window.运行.on("click", function () { if (运行状态 == true) { 运行状态 = false; window.运行情况_text.setText("停止运行"); 主程序线程.interrupt(); window.运行.attr("tint", "#76EEC6"); window.运行.attr("src", "ic_play_arrow_black_48dp"); } else if (运行状态 == false) { 运行状态 = true; window.运行情况_text.setText("开始运行"); 主程序线程 = threads.start(主程序); window.运行.attr("tint", "red"); window.运行.attr("src", "ic_power_settings_new_black_48dp"); } }) window.返回首页.on("click", function () { 运行状态 = false; 主程序线程.interrupt(); var intent = new Intent(context, activity.class); activity.startActivityForResult(intent, 0); toastLog("回到首页"); ui.emitter.on("resume", function () { if (运行状态 == false) { if (ui.运行.attr("tint") == "red") { ui.运行.attr("tint", "#76EEC6"); ui.运行.attr("src", "ic_play_arrow_black_48dp"); } } else if (运行状态 == true) { if (ui.运行.attr("tint") == "#76EEC6") { ui.运行.attr("tint", "red"); ui.运行.attr("src", "ic_power_settings_new_black_48dp"); } } }); window.close(); 悬浮窗线程.interrupt(); }) } function 悬浮窗文本设置(文本id, 文本内容, 打印颜色) { ui.run(function () { window[文本id + "_text"].setText(文本内容); }); if (打印颜色 == "红色") { console.error(文本内容); } else if (打印颜色 == "灰色") { console.verbose(文本内容); } } function 下载提示(a) { confirm("下载提示", "是否需要下载《" + 平台[a] + "》") .then(clear => { if (clear) { toastLog("下载" + 平台[a]); 下载平台(a, "首页ui"); } }); } function 下载平台(a, 返回ui) { 下载平台名称 = 软件[a].名称, 下载平台图标 = 软件[a].src; 下载平台链接 = 软件[a].下载链接; 下载平台路径 = files.join(files.getSdcardPath(), 下载平台名称 + ".apk"); if (a == 4 || a == 5) { app.openUrl(下载平台链接); return; } var threadId; ui.layout( {['ic_keyboard_arrow_left_black_48dp']}}" /> {下载平台图标}}" /> ); ui.返回.on("click", () => { threadId && threadId.isAlive() && threadId.interrupt(); 下载线程 && 下载线程.isAlive() && 下载线程.interrupt(); if (返回ui == "登陆ui") { 登陆ui(); } else if (返回ui == "首页ui") { 首页ui(); } }) var 下载线程 = threads.start(download); function download() { var filePath = files.join(files.getSdcardPath(), 下载平台名称 + ".apk"); importClass('java.io.FileOutputStream'); importClass('java.io.IOException'); importClass('java.io.InputStream'); importClass('java.net.MalformedURLException'); importClass('java.net.URL'); importClass('java.net.URLConnection'); importClass('java.util.ArrayList'); var url = new URL(下载平台链接); var conn = url.openConnection(); //URLConnection var inStream = conn.getInputStream(); //InputStream var fs = new FileOutputStream(filePath); //FileOutputStream var connLength = conn.getContentLength(); //int var buffer = util.java.array('byte', 1024); //byte[] var byteSum = 0; //总共读取的文件大小 var byteRead; //每次读取的byte数 threadId = threads.start(function () { while (true) { var 当前写入的文件大小 = byteSum; var progress = (当前写入的文件大小 / connLength) * 100; if (progress > 0.1) { var progress = parseInt(progress).toString(); ui.run(function () { ui.进度条.setProgress(progress); ui.progressNum.setText(progress + '%'); }); if (当前写入的文件大小 >= connLength) { break; } } sleep(1000); } }); while ((byteRead = inStream.read(buffer)) != -1) { byteSum += byteRead; //当前时间 currentTime = java.lang.System.currentTimeMillis(); fs.write(buffer, 0, byteRead); //读取 } ui.run(function () { ui.进度条.setProgress("100"); ui.progressNum.setText('100%'); }); threadId && threadId.isAlive() && threadId.interrupt(); toastLog('下载完成'); app.viewFile(filePath); return; } } function 浏览器ui(标题名称, 链接, 返回ui) { ui.layout( {['ic_keyboard_arrow_left_black_48dp']}}" /> ); ui.标题名称.setText(标题名称); ui.webview.loadUrl(链接); ui.返回.on("click", () => { if (返回ui == "登陆ui") { 登陆ui(); } else if (返回ui == "首页ui") { 首页ui(); } }) } function 文本ui(标题名称, 文本, 返回ui) { ui.layout( {['ic_keyboard_arrow_left_black_48dp']}}" /> ); ui.标题名称.setText(标题名称); ui.返回.on("click", () => { if (返回ui == "登陆ui") { 登陆ui(); } else if (返回ui == "首页ui") { 首页ui(); } }) 内容 = "屏幕宽度:" + device.width + "n屏幕高度:" + device.height + "nbuildId:" + device.buildId + "n主板:" + device.board + "n制造商:" + device.brand + "n工业设计名称:" + device.device + "n产品名称:" + device.product + "n型号:" + device.model + "nbootloader版本:" + device.bootloader + "n硬件名称:" + device.hardware + "n唯一标识码:" + device.fingerprint + "n硬件序列号:" + device.serial + "nIncremental:" + device.incremental + "nAndroid系统版本号:" + device.release + "nbaseOS:" + device.baseOS + "n安全补丁程序级别:" + device.securityPatch + "n开发代号:" + device.codename + "n内存总量:" + device.getTotalMem() + "n当前可用内存:" + device.getAvailMem() + "nAndroidId: " + device.getAndroidId() + "nMac: " + device.getMacAddress() + "nAPI: " + device.sdkInt + "n电量: " + device.getBattery() + "nIMEI: " + device.getIMEI() if (文本 == "手机信息") { ui.文本.setText(内容); } else { ui.文本.setText(文本); } } function 客服ui(返回ui) { ui.layout( {['ic_keyboard_arrow_left_black_48dp']}}" /> ); ui.返回.on("click", () => { if (返回ui == "登陆ui") { 登陆ui(); } else if (返回ui == "首页ui") { 首页ui(); } }) } function CDKLogin() { //退出上一次的Needle var logoutResult = LogoutNeedle(); console.log("退出登陆" + logoutResult[1]); var CDK = 本地存储.get("CDK"); var loginResult = SendQLRequest( "apiv3/card_login", "card=" + CDK + "&software=" + SoftwareName ); if (loginResult[0]) { var successData = loginResult[1]; var endTime = successData["endtime"]; var lessTime = successData["less_time"]; var needle = successData["needle"]; PutSt("oldNeedle", needle); //存储本次 的Needle return [true, needle, lessTime]; } else { var failResult = loginResult[1]; return [false, failResult]; } } function LogoutNeedle() { var CDK = 本地存储.get("CDK"); var oldNeedle = LocalStorage.get("oldNeedle"); if (oldNeedle != "" || oldNeedle != undefined || oldNeedle != false) { PutSt("oldNeedle", false); //存储本次 的Needle var logoutResult = SendQLRequest( "apiv3/card_logout", "card=" + CDK + "&needle=" + oldNeedle ); if (logoutResult[0]) { return [true, oldNeedle + " 退出成功!"]; } else { return [false, oldNeedle + " 退出失败!"]; } } else { return [true, "上次无存储的Needle"]; } } function SendHeartbeat() { var CDK = 本地存储.get("CDK"); var cdkNeedle = LocalStorage.get("oldNeedle"); do { log("心跳验证中"); var heartbeatResult = SendQLRequest( "apiv3/card_ping", "card=" + CDK + "&software=" + SoftwareName + "&needle=" + cdkNeedle ); log("cdkNeedle:" + cdkNeedle) if (heartbeatResult[0]) { var successData = heartbeatResult[1]; var endTime = successData["endtime"]; var lessTime = successData["less_time"]; log("剩余时间" + lessTime); if (lessTime != null && lessTime != "") { ui.run(function () { ui.激活码_text.setText("激活码:" + CDK); 卡密到期时间 = endTime; ui.到期时间_text.setText("到期时间: " + 卡密到期时间); var 提取字符串 = lessTime.replace(/【/g, ""); 卡密剩余时间 = 提取字符串.replace(/】/g, ""); ui.剩余时间_text.setText("剩余时间: " + 卡密剩余时间); }); sleep(5 * 60 * 1000); //休息5分钟 } } else { var failResult = heartbeatResult[1]; LocalStorage.put("oldNeedle", false); threads.start(function () { alert("注册码异常", failResult); }); exit(); } } while (true); } function SendQLRequest(api, apiParams) { var qlHostArray = [ "http://napi.2cccc.cc/", "http://api2.2cccc.cc/", "http://api3.2cccc.cc/" ]; var connectTimes = 0; while (true) { try { var recode_taobao = http.get("http://api.m.taobao.com/rest/api3.do?api=mtop.common.getTimestamp") if (recode_taobao.statusCode >= 200 && recode_taobao.statusCode < 300) { log("页面获取成功!") var taobaotime = recode_taobao.body.json(); if (taobaotime != null) { break; } } else if (recode_taobaos.statusCode == 404) { log("页面没找到哦..."); } else { log("错误: " + recode_taobao.statusCode + " " + recode_taobao.statusMessage); } } catch (e) { } } // log("你好"+taobaotime.data.t) var timeStamp = taobaotime.data.t.substring(0, 10); // log("timeStamp" + timeStamp); var sign = HexMd5(timeStamp + "" + ApiPassword); var common_params = "center_id=" + DeveloperID + "×tamp=" + timeStamp + "&sign=" + sign; connectTimes = 0; var qlResult = ""; do { connectTimes = connectTimes + 1; qlResult = http .get( qlHostArray[Math.floor(Math.random() * (3 - 0) + 0)] + api + "?" + common_params + "&" + apiParams ) .body.string(); if (connectTimes > 10) { return [false, "权朗回执超时"]; } } while (qlResult.substring(2, 6) != "code"); qlResult = JSON.parse(qlResult); if (qlResult["code"] == "1") { if ( HexMd5(qlResult["timestamp"] + ApiPassword).toUpperCase() == qlResult["sign"].toUpperCase() && Math.abs(timeStamp - qlResult["timestamp"]) < 700 ) { return [true, qlResult["data"]]; } else { return [false, "请检查API密码是否填写正确"]; } } else { return [false, qlResult["msg"]]; } } //--------Helper--------- function IsNotNullOrEmpty(content) { return ( content != null && content != undefined && content != "" && content != " " && content != " " ); } function PutSt(key, value) { // cw(key + " : " + value); if (IsNotNullOrEmpty(value)) { LocalStorage.put(key, value); } else { //cw("key:" + key + "----> value为空,跳过保存"); } } function GetSt(key, defaultValue) { var data = LocalStorage.get(key); // cw(key + " : " + data); if (IsNotNullOrEmpty(data)) { return data; } else { if (defaultValue == undefined) { defaultValue = ""; } //cw(key + " : 返回默认值->>" + defaultValue); return defaultValue; } } //------------------------------------- //-------MD5--------------------- //(autojs 调用java 的MD5方法有bug, 生成出来的是错误的结果.所以用 下面的js md5) function HexMd5(s) { return binl2hex(core_md5(str2binl(s), s.length * chrsz)); } function B64Md5(s) { return binl2str(core_md5(str2binl(s), s.length * chrsz)); } function StrMd5(key, data) { return binl2hex(core_hmac_md5(key, data)); } function HexHmacMd5(key, data) { return binl2hex(core_hmac_md5(key, data)); } function B64HmacMd5(key, data) { return binl2b64(core_hmac_md5(key, data)); } function StrHmacMd5(key, data) { return binl2str(core_hmac_md5(key, data)); } var hexcase = 0; var b64pad = ""; var chrsz = 8; function md5_vm_test() { return hex_md5("abc") == "900150983cd24fb0d6963f7d28e17f72"; } function core_md5(x, len) { x[len >> 5] |= 0x80 << len % 32; x[(((len + 64) >>> 9) << 4) + 14] = len; var a = 1732584193; var b = -271733879; var c = -1732584194; var d = 271733878; for (var i = 0; i < x.length; i += 16) { var olda = a; var oldb = b; var oldc = c; var oldd = d; a = md5_ff(a, b, c, d, x[i + 0], 7, -680876936); d = md5_ff(d, a, b, c, x[i + 1], 12, -389564586); c = md5_ff(c, d, a, b, x[i + 2], 17, 606105819); b = md5_ff(b, c, d, a, x[i + 3], 22, -1044525330); a = md5_ff(a, b, c, d, x[i + 4], 7, -176418897); d = md5_ff(d, a, b, c, x[i + 5], 12, 1200080426); c = md5_ff(c, d, a, b, x[i + 6], 17, -1473231341); b = md5_ff(b, c, d, a, x[i + 7], 22, -45705983); a = md5_ff(a, b, c, d, x[i + 8], 7, 1770035416); d = md5_ff(d, a, b, c, x[i + 9], 12, -1958414417); c = md5_ff(c, d, a, b, x[i + 10], 17, -42063); b = md5_ff(b, c, d, a, x[i + 11], 22, -1990404162); a = md5_ff(a, b, c, d, x[i + 12], 7, 1804603682); d = md5_ff(d, a, b, c, x[i + 13], 12, -40341101); c = md5_ff(c, d, a, b, x[i + 14], 17, -1502002290); b = md5_ff(b, c, d, a, x[i + 15], 22, 1236535329); a = md5_gg(a, b, c, d, x[i + 1], 5, -165796510); d = md5_gg(d, a, b, c, x[i + 6], 9, -1069501632); c = md5_gg(c, d, a, b, x[i + 11], 14, 643717713); b = md5_gg(b, c, d, a, x[i + 0], 20, -373897302); a = md5_gg(a, b, c, d, x[i + 5], 5, -701558691); d = md5_gg(d, a, b, c, x[i + 10], 9, 38016083); c = md5_gg(c, d, a, b, x[i + 15], 14, -660478335); b = md5_gg(b, c, d, a, x[i + 4], 20, -405537848); a = md5_gg(a, b, c, d, x[i + 9], 5, 568446438); d = md5_gg(d, a, b, c, x[i + 14], 9, -1019803690); c = md5_gg(c, d, a, b, x[i + 3], 14, -187363961); b = md5_gg(b, c, d, a, x[i + 8], 20, 1163531501); a = md5_gg(a, b, c, d, x[i + 13], 5, -1444681467); d = md5_gg(d, a, b, c, x[i + 2], 9, -51403784); c = md5_gg(c, d, a, b, x[i + 7], 14, 1735328473); b = md5_gg(b, c, d, a, x[i + 12], 20, -1926607734); a = md5_hh(a, b, c, d, x[i + 5], 4, -378558); d = md5_hh(d, a, b, c, x[i + 8], 11, -2022574463); c = md5_hh(c, d, a, b, x[i + 11], 16, 1839030562); b = md5_hh(b, c, d, a, x[i + 14], 23, -35309556); a = md5_hh(a, b, c, d, x[i + 1], 4, -1530992060); d = md5_hh(d, a, b, c, x[i + 4], 11, 1272893353); c = md5_hh(c, d, a, b, x[i + 7], 16, -155497632); b = md5_hh(b, c, d, a, x[i + 10], 23, -1094730640); a = md5_hh(a, b, c, d, x[i + 13], 4, 681279174); d = md5_hh(d, a, b, c, x[i + 0], 11, -358537222); c = md5_hh(c, d, a, b, x[i + 3], 16, -722521979); b = md5_hh(b, c, d, a, x[i + 6], 23, 76029189); a = md5_hh(a, b, c, d, x[i + 9], 4, -640364487); d = md5_hh(d, a, b, c, x[i + 12], 11, -421815835); c = md5_hh(c, d, a, b, x[i + 15], 16, 530742520); b = md5_hh(b, c, d, a, x[i + 2], 23, -995338651); a = md5_ii(a, b, c, d, x[i + 0], 6, -198630844); d = md5_ii(d, a, b, c, x[i + 7], 10, 1126891415); c = md5_ii(c, d, a, b, x[i + 14], 15, -1416354905); b = md5_ii(b, c, d, a, x[i + 5], 21, -57434055); a = md5_ii(a, b, c, d, x[i + 12], 6, 1700485571); d = md5_ii(d, a, b, c, x[i + 3], 10, -1894986606); c = md5_ii(c, d, a, b, x[i + 10], 15, -1051523); b = md5_ii(b, c, d, a, x[i + 1], 21, -2054922799); a = md5_ii(a, b, c, d, x[i + 8], 6, 1873313359); d = md5_ii(d, a, b, c, x[i + 15], 10, -30611744); c = md5_ii(c, d, a, b, x[i + 6], 15, -1560198380); b = md5_ii(b, c, d, a, x[i + 13], 21, 1309151649); a = md5_ii(a, b, c, d, x[i + 4], 6, -145523070); d = md5_ii(d, a, b, c, x[i + 11], 10, -1120210379); c = md5_ii(c, d, a, b, x[i + 2], 15, 718787259); b = md5_ii(b, c, d, a, x[i + 9], 21, -343485551); a = safe_add(a, olda); b = safe_add(b, oldb); c = safe_add(c, oldc); d = safe_add(d, oldd); } return Array(a, b, c, d); } function md5_cmn(q, a, b, x, s, t) { return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b); } function md5_ff(a, b, c, d, x, s, t) { return md5_cmn((b & c) | (~b & d), a, b, x, s, t); } function md5_gg(a, b, c, d, x, s, t) { return md5_cmn((b & d) | (c & ~d), a, b, x, s, t); } function md5_hh(a, b, c, d, x, s, t) { return md5_cmn(b ^ c ^ d, a, b, x, s, t); } function md5_ii(a, b, c, d, x, s, t) { return md5_cmn(c ^ (b | ~d), a, b, x, s, t); } function core_hmac_md5(key, data) { var bkey = str2binl(key); if (bkey.length > 16) bkey = core_md5(bkey, key.length * chrsz); var ipad = Array(16), opad = Array(16); for (var i = 0; i < 16; i++) { ipad[i] = bkey[i] ^ 0x36363636; opad[i] = bkey[i] ^ 0x5c5c5c5c; } var hash = core_md5(ipad.concat(str2binl(data)), 512 + data.length * chrsz); return core_md5(opad.concat(hash), 512 + 128); } function safe_add(x, y) { var lsw = (x & 0xffff) + (y & 0xffff); var msw = (x >> 16) + (y >> 16) + (lsw >> 16); return (msw << 16) | (lsw & 0xffff); } function bit_rol(num, cnt) { return (num << cnt) | (num >>> (32 - cnt)); } function str2binl(str) { var bin = Array(); var mask = (1 << chrsz) - 1; for (var i = 0; i < str.length * chrsz; i += chrsz) bin[i >> 5] |= (str.charCodeAt(i / chrsz) & mask) << i % 32; return bin; } function binl2str(bin) { var str = ""; var mask = (1 << chrsz) - 1; for (var i = 0; i < bin.length * 32; i += chrsz) str += String.fromCharCode((bin[i >> 5] >>> i % 32) & mask); return str; } function binl2hex(binarray) { var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef"; var str = ""; for (var i = 0; i < binarray.length * 4; i++) { str += hex_tab.charAt((binarray[i >> 2] >> ((i % 4) * 8 + 4)) & 0xf) + hex_tab.charAt((binarray[i >> 2] >> ((i % 4) * 8)) & 0xf); } return str; } function binl2b64(binarray) { var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; var str = ""; for (var i = 0; i < binarray.length * 4; i += 3) { var triplet = (((binarray[i >> 2] >> (8 * (i % 4))) & 0xff) << 16) | (((binarray[(i + 1) >> 2] >> (8 * ((i + 1) % 4))) & 0xff) << 8) | ((binarray[(i + 2) >> 2] >> (8 * ((i + 2) % 4))) & 0xff); for (var j = 0; j < 4; j++) { if (i * 8 + j * 6 > binarray.length * 32) str += b64pad; else str += tab.charAt((triplet >> (6 * (3 - j))) & 0x3f); } } return str; } function 指针位置() { app.startActivity({ action: "android.intent.action.VIEW", //此处可为其他值 packageName: "com.android.settings", className: "com.android.settings.Settings$DevelopmentSettingsActivity" //此处可以加入其他内容,如data、extras }); textContains("开发者").waitFor(); while (!textContains("指针位置").exists()) { sleep(50); if (scrollDown() == false) { while (!textContains("指针位置").exists()) { sleep(50); scrollUp(); sleep(100); } } sleep(100); } var zz = textContains("指针位置").findOne(5000); if (zz) { a = click("指针位置"); toastLog("指针位置切换成功:" + a); sleep(100); back(); } } function 奔放模式() { var 动画缩放, 开关; 内容 = 本地存储.get("奔放模式"); if (内容 == "0.5") { 动画缩放 = "1" 开关 = '关闭'; } else if (内容 == "1") { 动画缩放 = "0.5" 开关 = '开启'; } else { 动画缩放 = "0.5" 开关 = '开启'; } app.startActivity({ action: "android.intent.action.VIEW", //此处可为其他值 packageName: "com.android.settings", className: "com.android.settings.Settings$DevelopmentSettingsActivity" }); textContains("开发者").waitFor(); while (!textContains("窗口动画").exists()) { sleep(50); if (scrollDown() == false) { while (!textContains("窗口动画").exists()) { sleep(50); scrollUp(); sleep(100); } } sleep(100); } var zz = textContains("窗口动画").findOne(5000); if (zz) { a = click("窗口动画"); sleep(500); a = click(动画缩放); sleep(500); a = click("过渡动画"); sleep(500); a = click(动画缩放); sleep(500); a = click("动画程序"); sleep(500); a = click(动画缩放); sleep(500); 本地存储.put("奔放模式", 动画缩放); toastLog("成功" + 开关 + "奔放模式"); back(); } }
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/309480.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号