mirror of https://github.com/KingRan/KR.git
13 lines
41 KiB
JavaScript
13 lines
41 KiB
JavaScript
|
/*
|
|||
|
远程获取,自行运行
|
|||
|
cron:1 1 1 1 *
|
|||
|
============Quantumultx===============
|
|||
|
[task_local]
|
|||
|
#魔方红包雨
|
|||
|
1 1 1 1 * jd_mfredrain.js, tag=魔方红包雨, enabled=true
|
|||
|
*/
|
|||
|
|
|||
|
const $ = new Env('魔方红包雨');
|
|||
|
var version_='jsjiami.com.v7';const llIl1I=iii1II;(function(iI111i,I1I1l1,iI111l,i1lIii,III11i,i1lIil,III11l){return iI111i=iI111i>>0x3,i1lIil='hs',III11l='hs',function(llIl1i,llIl1l,IiiII,Iiil,IIIli){const IIIlIi=iii1II;Iiil='tfi',i1lIil=Iiil+i1lIil,IIIli='up',III11l+=IIIli,i1lIil=IiiII(i1lIil),III11l=IiiII(III11l),IiiII=0x0;const ii1i1=llIl1i();while(!![]&&--i1lIii+llIl1l){try{Iiil=-parseInt(IIIlIi(0x10b,'x8PS'))/0x1*(-parseInt(IIIlIi(0x1ac,'zc@3'))/0x2)+parseInt(IIIlIi(0x18b,')7l$'))/0x3+parseInt(IIIlIi(0xe2,']eyO'))/0x4+parseInt(IIIlIi(0x184,'aoI%'))/0x5*(parseInt(IIIlIi(0x11c,'Y$np'))/0x6)+-parseInt(IIIlIi(0xc3,'x8PS'))/0x7*(parseInt(IIIlIi(0xee,'yKbN'))/0x8)+parseInt(IIIlIi(0x19a,'#4y8'))/0x9+-parseInt(IIIlIi(0x1d9,'&NSA'))/0xa;}catch(Iiii){Iiil=IiiII;}finally{IIIli=ii1i1[i1lIil]();if(iI111i<=i1lIii)IiiII?III11i?Iiil=IIIli:III11i=IIIli:IiiII=IIIli;else{if(IiiII==III11i['replace'](/[LOgduMtGSAPEDYQUVpNwy=]/g,'')){if(Iiil===llIl1l){ii1i1['un'+i1lIil](IIIli);break;}ii1i1[III11l](IIIli);}}}}}(iI111l,I1I1l1,function(llIl11,IIIll,I1I1il,l1llii,liII1,I1I1ii,l1llil){return IIIll='\x73\x70\x6c\x69\x74',llIl11=arguments[0x0],llIl11=llIl11[IIIll](''),I1I1il='\x72\x65\x76\x65\x72\x73\x65',llIl11=llIl11[I1I1il]('\x76'),l1llii='\x6a\x6f\x69\x6e',(0x130786,llIl11[l1llii](''));});}(0x668,0x52a7e,Iii11l,0xcf),Iii11l)&&(version_=Iii11l);const notify=$['isNode']()?require('./sendNotify'):'',jdCookieNode=$[llIl1I(0x19d,'q@)4')]()?require('./jdCookie.js'):'',getToken=require('./function/krgetToken');let jdNotify=!![],cookiesArr=[],cookie='',message='';if($['isNode']()){Object[llIl1I(0x190,'%8y1')](jdCookieNode)[llIl1I(0xde,'hY)n')](iiliI=>{const i1lIl1=llIl1I;cookiesArr[i1lIl1(0x138,'1vze')](jdCookieNode[iiliI]);});if(process['env'][llIl1I(0xeb,'aE[(')]&&process[llIl1I(0x133,'I@Iz')]['JD_DEBUG']===llIl1I(0x1cb,'tWsN'))console[llIl1I(0x1af,'t0VF')]=()=>{};}else cookiesArr=[$[llIl1I(0xed,'tWsN')](llIl1I(0x1bb,'^np$')),$[llIl1I(0x12d,'3x13')](llIl1I(0xe4,'KN#9')),...jsonParse($[llIl1I(0x18c,'0#Xs')](llIl1I(0xe3,'edjD'))||'[]')[llIl1I(0x110,'9O(z')](Ill11I=>Ill11I[llIl1I(0x197,'UFtc')])]['filter'](I1il1i=>!!I1il1i);const JD_API_HOST='https://api.m.jd.com/client.action';!(async()=>{const liIli1=llIl1I,IliIIi={'LSTQn':'【提示】请先获取京东账号一cookie\x0a直接使用NobyDa的京东签到获取','FwFXC':'https://bean.m.jd.com/bean/signIndex.action','iDZGx':function(i1iil,llI11l){return i1iil+llI11l;},'Wmqhn':liIli1(0x1a6,'i%uK'),'Ccwrn':liIli1(0x115,'%5rk'),'zYgmk':function(I1llIl,i1iii){return I1llIl(i1iii);},'oQzic':'\x0a暂无活动~\x0a','eXCCM':function(I1llIi,IIii1I){return I1llIi<IIii1I;},'CnAvj':function(llI11i,i1iIi1){return llI11i!==i1iIi1;},'BFRmk':liIli1(0x1c8,')7l$'),'OplHR':liIli1(0x1be,'W0&1'),'PuRWS':function(l1l1il,I11i1I){return l1l1il+I11i1I;},'EPXtL':function(iliIi1,l1l1ii){return iliIi1<l1l1ii;}};if(!cookiesArr[0x0]){$[liIli1(0x1d0,'1dsN')]($[liIli1(0x1b4,'%8y1')],IliIIi[liIli1(0xc5,'mw9U')],IliIIi['FwFXC'],{'open-url':IliIIi[liIli1(0x15b,'aoI%')]});return;}let lI1l1i=IliIIi[liIli1(0xce,'a%F0')](IliIIi[liIli1(0x137,'Jb3e')],liIli1(0xc6,'j#M7'))+IliIIi['Ccwrn'];authorCodeList=await IliIIi[liIli1(0xc8,'Xk)U')](getAuthorCodeList,lI1l1i);if(authorCodeList[liIli1(0x104,'ssel')]<=0x0){console[liIli1(0x1af,'t0VF')](IliIIi[liIli1(0x13b,'E7dC')]);return;}for(let Il1i1I=0x0;IliIIi[liIli1(0x19b,'#4y8')](Il1i1I,cookiesArr['length']);Il1i1I++){if(cookiesArr[Il1i1I]){if(IliIIi[liIli1(0x1b3,'aE[(')](IliIIi['BFRmk'],IliIIi[liIli1(0xc1,'gq^L')])){cookie=cookiesArr[Il1i1I],$[liIli1(0xcf,'1vze')]=decodeURIComponent(cookie[liIli1(0x16c,'mw9U')](/pt_pin=([^; ]+)(?=;?)/)&&cookie[liIli1(0x1dc,'5TSJ')](/pt_pin=([^; ]+)(?=;?)/)[0x1]),$['index']=Il1i1I+0x1,$[liIli1(0x13e,'&xGJ')]=!![],$['nickName']='',UA=getUA(),console[liIli1(0x13c,'9O(z')](IliIIi[liIli1(0xca,'^np$')](IliIIi['PuRWS'](liIli1(0x182,'ZH$v'),$['index'])+'】'+($[liIli1(0x153,'E7dC')]||$[liIli1(0x1c1,'aoI%')]),'\x0a'));if(!$[liIli1(0x17f,'i%uK')]){$[liIli1(0x109,')7l$')]($['name'],liIli1(0x16e,'&NSA'),'京东账号'+$['index']+'\x20'+($['nickName']||$[liIli1(0x185,'%8y1'
|
|||
|
// prettier-ignore
|
|||
|
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.d
|