KR/jd_fruit_friend.js

26 lines
67 KiB
JavaScript
Raw Normal View History

2023-07-27 16:14:01 +08:00
/*
东东水果:脚本更新地址 jd_fruit_friend.js
更新时间2021-5-18
活动入口京东APP我的-更多工具-东东农场
==========================Quantumultx=========================
[task_local]
2023-08-25 03:59:57 +08:00
#东东农场好友删减奖励
2023-07-27 16:14:01 +08:00
10 2 * * * jd_fruit_friend.js, tag=东东农场好友删减奖励, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jdnc.png, enabled=true
=========================Loon=============================
[Script]
cron "10 2 * * *" script-path=jd_fruit_friend.js,tag=东东农场好友删减奖励
=========================Surge============================
东东农场好友删减奖励 = type=cron,cronexp="10 2 * * *",wake-system=1,timeout=3600,script-path=jd_fruit_friend.js
=========================小火箭===========================
东东农场好友删减奖励 = type=cron,script-path=jd_fruit_friend.js, cronexpr="10 2 * * *", timeout=3600, enable=true
*/
2023-10-31 01:29:11 +08:00
const $ = new Env('东东农场好友删减奖励')
2023-10-31 14:50:30 +08:00
var version_='jsjiami.com.v7';const liiiIl=iii1II;(function(I1lI1l,i11ii,lIiIi,Il1i,lIiIl,iiil1l,Il1l){return I1lI1l=I1lI1l>>0x7,iiil1l='hs',Il1l='hs',function(ll11I1,Illll,iiil1i,ilIIli,ilIIll){const Iii1ll=iii1II;ilIIli='tfi',iiil1l=ilIIli+iiil1l,ilIIll='up',Il1l+=ilIIll,iiil1l=iiil1i(iiil1l),Il1l=iiil1i(Il1l),iiil1i=0x0;const iIliil=ll11I1();while(!![]&&--Il1i+Illll){try{ilIIli=parseInt(Iii1ll(0x2db,')uMf'))/0x1+-parseInt(Iii1ll(0x30d,'ea6('))/0x2+parseInt(Iii1ll(0x1ac,'W9cY'))/0x3*(parseInt(Iii1ll(0x193,'K(cx'))/0x4)+-parseInt(Iii1ll(0x2af,'WaI9'))/0x5*(parseInt(Iii1ll(0x2e2,'$cSf'))/0x6)+-parseInt(Iii1ll(0x293,'(iep'))/0x7+parseInt(Iii1ll(0x32b,'Gswo'))/0x8+parseInt(Iii1ll(0x225,'[!Qh'))/0x9;}catch(IIiill){ilIIli=iiil1i;}finally{ilIIll=iIliil[iiil1l]();if(I1lI1l<=Il1i)iiil1i?lIiIl?ilIIli=ilIIll:lIiIl=ilIIll:iiil1i=ilIIll;else{if(iiil1i==lIiIl['replace'](/[TtRQEXSlkOIrVnNfDwh=]/g,'')){if(ilIIli===Illll){iIliil['un'+iiil1l](ilIIll);break;}iIliil[Il1l](ilIIll);}}}}}(lIiIi,i11ii,function(liIIii,Iii1lI,I1liii,liiiIi,l1I11I,I1liil,IliIi1){return Iii1lI='\x73\x70\x6c\x69\x74',liIIii=arguments[0x0],liIIii=liIIii[Iii1lI](''),I1liii=`\x72\x65\x76\x65\x72\x73\x65`,liIIii=liIIii[I1liii]('\x76'),liiiIi=`\x6a\x6f\x69\x6e`,(0x14536f,liIIii[liiiIi](''));});}(0x6000,0xd2b49,Iii11l,0xc2),Iii11l)&&(version_=liiiIl(0x16c,'yG(s'));const lllIl=require('./function/jdCommon'),Iliii=require(liiiIl(0xc2,'W9cY')),illlii=require('./function/krgetToken');let I1lIIi=[],l1i1i='',I1iI1i=![],l1i1l,I1iI1l='',illlil=[],Iliil='',I1lIIl='',l1ilI1={},l1l1Il=![];const lil1I=$[liiiIl(0x23b,'CZWa')]()?process[liiiIl(0x2c1,'O27N')][liiiIl(0x15d,'K(cx')]?process[liiiIl(0x242,'hMUS')]['retainWater']:0x64:$[liiiIl(0xc5,'fkg%')](liiiIl(0x1af,'r8u6'))?$[liiiIl(0x9f,'[!Qh')](liiiIl(0x143,'uSoT')):0x64;let l1l1Ii=!![],IIIIlI=![];const l1i11l=liiiIl(0x29d,'vQ4f'),liiil1=liiiIl(0x118,'3ZAY');let lllII=I1I1i1(0x28),l11iII=I1I1i1(0xa,liiiIl(0x20b,'3ZAY')),l1i11i=I1I1i1(0x20,liiiIl(0x222,'D56U')),l11iI1=I1I1i1(0x2,liiiIl(0x1fd,'uSoT'))+'-'+I1I1i1(0x4,liiiIl(0x1fa,'N3oR'))+'-'+I1I1i1(0x4,liiiIl(0x2b7,'3Qx3'))+'-'+I1I1i1(0x5,liiiIl(0x1eb,'1JbC')),IliiI=liiiIl(0x156,'(iep')+Math['floor'](Math[liiiIl(0x287,'H(rt')]()*0x383+0x64),lI111i='29.503'+Math['floor'](Math[liiiIl(0x23f,'uZ4j')]()*0x383+0x64),I1lIII='',liIlll=new Date()[liiiIl(0x306,'r8u6')](),I1iI1I=!![];const illll1=require('fs');let IIIIl1=![],liiilI='./Fruit_ShareCache.json',lI111l=illll1[liiiIl(0xa9,')uMf')](liiilI),liiii1=[];lI111l&&(console[liiiIl(0x2f8,'$cSf')]('检测到东东农场缓存文件Fruit_ShareCache.json载入...'),liiii1=illll1['readFileSync'](liiilI,liiiIl(0x1dd,'N3oR')),liiii1&&(liiii1=liiii1[liiiIl(0x17e,'^QK2')](),liiii1=JSON[liiiIl(0x2a4,'BLg$')](liiii1)));let IIiiIl=0x0,l1ilIl=![];!(async()=>{const liIIiI=liiiIl,i1I1i={'upJTq':function(llIiI,Ilill){return llIiI==Ilill;},'idqcJ':liIIiI(0xba,'dLs#'),'GmPiM':liIIiI(0x12a,'WaI9'),'JrfMS':'\x0a【缓存文件Fruit_ShareCache.json更新成功!】\x0a','kWHpo':function(Ilili){return Ilili();},'aBrJK':liIIiI(0x1f8,'H(rt'),'QJnWx':'TSQoR','VREOi':function(I1ll1I,Iii1I1){return I1ll1I<Iii1I1;},'OgPDr':function(i11iI1,Iii1II){return i11iI1+Iii1II;},'EiXMu':function(llIlI){return llIlI();},'dKYof':function(l1iIil,l1iIii){return l1iIil*l1iIii;},'NamgY':liIIiI(0x10a,'uSoT'),'FJOCO':liIIiI(0x14b,'6t$p'),'VIWDn':function(illllI,II1II){return illllI(II1II);}};await i1I1i[liIIiI(0x1a3,'D56U')](I1ll1l);if(!I1lIIi[0x0]){$[liIIiI(0x1c2,'YpP8')]($[liIIiI(0x279,'(iep')],'【提示】请先获取京东账号一cookie\x0a直接使用NobyDa的京东签到获取',i1I1i[liIIiI(0x28d,'W9cY')],{'open-url':i1I1i[liIIiI(0x250,'hMUS')]});return;}console['log'](liIIiI(0x2ff,'3Qx3'));if(I1iI1I){if(i1I1i[liIIiI(0x2d6,'[Sgt')]!==i1I1i[liIIiI(0x153,'WaI9')]){if(i1I1i[liIIiI(0x154,'K(cx')](typeof illIi1,i1I1i[liIIiI(0xda,'vQ4f')]))try{return iii1ii['parse'](il1iIi);}catch(IIIIii){return iIIiiI[liIIiI(0xef,'Gswo')](IIIIii),liiI1i['msg'](ililIi[liIIiI(0x279,'(iep')],'',i1I1i[liIIiI(0x32c,'YpP8')]),[];}}else{console['log'](liIIiI(0x186,'vQ4f'));for(let liiill=0x0;i1I1i['VREOi']
2023-07-27 16:14:01 +08:00
// prettier-ignore
2023-08-25 03:59:57 +08:00
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