mirror of https://github.com/KingRan/KR.git
18 lines
62 KiB
JavaScript
18 lines
62 KiB
JavaScript
|
/*
|
|||
|
临期京豆续命
|
|||
|
更新时间:2023-6-27
|
|||
|
已支持IOS双京东账号,Node.js支持N个京东账号
|
|||
|
脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js
|
|||
|
|
|||
|
定时自行修改。请勿频繁跑动,容易风控。
|
|||
|
|
|||
|
============Quantumultx===============
|
|||
|
[task_local]
|
|||
|
#临期京豆续命
|
|||
|
11 11 11 11 * jd_exchange.js, tag=临期京豆续命, img-url=https://raw.githubusercontent.com/Orz-3/mini/master/Color/jd.png, enabled=true
|
|||
|
*/
|
|||
|
|
|||
|
const $ = new Env('临期京豆续命');
|
|||
|
var version_='jsjiami.com.v7';const Il1I1i=iii1II;(function(i1Iil,lIi11i,i1Iii,IIiI1I,lIi11l,i1IlI,lIl1Ii){return i1Iil=i1Iil>>0x4,i1IlI='hs',lIl1Ii='hs',function(lIl1Il,Ii1IlI,Il1I1I,ll1Il1,li11li){const I1IIli=iii1II;ll1Il1='tfi',i1IlI=ll1Il1+i1IlI,li11li='up',lIl1Ii+=li11li,i1IlI=Il1I1I(i1IlI),lIl1Ii=Il1I1I(lIl1Ii),Il1I1I=0x0;const iliiii=lIl1Il();while(!![]&&--IIiI1I+Ii1IlI){try{ll1Il1=parseInt(I1IIli(0x1f0,'C(yR'))/0x1*(-parseInt(I1IIli(0xec,'%AaZ'))/0x2)+parseInt(I1IIli(0x239,'%AaZ'))/0x3*(parseInt(I1IIli(0x13f,'F0Uh'))/0x4)+-parseInt(I1IIli(0x2a3,'kt!5'))/0x5+parseInt(I1IIli(0x190,'yprL'))/0x6*(-parseInt(I1IIli(0x15b,'4%%0'))/0x7)+parseInt(I1IIli(0x187,'2BSk'))/0x8*(parseInt(I1IIli(0xd9,'yrEK'))/0x9)+parseInt(I1IIli(0x267,'A18c'))/0xa*(parseInt(I1IIli(0x28e,'yrEK'))/0xb)+parseInt(I1IIli(0x163,'GVm*'))/0xc;}catch(IIlIIi){ll1Il1=Il1I1I;}finally{li11li=iliiii[i1IlI]();if(i1Iil<=IIiI1I)Il1I1I?lIi11l?ll1Il1=li11li:lIi11l=li11li:Il1I1I=li11li;else{if(Il1I1I==lIi11l['replace'](/[HOlIbhSVBAfMRNWJL=]/g,'')){if(ll1Il1===Ii1IlI){iliiii['un'+i1IlI](li11li);break;}iliiii[lIl1Ii](li11li);}}}}}(i1Iii,lIi11i,function(iliiil,li11ll,i1Il1,li1l1,IIiI1l,IIiI1i,ilIllI){return li11ll='\x73\x70\x6c\x69\x74',iliiil=arguments[0x0],iliiil=iliiil[li11ll](''),i1Il1='\x72\x65\x76\x65\x72\x73\x65',iliiil=iliiil[i1Il1]('\x76'),li1l1='\x6a\x6f\x69\x6e',(0x132a22,iliiil[li1l1](''));});}(0xc90,0x8fb27,Iii11l,0xcb),Iii11l)&&(version_=Iii11l);const l1lil1=$['isNode']()?require(Il1I1i(0x2df,'DF55')):'',i1lil=require(Il1I1i(0x12d,'2BSk')),I1iIl=Il1I1i(0x18b,'NQRY'),IilII=require('./function/krgetToken'),ili1l=require('./function/krgetSign'),i1lii=process[Il1I1i(0x293,'C(yR')][Il1I1i(0x1e8,'b%jE')]||'',iilIII=$[Il1I1i(0x15e,'8aKz')]()?require(Il1I1i(0x1c6,'s4d6')):'';CryptoJS=$['isNode']()?require(Il1I1i(0x1a9,']b6z')):CryptoJS;let liI1Il=[],I1iIi='',iiiI1I=!![];process[Il1I1i(0x230,')IF5')][Il1I1i(0x1b7,'MeSj')]&&(iiiI1I=process['env'][Il1I1i(0x242,'%AaZ')]||Il1I1i(0xdc,'oE*x'));if($[Il1I1i(0x2d5,'7h!b')]()){Object[Il1I1i(0x281,'s4d6')](iilIII)[Il1I1i(0x21f,'XQ4v')](l1lill=>{const lIilI1=Il1I1i;liI1Il[lIilI1(0x320,'O5yg')](iilIII[l1lill]);});if(process['env'][Il1I1i(0x192,'8aKz')]&&process[Il1I1i(0x265,'89N%')][Il1I1i(0x15d,'7h!b')]===Il1I1i(0x114,'%AaZ'))console[Il1I1i(0xcf,']b6z')]=()=>{};}else liI1Il=[$[Il1I1i(0x1e0,'4%%0')](Il1I1i(0x276,'CXWd')),$[Il1I1i(0x180,'2leo')]('CookieJD2'),...i1Iili($[Il1I1i(0x117,'n)C5')](Il1I1i(0x2c9,'V%2&'))||'[]')[Il1I1i(0x19f,'U3tu')](i1li1=>i1li1[Il1I1i(0x326,'kt!5')])][Il1I1i(0x26b,'sYiv')](iIIllI=>!!iIIllI);let lilI11='';!(async()=>{const Il1I1l=Il1I1i,I1Ill1={'MImyY':function(ili11){return ili11();},'BfADo':function(IiIiIi,llIIIl){return IiIiIi!==llIIIl;},'kIrnr':'【提示】请先获取京东账号一cookie\x0a直接使用NobyDa的京东签到获取','WOAUq':Il1I1l(0x169,'V%2&'),'VpAzn':function(IIlI1I,llIIIi){return IIlI1I+llIIIi;},'gQZzQ':function(IiIiIl,I1Ilil){return IiIiIl+I1Ilil;},'EdYDY':function(l1I1I1,I1Ilii){return l1I1I1+I1Ilii;},'kkUnl':function(l1Iii,l1Iil){return l1Iii+l1Iil;},'ZEbpI':function(III1Ii,III1Il){return III1Ii!==III1Il;},'rnLGl':'tKOhV'};if(!liI1Il[0x0]){if(I1Ill1[Il1I1l(0x2d6,'4%%0')]('rsSgF','rsSgF'))I1Ill1[Il1I1l(0x2c4,'riZ6')](IilIll);else{$[Il1I1l(0x330,'VGm4')]($['name'],I1Ill1[Il1I1l(0x2eb,'b%jE')],I1Ill1['WOAUq'],{'open-url':Il1I1l(0x338,'XQ4v')});return;}}for(let IiIil=0x0;IiIil<liI1Il['length'];IiIil++){if(liI1Il[IiIil]){I1iIi=liI1Il[IiIil],$[Il1I1l(0x14b,'7h!b')]=decodeURIComponent(I1iIi[Il1I1l(0x1b3,']b6z')](/pt_pin=([^; ]+)(?=;?)/)&&I1iIi[Il1I1l(0x229,'U3tu')](/pt_pin=([^; ]+)(?=;?)/)[0x1]),$[Il1I1l(0x2f9,'sAOS')]=I1Ill1[Il1I1l(0x16b,']b6z')](IiIil,0x1),$['isLogin']=!![],$[Il1I1l(0x16f,'sYiv')]='',message='',expirebeans=0x0,console[Il1I1l(0x348,'kt!5')](I1Ill1[Il1I1l(0x233,'VGm4')](I1Ill1[Il1I1l(0x1a0,'O5yg')](I1Ill1[Il1I1l(0x179,'XQ4v')](I1Ill1[Il1I1l(0x20f,'%DlW')](Il1I1l(0x13e,']b6z'),$['index']),'】'),$[Il1I1l(0x197,'GVm*')]||$[Il1I1l(0x20c,'kt!5')]),'\x0a'));if(!$['isLogin']){$[Il1I1l(0x15c,'s4d6')]($[Il1I1l(0xdb,'C(yR')],'【提示】cookie已失效',Il1I1l(0x191,'
|
|||
|
// 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
|