1 Star 0 Fork 16

毛毛虫吃肉肉/autojs-demo

forked from lin_bo/autojs-demo 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
打开支付宝扫一扫.js 1.16 KB
一键复制 编辑 原始数据 按行查看 历史
lin_bo 提交于 2020-09-02 13:37 . update
let uiWaitTime = 1000;
function clickUI(item, waitTime) {
if (item) {
if (item.clickable()) {
item.click();
} else {
click(item.bounds().centerX(), item.bounds().centerY());
}
if (waitTime && waitTime > 0) {
// console.log('睡眠' + waitTime)
sleep(waitTime);
}
} else {
console.warn("UI控件为空,无法点击");
}
}
function __openZfbScan__() {
try {
let uri = app.parseUri("alipayqr://platformapi/startapp?saId=10000007");
let intent = new Intent(Intent.ACTION_VIEW, uri);
app.startActivity(intent);
sleep(1000);
} catch (e) {
console.trace(e);
}
}
function __selectPicture__() {
let btn = text('相册').findOne();
clickUI(btn, uiWaitTime);
btn = text('系统相册').findOne();
clickUI(btn, uiWaitTime);
btn = text('相册').find()[1];
clickUI(btn, uiWaitTime);
btn = text('收藏').findOne();
clickUI(btn, uiWaitTime);
btn = className('android.widget.ImageView').find()[1];
clickUI(btn, uiWaitTime);
}
function run() {
__openZfbScan__();
__selectPicture__();
}
run();
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/mmc7rr/autojs-demo.git
[email protected]:mmc7rr/autojs-demo.git
mmc7rr
autojs-demo
autojs-demo
master

搜索帮助