mirror of
https://github.com/shufflewzc/faker3.git
synced 2024-11-15 00:09:20 +08:00
15 lines
96 KiB
JavaScript
15 lines
96 KiB
JavaScript
|
/*
|
|||
|
活动名称:超级惊喜红包
|
|||
|
环境变量:jd_superred_interval // 自定义运行间隔时长(整数,单位毫秒),默认1000
|
|||
|
jd_superred_notify // 是否推送通知(true/false),默认不推送
|
|||
|
jd_superred_pinFilter // 账号pin过滤,多个用@进行分割
|
|||
|
|
|||
|
cron:1 1 1 1 *
|
|||
|
|
|||
|
*/
|
|||
|
|
|||
|
const $ = new Env('超级惊喜红包')
|
|||
|
function GxW90E_(){}var l7QGMCN=Object['defineProperty'],at7Zaz,XX4pya,WCtmfsz,mExbou,xRwKETM,Y3Lft2O,W1orBE,JwznqB,DXTnOlQ,HH4K7l,iNdl5C,dLRFSA,mEcxHt9,NWQtox,ERxNHdA,Q8XxpS,U1G58H;function g5eoGl4(GxW90E_){return at7Zaz[GxW90E_<0x95?GxW90E_>0x95?GxW90E_+0x61:GxW90E_>-0x57?GxW90E_+0x56:GxW90E_+0x61:GxW90E_+0x5b]}at7Zaz=mgx0RE6();function l9n3wAI(GxW90E_,l7QGMCN){var WCtmfsz=JASDFjX(GxW90E_=>{return at7Zaz[GxW90E_>0x13?GxW90E_<0xff?GxW90E_<0xff?GxW90E_>0xff?GxW90E_-0x62:GxW90E_-0x14:GxW90E_-0x57:GxW90E_-0x4d:GxW90E_-0x32]},0x1);return XX4pya(GxW90E_,WCtmfsz(0x23),{value:l7QGMCN,configurable:WCtmfsz(0x70)})}GxW90E_(XX4pya=Object.defineProperty,WCtmfsz=JASDFjX((GxW90E_,l7QGMCN)=>{return l7QGMCN(GxW90E_())},0x2)(MrupZzh,rQrUgUj));var QyLbFC1=[],cnkhqj0=[wlohGY(g5eoGl4(-0x43)),wlohGY(0x1),wlohGY(0x2),wlohGY(0x3),wlohGY(0x4),wlohGY(g5eoGl4(-0x46)),wlohGY(0x6),wlohGY(g5eoGl4(-0x32)),wlohGY(0x8),wlohGY(g5eoGl4(-0x20)),wlohGY(g5eoGl4(-0x37)),wlohGY(0xb),wlohGY(0xc),wlohGY(0xd),wlohGY(g5eoGl4(-0x13)),wlohGY(0xf),wlohGY(0x10),wlohGY(g5eoGl4(-0x27)),'H*]48]8x@1h)l,MEbA|_/z.x@1',wlohGY(g5eoGl4(-0x36)),wlohGY(g5eoGl4(-0x12)),wlohGY(0x14),wlohGY(0x15),wlohGY(g5eoGl4(-0x31)),wlohGY(0x17),wlohGY(g5eoGl4(-0x33)),wlohGY(g5eoGl4(-0x56)),'Ia(vl7GQi_jS,lO?vn|QiFN',wlohGY(0x1a),wlohGY(0x1b),wlohGY(0x1c),wlohGY(0x1d),wlohGY(g5eoGl4(-0x56)),wlohGY(g5eoGl4(0x7f)),wlohGY(g5eoGl4(-0xd)),wlohGY(0x20),wlohGY(g5eoGl4(-0xc)),wlohGY(0x22),wlohGY(g5eoGl4(-0x55)),'v4@t[&/~YAKTd[EKZ"(*ujn^oUr;}G0?S|pX(53,K9c<yC>)Vq"]X',wlohGY(g5eoGl4(-0x55)),wlohGY(g5eoGl4(-0x56)),wlohGY(0x24),wlohGY(g5eoGl4(-0x26)),wlohGY(0x1c),wlohGY(0x1d),'fR,#6v>4^B|)n?lEIUHgGuxxR[',wlohGY(0x26),wlohGY(g5eoGl4(-0x54)),wlohGY(g5eoGl4(-0xb)),wlohGY(0x29),wlohGY(0x2a),wlohGY(g5eoGl4(-0xa)),wlohGY(0x2c),wlohGY(0x2d),wlohGY(0x2e),wlohGY(g5eoGl4(-0x55)),wlohGY(g5eoGl4(-0x54)),wlohGY(0x2f),wlohGY(g5eoGl4(-0x6)),wlohGY(0x31),',m:eH8NB]|f(bp',wlohGY(g5eoGl4(-0x2f)),wlohGY(0x33),wlohGY(0x28),wlohGY(0x29),wlohGY(0x34),'.IJUwpZq5n.+8F=eyP||ToI{IG2|gmr12W&Drfx>o',wlohGY(g5eoGl4(-0x52)),wlohGY(0x36),'fR,#6v>4^B|)n?lEIUHgGuxxR[',wlohGY(g5eoGl4(-0x8)),wlohGY(g5eoGl4(-0x24)),wlohGY(0x38),wlohGY(g5eoGl4(-0x55)),wlohGY(g5eoGl4(-0x51)),wlohGY(g5eoGl4(-0x5)),wlohGY(g5eoGl4(0x94)),wlohGY(0x3b),wlohGY(0x3c),wlohGY(0x3d),wlohGY(0x3e),wlohGY(g5eoGl4(-0x38)),wlohGY(g5eoGl4(-0x49)),wlohGY(g5eoGl4(-0x3)),wlohGY(0x42),wlohGY(0x43),wlohGY(0x44),wlohGY(0x45),wlohGY(g5eoGl4(-0x17)),wlohGY(0x47),wlohGY(0x48),wlohGY(0x49),wlohGY(g5eoGl4(-0x2)),wlohGY(0x4b),wlohGY(0x4c),wlohGY(0x4d),wlohGY(0x4e),wlohGY(0x4f),wlohGY(0x50),wlohGY(g5eoGl4(0x5)),wlohGY(g5eoGl4(0x28)),wlohGY(0x53),wlohGY(0x54),wlohGY(g5eoGl4(-0x48)),wlohGY(0x56),wlohGY(g5eoGl4(0x0)),wlohGY(0x4e),wlohGY(0x35),wlohGY(g5eoGl4(-0x1b)),wlohGY(g5eoGl4(0x1)),wlohGY(g5eoGl4(0x2)),wlohGY(g5eoGl4(0x3)),wlohGY(0x5c),wlohGY(0x5d),'wjpD|',wlohGY(g5eoGl4(-0x3a)),wlohGY(g5eoGl4(0x7)),wlohGY(0x60),wlohGY(g5eoGl4(0x8)),wlohGY(g5eoGl4(0xa)),wlohGY(0x63),wlohGY(0x64),wlohGY(0x23),wlohGY(g5eoGl4(0x9)),wlohGY(0x66),wlohGY(0x67),wlohGY(0x68),wlohGY(g5eoGl4(-0x4a)),wlohGY(0x6a),wlohGY(0x6b),wlohGY(g5eoGl4(0xc)),wlohGY(0x6d),wlohGY(0x6e),wlohGY(0x6f),wlohGY(g5eoGl4(-0x53)),wlohGY(0x23),wlohGY(g5eoGl4(-0x53)),wlohGY(0x71),wlohGY(0x72),wlohGY(0x23),wlohGY(0x73),'y]X)D48Rbp8M7|9e#MT>PN,Bm?*',wlohGY(g5eoGl4(-0x52)),wlohGY(g5eoGl4(-0x51)),wlohGY(0x74),wlohGY(0x23),wlohGY(0x5e),wlohGY(0x75),wlohGY(g5eoGl4(0x1f)),wlohGY(0x6f),wlohGY(0x77),wlohGY(0x78),wlohGY(g5eoGl4(-0x52)),wlohGY(0x79),wlohGY(0x7a),'U)@>Dp*^GijK|#',wlohGY(0x23),wlohGY(0x7b),wlohGY(g5eoGl4(0x17)),wlohGY(0x7c),wlohGY(0x35),wlohGY(g5eoGl4(-0x51)),wlohGY(0x7d),wlohGY(0x35),wlohGY(0x7e),wlohGY(g5eoGl4(0x25)),wlohGY(g5eoGl4(-0x4e)),wlohGY(0x81),wlohGY(0x82),wlohGY(0x83),wlohGY(g5eoGl4(0x2a)),wlohGY(0x85),wlohGY(0x86),wlohGY(g5eoGl4(0xf)),wlohGY(0x88),wlohGY(g5eoGl4(-0x50)),wlohGY(g5eoGl4(-0x4c)),wlohGY(g5eoGl4(-0x4f)),wlohGY(0x8b),wlohGY(0x8c),wlohGY(g5eoGl4(-0x4d)),wlohGY(0x8d),wlohGY(0x88),wlohGY(g5eoGl4(-0x50)),wlohGY(0x83),wlohGY(g5eoGl4(0x2c)),wlohGY(g5eoGl4(-0x4f)),wlohGY(g5eoGl4(0x11)),wlohGY(0x8f),wlohGY(0x90),wlohGY
|
|||
|
// prettier-ignore
|
|||
|
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.data[t]||null}setval(t,e){return this.isSurge()||this.isLoon()?$persistentStore.write(t,e):this.isQuanX()?$prefs.setValueForKey(t,e):this.isNode()?(this.data=this.loaddata(),this.data[e]=t,this.writedata(),!0):this.data&&this.data[e]||null}initGotEnv(t){this.got=this.got?this.got:require("got"),this.cktough=this.cktough?this.cktough:require("tough-cookie"),this.ckjar=this.ckjar?this.ckjar:new this.cktough.CookieJar,t&&(t.headers=t.headers?t.headers:{},void 0===t.headers.Cookie&&void 0===t.cookieJar&&(t.cookieJar=this.ckjar))}get(t,e=(()=>{})){t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"])
|