@iflyrpa/actions 1.2.7 → 1.2.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -9,6 +9,1039 @@ import * as __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__ from "@iflyrpa/s
9
9
  import * as __WEBPACK_EXTERNAL_MODULE_form_data_cf000082__ from "form-data";
10
10
  import * as __WEBPACK_EXTERNAL_MODULE_node_buffer_fb286294__ from "node:buffer";
11
11
  import * as __WEBPACK_EXTERNAL_MODULE_node_crypto_9ba42079__ from "node:crypto";
12
+ var __webpack_modules__ = {
13
+ "./src/utils/ttABEncrypt.js": function(module) {
14
+ let Random = Math.random();
15
+ const Ts = 1749811200000;
16
+ class SM3Hasher {
17
+ constructor(){
18
+ this.reg = new Array(8);
19
+ this.chunk = [];
20
+ this.size = 0;
21
+ this.reset();
22
+ }
23
+ reset() {
24
+ this.reg[0] = 1937774191, this.reg[1] = 1226093241, this.reg[2] = 388252375, this.reg[3] = 3666478592, this.reg[4] = 2842636476, this.reg[5] = 372324522, this.reg[6] = 3817729613, this.reg[7] = 2969243214, this.chunk = [], this.size = 0;
25
+ }
26
+ write(t) {
27
+ var r = "string" == typeof t ? function(t) {
28
+ var r = encodeURIComponent(t).replace(/%([0-9A-F]{2})/g, function(t, r) {
29
+ return String.fromCharCode("0x" + r);
30
+ }), e = new Array(r.length);
31
+ return Array.prototype.forEach.call(r, function(t, r) {
32
+ e[r] = t.charCodeAt(0);
33
+ }), e;
34
+ }(t) : t;
35
+ this.size += r.length;
36
+ var e = 64 - this.chunk.length;
37
+ if (r.length < e) this.chunk = this.chunk.concat(r);
38
+ else for(this.chunk = this.chunk.concat(r.slice(0, e)); this.chunk.length >= 64;)this._compress(this.chunk), e < r.length ? this.chunk = r.slice(e, Math.min(e + 64, r.length)) : this.chunk = [], e += 64;
39
+ }
40
+ sum(t, r) {
41
+ t && (this.reset(), this.write(t)), this._fill();
42
+ for(var e = 0; e < this.chunk.length; e += 64)this._compress(this.chunk.slice(e, e + 64));
43
+ var n, o, i, u = null;
44
+ if ("hex" == r) {
45
+ u = "";
46
+ for(e = 0; e < 8; e++)u += (n = this.reg[e].toString(16), o = 8, i = "0", n.length >= o ? n : i.repeat(o - n.length) + n);
47
+ } else for(u = new Array(32), e = 0; e < 8; e++){
48
+ var a = this.reg[e];
49
+ u[4 * e + 3] = (255 & a) >>> 0, a >>>= 8, u[4 * e + 2] = (255 & a) >>> 0, a >>>= 8, u[4 * e + 1] = (255 & a) >>> 0, a >>>= 8, u[4 * e] = (255 & a) >>> 0;
50
+ }
51
+ return this.reset(), u;
52
+ }
53
+ _fill() {
54
+ var t = 8 * this.size, r = this.chunk.push(128) % 64;
55
+ for(64 - r < 8 && (r -= 64); r < 56; r++)this.chunk.push(0);
56
+ for(var e = 0; e < 4; e++){
57
+ var n = Math.floor(t / 4294967296);
58
+ this.chunk.push(n >>> 8 * (3 - e) & 255);
59
+ }
60
+ for(e = 0; e < 4; e++)this.chunk.push(t >>> 8 * (3 - e) & 255);
61
+ }
62
+ _compress(t) {
63
+ function br(t, r) {
64
+ return (t << (r %= 32) | t >>> 32 - r) >>> 0;
65
+ }
66
+ function wr(t) {
67
+ return 0 <= t && t < 16 ? 2043430169 : 16 <= t && t < 64 ? 2055708042 : void console.error("invalid j for constant Tj");
68
+ }
69
+ function xr(t, r, e, n) {
70
+ return 0 <= t && t < 16 ? (r ^ e ^ n) >>> 0 : 16 <= t && t < 64 ? (r & e | r & n | e & n) >>> 0 : (console.error("invalid j for bool function FF"), 0);
71
+ }
72
+ function Or(t, r, e, n) {
73
+ return 0 <= t && t < 16 ? (r ^ e ^ n) >>> 0 : 16 <= t && t < 64 ? (r & e | ~r & n) >>> 0 : (console.error("invalid j for bool function GG"), 0);
74
+ }
75
+ if (t.length < 64) {
76
+ console.error("compress error: not enough data");
77
+ return;
78
+ }
79
+ for(var r = function(t) {
80
+ for(var r = new Array(132), e = 0; e < 16; e++)r[e] = t[4 * e] << 24, r[e] |= t[4 * e + 1] << 16, r[e] |= t[4 * e + 2] << 8, r[e] |= t[4 * e + 3], r[e] >>>= 0;
81
+ for(var n = 16; n < 68; n++){
82
+ var o = r[n - 16] ^ r[n - 9] ^ br(r[n - 3], 15);
83
+ o = o ^ br(o, 15) ^ br(o, 23), r[n] = (o ^ br(r[n - 13], 7) ^ r[n - 6]) >>> 0;
84
+ }
85
+ for(n = 0; n < 64; n++)r[n + 68] = (r[n] ^ r[n + 4]) >>> 0;
86
+ return r;
87
+ }(t), e = this.reg.slice(0), n = 0; n < 64; n++){
88
+ var o = br(e[0], 12) + e[4] + br(wr(n), n), i = ((o = br(o = (4294967295 & o) >>> 0, 7)) ^ br(e[0], 12)) >>> 0, u = xr(n, e[0], e[1], e[2]);
89
+ u = (4294967295 & (u = u + e[3] + i + r[n + 68])) >>> 0;
90
+ var a = Or(n, e[4], e[5], e[6]);
91
+ a = (4294967295 & (a = a + e[7] + o + r[n])) >>> 0, e[3] = e[2], e[2] = br(e[1], 9), e[1] = e[0], e[0] = u, e[7] = e[6], e[6] = br(e[5], 19), e[5] = e[4], e[4] = (a ^ br(a, 9) ^ br(a, 17)) >>> 0;
92
+ }
93
+ for(var c = 0; c < 8; c++)this.reg[c] = (this.reg[c] ^ e[c]) >>> 0;
94
+ }
95
+ }
96
+ function EnvData2CharCode(postHeader, postData, envData) {
97
+ let _tmpa7 = 240 * Random >> 0 > 109 ? (240 * Random >> 0) + 2 : 240 * Random >> 0;
98
+ let _tmpa8 = 255 * Random >> 0 & 77 | 178;
99
+ let Env0 = [
100
+ 65535 * Random & 170 | 85 & [
101
+ 1,
102
+ 0,
103
+ 1,
104
+ 15
105
+ ].slice(0, 2)[0],
106
+ 65535 * Random & 85 | 170 & [
107
+ 1,
108
+ 0,
109
+ 1,
110
+ 15
111
+ ].slice(0, 2)[0],
112
+ 65535 * Random >> 8 & 170 | 85 & [
113
+ 1,
114
+ 0,
115
+ 1,
116
+ 15
117
+ ].slice(0, 2)[1],
118
+ 65535 * Random >> 8 & 85 | 170 & [
119
+ 1,
120
+ 0,
121
+ 1,
122
+ 15
123
+ ].slice(0, 2)[1],
124
+ 170 & _tmpa7 | 85 & [
125
+ 1,
126
+ 0,
127
+ 1,
128
+ 15
129
+ ].slice(2, 4)[0],
130
+ 85 & _tmpa7 | 170 & [
131
+ 1,
132
+ 0,
133
+ 1,
134
+ 15
135
+ ].slice(2, 4)[0],
136
+ 170 & _tmpa8 | 85 & [
137
+ 1,
138
+ 0,
139
+ 1,
140
+ 15
141
+ ].slice(2, 4)[1],
142
+ 85 & _tmpa8 | 170 & [
143
+ 1,
144
+ 0,
145
+ 1,
146
+ 15
147
+ ].slice(2, 4)[1]
148
+ ];
149
+ let InitEnv1 = '662|856|1920|977|1920|977|1920|1080|Linux x86_64'.split("").map((char)=>char.charCodeAt(0));
150
+ let InitEnv2 = ((255 & String(Ts + 3)) + ',').split("").map((char)=>char.charCodeAt(0));
151
+ const hasher = new SM3Hasher();
152
+ const hasherBytes = hasher.sum(hasher.sum(postHeader + 'dhzx'));
153
+ const dataBytes = hasher.sum(hasher.sum(postData + 'dhzx'));
154
+ const envBytes = hasher.sum(envData);
155
+ let $Env = [
156
+ 41,
157
+ (Ts - 1721836800000) / 1000 / 60 / 60 / 24 / 14 >> 0,
158
+ 6,
159
+ Ts - Ts + 3 & 255,
160
+ 255 & Ts,
161
+ Ts >> 8 & 255,
162
+ Ts >> 16 & 255,
163
+ Ts >> 24 & 255,
164
+ Ts / 256 / 256 / 256 / 256 & 255,
165
+ Ts / 256 / 256 / 256 / 256 / 256 & 255,
166
+ Ts / 256 / 256 / 256 / 256 / 256 & 255,
167
+ Ts / 256 / 256 / 256 / 256 / 256 & 255 & 255 / 256 & 255,
168
+ 1,
169
+ 0,
170
+ 1,
171
+ 1,
172
+ 1,
173
+ 0,
174
+ 8,
175
+ 0,
176
+ 0,
177
+ 0,
178
+ hasherBytes[9],
179
+ hasherBytes[18],
180
+ 3,
181
+ hasherBytes[3],
182
+ dataBytes[10],
183
+ dataBytes[19],
184
+ 4,
185
+ dataBytes[4],
186
+ envBytes[11],
187
+ envBytes[21],
188
+ 5,
189
+ envBytes[5],
190
+ Ts - 1 & 255,
191
+ Ts - 1 >> 8 & 255,
192
+ Ts - 1 >> 16 & 255,
193
+ Ts - 1 >> 24 & 255,
194
+ (Ts - 1) / 256 / 256 / 256 / 256 & 255,
195
+ (Ts - 1) / 256 / 256 / 256 / 256 / 256 & 255,
196
+ 3,
197
+ 41,
198
+ 101,
199
+ 0,
200
+ 0,
201
+ 207,
202
+ 4,
203
+ 0,
204
+ 0,
205
+ InitEnv1.length,
206
+ InitEnv1.length,
207
+ 0,
208
+ InitEnv2.length,
209
+ InitEnv2.length,
210
+ 0
211
+ ];
212
+ let InitEnv0 = [
213
+ $Env[9],
214
+ $Env[18],
215
+ $Env[30],
216
+ $Env[35],
217
+ $Env[47],
218
+ $Env[4],
219
+ $Env[44],
220
+ $Env[19],
221
+ $Env[10],
222
+ $Env[23],
223
+ $Env[12],
224
+ $Env[40],
225
+ $Env[25],
226
+ $Env[42],
227
+ $Env[3],
228
+ $Env[22],
229
+ $Env[38],
230
+ $Env[21],
231
+ $Env[5],
232
+ $Env[45],
233
+ $Env[1],
234
+ $Env[29],
235
+ $Env[6],
236
+ $Env[43],
237
+ $Env[33],
238
+ $Env[14],
239
+ $Env[36],
240
+ $Env[37],
241
+ $Env[2],
242
+ $Env[46],
243
+ $Env[15],
244
+ $Env[48],
245
+ $Env[31],
246
+ $Env[26],
247
+ $Env[16],
248
+ $Env[13],
249
+ $Env[8],
250
+ $Env[41],
251
+ $Env[27],
252
+ $Env[17],
253
+ $Env[39],
254
+ $Env[20],
255
+ $Env[11],
256
+ $Env[0],
257
+ $Env[34],
258
+ $Env[7],
259
+ $Env[50],
260
+ $Env[51],
261
+ $Env[53],
262
+ $Env[54]
263
+ ];
264
+ function delIndex(arr, indexesToDelete) {
265
+ indexesToDelete.sort((a, b)=>b - a).forEach((index)=>{
266
+ if (index >= 0 && index < arr.length) arr.splice(index, 1);
267
+ });
268
+ return arr;
269
+ }
270
+ let _env = Env0.concat(delIndex($Env, [
271
+ 24,
272
+ 28,
273
+ 32,
274
+ 49,
275
+ 52
276
+ ]));
277
+ let InitEnv3 = _env.reduce((acc, cur)=>acc ^ cur);
278
+ let InitEnv = InitEnv0.concat(InitEnv1, InitEnv2, InitEnv3);
279
+ let Env1 = [];
280
+ for(let i = 0; i < 98;){
281
+ Env1.push(1000 * Random & 145 | 110 & InitEnv[i++]);
282
+ Env1.push(1000 * Random & 66 | 189 & InitEnv[i++]);
283
+ Env1.push(1000 * Random & 44 | 211 & InitEnv[i++]);
284
+ Env1.push(145 & InitEnv[i - 3] | 66 & InitEnv[i - 2] | 44 & InitEnv[i - 1]);
285
+ }
286
+ let Env = Env0.concat(Env1, InitEnv[InitEnv.length - InitEnv.length % 3], InitEnv3);
287
+ return Env.map((code)=>String.fromCharCode(code)).join('');
288
+ }
289
+ function Base2Data(CharCode) {
290
+ let _Data = [
291
+ 65535 * Random & 170 | 85 & [
292
+ 3,
293
+ 82
294
+ ][0],
295
+ 65535 * Random & 85 | 170 & [
296
+ 3,
297
+ 82
298
+ ][0],
299
+ 40 * Random >> 0 & 170 | 85 & [
300
+ 3,
301
+ 82
302
+ ][1],
303
+ 40 * Random >> 0 & 85 | 170 & [
304
+ 3,
305
+ 82
306
+ ][1]
307
+ ].map((_num)=>String.fromCharCode(_num)).join('');
308
+ let Base = [
309
+ 255,
310
+ 254,
311
+ 253,
312
+ 252,
313
+ 251,
314
+ 250,
315
+ 249,
316
+ 248,
317
+ 247,
318
+ 246,
319
+ 245,
320
+ 244,
321
+ 243,
322
+ 242,
323
+ 241,
324
+ 240,
325
+ 239,
326
+ 238,
327
+ 237,
328
+ 236,
329
+ 235,
330
+ 234,
331
+ 233,
332
+ 232,
333
+ 231,
334
+ 230,
335
+ 229,
336
+ 228,
337
+ 227,
338
+ 226,
339
+ 225,
340
+ 224,
341
+ 223,
342
+ 222,
343
+ 221,
344
+ 220,
345
+ 219,
346
+ 218,
347
+ 217,
348
+ 216,
349
+ 215,
350
+ 214,
351
+ 213,
352
+ 212,
353
+ 211,
354
+ 210,
355
+ 209,
356
+ 208,
357
+ 207,
358
+ 206,
359
+ 205,
360
+ 204,
361
+ 203,
362
+ 202,
363
+ 201,
364
+ 200,
365
+ 199,
366
+ 198,
367
+ 197,
368
+ 196,
369
+ 195,
370
+ 194,
371
+ 193,
372
+ 192,
373
+ 191,
374
+ 190,
375
+ 189,
376
+ 188,
377
+ 187,
378
+ 186,
379
+ 185,
380
+ 184,
381
+ 183,
382
+ 182,
383
+ 181,
384
+ 180,
385
+ 179,
386
+ 178,
387
+ 177,
388
+ 176,
389
+ 175,
390
+ 174,
391
+ 173,
392
+ 172,
393
+ 171,
394
+ 170,
395
+ 169,
396
+ 168,
397
+ 167,
398
+ 166,
399
+ 165,
400
+ 164,
401
+ 163,
402
+ 162,
403
+ 161,
404
+ 160,
405
+ 159,
406
+ 158,
407
+ 157,
408
+ 156,
409
+ 155,
410
+ 154,
411
+ 153,
412
+ 152,
413
+ 151,
414
+ 150,
415
+ 149,
416
+ 148,
417
+ 147,
418
+ 146,
419
+ 145,
420
+ 144,
421
+ 143,
422
+ 142,
423
+ 141,
424
+ 140,
425
+ 139,
426
+ 138,
427
+ 137,
428
+ 136,
429
+ 135,
430
+ 134,
431
+ 133,
432
+ 132,
433
+ 131,
434
+ 130,
435
+ 129,
436
+ 128,
437
+ 127,
438
+ 126,
439
+ 125,
440
+ 124,
441
+ 123,
442
+ 122,
443
+ 121,
444
+ 120,
445
+ 119,
446
+ 118,
447
+ 117,
448
+ 116,
449
+ 115,
450
+ 114,
451
+ 113,
452
+ 112,
453
+ 111,
454
+ 110,
455
+ 109,
456
+ 108,
457
+ 107,
458
+ 106,
459
+ 105,
460
+ 104,
461
+ 103,
462
+ 102,
463
+ 101,
464
+ 100,
465
+ 99,
466
+ 98,
467
+ 97,
468
+ 96,
469
+ 95,
470
+ 94,
471
+ 93,
472
+ 92,
473
+ 91,
474
+ 90,
475
+ 89,
476
+ 88,
477
+ 87,
478
+ 86,
479
+ 85,
480
+ 84,
481
+ 83,
482
+ 82,
483
+ 81,
484
+ 80,
485
+ 79,
486
+ 78,
487
+ 77,
488
+ 76,
489
+ 75,
490
+ 74,
491
+ 73,
492
+ 72,
493
+ 71,
494
+ 70,
495
+ 69,
496
+ 68,
497
+ 67,
498
+ 66,
499
+ 65,
500
+ 64,
501
+ 63,
502
+ 62,
503
+ 61,
504
+ 60,
505
+ 59,
506
+ 58,
507
+ 57,
508
+ 56,
509
+ 55,
510
+ 54,
511
+ 53,
512
+ 52,
513
+ 51,
514
+ 50,
515
+ 49,
516
+ 48,
517
+ 47,
518
+ 46,
519
+ 45,
520
+ 44,
521
+ 43,
522
+ 42,
523
+ 41,
524
+ 40,
525
+ 39,
526
+ 38,
527
+ 37,
528
+ 36,
529
+ 35,
530
+ 34,
531
+ 33,
532
+ 32,
533
+ 31,
534
+ 30,
535
+ 29,
536
+ 28,
537
+ 27,
538
+ 26,
539
+ 25,
540
+ 24,
541
+ 23,
542
+ 22,
543
+ 21,
544
+ 20,
545
+ 19,
546
+ 18,
547
+ 17,
548
+ 16,
549
+ 15,
550
+ 14,
551
+ 13,
552
+ 12,
553
+ 11,
554
+ 10,
555
+ 9,
556
+ 8,
557
+ 7,
558
+ 6,
559
+ 5,
560
+ 4,
561
+ 3,
562
+ 2,
563
+ 1,
564
+ 0
565
+ ];
566
+ const fixedValue = "Ó".charCodeAt(0);
567
+ let lastIndex = 0;
568
+ for(let i = 0; i < Base.length; i++){
569
+ let val = Base[i];
570
+ lastIndex = (lastIndex * val + lastIndex + fixedValue) % 256;
571
+ [Base[i], Base[lastIndex]] = [
572
+ Base[lastIndex],
573
+ Base[i]
574
+ ];
575
+ }
576
+ let _LastIndx = 0;
577
+ let Data = "";
578
+ for(let i = 0; i < CharCode.length; i++){
579
+ let _CodeA = CharCode.charCodeAt(i);
580
+ let NowIndex = i + 1;
581
+ let NowBase = Base[NowIndex];
582
+ [Base[NowIndex], Base[(_LastIndx + NowBase) % 256]] = [
583
+ Base[(_LastIndx + NowBase) % 256],
584
+ Base[NowIndex]
585
+ ];
586
+ let _CodeB = Base[(Base[NowIndex] + NowBase) % 256];
587
+ _LastIndx = (_LastIndx + NowBase) % 256;
588
+ Data += String.fromCharCode(_CodeA ^ _CodeB);
589
+ }
590
+ return _Data + Data;
591
+ }
592
+ function Data2A_B(CAHR) {
593
+ let Data = 'Dkdpgh2ZmsQB80/MfvV36XI1R45-WUAlEixNLwoqYTOPuzKFjJnry79HbGcaStCe';
594
+ let result = '';
595
+ let o = [
596
+ 62,
597
+ 298,
598
+ 16,
599
+ 0,
600
+ 4,
601
+ 9,
602
+ 16,
603
+ 0,
604
+ 5,
605
+ 54,
606
+ 0,
607
+ 5,
608
+ 62,
609
+ 299,
610
+ 26,
611
+ 300,
612
+ 54,
613
+ 0,
614
+ 5,
615
+ 62,
616
+ 301,
617
+ 26,
618
+ 302,
619
+ 54,
620
+ 0,
621
+ 5,
622
+ 62,
623
+ 303,
624
+ 26,
625
+ 304,
626
+ 54,
627
+ 0,
628
+ 5,
629
+ 62,
630
+ 305,
631
+ 26,
632
+ 268,
633
+ 54,
634
+ 0,
635
+ 5,
636
+ 62,
637
+ 306,
638
+ 26,
639
+ 296,
640
+ 54,
641
+ 0,
642
+ 5,
643
+ 54,
644
+ 0,
645
+ 3,
646
+ 76,
647
+ 16,
648
+ 0,
649
+ 6,
650
+ 62,
651
+ 36,
652
+ 16,
653
+ 0,
654
+ 7,
655
+ 23,
656
+ 0,
657
+ 16,
658
+ 0,
659
+ 9,
660
+ 54,
661
+ 0,
662
+ 2,
663
+ 4,
664
+ 25,
665
+ 54,
666
+ 0,
667
+ 9,
668
+ 23,
669
+ 3,
670
+ 49,
671
+ 67,
672
+ 14,
673
+ 159,
674
+ 54,
675
+ 0,
676
+ 2,
677
+ 22,
678
+ 4,
679
+ 247,
680
+ 34,
681
+ 0,
682
+ 9,
683
+ 60,
684
+ 12,
685
+ 1,
686
+ 23,
687
+ 255,
688
+ 50,
689
+ 23,
690
+ 16,
691
+ 31,
692
+ 54,
693
+ 0,
694
+ 2,
695
+ 22,
696
+ 4,
697
+ 247,
698
+ 34,
699
+ 0,
700
+ 9,
701
+ 60,
702
+ 12,
703
+ 1,
704
+ 23,
705
+ 255,
706
+ 50,
707
+ 23,
708
+ 8,
709
+ 31,
710
+ 32,
711
+ 54,
712
+ 0,
713
+ 2,
714
+ 22,
715
+ 4,
716
+ 247,
717
+ 34,
718
+ 0,
719
+ 9,
720
+ 60,
721
+ 12,
722
+ 1,
723
+ 23,
724
+ 255,
725
+ 50,
726
+ 32,
727
+ 16,
728
+ 0,
729
+ 8,
730
+ 54,
731
+ 0,
732
+ 7,
733
+ 54,
734
+ 0,
735
+ 6,
736
+ 22,
737
+ 4,
738
+ 103,
739
+ 54,
740
+ 0,
741
+ 8,
742
+ 23,
743
+ 16515072,
744
+ 50,
745
+ 23,
746
+ 18,
747
+ 51,
748
+ 12,
749
+ 1,
750
+ 49,
751
+ 34,
752
+ 0,
753
+ 7,
754
+ 72,
755
+ 43,
756
+ 54,
757
+ 0,
758
+ 7,
759
+ 54,
760
+ 0,
761
+ 6,
762
+ 22,
763
+ 4,
764
+ 103,
765
+ 54,
766
+ 0,
767
+ 8,
768
+ 23,
769
+ 258048,
770
+ 50,
771
+ 23,
772
+ 12,
773
+ 51,
774
+ 12,
775
+ 1,
776
+ 49,
777
+ 34,
778
+ 0,
779
+ 7,
780
+ 72,
781
+ 43,
782
+ 54,
783
+ 0,
784
+ 7,
785
+ 54,
786
+ 0,
787
+ 6,
788
+ 22,
789
+ 4,
790
+ 103,
791
+ 54,
792
+ 0,
793
+ 8,
794
+ 23,
795
+ 4032,
796
+ 50,
797
+ 23,
798
+ 6,
799
+ 51,
800
+ 12,
801
+ 1,
802
+ 49,
803
+ 34,
804
+ 0,
805
+ 7,
806
+ 72,
807
+ 43,
808
+ 54,
809
+ 0,
810
+ 7,
811
+ 54,
812
+ 0,
813
+ 6,
814
+ 22,
815
+ 4,
816
+ 103,
817
+ 54,
818
+ 0,
819
+ 8,
820
+ 23,
821
+ 63,
822
+ 50,
823
+ 12,
824
+ 1,
825
+ 49,
826
+ 34,
827
+ 0,
828
+ 7,
829
+ 72,
830
+ 43,
831
+ 18,
832
+ -173,
833
+ 54,
834
+ 0,
835
+ 2,
836
+ 4,
837
+ 25,
838
+ 54,
839
+ 0,
840
+ 9,
841
+ 0,
842
+ 23,
843
+ 0,
844
+ 19,
845
+ 14,
846
+ 160,
847
+ 54,
848
+ 0,
849
+ 2,
850
+ 22,
851
+ 4,
852
+ 247,
853
+ 34,
854
+ 0,
855
+ 9,
856
+ 60,
857
+ 12,
858
+ 1,
859
+ 23,
860
+ 255,
861
+ 50,
862
+ 23,
863
+ 16,
864
+ 31,
865
+ 54,
866
+ 0,
867
+ 2,
868
+ 4,
869
+ 25,
870
+ 54,
871
+ 0,
872
+ 9,
873
+ 19,
874
+ 14,
875
+ 19,
876
+ 54,
877
+ 0,
878
+ 2,
879
+ 22,
880
+ 4,
881
+ 247,
882
+ 54,
883
+ 0,
884
+ 9,
885
+ 12,
886
+ 1,
887
+ 23,
888
+ 255,
889
+ 50,
890
+ 23,
891
+ 8,
892
+ 31,
893
+ 18,
894
+ 2,
895
+ 23,
896
+ 0,
897
+ 32,
898
+ 16,
899
+ 0,
900
+ 8,
901
+ 54,
902
+ 0,
903
+ 7,
904
+ 54,
905
+ 0,
906
+ 6,
907
+ 22,
908
+ 4,
909
+ 103,
910
+ 54,
911
+ 0,
912
+ 8,
913
+ 23,
914
+ 16515072,
915
+ 50,
916
+ 23,
917
+ 18,
918
+ 51,
919
+ 12,
920
+ 1,
921
+ 49,
922
+ 34,
923
+ 0,
924
+ 7,
925
+ 72,
926
+ 43,
927
+ 54,
928
+ 0,
929
+ 7,
930
+ 54,
931
+ 0,
932
+ 6,
933
+ 22,
934
+ 4,
935
+ 103,
936
+ 54,
937
+ 0,
938
+ 8,
939
+ 23,
940
+ 258048,
941
+ 50,
942
+ 23,
943
+ 12,
944
+ 51,
945
+ 12,
946
+ 1,
947
+ 49,
948
+ 34,
949
+ 0,
950
+ 7,
951
+ 72,
952
+ 43,
953
+ 54,
954
+ 0,
955
+ 7,
956
+ 54,
957
+ 0,
958
+ 2,
959
+ 4,
960
+ 25,
961
+ 54,
962
+ 0,
963
+ 9,
964
+ 19,
965
+ 14,
966
+ 19,
967
+ 54,
968
+ 0,
969
+ 6,
970
+ 22,
971
+ 4,
972
+ 103,
973
+ 54,
974
+ 0,
975
+ 8,
976
+ 23,
977
+ 4032,
978
+ 50,
979
+ 23,
980
+ 6,
981
+ 51,
982
+ 12,
983
+ 1,
984
+ 18,
985
+ 3,
986
+ 54,
987
+ 0,
988
+ 4,
989
+ 49,
990
+ 34,
991
+ 0,
992
+ 7,
993
+ 72,
994
+ 43,
995
+ 54,
996
+ 0,
997
+ 7,
998
+ 54,
999
+ 0,
1000
+ 4,
1001
+ 49,
1002
+ 34,
1003
+ 0,
1004
+ 7,
1005
+ 72,
1006
+ 43,
1007
+ 54,
1008
+ 0,
1009
+ 7,
1010
+ 65
1011
+ ];
1012
+ for(let i = 0; i + 2 <= CAHR.length; i += 3){
1013
+ const c = CAHR.charCodeAt(i);
1014
+ const b = CAHR.charCodeAt(i + 1);
1015
+ const a = CAHR.charCodeAt(i + 2);
1016
+ const temp = c << o[94] | b << o[112] | a;
1017
+ const p1 = (temp & o[147]) >> o[150];
1018
+ result += Data.charAt(p1);
1019
+ const p2 = (temp & o[173]) >> o[176];
1020
+ result += Data.charAt(p2);
1021
+ const p3 = (temp & o[199]) >> o[202];
1022
+ result += b ? Data.charAt(p3) : "=";
1023
+ const p4 = temp & o[225];
1024
+ result += a ? Data.charAt(p4) : "=";
1025
+ }
1026
+ return result;
1027
+ }
1028
+ function GenAB(postHeader, postData) {
1029
+ const envData = "fmUmtNjj1OfTrR716RULEyQaLPrOG1jpZz0/4Tyzr7/IbcOXs8PxVxHmrAIsIMm6IfTserj+JgCbPHUssUmedGKwCrIziubgSU0FT1MmqPOZXcPDGB3xUyq+vaM7HZyYgJtKyMR=";
1030
+ return Data2A_B(Base2Data(EnvData2CharCode(postHeader, postData, envData)));
1031
+ }
1032
+ module.exports = GenAB;
1033
+ }
1034
+ };
1035
+ var __webpack_module_cache__ = {};
1036
+ function __webpack_require__(moduleId) {
1037
+ var cachedModule = __webpack_module_cache__[moduleId];
1038
+ if (void 0 !== cachedModule) return cachedModule.exports;
1039
+ var module = __webpack_module_cache__[moduleId] = {
1040
+ exports: {}
1041
+ };
1042
+ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
1043
+ return module.exports;
1044
+ }
12
1045
  class Http {
13
1046
  static handleApiError(error) {
14
1047
  if (error && "object" == typeof error && "code" in error && "message" in error) return error;
@@ -648,6 +1681,37 @@ const searchXiaohongshuLocation = async (_task, params)=>{
648
1681
  return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)([]);
649
1682
  }
650
1683
  };
1684
+ const searchXiaohongshuTopicList = async (_task, params)=>{
1685
+ const http = new Http({
1686
+ headers: {
1687
+ cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
1688
+ referer: "https://creator.xiaohongshu.com",
1689
+ origin: "https://creator.xiaohongshu.com"
1690
+ }
1691
+ });
1692
+ try {
1693
+ const result = await http.api({
1694
+ method: "post",
1695
+ url: "https://edith.xiaohongshu.com/web_api/sns/v1/search/topic",
1696
+ data: {
1697
+ keyword: params.searchValue,
1698
+ suggest_topic_request: {
1699
+ title: "",
1700
+ desc: `#${params.searchValue}`
1701
+ },
1702
+ page: {
1703
+ page_size: 20,
1704
+ page: 1
1705
+ }
1706
+ },
1707
+ defaultErrorMsg: "话题搜索异常,请稍后重试。"
1708
+ });
1709
+ return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)(0 === result.code ? result.data.topic_info_dtos : [], '获取话题成功');
1710
+ } catch (error) {
1711
+ return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)([]);
1712
+ }
1713
+ };
1714
+ const GenAB = __webpack_require__("./src/utils/ttABEncrypt.js");
651
1715
  const mock_errnoMap = {
652
1716
  20004020: "图片上传异常,请重新绑定账号后同步。",
653
1717
  7115: "正文图片和封面图片推荐jpg、png格式。",
@@ -664,6 +1728,11 @@ const mock_errnoMap = {
664
1728
  2005: "账号无【申明原创】权限,请关闭申明后重试。",
665
1729
  100004: "用户未登录或登陆已过期,请重新登陆后重试。"
666
1730
  };
1731
+ const generatorFormData = (data)=>Object.entries(data).map(([key, value])=>{
1732
+ const encodedKey = encodeURIComponent(key);
1733
+ const encodedValue = encodeURIComponent(String(value));
1734
+ return `${encodedKey}=${encodedValue}`;
1735
+ }).join('&');
667
1736
  const get3101DetailError = (errorList, message, saveType)=>{
668
1737
  let error = "";
669
1738
  if (message?.includes("当日发文")) error = errorList[0];
@@ -808,12 +1877,28 @@ const mock_mockAction = async (task, params)=>{
808
1877
  claim_origin: toutiaoOriginal.includes("original") ? 1 : 0,
809
1878
  claim_exclusive: toutiaoOriginal.includes("exclusive") ? 1 : 0
810
1879
  };
1880
+ const msToken = params.cookies.find((it)=>"msToken" === it.name)?.value;
1881
+ if (!msToken) return {
1882
+ code: 200,
1883
+ message: "账号数据异常,请重新绑定账号后重试。",
1884
+ data: ""
1885
+ };
1886
+ const postHeaders = generatorFormData({
1887
+ source: "mp",
1888
+ type: "article",
1889
+ aid: 1231,
1890
+ mp_publish_ab_val: 0,
1891
+ msToken: msToken
1892
+ });
1893
+ const postData = generatorFormData(publishData);
1894
+ let a_bogus = GenAB(postHeaders, postData);
811
1895
  const publishResult = await http.api({
812
1896
  method: "post",
813
- url: "https://mp.toutiao.com/mp/agw/article/publish?source=mp&type=article&aid=1",
814
- data: publishData,
1897
+ url: `https://mp.toutiao.com/mp/agw/article/publish?${postHeaders}&a_bogus=${a_bogus}`,
1898
+ data: postData,
815
1899
  headers: {
816
- "content-type": "application/x-www-form-urlencoded"
1900
+ "content-type": "application/x-www-form-urlencoded",
1901
+ "user-agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36"
817
1902
  },
818
1903
  defaultErrorMsg: "draft" === params.saveType ? "文章同步异常,请稍后重试。" : "文章发布异常,请稍后重试。"
819
1904
  });
@@ -859,6 +1944,10 @@ const rpa_rpaAction = async (task, params)=>{
859
1944
  });
860
1945
  } else await route.continue();
861
1946
  });
1947
+ PopupListener(page, '.byte-modal.publish-exclusive-modal .title', "激励", '.byte-modal-close-icon', {
1948
+ checkInterval: 1000,
1949
+ stopAfterClick: false
1950
+ });
862
1951
  const titleInstance = page.locator(".publish-editor-title-wrapper .publish-editor-title textarea");
863
1952
  await titleInstance.click();
864
1953
  await titleInstance.fill(params.title);
@@ -1144,7 +2233,7 @@ const userTypeMap = {
1144
2233
  已关注的用户: 2,
1145
2234
  已关注7天及以上的用户: 3
1146
2235
  };
1147
- const generatorFormData = (data)=>{
2236
+ const mock_generatorFormData = (data)=>{
1148
2237
  const formData = new URLSearchParams();
1149
2238
  for (const [key, value] of Object.entries(data))formData.append(key, String(value));
1150
2239
  return formData.toString();
@@ -1160,7 +2249,7 @@ const checkCopyrightStat = async (http, params, data)=>{
1160
2249
  token: params.token,
1161
2250
  lang: "zh_CN"
1162
2251
  },
1163
- data: generatorFormData(data)
2252
+ data: mock_generatorFormData(data)
1164
2253
  });
1165
2254
  } catch (error) {
1166
2255
  resData = error?.data;
@@ -1274,7 +2363,7 @@ const weixinPublish_mock_mockAction = async (task, params)=>{
1274
2363
  params: {
1275
2364
  action: "searchacct"
1276
2365
  },
1277
- data: generatorFormData({
2366
+ data: mock_generatorFormData({
1278
2367
  lang: "zh_CN",
1279
2368
  f: "json",
1280
2369
  ajax: 1,
@@ -1403,7 +2492,7 @@ const weixinPublish_mock_mockAction = async (task, params)=>{
1403
2492
  params: {
1404
2493
  action: 'addautoreply'
1405
2494
  },
1406
- data: generatorFormData({
2495
+ data: mock_generatorFormData({
1407
2496
  type: 1,
1408
2497
  fingerprint,
1409
2498
  token: params.token,
@@ -1525,7 +2614,7 @@ const weixinPublish_mock_mockAction = async (task, params)=>{
1525
2614
  type: 77,
1526
2615
  lang: "zh_CN"
1527
2616
  },
1528
- data: generatorFormData(draftData),
2617
+ data: mock_generatorFormData(draftData),
1529
2618
  defaultErrorMsg: "创建草稿失败,请稍后重试发布。"
1530
2619
  });
1531
2620
  if ("draft" === params.saveType) return {
@@ -1558,7 +2647,7 @@ const weixinPublish_mock_mockAction = async (task, params)=>{
1558
2647
  lang: "zh_CN",
1559
2648
  token: params.token
1560
2649
  },
1561
- data: generatorFormData({
2650
+ data: mock_generatorFormData({
1562
2651
  token: params.token,
1563
2652
  lang: "zh_CN",
1564
2653
  f: "json",
@@ -1589,7 +2678,7 @@ const weixinPublish_mock_mockAction = async (task, params)=>{
1589
2678
  token: params.token,
1590
2679
  lang: "zh_CN"
1591
2680
  },
1592
- data: generatorFormData({
2681
+ data: mock_generatorFormData({
1593
2682
  appmsgid: appMsgId,
1594
2683
  fingerprint,
1595
2684
  token: params.token,
@@ -1601,7 +2690,7 @@ const weixinPublish_mock_mockAction = async (task, params)=>{
1601
2690
  await http.api({
1602
2691
  method: "post",
1603
2692
  url: "https://mp.weixin.qq.com/cgi-bin/masssend?action=check_same_material",
1604
- data: generatorFormData({
2693
+ data: mock_generatorFormData({
1605
2694
  msgid: appMsgId,
1606
2695
  fingerprint,
1607
2696
  token: params.token,
@@ -1640,7 +2729,7 @@ const weixinPublish_mock_mockAction = async (task, params)=>{
1640
2729
  token: params.token,
1641
2730
  lang: "zh_CN"
1642
2731
  },
1643
- data: generatorFormData({
2732
+ data: mock_generatorFormData({
1644
2733
  appmsg_id: appMsgId,
1645
2734
  fingerprint,
1646
2735
  token: params.token,
@@ -1659,7 +2748,7 @@ const weixinPublish_mock_mockAction = async (task, params)=>{
1659
2748
  params: {
1660
2749
  action: "check_music"
1661
2750
  },
1662
- data: generatorFormData({
2751
+ data: mock_generatorFormData({
1663
2752
  appmsgid: appMsgId,
1664
2753
  masssend_check: 1,
1665
2754
  fingerprint,
@@ -1679,7 +2768,7 @@ const weixinPublish_mock_mockAction = async (task, params)=>{
1679
2768
  lang: "zh_CN",
1680
2769
  1: 1
1681
2770
  },
1682
- data: generatorFormData({
2771
+ data: mock_generatorFormData({
1683
2772
  token: params.token,
1684
2773
  lang: "zh_CN",
1685
2774
  f: "json",
@@ -1699,7 +2788,7 @@ const weixinPublish_mock_mockAction = async (task, params)=>{
1699
2788
  lang: "zh_CN",
1700
2789
  1: 1
1701
2790
  },
1702
- data: generatorFormData({
2791
+ data: mock_generatorFormData({
1703
2792
  token: params.token,
1704
2793
  lang: "zh_CN",
1705
2794
  f: "json",
@@ -1753,7 +2842,7 @@ const weixinPublish_mock_mockAction = async (task, params)=>{
1753
2842
  lang: "zh_CN",
1754
2843
  timespam: Date.now()
1755
2844
  },
1756
- data: generatorFormData({
2845
+ data: mock_generatorFormData({
1757
2846
  token: params.token,
1758
2847
  lang: "zh_CN",
1759
2848
  f: "json",
@@ -1783,7 +2872,7 @@ const weixinPublish_mock_mockAction = async (task, params)=>{
1783
2872
  lang: "zh_CN",
1784
2873
  1: 1
1785
2874
  },
1786
- data: generatorFormData({
2875
+ data: mock_generatorFormData({
1787
2876
  token: params.token,
1788
2877
  lang: "zh_CN",
1789
2878
  f: "json",
@@ -1805,7 +2894,7 @@ const weixinPublish_mock_mockAction = async (task, params)=>{
1805
2894
  is_release_publish_page: 1
1806
2895
  }
1807
2896
  },
1808
- data: generatorFormData({
2897
+ data: mock_generatorFormData({
1809
2898
  token: params.token,
1810
2899
  lang: "zh_CN",
1811
2900
  f: "json",
@@ -2498,7 +3587,9 @@ class XsEncrypt {
2498
3587
  }
2499
3588
  }
2500
3589
  const xiaohongshuPublish_mock_errnoMap = {
2501
- 903: "账户已登出,需重新登陆重试!"
3590
+ 915: "所属C端账号手机号被修改,请重新登录",
3591
+ 903: "账户已登出,需重新登陆重试!",
3592
+ 902: "登录已过期,请重新登录!"
2502
3593
  };
2503
3594
  const xsEncrypt = new XsEncrypt();
2504
3595
  const xiaohongshuPublish_mock_mockAction = async (task, params)=>{
@@ -2568,13 +3659,34 @@ const xiaohongshuPublish_mock_mockAction = async (task, params)=>{
2568
3659
  };
2569
3660
  };
2570
3661
  const coverInfos = await Promise.all(params.banners.map((it, idx)=>uploadFile(it, idx)));
3662
+ if (params.topic && params.topic.length > 0) await Promise.all(params.topic.map(async (topic)=>{
3663
+ if (!topic["id"]) {
3664
+ const topicData = {
3665
+ topic_names: topic["name"]
3666
+ };
3667
+ const topicDataStr = xsEncrypt.dumps(topicData);
3668
+ const publishXt = Date.now().toString();
3669
+ const publishXs = await xsEncrypt.encryptXs(`/web_api/sns/capa/postgw/topic/batch_customized${topicDataStr}`, a1Cookie, publishXt);
3670
+ let createTopic = await http.api({
3671
+ method: "POST",
3672
+ url: "https://edith.xiaohongshu.com/web_api/sns/capa/postgw/topic/batch_customized",
3673
+ headers: {
3674
+ "x-s": publishXs,
3675
+ "x-t": publishXt
3676
+ },
3677
+ data: topicData,
3678
+ defaultErrorMsg: "话题创建异常,请稍后重试。"
3679
+ });
3680
+ Object.assign(topic, createTopic.data.topic_infos[0]);
3681
+ }
3682
+ }));
2571
3683
  const publishData = {
2572
3684
  common: {
2573
3685
  ats: [],
2574
3686
  biz_relations: [],
2575
3687
  desc: params?.content,
2576
3688
  goods_info: {},
2577
- hash_tag: [],
3689
+ hash_tag: params.topic || [],
2578
3690
  note_id: "",
2579
3691
  source: JSON.stringify({
2580
3692
  type: "web",
@@ -2692,6 +3804,7 @@ const xiaohongshuPublish_rpa_rpaAction = async (task, params)=>{
2692
3804
  '/api/galaxy/v2/creator/activity_center/list',
2693
3805
  '/web_api/sns/v5/creator/topic/template/list',
2694
3806
  '/web_api/sns/v5/creator/file/encryption',
3807
+ '/web_api/sns/capa/postgw/topic/batch_customized',
2695
3808
  '/web_api/sns/v2/note'
2696
3809
  ];
2697
3810
  await page.route('**', async (route, request)=>{
@@ -2713,11 +3826,11 @@ const xiaohongshuPublish_rpa_rpaAction = async (task, params)=>{
2713
3826
  });
2714
3827
  return;
2715
3828
  }
2716
- const isNoteRequest = urlObj.pathname.includes(interceptUrls[4]);
3829
+ const isNoteRequest = urlObj.pathname.includes(interceptUrls[5]);
2717
3830
  const xs = await (isNoteRequest ? (async ()=>{
2718
3831
  const publishData = JSON.parse(request.postData() || "");
2719
3832
  const publishDataStr = rpa_xsEncrypt.dumps(publishData);
2720
- return rpa_xsEncrypt.encryptXs(interceptUrls[4] + publishDataStr, a1Cookie, xt);
3833
+ return rpa_xsEncrypt.encryptXs(interceptUrls[5] + publishDataStr, a1Cookie, xt);
2721
3834
  })() : rpa_xsEncrypt.encryptXs(fetchCoverUrl, a1Cookie, xt));
2722
3835
  const newHeaders = {
2723
3836
  ...request.headers(),
@@ -2771,7 +3884,7 @@ const xiaohongshuPublish_rpa_rpaAction = async (task, params)=>{
2771
3884
  data: page.url()
2772
3885
  };
2773
3886
  }
2774
- await page.locator("#content-area .menu-container .publish-video a").click();
3887
+ await page.locator("#content-area .menu-container .publish-video .btn").click();
2775
3888
  await page.locator('.creator-container .header .creator-tab:not([style*="-9999px"]) .title').filter({
2776
3889
  hasText: /^上传图文$/
2777
3890
  }).click();
@@ -2788,7 +3901,15 @@ const xiaohongshuPublish_rpa_rpaAction = async (task, params)=>{
2788
3901
  await titleInstance.fill(params.title);
2789
3902
  const descInstance = page.locator(".editor-container #quillEditor .ql-editor");
2790
3903
  await descInstance.click();
2791
- await descInstance.fill(params.content);
3904
+ await descInstance.pressSequentially(params.content.replace(/#.*?\[.*?]\#/g, ""));
3905
+ if (params.topic && params.topic.length > 0) for (const it of params.topic){
3906
+ await descInstance.pressSequentially(`#${it["name"]}`);
3907
+ await page.locator('.ql-mention-loading').waitFor({
3908
+ state: 'detached'
3909
+ });
3910
+ await page.waitForTimeout(1000);
3911
+ await page.locator('#quill-mention-item-0 .item-view-num').click();
3912
+ }
2792
3913
  const container = page.locator(".creator-container .content .scroll-content");
2793
3914
  await container.focus();
2794
3915
  await page.mouse.wheel(0, 500);
@@ -2797,8 +3918,8 @@ const xiaohongshuPublish_rpa_rpaAction = async (task, params)=>{
2797
3918
  }), params.address.name);
2798
3919
  if (params.selfDeclaration) {
2799
3920
  await page.locator(".media-settings .flexbox").filter({
2800
- hasText: "自主声明"
2801
- }).locator(".d-select-wrapper").click();
3921
+ hasText: "内容类型声明"
3922
+ }).locator(".d-select-placeholder").click();
2802
3923
  const poperInstance = await getPoperInstance();
2803
3924
  const selfDeclarationInstance = poperInstance.locator(".d-options .d-option");
2804
3925
  if ("fictional-rendition" === params.selfDeclaration.type) await selfDeclarationInstance.filter({
@@ -2875,7 +3996,7 @@ const xiaohongshuPublish = async (task, params)=>{
2875
3996
  return executeAction(xiaohongshuPublish_mock_mockAction, xiaohongshuPublish_rpa_rpaAction)(task, params);
2876
3997
  };
2877
3998
  var package_namespaceObject = {
2878
- i8: "1.2.6"
3999
+ i8: "1.2.8"
2879
4000
  };
2880
4001
  class Action {
2881
4002
  constructor(task){
@@ -2912,6 +4033,9 @@ class Action {
2912
4033
  xiaohongshuPublish(params) {
2913
4034
  return this.bindTask(xiaohongshuPublish, params);
2914
4035
  }
4036
+ searchXiaohongshuTopicList(params) {
4037
+ return this.bindTask(searchXiaohongshuTopicList, params);
4038
+ }
2915
4039
  searchXiaohongshuLocation(params) {
2916
4040
  return this.bindTask(searchXiaohongshuLocation, params);
2917
4041
  }