KR/jd_fruit_help.js

40 lines
81 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
*/
2023-10-31 01:35:26 +08:00
const $ = new Env('东东农场内部水滴互助')
2023-08-25 11:05:55 +08:00
let cookiesArr = [],
cookie = '',
jdFruitShareArr = [],
isBox = false,
notify,
2023-10-31 01:35:26 +08:00
allMessage = ''
let shareCodes = [
// 这个列表填入你要助力的好友的shareCode
2023-08-25 11:05:55 +08:00
// //账号一的好友shareCode,不同好友的shareCode中间用@符号隔开
// '5853550f71014282912b76d95beb84c0@b58ddba3317b44ceb0ac86ea8952998c@8d724eb95e3847b6a1526587d1836f27@a80b7d1db41a4381b742232da9d22443@ce107b8f64d24f62a92292180f764018@c73ea563a77d4464b273503d3838fec1@0dd9a7fd1feb449fb1bf854a3ec0e801',
// //账号二的好友shareCode,不同好友的shareCode中间用@符号隔开
// '5853550f71014282912b76d95beb84c0@b58ddba3317b44ceb0ac86ea8952998c@8d724eb95e3847b6a1526587d1836f27@a80b7d1db41a4381b742232da9d22443@ce107b8f64d24f62a92292180f764018@c73ea563a77d4464b273503d3838fec1@0dd9a7fd1feb449fb1bf854a3ec0e801',
]
2023-10-31 01:35:26 +08:00
let newShareCodes = []
var version_='jsjiami.com.v7';const Iil1l=iii1II;(function(IllI1,iiiIil,lilll,l1iilI,lilli,iiII,Iil11){return IllI1=IllI1>>0x7,iiII='hs',Iil11='hs',function(Ill1iI,i1Ii1l,IIll,i1Ii1i,iiiIll){const ilI1l1=iii1II;i1Ii1i='tfi',iiII=i1Ii1i+iiII,iiiIll='up',Iil11+=iiiIll,iiII=IIll(iiII),Iil11=IIll(Iil11),IIll=0x0;const iilliI=Ill1iI();while(!![]&&--l1iilI+i1Ii1l){try{i1Ii1i=-parseInt(ilI1l1(0x3c2,'Vka3'))/0x1+parseInt(ilI1l1(0x2f0,'Ky!C'))/0x2*(parseInt(ilI1l1(0x2e5,'QZ&k'))/0x3)+-parseInt(ilI1l1(0x25e,'jfLV'))/0x4*(parseInt(ilI1l1(0x2fa,'kV5d'))/0x5)+-parseInt(ilI1l1(0x291,'Gm&5'))/0x6+-parseInt(ilI1l1(0x219,'pvLw'))/0x7+-parseInt(ilI1l1(0x2ec,']bO9'))/0x8*(parseInt(ilI1l1(0x385,'kc5['))/0x9)+parseInt(ilI1l1(0x198,'XB6W'))/0xa*(parseInt(ilI1l1(0x1dc,'EBpj'))/0xb);}catch(iII1i){i1Ii1i=IIll;}finally{iiiIll=iilliI[iiII]();if(IllI1<=l1iilI)IIll?lilli?i1Ii1i=iiiIll:lilli=iiiIll:IIll=iiiIll;else{if(IIll==lilli['replace'](/[JNSxlKFRgrDMnGdBQUXh=]/g,'')){if(i1Ii1i===i1Ii1l){iilliI['un'+iiII](iiiIll);break;}iilliI[Iil11](iiiIll);}}}}}(lilll,iiiIil,function(ilI1ii,iII1l,ilI1il,i11Il,i11Ii,iII1I,iilli1){return iII1l='\x73\x70\x6c\x69\x74',ilI1ii=arguments[0x0],ilI1ii=ilI1ii[iII1l](''),ilI1il=`\x72\x65\x76\x65\x72\x73\x65`,ilI1ii=ilI1ii[ilI1il]('\x76'),i11Il=`\x6a\x6f\x69\x6e`,(0x145267,ilI1ii[i11Il](''));});}(0x6200,0xc901f,Iii11l,0xc6),Iii11l)&&(version_=Iil1l(0x37d,'B*70'));let iilIIl='',i1Iili='',i1Iill={},l1IiI=![];const l1lill=$['isNode']()?process[Iil1l(0x2a5,'qJ5c')][Iil1l(0x183,'PK(U')]?process['env'][Iil1l(0x21a,'YLXI')]:0x64:$['getdata']('retainWater')?$[Iil1l(0x412,'FP!U')](Iil1l(0x2cc,'GMhO')):0x64;let i1li1=!![],iIIllI=![],I1Ill1=$[Iil1l(0x45c,'gE7X')]()?0x14:0x5;const ili11='https://api.m.jd.com/client.action',IiIiIi=Iil1l(0x330,'i!n#'),llIIIl=require(Iil1l(0x1b6,'!O1%')),IIlI1I=require('./function/getH5st'),llIIIi=require(Iil1l(0x3fd,'7%Wn'));let IiIiIl=iII1I1(0x28),I1Ilil=iII1I1(0xa,Iil1l(0x149,'DxsM')),l1I1I1=iII1I1(0x20,Iil1l(0x382,'J)2(')),I1Ilii=iII1I1(0x2,Iil1l(0x139,'aTv1'))+'-'+iII1I1(0x4,Iil1l(0x2ba,'FP!U'))+'-'+iII1I1(0x4,'1234567890')+'-'+iII1I1(0x5,Iil1l(0x2c6,'3b@(')),l1Iii='106.475'+Math['floor'](Math[Iil1l(0x20c,'yFl!')]()*0x383+0x64),l1Iil='29.503'+Math['floor'](Math[Iil1l(0x244,'5ztx')]()*0x383+0x64),III1Ii='',III1Il=new Date()[Iil1l(0x334,'OoSh')](),iIIliI=!![];const IiIil=require('fs');let IiIii=![],iill1l=Iil1l(0x271,'J)2('),IiIiII=IiIil['existsSync'](iill1l),iill1i=[];IiIiII&&(console[Iil1l(0x355,'5ztx')](Iil1l(0x3fe,'awET')),iill1i=IiIil['readFileSync'](iill1l,'utf-8'),iill1i&&(iill1i=iill1i[Iil1l(0x3cf,'kc5[')](),iill1i=JSON[Iil1l(0x1de,'!Y%q')](iill1i)));let l1Il1=0x0,iill11=![],I1IliI=[];!(async()=>{const Iil1i=Iil1l,lIi1iI={'FcRxc':function(iiiIIl,lIIi11){return iiiIIl===lIIi11;},'xlKkC':'jdFruitNotify','kWrOh':Iil1i(0x13b,'3b@('),'uJFxU':Iil1i(0x353,']bO9'),'ClSks':function(illiii,IIIll1){return illiii+IIIll1;},'ULXfu':function(illiil){return illiil();},'sWnKU':Iil1i(0x220,'kV5d'),'FTQat':Iil1i(0x427,'Mgdy'),'qgvvR':Iil1i(0x1c8,'52)('),'gkrHv':Iil1i(0x132,'!Y%q'),'nzBBm':function(liI11l,l1l1i){return liI11l<l1l1i;},'wwHbm':function(I1I1II,i11ll){return I1I1II!==i11ll;},'RZpaq':Iil1i(0x3f3,'CkUR'),'zBRNz':function(Ili11I,i11li){return Ili11I(i11li);},'aYbdg':Iil1i(0x3c5,'znSh'),'RWuxE':function(Illil,iil11i){return Illil==iil11i;},'GwMOv':function(Ill1II,llIili){return Ill1II*llIili;},'WDsgt':function(Illii,iIlI11){return Illii===iIlI11;},'ahzYa':Iil1i(0x21e,'J)2('),'kFOuE':'SCiFs','MmwhS':Iil1i(0x201,'5ztx'),'kzczJ':Iil1i(0x3b4,'OoSh'),'nJyek':Iil1i(0x316,'F1Iq'),'KXtqI':Iil1i(0x1fc,'GMhO'),'uNXPz':Iil1i(0x1d9,'znSh'),'SvYTU':Iil1i(0x203,'FP!U'),'mhJsQ':function(IIII,l1IIlI){return IIII*l1IIlI;}};await lIi1iI['ULXfu'](I1I1Ii);if(!cookiesArr[0x0]){$[Iil1i(0x246,'J6tb')]($['name'],lIi1iI[Iil1i(0x33f,'PK(U')],Iil1i(0x452,'pvLw'),{'open-url':lIi1iI[Iil1i(0x174,'FP!U')]});return;}console['log'](Iil1i(0x1f4,'pvLw'));if(iIIliI){if(lIi1iI[Iil1i(0x16a,'W8Ps')]===lIi1iI['gkrHv'])liil1I[Iil1i(0x356,'7%Wn')]=lIi1iI['FcRxc'](i11ii1[Iil1i(0x3fb,'PWhq')](lIi1iI[Iil1i(0x2f4,'IqX%')]),lIi1iI[Iil1i(0x444,'EBpj'
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"])