forked from wq-h/qinglong
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchinatelecom.js
1892 lines (1888 loc) · 69.1 KB
/
chinatelecom.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
/*
电信营业厅 v6.02
签到和完成部分金豆任务, 喂宠物
7天,15天,28天连签抽奖, 宠物等级权益兑换
自己设置电信的服务密码, 把 手机号#服务密码 填到变量里, 多账号换行或&或@隔开:
export chinaTelecomAccount="13888888888#123456"
每天运行一两次
cron: 33 10,14 * * *
const $ = new Env("电信营业厅");
*/
const _0x49dfef = _0x5370a4("电信营业厅"),
_0x8e0885 = require("got"),
_0x203c4a = require("path"),
{
exec: _0x3898d1
} = require("child_process"),
{
CookieJar: _0x4f58d7
} = require("tough-cookie"),
_0x5336b3 = require("fs"),
_0x5e650c = require("crypto-js"),
_0x22f09c = "chinaTelecom",
_0x1876a7 = /[\n\&\@]/,
_0x4aec53 = [_0x22f09c + "Account"],
_0x128624 = 30000,
_0x5a04a9 = 3,
_0x1736e2 = _0x22f09c + "Rpc",
_0x16d3ea = process.env[_0x1736e2],
_0xf4231c = 6.02,
_0x14f289 = "chinaTelecom",
_0x100b57 = "https://leafxcy.coding.net/api/user/leafxcy/project/validcode/shared-depot/validCode/git/blob/master/code.json",
_0x344953 = "JinDouMall";
let _0x1d3d6d = {};
const _0x5370da = "./chinaTelecom_cache.json",
_0x3ed712 = "Mozilla/5.0 (Linux; U; Android 12; zh-cn; ONEPLUS A9000 Build/QKQ1.190716.003) AppleWebKit/533.1 (KHTML, like Gecko) Version/5.0 Mobile Safari/533.1",
_0x75a069 = "34d7cb0bcdf07523",
_0x2304b1 = "1234567`90koiuyhgtfrdewsaqaqsqde",
_0x1110eb = "\0\0\0\0\0\0\0\0",
_0x3c561e = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDBkLT15ThVgz6/NOl6s8GNPofdWzWbCkWnkaAm7O2LjkM1H7dMvzkiqdxU02jamGRHLX/ZNMCXHnPcW/sDhiFCBN18qFvy8g6VYb9QtroI09e176s+ZCtiv7hbin2cCTj99iUpnEloZm19lwHyo69u5UMiPMpq0/XKBO8lYhN/gwIDAQAB",
_0x1e9565 = "-----BEGIN PUBLIC KEY-----\n" + _0x3c561e + "\n-----END PUBLIC KEY-----",
_0x516f15 = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC+ugG5A8cZ3FqUKDwM57GM4io6JGcStivT8UdGt67PEOihLZTw3P7371+N47PrmsCpnTRzbTgcupKtUv8ImZalYk65dU8rjC/ridwhw9ffW2LBwvkEnDkkKKRi2liWIItDftJVBiWOh17o6gfbPoNrWORcAdcbpk2L+udld5kZNwIDAQAB",
_0x4995b7 = "-----BEGIN PUBLIC KEY-----\n" + _0x516f15 + "\n-----END PUBLIC KEY-----",
_0x51cf70 = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDIPOHtjs6p4sTlpFvrx+ESsYkEvyT4JB/dcEbU6C8+yclpcmWEvwZFymqlKQq89laSH4IxUsPJHKIOiYAMzNibhED1swzecH5XLKEAJclopJqoO95o8W63Euq6K+AKMzyZt1SEqtZ0mXsN8UPnuN/5aoB3kbPLYpfEwBbhto6yrwIDAQAB",
_0x2e5ddf = "-----BEGIN PUBLIC KEY-----\n" + _0x51cf70 + "\n-----END PUBLIC KEY-----",
_0xc38e90 = require("node-rsa");
let _0x13a631 = new _0xc38e90(_0x1e9565);
const _0x4386dc = {
"encryptionScheme": "pkcs1"
};
_0x13a631.setOptions(_0x4386dc);
let _0x47bb4b = new _0xc38e90(_0x4995b7);
const _0xe2cacf = {
"encryptionScheme": "pkcs1"
};
_0x47bb4b.setOptions(_0xe2cacf);
let _0x5b4189 = new _0xc38e90(_0x2e5ddf);
const _0x3ab892 = {
"encryptionScheme": "pkcs1"
};
_0x5b4189.setOptions(_0x3ab892);
const _0x131d2d = [202201, 202202, 202203],
_0x3c685e = 5;
function _0x1519a6(_0x5771d9, _0x450cac, _0x2c564d, _0x433dc7, _0x39c4aa, _0x4504ac) {
return _0x5e650c[_0x5771d9].encrypt(_0x5e650c.enc.Utf8.parse(_0x433dc7), _0x5e650c.enc.Utf8.parse(_0x39c4aa), {
"mode": _0x5e650c.mode[_0x450cac],
"padding": _0x5e650c.pad[_0x2c564d],
"iv": _0x5e650c.enc.Utf8.parse(_0x4504ac)
}).ciphertext.toString(_0x5e650c.enc.Hex);
}
function _0x436a1e(_0x28a0ac, _0x359609, _0x282bea, _0x53ad35, _0x1dcccf, _0x387c88) {
return _0x5e650c[_0x28a0ac].decrypt({
"ciphertext": _0x5e650c.enc.Hex.parse(_0x53ad35)
}, _0x5e650c.enc.Utf8.parse(_0x1dcccf), {
"mode": _0x5e650c.mode[_0x359609],
"padding": _0x5e650c.pad[_0x282bea],
"iv": _0x5e650c.enc.Utf8.parse(_0x387c88)
}).toString(_0x5e650c.enc.Utf8);
}
function _0x4e4355() {
try {
_0x5336b3.writeFileSync(_0x5370da, JSON.stringify(_0x1d3d6d, null, 4), "utf-8");
} catch (_0x345e13) {
console.log("保存缓存出错");
}
}
function _0xa0ff1b() {
try {
_0x1d3d6d = JSON.parse(_0x5336b3.readFileSync(_0x5370da, "utf-8"));
} catch (_0x27edaf) {
console.log("读取缓存出错, 新建一个token缓存");
_0x4e4355();
}
}
let _0x300c8e = 0,
_0xdb6efe = 0;
function _0x11cae0() {
_0xdb6efe = 1;
process.on("SIGTERM", () => {
_0xdb6efe = 2;
process.exit(0);
});
const _0x15d402 = _0x203c4a.basename(process.argv[1]),
_0x55a240 = ["bash", "timeout", "grep"];
let _0x517188 = ["ps afx"];
_0x517188.push("grep " + _0x15d402);
_0x517188 = _0x517188.concat(_0x55a240.map(_0x376a17 => "grep -v \"" + _0x376a17 + " \""));
_0x517188.push("wc -l");
const _0x2f47c6 = _0x517188.join("|"),
_0x8109 = () => {
_0x3898d1(_0x2f47c6, (_0x3db287, _0x30373e, _0x39f532) => {
if (_0x3db287 || _0x39f532) return;
_0x300c8e = parseInt(_0x30373e.trim(), 10);
});
_0xdb6efe == 1 && setTimeout(_0x8109, 2000);
};
_0x8109();
}
class _0x9d1851 {
constructor() {
this.index = _0x49dfef.userIdx++;
this.name = "";
this.valid = false;
const _0x2c28d7 = {
"limit": 0
},
_0x2c4edd = {
"Connection": "keep-alive"
},
_0x5069eb = {
"retry": _0x2c28d7,
"timeout": _0x128624,
"followRedirect": false,
"ignoreInvalidCookies": true,
"headers": _0x2c4edd
};
this.got = _0x8e0885.extend(_0x5069eb);
_0xdb6efe == 0 && _0x11cae0();
}
["log"](_0x493cba, _0x452fe5 = {}) {
var _0x567ff8 = "",
_0x1d5ec0 = _0x49dfef.userCount.toString().length;
this.index && (_0x567ff8 += "账号[" + _0x49dfef.padStr(this.index, _0x1d5ec0) + "]");
this.name && (_0x567ff8 += "[" + this.name + "]");
_0x49dfef.log(_0x567ff8 + _0x493cba, _0x452fe5);
}
["set_cookie"](_0x5a17b2, _0x55db68, _0x11f17c, _0x1e7a6c, _0x3e9954 = {}) {
this.cookieJar.setCookieSync(_0x5a17b2 + "=" + _0x55db68 + "; Domain=" + _0x11f17c + ";", "" + _0x1e7a6c);
}
async ["request"](_0x5dffd5) {
const _0x37ac5c = ["ECONNRESET", "EADDRINUSE", "ENOTFOUND", "EAI_AGAIN"],
_0x2b4fd1 = ["TimeoutError"],
_0xab6ac9 = ["EPROTO"],
_0x875994 = [];
var _0x2ae6b5 = null,
_0x588da8 = 0,
_0x2c97d1 = _0x5dffd5.fn || _0x5dffd5.url;
let _0x5dfd65 = _0x49dfef.get(_0x5dffd5, "valid_code", _0x875994);
_0x5dffd5.method = _0x5dffd5?.["method"]?.["toUpperCase"]() || "GET";
let _0x3173c7, _0x2d079a;
while (_0x588da8 < _0x5a04a9) {
try {
_0x588da8++;
_0x3173c7 = "";
_0x2d079a = "";
let _0x56da93 = null,
_0x20fa96 = _0x5dffd5?.["timeout"] || this.got?.["defaults"]?.["options"]?.["timeout"]?.["request"] || _0x128624,
_0x372157 = false,
_0x329022 = Math.max(this.index - 2, 0),
_0xae873a = Math.min(Math.max(this.index - 3, 1), 3),
_0x1df6bf = Math.min(Math.max(this.index - 4, 1), 4),
_0x3dd9a2 = _0x329022 * _0xae873a * _0x1df6bf * 400,
_0x5c8e85 = _0x329022 * _0xae873a * _0x1df6bf * 1800,
_0x168d1c = _0x3dd9a2 + Math.floor(Math.random() * _0x5c8e85),
_0x43a74c = _0x300c8e * (_0x300c8e - 1) * 2000,
_0x6f7cc7 = (_0x300c8e - 1) * (_0x300c8e - 1) * 2000,
_0x410dd7 = _0x43a74c + Math.floor(Math.random() * _0x6f7cc7),
_0x37f92f = Math.max(_0x49dfef.userCount - 2, 0),
_0x29c518 = Math.max(_0x49dfef.userCount - 3, 0),
_0x4d7ea4 = _0x37f92f * 200,
_0x428995 = _0x29c518 * 400,
_0x5c5b4c = _0x4d7ea4 + Math.floor(Math.random() * _0x428995),
_0x169ad4 = _0x168d1c + _0x410dd7 + _0x5c5b4c;
await _0x49dfef.wait(_0x169ad4);
await new Promise(async _0x3fddf4 => {
setTimeout(() => {
_0x372157 = true;
_0x3fddf4();
}, _0x20fa96);
await this.got(_0x5dffd5).then(_0x209b82 => {
_0x2ae6b5 = _0x209b82;
}, _0x41c3d2 => {
_0x56da93 = _0x41c3d2;
_0x2ae6b5 = _0x41c3d2.response;
_0x3173c7 = _0x56da93?.["code"] || "";
_0x2d079a = _0x56da93?.["name"] || "";
});
_0x3fddf4();
});
if (_0x372157) this.log("[" + _0x2c97d1 + "]请求超时(" + _0x20fa96 / 1000 + "秒),重试第" + _0x588da8 + "次");else {
if (_0xab6ac9.includes(_0x3173c7)) {
this.log("[" + _0x2c97d1 + "]请求错误[" + _0x3173c7 + "][" + _0x2d079a + "]");
if (_0x56da93?.["message"]) {
console.log(_0x56da93.message);
}
break;
} else {
if (_0x2b4fd1.includes(_0x2d079a)) {
this.log("[" + _0x2c97d1 + "]请求错误[" + _0x3173c7 + "][" + _0x2d079a + "],重试第" + _0x588da8 + "次");
} else {
if (_0x37ac5c.includes(_0x3173c7)) {
this.log("[" + _0x2c97d1 + "]请求错误[" + _0x3173c7 + "][" + _0x2d079a + "],重试第" + _0x588da8 + "次");
} else {
let _0x33b70b = _0x2ae6b5?.["statusCode"] || "",
_0x289577 = _0x33b70b / 100 | 0;
if (_0x33b70b) {
_0x289577 > 3 && !_0x5dfd65.includes(_0x33b70b) && (_0x33b70b ? this.log("请求[" + _0x2c97d1 + "]返回[" + _0x33b70b + "]") : this.log("请求[" + _0x2c97d1 + "]错误[" + _0x3173c7 + "][" + _0x2d079a + "]"));
if (_0x289577 <= 4) break;
} else this.log("请求[" + _0x2c97d1 + "]错误[" + _0x3173c7 + "][" + _0x2d079a + "]");
}
}
}
}
} catch (_0x4c3a90) {
_0x4c3a90.name == "TimeoutError" ? this.log("[" + _0x2c97d1 + "]请求超时,重试第" + _0x588da8 + "次") : this.log("[" + _0x2c97d1 + "]请求错误(" + _0x4c3a90.message + "),重试第" + _0x588da8 + "次");
}
}
const _0x493b70 = {
"statusCode": _0x3173c7 || -1,
"headers": null,
"result": null
};
if (_0x2ae6b5 == null) {
return Promise.resolve(_0x493b70);
}
let {
statusCode: _0x307ac9,
headers: _0x5205ad,
body: _0x3a9f48
} = _0x2ae6b5;
if (_0x3a9f48) {
try {
_0x3a9f48 = JSON.parse(_0x3a9f48);
} catch {}
}
const _0x37c203 = {
"statusCode": _0x307ac9,
"headers": _0x5205ad,
"result": _0x3a9f48
};
return Promise.resolve(_0x37c203);
}
}
let _0x280825 = _0x9d1851;
try {
let _0x236d58 = require("./LocalBasic");
_0x280825 = _0x236d58;
} catch {}
let _0x3b1630 = new _0x280825(_0x49dfef);
class _0x3f433d extends _0x280825 {
constructor(_0x4802c1) {
super(_0x49dfef);
let _0x2a7cbd = _0x4802c1.split("#");
this.name = _0x2a7cbd[0];
this.passwd = _0x2a7cbd?.[1] || "";
this.uuid = [_0x49dfef.randomPattern("xxxxxxxx"), _0x49dfef.randomPattern("xxxx"), _0x49dfef.randomPattern("4xxx"), _0x49dfef.randomPattern("xxxx"), _0x49dfef.randomPattern("xxxxxxxxxxxx")];
this.cookieJar = new _0x4f58d7();
this.can_feed = true;
this.jml_tokenFlag = "";
this.mall_token = "";
const _0xf01b6c = {
"Connection": "keep-alive",
"User-Agent": _0x3ed712
};
this.got = this.got.extend({
"cookieJar": this.cookieJar,
"headers": _0xf01b6c
});
}
["load_token"]() {
let _0x14cf8a = false;
return _0x1d3d6d[this.name] && (this.userId = _0x1d3d6d[this.name].userId, this.token = _0x1d3d6d[this.name].token, this.log("读取到缓存token"), _0x14cf8a = true), _0x14cf8a;
}
["encode_phone"]() {
let _0x266210 = this.name.split("");
for (let _0x5f797f in _0x266210) {
_0x266210[_0x5f797f] = String.fromCharCode(_0x266210[_0x5f797f].charCodeAt(0) + 2);
}
return _0x266210.join("");
}
["encode_aes"](_0x47873f) {
return _0x1519a6("AES", "ECB", "Pkcs7", _0x47873f, _0x75a069, 0);
}
["get_mall_headers"]() {
return {
"Content-Type": "application/json;charset=utf-8",
"Accept": "application/json, text/javascript, */*; q=0.01",
"Authorization": this.mall_token ? "Bearer " + this.mall_token : "",
"X-Requested-With": "XMLHttpRequest"
};
}
async ["login"](_0x568c8f = {}) {
let _0x172a21 = false;
try {
let _0x4709da = _0x49dfef.time("yyyyMMddhhmmss"),
_0x21d997 = "iPhone 14 15.4." + this.uuid.slice(0, 2).join("") + this.name + _0x4709da + this.passwd + "0$$$0.",
_0x1b5e27 = {
"fn": "login",
"method": "post",
"url": "https://appgologin.189.cn:9031/login/client/userLoginNormal",
"json": {
"headerInfos": {
"code": "userLoginNormal",
"timestamp": _0x4709da,
"broadAccount": "",
"broadToken": "",
"clientType": "#9.6.1#channel50#iPhone 14 Pro Max#",
"shopId": "20002",
"source": "110003",
"sourcePassword": "Sid98s",
"token": "",
"userLoginName": this.name
},
"content": {
"attach": "test",
"fieldData": {
"loginType": "4",
"accountType": "",
"loginAuthCipherAsymmertric": _0x13a631.encrypt(_0x21d997, "base64"),
"deviceUid": this.uuid.slice(0, 3).join(""),
"phoneNum": this.encode_phone(),
"isChinatelecom": "0",
"systemVersion": "15.4.0",
"authentication": this.passwd
}
}
}
},
{
result: _0x44e3e2,
statusCode: _0x15338e
} = await this.request(_0x1b5e27),
_0x5d0534 = _0x49dfef.get(_0x44e3e2?.["responseData"], "resultCode", -1);
console.log("Request Content:", requestBody.content);
if (_0x5d0534 == "0000") {
let {
userId = "",
token = ""
} = _0x44e3e2?.["responseData"]?.["data"]?.["loginSuccessResult"] || {};
this.userId = userId;
this.token = token;
this.log("使用服务密码登录成功");
_0x1d3d6d[this.name] = {
"token": token,
"userId": userId,
"t": Date.now()
};
_0x4e4355();
_0x172a21 = true;
} else {
let _0x4d711e = _0x44e3e2?.["msg"] || _0x44e3e2?.["responseData"]?.["resultDesc"] || _0x44e3e2?.["headerInfos"]?.["reason"] || "";
this.log("服务密码登录失败[" + _0x5d0534 + "]: " + _0x4d711e);
}
} catch (_0x2334e8) {
console.log(_0x2334e8);
} finally {
return _0x172a21;
}
}
async ["get_ticket"](_0x292809 = {}) {
let _0x3ff995 = "";
try {
let _0x495fa7 = "\n <Request>\n <HeaderInfos>\n <Code>getSingle</Code>\n <Timestamp>" + _0x49dfef.time("yyyyMMddhhmmss") + "</Timestamp>\n <BroadAccount></BroadAccount>\n <BroadToken></BroadToken>\n <ClientType>#9.6.1#channel50#iPhone 14 Pro Max#</ClientType>\n <ShopId>20002</ShopId>\n <Source>110003</Source>\n <SourcePassword>Sid98s</SourcePassword>\n <Token>" + this.token + "</Token>\n <UserLoginName>" + this.name + "</UserLoginName>\n </HeaderInfos>\n <Content>\n <Attach>test</Attach>\n <FieldData>\n <TargetId>" + _0x1519a6("TripleDES", "CBC", "Pkcs7", this.userId, _0x2304b1, _0x1110eb) + "</TargetId>\n <Url>4a6862274835b451</Url>\n </FieldData>\n </Content>\n </Request>";
const _0xd42d5c = {
"fn": "get_ticket",
"method": "post",
"url": "https://appgologin.189.cn:9031/map/clientXML",
"body": _0x495fa7
};
let {
result: _0x364c7d,
statusCode: _0xd880be
} = await this.request(_0xd42d5c);
if (_0x364c7d) {
let _0x18bfb2 = _0x364c7d.match(/\<Ticket\>(\w+)\<\/Ticket\>/);
if (_0x18bfb2) {
let _0x33b8c5 = _0x18bfb2[1];
_0x3ff995 = _0x436a1e("TripleDES", "CBC", "Pkcs7", _0x33b8c5, _0x2304b1, _0x1110eb);
this.ticket = _0x3ff995;
}
}
!_0x3ff995 && (!_0x292809.retry && (await this.login()) ? (_0x292809.retry = true, _0x3ff995 = await this.get_ticket(_0x292809)) : (this.log("没有获取到ticket[" + _0xd880be + "]: "), _0x364c7d && this.log(": " + JSON.stringify(_0x364c7d))));
} catch (_0x28f8f2) {
console.log(_0x28f8f2);
} finally {
return _0x3ff995;
}
}
async ["get_sign"](_0xd5e98b = {}) {
let _0x3728d3 = false;
try {
const _0x228472 = {
"ticket": this.ticket
},
_0x1dce3c = {
"fn": "login",
"method": "get",
"url": "https://wapside.189.cn:9001/jt-sign/ssoHomLogin",
"searchParams": _0x228472
};
let {
result: _0x5b193e,
statusCode: _0x5f0725
} = await this.request(_0x1dce3c),
_0x29efdb = _0x49dfef.get(_0x5b193e, "resoultCode", _0x5f0725);
_0x29efdb == 0 ? (_0x3728d3 = _0x5b193e?.["sign"], this.sign = _0x3728d3, this.got = this.got.extend({
"headers": {
"sign": this.sign
}
})) : this.log("获取sign失败[" + _0x29efdb + "]: " + _0x5b193e);
} catch (_0x2f28bb) {
console.log(_0x2f28bb);
} finally {
return _0x3728d3;
}
}
["encrypt_para"](_0x2ea382) {
let _0x4ed84a = typeof _0x2ea382 == "string" ? _0x2ea382 : JSON.stringify(_0x2ea382);
return _0x47bb4b.encrypt(_0x4ed84a, "hex");
}
async ["userCoinInfo"](_0x124ec9 = false, _0x1a1cc3 = {}) {
try {
const _0x374d94 = {
"phone": this.name
};
let _0x4e6fdd = {
"fn": "userCoinInfo",
"method": "post",
"url": "https://wapside.189.cn:9001/jt-sign/api/home/userCoinInfo",
"json": {
"para": this.encrypt_para(_0x374d94)
}
},
{
result: _0x32da86,
statusCode: _0x1e20fc
} = await this.request(_0x4e6fdd),
_0x416871 = _0x49dfef.get(_0x32da86, "resoultCode", _0x1e20fc);
if (_0x416871 == 0) {
this.coin = _0x32da86?.["totalCoin"] || 0;
if (_0x124ec9) {
const _0x4aa23f = {
"notify": true
};
this.log("金豆余额: " + this.coin, _0x4aa23f);
if (_0x32da86.amountEx) {
let _0x1afe63 = _0x49dfef.time("yyyy-MM-dd", _0x32da86.expireDate);
const _0x171701 = {
"notify": true
};
_0x49dfef.log("-- [" + _0x1afe63 + "]将过期" + _0x32da86.amountEx + "金豆", _0x171701);
}
}
} else {
let _0x5dd2dd = _0x32da86?.["msg"] || _0x32da86?.["resoultMsg"] || _0x32da86?.["error"] || "";
this.log("查询账户金豆余额错误[" + _0x416871 + "]: " + _0x5dd2dd);
}
} catch (_0x46ed9f) {
console.log(_0x46ed9f);
}
}
async ["userStatusInfo"](_0xc9a8b1 = {}) {
try {
const _0x27024b = {
"phone": this.name
};
let _0x46d7e7 = {
"fn": "userStatusInfo",
"method": "post",
"url": "https://wapside.189.cn:9001/jt-sign/api/home/userStatusInfo",
"json": {
"para": this.encrypt_para(_0x27024b)
}
};
{
let {
result: _0x7c79f6,
statusCode: _0x5610ae
} = await this.request(_0x49dfef.copy(_0x46d7e7)),
_0x4b983e = _0x49dfef.get(_0x7c79f6, "resoultCode", _0x5610ae);
if (_0x4b983e == 0) {
let {
isSign: _0x577fdd
} = _0x7c79f6?.["data"];
_0x577fdd ? this.log("今天已签到") : await this.doSign();
} else {
let _0x16239c = _0x7c79f6?.["msg"] || _0x7c79f6?.["resoultMsg"] || _0x7c79f6?.["error"] || "";
this.log("查询账户签到状态错误[" + _0x4b983e + "]: " + _0x16239c);
}
}
{
let {
result: _0x2cb917,
statusCode: _0x42a823
} = await this.request(_0x49dfef.copy(_0x46d7e7)),
_0x11fe96 = _0x49dfef.get(_0x2cb917, "resoultCode", _0x42a823);
if (_0x11fe96 == 0) {
let {
continuousDay: _0xf63027,
signDay: _0x5a3e70,
isSeven: _0x434ea0
} = _0x2cb917?.["data"];
this.log("已签到" + _0x5a3e70 + "天, 连签" + _0xf63027 + "天");
_0x434ea0 && (await this.exchangePrize());
} else {
let _0x57bd0e = _0x2cb917?.["msg"] || _0x2cb917?.["resoultMsg"] || _0x2cb917?.["error"] || "";
this.log("查询账户签到状态错误[" + _0x11fe96 + "]: " + _0x57bd0e);
}
}
} catch (_0x70a9ad) {
console.log(_0x70a9ad);
}
}
async ["continueSignDays"](_0x57126c = {}) {
try {
const _0x1396f4 = {
"phone": this.name
};
let _0x40ec16 = {
"fn": "continueSignDays",
"method": "post",
"url": "https://wapside.189.cn:9001/jt-sign/webSign/continueSignDays",
"json": {
"para": this.encrypt_para(_0x1396f4)
}
},
{
result: _0xd56803,
statusCode: _0x133cba
} = await this.request(_0x40ec16),
_0x5ecdbe = _0x49dfef.get(_0xd56803, "resoultCode", _0x133cba);
if (_0x5ecdbe == 0) {
this.log("抽奖连签天数: " + (_0xd56803?.["continueSignDays"] || 0) + "天");
if (_0xd56803?.["continueSignDays"] == 15) {
const _0x1e4b5b = {
"type": "15"
};
await this.exchangePrize(_0x1e4b5b);
} else {
if (_0xd56803?.["continueSignDays"] == 28) {
const _0x5bc07e = {
"type": "28"
};
await this.exchangePrize(_0x5bc07e);
}
}
} else {
let _0x4e6817 = _0xd56803?.["msg"] || _0xd56803?.["resoultMsg"] || _0xd56803?.["error"] || "";
this.log("查询抽奖连签天数错误[" + _0x5ecdbe + "]: " + _0x4e6817);
}
} catch (_0x52cdc8) {
console.log(_0x52cdc8);
}
}
async ["continueSignRecords"](_0x2891d4 = {}) {
try {
const _0x2228e1 = {
"phone": this.name
};
let _0x49e887 = {
"fn": "continueSignRecords",
"method": "post",
"url": "https://wapside.189.cn:9001/jt-sign/webSign/continueSignRecords",
"json": {
"para": this.encrypt_para(_0x2228e1)
}
},
{
result: _0x1dd52d,
statusCode: _0x274d64
} = await this.request(_0x49e887),
_0xb167e6 = _0x49dfef.get(_0x1dd52d, "resoultCode", _0x274d64);
if (_0xb167e6 == 0) {
if (_0x1dd52d?.["continue15List"]?.["length"]) {
const _0x16fcf5 = {
"type": "15"
};
await this.exchangePrize(_0x16fcf5);
}
if (_0x1dd52d?.["continue28List"]?.["length"]) {
const _0x52fb63 = {
"type": "28"
};
await this.exchangePrize(_0x52fb63);
}
} else {
let _0x3090eb = _0x1dd52d?.["msg"] || _0x1dd52d?.["resoultMsg"] || _0x1dd52d?.["error"] || "";
this.log("查询连签抽奖状态错误[" + _0xb167e6 + "]: " + _0x3090eb);
}
} catch (_0x2bc775) {
console.log(_0x2bc775);
}
}
async ["doSign"](_0x1b376e = {}) {
try {
let _0x3e8ed4 = {
"phone": this.name,
"date": Date.now(),
"sysType": "20002"
},
_0x405845 = {
"fn": "doSign",
"method": "post",
"url": "https://wapside.189.cn:9001/jt-sign/webSign/sign",
"json": {
"encode": this.encode_aes(JSON.stringify(_0x3e8ed4))
}
},
{
result: _0x380f07,
statusCode: _0x36d52d
} = await this.request(_0x405845),
_0x3b877d = _0x49dfef.get(_0x380f07, "resoultCode", _0x36d52d);
if (_0x3b877d == 0) {
let _0x5bf6a1 = _0x49dfef.get(_0x380f07?.["data"], "code", -1);
if (_0x5bf6a1 == 1) {
const _0x13fbb6 = {
"notify": true
};
this.log("签到成功,获得" + (_0x380f07?.["data"]?.["coin"] || 0) + "金豆", _0x13fbb6);
await this.userStatusInfo();
} else {
const _0x106dcf = {
"notify": true
};
this.log("签到失败[" + _0x5bf6a1 + "]: " + _0x380f07.data.msg, _0x106dcf);
}
} else {
let _0x4cd1a1 = _0x380f07?.["msg"] || _0x380f07?.["resoultMsg"] || _0x380f07?.["error"] || "";
this.log("签到错误[" + _0x3b877d + "]: " + _0x4cd1a1);
}
} catch (_0x591e48) {
console.log(_0x591e48);
}
}
async ["exchangePrize"](_0x1959e6 = {}) {
try {
let _0x22bbfa = _0x49dfef.pop(_0x1959e6, "type", "7");
const _0x20ec8c = {
"phone": this.name,
"type": _0x22bbfa
};
let _0x1ca191 = {
"fn": "exchangePrize",
"method": "post",
"url": "https://wapside.189.cn:9001/jt-sign/webSign/exchangePrize",
"json": {
"para": this.encrypt_para(_0x20ec8c)
}
},
{
result: _0x4217e1,
statusCode: _0x4d9c82
} = await this.request(_0x1ca191),
_0x9afc2f = _0x49dfef.get(_0x4217e1, "resoultCode", _0x4d9c82);
if (_0x9afc2f == 0) {
let _0x28f1fc = _0x49dfef.get(_0x4217e1?.["prizeDetail"], "code", -1);
if (_0x28f1fc == 0) {
const _0x3a457e = {
"notify": true
};
this.log("连签" + _0x22bbfa + "天抽奖: " + _0x4217e1?.["prizeDetail"]?.["biz"]?.["winTitle"], _0x3a457e);
} else {
let _0x8e62fe = _0x4217e1?.["prizeDetail"]?.["err"] || "";
const _0x1e3693 = {
"notify": true
};
this.log("连签" + _0x22bbfa + "天抽奖失败[" + _0x28f1fc + "]: " + _0x8e62fe, _0x1e3693);
}
} else {
let _0x32f43a = _0x4217e1?.["msg"] || _0x4217e1?.["resoultMsg"] || _0x4217e1?.["error"] || "";
this.log("连签" + _0x22bbfa + "天抽奖错误[" + _0x9afc2f + "]: " + _0x32f43a);
}
} catch (_0x5751a7) {
console.log(_0x5751a7);
}
}
async ["homepage"](_0x7f393b, _0x27b6dc = {}) {
try {
const _0x91f4c = {
"phone": this.name,
"shopId": "20001",
"type": _0x7f393b
};
let _0x3c66e4 = {
"fn": "homepage",
"method": "post",
"url": "https://wapside.189.cn:9001/jt-sign/webSign/homepage",
"json": {
"para": this.encrypt_para(_0x91f4c)
}
},
{
result: _0x2bd358,
statusCode: _0x15ab0e
} = await this.request(_0x3c66e4),
_0x1ebbf3 = _0x49dfef.get(_0x2bd358, "resoultCode", _0x15ab0e);
if (_0x1ebbf3 == 0) {
let _0x31f344 = _0x49dfef.get(_0x2bd358?.["data"]?.["head"], "code", -1);
if (_0x31f344 == 0) for (let _0x1e9c0b of _0x2bd358?.["data"]?.["biz"]?.["adItems"] || []) {
if (["0", "1"].includes(_0x1e9c0b?.["taskState"])) switch (_0x1e9c0b.contentOne) {
case "3":
{
_0x1e9c0b?.["rewardId"] && (await this.receiveReward(_0x1e9c0b));
break;
}
case "5":
{
await this.openMsg(_0x1e9c0b);
break;
}
case "6":
{
await this.sharingGetGold();
break;
}
case "10":
case "13":
{
!this.xtoken && (await this.get_usercode());
this.xtoken && (await this.watchLiveInit());
break;
}
case "18":
{
await this.polymerize(_0x1e9c0b);
break;
}
default:
{
break;
}
}
} else {
let _0x24468f = _0x2bd358?.["data"]?.["head"]?.["err"] || "";
this.log("获取任务列表失败[" + _0x31f344 + "]: " + _0x24468f);
}
} else this.log("获取任务列表错误[" + _0x1ebbf3 + "]");
} catch (_0x590aa6) {
console.log(_0x590aa6);
}
}
async ["receiveReward"](_0x484772, _0x43564a = {}) {
try {
let _0x22887b = _0x484772?.["title"]?.["split"](" ")?.[0];
const _0x550f47 = {
"phone": this.name,
"rewardId": _0x484772?.["rewardId"] || ""
};
let _0x2463d2 = {
"fn": "receiveReward",
"method": "post",
"url": "https://wapside.189.cn:9001/jt-sign/paradise/receiveReward",
"json": {
"para": this.encrypt_para(_0x550f47)
}
},
{
result: _0x1de7a2,
statusCode: _0x5b6ad9
} = await this.request(_0x2463d2),
_0x124e90 = _0x49dfef.get(_0x1de7a2, "resoultCode", _0x5b6ad9);
if (_0x124e90 == 0) this.log("领取任务[" + _0x22887b + "]奖励成功: " + _0x1de7a2?.["resoultMsg"]);else {
let _0x20a521 = _0x1de7a2?.["msg"] || _0x1de7a2?.["resoultMsg"] || _0x1de7a2?.["error"] || "";
this.log("领取任务[" + _0x22887b + "]奖励错误[" + _0x124e90 + "]: " + _0x20a521);
}
} catch (_0x25a11e) {
console.log(_0x25a11e);
}
}
async ["openMsg"](_0x308623, _0x14e0b8 = {}) {
try {
let _0x435287 = _0x308623?.["title"]?.["split"](" ")?.[0];
const _0x13404e = {
"phone": this.name
};
let _0x34d20f = {
"fn": "openMsg",
"method": "post",
"url": "https://wapside.189.cn:9001/jt-sign/paradise/openMsg",
"json": {
"para": this.encrypt_para(_0x13404e)
}
},
{
result: _0x546705,
statusCode: _0x2eb743
} = await this.request(_0x34d20f),
_0x313ba3 = _0x49dfef.get(_0x546705, "resoultCode", _0x2eb743);
if (_0x313ba3 == 0) this.log("完成任务[" + _0x435287 + "]成功: " + _0x546705?.["resoultMsg"]);else {
let _0x301d94 = _0x546705?.["msg"] || _0x546705?.["resoultMsg"] || _0x546705?.["error"] || "";
this.log("完成任务[" + _0x435287 + "]错误[" + _0x313ba3 + "]: " + _0x301d94);
}
} catch (_0x47faa9) {
console.log(_0x47faa9);
}
}
async ["polymerize"](_0x7882f8, _0x3307f2 = {}) {
try {
let _0x57f3b6 = _0x7882f8?.["title"]?.["split"](" ")?.[0];
const _0x588ba0 = {
"phone": this.name,
"jobId": _0x7882f8.taskId
};
let _0x32f651 = {
"fn": "polymerize",
"method": "post",
"url": "https://wapside.189.cn:9001/jt-sign/webSign/polymerize",
"json": {
"para": this.encrypt_para(_0x588ba0)
}
},
{
result: _0x55f4ae,
statusCode: _0x12bcb6
} = await this.request(_0x32f651),
_0xe96682 = _0x49dfef.get(_0x55f4ae, "resoultCode", _0x12bcb6);
if (_0xe96682 == 0) this.log("完成任务[" + _0x57f3b6 + "]成功: " + _0x55f4ae?.["resoultMsg"]);else {
let _0x3c85b6 = _0x55f4ae?.["msg"] || _0x55f4ae?.["resoultMsg"] || _0x55f4ae?.["error"] || "";
this.log("完成任务[" + _0x57f3b6 + "]错误[" + _0xe96682 + "]: " + _0x3c85b6);
}
} catch (_0x364b16) {
console.log(_0x364b16);
}
}
async ["food"](_0x72be45, _0x385563 = {}) {
try {
const _0x43c1bd = {
"phone": this.name
};
let _0x222dd0 = {
"fn": "food",
"method": "post",
"url": "https://wapside.189.cn:9001/jt-sign/paradise/food",
"json": {
"para": this.encrypt_para(_0x43c1bd)
}
},
{
result: _0x57feb0,
statusCode: _0x11f22b
} = await this.request(_0x222dd0),
_0x5ef41d = _0x49dfef.get(_0x57feb0, "resoultCode", _0x11f22b);
if (_0x5ef41d == 0) {
this.log("第" + _0x72be45 + "次喂食: " + (_0x57feb0?.["resoultMsg"] || "成功"));
if (_0x57feb0?.["levelUp"]) {
let _0x4ca17a = _0x57feb0?.["currLevelRightList"][0]?.["level"];
const _0xd3dda5 = {
"notify": true
};
this.log("宠物已升级到[LV." + _0x4ca17a + "], 获得: " + _0x57feb0?.["currLevelRightList"][0]?.["righstName"], _0xd3dda5);
}
} else {
let _0x5ba722 = _0x57feb0?.["msg"] || _0x57feb0?.["resoultMsg"] || _0x57feb0?.["error"] || "";
this.log("第" + _0x72be45 + "次喂食失败[" + _0x5ef41d + "]: " + _0x5ba722);
_0x5ba722?.["includes"]("最大喂食次数") && (this.can_feed = false);
}
} catch (_0x27040d) {
console.log(_0x27040d);
}
}
async ["getParadiseInfo"](_0x4d05b5 = {}) {
try {
const _0x125538 = {
"phone": this.name
};
let _0x270bb1 = {
"fn": "getParadiseInfo",
"method": "post",
"url": "https://wapside.189.cn:9001/jt-sign/paradise/getParadiseInfo",
"json": {
"para": this.encrypt_para(_0x125538)
}
};
{
let {
result: _0x364c07,
statusCode: _0xcdef27
} = await this.request(_0x270bb1),
_0x48e40c = _0x49dfef.get(_0x364c07, "resoultCode", _0xcdef27);
if (_0x48e40c == 0) {
let _0x4a27b8 = _0x364c07?.["userInfo"]?.["levelInfoMap"];
this.level = _0x4a27b8?.["level"];
for (let _0xfc2d56 = 1; _0xfc2d56 <= 10 && this.can_feed; _0xfc2d56++) {
await this.food(_0xfc2d56);
}
} else {
let _0x10b0a2 = _0x364c07?.["msg"] || _0x364c07?.["resoultMsg"] || _0x364c07?.["error"] || "";
this.log("查询宠物等级失败[" + _0x48e40c + "]: " + _0x10b0a2);
return;
}
}
{
let {
result: _0x2d4c9d,
statusCode: _0x32822d
} = await this.request(_0x270bb1),
_0x33231c = _0x49dfef.get(_0x2d4c9d, "resoultCode", _0x32822d);
if (_0x33231c == 0) {
let _0x587dfa = _0x2d4c9d?.["userInfo"]?.["levelInfoMap"];
this.level = _0x587dfa?.["level"];
const _0x4a392a = {
"notify": true
};
this.log("宠物等级[Lv." + _0x587dfa?.["level"] + "], 升级进度: " + _0x587dfa?.["growthValue"] + "/" + _0x587dfa?.["fullGrowthCoinValue"], _0x4a392a);
} else {
let _0xc04dee = _0x2d4c9d?.["msg"] || _0x2d4c9d?.["resoultMsg"] || _0x2d4c9d?.["error"] || "";
this.log("查询宠物等级失败[" + _0x33231c + "]: " + _0xc04dee);
return;
}
}
} catch (_0x4f7ada) {
console.log(_0x4f7ada);
}
}
async ["getLevelRightsList"](_0x25055f = {}) {
try {
const _0xd28e8a = {
"phone": this.name
};
let _0x8f5d11 = {
"fn": "getLevelRightsList",
"method": "post",
"url": "https://wapside.189.cn:9001/jt-sign/paradise/getLevelRightsList",
"json": {
"para": this.encrypt_para(_0xd28e8a)
}
},
{
result: _0x364382,
statusCode: _0x49ed45
} = await this.request(_0x8f5d11);
if (_0x364382?.["currentLevel"]) {
let _0x51ee3a = _0x364382?.["currentLevel"] || 6,
_0x1a4b17 = false,
_0x3a1b27 = "V" + _0x51ee3a;
for (let _0x2f7780 of _0x364382[_0x3a1b27] || []) {
let _0x583017 = _0x2f7780?.["righstName"] || "";
if (this.coin < _0x2f7780.costCoin) continue;
(_0x583017?.["match"](/\d+元话费/) || _0x583017?.["match"](/专享\d+金豆/)) && (await this.getConversionRights(_0x2f7780, _0x1a4b17)) && (_0x1a4b17 = true);
}
} else {
let _0x369c9d = _0x364382?.["msg"] || _0x364382?.["resoultMsg"] || _0x364382?.["error"] || "";
this.log("查询宠物兑换权益失败: " + _0x369c9d);
}
} catch (_0x2b311a) {
console.log(_0x2b311a);
}
}
async ["getConversionRights"](_0x4ff23b, _0x4050ac, _0x214824 = {}) {
let _0x454e1a = false;
try {
let _0x3ea063 = _0x4ff23b?.["righstName"] || "";
const _0x404f21 = {
"phone": this.name,
"rightsId": _0x4ff23b.id,
"receiveCount": _0x4ff23b.receiveType
};
let _0x3098ed = {
"fn": "getConversionRights",
"method": "post",
"url": "https://wapside.189.cn:9001/jt-sign/paradise/getConversionRights",
"json": {
"para": this.encrypt_para(_0x404f21)
}
},
{
result: _0x269ce8,
statusCode: _0x209b41
} = await this.request(_0x3098ed),
_0x411acf = _0x49dfef.get(_0x269ce8, "code", _0x49dfef.get(_0x269ce8, "resoultCode", _0x209b41));
if (_0x411acf == 200) !(_0x269ce8?.["rightsStatus"]?.["includes"]("已兑换") || _0x269ce8?.["rightsStatus"]?.["includes"]("已领取")) && (_0x454e1a = true, _0x4050ac && (await _0x49dfef.wait(3000)), await this.conversionRights(_0x4ff23b));else {
let _0x465ea5 = _0x269ce8?.["msg"] || _0x269ce8?.["resoultMsg"] || _0x269ce8?.["error"] || "";
this.log("查询权益[" + _0x3ea063 + "]失败[" + _0x411acf + "]: " + _0x465ea5);
}
} catch (_0x4b949e) {
console.log(_0x4b949e);
} finally {
return _0x454e1a;
}
}
async ["conversionRights"](_0xd4165b, _0x5b8c93 = {}) {
try {
let _0x5e50ea = _0xd4165b?.["righstName"] || "";
const _0x53587c = {
"phone": this.name,
"rightsId": _0xd4165b.id