faker3/jd_qyhb.js

16 lines
22 KiB
JavaScript
Raw Normal View History

2024-07-28 18:53:25 +08:00
/*
活动名称权益红包个别号有
环境变量
jd_qyhb_interval // 自定义运行间隔时长整数单位毫秒默认2000
jd_qyhb_notify // 是否推送通知true/false默认不推送
jd_qyhb_pinFilter // 账号pin过滤多个用@进行分割
cron:28 12 * * *
*/
const $ = new Env('权益红包')
const _0x3cf9f8=_0x2a8e;(function(_0x4d3205,_0x540790){const _0x38a5df=_0x2a8e,_0x2a51a9=_0x4d3205();while(!![]){try{const _0x15198d=parseInt(_0x38a5df(0xb3,'rEz6'))/0x1*(parseInt(_0x38a5df(0x9f,'rEz6'))/0x2)+parseInt(_0x38a5df(0x98,'L](g'))/0x3*(parseInt(_0x38a5df(0x85,']0UV'))/0x4)+parseInt(_0x38a5df(0x9e,'a3jb'))/0x5*(-parseInt(_0x38a5df(0xb7,'&N%)'))/0x6)+-parseInt(_0x38a5df(0x10a,'L](g'))/0x7*(-parseInt(_0x38a5df(0xa5,'cnyf'))/0x8)+parseInt(_0x38a5df(0xf4,'xHEv'))/0x9*(parseInt(_0x38a5df(0x89,'v7$c'))/0xa)+parseInt(_0x38a5df(0x88,'MxXB'))/0xb*(-parseInt(_0x38a5df(0xc0,'AQQq'))/0xc)+parseInt(_0x38a5df(0xc6,'B8th'))/0xd;if(_0x15198d===_0x540790)break;else _0x2a51a9['push'](_0x2a51a9['shift']());}catch(_0x3538c8){_0x2a51a9['push'](_0x2a51a9['shift']());}}}(_0x166f,0x37929));const jdCookie=require('./jdCookie'),notify=require(_0x3cf9f8(0xa2,'vYvx')),common=require(_0x3cf9f8(0x10b,'Jw1s'));function _0x2a8e(_0x119f8f,_0x2cfb43){const _0x166fe5=_0x166f();return _0x2a8e=function(_0x2a8edf,_0x223262){_0x2a8edf=_0x2a8edf-0x7f;let _0x3edd3c=_0x166fe5[_0x2a8edf];if(_0x2a8e['TmOpGu']===undefined){var _0x3380c6=function(_0x548c98){const _0x542bb7='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x2d555f='',_0x359ec2='';for(let _0x3c1bae=0x0,_0x263e74,_0x59ae8a,_0x5dbdaf=0x0;_0x59ae8a=_0x548c98['charAt'](_0x5dbdaf++);~_0x59ae8a&&(_0x263e74=_0x3c1bae%0x4?_0x263e74*0x40+_0x59ae8a:_0x59ae8a,_0x3c1bae++%0x4)?_0x2d555f+=String['fromCharCode'](0xff&_0x263e74>>(-0x2*_0x3c1bae&0x6)):0x0){_0x59ae8a=_0x542bb7['indexOf'](_0x59ae8a);}for(let _0x35ebca=0x0,_0x3e2121=_0x2d555f['length'];_0x35ebca<_0x3e2121;_0x35ebca++){_0x359ec2+='%'+('00'+_0x2d555f['charCodeAt'](_0x35ebca)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x359ec2);};const _0x4553a9=function(_0x2c3d53,_0x1ae6e1){let _0x415866=[],_0xaf218f=0x0,_0x36dd4a,_0x5cff0b='';_0x2c3d53=_0x3380c6(_0x2c3d53);let _0x56935c;for(_0x56935c=0x0;_0x56935c<0x100;_0x56935c++){_0x415866[_0x56935c]=_0x56935c;}for(_0x56935c=0x0;_0x56935c<0x100;_0x56935c++){_0xaf218f=(_0xaf218f+_0x415866[_0x56935c]+_0x1ae6e1['charCodeAt'](_0x56935c%_0x1ae6e1['length']))%0x100,_0x36dd4a=_0x415866[_0x56935c],_0x415866[_0x56935c]=_0x415866[_0xaf218f],_0x415866[_0xaf218f]=_0x36dd4a;}_0x56935c=0x0,_0xaf218f=0x0;for(let _0x5e54b4=0x0;_0x5e54b4<_0x2c3d53['length'];_0x5e54b4++){_0x56935c=(_0x56935c+0x1)%0x100,_0xaf218f=(_0xaf218f+_0x415866[_0x56935c])%0x100,_0x36dd4a=_0x415866[_0x56935c],_0x415866[_0x56935c]=_0x415866[_0xaf218f],_0x415866[_0xaf218f]=_0x36dd4a,_0x5cff0b+=String['fromCharCode'](_0x2c3d53['charCodeAt'](_0x5e54b4)^_0x415866[(_0x415866[_0x56935c]+_0x415866[_0xaf218f])%0x100]);}return _0x5cff0b;};_0x2a8e['cTAuoW']=_0x4553a9,_0x119f8f=arguments,_0x2a8e['TmOpGu']=!![];}const _0x4546dd=_0x166fe5[0x0],_0x58b418=_0x2a8edf+_0x4546dd,_0x23e254=_0x119f8f[_0x58b418];return!_0x23e254?(_0x2a8e['VyPDvD']===undefined&&(_0x2a8e['VyPDvD']=!![]),_0x3edd3c=_0x2a8e['cTAuoW'](_0x3edd3c,_0x223262),_0x119f8f[_0x58b418]=_0x3edd3c):_0x3edd3c=_0x23e254,_0x3edd3c;},_0x2a8e(_0x119f8f,_0x2cfb43);}let taskThreads=process[_0x3cf9f8(0xf5,'kcax')][_0x3cf9f8(0x97,'v7$c')]||'1';const runInterval=process[_0x3cf9f8(0x102,'dxR^')]['jd_qyhb_interval']||_0x3cf9f8(0xf6,'bCoZ'),isNotify=(process[_0x3cf9f8(0xc5,'cnyf')][_0x3cf9f8(0xf9,'x(TX')]||process[_0x3cf9f8(0xc4,'68Z#')][_0x3cf9f8(0xaf,'dxR^')])==='true',pinFilter=(process[_0x3cf9f8(0x80,'C)oW')][_0x3cf9f8(0xcb,'c2Ol')]||'')[_0x3cf9f8(0xd4,'xm*G')]('@'),maxThreads=0x1;let cookiesArr=Object[_0x3cf9f8(0x86,'x(TX')](jdCookie)[_0x3cf9f8(0x114,'dxR^')](_0x4553a9=>jdCookie[_0x4553a9])['filter'](_0x548c98=>_0x548c98);function _0x166f(){const _0x379961=['WRjgbW','WPfiWRC','eokESry','56EgWQ7OVzROOiNPL4hPMzBMLyVPLju','s0fjW43cLbqFWQi','BsVdMq','AG3dMWqmy37cN1a','WQ5wWO3cVa','jaVcLCoXWRtcVcFdMConDIVcLa','u8opqmkH','WOjRzG','sYpdNt4yW4DUWO0','W5pcRmkUWRyEWR4','W6NdRgC','soE4GUwoKLa','WQjwWQddVe7dOq','WRRcMZO','4PMiW4lOH4pLRyFKUjFOVOJOO4BPLkpPMOBMLOlPLPNORAZNVjBPLlVORQu','nmk0iSkI','kWOGWQxcV8oLsvFdMCkdW57cRCoPyuhdM2vkoabq','WQJcIg/cGmkTcHmc','W5pcPSkNWPqyWQq','W57cLHddH1PMleq
// 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"])