jdpro/jd_plantBean.js

9 lines
155 KiB
JavaScript
Raw Permalink Normal View History

2024-06-28 07:47:44 +00:00
/*
2024-10-03 13:31:06 +00:00
活动入口APP我的--种豆得豆
22 7-21/2 * * * jd_plantBean.js
2024-06-28 07:47:44 +00:00
*/
const $ = new Env('种豆得豆任务');
2024-11-17 13:09:29 +00:00
function J6qfmo(){}var a4VNEi_=Object['defineProperty'],_aaNkwy,L2Amfa,QZWjsRi,E2F2YU,Z6Ac2ap,HA0_llv,hKanW2F,ga_Vxey,jzW48Qe,FvIV8m,U3JYQmc,Ewsxa5,EjQLfiK,PPLK3X,W9qLT52,JT09kc,kUerxT,KZLPjf;function PpLLlx(J6qfmo){return _aaNkwy[J6qfmo>0x200?J6qfmo-0x48:J6qfmo-0x2e]}_aaNkwy=zd9jUvf();function EcQSnyk(J6qfmo,a4VNEi_){var QZWjsRi=F5Pruu(J6qfmo=>{return _aaNkwy[J6qfmo<-0x16?J6qfmo-0x29:J6qfmo+0x15]},0x1);return L2Amfa(J6qfmo,QZWjsRi(-0x15),{value:a4VNEi_,configurable:!0x0})}J6qfmo(L2Amfa=Object.defineProperty,QZWjsRi=EcQSnyk(F5Pruu((...a4VNEi_)=>{var L2Amfa=F5Pruu(a4VNEi_=>{return _aaNkwy[a4VNEi_<0x1fe?a4VNEi_<0x1fe?a4VNEi_>0x2b?a4VNEi_>0x2b?a4VNEi_-0x2c:a4VNEi_+0x22:a4VNEi_+0x39:a4VNEi_-0x5c:a4VNEi_-0x3c]},0x1);J6qfmo(a4VNEi_[L2Amfa(0x2c)]=L2Amfa(0x60),a4VNEi_[L2Amfa(0x2d)]=a4VNEi_[L2Amfa(0x6b)]);return a4VNEi_[PpLLlx(0x2f)](a4VNEi_[PpLLlx(0x5e)]())}),0x2)(S3MhHi,YzgP1QM));var O2foNX=[],EOVK92=[vO2Wypx(0x0),'$@e+|,ge+',vO2Wypx(0x1),vO2Wypx(0x2),vO2Wypx(0x3),vO2Wypx(0x4),'qm|28aG5',vO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LLlx(0x31)),vO2Wypx(PpLLlx(0xb5)),vO2Wypx(0x68),vO2Wypx(0x69),vO2Wypx(0x6a),'3|:9pCZ#w>',vO2Wypx(PpLLlx(0xb6)),vO2Wypx(0x6c),vO2Wypx(PpLLlx(0xbc)),vO2Wypx(0x6e),vO2Wypx(0x6f),vO2Wypx(0x70),vO2Wypx(0x71),vO2Wypx(0x72),vO2Wypx(0x73),vO2Wypx(0x40),vO2Wypx(PpLLlx(0xa0)),vO2Wypx(0x44),vO2Wypx(0x32),vO2Wypx(0x33),'GA,|Y!#2LS+',vO2Wypx(0x74),vO2Wypx(0x75),PpLLlx(0x34),vO2Wypx(0x76),vO2Wypx(0x77),vO2Wypx(PpLLlx(0x14c)),vO2Wypx(PpLLlx(0x33)),vO2Wypx(PpLLlx(0xba)),vO2Wypx(PpLLlx(0xbb)),vO2Wypx(0x32),vO2Wypx(PpLLlx(0x31)),vO2Wypx(0x75),vO2Wypx(PpLLlx(0x1aa)),vO2Wypx(0x7b),vO2Wypx(0x61),vO2Wypx(0x7c),vO2Wypx(0x40),vO2Wypx(0x1a),PpLLlx(0x34),vO2Wypx(0x7d),vO2Wypx(0x4f),vO2Wypx(PpLLlx(0x35)),vO2Wypx(0x7e),vO2Wypx(0x7f),vO2Wypx(0x80),vO2Wypx(PpLLlx(0x91)),vO2Wypx(0x82),vO2Wypx(0x83),vO2Wypx(0x84),vO2Wypx(0x3d),'W1U8%C|5',vO2Wypx(0x85),vO2Wypx(0x86),vO2Wypx(PpLLlx(0xc5))
2024-10-03 13:31:06 +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