KR/jd_fruit_help.js

37 lines
96 KiB
JavaScript
Raw Normal View History

2023-07-27 16:14:01 +08:00
/*
东东水果:脚本更新地址 jd_fruit_help.js
更新时间2021-5-18
活动入口京东APP我的-更多工具-东东农场
==========================Quantumultx=========================
[task_local]
2023-08-25 03:43:26 +08:00
#东东农场内部互助
2023-07-27 16:14:01 +08:00
20 4,16 * * * jd_fruit_help.js, tag=东东农场内部互助, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jdnc.png, enabled=true
=========================Loon=============================
[Script]
cron "20 4,16 * * *" script-path=jd_fruit_help.js,tag=东东农场内部互助
=========================Surge============================
东东农场内部互助 = type=cron,cronexp="20 4,16 * * *",wake-system=1,timeout=3600,script-path=jd_fruit_help.js
=========================小火箭===========================
东东农场内部互助 = type=cron,script-path=jd_fruit_help.js, cronexpr="20 4,16 * * *", timeout=3600, enable=true
*/
const $ = new Env('东东农场内部水滴互助');
2023-08-25 11:05:55 +08:00
let cookiesArr = [],
cookie = '',
jdFruitShareArr = [],
isBox = false,
notify,
allMessage = '';
let shareCodes = [ // 这个列表填入你要助力的好友的shareCode
// //账号一的好友shareCode,不同好友的shareCode中间用@符号隔开
// '5853550f71014282912b76d95beb84c0@b58ddba3317b44ceb0ac86ea8952998c@8d724eb95e3847b6a1526587d1836f27@a80b7d1db41a4381b742232da9d22443@ce107b8f64d24f62a92292180f764018@c73ea563a77d4464b273503d3838fec1@0dd9a7fd1feb449fb1bf854a3ec0e801',
// //账号二的好友shareCode,不同好友的shareCode中间用@符号隔开
// '5853550f71014282912b76d95beb84c0@b58ddba3317b44ceb0ac86ea8952998c@8d724eb95e3847b6a1526587d1836f27@a80b7d1db41a4381b742232da9d22443@ce107b8f64d24f62a92292180f764018@c73ea563a77d4464b273503d3838fec1@0dd9a7fd1feb449fb1bf854a3ec0e801',
]
let newShareCodes=[];
2023-08-30 14:55:40 +08:00
var version_='jsjiami.com.v7';const IliiIl11=l1iiiIIi;(function(lli1lii1,l111i1,Ii11ilII,Illl1I1I,iil1lIiI,IiiIlii1,iI111ll){return lli1lii1=lli1lii1>>0x9,IiiIlii1='hs',iI111ll='hs',function(ll1ii1Il,i1l1111l,iI11IilI,I11iilli,IIili1iI){const iIIiIIlI=l1iiiIIi;I11iilli='tfi',IiiIlii1=I11iilli+IiiIlii1,IIili1iI='up',iI111ll+=IIili1iI,IiiIlii1=iI11IilI(IiiIlii1),iI111ll=iI11IilI(iI111ll),iI11IilI=0x0;const liil1111=ll1ii1Il();while(!![]&&--Illl1I1I+i1l1111l){try{I11iilli=-parseInt(iIIiIIlI(0x2d9,')7hm'))/0x1+-parseInt(iIIiIIlI(0x2ee,'@9v7'))/0x2+-parseInt(iIIiIIlI(0x114,'ab!b'))/0x3*(-parseInt(iIIiIIlI(0x47f,'qGvr'))/0x4)+-parseInt(iIIiIIlI(0x3a3,'ab!b'))/0x5*(parseInt(iIIiIIlI(0x223,'57J)'))/0x6)+-parseInt(iIIiIIlI(0x496,'mSqY'))/0x7+parseInt(iIIiIIlI(0x39e,'yKDZ'))/0x8*(parseInt(iIIiIIlI(0x151,'ab!b'))/0x9)+-parseInt(iIIiIIlI(0x468,'*OM4'))/0xa*(-parseInt(iIIiIIlI(0x2b6,'0[k('))/0xb);}catch(lIl11111){I11iilli=iI11IilI;}finally{IIili1iI=liil1111[IiiIlii1]();if(lli1lii1<=Illl1I1I)iI11IilI?iil1lIiI?I11iilli=IIili1iI:iil1lIiI=IIili1iI:iI11IilI=IIili1iI;else{if(iI11IilI==iil1lIiI['replace'](/[DHkKeJEwnGAhquUbOTMd=]/g,'')){if(I11iilli===i1l1111l){liil1111['un'+IiiIlii1](IIili1iI);break;}liil1111[iI111ll](IIili1iI);}}}}}(Ii11ilII,l111i1,function(lIiIlii,l1liIl1,IIIlil1,ilIilIII,IlI111I1,il1i1ill,i1IiIlII){return l1liIl1='\x73\x70\x6c\x69\x74',lIiIlii=arguments[0x0],lIiIlii=lIiIlii[l1liIl1](''),IIIlil1=`\x72\x65\x76\x65\x72\x73\x65`,lIiIlii=lIiIlii[IIIlil1]('\x76'),ilIilIII=`\x6a\x6f\x69\x6e`,(0x13bc9e,lIiIlii[ilIilIII](''));});}(0x18200,0xcf89d,i111ii1l,0xc3),i111ii1l)&&(version_=i111ii1l);let iIIlIiii='',iiI1l1II='',lIi1il1={},l11l1l1=![];const i11l1Ill=$[IliiIl11(0x2f1,'LW6n')]()?process[IliiIl11(0x280,'oNz!')]['retainWater']?process['env'][IliiIl11(0x47e,'qGvr')]:0x64:$['getdata']('retainWater')?$[IliiIl11(0x158,'(^%d')](IliiIl11(0x2cf,'Tpcl')):0x64;let iii1Iii1=!![],IiI11IiI=![],i1li1IIl=$[IliiIl11(0x29d,'dt10')]()?0x14:0x5;const IlI1I11='https://api.m.jd.com/client.action',IilIl1li=IliiIl11(0x36b,'jbA8'),I1lllI1l=require(IliiIl11(0x385,'G^#P')),illiii1l=require(IliiIl11(0x470,'0[k(')),i11l1lii=require(IliiIl11(0x37c,'YHNO'));let iIlili1=llIIil(0x28),llii=llIIil(0xa,IliiIl11(0x38b,'d5DW')),liIIiiii=llIIil(0x20,'1234567890qwertyuiopasdfghjklzxcvbnm'),ii11IIi1=llIIil(0x2,IliiIl11(0x3d1,'dt10'))+'-'+llIIil(0x4,IliiIl11(0x33a,'SjO)'))+'-'+llIIil(0x4,IliiIl11(0x3d6,'2%66'))+'-'+llIIil(0x5,IliiIl11(0x3d1,'dt10')),i1IiIl1='106.475'+Math[IliiIl11(0x288,'[VQ(')](Math['random']()*0x383+0x64),iI1lilll=IliiIl11(0x24e,'cvhw')+Math[IliiIl11(0xd4,')7hm')](Math[IliiIl11(0x438,'@9v7')]()*0x383+0x64),l1ili11I='',l11I1lIi=new Date()[IliiIl11(0x3ce,'OXTt')](),I11li11I=!![];const l1liilIl=require('fs');let l1ill1Ii=![],IIlIiI1I=IliiIl11(0x283,'(^%d'),Il1Illl1=l1liilIl[IliiIl11(0x28d,'Y3(c')](IIlIiI1I),ilIII11l=[];Il1Illl1&&(console[IliiIl11(0x1dc,'G^#P')]('检测到东东农场缓存文件Fruit_ShareCache.json载入...'),ilIII11l=l1liilIl[IliiIl11(0x16d,'4GNz')](IIlIiI1I,IliiIl11(0x2d6,'YHNO')),ilIII11l&&(ilIII11l=ilIII11l['toString'](),ilIII11l=JSON[IliiIl11(0x144,'GHz1')](ilIII11l)));let IIiliIii=0x0,i1I1iiii=![],liiIlIIi=[];!(async()=>{const iiIIIiii=IliiIl11,l1ll1I1={'uNGKr':function(ilIi1iII,lIIl1lI1){return ilIi1iII+lIIl1lI1;},'ErkrH':function(iIl1I1Ii,IlliIil){return iIl1I1Ii>=IlliIil;},'XtiVt':function(IIIIl,i1IIliIi){return IIIIl+i1IIliIi;},'qzNYg':function(iI1ill1,ilii1i1i){return iI1ill1+ilii1i1i;},'vvbRg':function(lIliIi1i,iIIliill){return lIliIi1i===iIIliill;},'AZRlD':iiIIIiii(0x220,'jWP6'),'rzaUH':function(IliIlIi,llI1IiI){return IliIlIi(llI1IiI);},'NXAgt':'\x0a【缓存文件Fruit_ShareCache.json更新失败!】\x0a','NjuNL':function(iiIIIi1,IlIili1){return iiIIIi1!==IlIili1;},'lmozD':'yqcpd','afpau':iiIIIiii(0x15e,'@9v7'),'UEJgN':function(illIi1li){return illIi1li();},'DVjac':iiIIIiii(0x1fd,'RMI2'),'YSzRt':iiIIIiii(0x1ae,'!9eA'),'CSCvF':iiIIIiii(0x15d,'AkFz'),'OXSmB':iiIIIiii(0x445,'utLR'),'KOCvR':function(Ii1lIi1,I1lI1Ii){return Ii1lIi1+I1lI1Ii;},'gzoyk':function(iI11II11,IliliIi1){return iI11II11===IliliIi1;},'doXfa':iiIII
2023-07-27 16:14:01 +08:00
// prettier-ignore
2023-08-25 03:43:26 +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.data[t]||null}setval(t,e){return this.isSurge()||this.isLoon()?$persistentStore.write(t,e):this.isQuanX()?$prefs.setValueForKey(t,e):this.isNode()?(this.data=this.loaddata(),this.data[e]=t,this.writedata(),!0):this.data&&this.data[e]||null}initGotEnv(t){this.got=this.got?this.got:require("got"),this.cktough=this.cktough?this.cktough:require("tough-cookie"),this.ckjar=this.ckjar?this.ckjar:new this.cktough.CookieJar,t&&(t.headers=t.headers?t.headers:{},void 0===t.headers.Cookie&&void 0===t.cookieJar&&(t.cookieJar=this.ckjar))}get(t,e=(()=>{})){t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"])