forked from maxwellyue/autojs_script
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.js
More file actions
68 lines (62 loc) · 1.86 KB
/
init.js
File metadata and controls
68 lines (62 loc) · 1.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
const utils = require('common.js');
/**
* 通过酷安或者豌豆荚的连接下载
* 1:浏览器下载
* 2:小米app商城下载
*/
//趣头条
download("http://api.1sapp.com/app/download",1);
//中青看点
download("https://res.youth.cn/youth_v1.2.8_code20_180824_c3001.apk",1);
//红包头条
download("https://www.wandoujia.com/apps/com.martian.hbnews/download/dot?ch=detail_normal_dl",1);
//微鲤看看
download("https://www.wandoujia.com/apps/cn.weli.story/download/dot?ch=detail_normal_dl",1);
//牛牛头条
download("https://www.wandoujia.com/apps/com.huolea.bull/download/dot?ch=detail_normal_dl",1);
//惠头条
download("https://www.wandoujia.com/apps/com.cashtoutiao/download/dot?ch=detail_normal_dl",1);
//薪头条
download("http://www.shouzuan.net/download.php?id=19578",1);
//下载app
function download(url,type){
//打开浏览器下载
app.openUrl(url);
if(type == 1){
//立即下载
utils.UITextClick("立即下载");
//循环找安装
var installFlag = false;
while(!installFlag){
var uiele = text("安装").findOnce();
if(uiele){
uiele.click();
installFlag = true;
}
}
//安装完成
var installFinishFlag = false;
while(!installFinishFlag){
var uiele = text("完成").findOnce();
if(uiele){
uiele.click();
installFinishFlag = true;
}
}
}
if(type == 2){
//循环找安装
var installFlag = false;
while(!installFlag){
toast(installFlag);
var uiele = text("安装").findOnce();
toast(123);
if(uiele){
toast(uiele);
uiele.click();
installFlag = true;
}
sleep(2000);
}
}
}