mirror of https://github.com/6dylan6/jdpro.git
9 lines
132 KiB
JavaScript
9 lines
132 KiB
JavaScript
|
/*
|
|||
|
活动入口:APP我的--瓜分得豆
|
|||
|
15 7-21/2 * * * jd_plantBean.js
|
|||
|
|
|||
|
*/
|
|||
|
const $ = new Env('种豆得豆任务');
|
|||
|
var _0xodn='jsjiami.com.v7';const _0x3e75aa=_0x1940;(function(_0x30bcca,_0xc0d02f,_0x1ebcc7,_0x1a767b,_0x40a941,_0x285e24,_0xb20ec4){return _0x30bcca=_0x30bcca>>0x4,_0x285e24='hs',_0xb20ec4='hs',function(_0x4fce3d,_0x17cc0d,_0x58b3c6,_0x164364,_0x15baeb){const _0x1cd3c2=_0x1940;_0x164364='tfi',_0x285e24=_0x164364+_0x285e24,_0x15baeb='up',_0xb20ec4+=_0x15baeb,_0x285e24=_0x58b3c6(_0x285e24),_0xb20ec4=_0x58b3c6(_0xb20ec4),_0x58b3c6=0x0;const _0x24bc9b=_0x4fce3d();while(!![]&&--_0x1a767b+_0x17cc0d){try{_0x164364=-parseInt(_0x1cd3c2(0x500,'bUnj'))/0x1+-parseInt(_0x1cd3c2(0x4b5,'nlOB'))/0x2*(-parseInt(_0x1cd3c2(0x27d,'ngDJ'))/0x3)+-parseInt(_0x1cd3c2(0x4a3,'35eI'))/0x4*(parseInt(_0x1cd3c2(0x3d2,'kjH('))/0x5)+-parseInt(_0x1cd3c2(0x586,')oUF'))/0x6*(parseInt(_0x1cd3c2(0xd1,'#It%'))/0x7)+parseInt(_0x1cd3c2(0x4c5,')2^j'))/0x8+parseInt(_0x1cd3c2(0x1b5,'kjH('))/0x9*(parseInt(_0x1cd3c2(0x9b,'YPVb'))/0xa)+parseInt(_0x1cd3c2(0x21b,'rd[T'))/0xb;}catch(_0x4aad8a){_0x164364=_0x58b3c6;}finally{_0x15baeb=_0x24bc9b[_0x285e24]();if(_0x30bcca<=_0x1a767b)_0x58b3c6?_0x40a941?_0x164364=_0x15baeb:_0x40a941=_0x15baeb:_0x58b3c6=_0x15baeb;else{if(_0x58b3c6==_0x40a941['replace'](/[LySVdEWIJGuXtHYCDe=]/g,'')){if(_0x164364===_0x17cc0d){_0x24bc9b['un'+_0x285e24](_0x15baeb);break;}_0x24bc9b[_0xb20ec4](_0x15baeb);}}}}}(_0x1ebcc7,_0xc0d02f,function(_0x4a6de8,_0xaf144c,_0x47147f,_0x453546,_0x4c61b3,_0x598101,_0x418212){return _0xaf144c='\x73\x70\x6c\x69\x74',_0x4a6de8=arguments[0x0],_0x4a6de8=_0x4a6de8[_0xaf144c](''),_0x47147f=`\x72\x65\x76\x65\x72\x73\x65`,_0x4a6de8=_0x4a6de8[_0x47147f]('\x76'),_0x453546=`\x6a\x6f\x69\x6e`,(0x156e07,_0x4a6de8[_0x453546](''));});}(0xbc0,0x1ff9a,_0x32da,0xbe),_0x32da)&&(_0xodn=0x13c1);const _0x138742=(function(){const _0x5496b3=_0x1940,_0x4af415={'eiZvK':_0x5496b3(0x13b,'lVZX'),'NAZoE':function(_0x15fa54,_0x58ff7d){return _0x15fa54!==_0x58ff7d;},'xwSNf':_0x5496b3(0x2c7,'&Gtx')};let _0x2c5b53=!![];return function(_0x5c6b0f,_0x1edb09){const _0x24093a=_0x5496b3,_0x219e56={'yNdpy':_0x4af415[_0x24093a(0x55c,'*xlg')],'ioili':function(_0xc83d31,_0x3a0abe){const _0x55a5d4=_0x24093a;return _0x4af415[_0x55a5d4(0x14a,'7IOO')](_0xc83d31,_0x3a0abe);},'NjYWY':_0x4af415[_0x24093a(0x574,'I4@R')]},_0x212f0a=_0x2c5b53?function(){const _0x1bc579=_0x24093a;if(_0x219e56[_0x1bc579(0xf0,'35eI')](_0x219e56[_0x1bc579(0x297,'9jKo')],_0x219e56[_0x1bc579(0x51f,'I4@R')]))try{return _0x453284[_0x1bc579(0x2e1,'1Kg2')](_0x259620);}catch(_0x1cfb22){return _0x3037c3[_0x1bc579(0x41f,'TBpy')](_0x1cfb22),_0x3612d2[_0x1bc579(0x1d6,'7IOO')](_0x58a806[_0x1bc579(0x36c,'bwep')],'',_0x219e56[_0x1bc579(0x3ab,'5sH(')]),[];}else{if(_0x1edb09){const _0x2395d9=_0x1edb09[_0x1bc579(0x6a2,'7IOO')](_0x5c6b0f,arguments);return _0x1edb09=null,_0x2395d9;}}}:function(){};return _0x2c5b53=![],_0x212f0a;};}()),_0xe7bb91=_0x138742(this,function(){const _0x3a457e=_0x1940,_0x19896f={'hUqnd':_0x3a457e(0x277,'l!wl')};return _0xe7bb91[_0x3a457e(0x254,'rd[T')]()[_0x3a457e(0xf3,'kIJ&')](_0x19896f[_0x3a457e(0x630,'KGHL')])[_0x3a457e(0x3bb,'x]Si')]()[_0x3a457e(0x2f2,'0inf')](_0xe7bb91)[_0x3a457e(0x47b,'K@YD')](_0x19896f[_0x3a457e(0x24d,'tdQ!')]);});_0xe7bb91();let _0x292b29=!![],_0x413aa1=[],_0x378924='',_0x213604,_0x5b108e=[],_0x1d22d0,_0x2830b4;const _0x2fe271=require(_0x3e75aa(0x2ab,'kIJ&')),_0x368b43=require('fs'),_0x1222d7=_0x3e75aa(0x516,')2^j');if(process[_0x3e75aa(0x40d,'2ndO')][_0x3e75aa(0x60c,'0inf')])try{ccc=require(_0x3e75aa(0x68f,'[*cz')),$[_0x3e75aa(0xe8,'1Kg2')]=ccc[_0x3e75aa(0x39b,'jwB@')]($[_0x3e75aa(0x35d,'ngDJ')][_0x3e75aa(0x49b,'bwep')]($)),$[_0x3e75aa(0x63e,'bsT%')]=ccc[_0x3e75aa(0x479,'!2Zi')]($[_0x3e75aa(0x240,'KGHL')][_0x3e75aa(0x576,'Ft9p')]($));}catch{$[_0x3e75aa(0x2a1,'I4@R')]=$[_0x3e75aa(0x274,'7IOO')],$[_0x3e75aa(0x5b9,'nlOB')]=$[_0x3e75aa(0x4cb,'kjH(')];}else $[_0x3e75aa(0x2b5,'#It%')]=$[_0x3e75aa(0x43a,')4Bj')],$[_0x3e75aa(0x463,'*xlg')]=$[_0x3e75aa(0x367,'kDH*')];let _0x669367='',_0x1fad4e=null,_0x279d91=null,_0x2e3077=[],_0x16d860='',_0x51237f,_0x118470=new Date()[_0x3e75aa(0x540,'[*cz')](),_0x51c94d=!![];$[_0x3e75aa(0x5a5,'0inf')]()&&process[_0x3e75aa(0x273,
|
|||
|
function Env(t, e) { "undefined" != typeof process && JSON.stringify(process.env).indexOf("GITHUB") > -1 && process.exit(0); 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((e, i) => { s.call(this, t, (t, s, r) => { t ? i(t) : e(s) }) }) } 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.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.startTime = (new Date).getTime(), Object.assign(this, e), this.log("", `🔔${this.name}, 开始!`) } isNode() { return "undefined" != typeof module && !!module.exports } isQuanX() { return "undefined" != typeof $task } isSurge() { return "undefined" != typeof $httpClient && "undefined" == typeof $loon } isLoon() { return "undefined" != typeof $loon } toObj(t, e = null) { try { return JSON.parse(t) } catch { return e } } toStr(t, e = null) { try { return JSON.stringify(t) } catch { return e } } getjson(t, e) { let s = e; const i = this.getdata(t); if (i) 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(e => { this.get({ url: t }, (t, s, i) => e(i)) }) } runScript(t, e) { return new Promise(s => { let i = this.getdata("@chavy_boxjs_userCfgs.httpapi"); i = i ? i.replace(/\n/g, "").trim() : i; let r = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout"); r = r ? 1 * r : 20, r = e && e.timeout ? e.timeout : r; const [o, h] = i.split("@"), n = { url: `http://${h}/v1/scripting/evaluate`, body: { script_text: t, mock_type: "cron", timeout: r }, headers: { "X-Key": o, Accept: "*/*" } }; this.post(n, (t, e, i) => s(i)) }).catch(t => this.logErr(t)) } loaddata() { if (!this.isNode()) return {}; { this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); const t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(t), i = !s && this.fs.existsSync(e); if (!s && !i) return {}; { const i = s ? t : e; try { return JSON.parse(this.fs.readFileSync(i)) } catch (t) { return {} } } } } writedata() { if (this.isNode()) { this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); const t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(t), i = !s && this.fs.existsSync(e), r = JSON.stringify(this.data); s ? this.fs.writeFileSync(t, r) : i ? this.fs.writeFileSync(e, r) : this.fs.writeFileSync(t, r) } } lodash_get(t, e, s) { const i = e.replace(/\[(\d+)\]/g, ".$1").split("."); let r = t; for (const t of i) if (r = Object(r)[t], void 0 === r) return s; return r } lodash_set(t, e, s) { return Object(t) !== t ? t : (Array.isArray(e) || (e = e.toString().match(/[^.[\]]+/g) || []), e.slice(0, -1).reduce((t, s, i) => Object(t[s]) === t[s] ? t[s] : t[s] = Math.abs(e[i + 1]) >> 0 == +e[i + 1] ? [] : {}, t)[e[e.length - 1]] = s, t) } getdata(t) { let e = this.getval(t); if (/^@/.test(t)) { const [, s, i] = /^@(.*?)\.(.*?)$/.exec(t), r = s ? this.getval(s) : ""; if (r) try { const t = JSON.parse(r); e = t ? this.lodash_get(t, i, "") : e } catch (t) { e = "" } } return e } setdata(t, e) { let s = !1; if (/^@/.test(e)) { const [, i, r] = /^@(.*?)\.(.*?)$/.exec(e), o = this.getval(i), h = i ? "null" === o ? null : o || "{}" : "{}"; try { const e = JSON.parse(h); this.lodash_set(e, r, t), s = this.setval(JSON.stringify(e), i) } catch (e) { const o = {}; this.lodash_set(o, r, t), s = this.setval(JSON.stringify(o), i) } } else s = this.setval(t, e); return s } getval(t) { return this.isSurge() || this.isLoon() ? $persistentStore.read(t) : this.isQuanX() ? $prefs.valueForKey(t) : this.isNode() ? (this.data = this.loaddata(), this.data[t]) : this.data && this.d
|