-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path好友列表名片点赞(不完美).js
55 lines (46 loc) · 1.16 KB
/
好友列表名片点赞(不完美).js
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
"auto";
//漏赞过多请稍微调大延迟
var 延迟 = 300;
//launchApp("QQ");
//点击联系人图标
className("TabWidget").findOne().child(1).click();
toast("请展开要点赞的分组");
var fail = 0;
while(true){
var list = id("elv_buddies").className("AbsListView").findOne();
var count = list.childCount();
print("count" + list.childCount());
for(let i = 0; i < count; i++){
try{
let child = list.child(i);
print(i);
if(isFriend(child)){
//点进好友名片
child.click();
fav(10);
backToList();
sleep(延迟);
}
}catch(e){
fail++;
toast("可能漏赞:" + fail);
}
}
list.scrollForward();
}
//点赞
function fav(times){
var i = 0;
var btn = descEndsWith("次赞").findOne();
while(i < times){
i += btn.click()? 1 : 0;
}
}
//判断是否是好友的视图
function isFriend(child){
return child && child.className().endsWith("LinearLayout") && child.childCount() == 2 && child.child(0).className().endsWith("FrameLayout");
}
//返回好友列表
function backToList(){
id("ivTitleBtnLeft").click();
}