jdpro/jd_fruit_new.js

11 lines
236 KiB
JavaScript
Raw Normal View History

2024-06-28 07:47:44 +00:00
/*
活动入口京东APP我的--东东农场
==========================Quantumultx=========================
[task_local]
#jd新农场
10 6,12,17 * * * jd_fruit_new.js
*/
const $ = new Env('新农场任务');
2024-09-10 11:50:22 +00:00
var _0xodg='jsjiami.com.v7';const _0x5eb604=_0x54c3;(function(_0x32f709,_0xe2ba17,_0x383ff3,_0x1aef4f,_0x26a4ac,_0x4737e9,_0x36faf7){return _0x32f709=_0x32f709>>0x5,_0x4737e9='hs',_0x36faf7='hs',function(_0x31ac01,_0x384c4a,_0x34b125,_0x19f07f,_0x5bed05){const _0x2ed019=_0x54c3;_0x19f07f='tfi',_0x4737e9=_0x19f07f+_0x4737e9,_0x5bed05='up',_0x36faf7+=_0x5bed05,_0x4737e9=_0x34b125(_0x4737e9),_0x36faf7=_0x34b125(_0x36faf7),_0x34b125=0x0;const _0x50c6b2=_0x31ac01();while(!![]&&--_0x1aef4f+_0x384c4a){try{_0x19f07f=parseInt(_0x2ed019(0x490,'%I5G'))/0x1*(-parseInt(_0x2ed019(0x428,'w33)'))/0x2)+parseInt(_0x2ed019(0x8ab,'x]y3'))/0x3*(parseInt(_0x2ed019(0xc0b,'w6@*'))/0x4)+parseInt(_0x2ed019(0x508,'w6@*'))/0x5+parseInt(_0x2ed019(0x4bc,'wZaZ'))/0x6*(parseInt(_0x2ed019(0x798,'%I5G'))/0x7)+parseInt(_0x2ed019(0x958,'mslg'))/0x8*(parseInt(_0x2ed019(0x2e1,'ZuNU'))/0x9)+-parseInt(_0x2ed019(0x64d,'VYvP'))/0xa*(parseInt(_0x2ed019(0x968,'K[E@'))/0xb)+parseInt(_0x2ed019(0xbf0,'Au*F'))/0xc*(-parseInt(_0x2ed019(0x57f,'1!ZZ'))/0xd);}catch(_0x2884cc){_0x19f07f=_0x34b125;}finally{_0x5bed05=_0x50c6b2[_0x4737e9]();if(_0x32f709<=_0x1aef4f)_0x34b125?_0x26a4ac?_0x19f07f=_0x5bed05:_0x26a4ac=_0x5bed05:_0x34b125=_0x5bed05;else{if(_0x34b125==_0x26a4ac['replace'](/[krSYhpXKNgwDxtInld=]/g,'')){if(_0x19f07f===_0x384c4a){_0x50c6b2['un'+_0x4737e9](_0x5bed05);break;}_0x50c6b2[_0x36faf7](_0x5bed05);}}}}}(_0x383ff3,_0xe2ba17,function(_0x10ceac,_0x32a04a,_0x4fb4e4,_0x2d81da,_0x4177dc,_0xb96793,_0x13f018){return _0x32a04a='\x73\x70\x6c\x69\x74',_0x10ceac=arguments[0x0],_0x10ceac=_0x10ceac[_0x32a04a](''),_0x4fb4e4=`\x72\x65\x76\x65\x72\x73\x65`,_0x10ceac=_0x10ceac[_0x4fb4e4]('\x76'),_0x2d81da=`\x6a\x6f\x69\x6e`,(0x181b8b,_0x10ceac[_0x2d81da](''));});}(0x1840,0x7505f,_0x5bbe,0xc4),_0x5bbe)&&(_0xodg=0xc4);const _0x446ef5=(function(){const _0x14cbde=_0x54c3,_0x13300d={'PdwLg':function(_0x48f409,_0x440578){return _0x48f409==_0x440578;},'OFRfR':_0x14cbde(0x477,'H$#O'),'LPVsB':_0x14cbde(0xa20,'mslg'),'sfNcr':_0x14cbde(0x8e4,'wZaZ'),'dSBLh':function(_0x5631a7,_0x55751d){return _0x5631a7===_0x55751d;},'bPTFw':_0x14cbde(0x2fe,'ArwU'),'zWRKa':_0x14cbde(0x162,'VXkq'),'ikNHy':function(_0x3d4a8d,_0x57a60f){return _0x3d4a8d+_0x57a60f;},'RxjQY':function(_0x45dd96,_0x1abc34){return _0x45dd96>=_0x1abc34;},'GEbWJ':function(_0x2dc1f6,_0x355c2b){return _0x2dc1f6+_0x355c2b;},'XHesz':function(_0xdc4e5d,_0x5628e6){return _0xdc4e5d+_0x5628e6;},'jmynk':function(_0x46e0e7,_0x2a46db){return _0x46e0e7+_0x2a46db;}};let _0x656851=!![];return function(_0x42a481,_0x4bf980){const _0x13a2b6={'bfUnq':function(_0x30af24,_0x9d7e4b){const _0x103218=_0x54c3;return _0x13300d[_0x103218(0x1b4,'[MXQ')](_0x30af24,_0x9d7e4b);},'HAhHi':function(_0x18e7bf,_0x3dc697){const _0x3609e7=_0x54c3;return _0x13300d[_0x3609e7(0x429,'P@Ts')](_0x18e7bf,_0x3dc697);},'AWpYH':function(_0x27d5e0,_0x2e94dd){const _0x47a551=_0x54c3;return _0x13300d[_0x47a551(0x92f,'$1nv')](_0x27d5e0,_0x2e94dd);},'NXEnE':function(_0x253d53,_0x66ca55){const _0x4f2998=_0x54c3;return _0x13300d[_0x4f2998(0x5f5,'P@Ts')](_0x253d53,_0x66ca55);},'jSDcf':function(_0x3432c5,_0x499ef8){const _0x39a02d=_0x54c3;return _0x13300d[_0x39a02d(0x7b3,'faJ*')](_0x3432c5,_0x499ef8);},'HOnsU':function(_0x26cd6d,_0x3cbd26){const _0x500334=_0x54c3;return _0x13300d[_0x500334(0x531,'OJfc')](_0x26cd6d,_0x3cbd26);},'CAfrQ':function(_0x1849f4,_0x1c8970){const _0x144d78=_0x54c3;return _0x13300d[_0x144d78(0x3af,'1kC*')](_0x1849f4,_0x1c8970);},'kiMUk':function(_0x2c9037,_0x4dd996){const _0x491bbb=_0x54c3;return _0x13300d[_0x491bbb(0x52e,'[q88')](_0x2c9037,_0x4dd996);}},_0x251f95=_0x656851?function(){const _0x2f6b43=_0x54c3,_0x53d024={'JRAQR':function(_0x105e32,_0x628a61){const _0x29dc7a=_0x54c3;return _0x13300d[_0x29dc7a(0x992,'H0kv')](_0x105e32,_0x628a61);},'LycJk':_0x13300d[_0x2f6b43(0xbae,'w6@*')],'KMzuz':_0x13300d[_0x2f6b43(0x67b,'@Ev%')],'oMdWI':_0x13300d[_0x2f6b43(0x3d3,'x]y3')]};if(_0x13300d[_0x2f6b43(0xa91,'VYvP')](_0x13300d[_0x2f6b43(0xa97,'faJ*')],_0x13300d[_0x2f6b43(0x1d5,'whCX')])){if(_0x4bf980){if(_0x13300d[_0x2f6b43(0x677,'H$#O')](_0x13300d[_0x2f6b43(0x70d,'pLS*')],
2024-09-06 13:16:22 +00:00
function Env(o,t){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((r,i)=>{s.call(this,t,(t,e,s)=>{t?i(t):r(e)})})}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.logLevels={debug:0,info:1,warn:2,error:3},this.logLevelPrefixs={debug:"[DEBUG] ",info:"[INFO] ",warn:"[WARN] ",error:"[ERROR] "},this.logLevel="info",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.encoding="utf-8",this.startTime=(new Date).getTime(),Object.assign(this,e),this.log("",`🔔${this.name}, 开始!`)}getEnv(){return"undefined"!=typeof $environment&&$environment["surge-version"]?"Surge":"undefined"!=typeof $environment&&$environment["stash-version"]?"Stash":"undefined"!=typeof module&&module.exports?"Node.js":"undefined"!=typeof $task?"Quantumult X":"undefined"!=typeof $loon?"Loon":"undefined"!=typeof $rocket?"Shadowrocket":void 0}isNode(){return"Node.js"===this.getEnv()}isQuanX(){return"Quantumult X"===this.getEnv()}isSurge(){return"Surge"===this.getEnv()}isLoon(){return"Loon"===this.getEnv()}isShadowrocket(){return"Shadowrocket"===this.getEnv()}isStash(){return"Stash"===this.getEnv()}toObj(t,e=null){try{return JSON.parse(t)}catch{return e}}toStr(t,e=null,...s){try{return JSON.stringify(t,...s)}catch{return e}}getjson(t,e){let s=e;if(this.getdata(t))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(r=>{this.get({url:t},(t,e,s)=>r(s))})}runScript(a,o){return new Promise(r=>{let t=this.getdata("@chavy_boxjs_userCfgs.httpapi");t=t&&t.replace(/\n/g,"").trim();var e=(e=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout"))?+e:20,[s,i]=(e=o&&o.timeout?o.timeout:e,t.split("@"));this.post({url:`http://${i}/v1/scripting/evaluate`,body:{script_text:a,mock_type:"cron",timeout:e},headers:{"X-Key":s,Accept:"*/*"},timeout:e},(t,e,s)=>r(s))}).catch(t=>this.logErr(t))}loaddata(){if(!this.isNode())return{};this.fs=this.fs||require("fs"),this.path=this.path||require("path");var t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),r=!s&&this.fs.existsSync(e);if(!s&&!r)return{};r=s?t:e;try{return JSON.parse(this.fs.readFileSync(r))}catch(t){return{}}}writedata(){var t,e,s,r,i;this.isNode()&&(this.fs=this.fs||require("fs"),this.path=this.path||require("path"),t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),r=!(s=this.fs.existsSync(t))&&this.fs.existsSync(e),i=JSON.stringify(this.data),!s&&r?this.fs.writeFileSync(e,i):this.fs.writeFileSync(t,i))}lodash_get(t,e,s){let r=t;for(const t of e.replace(/\[(\d+)\]/g,".$1").split("."))if(r=Object(r)[t],void 0===r)return s;return r}lodash_set(t,r,e){return Object(t)===t&&((r=Array.isArray(r)?r:r.toString().match(/[^.[\]]+/g)||[]).slice(0,-1).reduce((t,e,s)=>Object(t[e])===t[e]?t[e]:t[e]=Math.abs(r[s+1])>>0==+r[s+1]?[]:{},t)[r[r.length-1]]=e),t}getdata(t){let e=this.getval(t);if(/^@/.test(t)){var[,s,r]=/^@(.*?)\.(.*?)$/.exec(t);if(s=s?this.getval(s):"")try{const t=JSON.parse(s);e=t?this.lodash_get(t,r,""):e}catch(t){e=""}}return e}setdata(t,e){let s=!1;if(/^@/.test(e)){var[,r,i]=/^@(.*?)\.(.*?)$/.exec(e),a=this.getval(r),a=r?"null"===a?null:a||"{}":"{}";try{const e=JSON.parse(a);this.lodash_set(e,i,t),s=this.setval(JSON.stringify(e),r)}catch(e){this.lodash_set(a={},i,t),s=this.setval(JSON.stringify(a),r)}}else s=this.setval(t,e);return s}getval(t){switch(this.getEnv()){case"Surge":case"Loon":case"Stash":case"Shadowrocket":return $persistentStore.read(t);case"Quantumult X":return $prefs.valueForKey(t);case"Node.js":return this.data=this.loaddata(),this.data[t];default:return this.data&&this.data[t]||null}}setval(t,e){switch(this.getEnv()){case"Surge":case"Loon":case"Stash":case"Shadowrocket":return $persistentStore.write(t,e);case"Quantumult X":return $prefs.setValueF