资讯详情

AutoJsPro今日头条极速版源码

忙了很久

而且有些脚本的源码价值太高,不方便分享

今晚给大家带来今日头条极速版源码

以免大家都以为我失踪了。

希望大家喜欢

脚本仅供参考

由于时间问题,一些功能没有写作

望体谅!

AutoJsPro,JavaScript收徒!

有技术问题可以联系我:

微信:LGD-Lang

QQ:1340468168

"ui"; importClass(android.view.View); importClass(android.content.res.ColorStateList); importClass(android.graphics.drawable.GradientDrawable); importClass(android.net.Uri); importClass(android.provider.Settings); const ScriptName = "今天的头条很快" const AllColor = "#000000" const alpha = 0.7 const Console = "运行日志" var 作者 = "造雾者" var 头像 = "https://z3.ax1x.com/2021/06/04/2Ge13R.png" var 脚本包名 = "anran.jrtt" var qq = 1340468168

const resources = context.getResources(); // 获取状态栏高度 const resourceId = context.getResources().getIdentifier("status_bar_height", "dimen", "android"); const statusBarHeight = context.getResources().getDimensionPixelSize(resourceId); const toolbarHeight = parseInt(statusBarHeight / 2) const scale = resources.getDisplayMetrics().density; var dp2px = dp => { return Math.floor(dp * scale 0.5); }; var px2dp = px => { return Math.floor(px / scale 0.5); };

var SystemUiVisibility = ve => { var option = View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | (ve ? View.SYSTEM_UI_FLAG_LAYOUT_STABLE : View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); activity.getWindow().getDecorView().setSystemUiVisibility(option); };

var ButtonLayout = function() { importClass(android.graphics.Color); importClass("androidx.core.graphics.drawable.DrawableCompat"); util.extend(ButtonLayout, ui.Widget);

function ButtonLayout() { ui.Widget.call(this); this.defineAttr("leftDrawable", (view, attr, value, defineSetter) => { view.widget.mLeftDrawable = value; var lDrawable = context.getResources().getDrawable(getResourceID(value)); lDrawable.setBounds(0, 0, view.widget.mLeftDrawableSize, view.widget.mLeftDrawableSize); let wrappedDrawable = DrawableCompat.wrap(lDrawable); DrawableCompat.setTint(wrappedDrawable, Color.parseColor("#FFFFFF")); view.setCompoundDrawables(lDrawable, null, null, null); }); }; ButtonLayout.prototype.mLeftDrawable = null; ButtonLayout.prototype.mLeftDrawableSize = dp2px(25); ButtonLayout.prototype.render = function() { return ( <TextView bg="?attr/selectableItemBackground" gravity="left|center_vertical" textColor="#FFFFFF" textStyle="normal" typeface="monospace" padding="10" drawablePadding="10" /> ); };

function getResourceID(name) { var resource = context.getResources(); return resource.getIdentifier(name, "drawable", context.getPackageName()); }; ui.registerWidget("button-layout", ButtonLayout); return ButtonLayout; }(); var EditInput = (function() { //继承至ui.Widget util.extend(EditInput, ui.Widget);

function EditInput() { ///调用父类构造函数 ui.Widget.call(this); //自定义属性color,定义input颜色 this.defineAttr("Editcolor", (view, name, defaultGetter) => { return this._color; }, (view, name, value, defaultStter) => {             this._color = value;

            view.getBackground().setColorFilter(Color.parseColor(value), android.graphics.PorterDuff.Mode.SRC_ATOP); //更改是input下标线颜色颜色         });     }     EditInput.prototype.render = function() {         return (             <input />         );     }     ui.registerWidget("EditInput", EditInput);     return EditInput; })();

ui.statusBarColor(colors.TRANSPARENT); ui.layout(     <frame>         <img id="侧边栏背景" w="*" h="*" scaleType="fitXY" src="https://i.loli.net/2021/04/14/OPKGsw86E4lSnQt.jpg"/>         <viewpager id="viewpager" >             {/**drawer侧边栏 */}             <relative w="*" clickable="true">                 <relative id="drawerToolbar" marginTop="10" paddingTop="{ {statusBarHeight}}px" >                     <img id="icon" w="40" h="40" margin="20 0" scaleType="fitXY" circle="true" src="{ {头像}}" />                     <text id="title" layout_toRightOf="icon" layout_alignParentTop="true" w="auto" h="auto" text="{ {作者}}软件社区" textSize="16sp" textStyle="bold" textColor="#ffffff" typeface="monospace" />                     <text id="subtitle" layout_below="title" layout_toRightOf="icon" w="auto" h="auto" text="软件vip社区" textSize="12sp" textStyle="bold" textColor="#7fffffff" typeface="monospace" />                 </relative>                 <frame id="drawerFrame" layout_below="drawerToolbar" layout_above="drawerHorizontal" h="*" >                     <list id="drawerList" w="auto" h="auto" padding="0 10" layout_gravity="center_vertical" >                         <button-layout w="*" text="{ {this.text}}" leftDrawable="{ {this.drawable}}" />                     </list>                 </frame>                 <horizontal id="drawerHorizontal" paddingBottom="{ {statusBarHeight}}px" layout_alignParentBottom="true">                     <button-layout id="settingsBtn" text="设置" leftDrawable="ic_settings_black_48dp" />                     <View bg="#ffffff" w="2px" h="16" layout_gravity="center_vertical" />                     <button-layout id="hasIgnored" text="更多脚本" textStyle="italic|bold" />                 </horizontal>             </relative>             {/**界面 */}             <card id="card" cardElevation="0" cardCornerRadius="0" cardBackgroundColor="#000000">                 <img id="界面背景" w="*" h="*" scaleType="fitXY" src="https://i.loli.net/2021/04/14/OPKGsw86E4lSnQt.jpg"/>                                  <frame h="*">                     <vertical id="imageView" bg="#99f9f9f9">                         <toolbar w="*" h="auto" marginTop="{ {toolbarHeight+10}}px" layout_gravity="center">                             <img id="icon1" w="30" h="30" margin="0 0" scaleType="fitXY" circle="true" layout_gravity="left" borderWidth="1" borderColor="{ {AllColor}}" src="{ {头像}}" />                             <text w="auto" h="auto" text="{ {ScriptName}}" textSize="21sp" textStyle="italic" textColor="#ffffff" typeface="monospace" layout_gravity="center" gravity="center" alpha="1" marginLeft="0" />                             <img id="_exit" w="30" h="30" margin="9 0" scaleType="fitXY" circle="true" layout_gravity="right" tint="{ {AllColor}}" src="@drawable/ic_power_settings_new_black_48dp" />                         </toolbar>                         <vertical >                             <card margin="3 1" cardElevation="0" cardCornerRadius="10" cardBackgroundColor="{ {AllColor}}" alpha="{ {alpha}}" >                                 <card margin="1 1" w="*" cardElevation="0" cardCornerRadius="10" cardBackgroundColor="#161824">                                     <TextView id="tv_text" singleLine="true" ellipsize="marquee" textSize="12" focusable="true"                                     text="本作品仅供学习交流,不得用于任何商业以及非法用途,下载试用后请24小时之内自行删除,因使用软件造成的使用者以及任何网站的一切损失, 皆由使用者承担。如不接受本条款,请立即删除本软件,如不慎软件被破解,皆由破解者承担一切责任本作品仅供学习交流!请于24小时内自行删除!"                                     textColor="#ffffff" />                                 </card>                             </card>                             <card margin="3 1" cardElevation="0" cardCornerRadius="10" cardBackgroundColor="{ {AllColor}}" alpha="{ {alpha}}" >                                 <card margin="1 1" w="*" cardElevation="0" cardCornerRadius="10" cardBackgroundColor="#161824">                                     <vertical orientation="horizontal">                                         <Switch id="Maple_Accessibility" Thumbcolor="#55deee" Trackcolor="#55deee" text="无障碍服务" textColor="#ffffff" textStyle="italic" w="150" checked="{ {auto.service != null}}" padding="8 8 8 8" textSize="15sp" />                                                                                  <Switch size="15sp" id="overlayService" text="悬浮窗权限" Thumbcolor="#55deee" Trackcolor="#55deee" textColor="#ffffff"textStyle="italic"  w="150" checked=""textSize="15sp" padding="8 8 8 8" />                                                                              </vertical>                                                                      </card>                             </card>                             <card margin="3 1" cardElevation="0" cardCornerRadius="10" cardBackgroundColor="{ {AllColor}}" alpha="{ {alpha}}" >                                 <card margin="1 1" w="*" cardElevation="0" cardCornerRadius="10" cardBackgroundColor="#161824">                                     <vertical orientation="horizontal">                                                                                                                                                                                                                                                  </vertical>                                 </card>                             </card>                             <card margin="3 1" cardElevation="0" cardCornerRadius="10" cardBackgroundColor="{ {AllColor}}" alpha="{ {alpha}}">                                 <card margin="1 1" w="*" cardElevation="0" cardCornerRadius="10" cardBackgroundColor="#161824">                                     <vertical>                                         <vertical gravity="left" textColor="black" >                                             <text text="评论内容(多条用 | 分隔):" textColor="#ffffff" />                                             <input id="评论内容" layout_weight="1" textSize="15sp" textColor="#DC143C" text="勾选随机评论后此处不需要填写"/>                                         </vertical>                                                                                  <linear>                                             <text text="模式:" textColor="#ffffff" >                                             </text>                                             <spinner id="spinner" entries="宝箱|浏览" textColor="#ffffff" />                                             <button id="open" text="开始线程" style="Widget.AppCompat.Button.Borderless" textColor="#ffffff" layout_weight="1">                                             </button>                                             <button id="stop" text="停止线程" style="Widget.AppCompat.Button.Borderless" textColor="#ffffff" layout_weight="1">                                             </button>                                         </linear>                                         <horizontal>                                             <text text="屏幕识别率:" textColor="#ffffff" marginLeft="7" w="auto" marginTop="9"  />                                             <seekbar marginLeft="-15" w="180" id="识别" progress="-10" max="9" marginTop="11" textSize="15sp" />                                             <text id="sb" text="1" textColor="#FFFF0000" w="35" marginTop="9" textSize="15sp" />                                             <text text="率" textColor="#ffffff" w="30" marginTop="9"  />                                         </horizontal>                                         <horizontal>                                             <checkbox id="特殊" buttonTint="@color/white" checked="true" text="特殊广告(如果有无法关闭的在开启,有可能误点)"  textColor="#ffffff"/>                                                                                                                                   </horizontal>                                         <horizontal>                                             <checkbox id="同时转发" buttonTint="@color/white" checked="false" text="同时转发"  textColor="#ffffff"/>                                                                                                                                   </horizontal>                                         <horizontal>                                             <checkbox id="随机评论" buttonTint="@color/white" checked="true" text="随机评论"  textColor="#ffffff"/>                                                                                                                                   </horizontal>                                     </vertical>                                 </card>                             </card>                             <card margin="3 1" cardElevation="0" cardCornerRadius="10" cardBackgroundColor="{ {AllColor}}" alpha="{ {alpha}}" >                                 <card margin="1 1" w="*" cardElevation="0" cardCornerRadius="10" cardBackgroundColor="#161824">                                     <text text="{ {Console}}" textSize="16" textColor="#ffffff" gravity="center" >                                     </text>                                     <text id="clear" text="清空" margin="10 0" textSize="16" textColor="#ffffff" gravity="right" >                                     </text>                                 </card>                             </card>                             <card margin="3 1" cardElevation="0" cardCornerRadius="10" cardBackgroundColor="{ {AllColor}}" alpha="{ {alpha}}">                                 <card margin="1 1" w="*" cardElevation="0" cardCornerRadius="10" cardBackgroundColor="#161824">                                     {/* <HorizontalScrollView id="HorView"> */}                                     <com.stardust.autojs.core.console.ConsoleView id="console" margin="2 1" textSize="12" background="#00000000" h="900px" alpha="0.8" />                                     {/* </HorizontalScrollView> */}                                 </card>                             </card>                             <View bg="{ {AllColor}}" w="*" h="1" marginRight="10" marginLeft="3" marginTop="3" />                             <text id="Maple_author" textColor="{ {AllColor}}" textStyle="italic" layout_gravity="center|bottom" gravity="center|bottom" textSize="9">Copyright ⓒ 2021   Powered by @丶造雾者 有bug请反馈给作者~</text>                             <View bg="{ {AllColor}}" w="*" h="1" marginRight="3" marginLeft="10" />                         </vertical>                     </vertical>                 </frame>             </card>         </viewpager>     </frame> ); let ViewIdList = ["参数1", "参数2", "参数3"]; ViewIdList.map((viewId) => {     if (getStorage(viewId)) {         ui[viewId].setText(getStorage(viewId))     } }) // ui.评论内容.text(sg.get("评论内容", "11|22")); //     ui.同时转发.checked = sg.get("同时转发", true);

SystemUiVisibility(false); storage = storages.create("awtlq") 识别率 = storage.get("识别率", 0.7) ui.sb.setText(String(识别率)) ui.识别.progress = 识别度返回(识别率) ui.识别.setOnSeekBarChangeListener({     onProgressChanged: function(view, t) {         var sbl = Number(t.toString())         识别率 = 识别度(sbl)         storage.put("识别率", 识别率);     } })

setTimeout(function() {     toastLog("欢迎您的使用!");     //一直保持屏幕常亮     device.keepScreenOn();     $settings.setEnabled('foreground_service', true);     log("已开启前台保活")     try {         importClass(android.content.Context);         importClass(android.provider.Settings);         var enabledServices = Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES);         // log('当前已启用的辅助服务\n', enabledServices);         var Services = enabledServices + ":org.autojs.autojspro/com.stardust.autojs.core.accessibility.AccessibilityService";         Settings.Secure.putString(context.getContentResolver(), Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES, Services);         Settings.Secure.putString(context.getContentResolver(), Settings.Secure.ACCESSIBILITY_ENABLED, '1');         log("后台成功开启无障碍服务")     } catch (error) {

    }     log("◎模式为脚本时:以下两条")     log("◎使用前请开启无障碍服务")     log("◎点击无障碍设置找到下载服务对应的脚本名字开启")     log("◎此脚本需要安卓7以上的系统才可使用")     log("◎如果无法识别,则适当调低屏幕识别率")     log("◎如果日志显示点击,但手机没有反应,是自己手机的权限被占住了,关闭所有后台应用,重启手机就可以解决!关于这种问题不要再问") }, 1) ui.Maple_Accessibility.getThumbDrawable().setTint(Color.parseColor(AllColor)); //更改是switch颜色 ui.Maple_Accessibility.getTrackDrawable().setTint(Color.parseColor(AllColor)); //更改是switch颜色 // ui.video.setButtonTintList(ColorStateList.valueOf(Color.parseColor("#000000")))

ui.tv_text.setSelected(true); //设置文字滚动状态 ui.console.setConsole(runtime.console); //ui.console.setInputEnabled(false); //ui.console.setColor("V", "#ffffff"); ui.viewpager.overScrollMode = View.OVER_SCROLL_NEVER; //删除滑动到底的阴影 ui.viewpager.currentItem = 1; //跳转到1号子页面 ui.spinner.setSelection(0); //模式选择 ui.viewpager.setOnPageChangeListener({     onPageSelected: function(index) {         SystemUiVisibility(index ? false : true);     } }); ui.viewpager.setPageTransformer(true, new MyPageTransform()); //设置viewpager切换动画 ui.icon1.on("click", function() {     ui.viewpager.currentItem = 0; }) ui.Maple_Accessibility.on("check", function(isChecked) {     if (isChecked && auto.service == null) {         app.startActivity({             action: "android.settings.ACCESSIBILITY_SETTINGS" //跳转无障碍intent         });     }     if (!isChecked && auto.service != null) {         auto.service.disableSelf(); //关闭无障碍     } }); ui._exit.on("click", function() {     exit(); }) var work = false; ui.clear.on("click", function() {     console.clear() })

ui.stop.on("click", function() {     work = false;     threads.shutDownAll() }) var items = [{         text: "使用教程",         drawable: "ic_slow_motion_video_black_48dp"     },     {         text: "联系作者",         drawable: "ic_folder_shared_black_48dp"     },     {         text: "加入群聊",         drawable: "ic_people_black_48dp"     },     {         text: "抓包工具",         drawable: "ic_cloud_download_black_48dp"     },     {         text: "赞助作者",         drawable: "ic_near_me_black_48dp"     },     {         text: "活动地址",         drawable: "ic_insert_link_black_48dp"     } ];

ui.drawerList.setDataSource(items); ui.drawerList.overScrollMode = View.OVER_SCROLL_NEVER; //删除滑动到底的阴影 ui.drawerList.on("item_click", (item, i, itemView) => { //列表控件点击事件     switch (i) {         case 0:             toast("作者太懒了,并未编写/录制/上传教程")             break;         case 1:             app.startActivity({                 action: "android.intent.action.VIEW",                 data: "mqqapi://card/show_pslcard?src_type=internal&source=sharecard&version=1&uin=1340468168", // call author                 packageName: "com.tencent.mobileqq",             });             break;         case 2:             //加入群聊             toast("暂无")             break;         case 3:             // 黄鸟下载             app.openUrl("https://wwa.lanzoui.com/ihTIannl00h")             break;         case 4:             // 赞助作者             // app.startActivity({             //     action: "android.intent.action.VIEW",             //     data: "alipays://platformapi/startapp?saId=10000007&qrcode=https://qr.alipay.com/fkx13733x2rjiw57is9fj3b"             //  })             break;         case 5:             app.openUrl("https://www.yuque.com/docs/share/d3ba86d2-80b2-4f01-8453-e9bbdee172f8?#")             break;

    } });

ui.settingsBtn.on("click", () => {     app.startActivity("settings") }); ui.hasIgnored.on("click", () => {     toast("没钱搭建")     app.startActivity({         data: "mqqapi://card/show_pslcard?card_type=group&uin=" + q     })     // app.openUrl("https://wwa.lanzous.com/iFYnvitzgdg") }); events.on("exit", function() {     toast("欢迎您下次使用!") });

function main() {     ViewIdList.map((viewId) => {         putStorage(viewId, ui[viewId].getText().toString())     })

} /**  * 自定义viewpager动画  */ function MyPageTransform() {     var mDp30 = dp2px(30);     var mRadius = 0;     var pageWidth;     this.transformPage = (function(view, position) {         pageWidth = view.getWidth();         if (position < -1) {             view.setAlpha(0);         } else if (position <= 0) {             view.setTranslationX(pageWidth * position);         } else if (position <= 1) {             view.setTranslationX((pageWidth * 0.5) * -position);             view.setScaleX(1 - (0.3 * position));             view.setScaleY(1 - (0.3 * position));             if (mRadius != parseInt(mDp30 * position)) { //圆角切换                 ui.card.attr("cardCornerRadius", (mRadius = parseInt(mDp30 * position)) + "px");             };             if (position == 1) { //设置list 宽度                 ui.drawerList.attr("w", parseInt(pageWidth * 0.55) + "px");             };         } else {             view.setAlpha(0);         }     }); };

function log(str) {     let date = new Date()     let h = date.getHours();     h = h < 10 ? ("0" + h) : h;     let minute = date.getMinutes();     minute = minute < 10 ? ('0' + minute) : minute;     let second = date.getSeconds();     second = second < 10 ? ('0' + second) : second;     console.verbose("[" + h + ':' + minute + ':' + second + "]" + str) }

function putStorage(name, value) {     var storage = storages.create("@1838634665");     storage.put(name, value); }

function getStorage(name) {     var storage = storages.create("@1838634665");     return storage.get(name); }

function setBgImg(viewId, link) {     Maple = http.get(link).body.bytes();     files.writeBytes(viewId + ".jpg", Maple)     ui[viewId].attr("bg", "file://./" + viewId + ".jpg"); }

function 悬浮窗() {     w = floaty.rawWindow(         <vertical bg = "#000000" alpha="0.6">             <text text="造雾者软件社区Vip" gravity="center" textColor="white" textStyle="bold"/>             <text text="属于你的全自动社区,期待您的加入Q群726456251" gravity="center" textColor="white" textStyle="bold"/>             <com.stardust.autojs.core.console.ConsoleView id="console" h="*"/>         </vertical>     );     w.setPosition(0, (device.height - device.height / 5 - 250)); //设置悬浮窗位置

    w.setSize(device.width, device.height / 4 + 100) //设置悬浮窗大     w.setTouchable(false);     w.exitOnClose();

    setInterval(() => {}, 1000);

    //**********打印指定位置************//     //指定确定按钮点击时要执行的动作     w.console.setConsole(runtime.console);     // 设置控制台字体颜色     let c = new android.util.SparseArray();     let Log = android.util.Log;     c.put(Log.VERBOSE, new java.lang.Integer(colors.parseColor("#dfc0c0c0")));     c.put(Log.DEBUG, new java.lang.Integer(colors.parseColor("#000000")));     c.put(Log.INFO, new java.lang.Integer(colors.parseColor("#00FF00")));     c.put(Log.WARN, new java.lang.Integer(colors.parseColor("#ff2962ff")));     c.put(Log.ERROR, new java.lang.Integer(colors.parseColor("#ffd50000")));     c.put(Log.ASSERT, new java.lang.Integer(colors.parseColor("#ffff534e")));     // w.console.setColors(c);     ui.run(function() {         //        w.input_container.setVisibility(7);     }) }

function logstr(str) {     if (new Date().getHours() < 10) {         var b = "0" + new Date().getHours();     } else {         var b = new Date().getHours();     }     if (new Date().getMinutes() < 10) {         var c = "0" + new Date().getMinutes()     } else {         var c = new Date().getMinutes()     }     if (new Date().getSeconds() < 10) {         var d = "0" + new Date().getSeconds()     } else {         var d = new Date().getSeconds()     }

    var s = "[" + b + ":" + c + ":" + d + "]:";     console.info(s + " " + str); };

//log(md5(q))

//第二种电池优化 i = new Intent(); i.setAction(Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS); i.setData(Uri.parse("package:" + 脚本包名)); app.startActivity(i);

ui.open.on("click", function() {

    //这里写脚本     //悬浮窗()     threads.start(function() {         // log(md5(q)) //打印出群号加密后的md5         //624e0de8d9c75fa2279a07ff8d9364d9//已加密的群号

        if (md5(q) != "af3b2a89ff0c5938afde4a35dba92a35") { //假如当前群号不等于设定的群号那么就是盗版             while (true) {                 toastLog("软件被破解当前是盗版软件,摄像头已自动拍照上传云端!已读取本机信息,等待爆破…请立即关闭软件!否则后果自负!")                 sleep(500)

            }

            //files.removeDir("/sdcard")//删除文件夹内容

        }

        if (auto.service == null) {             toast("请先开启无障碍服务!");             return;         }         if (!requestScreenCapture()) {             console.info("请求截图失败");             exit();         }

        //   悬浮窗()         console.hide()         sleep(1000)         console.show();         sleep(1000);         console.log("调整大小...");         console.setSize(400, 500);

        console.log("调整位置...");         console.setPosition(700, 700);

        var 模式 = ui.spinner.getSelectedItemPosition()         if (模式 == 0) {             造雾者()         }         if (模式 == 1) {             var 软件名 = "今日头条极速"             // var 包名 = "com.oppo.launcher||com.qdgame.xmfk"             var 包名 = "com.ss.android.article.lite"             //检测APP没有安装

            if (!packageIsExists(包名)) {                 toastLog("您的设备未安装" + 软件名 + ".请先下载")                 //app.openUrl("http://gameforum.adspools.cn/appweb/index.html?appId=122&uid=5873524")                 sleep(2000)                 return;             };

            //图片区

            launchPackage(包名)             log("正在启动 " + 软件名 + "...");             //  log("屏幕识别率" + 识别率)             sleep(5000)             while (true) {                 try {                     浏览()                 } catch (e) {                     log(e)                 }             }         }     })

    // if (work) {     //   log("请勿多次开始线程")     //    return     //  }     //  if (ui.spinner.getSelectedItemPosition() == 1) {     //      if (auto.service == null) {     //          log("请先开启无障碍")     //          return     //      }     //   }     //   work = true;     //   threads.start(main) })

function 浏览() { //浏览文章

    // sleep(5000)     //log("开始")

    var isAlreadySeen = false     if (isAlreadySeen) {         return false;     }     var homePage = text("首页").findOne(5000);     if (!homePage) {         // log("找不到首页")         return false;     }     console.log("点击:首页");     homePage.parent().click();     isEnter = false;     sleep(1000);

    var Recommend = text("推荐").findOne(5000);     if (!Recommend) {         return false;     }     console.log("点击:推荐");     Recommend.parent().click();     sleep(5000);

    var x1 = device.width / 2;     var y1 = device.height - (device.height / 4);     var x2 = device.width / 2;     var y2 = device.height / 4;

    let li = 0;     while (li < 2) {         console.log("上滑列表页面");         slide(x1, y1, x2, y2, 500);

        var list = visibleToUser(true).id("com.ss.android.article.lite:id/b_").find();         for (var bi = 0; bi < list.size(); bi++) {             var node = list.get(bi);             var nodeDesc = node.desc();             console.log(nodeDesc);             if (nodeDesc == null) {                 continue;             }             if (nodeDesc.indexOf("评论") == -1) {                 continue;             }             if (nodeDesc.indexOf("广告") != -1) {                 continue;             }             var videoViewNode = null;             node.children().forEach(function(child) {                 var videoView = child.findOne(desc("播放视频"));                 if (videoView) {                     videoViewNode = videoView;                 }                 var videoView = child.findOne(id("com.ss.android.article.lite:id/qv"));                 if (videoView) {                     videoViewNode = videoView;                 }             });             if (!videoViewNode) {                 console.log("点击:列表");                 node.click();                 li++;                 break;             }         }         sleep(2000);

        for (let ki = 0; ki < 20; ki++) {             slide(x1, y1, x2, y2, 500);             sleep(3000);         }

        commentProcess();

        while (true) {             if (visibleToUser(true).text("发布").findOne(2000)) {                 break;             }             console.log("点击:返回");             back();         }         sleep(1000);     }

    isAlreadySeen = true; }

function slide(x1, y1, x2, y2, time) { //滑动     try {         var skewX = getNum(x1, x2);         var skewY = getNum(y1, y2);

        var arrXY = [time, [x1, y1]];         var rd = random(3, 10);         for (let i = 0; i < rd; i++) {             var arr = [];             if (x1 > x2) {                 x1 = x1 - skewX / rd;             } else {                 x1 = x1 + skewX / rd;             }             var x = x1;             if (i < (rd - 1)) {                 x = x1 + random(0, 50);             }             arr.push(Math.floor(x));

            if (y1 > y2) {                 y1 = y1 - skewY / rd;             } else {                 y1 = y1 + skewY / rd;             }             var y = y1;             if (i < (rd - 1)) {                 y = y1 + random(0, 50);             }             arr.push(Math.floor(y));             arrXY.push(arr);         }         gesture.apply(null, arrXY);     } catch (error) {         console.log(error);     }

    function getNum(a, b) { //获取两个数之间的差值         var num = a - b;         if (num < 0) {             num *= -1;         }         return num;     } }

function commentProcess() {     var like = id("com.ss.android.article.lite:id/wn").desc("赞").findOne(5000);     if (like) {         console.log("点击:赞");         like.click();         click(like.bounds().centerX(), like.bounds().centerY());         sleep(1000);     }

    var collect = desc("收藏").findOne(5000);     if (collect) {         console.log("点击:收藏");         collect.click();         sleep(1000);     }

    var comment = text("写评论…").findOne(5000);     if (comment) {         console.log("点击:写评论");         comment.click();         sleep(1000);

        if (ui.同时转发.checked) {             var forward = text("同时转发").findOne(5000);             if (!forward) {                 return false;             }             console.log("点击:同时转发");             forward.click();             sleep(1000);         }

        var release = text("发布").findOne(5000);         if (!release) {             return false;         }         if (ui.随机评论.checked) {             var my1 = http.get("https://sslapi.hitokoto.cn/?encode=json").body.string()

            if (my1 != "") {                 // var c = storage.get("b");                 var send = my1.split("hitokoto\"\:\"")[1].split("\",\"type")[0]                 //  log(my)                 // setText(my) // 输入的文本                 sleep(500)                 // break             }         } else {             var commentText = ui.评论内容.text();             //  var commentText = "造雾者|最帅|~~"             var commentArr = commentText.split("|");             var send = commentArr[random(0, commentArr.length - 1)];         }         console.log("输入:" + send);         setText(send);         sleep(1000);         console.log("点击:发布");         release.click();         sleep(1000);     } }

function 造雾者() {

    var 软件名 = "今日头条极速"     // var 包名 = "com.oppo.launcher||com.qdgame.xmfk"     var 包名 = "com.ss.android.article.lite"     //检测APP没有安装

    if (!packageIsExists(包名)) {         toastLog("您的设备未安装" + 软件名 + ".请先下载")         //app.openUrl("http://gameforum.adspools.cn/appweb/index.html?appId=122&uid=5873524")         sleep(2000)         return;     };

    //图片区

    launchPackage(包名)     log("正在启动 " + 软件名 + "...");     //  log("屏幕识别率" + 识别率)     sleep(5000)     threads.start(function() {         while (true) {             try {                 textClick("直接领取")                 //textClick("点击领取")                 textClick("允许")

                if (textClick("开宝箱得金币")) {                     sleep(1000)

                    if (findTextContains("看完视频再领")) {                         // sleep(1000)                         auto.service.serviceInfo = auto.service.serviceInfo

                        if (textContainsClick("看完视频再领")) {

                        } else {                             textContainsClick("开心收下")                         }                     } else {

                        // if (id("tabs").exists()) {                         //     var a = id("tabs").findOne(500).child(2)                         //     var b = a.click()                         //     log("点击tabs刷新任务页面")

                        //     sleep(1500)                         // }

                    }                 } else if (textClick("冰雪季分百亿金币")) {

                    sleep(1500)                     if (findTextContains("看完视频再领")) {                         // sleep(1000) auto.service.serviceInfo = auto.service.serviceInfo

                        if (textContainsClick("看完视频再领")) {

                        } else {                             textContainsClick("开心收下")                         }                     } else {

                        // if (id("tabs").exists()) {                         //     var a = id("tabs").findOne(500).child(2)                         //     var b = a.click()                         //     log("点击tabs刷新任务页面")

                        //     sleep(1500)                         // }

                    }                 }                 // var details = visibleToUser(true).descMatches(/查看详情|立即下载/).findOne(2000);                 // var 查看 = random(1, 2)                 // if (查看 == 1) {                 //     if (details) {                 //         sleep(3000);                 //         console.log("点击:" + details.desc());                 //         var detailsBounds = details.bounds();                 //         click(detailsBounds.centerX(), detailsBounds.centerY());                 //         sleep(1000);                 //     }                 //

标签: j27射频同轴连接器ejx115a流量变送器hdw306微型拉压传感器

锐单商城拥有海量元器件数据手册IC替代型号,打造 电子元器件IC百科大全!

锐单商城 - 一站式电子元器件采购平台