jdpro/jd_fruit_new.js

11 lines
157 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-28 15:15:44 +00:00
var _0xodR='jsjiami.com.v7';const _0x1c956c=_0x3c00;(function(_0x18d6df,_0x307df6,_0x2cb806,_0x4c98c5,_0x163f3b,_0x369486,_0x595699){return _0x18d6df=_0x18d6df>>0x1,_0x369486='hs',_0x595699='hs',function(_0x101060,_0x37b64c,_0x5d1e1c,_0x207636,_0x42e02c){const _0x48c37b=_0x3c00;_0x207636='tfi',_0x369486=_0x207636+_0x369486,_0x42e02c='up',_0x595699+=_0x42e02c,_0x369486=_0x5d1e1c(_0x369486),_0x595699=_0x5d1e1c(_0x595699),_0x5d1e1c=0x0;const _0x445a6c=_0x101060();while(!![]&&--_0x4c98c5+_0x37b64c){try{_0x207636=-parseInt(_0x48c37b(0x734,'g8Ht'))/0x1*(parseInt(_0x48c37b(0x8d8,'VxV)'))/0x2)+-parseInt(_0x48c37b(0x586,'h3H%'))/0x3*(-parseInt(_0x48c37b(0x1f7,'6(dP'))/0x4)+-parseInt(_0x48c37b(0x587,'!n5('))/0x5*(parseInt(_0x48c37b(0x3de,'rJBU'))/0x6)+parseInt(_0x48c37b(0x604,'lXkp'))/0x7+-parseInt(_0x48c37b(0x8ea,'K0hz'))/0x8+parseInt(_0x48c37b(0x455,'RK3^'))/0x9*(parseInt(_0x48c37b(0x44b,'g8Ht'))/0xa)+-parseInt(_0x48c37b(0x8af,'Re%F'))/0xb*(-parseInt(_0x48c37b(0x5c0,'h3H%'))/0xc);}catch(_0xe6e2d3){_0x207636=_0x5d1e1c;}finally{_0x42e02c=_0x445a6c[_0x369486]();if(_0x18d6df<=_0x4c98c5)_0x5d1e1c?_0x163f3b?_0x207636=_0x42e02c:_0x163f3b=_0x42e02c:_0x5d1e1c=_0x42e02c;else{if(_0x5d1e1c==_0x163f3b['replace'](/[qUtLCQgIXSHJODErdFfN=]/g,'')){if(_0x207636===_0x37b64c){_0x445a6c['un'+_0x369486](_0x42e02c);break;}_0x445a6c[_0x595699](_0x42e02c);}}}}}(_0x2cb806,_0x307df6,function(_0x37fc89,_0x32cb8e,_0x3243fd,_0x56e10d,_0x4f93cb,_0xb10bde,_0x3d4195){return _0x32cb8e='\x73\x70\x6c\x69\x74',_0x37fc89=arguments[0x0],_0x37fc89=_0x37fc89[_0x32cb8e](''),_0x3243fd=`\x72\x65\x76\x65\x72\x73\x65`,_0x37fc89=_0x37fc89[_0x3243fd]('\x76'),_0x56e10d=`\x6a\x6f\x69\x6e`,(0x1851a2,_0x37fc89[_0x56e10d](''));});}(0x196,0x3c001,_0x5cf7,0xcd),_0x5cf7)&&(_0xodR=0xebb);function _0x3c00(_0x247edb,_0x6349c5){const _0x2d3908=_0x5cf7();return _0x3c00=function(_0x583daa,_0xd501f8){_0x583daa=_0x583daa-0x184;let _0x5cf742=_0x2d3908[_0x583daa];if(_0x3c00['OlOFLZ']===undefined){var _0x3c0044=function(_0x776de4){const _0x6f995a='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x3b7df8='',_0x3f9edb='',_0x2162ac=_0x3b7df8+_0x3c0044;for(let _0x3c42d1=0x0,_0xc70ce2,_0x4f5bc4,_0x591029=0x0;_0x4f5bc4=_0x776de4['charAt'](_0x591029++);~_0x4f5bc4&&(_0xc70ce2=_0x3c42d1%0x4?_0xc70ce2*0x40+_0x4f5bc4:_0x4f5bc4,_0x3c42d1++%0x4)?_0x3b7df8+=_0x2162ac['charCodeAt'](_0x591029+0xa)-0xa!==0x0?String['fromCharCode'](0xff&_0xc70ce2>>(-0x2*_0x3c42d1&0x6)):_0x3c42d1:0x0){_0x4f5bc4=_0x6f995a['indexOf'](_0x4f5bc4);}for(let _0x5d1124=0x0,_0x36c954=_0x3b7df8['length'];_0x5d1124<_0x36c954;_0x5d1124++){_0x3f9edb+='%'+('00'+_0x3b7df8['charCodeAt'](_0x5d1124)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x3f9edb);};const _0x87875a=function(_0x19c09c,_0x533f42){let _0x232771=[],_0x5ce065=0x0,_0x1917d9,_0x260d16='';_0x19c09c=_0x3c0044(_0x19c09c);let _0x3dfe8f;for(_0x3dfe8f=0x0;_0x3dfe8f<0x100;_0x3dfe8f++){_0x232771[_0x3dfe8f]=_0x3dfe8f;}for(_0x3dfe8f=0x0;_0x3dfe8f<0x100;_0x3dfe8f++){_0x5ce065=(_0x5ce065+_0x232771[_0x3dfe8f]+_0x533f42['charCodeAt'](_0x3dfe8f%_0x533f42['length']))%0x100,_0x1917d9=_0x232771[_0x3dfe8f],_0x232771[_0x3dfe8f]=_0x232771[_0x5ce065],_0x232771[_0x5ce065]=_0x1917d9;}_0x3dfe8f=0x0,_0x5ce065=0x0;for(let _0x1b0783=0x0;_0x1b0783<_0x19c09c['length'];_0x1b0783++){_0x3dfe8f=(_0x3dfe8f+0x1)%0x100,_0x5ce065=(_0x5ce065+_0x232771[_0x3dfe8f])%0x100,_0x1917d9=_0x232771[_0x3dfe8f],_0x232771[_0x3dfe8f]=_0x232771[_0x5ce065],_0x232771[_0x5ce065]=_0x1917d9,_0x260d16+=String['fromCharCode'](_0x19c09c['charCodeAt'](_0x1b0783)^_0x232771[(_0x232771[_0x3dfe8f]+_0x232771[_0x5ce065])%0x100]);}return _0x260d16;};_0x3c00['orRKdu']=_0x87875a,_0x247edb=arguments,_0x3c00['OlOFLZ']=!![];}const _0x1f5897=_0x2d3908[0x0],_0x486de6=_0x583daa+_0x1f5897,_0x2a7386=_0x247edb[_0x486de6];if(!_0x2a7386){if(_0x3c00['duxTOy']===undefined){const _0x14cdc3=function(_0x46cd73){this['tMutaB']=_0x46cd73,this['gYZYEW']=[0x1,0x0,0x0],this['bgTXmO']=function(){return'newState';},this['HBjttB']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['CFXCWS']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x14cdc3['p
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