faker3/jd_wxShopGift.js

23 lines
111 KiB
JavaScript
Raw Normal View History

2024-06-28 15:38:28 +08:00
/*
活动名称店铺礼包 · 超级无线/超级会员/fjzy
活动链接https://lzkj-isv.isvjd.com/wxShopGift/activity?activityId=<活动id>
https://cjhy-isv.isvjcloud.com/wxShopGift/activity?activityId=<活动id>
https://fjzy-isv.isvjcloud.com/index.php?mod=wxShopGift&c=giftOne&activeId=<活动id>
环境变量jd_wxShopGift_activityUrl // 活动链接
jd_wxShopGift_openCard // 是否开卡,默认不开卡
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')
var version_='jsjiami.com.v7';const _0x1590f6=_0x3e93;(function(_0x4609eb,_0x27ebbf,_0x24e7c7,_0x2862a0,_0x4cf60d,_0x319f14,_0x517aab){return _0x4609eb=_0x4609eb>>0x1,_0x319f14='hs',_0x517aab='hs',function(_0x15f674,_0x1bed28,_0x34683f,_0x5b5674,_0x1ca71a){const _0x5ab8ab=_0x3e93;_0x5b5674='tfi',_0x319f14=_0x5b5674+_0x319f14,_0x1ca71a='up',_0x517aab+=_0x1ca71a,_0x319f14=_0x34683f(_0x319f14),_0x517aab=_0x34683f(_0x517aab),_0x34683f=0x0;const _0xe2b817=_0x15f674();while(!![]&&--_0x2862a0+_0x1bed28){try{_0x5b5674=-parseInt(_0x5ab8ab(0x466,'9mzJ'))/0x1*(-parseInt(_0x5ab8ab(0x1a6,'&B^M'))/0x2)+-parseInt(_0x5ab8ab(0x2fc,'uDxi'))/0x3*(parseInt(_0x5ab8ab(0x422,'j7eA'))/0x4)+parseInt(_0x5ab8ab(0x498,'*wc%'))/0x5*(parseInt(_0x5ab8ab(0x4a6,'5s5U'))/0x6)+-parseInt(_0x5ab8ab(0x351,'F*!U'))/0x7*(-parseInt(_0x5ab8ab(0x591,'jwuW'))/0x8)+-parseInt(_0x5ab8ab(0x56f,'Kgb!'))/0x9*(-parseInt(_0x5ab8ab(0x4f0,'NZ@Z'))/0xa)+-parseInt(_0x5ab8ab(0x201,'pPpt'))/0xb+-parseInt(_0x5ab8ab(0x49d,'D96#'))/0xc;}catch(_0x520b74){_0x5b5674=_0x34683f;}finally{_0x1ca71a=_0xe2b817[_0x319f14]();if(_0x4609eb<=_0x2862a0)_0x34683f?_0x4cf60d?_0x5b5674=_0x1ca71a:_0x4cf60d=_0x1ca71a:_0x34683f=_0x1ca71a;else{if(_0x34683f==_0x4cf60d['replace'](/[hPXnMUYClkSQJuRpDVN=]/g,'')){if(_0x5b5674===_0x1bed28){_0xe2b817['un'+_0x319f14](_0x1ca71a);break;}_0xe2b817[_0x517aab](_0x1ca71a);}}}}}(_0x24e7c7,_0x27ebbf,function(_0xbc228c,_0x46bfa9,_0x415119,_0x580de7,_0x138241,_0x1f586e,_0x5ac496){return _0x46bfa9='\x73\x70\x6c\x69\x74',_0xbc228c=arguments[0x0],_0xbc228c=_0xbc228c[_0x46bfa9](''),_0x415119='\x72\x65\x76\x65\x72\x73\x65',_0xbc228c=_0xbc228c[_0x415119]('\x76'),_0x580de7='\x6a\x6f\x69\x6e',(0x135e5d,_0xbc228c[_0x580de7](''));});}(0x198,0x812aa,_0x5dc2,0xce),_0x5dc2)&&(version_=_0x5dc2);let activityUrl=process[_0x1590f6(0x247,'8[6^')][_0x1590f6(0x14f,'&B^M')]?process[_0x1590f6(0x157,'F*!U')][_0x1590f6(0x52b,'PS$1')]:'',openCard=process['env'][_0x1590f6(0x26f,'81@V')]==='true'?!![]:![],lz_cookie={},activityCookie='',cookiesArr=[],cookie='',message='',allMessage='';messageTitle='';if($[_0x1590f6(0x593,'Vd6n')]()){if(JSON[_0x1590f6(0x39a,'j7eA')](process[_0x1590f6(0x22d,'@8zd')])[_0x1590f6(0x2ea,'8[6^')]('GITHUB')>-0x1)process['exit'](0x0);Object[_0x1590f6(0x1c7,'D96#')](jdCookieNode)[_0x1590f6(0x3b2,'jygn')](_0x329072=>{const _0x59f98d=_0x1590f6;cookiesArr[_0x59f98d(0x40b,'&B^M')](jdCookieNode[_0x329072]);});if(process[_0x1590f6(0x457,'5s5U')]['JD_DEBUG']&&process['env']['JD_DEBUG']===_0x1590f6(0x274,'*6zC'))console[_0x1590f6(0x30f,'jwuW')]=()=>{};}else cookiesArr=[$[_0x1590f6(0x3ef,'*wc%')](_0x1590f6(0x4b0,'jwuW')),$[_0x1590f6(0x283,'j7eA')](_0x1590f6(0x2b4,'DYSA')),...$['toObj']($['getdata']('CookiesJD')||'[]')[_0x1590f6(0x2b9,'^O4U')](_0x3c2912=>_0x3c2912[_0x1590f6(0x3ca,'&*4i')])][_0x1590f6(0x4ec,'&B^M')](_0x22542c=>!!_0x22542c);if(activityUrl){const zMDlkn=_0x1590f6(0x410,'tQ4n')[_0x1590f6(0x310,'jwuW')]('|');let JKpYeN=0x0;while(!![]){switch(zMDlkn[JKpYeN++]){case'0':if($[_0x1590f6(0x304,'NZ@Z')][_0x1590f6(0x495,'[zE(')]('cjhy'))$[_0x1590f6(0x250,'PS$1')]=_0x1590f6(0x512,'qgn9');continue;case'1':$[_0x1590f6(0x1ba,'D96#')]=activityUrl[_0x1590f6(0x321,'qgn9')](/https?:\/\/([^/]+)/)[0x1];continue;case'2':$[_0x1590f6(0x414,'PS$1')][_0x1590f6(0x510,'iVv]')](_0x1590f6(0x427,'*wc%'))?$[_0x1590f6(0x51b,'fB%Z')]=getQueryString(''+activityUrl,_0x1590f6(0x2ef,'*ZnX')):$['activityId']=getQueryString(''+activityUrl,'activityId');continue;case'3':if($[_0x1590f6(0x32f,'(n#)')][_0x1590f6(0x25a,'(n#)')]('lzkj'))$[_0x1590f6(0x396,'@8zd')]=_0x1590f6(0x543,'NZ@Z');continue;case'4':if($['domain']['includes'](_0x1590f6(0x574,'DYSA')))$[_0x1590f6(0x28c,'NZ@Z')]='fjzy';continue;case'5':if($[_0x1590f6(0x396,'@8zd')]==null){console[_0x1590f6(0x3b5,'&*4i')](_0x1590f6(0x1a9,'(n#)'));return;}continue;case'6':$[_0x1590f6(0x45d,'tQ4n')]=null;continue;}break;}}else{console['log'](_0x1590f6(0x49c,'qgn9'));return;}let domains='https://'+$[_0x1590f6(0x434,'*6zC')];!(async()=>{const _0x4b758d=_0x1590f6,_0x28ebbf={'VEwSv':'未能获取用户鉴权信息!','OSahy':_0x4b758d(0x1b9,'DYSA'),'uxbhj':function(_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"])