faker3/jd_wxSecond.js

22 lines
105 KiB
JavaScript
Raw Normal View History

2024-06-28 15:38:28 +08:00
/*
活动名称读秒拼手速 · 超级无线
活动链接https://lzkjdz-isv.isvjd.com/wxSecond/activity/activity?activityId=<活动id>
环境变量jd_wxSecond_activityId // 活动id
jd_wxSecond_addCart // 是否做加购任务,默认不做
7 7 7 7 *
*/
const $ = new Env('读秒拼手速(超级无线)')
const jdCookieNode = $.isNode() ? require('./jdCookie') : ''
const notify = $.isNode() ? require('./sendNotify') : ''
const getH5st = require('./function/getH5st3_0')
const getToken = require('./function/getToken')
const { wxSavePrize } = require('./function/savePrize')
var version_='jsjiami.com.v7';const _0x1af36c=_0x2d0e;(function(_0x76cb68,_0x44fb6b,_0x5f2efe,_0x3550cf,_0x2c4106,_0x27570d,_0x2c7d39){return _0x76cb68=_0x76cb68>>0x9,_0x27570d='hs',_0x2c7d39='hs',function(_0x1234c1,_0x3f4d4f,_0x34ac9b,_0x49c8d4,_0x332789){const _0x2e4bfe=_0x2d0e;_0x49c8d4='tfi',_0x27570d=_0x49c8d4+_0x27570d,_0x332789='up',_0x2c7d39+=_0x332789,_0x27570d=_0x34ac9b(_0x27570d),_0x2c7d39=_0x34ac9b(_0x2c7d39),_0x34ac9b=0x0;const _0x10bd22=_0x1234c1();while(!![]&&--_0x3550cf+_0x3f4d4f){try{_0x49c8d4=parseInt(_0x2e4bfe(0x331,'eTgl'))/0x1*(-parseInt(_0x2e4bfe(0x2b5,'FQ%o'))/0x2)+-parseInt(_0x2e4bfe(0x509,'VHEz'))/0x3*(-parseInt(_0x2e4bfe(0x200,'0jXk'))/0x4)+-parseInt(_0x2e4bfe(0x341,'x8zO'))/0x5+parseInt(_0x2e4bfe(0x180,'OLOW'))/0x6+parseInt(_0x2e4bfe(0x540,'RxGf'))/0x7+-parseInt(_0x2e4bfe(0x26a,'pPvZ'))/0x8*(-parseInt(_0x2e4bfe(0x55f,'4aE('))/0x9)+-parseInt(_0x2e4bfe(0x476,'h6H5'))/0xa*(parseInt(_0x2e4bfe(0x3dd,'ywMy'))/0xb);}catch(_0x38666b){_0x49c8d4=_0x34ac9b;}finally{_0x332789=_0x10bd22[_0x27570d]();if(_0x76cb68<=_0x3550cf)_0x34ac9b?_0x2c4106?_0x49c8d4=_0x332789:_0x2c4106=_0x332789:_0x34ac9b=_0x332789;else{if(_0x34ac9b==_0x2c4106['replace'](/[CTBEAxSbVPYtkyNWn=]/g,'')){if(_0x49c8d4===_0x3f4d4f){_0x10bd22['un'+_0x27570d](_0x332789);break;}_0x10bd22[_0x2c7d39](_0x332789);}}}}}(_0x5f2efe,_0x44fb6b,function(_0x757ffc,_0x100bc7,_0x40ba2a,_0x26c81c,_0x298888,_0x1b86f5,_0x2c0967){return _0x100bc7='\x73\x70\x6c\x69\x74',_0x757ffc=arguments[0x0],_0x757ffc=_0x757ffc[_0x100bc7](''),_0x40ba2a='\x72\x65\x76\x65\x72\x73\x65',_0x757ffc=_0x757ffc[_0x40ba2a]('\x76'),_0x26c81c='\x6a\x6f\x69\x6e',(0x135e5a,_0x757ffc[_0x26c81c](''));});}(0x17c00,0x596e2,_0x5ab0,0xc0),_0x5ab0)&&(version_=_0x5ab0);let lz_cookie={},cookiesArr=[],cookie='';if($[_0x1af36c(0x4e8,'Jgm*')]()){Object[_0x1af36c(0x40d,')lPs')](jdCookieNode)[_0x1af36c(0x1ab,'WjTI')](_0x448054=>{const _0x978a55=_0x1af36c;cookiesArr[_0x978a55(0x353,'L3NL')](jdCookieNode[_0x448054]);});if(process[_0x1af36c(0x2dc,'LHok')][_0x1af36c(0x1c7,'j0nq')]&&process[_0x1af36c(0x258,'w[iW')]['JD_DEBUG']===_0x1af36c(0x2da,'afx&'))console[_0x1af36c(0x577,'pPvZ')]=()=>{};}else cookiesArr=[$['getdata'](_0x1af36c(0x3b1,'FQ%o')),$[_0x1af36c(0x1f7,'VHEz')](_0x1af36c(0x49d,'k04B')),...jsonParse($[_0x1af36c(0x582,'OLOW')](_0x1af36c(0x445,'(K5h'))||'[]')[_0x1af36c(0x1cc,'QIAu')](_0x311afa=>_0x311afa['cookie'])][_0x1af36c(0x360,')spa')](_0x26b67c=>!!_0x26b67c);function _0x2d0e(_0x3f7932,_0x38aea4){const _0x5ab0ec=_0x5ab0();return _0x2d0e=function(_0x2d0ebc,_0xdd5e83){_0x2d0ebc=_0x2d0ebc-0x151;let _0x748f8c=_0x5ab0ec[_0x2d0ebc];if(_0x2d0e['OodrGh']===undefined){var _0x378994=function(_0x10db03){const _0x1cf72f='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x4029f0='',_0x4f8f89='';for(let _0x468807=0x0,_0x321f69,_0x420743,_0x1fca31=0x0;_0x420743=_0x10db03['charAt'](_0x1fca31++);~_0x420743&&(_0x321f69=_0x468807%0x4?_0x321f69*0x40+_0x420743:_0x420743,_0x468807++%0x4)?_0x4029f0+=String['fromCharCode'](0xff&_0x321f69>>(-0x2*_0x468807&0x6)):0x0){_0x420743=_0x1cf72f['indexOf'](_0x420743);}for(let _0x400aea=0x0,_0x18fcab=_0x4029f0['length'];_0x400aea<_0x18fcab;_0x400aea++){_0x4f8f89+='%'+('00'+_0x4029f0['charCodeAt'](_0x400aea)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x4f8f89);};const _0x348490=function(_0x41844c,_0x5f1b87){let _0x24528d=[],_0x8a9e02=0x0,_0x5f089c,_0x4a9f18='';_0x41844c=_0x378994(_0x41844c);let _0x2b0146;for(_0x2b0146=0x0;_0x2b0146<0x100;_0x2b0146++){_0x24528d[_0x2b0146]=_0x2b0146;}for(_0x2b0146=0x0;_0x2b0146<0x100;_0x2b0146++){_0x8a9e02=(_0x8a9e02+_0x24528d[_0x2b0146]+_0x5f1b87['charCodeAt'](_0x2b0146%_0x5f1b87['length']))%0x100,_0x5f089c=_0x24528d[_0x2b0146],_0x24528d[_0x2b0146]=_0x24528d[_0x8a9e02],_0x24528d[_0x8a9e02]=_0x5f089c;}_0x2b0146=0x0,_0x8a9e02=0x0;for(let _0x529e73=0x0;_0x529e73<_0x41844c['length'];_0x529e73++){_0x2b0146=(_0x2b0146+0x1)%0x100,_0x8a9e02=(_0x8a9e02+_0x24528d[_0x2b0146])%0x100,_0x5f089c=_0x24528d[_0x2b0146],_0x24528d[_0x2b0146]=_0x24528d[_0x8a9e02],_0x24528d[_0x8a9e02]=_0x5f089c,_0x4a9f18+=String['fromCharCode'](_0
// 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"])