KR/jd_fruit_help.js

40 lines
83 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 = []
2023-10-31 14:37:22 +08:00
var version_='jsjiami.com.v7';const lilll=iii1II;(function(illIIi,iiIi,iiIl,Iil1I,illIIl,iiiIlI,I1i11){return illIIi=illIIi>>0x8,iiiIlI='hs',I1i11='hs',function(Ill1ii,IllII,Ill1il,IIlI,I1i1l){const iiiIil=iii1II;IIlI='tfi',iiiIlI=IIlI+iiiIlI,I1i1l='up',I1i11+=I1i1l,iiiIlI=Ill1il(iiiIlI),I1i11=Ill1il(I1i11),Ill1il=0x0;const llIiIi=Ill1ii();while(!![]&&--Iil1I+IllII){try{IIlI=parseInt(iiiIil(0x443,'VB2e'))/0x1*(-parseInt(iiiIil(0x3d0,'l1aM'))/0x2)+-parseInt(iiiIil(0x458,'m0f7'))/0x3*(parseInt(iiiIil(0x31d,'y1@Z'))/0x4)+-parseInt(iiiIil(0x53e,'VP6b'))/0x5+-parseInt(iiiIil(0x356,'1kvJ'))/0x6+parseInt(iiiIil(0x262,'&^m1'))/0x7*(parseInt(iiiIil(0x2ca,'#)3v'))/0x8)+parseInt(iiiIil(0x4db,')fg&'))/0x9*(parseInt(iiiIil(0x520,'kfq2'))/0xa)+parseInt(iiiIil(0x53c,'K)Nb'))/0xb;}catch(IIil){IIlI=Ill1il;}finally{I1i1l=llIiIi[iiiIlI]();if(illIIi<=Iil1I)Ill1il?illIIl?IIlI=I1i1l:illIIl=I1i1l:Ill1il=I1i1l;else{if(Ill1il==illIIl['replace'](/[SbdAwxPeFyRWIpJhn=]/g,'')){if(IIlI===IllII){llIiIi['un'+iiiIlI](I1i1l);break;}llIiIi[I1i11](I1i1l);}}}}}(iiIl,iiIi,function(IIii,i1Ii1I,llIiIl,I1i1i,lIi1II,iiiIii,IllI1){return i1Ii1I='\x73\x70\x6c\x69\x74',IIii=arguments[0x0],IIii=IIii[i1Ii1I](''),llIiIl=`\x72\x65\x76\x65\x72\x73\x65`,IIii=IIii[llIiIl]('\x76'),I1i1i=`\x6a\x6f\x69\x6e`,(0x145363,IIii[I1i1i](''));});}(0xcd00,0x5c668,Iii11l,0xcf),Iii11l)&&(version_=lilll(0x4a6,'S7ot'));let I1IllI='',IIlI11='',iIIll1={},llIIII=![];function iii1II(_0x58242f,_0xd36b90){const _0x548756=Iii11l();return iii1II=function(_0x51b486,_0x27bafa){_0x51b486=_0x51b486-0x1c6;let _0x170409=_0x548756[_0x51b486];if(iii1II['WZPbsW']===undefined){var _0x226561=function(_0xf23f9f){const _0x262cf3='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x4a10e4='',_0x267fc1='';for(let _0x2e81d1=0x0,_0x5f3b08,_0x156df9,_0x15d2aa=0x0;_0x156df9=_0xf23f9f['charAt'](_0x15d2aa++);~_0x156df9&&(_0x5f3b08=_0x2e81d1%0x4?_0x5f3b08*0x40+_0x156df9:_0x156df9,_0x2e81d1++%0x4)?_0x4a10e4+=String['fromCharCode'](0xff&_0x5f3b08>>(-0x2*_0x2e81d1&0x6)):0x0){_0x156df9=_0x262cf3['indexOf'](_0x156df9);}for(let _0x4e536b=0x0,_0x4b881a=_0x4a10e4['length'];_0x4e536b<_0x4b881a;_0x4e536b++){_0x267fc1+='%'+('00'+_0x4a10e4['charCodeAt'](_0x4e536b)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x267fc1);};const _0x343565=function(_0x3d8221,_0x34e7ce){let _0x172710=[],_0x310f50=0x0,_0x43ffbf,_0x136d3b='';_0x3d8221=_0x226561(_0x3d8221);let _0x13bb63;for(_0x13bb63=0x0;_0x13bb63<0x100;_0x13bb63++){_0x172710[_0x13bb63]=_0x13bb63;}for(_0x13bb63=0x0;_0x13bb63<0x100;_0x13bb63++){_0x310f50=(_0x310f50+_0x172710[_0x13bb63]+_0x34e7ce['charCodeAt'](_0x13bb63%_0x34e7ce['length']))%0x100,_0x43ffbf=_0x172710[_0x13bb63],_0x172710[_0x13bb63]=_0x172710[_0x310f50],_0x172710[_0x310f50]=_0x43ffbf;}_0x13bb63=0x0,_0x310f50=0x0;for(let _0x40c8f9=0x0;_0x40c8f9<_0x3d8221['length'];_0x40c8f9++){_0x13bb63=(_0x13bb63+0x1)%0x100,_0x310f50=(_0x310f50+_0x172710[_0x13bb63])%0x100,_0x43ffbf=_0x172710[_0x13bb63],_0x172710[_0x13bb63]=_0x172710[_0x310f50],_0x172710[_0x310f50]=_0x43ffbf,_0x136d3b+=String['fromCharCode'](_0x3d8221['charCodeAt'](_0x40c8f9)^_0x172710[(_0x172710[_0x13bb63]+_0x172710[_0x310f50])%0x100]);}return _0x136d3b;};iii1II['thSOVV']=_0x343565,_0x58242f=arguments,iii1II['WZPbsW']=!![];}const _0x268754=_0x548756[0x0],_0x797649=_0x51b486+_0x268754,_0x32596d=_0x58242f[_0x797649];return!_0x32596d?(iii1II['TDTXeX']===undefined&&(iii1II['TDTXeX']=!![]),_0x170409=iii1II['thSOVV'](_0x170409,_0x27bafa),_0x58242f[_0x797649]=_0x170409):_0x170409=_0x32596d,_0x170409;},iii1II(_0x58242f,_0xd36b90);}const ilI11I=$[lilll(0x342,'w!eQ')]()?process['env'][lilll(0x2cc,'X7BB')]?process['env'][lilll(0x478,'ndfy')]:0x64:$['getdata'](lilll(0x2e8,'2nK*'))?$[lilll(0x460,'N@1r')](lilll(0x224,'rEFm')):0x64;let ili1I=!![],iilIIl=![],i1Iili=$[lilll(0x214,'l8zg')]()?0x14:0x5;function Iii11l(){const iliill=(function(){return[...[version_,'ewedjysAjiRpambpwiIJ.ecwohwxmW.Avp7neFPS==','W4SuqsTb','WRBcUWtdQq','W58bWO0RW53dGa','WRn5W6a6WOxdPuZcSJW','W7RcRCo2','BSodWPe','W7HIWQ3dN8k+','WPVcI3BdLZ8JWQpcRW','WQhdKvPCW5tdSG','WQ0UWPBdQ1
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"])