mirror of https://github.com/6dylan6/jdpro.git
7 lines
98 KiB
JavaScript
7 lines
98 KiB
JavaScript
|
/*
|
||
|
0 1 0 * * * jd_dailysign.js
|
||
|
*/
|
||
|
|
||
|
const $ = new Env('每日签到得豆');
|
||
|
const bdy_0x43ac94=bdy_0x53b3;(function(_0x18fea3,_0x39cf2c){const bdy_0x21b1ad={_0x2ab5a2:'0x278',_0x24173b:'QW6F',_0x57480d:'0x353',_0x16b1a8:'9PWH',_0x4d3273:'0x39e',_0x4bdd67:'u^dq',_0x4b3f16:'0x235',_0x111ebe:'V2ic',_0x34ab41:'0x345',_0x166888:'@SbO',_0x3ba8ad:'0x1e2',_0x1ce9af:'Jqcz',_0x2f6f86:'0x232',_0x1cb0e5:'7GN@',_0x1916e9:'0x32e',_0x3d4e01:'dzl%',_0x3fce44:'0x329',_0x4c49d0:'Zyjd',_0x185bdc:'0x3c8',_0x2578e5:'OWW&',_0x116a66:'0x2dd'},_0x3d614e=bdy_0x53b3,_0xd355b8=_0x18fea3();while(!![]){try{const _0x55222b=parseInt(_0x3d614e(bdy_0x21b1ad._0x2ab5a2,bdy_0x21b1ad._0x24173b))/(-0x75+0x1*-0x4b5+-0x1b9*-0x3)+parseInt(_0x3d614e(bdy_0x21b1ad._0x57480d,bdy_0x21b1ad._0x16b1a8))/(0x11be*-0x1+-0x74a+0x2*0xc85)*(-parseInt(_0x3d614e(bdy_0x21b1ad._0x4d3273,bdy_0x21b1ad._0x4bdd67))/(-0x137b+0x1e31*0x1+0xb*-0xf9))+parseInt(_0x3d614e(bdy_0x21b1ad._0x4b3f16,bdy_0x21b1ad._0x111ebe))/(0x1fa9+0x5*-0x5+-0x1f8c)*(parseInt(_0x3d614e(bdy_0x21b1ad._0x34ab41,bdy_0x21b1ad._0x166888))/(-0x4*-0x831+-0x3*-0x5e9+-0xb6*0x47))+parseInt(_0x3d614e(bdy_0x21b1ad._0x3ba8ad,bdy_0x21b1ad._0x1ce9af))/(0x1a5d+-0x2311+-0x8ba*-0x1)*(-parseInt(_0x3d614e(bdy_0x21b1ad._0x2f6f86,bdy_0x21b1ad._0x1cb0e5))/(-0x1c4f*0x1+-0x17c0+0x3416))+parseInt(_0x3d614e(bdy_0x21b1ad._0x1916e9,bdy_0x21b1ad._0x3d4e01))/(0x24e6+-0x1f73+-0x56b)+parseInt(_0x3d614e(bdy_0x21b1ad._0x3fce44,bdy_0x21b1ad._0x4c49d0))/(-0x2503+0x2*-0x21d+0x2946)*(parseInt(_0x3d614e(bdy_0x21b1ad._0x185bdc,bdy_0x21b1ad._0x2578e5))/(0x38a*0x2+-0xffb+0x8f1))+-parseInt(_0x3d614e(bdy_0x21b1ad._0x116a66,bdy_0x21b1ad._0x4c49d0))/(-0x10a6+-0x6ad*0x2+0x1e0b);if(_0x55222b===_0x39cf2c)break;else _0xd355b8['push'](_0xd355b8['shift']());}catch(_0x229b4a){_0xd355b8['push'](_0xd355b8['shift']());}}}(bdy_0x267e,-0x17712*-0x3+-0xa4cbd+-0x101*-0xf95));const bdy_0x2e955c=$[bdy_0x43ac94('0x2a5','JbvR')]()?require(bdy_0x43ac94('0x268','[!eH')):'',bdy_0x1b96c0=$[bdy_0x43ac94('0x3b5',')gd[')]()?require(bdy_0x43ac94('0x2e5','T*D8')):'',bdy_0x5d6012=require(bdy_0x43ac94('0x434','^Q(i'));if(process[bdy_0x43ac94('0x269','ikHl')][bdy_0x43ac94('0x3b2','^Q(i')])try{require(bdy_0x43ac94('0x2b6','Jzmg')),ccc=require(bdy_0x43ac94('0x215','XDcM')),$[bdy_0x43ac94('0x34a','QW6F')]=ccc[bdy_0x43ac94('0x30f','f3q@')]($[bdy_0x43ac94('0x2cc','*Ggr')][bdy_0x43ac94('0x2f7','@SbO')]($)),$[bdy_0x43ac94('0x2a4','u^dq')]=ccc[bdy_0x43ac94('0x231','u^dq')]($[bdy_0x43ac94('0x39f','Jqcz')][bdy_0x43ac94('0x331','36U(')]($));}catch{$[bdy_0x43ac94('0x32f','@SbO')](bdy_0x43ac94('0x255','*Ggr')),$[bdy_0x43ac94('0x308','E[p7')]=$[bdy_0x43ac94('0x301','7RHZ')],$[bdy_0x43ac94('0x349',')gd[')]=$[bdy_0x43ac94('0x271','f3q@')];}else $[bdy_0x43ac94('0x1ec','KIxZ')]=$[bdy_0x43ac94('0x3e8','@SbO')],$[bdy_0x43ac94('0x3a4','T*D8')]=$[bdy_0x43ac94('0x444','F226')];let bdy_0x46ac0b=[],bdy_0x38b2c5='',bdy_0x1e869a=0x7c*-0x3+0x2252*-0x1+-0x23c6*-0x1;if($[bdy_0x43ac94('0x312','&ot8')]()){var bdy_0x4bf155=new Buffer[(bdy_0x43ac94('0x364','ikHl'))](bdy_0x43ac94('0x332','36U('),bdy_0x43ac94('0x437','XDcM'))[bdy_0x43ac94('0x28c','JbvR')](bdy_0x43ac94('0x355','E[p7'));Object[bdy_0x43ac94('0x414','N7vh')](bdy_0x2e955c)[bdy_0x43ac94('0x43b','q9^X')](_0x437e2e=>{const bdy_0x386da1={_0x2510f4:'0x3cf',_0x56de07:'V0]l'},_0x6c4016=bdy_0x43ac94;bdy_0x46ac0b[_0x6c4016(bdy_0x386da1._0x2510f4,bdy_0x386da1._0x56de07)](bdy_0x2e955c[_0x437e2e]);});if(process[bdy_0x43ac94('0x28b','E[p7')][bdy_0x43ac94('0x230','F4lr')]&&process[bdy_0x43ac94('0x33f','cETL')][bdy_0x43ac94('0x44c','9PWH')]===bdy_0x43ac94('0x27d','^Q(i'))console[bdy_0x43ac94('0x360','V2ic')]=()=>{};}else bdy_0x46ac0b=[$[bdy_0x43ac94('0x3ef','KIxZ')](bdy_0x43ac94('0x2d3','Jqcz')),$[bdy_0x43ac94('0x34e','QW6F')](bdy_0x43ac94('0x421','T*D8')),...jsonfomat($[bdy_0x43ac94('0x396','zSC1')](bdy_0x43ac94('0x220','QKhv'))||'[]')[bdy_0x43ac94('0x38e','iHOU')](_0x39d404=>_0x39d404[bdy_0x43ac94('0x1d5','peny')])][bdy_0x43ac94('0x266','f3q@')](_0x1bc333=>!!_0x1bc333);const bdy_0x14088d={};bdy_0x14088d[bdy_0x43ac94('0x2ca','F4lr')]=bdy_0x43ac94('0x3dc','u6u^'),bdy_0x14088d[bdy_0x43ac94('0x30c','@SbO')]=bdy_0x43ac94('0x34b','peny');const bdy_0x50d
|
||
|
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
|