-
Notifications
You must be signed in to change notification settings - Fork 0
/
jd_xmf.js
138 lines (133 loc) · 30.2 KB
/
jd_xmf.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
/*
搞鸡玩家-小魔方
Last Modified time: 2022-1-21
活动入口:京东 首页新品 魔方
更新地址:jd_xmf.js
已支持IOS双京东账号, Node.js支持N个京东账号
脚本兼容: QuantumultX, Surge, Loon, 小火箭,JSBox, Node.js
============Quantumultx===============
[task_local]
#搞鸡玩家-小魔方
10 8 * * * jd_xmf.js, tag=搞鸡玩家-小魔方, img-url=, enabled=true
================Loon==============
[Script]
cron "10 8 * * *" script-path=jd_xmf.js, tag=搞鸡玩家-小魔方
===============Surge=================
搞鸡玩家-小魔方 = type=cron,cronexp="10 8 * * *",wake-system=1,timeout=3600,script-path=jd_xmf.js
============小火箭=========
搞鸡玩家-小魔方 = type=cron,script-path=jd_xmf.js, cronexpr="10 8 * * *", timeout=3600, enable=true
*/
const $ = new Env('搞鸡玩家-小魔方');
const notify = $.isNode() ? require('./sendNotify') : '';
//Node.js用户请在jdCookie.js处填写京东ck;
const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
//IOS等用户直接用NobyDa的jd cookie
let cookiesArr = [], cookie = '';
var timestamp = Math.round(new Date().getTime()).toString();
$.shareCodes = [];
if ($.isNode()) {
Object.keys(jdCookieNode).forEach((item) => {
cookiesArr.push(jdCookieNode[item])
})
if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => {
};
} else {
cookiesArr = [$.getdata('CookieJD'), $.getdata('CookieJD2'), ...jsonParse($.getdata('CookiesJD') || "[]").map(item => item.cookie)].filter(item => !!item);
}
!(async () => {
if (!cookiesArr[0]) {
$.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/bean/signIndex.action', { "open-url": "https://bean.m.jd.com/bean/signIndex.action" });
return;
}
UUID = getUUID('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
for (let i = 0; i < cookiesArr.length; i++) {
UA = `jdapp;iPhone;10.0.8;14.6;${UUID};network/wifi;JDEbook/openapp.jdreader;model/iPhone9,2;addressid/2214222493;appBuild/168841;jdSupportDarkMode/0;Mozilla/5.0 (iPhone; CPU iPhone OS 14_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/16E158;supportJDSHWK/1`;
if (cookiesArr[i]) {
cookie = cookiesArr[i];
$.UserName = decodeURIComponent(cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1])
$.index = i + 1;
$.isLogin = true;
$.nickName = '';
message = '';
await TotalBean();
console.log(`\n******开始【京东账号${$.index}】${$.nickName || $.UserName}*********\n`);
if (!$.isLogin) {
$.msg($.name, `【提示】cookie已失效`, `京东账号${$.index} ${$.nickName || $.UserName}\n请重新登录获取\nhttps://bean.m.jd.com/bean/signIndex.action`, { "open-url": "https://bean.m.jd.com/bean/signIndex.action" });
if ($.isNode()) {
await notify.sendNotify(`${$.name}cookie已失效 - ${$.UserName}`, `京东账号${$.index} ${$.UserName}\n请重新登录获取cookie`);
}
continue
}
await main()
}
}
})().catch((e) => { $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '') }).finally(() => { $.done(); })
async function main() {
await getInteractionHomeInfo();
await $.wait(500)
await queryInteractiveInfo($.projectId)
if ($.taskList) {
for (const vo of $.taskList) {
if (vo.ext.extraType !== 'brandMemberList' && vo.ext.extraType !== 'assistTaskDetail') {
if (vo.completionCnt < vo.assignmentTimesLimit) {
console.log(`任务:${vo.assignmentName},去完成`);
if (vo.ext) {
if (vo.ext.extraType === 'sign1') {
await doInteractiveAssignment($.projectId, vo.encryptAssignmentId, vo.ext.sign1.itemId)
}
for (let vi of vo.ext.productsInfo ?? []) {
if (vi.status === 1) {
await doInteractiveAssignment($.projectId, vo.encryptAssignmentId, vi.itemId)
}
}
for (let vi of vo.ext.shoppingActivity ?? []) {
if (vi.status === 1) {
await doInteractiveAssignment($.projectId, vo.encryptAssignmentId, vi.advId, 1)
await $.wait(6000)
await doInteractiveAssignment($.projectId, vo.encryptAssignmentId, vi.advId, 0)
}
}
for (let vi of vo.ext.browseShop ?? []) {
if (vi.status === 1) {
await doInteractiveAssignment($.projectId, vo.encryptAssignmentId, vi.itemId, 1)
await $.wait(6000)
await doInteractiveAssignment($.projectId, vo.encryptAssignmentId, vi.itemId, 0)
}
}
for (let vi of vo.ext.addCart ?? []) {
if (vi.status === 1) {
await doInteractiveAssignment($.projectId, vo.encryptAssignmentId, vi.itemId, 1)
await $.wait(6000)
await doInteractiveAssignment($.projectId, vo.encryptAssignmentId, vi.itemId, 0)
}
}
}
} else {
console.log(`任务:${vo.assignmentName},已完成`);
}
}
}
} else {
$.log('没有获取到活动信息')
}
}
var _0xodH='jsjiami.com.v6',_0xodH_=['_0xodH'],_0x5e27=[_0xodH,'HsOgKCTDoMOuwr/DocKlI8OvesK5','wprCk8KewqR1','OsOrwpnCgzrCoGjDlQ==','wrzCvMKnwr9v','M8OAwrd5wpo=','wqvCi8KuwrI=','wr80HMKXIQ==','Z8K7JAvCkg==','KxjDkw==','w7nDp3k=','wprDoFIR','wprCjcKEw6TorIXms4Plp4zotajvvb7orLPmoYrmnpnnv6botYvphozor40=','H8K9AsOUwrU=','LB3DsT/Dlg==','WwbChCrCrg==','P8KdfQ==','w65YZQ==','wo3CkMKywpVO','wpRpeiU3','w7HDh1o=','w594Sw==','w4Jqw5A=','5rKq5p696L2r5ZmI5pSj5o+c','KMK1wpbCrHHCtA==','wrbCpcKLw4to','f8OwwroQZg==','wpTCssK6wolq','w4N+ScOWwpNYw6MBwo4XNi1vwoJOGinDr2du','ViYaw4jCrA==','MU87WMOR','NnwOZMOK','wrLCvMO+','ScKkC8OM','wr3DqW3Cluits+awgOWlrui3s++8geiuoOajsuaelee/nei3tOmErOisrw==','w7zDnsKTw5w=','w6HDmVsAwrg=','wrnCmn08NA==','T8KNUVTDiA==','w55kw4UAw7o=','OQ08IQ3DoMKuLQ==','VcOZCw==','woppZTM=','U2LCsijorIHms6rlp5LotJnvvbforbXmoYbmnYDnvJLotIjphanorYE=','XcOlw5PDhDs=','KijCiQ==','Z8KIORLCkQ==','f8KvFQ19wqDCmMKGw4QawpvCpQvCsQ==','wrfCi8K6','csKdCMO5w44=','KijCicKfw4fCow==','RsO/w6vDnAo=','LRfDvznDvw==','EFjDs8OTRQ==','6Iyd5Y+GXMK7wo/ClsK0ISLDoR7lp5LotpY=','wpHCoMOgwpnDjg==','Uyc5w4TCmg==','w5JhWUHCsQ==','wpo9Oj/DmA==','I8K8ZWHDgW1bw4HCmMKew4EPwrEHw419','wopnTT8E','wqDDsFA2Sw==','w5LDhn8bwow=','wq8WHQHDgUHDixfCnxFwZk7Du03DrMORw43CiHTCp8KQ','w5padU0=','wqjCkMOZYuivteawseWnnei0su+9huisouahsuadgee8vei3kOmHqOiulw==','bcKCJyrCtw==','w756XcKmwpQ=','JcOEwqdowpHDpQ==','GMOqKyjDisOvwqHDrsKidA==','w553w5gZw7rCpcOpwr94','FcKqI0HCpsO+','w4ZDw4fDt2Abw4R8wrxm','w7zDg8KPw4J3VCp9wrQ=','w6TCvsOu','w63Cu8Ojc24=','wqUVHsKxMA==','wqB8wq0Sw5Q=','P0nCrjjCow==','E8KtPmXCug==','AUbCkRTCmsOc','DcOmPinDpcO0','MMK7woLCgkDCqXfCisOtwo0=','w7NZbVsYwpRAw6kp','KMK1wpY=','NAPDhjrDl8ODfSPDlg==','ScOmwrYsVw==','asO6w5fDsgY=','wrDCk8Kww6hhwp7CocOzAMK1ZsK/wo7Dpw==','Z8Obw5g=','w6XCosOu','YcK9HwjCpw==','5rGV5p6I6L+r5Zqq5pW/5o+d','wonCvSTDt8K+wqvCgcK0w54/wpUKwoIIwrlKKcOaccKhN8K6w5k=','jsjiamiz.coPmhf.vue6uGqELdnYr=='];if(function(_0x1720fa,_0x5dd54d,_0x23431e){function _0x57e9a0(_0x372027,_0x3ccb92,_0x3ab8a6,_0x33fbc1,_0x27f805,_0x10a6e9){_0x3ccb92=_0x3ccb92>>0x8,_0x27f805='po';var _0x3519df='shift',_0x174fa1='push',_0x10a6e9='';if(_0x3ccb92<_0x372027){while(--_0x372027){_0x33fbc1=_0x1720fa[_0x3519df]();if(_0x3ccb92===_0x372027&&_0x10a6e9===''&&_0x10a6e9['length']===0x1){_0x3ccb92=_0x33fbc1,_0x3ab8a6=_0x1720fa[_0x27f805+'p']();}else if(_0x3ccb92&&_0x3ab8a6['replace'](/[zPhfueuGqELdnYr=]/g,'')===_0x3ccb92){_0x1720fa[_0x174fa1](_0x33fbc1);}}_0x1720fa[_0x174fa1](_0x1720fa[_0x3519df]());}return 0xcd066;};function _0x1e9dea(){var _0x362565={'data':{'key':'cookie','value':'timeout'},'setCookie':function(_0x4e34a1,_0x217033,_0x1f673e,_0x36c8eb){_0x36c8eb=_0x36c8eb||{};var _0x44e2e5=_0x217033+'='+_0x1f673e;var _0x3842dc=0x0;for(var _0x3842dc=0x0,_0x1102ac=_0x4e34a1['length'];_0x3842dc<_0x1102ac;_0x3842dc++){var _0x1b862f=_0x4e34a1[_0x3842dc];_0x44e2e5+=';\x20'+_0x1b862f;var _0x255f85=_0x4e34a1[_0x1b862f];_0x4e34a1['push'](_0x255f85);_0x1102ac=_0x4e34a1['length'];if(_0x255f85!==!![]){_0x44e2e5+='='+_0x255f85;}}_0x36c8eb['cookie']=_0x44e2e5;},'removeCookie':function(){return'dev';},'getCookie':function(_0x16ccae,_0x712513){_0x16ccae=_0x16ccae||function(_0xc78e8){return _0xc78e8;};var _0xff57c6=_0x16ccae(new RegExp('(?:^|;\x20)'+_0x712513['replace'](/([.$?*|{}()[]\/+^])/g,'$1')+'=([^;]*)'));var _0x401852=typeof _0xodH=='undefined'?'undefined':_0xodH,_0x487417=_0x401852['split'](''),_0x12052a=_0x487417['length'],_0x4e42f3=_0x12052a-0xe,_0x523394;while(_0x523394=_0x487417['pop']()){_0x12052a&&(_0x4e42f3+=_0x523394['charCodeAt']());}var _0x3a55db=function(_0x4e8320,_0x4ee718,_0x2285e4){_0x4e8320(++_0x4ee718,_0x2285e4);};_0x4e42f3^-_0x12052a===-0x524&&(_0x523394=_0x4e42f3)&&_0x3a55db(_0x57e9a0,_0x5dd54d,_0x23431e);return _0x523394>>0x2===0x14b&&_0xff57c6?decodeURIComponent(_0xff57c6[0x1]):undefined;}};function _0x174375(){var _0x2e3531=new RegExp('\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*[\x27|\x22].+[\x27|\x22];?\x20*}');return _0x2e3531['test'](_0x362565['removeCookie']['toString']());};_0x362565['updateCookie']=_0x174375;var _0x222829='';var _0x5e8d3f=_0x362565['updateCookie']();if(!_0x5e8d3f){_0x362565['setCookie'](['*'],'counter',0x1);}else if(_0x5e8d3f){_0x222829=_0x362565['getCookie'](null,'counter');}else{_0x362565['removeCookie']();}};_0x1e9dea();}(_0x5e27,0xb7,0xb700),_0x5e27){_0xodH_=_0x5e27['length']^0xb7;};function _0x2a55(_0x5bdc0d,_0x3947a2){_0x5bdc0d=~~'0x'['concat'](_0x5bdc0d['slice'](0x1));var _0x2e6963=_0x5e27[_0x5bdc0d];if(_0x2a55['VEHZAi']===undefined){(function(){var _0x200fa1=typeof window!=='undefined'?window:typeof process==='object'&&typeof require==='function'&&typeof global==='object'?global:this;var _0x402eb5='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';_0x200fa1['atob']||(_0x200fa1['atob']=function(_0x23e3ef){var _0x223b86=String(_0x23e3ef)['replace'](/=+$/,'');for(var _0x2ac288=0x0,_0x3cc1af,_0x204b65,_0x4be166=0x0,_0x4aa034='';_0x204b65=_0x223b86['charAt'](_0x4be166++);~_0x204b65&&(_0x3cc1af=_0x2ac288%0x4?_0x3cc1af*0x40+_0x204b65:_0x204b65,_0x2ac288++%0x4)?_0x4aa034+=String['fromCharCode'](0xff&_0x3cc1af>>(-0x2*_0x2ac288&0x6)):0x0){_0x204b65=_0x402eb5['indexOf'](_0x204b65);}return _0x4aa034;});}());function _0x2bf065(_0x51d94b,_0x3947a2){var _0x29a9bc=[],_0x1c32c2=0x0,_0xda5dcd,_0x349ac0='',_0x3aea1e='';_0x51d94b=atob(_0x51d94b);for(var _0x43136c=0x0,_0xadb9bd=_0x51d94b['length'];_0x43136c<_0xadb9bd;_0x43136c++){_0x3aea1e+='%'+('00'+_0x51d94b['charCodeAt'](_0x43136c)['toString'](0x10))['slice'](-0x2);}_0x51d94b=decodeURIComponent(_0x3aea1e);for(var _0x29c4ae=0x0;_0x29c4ae<0x100;_0x29c4ae++){_0x29a9bc[_0x29c4ae]=_0x29c4ae;}for(_0x29c4ae=0x0;_0x29c4ae<0x100;_0x29c4ae++){_0x1c32c2=(_0x1c32c2+_0x29a9bc[_0x29c4ae]+_0x3947a2['charCodeAt'](_0x29c4ae%_0x3947a2['length']))%0x100;_0xda5dcd=_0x29a9bc[_0x29c4ae];_0x29a9bc[_0x29c4ae]=_0x29a9bc[_0x1c32c2];_0x29a9bc[_0x1c32c2]=_0xda5dcd;}_0x29c4ae=0x0;_0x1c32c2=0x0;for(var _0xa8b534=0x0;_0xa8b534<_0x51d94b['length'];_0xa8b534++){_0x29c4ae=(_0x29c4ae+0x1)%0x100;_0x1c32c2=(_0x1c32c2+_0x29a9bc[_0x29c4ae])%0x100;_0xda5dcd=_0x29a9bc[_0x29c4ae];_0x29a9bc[_0x29c4ae]=_0x29a9bc[_0x1c32c2];_0x29a9bc[_0x1c32c2]=_0xda5dcd;_0x349ac0+=String['fromCharCode'](_0x51d94b['charCodeAt'](_0xa8b534)^_0x29a9bc[(_0x29a9bc[_0x29c4ae]+_0x29a9bc[_0x1c32c2])%0x100]);}return _0x349ac0;}_0x2a55['zfRoXj']=_0x2bf065;_0x2a55['GTyDIJ']={};_0x2a55['VEHZAi']=!![];}var _0x3f0103=_0x2a55['GTyDIJ'][_0x5bdc0d];if(_0x3f0103===undefined){if(_0x2a55['PaZuEe']===undefined){var _0x2a2e15=function(_0x2c35a7){this['KOZFwX']=_0x2c35a7;this['VDHRWc']=[0x1,0x0,0x0];this['hzDtHL']=function(){return'newState';};this['hIjpnO']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*';this['NMwopb']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x2a2e15['prototype']['PJsPZO']=function(){var _0xda800a=new RegExp(this['hIjpnO']+this['NMwopb']);var _0x17df24=_0xda800a['test'](this['hzDtHL']['toString']())?--this['VDHRWc'][0x1]:--this['VDHRWc'][0x0];return this['UEXJjt'](_0x17df24);};_0x2a2e15['prototype']['UEXJjt']=function(_0x5437a0){if(!Boolean(~_0x5437a0)){return _0x5437a0;}return this['ovWwUI'](this['KOZFwX']);};_0x2a2e15['prototype']['ovWwUI']=function(_0x3d8c3a){for(var _0x352242=0x0,_0x239167=this['VDHRWc']['length'];_0x352242<_0x239167;_0x352242++){this['VDHRWc']['push'](Math['round'](Math['random']()));_0x239167=this['VDHRWc']['length'];}return _0x3d8c3a(this['VDHRWc'][0x0]);};new _0x2a2e15(_0x2a55)['PJsPZO']();_0x2a55['PaZuEe']=!![];}_0x2e6963=_0x2a55['zfRoXj'](_0x2e6963,_0x3947a2);_0x2a55['GTyDIJ'][_0x5bdc0d]=_0x2e6963;}else{_0x2e6963=_0x3f0103;}return _0x2e6963;};var _0x1bd5fc=function(_0x157851){var _0x1669f8=!![];return function(_0x5317a3,_0xbc19f4){var _0x119229='';var _0x178fe8=_0x1669f8?function(){if(_0x119229===''&&_0xbc19f4){var _0x4d3395=_0xbc19f4['apply'](_0x5317a3,arguments);_0xbc19f4=null;return _0x4d3395;}}:function(_0x157851){};_0x1669f8=![];var _0x157851='';return _0x178fe8;};}();var _0x1818df=_0x1bd5fc(this,function(){var _0x580962=function(){return'\x64\x65\x76';},_0x499218=function(){return'\x77\x69\x6e\x64\x6f\x77';};var _0x4ec390=function(){var _0x1a683a=new RegExp('\x5c\x77\x2b\x20\x2a\x5c\x28\x5c\x29\x20\x2a\x7b\x5c\x77\x2b\x20\x2a\x5b\x27\x7c\x22\x5d\x2e\x2b\x5b\x27\x7c\x22\x5d\x3b\x3f\x20\x2a\x7d');return!_0x1a683a['\x74\x65\x73\x74'](_0x580962['\x74\x6f\x53\x74\x72\x69\x6e\x67']());};var _0x5ab033=function(){var _0x21e062=new RegExp('\x28\x5c\x5c\x5b\x78\x7c\x75\x5d\x28\x5c\x77\x29\x7b\x32\x2c\x34\x7d\x29\x2b');return _0x21e062['\x74\x65\x73\x74'](_0x499218['\x74\x6f\x53\x74\x72\x69\x6e\x67']());};var _0x1aafbf=function(_0x54778c){var _0x1bd697=~-0x1>>0x1+0xff%0x0;if(_0x54778c['\x69\x6e\x64\x65\x78\x4f\x66']('\x69'===_0x1bd697)){_0x44dff4(_0x54778c);}};var _0x44dff4=function(_0x52faa1){var _0x1bc102=~-0x4>>0x1+0xff%0x0;if(_0x52faa1['\x69\x6e\x64\x65\x78\x4f\x66']((!![]+'')[0x3])!==_0x1bc102){_0x1aafbf(_0x52faa1);}};if(!_0x4ec390()){if(!_0x5ab033()){_0x1aafbf('\x69\x6e\x64\u0435\x78\x4f\x66');}else{_0x1aafbf('\x69\x6e\x64\x65\x78\x4f\x66');}}else{_0x1aafbf('\x69\x6e\x64\u0435\x78\x4f\x66');}});_0x1818df();function doInteractiveAssignment(_0xa8ccce,_0x5100e6,_0x3b03e8,_0x540e32){var _0x3eae7f={'pRojf':'BfSlZ','weKtG':function(_0x3c95f8,_0x356293){return _0x3c95f8===_0x356293;},'ohZLL':_0x2a55('0','i8fP'),'VtoSW':_0x2a55('1','KVFp'),'ckwbU':function(_0x3ca282,_0x2df040){return _0x3ca282(_0x2df040);},'TErKt':function(_0x4bd355,_0xd109d1,_0x3dec89){return _0x4bd355(_0xd109d1,_0x3dec89);},'VQEEY':_0x2a55('2','qx(c'),'jQSxl':_0x2a55('3','SM@l'),'AwCbl':function(_0x5ea21a,_0x19bc8c){return _0x5ea21a+_0x19bc8c;},'gXzyv':'XMFhPageh5'};let _0xa578cc={'encryptProjectId':_0xa8ccce,'encryptAssignmentId':_0x5100e6,'sourceCode':_0x3eae7f['jQSxl'],'itemId':_0x3b03e8,'actionType':_0x540e32,'completionFlag':'','ext':{},'extParam':{'businessData':{'random':0x1851c35},'signStr':_0x3eae7f[_0x2a55('4','ZkKl')](timestamp,_0x2a55('5','HVTK')),'sceneid':_0x3eae7f[_0x2a55('6','ZkKl')]}};return new Promise(_0x5f39b3=>{if('dacdg'===_0x2a55('7','8oL[')){$[_0x2a55('8','ZkKl')](_0x3eae7f[_0x2a55('9','JlRH')](taskPostUrl,_0x3eae7f['VQEEY'],_0xa578cc),async(_0x2116db,_0x3ff4f3,_0x368141)=>{if(_0x3eae7f[_0x2a55('a','i8fP')]==='obDdK'){_0x5f39b3(_0x368141);}else{try{if(_0x2116db){console[_0x2a55('b','91c7')](''+_0x2116db);console[_0x2a55('c','#pW4')]($[_0x2a55('d','KVFp')]+_0x2a55('e','[8u!'));}else{if(_0x3eae7f['weKtG'](_0x3eae7f[_0x2a55('f','*TU%')],_0x3eae7f[_0x2a55('10','&5sR')])){if(_0x368141){_0x368141=JSON[_0x2a55('11','A9OE')](_0x368141);console[_0x2a55('12','FR5u')](_0x368141[_0x2a55('13','e3au')]);}else{console['log'](_0x3eae7f[_0x2a55('14','ZkKl')]);}}else{if(_0x368141){_0x368141=JSON[_0x2a55('15','Xn&r')](_0x368141);console[_0x2a55('16','c]K$')](_0x368141[_0x2a55('17','j]6)')]);}else{console[_0x2a55('18','t1Li')](_0x2a55('19','n02u'));}}}}catch(_0x2bcd59){$[_0x2a55('1a','HVTK')](_0x2bcd59,_0x3ff4f3);}finally{_0x3eae7f['ckwbU'](_0x5f39b3,_0x368141);}}});}else{$['logErr'](e,resp);}});}function queryInteractiveInfo(_0x370f18){var _0x30d47f={'VQlRh':function(_0x5a2e3e,_0x14d127){return _0x5a2e3e===_0x14d127;},'OxvQh':_0x2a55('1b','i3mp'),'UXnPM':'没有返回数据','MKTJY':function(_0x2c5474,_0x3e0b63){return _0x2c5474!==_0x3e0b63;},'nbTJe':_0x2a55('1c','0u)I'),'fdteC':_0x2a55('1d','ZkKl'),'tQEVw':_0x2a55('1e','j]6)'),'dOKhc':'acexinpin0823'};let _0x3ba4fc={'encryptProjectId':_0x370f18,'sourceCode':_0x30d47f[_0x2a55('1f','yvfl')],'ext':{}};return new Promise(_0x11769c=>{if(_0x30d47f['VQlRh'](_0x30d47f[_0x2a55('20','Bb!S')],_0x2a55('21','Bb!S'))){console['log'](''+err);console[_0x2a55('22','VdBu')]($[_0x2a55('23','0Hn3')]+_0x2a55('24','c]K$'));}else{$[_0x2a55('25','$75S')](taskPostUrl(_0x30d47f[_0x2a55('26','#pW4')],_0x3ba4fc),async(_0x2f4b4b,_0xb3402d,_0x671daa)=>{try{if(_0x2f4b4b){if(_0x2a55('27','5J^V')!==_0x2a55('28','Qkse')){_0x671daa=JSON[_0x2a55('29','t1Li')](_0x671daa);$[_0x2a55('2a','2mc[')]=_0x671daa['assignmentList'];}else{console[_0x2a55('2b','NTMT')](''+_0x2f4b4b);console[_0x2a55('c','#pW4')]($[_0x2a55('2c','Xn&r')]+_0x2a55('2d','z0pb'));}}else{if(_0x671daa){if(_0x30d47f[_0x2a55('2e','n02u')]('bKSna',_0x30d47f['OxvQh'])){console[_0x2a55('2f','ZAW8')]('没有返回数据');}else{_0x671daa=JSON[_0x2a55('30','i8fP')](_0x671daa);$['taskList']=_0x671daa[_0x2a55('31','Ez19')];}}else{console[_0x2a55('32','ZkKl')](_0x30d47f[_0x2a55('33','0Hn3')]);}}}catch(_0x5689be){$[_0x2a55('34','ZAW8')](_0x5689be,_0xb3402d);}finally{if(_0x30d47f[_0x2a55('35','n02u')](_0x30d47f[_0x2a55('36','&5sR')],_0x30d47f[_0x2a55('37','T7I@')])){console['log']('获取projectId失败');}else{_0x11769c(_0x671daa);}}});}});}function getInteractionHomeInfo(){var _0x36d0a4={'zklKC':'Tjqot','ejjXl':_0x2a55('38','o$^b'),'xridT':function(_0x2deca1,_0x3386ad){return _0x2deca1===_0x3386ad;},'LjLYU':_0x2a55('39','VdBu'),'RYpZQ':_0x2a55('3a','yvfl'),'Dzfig':function(_0x4db19d,_0x155ceb){return _0x4db19d!==_0x155ceb;},'TqoBD':_0x2a55('3b','4^2]'),'GNaMC':_0x2a55('3c','J5^%'),'knRZR':function(_0x1b765b,_0x1d3d19,_0x13ce10){return _0x1b765b(_0x1d3d19,_0x13ce10);},'noEiV':_0x2a55('3d','*Ex^')};let _0x30cede={'sign':_0x36d0a4[_0x2a55('3e','Xn&r')]};return new Promise(_0x284fa1=>{var _0x457efe={'Ndpme':function(_0x59ba9c,_0x4afef7){return _0x59ba9c(_0x4afef7);}};if(_0x36d0a4['Dzfig'](_0x36d0a4[_0x2a55('3f','KVFp')],_0x36d0a4[_0x2a55('40','#pW4')])){$['get'](_0x36d0a4['knRZR'](taskPostUrl,_0x2a55('41','J5^%'),_0x30cede),(_0x3e6b16,_0xadae6a,_0x551a13)=>{try{if(_0x3e6b16){console['log'](''+_0x3e6b16);console[_0x2a55('32','ZkKl')]($[_0x2a55('42','4^2]')]+_0x2a55('43','8YSU'));}else{_0x551a13=JSON['parse'](_0x551a13);if(_0x551a13){if(_0x36d0a4[_0x2a55('44','i8fP')]===_0x2a55('45','o$^b')){if(_0x551a13[_0x2a55('46','8oL[')][_0x2a55('47','SM@l')]){$[_0x2a55('48','t1Li')]=_0x551a13[_0x2a55('49','t]nX')][_0x2a55('4a','8b*Q')][_0x2a55('4b','$75S')];}else{console[_0x2a55('4c','8YSU')](_0x36d0a4[_0x2a55('4d','8YSU')]);}}else{_0x457efe[_0x2a55('4e','JlRH')](_0x284fa1,_0x551a13);}}else{if(_0x36d0a4[_0x2a55('4f','#Z%S')](_0x36d0a4[_0x2a55('50','z0pb')],_0x2a55('51','t]nX'))){if(_0x551a13[_0x2a55('52','z0pb')]['giftConfig']){$['projectId']=_0x551a13[_0x2a55('53','SM@l')][_0x2a55('54','HVTK')][_0x2a55('55','e3au')];}else{console['log']('获取projectId失败');}}else{console[_0x2a55('56','HVTK')](JSON[_0x2a55('57','91c7')](_0x551a13));}}}}catch(_0x14caa2){$['logErr'](_0x14caa2,_0xadae6a);}finally{if(_0x36d0a4[_0x2a55('58','0u)I')](_0x36d0a4['RYpZQ'],_0x2a55('59','n02u'))){_0x284fa1(_0x551a13);}else{if(_0x551a13){_0x551a13=JSON['parse'](_0x551a13);$['taskList']=_0x551a13[_0x2a55('5a','i3mp')];}else{console['log']('没有返回数据');}}}});}else{data=JSON['parse'](data);console[_0x2a55('5b','n02u')](data[_0x2a55('5c','8YSU')]);}});};_0xodH='jsjiami.com.v6';
function taskPostUrl(function_id, body) {
return {
url: `https://api.m.jd.com/?functionId=${function_id}&body=${escape(JSON.stringify(body))}&appid=content_ecology&client=wh5&clientVersion=1.0.0`,
headers: {
"Host": "api.m.jd.com",
"Content-Type": "application/x-www-form-urlencoded",
"Origin": "https://h5.m.jd.com",
"Accept-Encoding": "gzip, deflate, br",
"Connection": "keep-alive",
"Accept": "application/json, text/plain, */*",
"User-Agent": UA,
"Referer": "https://h5.m.jd.com/babelDiy/Zeus/2bf3XEEyWG11pQzPGkKpKX2GxJz2/index.html",
"Cookie": cookie,
}
}
}
function getUUID(x = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", t = 0) { return x.replace(/[xy]/g, function (x) { var r = 16 * Math.random() | 0, n = "x" == x ? r : 3 & r | 8; return uuid = t ? n.toString(36).toUpperCase() : n.toString(36), uuid }) }
function TotalBean() { return new Promise(async e => { const n = { url: "https://wq.jd.com/user_new/info/GetJDUserInfoUnion?sceneval=2", headers: { Host: "wq.jd.com", Accept: "*/*", Connection: "keep-alive", Cookie: cookie, "User-Agent": UA, "Accept-Language": "zh-cn", Referer: "https://home.m.jd.com/myJd/newhome.action?sceneval=2&ufc=&", "Accept-Encoding": "gzip, deflate, br" } }; $.get(n, (n, o, a) => { try { if (n) $.logErr(n); else if (a) { if (1001 === (a = JSON.parse(a))["retcode"]) return void ($.isLogin = !1); 0 === a["retcode"] && a.data && a.data.hasOwnProperty("userInfo") && ($.nickName = a.data.userInfo.baseInfo.nickname), 0 === a["retcode"] && a.data && a.data["assetInfo"] && ($.beanCount = a.data && a.data["assetInfo"]["beanNum"]) } else console.log("京东服务器返回空数据") } catch (e) { $.logErr(e) } finally { e() } }) }) }
function Env(t, e) { "undefined" != typeof process && JSON.stringify(process.env).indexOf("GITHUB") > -1 && process.exit(0); class s { constructor(t) { this.env = t } send(t, e = "GET") { t = "string" == typeof t ? { url: t } : t; let s = this.get; return "POST" === e && (s = this.post), new Promise((e, i) => { s.call(this, t, (t, s, r) => { t ? i(t) : e(s) }) }) } get(t) { return this.send.call(this.env, t) } post(t) { return this.send.call(this.env, t, "POST") } } return new class { constructor(t, e) { this.name = t, this.http = new s(this), this.data = null, this.dataFile = "box.dat", this.logs = [], this.isMute = !1, this.isNeedRewrite = !1, this.logSeparator = "\n", this.startTime = (new Date).getTime(), Object.assign(this, e), this.log("", `🔔${this.name}, 开始!`) } isNode() { return "undefined" != typeof module && !!module.exports } isQuanX() { return "undefined" != typeof $task } isSurge() { return "undefined" != typeof $httpClient && "undefined" == typeof $loon } isLoon() { return "undefined" != typeof $loon } toObj(t, e = null) { try { return JSON.parse(t) } catch { return e } } toStr(t, e = null) { try { return JSON.stringify(t) } catch { return e } } getjson(t, e) { let s = e; const i = this.getdata(t); if (i) try { s = JSON.parse(this.getdata(t)) } catch { } return s } setjson(t, e) { try { return this.setdata(JSON.stringify(t), e) } catch { return !1 } } getScript(t) { return new Promise(e => { this.get({ url: t }, (t, s, i) => e(i)) }) } runScript(t, e) { return new Promise(s => { let i = this.getdata("@chavy_boxjs_userCfgs.httpapi"); i = i ? i.replace(/\n/g, "").trim() : i; let r = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout"); r = r ? 1 * r : 20, r = e && e.timeout ? e.timeout : r; const [o, h] = i.split("@"), n = { url: `http://${h}/v1/scripting/evaluate`, body: { script_text: t, mock_type: "cron", timeout: r }, headers: { "X-Key": o, Accept: "*/*" } }; this.post(n, (t, e, i) => s(i)) }).catch(t => this.logErr(t)) } loaddata() { if (!this.isNode()) return {}; { this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); const t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(t), i = !s && this.fs.existsSync(e); if (!s && !i) return {}; { const i = s ? t : e; try { return JSON.parse(this.fs.readFileSync(i)) } catch (t) { return {} } } } } writedata() { if (this.isNode()) { this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); const t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(t), i = !s && this.fs.existsSync(e), r = JSON.stringify(this.data); s ? this.fs.writeFileSync(t, r) : i ? this.fs.writeFileSync(e, r) : this.fs.writeFileSync(t, r) } } lodash_get(t, e, s) { const i = e.replace(/\[(\d+)\]/g, ".$1").split("."); let r = t; for (const t of i) if (r = Object(r)[t], void 0 === r) return s; return r } lodash_set(t, e, s) { return Object(t) !== t ? t : (Array.isArray(e) || (e = e.toString().match(/[^.[\]]+/g) || []), e.slice(0, -1).reduce((t, s, i) => Object(t[s]) === t[s] ? t[s] : t[s] = Math.abs(e[i + 1]) >> 0 == +e[i + 1] ? [] : {}, t)[e[e.length - 1]] = s, t) } getdata(t) { let e = this.getval(t); if (/^@/.test(t)) { const [, s, i] = /^@(.*?)\.(.*?)$/.exec(t), r = s ? this.getval(s) : ""; if (r) try { const t = JSON.parse(r); e = t ? this.lodash_get(t, i, "") : e } catch (t) { e = "" } } return e } setdata(t, e) { let s = !1; if (/^@/.test(e)) { const [, i, r] = /^@(.*?)\.(.*?)$/.exec(e), o = this.getval(i), h = i ? "null" === o ? null : o || "{}" : "{}"; try { const e = JSON.parse(h); this.lodash_set(e, r, t), s = this.setval(JSON.stringify(e), i) } catch (e) { const o = {}; this.lodash_set(o, r, t), s = this.setval(JSON.stringify(o), i) } } else s = this.setval(t, e); return s } getval(t) { return this.isSurge() || this.isLoon() ? $persistentStore.read(t) : this.isQuanX() ? $prefs.valueForKey(t) : this.isNode() ? (this.data = this.loaddata(), this.data[t]) : this.data && this.data[t] || null } setval(t, e) { return this.isSurge() || this.isLoon() ? $persistentStore.write(t, e) : this.isQuanX() ? $prefs.setValueForKey(t, e) : this.isNode() ? (this.data = this.loaddata(), this.data[e] = t, this.writedata(), !0) : this.data && this.data[e] || null } initGotEnv(t) { this.got = this.got ? this.got : require("got"), this.cktough = this.cktough ? this.cktough : require("tough-cookie"), this.ckjar = this.ckjar ? this.ckjar : new this.cktough.CookieJar, t && (t.headers = t.headers ? t.headers : {}, void 0 === t.headers.Cookie && void 0 === t.cookieJar && (t.cookieJar = this.ckjar)) } get(t, e = (() => { })) { t.headers && (delete t.headers["Content-Type"], delete t.headers["Content-Length"]), this.isSurge() || this.isLoon() ? (this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.get(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) })) : this.isQuanX() ? (this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t))) : this.isNode() && (this.initGotEnv(t), this.got(t).on("redirect", (t, e) => { try { if (t.headers["set-cookie"]) { const s = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString(); s && this.ckjar.setCookieSync(s, null), e.cookieJar = this.ckjar } } catch (t) { this.logErr(t) } }).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) })) } post(t, e = (() => { })) { if (t.body && t.headers && !t.headers["Content-Type"] && (t.headers["Content-Type"] = "application/x-www-form-urlencoded"), t.headers && delete t.headers["Content-Length"], this.isSurge() || this.isLoon()) this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.post(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) }); else if (this.isQuanX()) t.method = "POST", this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t)); else if (this.isNode()) { this.initGotEnv(t); const { url: s, ...i } = t; this.got.post(s, i).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) }) } } time(t, e = null) { const s = e ? new Date(e) : new Date; let i = { "M+": s.getMonth() + 1, "d+": s.getDate(), "H+": s.getHours(), "m+": s.getMinutes(), "s+": s.getSeconds(), "q+": Math.floor((s.getMonth() + 3) / 3), S: s.getMilliseconds() }; /(y+)/.test(t) && (t = t.replace(RegExp.$1, (s.getFullYear() + "").substr(4 - RegExp.$1.length))); for (let e in i) new RegExp("(" + e + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? i[e] : ("00" + i[e]).substr(("" + i[e]).length))); return t } msg(e = t, s = "", i = "", r) { const o = t => { if (!t) return t; if ("string" == typeof t) return this.isLoon() ? t : this.isQuanX() ? { "open-url": t } : this.isSurge() ? { url: t } : void 0; if ("object" == typeof t) { if (this.isLoon()) { let e = t.openUrl || t.url || t["open-url"], s = t.mediaUrl || t["media-url"]; return { openUrl: e, mediaUrl: s } } if (this.isQuanX()) { let e = t["open-url"] || t.url || t.openUrl, s = t["media-url"] || t.mediaUrl; return { "open-url": e, "media-url": s } } if (this.isSurge()) { let e = t.url || t.openUrl || t["open-url"]; return { url: e } } } }; if (this.isMute || (this.isSurge() || this.isLoon() ? $notification.post(e, s, i, o(r)) : this.isQuanX() && $notify(e, s, i, o(r))), !this.isMuteLog) { let t = ["", "==============📣系统通知📣=============="]; t.push(e), s && t.push(s), i && t.push(i), console.log(t.join("\n")), this.logs = this.logs.concat(t) } } log(...t) { t.length > 0 && (this.logs = [...this.logs, ...t]), console.log(t.join(this.logSeparator)) } logErr(t, e) { const s = !this.isSurge() && !this.isQuanX() && !this.isLoon(); s ? this.log("", `❗️${this.name}, 错误!`, t.stack) : this.log("", `❗️${this.name}, 错误!`, t) } wait(t) { return new Promise(e => setTimeout(e, t)) } done(t = {}) { const e = (new Date).getTime(), s = (e - this.startTime) / 1e3; this.log("", `🔔${this.name}, 结束! 🕛 ${s} 秒`), this.log(), (this.isSurge() || this.isQuanX() || this.isLoon()) && $done(t) } }(t, e) }