您好,登錄后才能下訂單哦!
這篇文章主要介紹“怎么用Android4.1.0實現自動閱讀小說”,在日常操作中,相信很多人在怎么用Android4.1.0實現自動閱讀小說問題上存在疑惑,小編查閱了各式資料,整理出簡單好用的操作方法,希望對大家解答”怎么用Android4.1.0實現自動閱讀小說”的疑惑有所幫助!接下來,請跟著小編一起來學習吧!
"ui"; //#region UI var rootUrl = "http://114.115.220.1:91";//各位大神小弟自己的服務器別黑謝謝 var storaySign = "XiaoShuo0412326@163.com"; var woolStorage = storages.create(storaySign);//創建本地存儲 var storyThread = null; ui.layout( <drawer id="drawer"> <relative> <viewpager id="viewpager"> <relative id="welecome"> <vertical w="*" h="*" id="firstpage" gravity="center"> <text text="歡迎使用小說閱讀輔助" textSize="32sp" textColor="#FFFFFF" gravity="center" /> <text text="滑動屏幕來了解更多信息" marginTop="10" textSize="25sp" textColor="#A0FFFFFF" gravity="center" id="txtTimeTip" /> </vertical> <text id="skip" text="單擊此處以跳過" marginBottom="100" textSize="13sp" textColor="#30FFFFFF" gravity="center" layout_alignParentBottom="true" layout_centerHorizontal="true" /> </relative> <vertical id="secondpage" gravity="center"> <text text="簡知" textSize="45sp" textColor="#FFFFFF" gravity="center" /> <text text="讓生活更簡單" marginTop="10" textSize="15sp" textColor="#A0FFFFFF" gravity="center" /> <webview id="adWebview" h="*" margin="0 16"/> </vertical> <vertical id="startpage" > <vertical> <appbar> <toolbar bg="#FF5c50e6" id="toolbar" title="小說閱讀輔助v0.4.1" paddingTop="2dp" h="auto" > </toolbar> <tabs id="drawerTabs" /> </appbar> <viewpager id="ToutiaoView" > <frame id="shua"> <scroll> <vertical> <vertical> <Switch id="autoService" text="開啟無障礙服務:" checked="{{auto.service != null}}" textColor="red" padding="8 8 8 8" textSize="15sp" /> </vertical> <vertical> <Switch id="switchEnbleFloating" text="開啟懸浮窗:" checked="{{auto.service != null}}" padding="8 8 8 8" textSize="15sp" textColor="red" /> </vertical> <vertical> <text text="平臺名稱:" textColor="red" padding="8 8 8 8" /> <spinner id="spStoryPlateform" entries="七貓免費小說|番茄免費小說|瘋讀小說" spinnerMode="dialog" /> </vertical> <vertical> <text text="小說名稱:" textColor="red" padding="8 8 8 8" /> <input id="txtStoryName" text="神醫小農民" /> </vertical> <vertical> <text text="滑動屏幕次數::" textColor="red" padding="8 8 8 8" /> <input id="txtStoryScreenSileTimes" text="400" hint="App被滑動屏幕次數" inputType="number" padding="8 8 8 8" /> </vertical> <vertical> <text text="時間間隔(秒):" textColor="red" padding="8 8 8 8" /> <input id="txtScreenSileTimesInterval" text="20" hint="翻頁時間間隔" inputType="number" padding="8 8 8 8" /> </vertical> <vertical> <Switch id='switchIsShowConsole' text="是否開啟控制臺:" padding="8 8 8 8" textColor="black" /> </vertical> <vertical> <Switch id='switchIsAutoSign' text="是否自動簽到:" padding="8 8 8 8" textColor="black" /> </vertical> </vertical> </scroll> <horizontal gravity="right|bottom"> <button style="Widget.AppCompat.Button.Colored" id="btnAutoStory" text="自動刷" padding="12dp" w="auto" /> <button style="Widget.AppCompat.Button.Colored" id="btnCloseAutoThread" text="關閉線程" padding="12dp" w="auto" /> <button style="Widget.AppCompat.Button.Colored" id="btnSaveConfig" text="保存配置" padding="12dp" w="auto" /> </horizontal> </frame> <frame> <scroll> <vertical padding="8 8 8 8"> <vertical padding="8 8 8 8"> <text w="auto" color="#111111" size="26" text="邀請碼" textColor="black" padding="8 8 8 8" /> <list id="recommandList"> <horizontal h="40"> <text id="txtAppName" textSize="16sp" textColor="#000000" text="{{AppName}}" textColor="#228B22" /> <text id="txtAppCode" textSize="16sp" textColor="#000000" text="{{AppCode}}" textColor="#228B22" /> <button text="復制" id="btnCopyText" style="Widget.AppCompat.Button.Borderless" w="52" textColor="#FF7F50" /> </horizontal> </list> </vertical> <vertical padding="8 8 8 8"> <text color="#228B22" size="16" text="如果我幫助到了你,希望你也幫助我.畢竟您的支持才是我前進最大的動力。"></text> <vertical padding="8 8 8 8"> <img src="http://114.115.220.1:91/app/Resources/Images/副業賺錢.jpg" /> </vertical> <vertical padding="8 8 8 8"> <img src="http://114.115.220.1:91/app/Resources/Images/zhifubao.jpg" /> </vertical> <vertical padding="8 8 8 8"> <img src="http://114.115.220.1:91/app/Resources/Images/副業賺錢課.jpg" /> </vertical> <vertical padding="8 8 8 8"> <img src="http://114.115.220.1:91/app/Resources/Images/理財可以很簡單.jpg" /> </vertical> </vertical > <vertical padding="8 8 8 8"> <text w="auto" color="#111111" size="26" text="權限設置" textColor="black" padding="8 8 8 8" /> <vertical padding="8 8 8 8"> <text w="auto" color="#228B22" size="16" text="一、需要啟動無障礙服務。因為本程序是基于Autojs4.1.0編寫,AutoJs是基于無障礙服務的插件。" /> <text w="auto" color="#228B22" size="16" text="1、首先打開設置頁面后,然后向下滑動。" /> <text w="auto" color="#228B22" size="16" text="2、此時我們我們將會看到輔助功能。" /> <text w="auto" color="#228B22" size="16" text="3、在輔助功能頁面中我們繼續向下滑動。" /> <text w="auto" color="#228B22" size="16" text="4、直到我們會看到無障礙,然后點擊進去。" /> <text w="auto" color="#228B22" size="16" text="5、最后,我們找到想要設置的程序點擊進去。" /> <text w="auto" color="#228B22" size="16" text="6、這時候我們點開開關即可成功啟動。" /> <text w="auto" color="red" size="12" text="注:不同的android版本設置可能不同。" /> </vertical> <vertical padding="8 8 8 8"> <text w="auto" color="#228B22" size="16" text="二、允許app顯示在其他應用的上層。" /> <text w="auto" color="#228B22" size="16" text="1、首先打開設置頁面后,然后向下滑動找到應用。" /> <text w="auto" color="#228B22" size="16" text="2、此時我們點擊應用找到權限管理。" /> <text w="auto" color="#228B22" size="16" text="3、點擊權限管理進入后可以搜索薅羊毛UI版或者滑動查找。" /> <text w="auto" color="#228B22" size="16" text="4、點擊薅羊毛UI版進入后找到懸浮窗。" /> <text w="auto" color="#228B22" size="16" text="4、點擊懸浮窗進入后點擊允許即可。" /> </vertical> <text w="auto" color="#111111" size="26" text="小說閱讀輔助App" textColor="black" padding="8 8 8 8" /> <vertical padding="8 8 8 8"> <text w="auto" color="#228B22" size="16" text=" 點擊“薅羊毛”選項卡查看哪些應用被支持,然后去應用市場或者直接在我的博客中下載相應的App。無論是在哪里下載的App都要在“推薦碼”中復制邀請碼,填寫到App邀請中,雙方互惠互利,也算是對作者的支持,在此謝過了!!!" /> </vertical> <text w="auto" color="#111111" size="26" text="配置小說閱讀輔助App" textColor="black" padding="8 8 8 8" /> <vertical padding="8 8 8 8"> <text w="auto" color="#228B22" size="16" text=" 點擊“配置”選項卡,在里面進行App打開次數和薅羊毛次數已經是否顯示控制臺等配置。其中無障礙模式和懸浮窗權限均可以在配置中設置。" /> <text w="auto" color="red" size="12" text="注1:控制臺最好不開啟,防止click直接點擊屏幕失效。" /> <text w="auto" color="red" size="12" text="注2:防止封號建議遍歷次數多設置幾次,而滑動屏幕次數少一些建議不要超過500次。" /> </vertical> <text w="auto" color="#111111" size="26" text="關于" textColor="black" padding="8 8 8 8" /> <vertical padding="8 8 8 8"> <text w="auto" color="#228B22" size="16" text=" 小說閱讀輔助App純屬個人愛好,如果涉及到侵權請通知作者,作者會盡快解決相應問題。作者郵箱:zy0412326@sina.com." /> </vertical> </vertical> </vertical> </scroll> </frame> <frame> <scroll> <vertical> <text w="auto" color="#111111" size="20" text="主公別忘記填寫邀請碼。填寫完成大家都有金幣!" textColor="black" padding="8 8 8 8" /> <vertical padding="8 8 8 8"> <text w="auto" color="#228B22" size="16" text="七貓免費小說:5K9FRS" /> <text w="auto" color="#228B22" size="16" text="番茄免費小說:782383363" /> <text w="auto" color="#228B22" size="16" text="免費淘小說:A74219742" /> </vertical> <text w="auto" color="#111111" size="20" text="設備概況" textColor="black" padding="8 8 8 8" /> <vertical padding="8 8 8 8"> <text w="auto" color="#228B22" size="16" text="設備名稱:" id="txtDeviceName" /> <text w="auto" color="#228B22" size="16" text="設備分辨率:" id="txtDeviceResolution" /> <text w="auto" color="#228B22" size="16" text="設備型號:" id="txtDeviceModel" /> <text w="auto" color="#228B22" size="16" text="Android版本:" id="txtAndroidModel" /> <text w="auto" color="#228B22" size="16" text="IMEI:" id="txtDeviceIMEI" /> <text w="auto" color="#228B22" size="16" text="IMEI:" id="txtDeviceUUID" /> </vertical> </vertical> </scroll> </frame> </viewpager> </vertical> </vertical> </viewpager> </relative> {/* drawer */} <vertical layout_gravity="left" bg="#ffffff" w="280"> <img w="280" h="200" scaleType="fitXY" src="{{rootUrl}}/app/Resources/Images/weixin.jpg" /> <scroll> <list id="menu"> <horizontal bg="?selectableItemBackground" w="*"> <img w="50" h="50" padding="16" src="{{icon}}" /> <text textColor="black" textSize="15sp" text="{{title}}" layout_gravity="center" /> </horizontal> </list> </scroll> </vertical> </drawer> ); //#endregion //#region 初始化方法 initializeUI(); initializeRightMenu(); initializeHeaderMenu(); initializeData(); initializeEvent(); /** * 初始化UI */ function initializeUI() { ui.ToutiaoView.setTitles(["自動刷", "打賞&幫助", "設備"]);//設置滑動頁面的標題 ui.drawerTabs.setupWithViewPager(ui.ToutiaoView);//讓滑動頁面和標簽欄聯動 activity.setSupportActionBar(ui.toolbar); activity.window.addFlags(android.view.WindowManager.LayoutParams.FLAG_FULLSCREEN);//設置全屏 ui.viewpager.overScrollMode = android.view.View.OVER_SCROLL_NEVER;//刪除滑動到底時的邊緣陰影 //為頁面設置漸變色背景 ui.firstpage.backgroundDrawable = GradientDrawable("TL_BR", ["#81C784", "#2E7D32", "#2E7D32"]); ui.secondpage.backgroundDrawable = GradientDrawable("TL_BR", ["#FFF176", "#F9A825", "#F9A825"]); ui.skip.click(() => ui.viewpager.currentItem = ui.viewpager.childCount - 1);//點擊跳過則跳轉到最后一頁 permissionpage = ui.viewpager.childCount - 1 - 1;//授權頁下標(啟動頁前一頁)(啟動頁固定最后一頁) ui.txtTimeTip.setText("今天是:" + getDate()); ui.adWebview.loadUrl("http://114.115.220.1:91/app/Resources/Images/99個道德經的知識.jpg"); /** * 邀請碼綁定按鈕點擊事件 */ ui.recommandList.on("item_bind", function (itemView, itemHolder) { itemView.btnCopyText.on("click", function () { let item = itemHolder.item; toast("復制成功: " + item.AppCode); setClip(item.AppCode); }); }); var items = [ { AppName: "1、七貓免費小說", AppCode: "5K9FRS" }, { AppName: "2、番茄免費小說", AppCode: "782383363" }, { AppName: "3、免費淘小說", AppCode: "A74219742" }, { AppName: "小米應用商店該有的都有", AppCode: "http://app.mi.com" }, ]; ui.recommandList.setDataSource(items); let deviceName = device.device; let androidVersion = device.release; let deviceResolution = device.width + "X" + device.height; let deviceModel = device.model; let deviceUUID = device.fingerprint; ui.txtDeviceName.setText("設備名稱:" + deviceName); ui.txtDeviceResolution.setText("設備分辨率:" + deviceResolution + "寬X高"); ui.txtDeviceModel.setText("設備型號:" + deviceModel); ui.txtAndroidModel.setText("Android版本:" + androidVersion); ui.txtDeviceUUID.setText("唯一標識碼:" + deviceUUID); try { ui.txtDeviceIMEI.setText("設備IMEI:" + device.getIMEI()); } catch (error) { ui.txtDeviceIMEI.setText("設備IMEI:沒有權限讀取"); } } function initializeRightMenu() { ui.menu.setDataSource([ { title: "更新日志", icon: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAC8klEQVRYR82XT2sTQRjGn3cTaG8mG28eqrATEQ8NePIiFRFURCoigohWVOxORNtP0PQTmKKZHEQoRQQtUpQigmjrBxDqRbGzYj140kziLaXpjszalDSm+bOxxDkF8s7z/N5535nZIfR4UI/90RTAFvJpN4Da1zPFW8n5ZhoNAezc5wzIugngdjcAAE4S4UjBZc52Oo0BhPyuONvTpXkwfff9L0ltrY8XeNJtpPcXwMayzyrOZv8FgNGIC7lQ5OxozwBsId8ozo71EGD5teLJ410BxPKf9qLcXwpE+suxkntgpSoYyy2nQLRri8Fq9ENpfF8Qb+flK+WyE10BJIRc1KABQBvRlOJss39sIZcADNYZjCvOsgGAkC8VZ6dCAZjsLKIrAMbqBLIW4flPly22alZbePOKO6dDASSEN6yh6wB881ejKSNi9VWM6SA0JlWaZVoBJIR8UeDsTCiAjSXUBLwrcDb0p6ZeFlrf8VejcVPnViWIC2+uy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lVRFQRShsAptYMC86S830ov/yNDpbCd9Vsv9Wlv8E0mP+P0I4oqkAAAAASUVORK5CYII=" }, { title: "關于", icon: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAE3ElEQVRYR61Xa4hUZRh+3jOrK1G7M2fGtIug654xS1IqSIpCKKlMtCL3RyCx5YU940oKJmSQCxoUhOU232Sp+K/UH1mkGRiKGV0oumDFzhnTMipx58xgCO26c574zjmj42Vmzkrn38z3vO/7fO/9E0T8EluOtRuet4DkQoF0EEgBkgzEWRRgkEBePG+nnOWBwbW3/BNFtTQDJbP56RDpJfAUgPZm+PC8JMB7IPuLmfQvjWQaEkjk8huE0gugLVRyBsAXAhwmcYpi/K3/F3oTRTCB4D0QmQtibBVPYX+pJ/1iPRJ1CZjK2QVgkS8o8qlHbi6nhvaja8Zwoxu1bT1pxoaHngS4TIA7wxB95trp+68kd0UCpiocBzg5FFjq2tbWiK6/CJZQhWUCbglJDLp2evylei4jYKr8aUBSfmohNrNkd/x4NcarMglVeETAfcFvOeHanVNq9V1EwFT5w4DcpwGubTVN0NEQM5XDEL/bta2uqux5I2HCrQtuLvNKdufHUQyYbzm3soI59PBzudc6VE8moX69XVD5wdcv3FhNTJ+ALjWKfBlme+SYj88evbYirVruNt8wvT43M219PRKmcpYAeAfAGSFn6xINCChHEejR2e72dD4Y5eYaE+935hgxHLyAp+va6bA5XVmLmSscAPmAALmibdk+AVM5vwOY5AELy7b1YVQC120ZSI2pGKfP40V2uD2d3Y3k48pZYAAfAPjTta2bJJ49PsuQke8AlN1TQxPQ17jOL1VuKmeRAIsJDrh3ek1T8ruOjjUHWzXpNhHvbknmCitJvkHInpLd+XhTBf8DwFTOfgAPgVgtZtbZBsEzAqwr2tbLo9Xf/qZzhxBtjSrgUp1J5bxAYCOI7WIq5wiAe0EscTPWtqgEJuQK1w97XAXBKgFam1VArV4z6zwLge6un2sCOh5pwphfsqfujUIgofKbBaJ7+8wafJdrW7ujyR97V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SfA3UDNKrk5zbkLgNPAFuBTq+Q9XQMUtXlGwEvABbfC/ef2yZN9AUyZ63G8FyA8PFtX8lBanDUKjFR/2RaJ5c+BAvhHrRp7qx15lgLBb+R1c1PkCfG880Pbz1U2fN8abw1ArM0rwAFg2io53imBugEI/iVtnvPwInDYKvlkW4Dhw6fjofy6UwixPoqiW+f3bvxmEAAhRlyt/QzklxeXbjh/YKttjntJgWLVKCGoAu9aJR/JOj7dKtAA0OYNYLf3VOoVqVMBYl07BmKPJ7qvrjZ+OEiAkUmzI8pxAs+btiJ3pSugzYlw7kVu6LqFxzfMZgFkFaJm//LRuTEXuTPAV1bJO9ptwe9CMBrlR4bnd41eGCjAodmCK+TOA/NWydE2W2CCQYFlrrL7ZfjdccTaLCZ3QSHrLoiPmGGG+CPUFqvkcDuAINEYEVvsXvlTFkAv8/FqUfoxrbL+fQqSHADGrZLTvSyQZVuq1h7wQsx4OFlX8q5UBUraVDwc7aYIZS3YOl+smkkhmBBwcEHJUJQujSYFZm8U5H5ozDhusxPy614XSrNP9v8zYFtagWstxe8DDw5ShVjXXgbxNDBjlXyoFXINQFGfuVMQhcsDvHjKVjaFu6HvEU/VduLE8UY43Pa62vxFR4AwGToZgdjXOGJtmpFuiS4Wq3AZ1ZU8mOaX3hFpYwRsShx6PhWxNg9DoxcI4x/VLzUJW+libb4Ebk/+n8bxalZilvXZmx1uT7hTVmXnbF1J2Umxjl1xUZsXBDzfFOAjL3hHCL5jidU+bx3X4BqtV3jr8KymEH6y76a0mThJzCeS09HN9s943GtpCdd1DqQZlqfmbvHO3etgp4D1wNWAEILfvG88H+Q8x+cn5LfdUF606fvDpJdF+s6BQS3yP0AnBf4C4vh7MKas2UAAAAAASUVORK5CYII=" } ]); ui.menu.on("item_click", item => { switch (item.title) { case "更新日志": app.openUrl(rootUrl + "/app/WoolUpgradeLog.html"); break; case "檢查更新": threads.start(function () { let titileAndVersion = ui.toolbar.getTitle(); let appNameAndVersionArray = titileAndVersion.split("v"); let appName = appNameAndVersionArray[0]; let appVersion = appNameAndVersionArray[1]; var url = rootUrl + "/app/WebService.asmx/CheckAppVersion"; var version = appVersion; var res = http.post(url, { "appName": appName, "version": version }); var returnString = res.body.string(); let json = JSON.parse(returnString); if (json.success == "true") { if (json.data.upgrade == "true") { app.openUrl(rootUrl + "/app/WebService.asmx/DownLoadWoolUIApk"); } else { toast("已經是最新版"); } } else { toast("請求遠端服務器出現異常!請稍后重試!"); } }); break; case "教程": app.openUrl("https://blog.csdn.net/zy0412326/article/details/104767602"); break; case "關于": dialogs.build({ title: "關于", positive: "確定", items: ["抖音小助手版純屬個人愛好,如果涉及到侵權請通知作者,作者會盡快解決相應問題。作者郵箱:zy0412326@sina.com"] }).on("show", (dialog) => { }).show(); break; case "退出": ui.finish(); break; } }); //讓工具欄左上角可以打開側拉菜單 ui.toolbar.setupWithDrawer(ui.drawer); } /** * 創建選項菜單(右上角)右上角菜單事件 */ function initializeHeaderMenu() { ui.emitter.on("create_options_menu", menu => { menu.add("更新日志"); menu.add("打賞"); menu.add("教程"); menu.add("關于"); menu.add("退出"); }); ui.emitter.on("options_item_selected", (e, item) => { switch (item.getTitle()) { case "更新日志": app.openUrl(rootUrl + "/app/WoolUpgradeLog.html"); break; case "打賞": app.openUrl(rootUrl + "/app/index.aspx"); break; case "教程": app.openUrl("https://blog.csdn.net/zy0412326/article/details/104767602"); break; case "關于": dialogs.build({ title: "關于", positive: "確定", items: ["薅羊毛UI版純屬個人愛好,如果涉及到侵權請通知作者,作者會盡快解決相應問題。作者郵箱:zy0412326@sina.com"] }).on("show", (dialog) => { }).show(); break; case "退出": ui.finish(); break; } e.consumed = true; }); } /** * 初始化配置數據 */ function initializeData() { let StoryPlateform = woolStorage.get("StoryPlateform"); if (StoryPlateform != null) { if (StoryPlateform == "七貓免費小說") { ui.spStoryPlateform.setSelection(0); } else if (StoryPlateform == "番茄免費小說") { ui.spStoryPlateform.setSelection(1); } else if (StoryPlateform == "瘋讀小說") { ui.spStoryPlateform.setSelection(2); } } let StoryName = woolStorage.get("StoryName"); if (StoryName != null) { ui.txtStoryName.setText(StoryName); } let StoryScreenSileTimes = woolStorage.get("StoryScreenSileTimes"); if (StoryScreenSileTimes != null) { ui.txtStoryScreenSileTimes.setText(StoryScreenSileTimes); } let ScreenSileTimesInterval = woolStorage.get("ScreenSileTimesInterval"); if (ScreenSileTimesInterval != null) { ui.txtScreenSileTimesInterval.setText(ScreenSileTimesInterval); } var IsAutoSign = woolStorage.get("IsAutoSign"); if (IsAutoSign != null && IsAutoSign == "true") { ui.switchIsAutoSign.setChecked(true); } else { ui.switchIsAutoSign.setChecked(false); } var isShowConsole = woolStorage.get("isShowConsole"); if (isShowConsole != null && isShowConsole == "true") { ui.switchIsShowConsole.setChecked(true); } else { ui.switchIsShowConsole.setChecked(false); } } //#region 初始化事件 function initializeEvent() { ui.btnAutoStory.click(function () { let isAutoSign = ui.switchIsAutoSign.isChecked(); let isShowConsole = ui.switchIsShowConsole.isChecked(); let StoryPlateform = ui.spStoryPlateform.getSelectedItem(); let StoryName = ui.txtStoryName.getText(); let StoryScreenSileTimes = ui.txtStoryScreenSileTimes.getText(); let ScreenSileTimesInterval = ui.txtScreenSileTimesInterval.getText(); confirm(tipMessage).then(value => { //當點擊確定后會執行這里, value為true或false, 表示點擊"確定"或"取消" if (value) { storyThread = threads.start(function () { threads.start(function () { auto.waitFor(); app.launchApp(StoryPlateform); toastLog("正在進入" + StoryPlateform + "......"); autoBrush(StoryPlateform, StoryName, StoryScreenSileTimes, ScreenSileTimesInterval, isShowConsole, isAutoSign); }); }); } else { } }); }); ui.btnSaveConfig.click(function () { woolStorage.put("StoryPlateform", "" + ui.spStoryPlateform.getSelectedItem() + ""); woolStorage.put("StoryName", "" + ui.txtStoryName.getText() + ""); woolStorage.put("StoryScreenSileTimes", "" + ui.txtStoryScreenSileTimes.getText() + ""); woolStorage.put("ScreenSileTimesInterval", "" + ui.txtScreenSileTimesInterval.getText() + ""); woolStorage.put("IsAutoSign", "" + ui.switchIsAutoSign.isChecked() + ""); woolStorage.put("isShowConsole", "" + ui.switchIsShowConsole.isChecked() + ""); toast("自動刷配置保存成功!"); }); } //#endregion //#endregion //#region 業務方法 /** * 自動刷方法 * @param {軟件名} appName * @param {閱讀小說名} StoryName * @param {翻頁次數} StoryScreenSileTimes * @param {翻頁時間間隔} ScreenSileTimesInterval * @param {是否顯示控制臺} isShowConsole * @param {是否自動簽到} isAutoSign */ function autoBrush(appName, StoryName, StoryScreenSileTimes, ScreenSileTimesInterval, isShowConsole, isAutoSign) { threads.start(function () { if (isShowConsole) { console.show(); console.setSize(device.width, device.height / 4); } }); sleep(10000); adolescentWindows(); if (isAutoSign) { sign(appName); } if (appName == '七貓免費小說') { try { if (className("android.widget.TextView").text("" + StoryName + "").exists()) { let b = className("android.widget.TextView").text("" + StoryName + "").findOnce().bounds(); click(b.centerX(), b.centerY()); } else { let bookList = className("android.widget.LinearLayout").find(); if (bookList != null) { bookList[2].click(); } } } catch (e) { } for (var i = 1; i < StoryScreenSileTimes; i++) { toastLog("七貓免費小說滑動" + i + "次" + "總計:" + StoryScreenSileTimes + "次"); swipe(device.width * 0.65, device.height * 0.05, device.width * 0.08, device.height * 0.05, 300); let times = parseInt(ScreenSileTimesInterval) * 1000; sleep(times); } } else if (appName == '番茄免費小說') { try { if (className("android.widget.RadioButton").text('書架').exists()) { let bookshelf = className("android.widget.RadioButton").text('書架').findOnce(); bookshelf.click(); sleep(2000); if (className("android.widget.TextView").text("" + StoryName + "").exists()) { let b = className("android.widget.TextView").text("" + StoryName + "").findOnce().bounds(); click(b.centerX(), b.centerY()); } else { let booklist = className('android.view.ViewGroup').find();//查找到的所有ViewGroup if (booklist != null) { booklist[1].click();//第一本書的ViewGroup } } } } catch (e) { } sleep(10000); for (var i = 1; i < StoryScreenSileTimes; i++) { toastLog("番茄免費小說滑動" + i + "次" + "總計:" + StoryScreenSileTimes + "次"); swipe(device.width * 0.65, device.height * 0.5, device.width * 0.08, device.height * 0.5, 300); let times = parseInt(ScreenSileTimesInterval) * 1000; sleep(times); } } else if (appName == '瘋讀小說') { if (className("android.widget.TextView").text("" + StoryName + "").exists()) { let b = className("android.widget.TextView").text("" + StoryName + "").findOnce().bounds(); click(b.centerX(), b.centerY()); } else { let bookList=className("android.view.ViewGroup").find(); if(bookList.length!=0){ console.warn(bookList.length); bookList[1].click(); } } for (var i = 1; i < StoryScreenSileTimes; i++) { toastLog("瘋讀小說滑動" + i + "次" + "總計:" + StoryScreenSileTimes + "次"); swipe(device.width * 0.65, device.height * 0.05, device.width * 0.08, device.height * 0.05, 300); let times = parseInt(ScreenSileTimesInterval) * 1000; sleep(times); } } } /** * 小說簽到 * @param {平臺名} appName */ function sign(appName) { sleep(1000); if (appName == '七貓免費小說') { if (className("android.widget.TextView").text("福利").exists()) { let b = className("android.widget.TextView").text("福利").findOnce().bounds(); click(b.centerX(), b.centerY()); } sleep(3000); try { if (className("android.view.View").text("簽到+20金幣").exists()) { console.info("七貓免費小說。福利簽到+20金幣"); className("android.view.View").text("簽到+20金幣").findOnce().click(); recordSignTime(appName); } else if (className("android.view.View").text("已簽到").exists()) { toastLog("已簽到記錄時間"); className("android.view.View").text("已簽到").findOnce().click(); recordSignTime(appName); } if (className("android.view.View").text("立即簽到").exists()) { className("android.view.View").text("立即簽到").findOnce().click(); recordSignTime(appName); } sleep(3000); recordSignTime(appName);//記錄時間 back(); if (className("android.widget.TextView").text("書架").exists()) { let b = className("android.widget.TextView").text("書架").findOnce().bounds(); click(b.centerX(), b.centerY()); } } catch (e) { } } else if (appName == '番茄免費小說') { if (className("android.widget.RadioButton").text("福利").exists()) { console.log("番茄免費小說,點擊福利"); className("android.widget.RadioButton").text("福利").findOnce().click(); sleep(3000);//福利頁面加載很慢所以等一會 recordSignTime(appName); if (className("android.widget.RadioButton").text("書架").exists()) { className("android.widget.RadioButton").text("書架").findOnce().click(); }else{ back(); } sleep(2000); } } else if (appName == '瘋讀小說') { if (className("android.widget.TextView").text("我").exists()) { let b = className("android.widget.TextView").text("我").findOnce().bounds(); click(b.centerX(), b.centerY()); } sleep(3000);//特別慢得等一會 if (className("android.widget.TextView").text("福利中心").exists()) { let b = className("android.widget.TextView").text("福利中心").findOnce().bounds(); click(b.centerX(), b.centerY()); } sleep(12000);//更慢 if (className("android.widget.Button").text("繼續").exists()) { let b = className("android.widget.TextView").text("繼續").findOnce().click(); } sleep(3000); if (className("android.view.View").text("去簽到").exists()) { recordSignTime(appName); let b = className("android.view.View").text("去簽到").findOnce().click(); } recordSignTime(appName); back(); if (className("android.widget.TextView").text("書架").exists()) { let b = className("android.widget.TextView").text("書架").findOnce().bounds(); click(b.centerX(), b.centerY()); } sleep(1000);//慢得等一會 } } //#endregion //#region 公共方法 /** * 輸出Tosat和Info日志 * @param {日志消息} messagge */ function toastInfo(message) { toast(message); console.info(getTime() + "" + message); } /** * 輸出Tosat和Error日志 * @param {日志消息} messagge */ function toastError(message) { toast(message); console.error(getTime() + "" + message); } function toastLog(message) { toast(message); console.log(getTime() + "" + message); } function toastWarn(message) { toast(message); console.warn(getTime() + "" + message); } /** * 記錄App簽到時間 * @param {App名稱} appName */ function getSignTime(appName) { let key = appName + storaySign; let value = woolStorage.get(key); return value; } function Color(color) { return android.graphics.Color.parseColor(color); } function GradientDrawable(orientation, color) { var colors = []; color.forEach(color => colors.push(Color(color))); return new android.graphics.drawable.GradientDrawable(android.graphics.drawable.GradientDrawable.Orientation[orientation], colors); } /** * 青少年窗口 */ function adolescentWindows() { if (text("我知道了").exists()) { text("我知道了").findOnce().click(); } if (text("知道了").exists()) { text("知道了").findOnce().click(); } } /** * 記錄App簽到時間 * @param {App名稱} appName */ function recordSignTime(appName) { let key = appName + storaySign; let value = getDate(); woolStorage.put(key, value); } /** * 記錄App一次運行的時間 * @param {appName} appName * @param {本次運行時間} recordTimes */ function appRunTimeRecord(appName, recordTimes) { let key = appName + storaySign + getDate(); var havedRunTimes = woolStorage.get("" + key + ""); let value = ""; if (havedRunTimes == null) { woolStorage.put(key, parseInt(recordTimes)); } else { value = parseInt(havedRunTimes) + parseInt(recordTimes); woolStorage.put(key, value); } } /** * 秒轉換成小時 * @param {*} appCount * @param {*} foreachCount * @param {*} slideTimes * @param {*} timesInterval * @param {*} isExistsLongTimes */ function computerTime(appCount, foreachCount, slideTimes, timesInterval, isExistsLongTimes) { let maxSecond = appCount * foreachCount * slideTimes * timesInterval; let maxHour = maxSecond / 3600; return Math.round(maxHour); } /** * 獲取當前時間格式yyyyMMdd */ function getDate() { var date = new Date(); var year = date.getFullYear(); var month = date.getMonth() + 1; if (month < 10) { month = "0" + month; }; var day = date.getDate(); if (day < 10) { day = "0" + day; }; return year + "-" + month + "-" + day; } function getTime() { var date = new Date(); var year = date.getFullYear(); var month = date.getMonth() + 1; if (month < 10) { month = "0" + month; }; var day = date.getDate(); if (day < 10) { day = "0" + day; }; var hour = date.getHours(); if (hour < 10) { hour = "0" + hour; }; var minute = date.getMinutes(); if (minute < 10) { minute = "0" + minute; }; return year + "-" + month + "-" + day + " " + hour + ":" + minute + ":" + "0"; }; //#endregion
到此,關于“怎么用Android4.1.0實現自動閱讀小說”的學習就結束了,希望能夠解決大家的疑惑。理論與實踐的搭配能更好的幫助大家學習,快去試試吧!若想繼續學習更多相關知識,請繼續關注億速云網站,小編會繼續努力為大家帶來更多實用的文章!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。