jdpro/jd_plantBean.js

9 lines
163 KiB
JavaScript
Raw 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-10-10 03:13:39 +00:00
function EeSKdeQ(){}var gjjE26=Object['defineProperty'],N4qNC0,p2vBRR,BRTuZcw,YuD_WfT,j6soey_,QTtz8j,WIXZx4,uxXHI46,ZvG_KG,GGvSLlu,QhGr6_,qgIdVWw,COmZZK,B1uEsu,GZVHFs5,R0ULRW,VcGEpZ,ANOdIj,szKkmU,lPveLUr,HgamTCV,aC9Fiz,fs47ft,badtvt_;function kSVJZ0A(EeSKdeQ){return N4qNC0[EeSKdeQ>0x1e8?EeSKdeQ+0x34:EeSKdeQ<0x1e8?EeSKdeQ>0x2a?EeSKdeQ-0x2b:EeSKdeQ-0x23:EeSKdeQ+0x27]}N4qNC0=Osw0OY();function eW4kKll(EeSKdeQ,gjjE26){var BRTuZcw=ZGgZJz(EeSKdeQ=>{return N4qNC0[EeSKdeQ<0x1e0?EeSKdeQ>0x1e0?EeSKdeQ+0x44:EeSKdeQ<0x1e0?EeSKdeQ<0x1e0?EeSKdeQ-0x23:EeSKdeQ-0x46:EeSKdeQ-0x3a:EeSKdeQ-0x12]},0x1);return p2vBRR(EeSKdeQ,BRTuZcw(0x23),{value:gjjE26,configurable:BRTuZcw(0x83)})}EeSKdeQ(p2vBRR=Object.defineProperty,BRTuZcw=eW4kKll(ZGgZJz((...gjjE26)=>{var p2vBRR=ZGgZJz(gjjE26=>{return N4qNC0[gjjE26>0x1c2?gjjE26-0x19:gjjE26>0x4?gjjE26>0x1c2?gjjE26+0x1b:gjjE26-0x5:gjjE26+0x5c]},0x1);EeSKdeQ(gjjE26[p2vBRR(0x5)]=kSVJZ0A(0x2c),gjjE26.JEgqE2=-kSVJZ0A(0x30));return gjjE26.JEgqE2>p2vBRR(0x8)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A(0x32)),NYrdB3(0x55),'1?orxb#U|5d','q&54^~|0',NYrdB3(kSVJZ0A(0x1c5)),NYrdB3(0x18),kSVJZ0A(0x38),NYrdB3(0x57),NYrdB3(0x58),NYrdB3(0x59),NYrdB3(0x5a),NYrdB3(0x5b),NYrdB3(0x5c),NYrdB3(kSVJZ0A(0xa5)),'r|V*',NYrdB3(0x5e),NYrdB3(0x5f),NYrdB3(kSVJZ0A(0x33)),NYrdB3(0x60),NYrdB3(kSVJZ0A(0xd1)),NYrdB3(0x62),'a2|u!Go$L',NYrdB3(kSVJZ0A(0xab)),NYrdB3(kSVJZ0A(0x103)),NYrdB3(0x65),NYrdB3(0x66),NYrdB3(0x67),'MUc4|T|;X*',NYrdB3(kSVJZ0A(0xd5)),NYrdB3(0x69),NYrdB3(kSVJZ0A(0x1c2)),NYrdB3(kSVJZ0A(0xd6)),NYrdB3(0x6c),NYrdB3(kSVJZ0A(0x34)),NYrdB3(0x21),NYrdB3(0x6d),NYrdB3(kSVJZ0A(0x42)),NYrdB3(kSVJZ0A(0x35)),'k|qphrQVV.',NYrdB3(0x3c),NYrdB3(kSVJZ0A(0x36)),NYrdB3(0x44),NYrdB3(0x21),NYrdB3(kSVJZ0A(0xb5)),NYrdB3(0x70),NYrdB3(0x71),'e|~eBSCcv;>{TjYAq&9','|~7}H#/Ed#SUpKzcKMT)/62',NYrdB3(kSVJZ0A(0xd9)),NYrdB3(0x73),NYrdB3(0x74),'|?oXQ',NYrdB3(kSVJZ0A(0xdb)),NYrdB3(kSVJZ0A(0x3d)),NYrdB3(kSVJZ0A(0x1d9)),NYrdB3(0x43),NYrdB3(kSVJZ0A(0x31)),NYrdB3(kSVJZ0
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