mirror of https://github.com/6dylan6/jdpro.git
7 lines
89 KiB
JavaScript
7 lines
89 KiB
JavaScript
|
/*
|
||
|
|
||
|
*/
|
||
|
|
||
|
const $ = new Env('延保抽奖');
|
||
|
function BodUC3(){}var IgpHDdu=Object['defineProperty'],VPDNcIS,SYn4yOF,QjqIqh,LYdEmFe,y2TXCG,lI_Q_iE,lQkKUw,BstXd_v,kqWcApG,a7I8Ok,BCvqPiP,Vdkga4C,TuLEQL,zu9rFW2,uyKuuf;function wzqwqL(BodUC3){return VPDNcIS[BodUC3>0x16?BodUC3-0x17:BodUC3-0x1]}VPDNcIS=_pyeqN();function gkeIsE(BodUC3,IgpHDdu){SYn4yOF(BodUC3,'length',{value:IgpHDdu,configurable:wzqwqL(0x66)});return BodUC3}BodUC3(SYn4yOF=Object.defineProperty,QjqIqh=qrq0NrF((BodUC3,IgpHDdu)=>{return IgpHDdu(BodUC3())},0x2)(rZ8Yrkr,fvmPWE));var NT7zvK=[],UlKSGe=[Z3BGeS2(wzqwqL(0x36)),Z3BGeS2(0x1),Z3BGeS2(0x2),'[L|`3c6%',Z3BGeS2(wzqwqL(0x35)),Z3BGeS2(wzqwqL(0x33)),Z3BGeS2(0x5),Z3BGeS2(0x6),Z3BGeS2(0x7),Z3BGeS2(0x8),Z3BGeS2(0x9),Z3BGeS2(wzqwqL(0x88)),Z3BGeS2(0xb),Z3BGeS2(wzqwqL(0x17)),Z3BGeS2(0xd),Z3BGeS2(0xe),Z3BGeS2(0xf),Z3BGeS2(0x10),Z3BGeS2(wzqwqL(0xac)),Z3BGeS2(wzqwqL(0x3d)),Z3BGeS2(wzqwqL(0x69)),Z3BGeS2(wzqwqL(0x67)),Z3BGeS2(wzqwqL(0x40)),Z3BGeS2(wzqwqL(0x18)),Z3BGeS2(0x17),Z3BGeS2(wzqwqL(0x77)),'lXIs|s|gu}Mnt~2}t6=n*~(~DY!',Z3BGeS2(wzqwqL(0x72)),'VH4mL1Z$YW/S5E@D/j|>H_S8?g`*gpe)T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),Z3BGeS2(0x51),Z3BGeS2(0x52),Z3BGeS2(wzqwqL(0x1d)),'Y~|^G',']p?A|s9S`',Z3BGeS2(0x1d),Z3BGeS2(wzqwqL(0x26)),Z3BGeS2(wzqwqL(0x17)),Z3BGeS2(wzqwqL(0x1e)),Z3BGeS2(0x65),Z3BGeS2(0x66),Z3BGeS2(0x67),Z3BGeS2(wzqwqL(0x98)),Z3BGeS2(0x69),Z3BGeS2(wzqwqL(0x99)),Z3BGeS2(0x5f),Z3BGeS2(0x6b),'G~|^|',Z3BGeS2(0x6c),Z3BGeS2(0x6d),Z3BGeS2(wzqwqL(0xb5)),Z3BGeS2(0x6f),Z3BGeS2(0x70),Z3BGeS2(0x71),Z3BGeS2(wzqwqL(0x9c)),')x(E|sol',Z3BGeS2(0x73),Z3BGeS2(0x74),Z3BGeS2(0x75),Z3BGeS2(0xe),Z3BGeS2(0x53),Z3BGeS2(wzqwqL(0x17)),Z3BGeS2(0x5a),Z3BGeS2(0x56),wzqwqL(0x1f),Z3BGeS2(wzqwqL(0x20)),Z3BGeS2(0x53),Z3BGeS2(wzqwqL(0x27)),Z3BGeS2(0xc),Z3BGeS2(0x5a),Z3BGeS2(0x56),'Y~|^G',Z3BGeS2(0x57),Z3BGeS2(wzqwqL(0x17)),Z3BGeS2(0x16),Z3BGeS2(wzqwqL(0x20)),Z3BGeS2(wzqwqL(0x21)),Z3BGeS2(0x48),Z3BGeS2(wzqwqL(0x1b)),Z3BGeS2(wzqwqL(0x22)),Z3BGeS2(0x4b),Z3BGeS2(0x76),'G~|^|',Z3BGeS2(wzqwqL(0x23)),Z3BGeS2(0x77),Z3BGeS2(0x78),Z3BGeS2(wzqwqL(0x9e)),Z3BGeS2(0x4e),Z3BGeS2
|
||
|
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
|