jdpro/jd_gwfd.js

10 lines
37 KiB
JavaScript
Raw Normal View History

2024-01-02 12:59:48 +00:00
/*
非plus购物返豆领取
https://raw.githubusercontent.com/6dylan6/jdpro/main/jd_gwfd.js
updatetime:2023/4/29
*/
const $ = new Env('购物返豆领取');
var version_='jsjiami.com.v7';const IIi1lI11=ilii1ili;function ilii1ili(_0x1550c7,_0x588f1b){const _0x507a32=iiI1Il1l();return ilii1ili=function(_0x3c534a,_0xeee196){_0x3c534a=_0x3c534a-0x13c;let _0x27c691=_0x507a32[_0x3c534a];if(ilii1ili['AtOOsn']===undefined){var _0x126c9f=function(_0x1be29a){const _0x23c556='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x5941c7='',_0x41b8f8='',_0x20aaac=_0x5941c7+_0x126c9f;for(let _0xf1b48b=0x0,_0x4e9c11,_0x12b350,_0xf4da15=0x0;_0x12b350=_0x1be29a['charAt'](_0xf4da15++);~_0x12b350&&(_0x4e9c11=_0xf1b48b%0x4?_0x4e9c11*0x40+_0x12b350:_0x12b350,_0xf1b48b++%0x4)?_0x5941c7+=_0x20aaac['charCodeAt'](_0xf4da15+0xa)-0xa!==0x0?String['fromCharCode'](0xff&_0x4e9c11>>(-0x2*_0xf1b48b&0x6)):_0xf1b48b:0x0){_0x12b350=_0x23c556['indexOf'](_0x12b350);}for(let _0x2f74b4=0x0,_0x70bf06=_0x5941c7['length'];_0x2f74b4<_0x70bf06;_0x2f74b4++){_0x41b8f8+='%'+('00'+_0x5941c7['charCodeAt'](_0x2f74b4)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x41b8f8);};const _0x339d29=function(_0x5d19d2,_0x2ba503){let _0x1f6d21=[],_0x1f3e32=0x0,_0x32886a,_0x385109='';_0x5d19d2=_0x126c9f(_0x5d19d2);let _0x985890;for(_0x985890=0x0;_0x985890<0x100;_0x985890++){_0x1f6d21[_0x985890]=_0x985890;}for(_0x985890=0x0;_0x985890<0x100;_0x985890++){_0x1f3e32=(_0x1f3e32+_0x1f6d21[_0x985890]+_0x2ba503['charCodeAt'](_0x985890%_0x2ba503['length']))%0x100,_0x32886a=_0x1f6d21[_0x985890],_0x1f6d21[_0x985890]=_0x1f6d21[_0x1f3e32],_0x1f6d21[_0x1f3e32]=_0x32886a;}_0x985890=0x0,_0x1f3e32=0x0;for(let _0x1621ed=0x0;_0x1621ed<_0x5d19d2['length'];_0x1621ed++){_0x985890=(_0x985890+0x1)%0x100,_0x1f3e32=(_0x1f3e32+_0x1f6d21[_0x985890])%0x100,_0x32886a=_0x1f6d21[_0x985890],_0x1f6d21[_0x985890]=_0x1f6d21[_0x1f3e32],_0x1f6d21[_0x1f3e32]=_0x32886a,_0x385109+=String['fromCharCode'](_0x5d19d2['charCodeAt'](_0x1621ed)^_0x1f6d21[(_0x1f6d21[_0x985890]+_0x1f6d21[_0x1f3e32])%0x100]);}return _0x385109;};ilii1ili['rAVvZK']=_0x339d29,_0x1550c7=arguments,ilii1ili['AtOOsn']=!![];}const _0x38c2ae=_0x507a32[0x0],_0x5d637b=_0x3c534a+_0x38c2ae,_0x1f4790=_0x1550c7[_0x5d637b];if(!_0x1f4790){if(ilii1ili['VJNiRH']===undefined){const _0x1f2fa7=function(_0x3bad09){this['fHgKAn']=_0x3bad09,this['PJdOux']=[0x1,0x0,0x0],this['DObGeL']=function(){return'newState';},this['MoesyQ']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['jjGnGN']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x1f2fa7['prototype']['xNPCuP']=function(){const _0xbb3af1=new RegExp(this['MoesyQ']+this['jjGnGN']),_0x354fdb=_0xbb3af1['test'](this['DObGeL']['toString']())?--this['PJdOux'][0x1]:--this['PJdOux'][0x0];return this['nQjBdA'](_0x354fdb);},_0x1f2fa7['prototype']['nQjBdA']=function(_0x17e278){if(!Boolean(~_0x17e278))return _0x17e278;return this['aZIxOp'](this['fHgKAn']);},_0x1f2fa7['prototype']['aZIxOp']=function(_0x14faf1){for(let _0xa191fa=0x0,_0x3fd26c=this['PJdOux']['length'];_0xa191fa<_0x3fd26c;_0xa191fa++){this['PJdOux']['push'](Math['round'](Math['random']())),_0x3fd26c=this['PJdOux']['length'];}return _0x14faf1(this['PJdOux'][0x0]);},new _0x1f2fa7(ilii1ili)['xNPCuP'](),ilii1ili['VJNiRH']=!![];}_0x27c691=ilii1ili['rAVvZK'](_0x27c691,_0xeee196),_0x1550c7[_0x5d637b]=_0x27c691;}else _0x27c691=_0x1f4790;return _0x27c691;},ilii1ili(_0x1550c7,_0x588f1b);}(function(lII11ll1,il11I11i,iIiIll,Ilil111i,iIll1i1,Ii1lIliI,li111l1l){return lII11ll1=lII11ll1>>0x9,Ii1lIliI='hs',li111l1l='hs',function(I1l1IlII,l11I1Ii,III11lIl,I11Ii1I,l1Il1111){const llIiiiI1=ilii1ili;I11Ii1I='tfi',Ii1lIliI=I11Ii1I+Ii1lIliI,l1Il1111='up',li111l1l+=l1Il1111,Ii1lIliI=III11lIl(Ii1lIliI),li111l1l=III11lIl(li111l1l),III11lIl=0x0;const ilI11IlI=I1l1IlII();while(!![]&&--Ilil111i+l11I1Ii){try{I11Ii1I=-parseInt(llIiiiI1(0x24e,'H1r&'))/0x1*(-parseInt(llIiiiI1(0x222,'pX*A'))/0x2)+parseInt(llIiiiI1(0x1df,'pX*A'))/0x3*(parseInt(llIiiiI1(0x230,'D&0p'))/0x4)+parseInt(llIiiiI1(0x28c,'%l0c'))/0x5*(parseInt(llIiiiI1(0x1eb,'%&g@'))/0x6)+parseInt(llIiiiI1(0x297,'OCpu'))/0x7+parseInt(llIiiiI1(0x13e,'pX*A'))/0x8*(-parseInt(llIiiiI1(0x21f,'e#0u'))/0x9)+-parseInt(llIiiiI1(0x24d,'@cDk'))/0xa*(-parseInt(llIiiiI1(0x146,'9)^W'))/0xb)
// 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