-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdidi.js
2439 lines (2434 loc) · 80.7 KB
/
didi.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
/*
滴滴打车 v1.04
目前功能:
自动领券, 领券签到, 福利金签到, 福利金打卡瓜分, 养券游戏
福利金可以抵车费, 养券一段时间后可以兑换打车满减券
每天间隔几小时跑一次(养券游戏体力按时间恢复)
把 备注#ticket 填到文件 didiCookie.txt 里(自己新建或者第一次运行脚本后自动创建), 每行一个, 没有备注的话可留空, 如:
备注1#ticket1
#ticket2
自己捉包: 微信小程序 -- 滴滴出行, 第一次注册登录后可能需要退出再进一次
捉 epassport.diditaxi.com.cn/passport/login/v5/signInByOpenid 这个包返回里面的 ticket
cron: 5 0-23/4 * * *
const $ = new Env("滴滴打车");
*/
const _0x295126 = _0x1243c7("滴滴打车"),
_0x5d1274 = require("fs"),
_0x263bb0 = require("got"),
_0x160351 = require("crypto-js"),
_0x3be1c4 = require("ws"),
_0x2f28e5 = "didi",
_0x401283 = _0x2f28e5 + "Cookie.txt",
_0x43680c = 20000,
_0x4721e8 = 3;
const _0x5ec789 = 1.04,
_0x5f16a5 = "didi",
_0x206d5d = "https://leafxcy.coding.net/api/user/leafxcy/project/validcode/shared-depot/validCode/git/blob/master/code.json",
_0x101977 = "https://leafxcy.coding.net/api/user/leafxcy/project/validcode/shared-depot/validCode/git/blob/master/" + _0x5f16a5 + ".json",
_0x9ef809 = "Mozilla/5.0 (iPhone; CPU iPhone OS 16_1_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.44(0x18002c2d) NetType/WIFI Language/zh_CN",
_0xe4f6f2 = "https://servicewechat.com/wxaf35009675aa0b2a/783/page-frame.html",
_0x5dd9ff = 2000,
_0xc1e126 = 5,
_0x56e37f = 5000,
_0x39690d = 2500;
const _0x4e936c = {
dchn: "kkXgpzO",
prod_key: "ut-limited-seckill"
};
const _0x1deeae = {
dchn: "gL3E8qZ",
prod_key: "ut-support-coupon"
};
const _0x2afc21 = [_0x4e936c, _0x1deeae],
_0x3a0cfd = "wss://game-proxy.xiaojukeji.com/proxy/game/go";
const _0x114582 = {
"0": "金币",
"1": "体力",
"2": "立减金额经验",
"3": "有效日期经验",
"4": "使用门槛经验"
},
_0x2a2116 = ["ut_look_through_weibo"],
_0x1d906a = 4000;
let _0x771bc = [],
_0x3f64ec = [],
_0x51a95b = [],
_0x2cbaa5 = [];
const _0x4d68f6 = "R4doMFFeMNlliIWM",
_0x5805cb = "ABCDEFG0123456789abcdefgHIJKLMN+/hijklmnOPQRSTopqrstUVWXYZuvwxyz";
let _0x52ec35 = "6612528ad60e22079f35d61d901bef73342kcgfg";
class _0x364067 {
constructor() {
this.index = _0x295126.userIdx++;
this.name = "";
this.valid = false;
const _0x552ce4 = {
limit: 0
};
const _0x5bd281 = {
Connection: "keep-alive"
};
const _0x17ba3f = {
retry: _0x552ce4,
timeout: _0x43680c,
followRedirect: false,
headers: _0x5bd281
};
this.got = _0x263bb0.extend(_0x17ba3f);
}
get_prefix(_0x20960a = {}) {
var _0x15c488 = "",
_0x3c6ac7 = _0x295126.userCount.toString().length;
if (this.index) {
_0x15c488 += "账号[" + _0x295126.padStr(this.index, _0x3c6ac7) + "]";
}
if (this.name) {
_0x15c488 += "[" + this.name + "]";
}
return _0x15c488;
}
log(_0x194486, _0x2b0f4c = {}) {
let _0x25729a = this.get_prefix();
_0x295126.log(_0x25729a + _0x194486, _0x2b0f4c);
}
async request(_0x57f8b1) {
const _0xfeaace = ["RequestError"],
_0x2407b7 = ["TimeoutError"];
let _0x21dd80 = _0x295126.copy(_0x57f8b1),
_0x44abbb = {};
try {
let _0x232ac8 = null,
_0x14bb6a = 0,
_0x425773 = _0x21dd80.fn || _0x21dd80.url,
_0x42d20e = _0x21dd80.valid_code || [200];
if (_0x21dd80.form) {
for (let _0x25244c in _0x21dd80.form) {
typeof _0x21dd80.form[_0x25244c] == "object" && (_0x21dd80.form[_0x25244c] = JSON.stringify(_0x21dd80.form[_0x25244c]));
}
}
_0x21dd80.method = _0x21dd80?.["method"]?.["toUpperCase"]() || "GET";
if (_0x21dd80.searchParams) {
for (let _0x2b66be in _0x21dd80.searchParams) {
typeof _0x21dd80.searchParams[_0x2b66be] == "object" && (_0x21dd80.searchParams[_0x2b66be] = JSON.stringify(_0x21dd80.searchParams[_0x2b66be]));
}
}
let _0xc471e4 = _0x21dd80.got_client || this.got;
_0x21dd80.debug_in && console.log(_0x21dd80);
while (_0x14bb6a < _0x4721e8) {
if (_0x14bb6a > 0) {
await _0x295126.wait(_0x5dd9ff * _0x14bb6a);
let _0x555941 = _0x295126.get(_0x21dd80, "retryer", null);
if (_0x555941) {
let _0x53935f = _0x295126.get(_0x21dd80, "retryer_opt", {});
await _0x555941(_0x21dd80, _0x53935f);
}
}
_0x14bb6a++;
let _0x22bba8 = null;
try {
let _0x1e2b48 = Number(_0x21dd80?.["timeout"]?.["request"] || _0x21dd80?.["timeout"] || _0x43680c),
_0xdb4877 = false,
_0x3cc93c = Date.now(),
_0x38a74b = _0xc471e4(_0x21dd80),
_0x31ac0a = setTimeout(() => {
_0xdb4877 = true;
_0x38a74b.cancel();
}, _0x1e2b48);
await _0x38a74b.then(_0x354f73 => {
_0x232ac8 = _0x354f73;
}, _0x1a5918 => {
_0x22bba8 = _0x1a5918;
_0x232ac8 = _0x1a5918.response;
}).finally(() => clearTimeout(_0x31ac0a));
let _0x47b663 = Date.now(),
_0x2cd134 = _0x47b663 - _0x3cc93c,
_0x2844ec = _0x232ac8?.["statusCode"] || null;
if (_0xdb4877 || _0x2407b7.includes(_0x22bba8?.["name"])) {
let _0x8eafe8 = "";
_0x22bba8?.["code"] && (_0x8eafe8 += "(" + _0x22bba8.code, _0x22bba8?.["event"] && (_0x8eafe8 += ":" + _0x22bba8.event), _0x8eafe8 += ")");
this.log("[" + _0x425773 + "]请求超时" + _0x8eafe8 + "(" + _0x2cd134 + "ms),重试第" + _0x14bb6a + "次");
} else {
if (_0xfeaace.includes(_0x22bba8?.["name"])) {
this.log("[" + _0x425773 + "]请求错误(" + _0x22bba8.code + ")(" + _0x2cd134 + "ms),重试第" + _0x14bb6a + "次");
} else {
if (_0x2844ec) {
_0x22bba8 && !_0x42d20e.includes(_0x2844ec) && this.log("请求[" + _0x425773 + "]返回[" + _0x2844ec + "]");
} else {
let {
code = "unknown",
name = "unknown"
} = _0x22bba8 || {};
this.log("请求[" + _0x425773 + "]错误[" + code + "][" + name + "]");
}
break;
}
}
} catch (_0x22e3c1) {
this.log("[" + _0x425773 + "]请求错误(" + _0x22e3c1.message + "),重试第" + _0x14bb6a + "次");
}
}
if (_0x232ac8 === null || _0x232ac8 === undefined) {
const _0x1c65b7 = {
statusCode: -1,
headers: null,
result: null
};
return _0x1c65b7;
}
let {
statusCode: _0x2ba34d,
headers: _0x2f3943,
body: _0x4ae9aa
} = _0x232ac8,
_0x76e492 = _0x295126.get(_0x21dd80, "decode_json", true);
if (_0x4ae9aa && _0x76e492) {
try {
_0x4ae9aa = JSON.parse(_0x4ae9aa);
} catch {}
}
const _0x1f8692 = {
statusCode: _0x2ba34d,
headers: _0x2f3943,
result: _0x4ae9aa
};
_0x44abbb = _0x1f8692;
_0x21dd80.debug_out && console.log(_0x44abbb);
} catch (_0x5d5437) {
console.log(_0x5d5437);
} finally {
return _0x44abbb;
}
}
}
let _0x46ce39 = new _0x364067();
class _0x8a6501 extends _0x364067 {
constructor(_0x3004eb) {
super();
let _0x48d37b = _0x3004eb.split("#");
_0x48d37b?.[1] ? (this.remark = _0x48d37b[0] || "", this.name = this.remark || "", this.ticket = _0x48d37b[1]) : (this.remark = "", this.name = "", this.ticket = _0x48d37b[0]);
this.lat = "22.5" + _0x295126.randomString(13, "0123456789");
this.lng = "114.0" + _0x295126.randomString(13, "0123456789");
this.t_req = 0;
this.t_game_draw = 0;
this.game_gid = 0;
this.game_coupon = null;
this.game_coin = 0;
this.game_timer = {};
this.wait_flag = {};
this.game_can_exchange_coupon = true;
const _0x3fbaed = {
"User-Agent": _0x9ef809,
Referer: _0xe4f6f2
};
const _0x5ab7a4 = {
headers: _0x3fbaed
};
this.got = this.got.extend(_0x5ab7a4);
}
coupon_log(_0xc270b4, _0x52021d = "", _0x11b5eb = {}) {
_0x11b5eb.notify = _0x295126.get(_0x11b5eb, "notify", true);
let _0xd11e14 = _0x52021d || "领券";
this.log(_0xd11e14 + ": " + _0xc270b4, _0x11b5eb);
}
get_common_body(_0x3af6ae = {}) {
const _0x1d9dd7 = {
isHitButton: true,
newAppid: 35009,
userAgent: "",
openId: "",
model: "iPhone 14 Pro Max<iPhone15,3>",
wifi: 1
};
return {
lang: "zh-CN",
token: this.token,
access_key_id: 9,
appversion: "6.7.40",
channel: 1100000013,
_ds: "",
xoid: "",
xpsid: _0x295126.randomString(),
xpsid_root: _0x295126.randomString(),
city_id: 2,
lat: this.lat,
lng: this.lng,
platform: "mp",
env: _0x1d9dd7,
f_xpsid: _0x295126.randomString(),
root_xpsid: _0x295126.randomString()
};
}
get_env(_0x20249b = {}) {
const _0x3865c5 = {
token: this.token
};
return JSON.stringify(_0x3865c5);
}
gen_wsgsig(_0x976069, _0x2b423a = "json", _0xbcb8f3 = {}) {
let _0x45644b = "";
if (_0x2b423a == "json") {
_0x45644b = JSON.stringify(_0x976069);
} else {
let _0x320deb = [];
for (let _0x3cce56 in _0x976069) {
let _0x548fe0 = _0x976069[_0x3cce56];
typeof _0x548fe0 == "object" ? _0x320deb.push("" + _0x3cce56 + JSON.stringify(_0x548fe0)) : _0x320deb.push("" + _0x3cce56 + _0x548fe0);
}
_0x45644b = _0x320deb.sort().reverse().join("");
}
const _0x1b53eb = {
k: "v",
v: "1"
};
const _0x406bae = {
k: "os",
v: "web"
};
const _0x5695a5 = {
k: "av",
v: "02"
};
const _0x5a4309 = {
k: "kv",
v: "0000010001"
};
let _0x22442c = [{
k: "ts",
v: Math.floor(Date.now() / 1000)
}, _0x1b53eb, _0x406bae, _0x5695a5, _0x5a4309, {
k: "vl",
v: Buffer.from(_0x45644b).length
}, {
k: "sig",
v: _0x160351.MD5(_0x4d68f6 + _0x45644b).toString()
}],
_0x392da9 = _0x22442c.map(_0x5c4b3c => _0x5c4b3c.k + "=" + _0x5c4b3c.v).join("&"),
_0x5eef85 = [Math.floor(Math.random() * 256), Math.floor(Math.random() * 256), Math.floor(Math.random() * 256), Math.floor(Math.random() * 256)],
_0x4b9881 = [].concat(_0x5eef85);
for (let _0x827385 = 0; _0x827385 < _0x392da9.length; _0x827385++) {
_0x4b9881.push(_0x392da9.charCodeAt(_0x827385) ^ _0x5eef85[_0x827385 % 4]);
}
let _0x3eb5b8 = 3 - _0x4b9881.length % 3,
_0x1c3a3d = _0x3eb5b8;
while (_0x1c3a3d-- > 0) {
_0x4b9881.push(0);
}
let _0x467ebe = "";
for (let _0x297d7f = 0; _0x297d7f < _0x4b9881.length; _0x297d7f += 3) {
let _0x4ac78f = _0x4b9881[_0x297d7f] << 16 | _0x4b9881[_0x297d7f + 1] << 8 | _0x4b9881[_0x297d7f + 2];
_0x467ebe += _0x5805cb.charAt(_0x4ac78f >> 18 & 63) + _0x5805cb.charAt(_0x4ac78f >> 12 & 63) + _0x5805cb.charAt(_0x4ac78f >> 6 & 63) + _0x5805cb.charAt(_0x4ac78f & 63);
}
_0x3eb5b8 && (_0x467ebe = _0x467ebe.slice(0, -_0x3eb5b8));
return "dd03-" + _0x467ebe;
}
async signInByOpenid(_0x5b13bd = {}) {
let _0x5c1ec9 = false;
try {
const _0x4816d5 = {
channel: 1100000003
};
const _0x484204 = {
api_version: "1.0.1",
appid: 35009,
role: 1,
extra_info: _0x4816d5,
device_name: "iPhone 14 Pro Max<iPhone15,3>",
sec_session_id: "",
ddfp: "",
lang: "zh-CN",
wsgenv: "",
model: "iPhone iPhone 14 Pro Max<iPhone15,3>",
unionid_through_login: false,
oauthcode: "",
ticket: this.ticket,
with_temp_ticket: true
};
let _0x34d3b7 = {
q: JSON.stringify(_0x484204)
},
_0x516387 = {
fn: "signInByOpenid",
method: "post",
url: "https://epassport.diditaxi.com.cn/passport/login/v5/signInByOpenid",
searchParams: {
wsgsig: this.gen_wsgsig(_0x34d3b7, "form")
},
form: _0x34d3b7
},
{
result: _0x5172b6,
statusCode: _0x5eb201
} = await this.request(_0x295126.copy(_0x516387)),
_0xbd84a3 = _0x295126.get(_0x5172b6, "errno", _0x5eb201);
if (_0xbd84a3 == 0) {
let {
cell: _0x4cd955,
ticket: _0x43b585,
temp_ticket: _0x378292,
uid: _0x1bf63e
} = _0x5172b6;
this.uid = _0x1bf63e;
this.ticket = _0x43b585;
this.token = _0x378292;
this.mobile = _0x4cd955;
this.name = this.name || _0x4cd955;
this.got = this.got.extend({
headers: {
"Didi-Ticket": this.token
}
});
this.log("登录成功: uid=" + _0x1bf63e);
_0x2084ad();
_0x5c1ec9 = true;
} else {
let _0x1e92ed = _0x295126.get(_0x5172b6, "error", "");
const _0x39c727 = {
notify: true
};
this.log("登录失败(先检查格式有没有填错)[" + _0xbd84a3 + "]: " + _0x1e92ed, _0x39c727);
}
} catch (_0xc513a6) {
console.log(_0xc513a6);
} finally {
return _0x5c1ec9;
}
}
async sign_index(_0x332b62 = {}) {
try {
let _0xccada6 = {
fn: "sign_index",
method: "post",
url: "https://ut.xiaojukeji.com/ut/janitor/api/home/sign/index",
json: this.get_common_body()
};
{
let {
result: _0x3b2606,
statusCode: _0x41148a
} = await this.request(_0x295126.copy(_0xccada6)),
_0x208b24 = _0x295126.get(_0x3b2606, "errno", _0x41148a);
if (_0x208b24 == 0) {
let {
visited: _0x12c9a7,
total_progress: _0xe0e4a0,
current_progress: _0x1bc006,
finished_times: _0x1dcea3
} = _0x3b2606?.["data"];
_0x1dcea3 >= _0x1bc006 ? this.log("今天已签到: " + _0x1dcea3 + "/" + _0xe0e4a0) : await this.sign_do();
} else {
let _0x441367 = _0x295126.get(_0x3b2606, "errmsg", "");
this.log("查询签到信息失败[" + _0x208b24 + "]: " + _0x441367);
}
}
{
let {
result: _0x143f99,
statusCode: _0x136016
} = await this.request(_0x295126.copy(_0xccada6)),
_0x44ce5c = _0x295126.get(_0x143f99, "errno", _0x136016);
if (_0x44ce5c == 0) {
let {
lottery_chance: _0x57710f,
activity_id: _0x1ea8f1
} = _0x143f99?.["data"];
this.log("可以抽奖" + _0x57710f + "次");
while (_0x57710f-- > 0) {
await this.doLottery(_0x1ea8f1);
}
} else {
let _0x322aaf = _0x295126.get(_0x143f99, "errmsg", "");
this.log("查询抽奖次数失败[" + _0x44ce5c + "]: " + _0x322aaf);
}
}
} catch (_0x9c9f9) {
console.log(_0x9c9f9);
}
}
async sign_do(_0x3b9694 = {}) {
try {
let _0x20ee80 = {
fn: "sign_do",
method: "post",
url: "https://ut.xiaojukeji.com/ut/janitor/api/action/sign/do",
json: this.get_common_body()
},
{
result: _0x576796,
statusCode: _0x55cd2f
} = await this.request(_0x295126.copy(_0x20ee80)),
_0x539e32 = _0x295126.get(_0x576796, "errno", _0x55cd2f);
if (_0x539e32 == 0) {
let {
total_progress: _0xccc455,
current_progress: _0x1e6ef9,
finished_times: _0x4a4463
} = _0x576796?.["data"];
this.log("签到成功: " + _0x4a4463 + "/" + _0xccc455);
} else {
let _0x470590 = _0x295126.get(_0x576796, "errmsg", "");
this.log("签到失败[" + _0x539e32 + "]: " + _0x470590);
}
} catch (_0x116e4d) {
console.log(_0x116e4d);
}
}
async doLottery(_0x38435b, _0x57135f = {}) {
try {
let _0x152277 = {
fn: "doLottery",
method: "post",
url: "https://ut.xiaojukeji.com/ut/janitor/api/action/lottery/doLottery",
json: {
...this.get_common_body(),
act_id: _0x38435b
}
};
await _0x295126.wait_gap_interval(this.t_req, _0x56e37f);
let {
result: _0x407296,
statusCode: _0x458f44
} = await this.request(_0x295126.copy(_0x152277));
this.t_req = Date.now();
let _0x2e793c = _0x295126.get(_0x407296, "errno", _0x458f44);
if (_0x2e793c == 0) {
let _0x573e97 = [],
{
win_lottery: _0x5caf94,
prize_data: _0x256ceb
} = _0x407296?.["data"];
if (_0x5caf94) {
for (let _0x131dd3 of _0x256ceb || []) {
let {
name: _0x3a4b68,
threshold_desc: _0x105189,
coupon_amount: _0x51eb32
} = _0x131dd3;
_0x573e97.push("[" + _0x3a4b68 + "]" + _0x105189 + "减" + _0x51eb32);
}
}
this.log("抽奖: " + (_0x573e97.join(", ") || "空气"));
} else {
let _0xba9c19 = _0x295126.get(_0x407296, "errmsg", "");
this.log("抽奖失败[" + _0x2e793c + "]: " + _0xba9c19);
}
} catch (_0x22af57) {
console.log(_0x22af57);
}
}
async product_init(_0x481ab1, _0x4fbfad = {}) {
try {
let _0x29df90 = {
fn: "product_init",
method: "post",
url: "https://api.didi.cn/webx/chapter/product/init",
json: {
...this.get_common_body(),
uid: this.uid,
dchn: _0x481ab1,
args: {
key: this.uid,
invoke_key: "default",
runtime_args: {
dsi: _0x52ec35,
env: {
dchn: _0x481ab1,
model: "iPhone 14 Pro Max<iPhone15,3>",
openId: "",
sceneId: 1001,
latitude: Number(this.lat),
newAppid: "35009",
isOpenWeb: false,
longitude: Number(this.lng),
openIdType: 1,
fromChannel: "2",
isHitButton: false
},
lat: this.lat,
lng: this.lng,
ncc: true,
scene: 1037,
token: this.token,
x_test_user: {
key: this.uid
}
}
},
xbiz: "110105",
xenv: "wxmp",
xoid: "",
openId: "",
prod_key: "wyc-cpc-v-three",
xspm_from: "none.none.none.none",
xpsid_from: "",
is_prefetch: true,
xpsid_share: "",
need_page_config: true,
need_share_config: true
}
};
await this.request(_0x295126.copy(_0x29df90));
} catch (_0x2f839e) {
console.log(_0x2f839e);
}
}
async getBubble(_0x5dce15 = {}) {
try {
let _0x4fc615 = {
fn: "getBubble",
method: "post",
url: "https://ut.xiaojukeji.com/ut/welfare/api/home/getBubble",
json: {
...this.get_common_body(),
env: this.get_env()
}
},
{
result: _0x2fde86,
statusCode: _0x2cb808
} = await this.request(_0x295126.copy(_0x4fc615)),
_0x43bf44 = _0x295126.get(_0x2fde86, "errno", _0x2cb808);
if (_0x43bf44 == 0) {
let {
bubble_list: _0x4e958f
} = _0x2fde86?.["data"];
for (let _0x4087a2 of (_0x4e958f || []).filter(_0x283d36 => _0x283d36.cycle_id)) {
await this.clickBubble(_0x4087a2);
}
} else {
let _0xc11848 = _0x295126.get(_0x2fde86, "errmsg", "");
this.log("查询福利金可领取气泡失败[" + _0x43bf44 + "]: " + _0xc11848);
}
} catch (_0xa7bbdd) {
console.log(_0xa7bbdd);
}
}
async clickBubble(_0x57bed6, _0x3d1507 = {}) {
try {
let _0x52aa72 = {
fn: "clickBubble",
method: "post",
url: "https://ut.xiaojukeji.com/ut/welfare/api/action/clickBubble",
json: {
...this.get_common_body(),
cycle_id: _0x57bed6.cycle_id,
bubble_type: _0x57bed6.bubble_type,
env: this.get_env()
}
},
{
result: _0x4e8cc4,
statusCode: _0x27c576
} = await this.request(_0x295126.copy(_0x52aa72)),
_0x2c3b5d = _0x295126.get(_0x4e8cc4, "errno", _0x27c576);
if (_0x2c3b5d == 0) {
this.log("领取气泡[" + _0x57bed6.pre_content + "]奖励成功: " + _0x57bed6.reward_count + "福利金");
} else {
let _0x21dd8a = _0x295126.get(_0x4e8cc4, "errmsg", "");
this.log("领取福利金气泡奖励失败[" + _0x2c3b5d + "]: " + _0x21dd8a);
}
} catch (_0x3319c8) {
console.log(_0x3319c8);
}
}
async divideData(_0x9b07d = {}) {
try {
let _0x5b7920 = {
fn: "divideData",
method: "post",
url: "https://ut.xiaojukeji.com/ut/welfare/api/home/divideData",
json: {
...this.get_common_body(),
env: this.get_env()
}
},
{
result: _0x479784,
statusCode: _0x6c7b4b
} = await this.request(_0x295126.copy(_0x5b7920)),
_0x1c7294 = _0x295126.get(_0x479784, "errno", _0x6c7b4b);
if (_0x1c7294 == 0) {
for (let _0x1c0390 of Object.keys(_0x479784?.["data"]?.["divide_data"]?.["divide"] || {}) || []) {
let _0x58e3f9 = _0x479784.data.divide_data.divide[_0x1c0390],
{
status: _0x2663a4
} = _0x58e3f9;
switch (_0x2663a4) {
case 1:
{
await this.joinDivide(_0x1c0390, _0x58e3f9);
break;
}
case 2:
{
let _0x1c8875 = _0x295126.time("yyyy-MM-dd");
_0x1c8875 == _0x1c0390 ? await this.divideReward(_0x1c0390, _0x58e3f9) : this.log("已投注参加[" + _0x1c0390 + "]期瓜瓜乐");
break;
}
case 3:
{
this.log("已打卡[" + _0x1c0390 + "]期瓜瓜乐, 等待瓜分");
break;
}
case 4:
{
this.log("已瓜分[" + _0x1c0390 + "]期瓜瓜乐");
break;
}
default:
{
this.log("未知[" + _0x1c0390 + "]期瓜瓜乐参与状态[" + _0x2663a4 + "]");
break;
}
}
}
} else {
let _0x130299 = _0x295126.get(_0x479784, "errmsg", "");
this.log("查询瓜瓜乐状态失败[" + _0x1c7294 + "]: " + _0x130299);
}
} catch (_0x201785) {
console.log(_0x201785);
}
}
async joinDivide(_0x45f8aa, _0x2732ff, _0x5b4205 = {}) {
try {
let _0xfd80c3 = {
fn: "joinDivide",
method: "post",
url: "https://ut.xiaojukeji.com/ut/welfare/api/action/joinDivide",
json: {
...this.get_common_body(),
env: this.get_env(),
activity_id: _0x2732ff.activity_id,
count: _0x2732ff.button.count,
type: _0x2732ff.button.type
}
},
{
result: _0x64308d,
statusCode: _0x4a4ba6
} = await this.request(_0x295126.copy(_0xfd80c3)),
_0xbcd7aa = _0x295126.get(_0x64308d, "errno", _0x4a4ba6);
if (_0xbcd7aa == 0) {
this.log("投注参加[" + _0x45f8aa + "]期瓜瓜乐成功");
} else {
let _0x41c2e9 = _0x295126.get(_0x64308d, "errmsg", "");
this.log("投注参加[" + _0x45f8aa + "]期瓜瓜乐失败[" + _0xbcd7aa + "]: " + _0x41c2e9);
}
} catch (_0x2ffbea) {
console.log(_0x2ffbea);
}
}
async divideReward(_0x1aeb53, _0x85cce7, _0x91bded = {}) {
try {
let _0x669d9f = {
fn: "divideReward",
method: "post",
url: "https://ut.xiaojukeji.com/ut/welfare/api/action/divideReward",
json: {
...this.get_common_body(),
env: this.get_env(),
activity_id: _0x85cce7.activity_id,
task_id: _0x85cce7.task_id
}
},
{
result: _0x258b18,
statusCode: _0x37667b
} = await this.request(_0x295126.copy(_0x669d9f)),
_0x14176e = _0x295126.get(_0x258b18, "errno", _0x37667b);
if (_0x14176e == 0) {
this.log("打卡[" + _0x1aeb53 + "]期瓜瓜乐成功, 等待瓜分");
} else {
let _0x1fa84e = _0x295126.get(_0x258b18, "errmsg", "");
this.log("打卡[" + _0x1aeb53 + "]期瓜瓜乐失败[" + _0x14176e + "]: " + _0x1fa84e);
}
} catch (_0x502d08) {
console.log(_0x502d08);
}
}
async productInit(_0x10e967 = {}) {
try {
let _0x677300 = {
fn: "productInit",
method: "post",
url: "https://api.didi.cn/webx/v2/productInit",
json: {
...this.get_common_body(),
dchn: "q8d86BM",
args: {
invoke_key: "default",
key: "",
runtime_args: {
token: this.token,
lat: this.lat,
lng: this.lng,
env: this.get_env()
}
}
}
};
{
let {
result: _0x122427,
statusCode: _0x6a7bf3
} = await this.request(_0x295126.copy(_0x677300)),
_0x5a4ac3 = _0x295126.get(_0x122427, "errno", _0x6a7bf3);
if (_0x5a4ac3 == 0) {
let {
now_track_id = null,
sign_activity = null
} = _0x122427?.["data"]?.["conf"]?.["strategy_data"]?.["data"]?.["daily_sign"] || {};
for (let _0x460786 of sign_activity || []) {
if (_0x460786.activity_turn_track_id == now_track_id) {
switch (_0x460786.sign_status) {
case 0:
{
await this.dailySign();
break;
}
case 1:
{
this.log("今天福利金已签到");
break;
}
default:
{
this.log("未知福利金签到状态[" + _0x460786.sign_status + "]");
break;
}
}
break;
}
}
await this.getBubble();
await this.divideData();
} else {
let _0x314679 = _0x295126.get(_0x122427, "errmsg", "");
this.log("查询福利金签到状态失败[" + _0x5a4ac3 + "]: " + _0x314679);
}
}
{
let {
result: _0x5bcbab,
statusCode: _0x11079a
} = await this.request(_0x295126.copy(_0x677300)),
_0x25fdfc = _0x295126.get(_0x5bcbab, "errno", _0x11079a);
if (_0x25fdfc == 0) {
let _0x43a8c1 = _0x5bcbab?.["data"]?.["conf"]?.["strategy_data"]?.["data"]?.["bonus_info"]?.["total_amount"] || 0;
const _0x367eca = {
notify: true
};
this.log("福利金余额: " + _0x43a8c1, _0x367eca);
} else {
let _0x344771 = _0x295126.get(_0x5bcbab, "errmsg", "");
this.log("查询福利金失败[" + _0x25fdfc + "]: " + _0x344771);
}
}
} catch (_0x232fe1) {
console.log(_0x232fe1);
}
}
async dailySign(_0x405bdd = {}) {
try {
let _0x29fdfb = {
fn: "dailySign",
method: "post",
url: "https://ut.xiaojukeji.com/ut/welfare/api/action/dailySign",
json: {
...this.get_common_body(),
dchn: "q8d86BM",
env: this.get_env()
}
},
{
result: _0x381489,
statusCode: _0x1a50c4
} = await this.request(_0x295126.copy(_0x29fdfb)),
_0x3a879c = _0x295126.get(_0x381489, "errno", _0x1a50c4);
if (_0x3a879c == 0) {
if (_0x381489?.["data"]?.["prize_status"]) {
let {
subsidy_amount: _0x1bad02
} = _0x381489?.["data"]?.["subsidy_state"];
this.log("福利金签到成功: " + _0x1bad02 + "福利金");
} else {
this.log("福利金签到成功, 没有奖品");
}
} else {
let _0xe29e17 = _0x295126.get(_0x381489, "errmsg", "");
this.log("福利金签到失败[" + _0x3a879c + "]: " + _0xe29e17);
}
} catch (_0x44edf3) {
console.log(_0x44edf3);
}
}
async getTaskList_v3(_0x42e7c0 = {}) {
try {
let _0x2445e8 = {
fn: "getTaskList_v3",
method: "post",
url: "https://ut.xiaojukeji.com/ut/welfare/api/home/getTaskList/v3",
json: {
...this.get_common_body(),
env: this.get_env()
}
},
{
result: _0x36a24f,
statusCode: _0x1ea91a
} = await this.request(_0x295126.copy(_0x2445e8)),
_0x89c69e = _0x295126.get(_0x36a24f, "errno", _0x1ea91a);
if (_0x89c69e == 0) {
let {
task_list: _0x6f7a58
} = _0x36a24f?.["data"];
for (let _0x20aa1e of _0x6f7a58 || []) {
switch (_0x20aa1e.status) {
case "not_enroll":
{
await this.receiveTask_v2(_0x20aa1e);
break;
}
case "ing":
{
await this.receiveTask_v2(_0x20aa1e);
break;
}
case "complete":
{
await this.taskReward(_0x20aa1e);
break;
}
case "finish":
{
break;
}
}
}
} else {
let _0x4beb45 = _0x295126.get(_0x36a24f, "errmsg", "");
this.log("查询福利金任务列表失败[" + _0x89c69e + "]: " + _0x4beb45);
}
} catch (_0x24ef77) {
console.log(_0x24ef77);
}
}
async receiveTask_v2(_0x4e1eb7, _0x3add99 = {}) {
try {
let _0x359cab = {
fn: "receiveTask_v2",
method: "post",
url: "https://ut.xiaojukeji.com/ut/welfare/api/action/receiveTask/v2",
json: {
...this.get_common_body(),
env: this.get_env(),
..._0x4e1eb7
}
},
{
result: _0x577e00,
statusCode: _0x3f74a6
} = await this.request(_0x295126.copy(_0x359cab)),
_0x6c39cc = _0x295126.get(_0x577e00, "errno", _0x3f74a6);
if (_0x6c39cc == 0) {
_0x577e00?.["data"]?.["result"] ? (this.log("接受任务[" + _0x4e1eb7.title + "]成功"), await this.taskReward(_0x4e1eb7)) : this.log("接受任务[" + _0x4e1eb7.title + "]失败");
} else {
let _0x579b57 = _0x295126.get(_0x577e00, "errmsg", "");
this.log("接受任务[" + _0x4e1eb7.title + "]失败[" + _0x6c39cc + "]: " + _0x579b57);
}
} catch (_0x5d2d23) {
console.log(_0x5d2d23);
}
}
async taskReward(_0x4229e2, _0x50f7b1 = {}) {
try {
let {
title: _0x2f0b8c,
activity_id: _0x185135,
task_id: _0x3f9228
} = _0x4229e2,
_0x3454a4 = {
fn: "taskReward",
method: "post",
url: "https://ut.xiaojukeji.com/ut/welfare/api/action/taskReward",
json: {
...this.get_common_body(),
env: this.get_env(),
activity_id: _0x185135,
task_id: _0x3f9228
}
},
{
result: _0x27b687,
statusCode: _0x2af70f
} = await this.request(_0x295126.copy(_0x3454a4)),
_0x117673 = _0x295126.get(_0x27b687, "errno", _0x2af70f);
if (_0x117673 == 0) {
this.log("领取任务[" + _0x2f0b8c + "]奖励成功");
} else {
let _0xa17fa5 = _0x295126.get(_0x27b687, "errmsg", "");
this.log("领取任务[" + _0x2f0b8c + "]奖励失败[" + _0x117673 + "]: " + _0xa17fa5);
}
} catch (_0x1ecedc) {
console.log(_0x1ecedc);
}
}
get_game_gid() {
return (++this.game_gid).toString();
}
async game_ws_send_data(_0x4d7774, _0x5ad542, _0x318cd2 = {}) {
let _0x36e911 = {
msg_type: _0x4d7774,
game_data: _0x5ad542,
gid: this.get_game_gid()
};
this.ws_client.send(JSON.stringify(_0x36e911));
}
async game_RiskParamInit(_0x869c43 = {}) {
let _0x4dbecd = {
"D-Header-T": this.token,
"D-Header-Did": "",
"D-Header-Ddfp": "",
"D-Header-OpenId": "",
"D-Header-FromChannel": "0",
"D-Header-Appid": "35009",
"D-Header-IsHitButton": "true",