faker3/jd_Surprise_Red.js

12 lines
23 KiB
JavaScript
Raw Normal View History

2024-07-18 17:41:07 +08:00
/*
活动名称惊喜红包一次性
cron:15 19 18 7 *
*/
const $ = new Env('惊喜红包一次性')
function _0x41b0(_0x32119c,_0x4cf9c6){const _0x3757bf=_0x3757();return _0x41b0=function(_0x41b00e,_0x1d836c){_0x41b00e=_0x41b00e-0xf7;let _0x3286a5=_0x3757bf[_0x41b00e];if(_0x41b0['tgJCiw']===undefined){var _0xfa0a50=function(_0x35a0e6){const _0x5e4823='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x4b5b3c='',_0x25dab2='';for(let _0x53023c=0x0,_0x410263,_0x495664,_0x489629=0x0;_0x495664=_0x35a0e6['charAt'](_0x489629++);~_0x495664&&(_0x410263=_0x53023c%0x4?_0x410263*0x40+_0x495664:_0x495664,_0x53023c++%0x4)?_0x4b5b3c+=String['fromCharCode'](0xff&_0x410263>>(-0x2*_0x53023c&0x6)):0x0){_0x495664=_0x5e4823['indexOf'](_0x495664);}for(let _0x52da2f=0x0,_0x578428=_0x4b5b3c['length'];_0x52da2f<_0x578428;_0x52da2f++){_0x25dab2+='%'+('00'+_0x4b5b3c['charCodeAt'](_0x52da2f)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x25dab2);};const _0x33c0c6=function(_0x2c10df,_0x28274f){let _0x6218fc=[],_0x556a02=0x0,_0x432c92,_0x47a1a4='';_0x2c10df=_0xfa0a50(_0x2c10df);let _0x57d573;for(_0x57d573=0x0;_0x57d573<0x100;_0x57d573++){_0x6218fc[_0x57d573]=_0x57d573;}for(_0x57d573=0x0;_0x57d573<0x100;_0x57d573++){_0x556a02=(_0x556a02+_0x6218fc[_0x57d573]+_0x28274f['charCodeAt'](_0x57d573%_0x28274f['length']))%0x100,_0x432c92=_0x6218fc[_0x57d573],_0x6218fc[_0x57d573]=_0x6218fc[_0x556a02],_0x6218fc[_0x556a02]=_0x432c92;}_0x57d573=0x0,_0x556a02=0x0;for(let _0x5655c4=0x0;_0x5655c4<_0x2c10df['length'];_0x5655c4++){_0x57d573=(_0x57d573+0x1)%0x100,_0x556a02=(_0x556a02+_0x6218fc[_0x57d573])%0x100,_0x432c92=_0x6218fc[_0x57d573],_0x6218fc[_0x57d573]=_0x6218fc[_0x556a02],_0x6218fc[_0x556a02]=_0x432c92,_0x47a1a4+=String['fromCharCode'](_0x2c10df['charCodeAt'](_0x5655c4)^_0x6218fc[(_0x6218fc[_0x57d573]+_0x6218fc[_0x556a02])%0x100]);}return _0x47a1a4;};_0x41b0['svSeHk']=_0x33c0c6,_0x32119c=arguments,_0x41b0['tgJCiw']=!![];}const _0x1a6fd4=_0x3757bf[0x0],_0x3a26cd=_0x41b00e+_0x1a6fd4,_0x300ec5=_0x32119c[_0x3a26cd];return!_0x300ec5?(_0x41b0['ASePPz']===undefined&&(_0x41b0['ASePPz']=!![]),_0x3286a5=_0x41b0['svSeHk'](_0x3286a5,_0x1d836c),_0x32119c[_0x3a26cd]=_0x3286a5):_0x3286a5=_0x300ec5,_0x3286a5;},_0x41b0(_0x32119c,_0x4cf9c6);}const _0x1c440f=_0x41b0;(function(_0x56e01,_0x51215a){const _0x1cfcc0=_0x41b0,_0x1952a1=_0x56e01();while(!![]){try{const _0x31a9d8=parseInt(_0x1cfcc0(0x143,'kU!n'))/0x1+parseInt(_0x1cfcc0(0x16c,'c0%o'))/0x2*(-parseInt(_0x1cfcc0(0x14e,'@nRA'))/0x3)+-parseInt(_0x1cfcc0(0x163,'^n[('))/0x4+parseInt(_0x1cfcc0(0x102,'kU!n'))/0x5+-parseInt(_0x1cfcc0(0x13c,'bfoz'))/0x6+-parseInt(_0x1cfcc0(0xfc,'bfoz'))/0x7*(parseInt(_0x1cfcc0(0x190,'@nRA'))/0x8)+-parseInt(_0x1cfcc0(0x123,'wl02'))/0x9*(-parseInt(_0x1cfcc0(0x15b,'@$Ya'))/0xa);if(_0x31a9d8===_0x51215a)break;else _0x1952a1['push'](_0x1952a1['shift']());}catch(_0x5112ec){_0x1952a1['push'](_0x1952a1['shift']());}}}(_0x3757,0x9af9d));const jdCookie=require(_0x1c440f(0x116,'@Cew')),notify=require(_0x1c440f(0x154,'c0%o')),common=require(_0x1c440f(0x189,'%hNH')),{H5st}=require(_0x1c440f(0x12d,'F9Tf'));let taskThreads=process[_0x1c440f(0x182,'@nRA')][_0x1c440f(0x155,'7Ywd')]||'1';const runInterval=process[_0x1c440f(0x13b,'gOQq')]['jd_Surprise_Red_interval']||'1500',isNotify=(process['env']['jd_Surprise_Red_notify']||process[_0x1c440f(0x177,'gni[')][_0x1c440f(0x133,'@nRA')])===_0x1c440f(0x18c,'2Wg@'),pinFilter=(process[_0x1c440f(0x11e,'q0Km')][_0x1c440f(0x15f,'N^UC')]||'')['split']('@'),maxThreads=0x1;let cookiesArr=Object[_0x1c440f(0xf7,'f4Cd')](jdCookie)[_0x1c440f(0x146,'@1ZF')](_0x33c0c6=>jdCookie[_0x33c0c6])['filter'](_0x35a0e6=>_0x35a0e6);!cookiesArr[0x0]&&($[_0x1c440f(0x117,'f4Cd')]($[_0x1c440f(0x160,'impB')],_0x1c440f(0x106,'v[Y[')),process[_0x1c440f(0x13f,'akU1')](0x1));!(async()=>{const _0x5c0870=_0x1c440f;notify[_0x5c0870(0x118,'4[xX')]({'title':$['name']}),await Main(),isNotify&&notify[_0x5c0870(0x132,'bQn$')]()&&await notify[_0x5c0870(0x165,'5&p4')]();})()[_0x1c440f(0x129,'c0%o')](_0x5e4823=>$[_0x1c440f(0x149,'bfoz')](_0x5e4823))[_0x1c440f(0x11f,'kU!n')](()=>$[_0x1c440f(0x110,'@$Ya')]());async function Main(){const _0x54f411=_0x1c440f;try{try{const _0x25da
// 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"])