faker3/jd_fruit_friend.js

16 lines
67 KiB
JavaScript
Raw Normal View History

2024-06-28 15:38:28 +08:00
/*
东东农场好友删减奖励 jd_fruit_friend.js
活动入口京东APP我的-更多工具-东东农场
#东东农场好友删减奖励
cron "10 2 * * *" script-path=jd_fruit_friend.js,tag=东东农场好友删减奖励
*/
const $ = new Env('东东农场好友删减奖励')
var il='jsjiami.com.v7';const I1lI1i=iii1II;(function(iill1l,IiIiII,iill1i,l1Il1,iill11,I1IliI,III1II){return iill1l=iill1l>>0x7,I1IliI='hs',III1II='hs',function(l1I1II,iIIlil,IiIiI1,iIIlii,llIII1){const lIIi1l=iii1II;iIIlii='tfi',I1IliI=iIIlii+I1IliI,llIII1='up',III1II+=llIII1,I1IliI=IiIiI1(I1IliI),III1II=IiIiI1(III1II),IiIiI1=0x0;const IiIiI=l1I1II();while(!![]&&--l1Il1+iIIlil){try{iIIlii=-parseInt(lIIi1l(0x25f,'&kX$'))/0x1+-parseInt(lIIi1l(0x140,'Z6)h'))/0x2*(parseInt(lIIi1l(0x1d6,'i6We'))/0x3)+parseInt(lIIi1l(0x1fa,'Q0H!'))/0x4+parseInt(lIIi1l(0x345,'wPEq'))/0x5+parseInt(lIIi1l(0x37d,'4gV7'))/0x6*(parseInt(lIIi1l(0x22e,'iA3a'))/0x7)+parseInt(lIIi1l(0x374,'iA3a'))/0x8+parseInt(lIIi1l(0x2c7,'loVm'))/0x9;}catch(iill1I){iIIlii=IiIiI1;}finally{llIII1=IiIiI[I1IliI]();if(iill1l<=l1Il1)IiIiI1?iill11?iIIlii=llIII1:iill11=llIII1:IiIiI1=llIII1;else{if(IiIiI1==iill11['replace'](/[QgBUMwKdVlJhLIROkrY=]/g,'')){if(iIIlii===iIIlil){IiIiI['un'+I1IliI](llIII1);break;}IiIiI[III1II](llIII1);}}}}}(iill1i,IiIiII,function(Illi1,l1iiIl,lIIi1i,liI11I,III1,l1IIl1,l1iiIi){return l1iiIl='\x73\x70\x6c\x69\x74',Illi1=arguments[0x0],Illi1=Illi1[l1iiIl](''),lIIi1i=`\x72\x65\x76\x65\x72\x73\x65`,Illi1=Illi1[lIIi1i]('\x76'),liI11I=`\x6a\x6f\x69\x6e`,(0x159f9c,Illi1[liI11I](''));});}(0x6280,0x83241,Iii11l,0xc7),Iii11l)&&(il=0xc7);const notify=$['isNode']()?require(I1lI1i(0x19a,')S0F')):'',jdCookieNode=$['isNode']()?require(I1lI1i(0x184,'loVm')):'';let cookiesArr=[],cookie='',jdFruitShareArr=[],isBox=![],allMessage='',message='',subTitle='',option={},isFruitFinished=![];if($[I1lI1i(0x343,'UtiQ')]()){Object[I1lI1i(0x22a,'JE*A')](jdCookieNode)[I1lI1i(0x1aa,'#aiy')](liIII=>{const illili=I1lI1i,llii11={'LPJso':function(Iillli,ll11l1){return Iillli===ll11l1;},'NlGte':'ZLpct','QfZMl':illili(0x2b7,'7ke2')};jdCookieNode[liIII]&&(llii11[illili(0x288,'AZVf')](llii11[illili(0x358,'ZSik')],llii11[illili(0x349,'ITLq')])?IiiIll[illili(0x35a,'UtiQ')]():cookiesArr[illili(0x1ed,'p!d&')](jdCookieNode[liIII]));});if(process['env']['JD_DEBUG']&&process[I1lI1i(0x190,'fmQL')][I1lI1i(0x262,'iA5q')]==='false')console['log']=()=>{};}else cookiesArr=[$[I1lI1i(0x2f7,'ZSik')](I1lI1i(0x151,'loVm')),$[I1lI1i(0x19d,'EATG')](I1lI1i(0x172,'iA5q')),...jsonParse($[I1lI1i(0x1ea,'*bLW')](I1lI1i(0x34a,'Q0H!'))||'[]')[I1lI1i(0x132,'4gV7')](llliII=>llliII[I1lI1i(0x17b,'X@cG')])][I1lI1i(0x2e8,'V$(H')](iiIiIl=>!!iiIiIl);console['log']('共'+cookiesArr[I1lI1i(0x144,'c!Jc')]+I1lI1i(0x153,'ITLq'));let newShareCodes=[];const retainWater=$[I1lI1i(0x1cd,'HUyD')]()?process[I1lI1i(0x2ec,'V$(H')][I1lI1i(0x298,'ZSik')]?process['env'][I1lI1i(0x3ad,'AZVf')]:0x64:$['getdata']('retainWater')?$[I1lI1i(0x252,'9aLm')](I1lI1i(0x1cf,'RIBX')):0x64;let jdNotify=!![],jdFruitBeanCard=![];const common=require(I1lI1i(0x327,'i6We')),{H5st}=require(I1lI1i(0x25c,'#bHV')),JD_API_HOST=I1lI1i(0x32a,'dS[$'),urlSchema='openjd://virtual?params=%7B%20%22category%22:%20%22jump%22,%20%22des%22:%20%22m%22,%20%22url%22:%20%22https://h5.m.jd.com/babelDiy/Zeus/3KSjXqQabiTuD1cJ28QskrpWoBKT/index.html%22%20%7D';let uuid=randomString(0x28),addressid=randomString(0xa,I1lI1i(0x333,'i6We')),sid=randomString(0x20,I1lI1i(0x11f,'cndb')),un_area=randomString(0x2,I1lI1i(0x20d,'mhg!'))+'-'+randomString(0x4,I1lI1i(0x1b6,'oRA&'))+'-'+randomString(0x4,'1234567890')+'-'+randomString(0x5,'1234567890'),lng='106.475'+Math['floor'](Math[I1lI1i(0x123,'^QQf')]()*0x383+0x64),lat=I1lI1i(0x33e,'UtiQ')+Math['floor'](Math[I1lI1i(0x123,'^QQf')]()*0x383+0x64),llhelp=!![];const fs=require('fs');let boolneedUpdate=![],strShare='./Fruit_ShareCache.json',Fileexists=fs['existsSync'](strShare),TempShareCache=[];Fileexists&&(console[I1lI1i(0x325,'EA6]')](I1lI1i(0x21d,'dS[$')),TempShareCache=fs[I1lI1i(0x13b,'loVm')](strShare,I1lI1i(0x16c,'SYLQ')),TempShareCache&&(TempShareCache=TempShareCache[I1lI1i(0x2f3,'rL^4')](),TempShareCache=JSON[I1lI1i(0x264,'p!d&')](TempShareCache)));function iii1II(_0x110323,_0x46ac57){const _0x511e39=Iii11l();return iii1II=function(_0x39f322,_0x1517de){_0x39f322=_0x39f322-0x11e;let _0x21e0b7=_0x511e39[_0x39f322];if(iii1II['JOqiVu']===un
// 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