基于autojs pro的接码登录界面,演示了组件事件的挂接
生活随笔
收集整理的這篇文章主要介紹了
基于autojs pro的接码登录界面,演示了组件事件的挂接
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
說明
本文提供的代碼僅供參考。不建議用于生產環境。
可能有些地方在最新版本的Auto.js上面需要做修改,才能運行。
Auto.js簡介
Auto.js是利用安卓系統的“輔助功能”實現類似于按鍵精靈一樣,可以通過代碼模擬一系列界面動作的輔助工作。
與“按鍵精靈”不同的是,它的模擬動作并不是簡單的使用在界面定坐標點來實現,而是類似與win一般,找窗口句柄來實現的。
Auto.js使用JavaScript作為腳本語言,目前使用Rhino 1.7.7.2作為腳本引擎,支持ES5與部分ES6特性。
推薦教程
Auto.js Pro安卓全分辨率免ROOT引流腳本開發視頻教程(HD超清1080p)
開發文檔
Auto.js Pro開發文檔
文檔尚在完善中,可能有文檔描述和代碼實際行為有出入的情況。
為什么要使用Auto.js Pro開發腳本,有什么特點?
吸引我使用Auto.js Pro的原因有很多。最主要的幾個原因是:
- Auto.js Pro能開發免ROOT的安卓腳本
- Auto.js Pro基于節點操作,能開發全分辨率的腳本,自動適配各種安卓機型
- Auto.js Pro豐富的UI組件,能自定義各種樣式的安卓界面
- Auto.js Pro使用的javascript的語法比較優雅,代碼可讀性強
- Auto.js Pro的命令庫非常的豐富,接口比較多
- Auto.js Pro腳本文件體積比較小。1000行的代碼,打包后的apk文件只有3-5M,還沒有廣告
示例代碼
// 此代碼由飛云腳本圈www.feiyunjs.com整理提供 var window = floaty.window(<card layout_width="match_parent" layout_height="match_parent" cardCornerRadius="8dp" cardElevation="0dp" gravity="center_vertical"><LinearLayout orientation="vertical" layout_width="wrap_content" layout_height="wrap_content" gravity="left|center"><EditText layout_width="360px" inputType="number" layout_height="85px" ems="10" hint="手機號碼" textSize="15sp"id="EditText1" textColor="#0078FF"/><LinearLayout orientation="horizontal" layout_width="wrap_content" layout_height="wrap_content"><EditText layout_width="260px" inputType="number" layout_height="85px" ems="10" textSize="15sp" hint="驗證碼" id="EditText2" textColor="#0078FF"/><Button layout_width="100px" layout_height="75px" text="發送" id="code" textColor="#0078FF"/></LinearLayout><LinearLayout orientation="horizontal" layout_width="wrap_content" layout_height="wrap_content"><Button layout_width="wrap_content" layout_height="80px" text="登入" id="Loginto" textColor="#0078FF"/><Button layout_width="wrap_content" layout_height="80px" text="退出" id="exit" textColor="#0078FF"/></LinearLayout></LinearLayout></card> ); setInterval(() => {}, 1000); //window.setPosition(160, 360);window.requestFocus();window.code.on("click", () => {toastLog("獲取驗證碼"); });window.Loginto.on("click", () => {toastLog("登入"); });window.exit.on("click", () => {window.close();// exit(); });總結
以上是生活随笔為你收集整理的基于autojs pro的接码登录界面,演示了组件事件的挂接的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 小孔成像总结_干货 | 初中物理解题技巧
- 下一篇: 4084: [Sdoi2015]双旋转字