forked from yangmian1167/js_project
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdygz.js
1099 lines (1043 loc) · 27.5 KB
/
dygz.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
importClass(android.content.ContentResolver);
importClass(android.database.Cursor);
importClass(android.net.Uri);
function open_img() {
var thread = threads.start(function () {
while (true) {
if (click("立即开始")) {
log("立即开始");
}
sleep(1000);
}
});
requestScreenCapture();
sleep(1000 * 5);
thread.interrupt();
log("open end");
}
// open_img()
//取短信function
function get_sms_by_time(name, timeline) {
var smsUri = "content://sms/inbox";
function xxxx(body, date) {
var sms_arr = {};
var cursor = context
.getContentResolver()
.query(
Uri.parse(smsUri),
["body"],
"body like ? and date > ?",
["%" + body + "%", date],
"date desc"
);
if (cursor != null) {
let i = 0;
while (cursor.moveToNext()) {
var sms_content = cursor.getString(cursor.getColumnIndex("body"));
console.log("短信", sms_content);
sms_arr[i] = sms_content;
i++;
}
}
// log(sms_arr);
if (sms_arr[0]) {
return sms_arr[0];
} else {
return false;
}
}
if (!timeline) {
timeline = 0;
}
return xxxx(name, timeline);
}
//post
function jspost(url, data) {
var res = http.post(url, data);
var data = res.body.string();
if (data) {
log(data);
return data;
}
}
// 获取接口数据
function getTask() {
var url = "http://api.wenfree.cn/public/";
let res = http.post(url, {
s: "NewsImei.Imei",
imei: device.getIMEI() || "13856d62514d48cba2467cbf8dcb5f46",
});
let json = {};
try {
let html = res.body.string();
// log(html)
json = JSON.parse(html);
log(json);
return json.data;
} catch (err) {
//在此处理错误
}
}
// 获取流程记录
function getTaskRecord() {
var url = "http://api.wenfree.cn/public/";
let res = http.post(url, {
s: "NewsImeiTaskData.Task",
imei: device.getIMEI() || "13856d62514d48cba2467cbf8dcb5f46",
appname: appinfo.name,
});
let json = {};
try {
let html = res.body.string();
// log(html)
json = JSON.parse(html);
if (json.data) {
info = json.data.task_data;
info.id = json.data.id;
}
} catch (err) {
//在此处理错误
}
}
// 返回流程记录
function getTaskRecordUpdate(info) {
let infoArr = {};
infoArr["task_data"] = JSON.stringify(info);
var url = "http://api.wenfree.cn/public/";
let res = http.post(url, {
s: "Index.update",
id: info.id,
table: "news_imei_data_task_record",
arr: JSON.stringify(infoArr),
});
let json = {};
try {
let html = res.body.string();
log(html);
} catch (err) {
//在此处理错误
}
}
//任务回调
function callback_task(id, state) {
var url = "http://api.wenfree.cn/public/";
var arr = {};
arr["id"] = id;
arr["state"] = state;
var postdata = {};
postdata["s"] = "NewsRecordBack.Back";
postdata["arr"] = JSON.stringify(arr);
log(arr, postdata);
log(jspost(url, postdata));
}
//读取本地数据
function getStorageData(name, key) {
const storage = storages.create(name); //创建storage对象
if (storage.contains(key)) {
return storage.get(key);
}
//默认返回undefined
}
function app_info(name, data) {
var url = "http://api.wenfree.cn/public/";
var postdata = {};
postdata["s"] = "App.NewsAppInfo.App_info";
postdata["imei"] = device.getIMEI() || "13856d62514d48cba2467cbf8dcb5f46";
postdata["app_name"] = name;
postdata["app_info"] = JSON.stringify(data);
log(jspost(url, postdata));
}
//基础函数
function active(pkg, n) {
if (!n) {
n = 5;
}
if (currentPackage() == pkg) {
log("应用在前端");
return true;
} else {
app.launch(pkg);
sleep(1000 * n);
}
}
//准备点击
function click_(x, y, sleeptime, txt) {
if (!sleeptime) {
sleeptime = 1;
}
if (txt) {
log("准备点击->" + txt, "x:", x, "y:", y);
} else {
log("准备点击坐标->", "x:", x, "y:", y);
}
if (x > 0 && x < width && y > 0 && y < height) {
click(x, y);
sleep(sleeptime * 1000);
return true;
} else {
log("坐标错误");
}
}
//点击obj
function click__(objs, sleeptime, txt) {
if (!sleeptime) {
sleeptime == 1;
}
if (txt) {
log("准备点击对象->" + txt);
} else {
log("点击未命名对象");
}
click_(objs.bounds().centerX(), objs.bounds().centerY(), sleeptime, txt);
}
//普通封装
function jjsclick(way, txt, clickKey, sleeptimes, height_) {
sleeptimes = sleeptimes || 1; //当n没有传值时,设置n=1
if (!height_) {
height_ = height;
} //没有设置高度则height = 1440
if (!clickKey) {
clickKey = true;
} //如果没有设置点击项,设置为false
var objs = false;
if (way == "text") {
objs = text(txt).findOne(200);
} else if (way == "id") {
objs = id(txt).findOne(200);
} else if (way == "desc") {
objs = desc(txt).findOne(200);
}
if (objs) {
if (
objs.bounds().centerX() < 0 ||
objs.bounds().centerX() > width ||
objs.bounds().centerY() < 0 ||
objs.bounds().centerY() > height_
) {
} else {
if (clickKey) {
log(
"准备点击->",
txt,
"x:",
objs.bounds().centerX(),
"y:",
objs.bounds().centerY()
);
click__(objs, sleeptimes, txt);
} else {
log("找到->", txt);
}
return true;
}
}
}
//普通封装
function jsclick(way, txt, clickKey, sleeptimes, height_) {
sleeptimes = sleeptimes || 1; //当n没有传值时,设置n=1
if (!height_) {
height_ = height;
} //没有设置高度则height = 1440
clickKey = clickKey || false; //如果没有设置点击项,设置为false
var objs = false;
if (way == "text") {
objs = text(txt).findOne(200);
} else if (way == "id") {
objs = id(txt).findOne(200);
} else if (way == "desc") {
objs = desc(txt).findOne(200);
}
if (objs) {
if (
objs.bounds().centerX() < 0 ||
objs.bounds().centerX() > width ||
objs.bounds().centerY() < 0 ||
objs.bounds().centerY() > height_
) {
} else {
if (clickKey) {
log(
"准备点击->",
txt,
"x:",
objs.bounds().centerX(),
"y:",
objs.bounds().centerY()
);
if (!clickTrue(objs, sleeptimes, txt)) {
click__(objs, sleeptimes, txt);
}
} else {
log("找到->", txt);
}
return true;
}
}
}
//强制点击
function bclick(way, txt, clickKey, sleeptimes, height_) {
sleeptimes = sleeptimes || 1; //当n没有传值时,设置n=1
if (!height_) {
height_ = height;
} //没有设置高度则height = 1440
var obj = false;
clickKey = clickKey || false; //如果没有设置点击项,设置为false
if (way == "text") {
obj = text(txt).findOne(200);
} else if (way == "id") {
obj = id(txt).findOne(200);
} else if (way == "desc") {
obj = desc(txt).findOne(200);
}
if (obj) {
if (
objs.bounds().centerX() < 0 ||
objs.bounds().centerX() > width ||
objs.bounds().centerY() < 0 ||
objs.bounds().centerY() > height_
) {
return false;
}
if (clickKey) {
if (!clickTrue(obj, sleeptimes, txt)) {
click__(obj, sleeptimes, txt);
}
} else {
log("找到->", txt);
}
return true;
}
}
//穿透点击
function clickTrue(obj, sleeptime, txt) {
log("clickTrue", txt);
if (!sleeptime) {
sleeptime = 1;
}
let result = false;
if (obj && obj.clickable()) {
obj.click();
result = true;
} else {
log("组件不能穿透");
let obj_ = obj.parent();
if (obj_ && obj_.clickable()) {
obj_.click();
log("父组件能穿透");
result = true;
} else {
log("父组件不能穿透");
}
}
if (result) {
sleep(sleeptime * 1000);
}
return result;
}
//正则点击
function ms(obj, clicks, sleeptimes, height_, txts) {
if (!sleeptimes) {
sleeptimes = 1;
}
if (!height_) {
height_ = height;
} //没有设置高度则height = 1440
var txt = "";
for (let key in obj) {
if (key == "textMatches") {
eval("var matches = /" + obj[key] + "/");
txt = txt + key + "(" + matches + ").";
} else {
txt = txt + key + '("' + obj[key] + '").';
}
}
var txt = "let objs = " + txt + "findOne(200);";
log(txt);
eval(txt);
log(objs);
if (objs) {
if (
objs.bounds().centerX() < 0 ||
objs.bounds().centerX() > width ||
objs.bounds().centerY() < 0 ||
objs.bounds().centerY() > height_
) {
return false;
}
if (clicks) {
if (!clickTrue(objs, sleeptimes, txts)) {
click__(objs, sleeptimes, txts);
}
}
return true;
}
}
//随机数
function rd(min, max) {
if (min <= max) {
return random(min, max);
} else {
return random(max, min);
}
} //下载app
function download(appname) {
var timeLine = new Date().getTime();
while (new Date().getTime() - timeLine < 10 * 60 * 1000) {
var storePid = "com.xiaomi.market";
var phoneMode = device.brand;
if (phoneMode == "Coolpad") {
storePid = "com.qiku.cloudfolder";
}
if (active(storePid, 5)) {
var UI = currentActivity();
log("UI", UI);
switch (UI) {
case "com.xiaomi.market.ui.MarketTabActivity":
log("主界面");
jsclick("id", "search_text_switcher", true, 2);
setText(0, appname);
sleep(2000);
if (ms({ descMatches: appname + ".*", id: "app_icon" }, true, 2)) {
} else if (
ms({ textMatches: appname, id: "display_name" }, true, 2)
) {
} else if (
ms({ textMatches: appname + ".*", id: "display_name" }, true, 2)
) {
} else if (ms({ text: appname + "图形" }, true, 2)) {
} else if (ms({ desc: appname + "图形" }, true, 2)) {
} else if (ms({ text: appname }, true, 2)) {
}
break;
case "com.xiaomi.market.ui.SearchActivityPhone":
log("搜索页面");
if (ms({ descMatches: appname + ".*", id: "app_icon" }, true, 2)) {
} else if (
ms({ textMatches: appname, id: "display_name" }, true, 2)
) {
} else if (
ms({ textMatches: appname + ".*", id: "display_name" }, true, 2)
) {
} else if (ms({ text: appname + "图形" }, true, 2)) {
} else if (ms({ desc: appname + "图形" }, true, 2)) {
} else if (ms({ text: appname }, true, 2)) {
}
break;
case "com.xiaomi.market.ui.AppDetailActivityInner":
log("app详情页面");
if (
ms(
{ id: "J_detailInstallBtn", depth: 11, textMatches: "打开" },
false,
4
)
) {
return true;
} else if (
ms(
{
className: "android.widget.EditText",
depth: 11,
textMatches: "安装.*|升级|继续",
},
true,
4
)
) {
} else if (
ms(
{
className: "android.widget.EditText",
depth: 11,
textMatches: "暂停|安装中",
},
false,
4
)
) {
toastLog("暂停或安装中");
}
break;
case "com.xiaomi.market.ui.detail.AppDetailActivityInner":
log("app详情页面");
var detail_download = id("detail_download").findOne(500);
if (detail_download) {
var detail_download_text = detail_download.desc();
if (detail_download_text == "打开") {
log("下载完成");
return true;
} else if (detail_download_text == "安装中") {
log("安装中");
toast("安装中");
} else if (
detail_download_text.search("安装") == 0 ||
detail_download_text == "升级" ||
detail_download_text == "继续"
) {
click__(detail_download);
sleep(3000);
jsclick("text", "立即下载", true, rd(2, 3));
} else if (detail_download_text.search("%") == 0) {
log("正在下载中");
toast("正在下载中,会下载10分钟左右");
sleep(1000);
} else {
log(detail_download_text);
}
}
break;
case "com.qiku.cloudfolder.ui.activity.main.MainActivity":
log("CoolPa 主界面");
jsclick("id", "text_main_search_word", true, rd(2, 3));
break;
case "com.qiku.cloudfolder.ui.activity.search.AppSearchActivity":
log("准备搜索");
setText(0, appname);
jsclick("id", "search_app", true, 8);
ms({ textMatches: appname, id: "vertical_app_name" }, true, 3);
break;
case "com.qiku.cloudfolder.ui.activity.details.AppDetailsActivity":
log("app详情页面");
var state = id("details_app_download_progress").findOne(200);
if (state) {
let txt = state.text();
if (txt == "等待中" || txt == "下载中") {
} else if (txt == "已暂停" || txt == "安装" || txt == "升级") {
click__(state, 3, state.text());
} else if (txt == "打开") {
return true;
}
toastLog(txt);
}
break;
default:
back();
}
}
sleep(1000);
}
}
//发广播
function sendBroadcast(appName, data) {
var mapObject = {
appName: appName,
data: data,
};
app.sendBroadcast({
packageName: "com.flow.factory",
className: "com.flow.factory.broadcast.TaskBroadCast",
extras: mapObject,
});
}
//滑动函数
function moveTo(x, y, x1, y1, times) {
Swipe(x, y, x1, y1, times);
sleep(1000);
}
//河马ip
function hmip() {
var result = shell("ipclient faa31f81bfea4124995972d5dc016b57 1", true);
// console.show();
// log(result);
if (result.code == 0) {
toast("vpn 执行成功");
// return true
} else {
toast("vpn 执行失败!请到控制台查看错误信息");
}
var url = "http://idfaapi.wenfree.cn/?s=App.IP.GetInfo";
var ips = jspost(url, {});
if (ips) {
ips = JSON.parse(ips);
if (ips.ret == 200) {
toastLog(ips.data.ip);
return true;
}
}
}
//光之
function gz() {
var timeLine = new Date().getTime();
while (new Date().getTime() - timeLine < 5 * 60 * 1000) {
if (active(appinfo.gzbid, 3)) {
if (jsclick("text", "立即登录", true, rd(6, 10))) {
} else if (jsclick("id", "vpnSwitch", true, rd(6, 10))) {
return true;
}
}
sleep(1000);
}
}
//设备大师
function sbds() {
let starMun = 0;
let fix = false;
var start = false;
var timeLine = new Date().getTime();
while (new Date().getTime() - timeLine < 6 * 60 * 1000) {
starMun++;
log(starMun);
if (active(appinfo.sbdsbid, 8)) {
if (jsclick("text", "修改设备", false, rd(2, 3))) {
if (fix) {
return true;
}
jsclick("text", "修改设备", true, rd(2, 3));
} else if (jsclick("text", "设备属性设置", false, rd(2, 3))) {
start = true;
if (jjsclick("id", "brand", true, rd(2, 3))) {
var phonelist = ["XIAOMI", "HUAWEI", "OPPO", "vivo"];
ms({ text: phonelist[rd(0, 4)], depth: 4 }, true, rd(2, 3));
jsclick("text", "下一步", true, 8);
} else {
back();
}
} else if (jsclick("text", "清理应用", false, rd(2, 3))) {
jjsclick("text", appinfo.name, true, 1);
if (jsclick("text", "立即清理", true, rd(10, 15))) {
fix = true;
}
} else {
back();
}
}
sleep(2000);
}
}
//接口调用设备大师
function sbdsJk() {
active(appinfo.sbdsbid, 8);
var result = shell("setphone", true);
// console.show();
log(result);
if (result.code == 0) {
toast("一键新机 执行成功");
} else {
toast("一键新机 执行失败!请到控制台查看错误信息");
}
var result = shell("pm clear " + appinfo.bid, true);
log(result);
if (result.code == 0) {
toast("一键清理 执行成功");
} else {
toast("一键清理 执行失败!请到控制台查看错误信息");
}
shell(
"am start -n com.android.systemui/com.android.systemui.recents.RecentsActivity",
true
);
sleep(3000);
if (ms({ descMatches: "移除设备大师.*" }, true, 5)) {
return true;
}
}
//用户Login
function getLogin() {
let url =
"http://uasea.cn/yhapi.ashx?act=login&ApiName=api_wenfree_q7m&PassWord=AaDd112211";
let data = http.get(url);
if (data) {
data = data.body.string();
log(data);
data = data.split("|");
token = data[1];
log(token);
return token;
}
toastLog("登录出错");
}
//取手机号
function getPhone() {
token = getLogin();
iid = "9902";
let getArr = {};
let url =
"http://uasea.cn/yhapi.ashx?act=getPhone&token=" +
token +
"&iid=9902" +
"&mobile=";
let data = http.get(url);
if (data) {
data = data.body.string();
log(data);
data = data.split("|");
log(data[4]);
return data[4];
}
toastLog("取手机号出错");
}
//取短信
function getMessage() {
iid = "9902";
let getArr = {};
let url =
"http://uasea.cn/yhapi.ashx?act=getPhoneCode&token=" +
token +
"&pid=9902" +
phone_num;
for (var i = 0; i < 25; i++) {
let data = http.get(url);
if (data) {
data = data.body.string();
log(data);
data = data.split("|");
if (data[1].length == 6) {
log("成功");
log(data[1]);
return data[1];
}
sleep(3000);
}
}
toastLog("取短信出错");
return false;
}
//上传
function Idfa(ohter) {
let postArr = {};
postArr["name"] = appinfo.name;
postArr["account"] = appinfo.imei;
postArr["idfa"] = appinfo.oaid;
postArr["ip"] = ip;
postArr["phone"] = "";
postArr["ohter"] = ohter || "";
postArr["password"] = appinfo.brand;
let data = jspost(
"http://wenfree.cn/api/Public/idfa/?service=idfa.idfa",
postArr
);
}
var all_Info = textMatches(/.*/).find();
for (var i = 0; i < all_Info.length; i++) {
var d = all_Info[i];
log(i, d.id(), d.text(), d.depth());
}
/**
* 联众图像识别函数
* @param {string} username 联众图像识别账号
* @param {string} password 联众图像识别密码
* @param {object} img 识别图片
*/
/**
* 敬告使用者
*
* 联众识图网站SDK页面提供的接口、实例文件均为第三方开发,非联众识图开发,因技术原因,联众识图平台未进行代码审查,亦不能确定代码的功能作用,请接入的开发者审查代码后调用。如实例中包含恶意代码或针对某网站、软件的攻击行为,请联系联众识图平台删除链接。
*
* 联众识别平台仅为残障人士以及有需要的个人和企业提供图像识别和图像识别分类服务,联众平台仅仅被动接受开发者传入的图像返回图像中的文字或结果信息,不参与破解,不为恶意软件提供帮助,不针对任何网站或个人。
* 请勿利用联众识别做违反国家法律法规的行为,否则强制停止使用,不予退费,联众将依法向有关部门递交您的个人资料!
* 违法软件是指的是包括但不限于以下用途的软件:
* 1、破解、入侵系统,或正常登录但超越授权范围获取信息。
* 2、赌博
* 3、薅羊毛
* 4、批量登录、批量注册、批量支付
* 5、游戏外挂、游戏辅助
* 6、超越访问频率限制
* 7、批量盗取公民个人信息,获取手机号、身份证等隐私信息
*
*/
function getCode(img) {
http.__okhttp__.setTimeout(3e4);
var r = images.toBase64(img, (format = "png")),
i = device.release,
c = device.model,
s = device.buildId;
try {
var n = http.postJson(
"https://v2-api.jsdama.com/upload",
{
softwareId: 15026,
softwareSecret: "jR6wwkyxPdTe0QKrw3yZ0wmQbglIEncyC8u4lNZ4",
username: "ouwen000",
password: "AaDd112211..",
captchaData: r,
captchaType: 1001,
captchaMinLength: 4,
captchaMaxLength: 4,
workerTipsId: 0,
},
{
headers: {
"User-Agent":
"Mozilla/5.0 (Linux; Android " +
i +
"; " +
c +
" Build/" +
s +
"; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 Mobile Safari/537.36",
},
}
);
} catch (e) {
return {
code: "-1",
msg: "网络链接超时...",
data: {},
};
}
var d = n.body.json(),
p = d.code,
m = d.message;
if ("10079009" == p)
return {
code: p,
msg: m,
data: {},
};
if ("10142006" == p)
return {
code: p,
msg: m,
data: {},
};
if ("10142004" == p)
return {
code: p,
msg: m,
data: {},
};
if ("10142005" == p)
return {
code: p,
msg: m,
data: {},
};
if ("10079006" == p)
return {
code: p,
msg: m,
data: {},
};
if ("0" == p) {
return {
code: p,
msg: m,
data: {
res: d.data.recognition,
},
};
}
return d;
}
function getimgs() {
sleep(1000);
captureScreen("/sdcard/screencapture.png");
var src = images.read("/sdcard/screencapture.png");
log(width, device.height, src.getWidth(), src.getHeight());
var clip = images.clip(src, 740, 148, (692 - 536) / 2, (344 - 266) / 2);
// var clip = images.clip(src, 840,133, (692-536)/2,(344-266)/2 ); //真机
images.save(clip, "/sdcard/yzm.png");
}
//设备大师参数信息
function getsbds() {
Tips();
let fix = false;
var start = false;
var timeLine = new Date().getTime();
sleep(5000);
while (new Date().getTime() - timeLine < 2 * 60 * 1000) {
if (active(appinfo.sbdsbid, 4)) {
if (jsclick("text", "关闭应用")) {
} else if (jsclick("text", "当前设备")) {
log("设备信息界面");
appinfo.imei = id("imei").findOne(100).text();
appinfo.oaid = id("android_id").findOne(100).text();
appinfo.device = id("phone_model").findOne(100).text();
appinfo.brand = id("phone_brand").findOne(100).text();
// console.show()
log(appinfo);
home();
sleep(1000);
return true;
}
}
}
}
//获取ip
function get_ip() {
let url =
"http://pv.sohu.com/cityjson?ie=utf-8";
let data = http.get(url);
if (data) {
data = data.body.string();
log(data);
data = data.split("=")[1];
data = data.split(";")[0];
ip = JSON.parse(data)["cip"]
log(ip);
return ip;
}
toastLog("未能获取IP");
}
function Reportidfa() {
let postArr = {};
postArr["source"] = "anzhuo1";
postArr["uid"] = "1000";
postArr["appPackage"] = "com.youxiang.soyoungapp";
postArr["imei"] = appinfo.imei;
postArr["oaid"] = appinfo.oaid;
postArr["device"] = appinfo.device;
postArr["brand"] = appinfo.brand;
postArr["ip"] = "";
let data = jspost("http://td.wenfree.cn/?s=App.Std.Report", postArr);
toastLog(data);
}
function Distinctidfa() {
let postArr = {};
postArr["source"] = "anzhuo1";
postArr["uid"] = "1000";
postArr["appPackage"] = "com.youxiang.soyoungapp";
postArr["imei"] = appinfo.imei;
postArr["oaid"] = appinfo.oaid;
postArr["device"] = appinfo.device;
postArr["brand"] = appinfo.brand;
postArr["ip"] = "";
let data = jspost("http://td.wenfree.cn/?s=App.Std.Distinct", postArr);
if (data) {
data = JSON.parse(data);
if (data.data == "排重成功") {
return true;
}
}
log(data);
toastLog("排重失败");
}
//新tips
function Tips() {
log("查询弹窗");
let appTips = [
{ text: "同意继续" },
{ textMatches: "同意继续" },
{ text: "允许" },
{ textMatches: "允许" },
{ text: "下一步" },
{ text: "确定" },
{ textMatches: "确认" },
{ textMatches: ".*关闭应用.*" },
{ textMatches: ".*重新打开应用.*" },
{ text: "重新加载" },
];
for (let k in appTips) {
if (ms(appTips[k], true, rd(1, 2))) {
}
}
log("查询弹窗-end");
}
// 正式开始编代码
var width = 720;
var height = 1440;
var width = device.width;
var height = device.height;
var phoneMode = device.brand;
log([currentPackage(), currentActivity(), width, height]);
var appinfo = {};
appinfo.name = "dygz";
appinfo.bid = "com.ss.android.ugc.live"
appinfo.bid登录界面 = "com.heytap.htms";
appinfo.llq = "com.tencent.mtt";
appinfo.gzbid = "com.deruhai.guangzi";
appinfo.sbdsbid = "com.longene.setcardproperty";
info = {};
info.phone = "18128823268";
info.password = "AaDd112211";
info.api = "http://sms.wenfree.cn/public/";
info.yzm = "";
info.smsname = "";
// console.show();
function get_task() {
url = "http://wenfree.cn/api/Public/tjj/?service=Tjj.gettask";
postArr = {};
postArr["phonename"] = "anzhuo6";
postArr["imei"] = "hemayun6";
taskData = jspost(url, postArr);
if (taskData != null) {
taskData = JSON.parse(taskData);