-
Notifications
You must be signed in to change notification settings - Fork 309
/
dianxin.js
1985 lines (1965 loc) · 81.2 KB
/
dianxin.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
//变量名chinaTelecomAccount
//let ruishuApi = 'http://192.168.31.197:1257'
//搭建DOCKER 瑞数API
//docker run -d --name ruishu -p 1257:1257 yanyu.icu/smallfawn/ruishu
//改为自己的DOCKER地址
//青龙环境防止SSL报错
//export NODE_OPTIONS="${NODE_OPTIONS} --tls-cipher-list=DEFAULT@SECLEVEL=0"
let ruishuApi = 'http://192.168.31.197:1257'
const _0x49dfef = _0x5370a4("电信营业厅");
const _0x8e0885 = require("got");
const _0x203c4a = require("path");
const {
exec: _0x3898d1
} = require("child_process");
const {
CookieJar: _0x4f58d7
} = require("tough-cookie");
let cookieString
const _0x5336b3 = require("fs");
const _0x5e650c = require("crypto-js");
const _0x22f09c = "chinaTelecom";
const _0x1876a7 = /[\n\&\@]/;
const _0x4aec53 = [_0x22f09c + "Account"];
const _0x128624 = 30000;
const _0x5a04a9 = 3;
const _0x1736e2 = _0x22f09c + "Rpc";
const _0x16d3ea = process.env[_0x1736e2];
const _0xf4231c = 6.02;
const _0x14f289 = "chinaTelecom";
const _0x100b57 = "https://leafxcy.coding.net/api/user/leafxcy/project/validcode/shared-depot/validCode/git/blob/master/code.json";
const _0x344953 = "JinDouMall";
let _0x1d3d6d = {};
const _0x5370da = "./chinaTelecom_cache.json";
const _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";
const _0x75a069 = "34d7cb0bcdf07523";
const _0x2304b1 = "1234567`90koiuyhgtfrdewsaqaqsqde";
const _0x1110eb = "\0\0\0\0\0\0\0\0";
const _0x3c561e = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDBkLT15ThVgz6/NOl6s8GNPofdWzWbCkWnkaAm7O2LjkM1H7dMvzkiqdxU02jamGRHLX/ZNMCXHnPcW/sDhiFCBN18qFvy8g6VYb9QtroI09e176s+ZCtiv7hbin2cCTj99iUpnEloZm19lwHyo69u5UMiPMpq0/XKBO8lYhN/gwIDAQAB";
const _0x1e9565 = "-----BEGIN PUBLIC KEY-----\n" + _0x3c561e + "\n-----END PUBLIC KEY-----";
const _0x516f15 = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC+ugG5A8cZ3FqUKDwM57GM4io6JGcStivT8UdGt67PEOihLZTw3P7371+N47PrmsCpnTRzbTgcupKtUv8ImZalYk65dU8rjC/ridwhw9ffW2LBwvkEnDkkKKRi2liWIItDftJVBiWOh17o6gfbPoNrWORcAdcbpk2L+udld5kZNwIDAQAB";
const _0x4995b7 = "-----BEGIN PUBLIC KEY-----\n" + _0x516f15 + "\n-----END PUBLIC KEY-----";
const _0x51cf70 = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDIPOHtjs6p4sTlpFvrx+ESsYkEvyT4JB/dcEbU6C8+yclpcmWEvwZFymqlKQq89laSH4IxUsPJHKIOiYAMzNibhED1swzecH5XLKEAJclopJqoO95o8W63Euq6K+AKMzyZt1SEqtZ0mXsN8UPnuN/5aoB3kbPLYpfEwBbhto6yrwIDAQAB";
const _0x2e5ddf = "-----BEGIN PUBLIC KEY-----\n" + _0x51cf70 + "\n-----END PUBLIC KEY-----";
const _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];
const _0x3c685e = 5;
function _0x1519a6(_0xa8ae5c, _0x459aac, _0x58d61f, _0xa81bc3, _0x5af061, _0x3eaf32) {
return _0x5e650c[_0xa8ae5c].encrypt(_0x5e650c.enc.Utf8.parse(_0xa81bc3), _0x5e650c.enc.Utf8.parse(_0x5af061), {
mode: _0x5e650c.mode[_0x459aac],
padding: _0x5e650c.pad[_0x58d61f],
iv: _0x5e650c.enc.Utf8.parse(_0x3eaf32)
}).ciphertext.toString(_0x5e650c.enc.Hex);
}
function _0x436a1e(_0x5007ed, _0x18814d, _0x38ebb6, _0x4281ff, _0x1bafc9, _0x3aac70) {
return _0x5e650c[_0x5007ed].decrypt({
ciphertext: _0x5e650c.enc.Hex.parse(_0x4281ff)
}, _0x5e650c.enc.Utf8.parse(_0x1bafc9), {
mode: _0x5e650c.mode[_0x18814d],
padding: _0x5e650c.pad[_0x38ebb6],
iv: _0x5e650c.enc.Utf8.parse(_0x3aac70)
}).toString(_0x5e650c.enc.Utf8);
}
function _0x4e4355() {
try {
_0x5336b3.writeFileSync(_0x5370da, JSON.stringify(_0x1d3d6d, null, 4), "utf-8");
} catch (_0x1c3791) {
console.log("保存缓存出错");
}
}
function _0xa0ff1b() {
try {
_0x1d3d6d = JSON.parse(_0x5336b3.readFileSync(_0x5370da, "utf-8"));
} catch (_0x125821) {
console.log("读取缓存出错, 新建一个token缓存");
_0x4e4355();
}
}
let _0x300c8e = 0;
let _0xdb6efe = 0;
function _0x11cae0() {
_0xdb6efe = 1;
process.on("SIGTERM", () => {
_0xdb6efe = 2;
process.exit(0);
});
const _0x377b8a = _0x203c4a.basename(process.argv[1]);
const _0x39bc5b = ["bash", "timeout", "grep"];
let _0x4fe84e = ["ps afx"];
_0x4fe84e.push("grep " + _0x377b8a);
_0x4fe84e = _0x4fe84e.concat(_0x39bc5b.map(_0x425dac => "grep -v \"" + _0x425dac + " \""));
_0x4fe84e.push("wc -l");
const _0x401932 = _0x4fe84e.join("|");
const _0x134226 = () => {
_0x3898d1(_0x401932, (_0x26b41f, _0x817890, _0x4eca1a) => {
if (_0x26b41f || _0x4eca1a) {
return;
}
_0x300c8e = parseInt(_0x817890.trim(), 10);
});
if (_0xdb6efe == 1) {
setTimeout(_0x134226, 2000);
}
};
_0x134226();
}
class _0x9d1851 {
constructor() {
this.index = _0x49dfef.userIdx++;
this.name = "";
this.valid = false;
const _0x46f57a = {
limit: 0
};
const _0x42e66e = {
Connection: "keep-alive"
};
const _0x1612bd = {
retry: _0x46f57a,
timeout: _0x128624,
followRedirect: false,
ignoreInvalidCookies: true,
headers: _0x42e66e
};
this.got = _0x8e0885.extend(_0x1612bd);
if (_0xdb6efe == 0) {
_0x11cae0();
}
}
log(_0x42a357, _0x32d0cc = {}) {
var _0x58117c = "";
var _0x9ca0e2 = _0x49dfef.userCount.toString().length;
if (this.index) {
_0x58117c += "账号[" + _0x49dfef.padStr(this.index, _0x9ca0e2) + "]";
}
if (this.name) {
_0x58117c += "[" + this.name + "]";
}
_0x49dfef.log(_0x58117c + _0x42a357, _0x32d0cc);
}
set_cookie(_0x309397, _0x3ab012, _0x4a8547, _0x1320cb, _0x482400 = {}) {
this.cookieJar.setCookieSync(_0x309397 + "=" + _0x3ab012 + "; Domain=" + _0x4a8547 + ";", "" + _0x1320cb);
}
async request(_0x29ad8a) {
const _0x58b4a1 = ["ECONNRESET", "EADDRINUSE", "ENOTFOUND", "EAI_AGAIN"];
const _0x497c09 = ["TimeoutError"];
const _0x54807f = ["EPROTO"];
const _0x30eee7 = [];
var _0x208a74 = null;
var _0x3a35d0 = 0;
var _0x1684d3 = _0x29ad8a.fn || _0x29ad8a.url;
let _0x25d788 = _0x49dfef.get(_0x29ad8a, "valid_code", _0x30eee7);
_0x29ad8a.method = _0x29ad8a?.["method"]?.["toUpperCase"]() || "GET";
let _0x19ce7b;
let _0x5c8c40;
while (_0x3a35d0 < _0x5a04a9) {
try {
_0x3a35d0++;
_0x19ce7b = "";
_0x5c8c40 = "";
let _0x1fa216 = null;
let _0x123eec = _0x29ad8a?.["timeout"] || this.got?.["defaults"]?.["options"]?.["timeout"]?.["request"] || _0x128624;
let _0x34e77b = false;
let _0x5397b0 = Math.max(this.index - 2, 0);
let _0x5d25e7 = Math.min(Math.max(this.index - 3, 1), 3);
let _0x52755a = Math.min(Math.max(this.index - 4, 1), 4);
let _0x15d328 = _0x5397b0 * _0x5d25e7 * _0x52755a * 400;
let _0x2c4c80 = _0x5397b0 * _0x5d25e7 * _0x52755a * 1800;
let _0x4cfee0 = _0x15d328 + Math.floor(Math.random() * _0x2c4c80);
let _0x15dce7 = _0x300c8e * (_0x300c8e - 1) * 2000;
let _0x5ca50a = (_0x300c8e - 1) * (_0x300c8e - 1) * 2000;
let _0x333735 = _0x15dce7 + Math.floor(Math.random() * _0x5ca50a);
let _0x573d35 = Math.max(_0x49dfef.userCount - 2, 0);
let _0x25871d = Math.max(_0x49dfef.userCount - 3, 0);
let _0x34f531 = _0x573d35 * 200;
let _0x1bd293 = _0x25871d * 400;
let _0x4845e7 = _0x34f531 + Math.floor(Math.random() * _0x1bd293);
let _0x5dc50f = _0x4cfee0 + _0x333735 + _0x4845e7;
await _0x49dfef.wait(1000);
await new Promise(async _0x45b1d3 => {
setTimeout(() => {
_0x34e77b = true;
_0x45b1d3();
}, _0x123eec);
let Cookie = await this.got({
method: "post",
url: ruishuApi+"/get_cookies",
body: JSON.stringify({ response: "", url: "" })
})
let c = JSON.parse(Cookie['body'])
cookieString = Object.entries(c)
.map(([key, value]) => `${key}=${value}`)
.join('; ');
_0x29ad8a['headers'] = {}
_0x29ad8a['headers']['cookie'] = cookieString
await this.got(_0x29ad8a).then(_0x284c2a => {
_0x208a74 = _0x284c2a;
}, _0x55b6b8 => {
_0x1fa216 = _0x55b6b8;
_0x208a74 = _0x55b6b8.response;
_0x19ce7b = _0x1fa216?.["code"] || "";
_0x5c8c40 = _0x1fa216?.["name"] || "";
});
_0x45b1d3();
});
if (_0x34e77b) {
this.log("[" + _0x1684d3 + "]请求超时(" + _0x123eec / 1000 + "秒),重试第" + _0x3a35d0 + "次");
} else {
if (_0x54807f.includes(_0x19ce7b)) {
this.log("[" + _0x1684d3 + "]请求错误[" + _0x19ce7b + "][" + _0x5c8c40 + "]");
if (_0x1fa216?.["message"]) {
console.log(_0x1fa216.message);
}
break;
} else {
if (_0x497c09.includes(_0x5c8c40)) {
this.log("[" + _0x1684d3 + "]请求错误[" + _0x19ce7b + "][" + _0x5c8c40 + "],重试第" + _0x3a35d0 + "次");
} else {
if (_0x58b4a1.includes(_0x19ce7b)) {
this.log("[" + _0x1684d3 + "]请求错误[" + _0x19ce7b + "][" + _0x5c8c40 + "],重试第" + _0x3a35d0 + "次");
} else {
let _0x42b498 = _0x208a74?.["statusCode"] || "";
let _0x2ef704 = _0x42b498 / 100 | 0;
if (_0x42b498) {
_0x2ef704 > 3 && !_0x25d788.includes(_0x42b498) && (_0x42b498 ? this.log("请求[" + _0x1684d3 + "]返回[" + _0x42b498 + "]") : this.log("请求[" + _0x1684d3 + "]错误[" + _0x19ce7b + "][" + _0x5c8c40 + "]"));
if (_0x2ef704 <= 4) {
break;
}
} else {
this.log("请求[" + _0x1684d3 + "]错误[" + _0x19ce7b + "][" + _0x5c8c40 + "]");
}
}
}
}
}
} catch (_0xa3ad4) {
_0xa3ad4.name == "TimeoutError" ? this.log("[" + _0x1684d3 + "]请求超时,重试第" + _0x3a35d0 + "次") : this.log("[" + _0x1684d3 + "]请求错误(" + _0xa3ad4.message + "),重试第" + _0x3a35d0 + "次");
}
}
const _0x14f89a = {
statusCode: _0x19ce7b || -1,
headers: null,
result: null
};
if (_0x208a74 == null) {
return Promise.resolve(_0x14f89a);
}
let {
statusCode: _0x4f50c8,
headers: _0x4fdc35,
body: _0x4bfa21
} = _0x208a74;
if (_0x4bfa21) {
try {
_0x4bfa21 = JSON.parse(_0x4bfa21);
} catch { }
}
const _0x5d1199 = {
statusCode: _0x4f50c8,
headers: _0x4fdc35,
result: _0x4bfa21
};
return Promise.resolve(_0x5d1199);
}
}
let _0x280825 = _0x9d1851;
try {
let _0x236d58 = require("./LocalBasic");
_0x280825 = _0x236d58;
} catch { }
let _0x3b1630 = new _0x280825(_0x49dfef);
class _0x3f433d extends _0x280825 {
constructor(_0x5669ce) {
super(_0x49dfef);
let _0x28f602 = _0x5669ce.split("#");
this.name = _0x28f602[0];
this.passwd = _0x28f602?.[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 _0x1effd8 = {
Connection: "keep-alive",
"User-Agent": _0x3ed712
};
this.got = this.got.extend({
cookieJar: this.cookieJar,
headers: _0x1effd8
});
}
load_token() {
let _0x2f4a66 = false;
_0x1d3d6d[this.name] && (this.userId = _0x1d3d6d[this.name].userId, this.token = _0x1d3d6d[this.name].token, this.log("读取到缓存token"), _0x2f4a66 = true);
return _0x2f4a66;
}
encode_phone() {
let _0xd2389f = this.name.split("");
for (let _0x51660a in _0xd2389f) {
_0xd2389f[_0x51660a] = String.fromCharCode(_0xd2389f[_0x51660a].charCodeAt(0) + 2);
}
return _0xd2389f.join("");
}
encode_aes(_0x53e9bb) {
return _0x1519a6("AES", "ECB", "Pkcs7", _0x53e9bb, _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(_0x2971d3 = {}) {
let _0x22cd07 = false;
try {
let _0x3ae9d0 = _0x49dfef.time("yyyyMMddhhmmss");
let _0x16bc9b = "iPhone 14 15.4." + this.uuid.slice(0, 2).join("") + this.name + _0x3ae9d0 + this.passwd + "0$$$0.";
let _0x807c6e = {
fn: "login",
method: "post",
url: "https://appgologin.189.cn:9031/login/client/userLoginNormal",
json: {
headerInfos: {
code: "userLoginNormal",
timestamp: _0x3ae9d0,
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(_0x16bc9b, "base64"),
deviceUid: this.uuid.slice(0, 3).join(""),
phoneNum: this.encode_phone(),
isChinatelecom: "0",
systemVersion: "15.4.0",
authentication: this.passwd
}
}
}
};
let {
result: _0x3cbd6a,
statusCode: _0x4338ff
} = await this.request(_0x807c6e);
let _0x107431 = _0x49dfef.get(_0x3cbd6a?.["responseData"], "resultCode", -1);
if (_0x107431 == "0000") {
let {
userId = "",
token = ""
} = _0x3cbd6a?.["responseData"]?.["data"]?.["loginSuccessResult"] || {};
this.userId = userId;
this.token = token;
this.log("使用服务密码登录成功");
_0x1d3d6d[this.name] = {
token: token,
userId: userId,
t: Date.now()
};
_0x4e4355();
_0x22cd07 = true;
} else {
let _0xf8ba30 = _0x3cbd6a?.["msg"] || _0x3cbd6a?.["responseData"]?.["resultDesc"] || _0x3cbd6a?.["headerInfos"]?.["reason"] || "";
this.log("服务密码登录失败[" + _0x107431 + "]: " + _0xf8ba30);
}
} catch (_0x576f6c) {
console.log(_0x576f6c);
} finally {
return _0x22cd07;
}
}
async get_ticket(_0x3e5067 = {}) {
let _0x252ee2 = "";
try {
let _0x21dd20 = "\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>";
let _0x2990d1 = {
fn: "get_ticket",
method: "post",
url: "https://appgologin.189.cn:9031/map/clientXML",
body: _0x21dd20
};
let {
result: _0x9f4220,
statusCode: _0x1e891f
} = await this.request(_0x2990d1);
if (_0x9f4220) {
let _0x18f397 = _0x9f4220.match(/\<Ticket\>(\w+)\<\/Ticket\>/);
if (_0x18f397) {
let _0x2c4653 = _0x18f397[1];
_0x252ee2 = _0x436a1e("TripleDES", "CBC", "Pkcs7", _0x2c4653, _0x2304b1, _0x1110eb);
this.ticket = _0x252ee2;
}
}
!_0x252ee2 && (!_0x3e5067.retry && (await this.login()) ? (_0x3e5067.retry = true, _0x252ee2 = await this.get_ticket(_0x3e5067)) : (this.log("没有获取到ticket[" + _0x1e891f + "]: "), _0x9f4220 && this.log(": " + JSON.stringify(_0x9f4220))));
} catch (_0x1c9e54) {
console.log(_0x1c9e54);
} finally {
return _0x252ee2;
}
}
async get_sign(_0x9b96be = {}) {
let _0x10c0cb = false;
try {
const _0x59fe75 = {
ticket: this.ticket
};
let _0x269bf2 = {
fn: "login",
method: "get",
url: "https://wapside.189.cn:9001/jt-sign/ssoHomLogin",
searchParams: _0x59fe75
};
let {
result: _0x36bbb6,
statusCode: _0x3a8945
} = await this.request(_0x269bf2);
let _0xe3542d = _0x49dfef.get(_0x36bbb6, "resoultCode", _0x3a8945);
_0xe3542d == 0 ? (_0x10c0cb = _0x36bbb6?.["sign"], this.sign = _0x10c0cb, this.got = this.got.extend({
headers: {
sign: this.sign
}
})) : this.log("获取sign失败[" + _0xe3542d + "]: " + _0x36bbb6);
} catch (_0x44161f) {
console.log(_0x44161f);
} finally {
return _0x10c0cb;
}
}
encrypt_para(_0x217db5) {
let _0x1c768f = typeof _0x217db5 == "string" ? _0x217db5 : JSON.stringify(_0x217db5);
return _0x47bb4b.encrypt(_0x1c768f, "hex");
}
async userCoinInfo(_0x3a27b0 = false, _0x2a9f2e = {}) {
try {
let _0x12feeb = {
phone: this.name
};
let _0x55424b = {
fn: "userCoinInfo",
method: "post",
url: "https://wapside.189.cn:9001/jt-sign/api/home/userCoinInfo",
json: {
para: this.encrypt_para(_0x12feeb)
}
};
let {
result: _0x18ad00,
statusCode: _0x3e695c
} = await this.request(_0x55424b);
let _0x474131 = _0x49dfef.get(_0x18ad00, "resoultCode", _0x3e695c);
if (_0x474131 == 0) {
this.coin = _0x18ad00?.["totalCoin"] || 0;
if (_0x3a27b0) {
const _0x3a5985 = {
notify: true
};
this.log("金豆余额: " + this.coin, _0x3a5985);
if (_0x18ad00.amountEx) {
let _0x5b7bde = _0x49dfef.time("yyyy-MM-dd", _0x18ad00.expireDate);
const _0x359049 = {
notify: true
};
_0x49dfef.log("-- [" + _0x5b7bde + "]将过期" + _0x18ad00.amountEx + "金豆", _0x359049);
}
}
} else {
let _0x4e7123 = _0x18ad00?.["msg"] || _0x18ad00?.["resoultMsg"] || _0x18ad00?.["error"] || "";
this.log("查询账户金豆余额错误[" + _0x474131 + "]: " + _0x4e7123);
}
} catch (_0x4d1b75) {
console.log(_0x4d1b75);
}
}
async userStatusInfo(_0x10c627 = {}) {
try {
let _0x219924 = {
phone: this.name
};
let _0x16b897 = {
fn: "userStatusInfo",
method: "post",
url: "https://wapside.189.cn:9001/jt-sign/api/home/userStatusInfo",
json: {
para: this.encrypt_para(_0x219924)
}
};
{
let {
result: _0x39cfe5,
statusCode: _0x5e556e
} = await this.request(_0x49dfef.copy(_0x16b897));
let _0x509ab0 = _0x49dfef.get(_0x39cfe5, "resoultCode", _0x5e556e);
if (_0x509ab0 == 0) {
let {
isSign: _0x1d403c
} = _0x39cfe5?.["data"];
_0x1d403c ? this.log("今天已签到") : await this.doSign();
} else {
let _0x11bda2 = _0x39cfe5?.["msg"] || _0x39cfe5?.["resoultMsg"] || _0x39cfe5?.["error"] || "";
this.log("查询账户签到状态错误[" + _0x509ab0 + "]: " + _0x11bda2);
}
}
{
let {
result: _0xf4c969,
statusCode: _0x34b777
} = await this.request(_0x49dfef.copy(_0x16b897));
let _0x4d9c85 = _0x49dfef.get(_0xf4c969, "resoultCode", _0x34b777);
if (_0x4d9c85 == 0) {
let {
continuousDay: _0x33365d,
signDay: _0x128cf2,
isSeven: _0x3fa455
} = _0xf4c969?.["data"];
this.log("已签到" + _0x128cf2 + "天, 连签" + _0x33365d + "天");
_0x3fa455 && (await this.exchangePrize());
} else {
let _0xc36b81 = _0xf4c969?.["msg"] || _0xf4c969?.["resoultMsg"] || _0xf4c969?.["error"] || "";
this.log("查询账户签到状态错误[" + _0x4d9c85 + "]: " + _0xc36b81);
}
}
} catch (_0x103f04) {
console.log(_0x103f04);
}
}
async continueSignDays(_0x3e553e = {}) {
try {
let _0x124dfb = {
phone: this.name
};
let _0x215fff = {
fn: "continueSignDays",
method: "post",
url: "https://wapside.189.cn:9001/jt-sign/webSign/continueSignDays",
json: {
para: this.encrypt_para(_0x124dfb)
}
};
let {
result: _0x6e6187,
statusCode: _0x257d59
} = await this.request(_0x215fff);
let _0x912371 = _0x49dfef.get(_0x6e6187, "resoultCode", _0x257d59);
if (_0x912371 == 0) {
this.log("抽奖连签天数: " + (_0x6e6187?.["continueSignDays"] || 0) + "天");
if (_0x6e6187?.["continueSignDays"] == 15) {
const _0x207b02 = {
type: "15"
};
await this.exchangePrize(_0x207b02);
} else {
if (_0x6e6187?.["continueSignDays"] == 28) {
const _0x1f691c = {
type: "28"
};
await this.exchangePrize(_0x1f691c);
}
}
} else {
let _0x311a52 = _0x6e6187?.["msg"] || _0x6e6187?.["resoultMsg"] || _0x6e6187?.["error"] || "";
this.log("查询抽奖连签天数错误[" + _0x912371 + "]: " + _0x311a52);
}
} catch (_0xfe7972) {
console.log(_0xfe7972);
}
}
async continueSignRecords(_0x716c04 = {}) {
try {
let _0x353f90 = {
phone: this.name
};
let _0x3db199 = {
fn: "continueSignRecords",
method: "post",
url: "https://wapside.189.cn:9001/jt-sign/webSign/continueSignRecords",
json: {
para: this.encrypt_para(_0x353f90)
}
};
let {
result: _0xcdce9f,
statusCode: _0x167568
} = await this.request(_0x3db199);
let _0xd160b5 = _0x49dfef.get(_0xcdce9f, "resoultCode", _0x167568);
if (_0xd160b5 == 0) {
if (_0xcdce9f?.["continue15List"]?.["length"]) {
const _0x4ddf3a = {
type: "15"
};
await this.exchangePrize(_0x4ddf3a);
}
if (_0xcdce9f?.["continue28List"]?.["length"]) {
const _0x24d413 = {
type: "28"
};
await this.exchangePrize(_0x24d413);
}
} else {
let _0xa1a8c7 = _0xcdce9f?.["msg"] || _0xcdce9f?.["resoultMsg"] || _0xcdce9f?.["error"] || "";
this.log("查询连签抽奖状态错误[" + _0xd160b5 + "]: " + _0xa1a8c7);
}
} catch (_0x696f49) {
console.log(_0x696f49);
}
}
async doSign(_0x3d1e97 = {}) {
try {
let _0x2c6ae2 = {
phone: this.name,
date: Date.now(),
sysType: "20002"
};
let _0x32b4a2 = {
fn: "doSign",
method: "post",
url: "https://wapside.189.cn:9001/jt-sign/webSign/sign",
json: {
encode: this.encode_aes(JSON.stringify(_0x2c6ae2))
}
};
let {
result: _0x4a380a,
statusCode: _0x39f295
} = await this.request(_0x32b4a2);
let _0x66dfe4 = _0x49dfef.get(_0x4a380a, "resoultCode", _0x39f295);
if (_0x66dfe4 == 0) {
let _0x3199d0 = _0x49dfef.get(_0x4a380a?.["data"], "code", -1);
if (_0x3199d0 == 1) {
const _0x241cc1 = {
notify: true
};
this.log("签到成功,获得" + (_0x4a380a?.["data"]?.["coin"] || 0) + "金豆", _0x241cc1);
await this.userStatusInfo();
} else {
const _0x16b3bf = {
notify: true
};
this.log("签到失败[" + _0x3199d0 + "]: " + _0x4a380a.data.msg, _0x16b3bf);
}
} else {
let _0x48eddc = _0x4a380a?.["msg"] || _0x4a380a?.["resoultMsg"] || _0x4a380a?.["error"] || "";
this.log("签到错误[" + _0x66dfe4 + "]: " + _0x48eddc);
}
} catch (_0x3c07a4) {
console.log(_0x3c07a4);
}
}
async exchangePrize(_0x503199 = {}) {
try {
let _0x15d8af = _0x49dfef.pop(_0x503199, "type", "7");
let _0x2a4555 = {
phone: this.name,
type: _0x15d8af
};
let _0x275dee = {
fn: "exchangePrize",
method: "post",
url: "https://wapside.189.cn:9001/jt-sign/webSign/exchangePrize",
json: {
para: this.encrypt_para(_0x2a4555)
}
};
let {
result: _0x122edb,
statusCode: _0x7493f8
} = await this.request(_0x275dee);
let _0x32ecff = _0x49dfef.get(_0x122edb, "resoultCode", _0x7493f8);
if (_0x32ecff == 0) {
let _0xfbfebb = _0x49dfef.get(_0x122edb?.["prizeDetail"], "code", -1);
if (_0xfbfebb == 0) {
const _0x51aac0 = {
notify: true
};
this.log("连签" + _0x15d8af + "天抽奖: " + _0x122edb?.["prizeDetail"]?.["biz"]?.["winTitle"], _0x51aac0);
} else {
let _0x36ea79 = _0x122edb?.["prizeDetail"]?.["err"] || "";
const _0x513b8a = {
notify: true
};
this.log("连签" + _0x15d8af + "天抽奖失败[" + _0xfbfebb + "]: " + _0x36ea79, _0x513b8a);
}
} else {
let _0x2f0e88 = _0x122edb?.["msg"] || _0x122edb?.["resoultMsg"] || _0x122edb?.["error"] || "";
this.log("连签" + _0x15d8af + "天抽奖错误[" + _0x32ecff + "]: " + _0x2f0e88);
}
} catch (_0x57662f) {
console.log(_0x57662f);
}
}
async homepage(_0x5a7e8f, _0x26d9a1 = {}) {
try {
let _0x60744a = {
phone: this.name,
shopId: "20001",
type: _0x5a7e8f
};
let _0x5a9f66 = {
fn: "homepage",
method: "post",
url: "https://wapside.189.cn:9001/jt-sign/webSign/homepage",
json: {
para: this.encrypt_para(_0x60744a)
}
};
let {
result: _0x3462ae,
statusCode: _0x17c9d0
} = await this.request(_0x5a9f66);
let _0x59fe3c = _0x49dfef.get(_0x3462ae, "resoultCode", _0x17c9d0);
if (_0x59fe3c == 0) {
let _0x52a59b = _0x49dfef.get(_0x3462ae?.["data"]?.["head"], "code", -1);
if (_0x52a59b == 0) {
for (let _0x3e6107 of _0x3462ae?.["data"]?.["biz"]?.["adItems"] || []) {
let _0x27e7ab = _0x3e6107.title;
if (["0", "1"].includes(_0x3e6107?.["taskState"])) {
switch (_0x3e6107.contentOne) {
case "3":
{
if (_0x3e6107?.["rewardId"]) {
await this.receiveReward(_0x3e6107);
}
break;
}
case "5":
{
await this.openMsg(_0x3e6107);
break;
}
case "6":
{
await this.sharingGetGold();
break;
}
case "10":
case "13":
{
if (!this.xtoken) {
await this.get_usercode();
}
this.xtoken && (await this.watchLiveInit());
break;
}
case "18":
{
await this.polymerize(_0x3e6107);
break;
}
default:
{
break;
}
}
}
}
} else {
let _0xf9bca1 = _0x3462ae?.["data"]?.["head"]?.["err"] || "";
this.log("获取任务列表失败[" + _0x52a59b + "]: " + _0xf9bca1);
}
} else {
this.log("获取任务列表错误[" + _0x59fe3c + "]");
}
} catch (_0x1713d1) {
console.log(_0x1713d1);
}
}
async receiveReward(_0x1f06a0, _0x27d046 = {}) {
try {
let _0x408e82 = _0x1f06a0?.["title"]?.["split"](" ")?.[0];
let _0x12889d = {
phone: this.name,
rewardId: _0x1f06a0?.["rewardId"] || ""
};
let _0x4db2f8 = {
fn: "receiveReward",
method: "post",
url: "https://wapside.189.cn:9001/jt-sign/paradise/receiveReward",
json: {
para: this.encrypt_para(_0x12889d)
}
};
let {
result: _0x514940,
statusCode: _0x5641f8
} = await this.request(_0x4db2f8);
let _0x1559d6 = _0x49dfef.get(_0x514940, "resoultCode", _0x5641f8);
if (_0x1559d6 == 0) {
this.log("领取任务[" + _0x408e82 + "]奖励成功: " + _0x514940?.["resoultMsg"]);
} else {
let _0xa69dbc = _0x514940?.["msg"] || _0x514940?.["resoultMsg"] || _0x514940?.["error"] || "";
this.log("领取任务[" + _0x408e82 + "]奖励错误[" + _0x1559d6 + "]: " + _0xa69dbc);
}
} catch (_0x2a40e0) {
console.log(_0x2a40e0);
}
}
async openMsg(_0x51c539, _0x46c92d = {}) {
try {
let _0x4b897b = _0x51c539?.["title"]?.["split"](" ")?.[0];
let _0x18e652 = {
phone: this.name
};
let _0x1c217b = {
fn: "openMsg",
method: "post",
url: "https://wapside.189.cn:9001/jt-sign/paradise/openMsg",
json: {
para: this.encrypt_para(_0x18e652)
}
};
let {
result: _0xb6f7bf,
statusCode: _0x41e108
} = await this.request(_0x1c217b);
let _0x1377ff = _0x49dfef.get(_0xb6f7bf, "resoultCode", _0x41e108);
if (_0x1377ff == 0) {
this.log("完成任务[" + _0x4b897b + "]成功: " + _0xb6f7bf?.["resoultMsg"]);
} else {
let _0x59d65d = _0xb6f7bf?.["msg"] || _0xb6f7bf?.["resoultMsg"] || _0xb6f7bf?.["error"] || "";
this.log("完成任务[" + _0x4b897b + "]错误[" + _0x1377ff + "]: " + _0x59d65d);
}
} catch (_0x574cb0) {
console.log(_0x574cb0);
}
}
async polymerize(_0x2beade, _0x3610fd = {}) {
try {
let _0x27bccc = _0x2beade?.["title"]?.["split"](" ")?.[0];
let _0x2caf2f = {
phone: this.name,
jobId: _0x2beade.taskId
};
let _0x493039 = {
fn: "polymerize",
method: "post",
url: "https://wapside.189.cn:9001/jt-sign/webSign/polymerize",
json: {
para: this.encrypt_para(_0x2caf2f)
}
};
let {
result: _0x2c3e91,
statusCode: _0x3c5244
} = await this.request(_0x493039);
let _0x43d9c9 = _0x49dfef.get(_0x2c3e91, "resoultCode", _0x3c5244);
if (_0x43d9c9 == 0) {
this.log("完成任务[" + _0x27bccc + "]成功: " + _0x2c3e91?.["resoultMsg"]);
} else {
let _0x402f9a = _0x2c3e91?.["msg"] || _0x2c3e91?.["resoultMsg"] || _0x2c3e91?.["error"] || "";
this.log("完成任务[" + _0x27bccc + "]错误[" + _0x43d9c9 + "]: " + _0x402f9a);
}
} catch (_0xc860ab) {
console.log(_0xc860ab);
}
}
async food(_0x7cbaa1, _0x4b0ab1 = {}) {
try {
let _0x5c6c6d = {
phone: this.name
};
let _0x587fa4 = {
fn: "food",
method: "post",
url: "https://wapside.189.cn:9001/jt-sign/paradise/food",
json: {
para: this.encrypt_para(_0x5c6c6d)
}
};
let {
result: _0x156b8d,
statusCode: _0x191b9d
} = await this.request(_0x587fa4);
let _0x117b58 = _0x49dfef.get(_0x156b8d, "resoultCode", _0x191b9d);
if (_0x117b58 == 0) {
this.log("第" + _0x7cbaa1 + "次喂食: " + (_0x156b8d?.["resoultMsg"] || "成功"));
if (_0x156b8d?.["levelUp"]) {
let _0x265b8d = _0x156b8d?.["currLevelRightList"][0]?.["level"];
const _0x2eec5b = {
notify: true
};
this.log("宠物已升级到[LV." + _0x265b8d + "], 获得: " + _0x156b8d?.["currLevelRightList"][0]?.["righstName"], _0x2eec5b);
}
} else {
let _0x14117b = _0x156b8d?.["msg"] || _0x156b8d?.["resoultMsg"] || _0x156b8d?.["error"] || "";
this.log("第" + _0x7cbaa1 + "次喂食失败[" + _0x117b58 + "]: " + _0x14117b);
_0x14117b?.["includes"]("最大喂食次数") && (this.can_feed = false);
}
} catch (_0x523284) {
console.log(_0x523284);
}
}
async getParadiseInfo(_0x4c16d3 = {}) {
try {
let _0x1c882e = {
phone: this.name
};
let _0x2d8a6c = {
fn: "getParadiseInfo",
method: "post",
url: "https://wapside.189.cn:9001/jt-sign/paradise/getParadiseInfo",
json: {
para: this.encrypt_para(_0x1c882e)
}
};
{
let {
result: _0x13b7df,
statusCode: _0x1e6dfd
} = await this.request(_0x2d8a6c);
let _0x54514a = _0x49dfef.get(_0x13b7df, "resoultCode", _0x1e6dfd);
if (_0x54514a == 0) {
let _0xdb66c = _0x13b7df?.["userInfo"]?.["levelInfoMap"];
this.level = _0xdb66c?.["level"];
for (let _0x33d3a3 = 1; _0x33d3a3 <= 10 && this.can_feed; _0x33d3a3++) {
await this.food(_0x33d3a3);
}
} else {
let _0x4e4dd5 = _0x13b7df?.["msg"] || _0x13b7df?.["resoultMsg"] || _0x13b7df?.["error"] || "";
this.log("查询宠物等级失败[" + _0x54514a + "]: " + _0x4e4dd5);
return;
}
}
{
let {
result: _0x1334dd,
statusCode: _0x363378
} = await this.request(_0x2d8a6c);
let _0xf71230 = _0x49dfef.get(_0x1334dd, "resoultCode", _0x363378);
if (_0xf71230 == 0) {
let _0x41df23 = _0x1334dd?.["userInfo"]?.["levelInfoMap"];
this.level = _0x41df23?.["level"];
const _0x268241 = {
notify: true
};
this.log("宠物等级[Lv." + _0x41df23?.["level"] + "], 升级进度: " + _0x41df23?.["growthValue"] + "/" + _0x41df23?.["fullGrowthCoinValue"], _0x268241);
} else {
let _0x1036a5 = _0x1334dd?.["msg"] || _0x1334dd?.["resoultMsg"] || _0x1334dd?.["error"] || "";
this.log("查询宠物等级失败[" + _0xf71230 + "]: " + _0x1036a5);
return;
}
}
} catch (_0x94c5b4) {
console.log(_0x94c5b4);
}
}
async getLevelRightsList(_0x3ea0a7 = {}) {
try {
let _0x1fd8f0 = {
phone: this.name
};
let _0x5a0971 = {
fn: "getLevelRightsList",
method: "post",
url: "https://wapside.189.cn:9001/jt-sign/paradise/getLevelRightsList",
json: {
para: this.encrypt_para(_0x1fd8f0)
}
};
let {
result: _0x4cf13d,
statusCode: _0x5e92a4
} = await this.request(_0x5a0971);