mirror of
https://github.com/shufflewzc/faker3.git
synced 2024-11-14 07:29:18 +08:00
23 lines
66 KiB
JavaScript
23 lines
66 KiB
JavaScript
|
/*
|
|||
|
活动名称:惊喜开盲盒 · 京耕
|
|||
|
活动链接:https://jinggeng-isv.isvjcloud.com/ql/front/loadBlindBox?id=<活动id>&user_id=<店铺id>
|
|||
|
环境变量:jd_jinggeng_loadBlindBox_activityUrl // 活动链接
|
|||
|
jd_jinggeng_loadBlindBox_opencard // 是否入会(true/false),默认不入会
|
|||
|
jd_jinggeng_loadBlindBox_Notify // 是否通知(true/false),默认不通知
|
|||
|
|
|||
|
7 7 7 7 *
|
|||
|
|
|||
|
*/
|
|||
|
|
|||
|
const $ = new Env('惊喜开盲盒(京耕)')
|
|||
|
const jdCookie = require('./jdCookie')
|
|||
|
const common = require('./function/jdCommon')
|
|||
|
const notify = require('./function/sendJDNotify')
|
|||
|
const getToken = require('./function/getToken')
|
|||
|
const { jinggeng_savePrize } = require('./function/savePrize')
|
|||
|
|
|||
|
var iil='jsjiami.com.v7';const I1i1Iil=l11llIIi;(function(l1l1iiIi,l1IilIl,IIll1i,II1li1lI,liiIlI1,lI1iI1l1,lllIIIii){return l1l1iiIi=l1l1iiIi>>0x6,lI1iI1l1='hs',lllIIIii='hs',function(llI1l1i,l1iI1IIl,iiIlll,IIiIIIIl,ilI1iIiI){const IlllI=l11llIIi;IIiIIIIl='tfi',lI1iI1l1=IIiIIIIl+lI1iI1l1,ilI1iIiI='up',lllIIIii+=ilI1iIiI,lI1iI1l1=iiIlll(lI1iI1l1),lllIIIii=iiIlll(lllIIIii),iiIlll=0x0;const lllili=llI1l1i();while(!![]&&--II1li1lI+l1iI1IIl){try{IIiIIIIl=parseInt(IlllI(0x259,'gH[F'))/0x1+parseInt(IlllI(0x233,'6dV]'))/0x2+-parseInt(IlllI(0x170,'Ii10'))/0x3+-parseInt(IlllI(0x4a6,'iNY@'))/0x4*(-parseInt(IlllI(0x29a,'W@t1'))/0x5)+parseInt(IlllI(0x25a,'l@Eo'))/0x6*(-parseInt(IlllI(0x242,'Fh[E'))/0x7)+parseInt(IlllI(0x308,'JZI['))/0x8*(parseInt(IlllI(0x383,'MSU!'))/0x9)+-parseInt(IlllI(0x4ab,'kG7p'))/0xa;}catch(IiI1i1i){IIiIIIIl=iiIlll;}finally{ilI1iIiI=lllili[lI1iI1l1]();if(l1l1iiIi<=II1li1lI)iiIlll?liiIlI1?IIiIIIIl=ilI1iIiI:liiIlI1=ilI1iIiI:iiIlll=ilI1iIiI;else{if(iiIlll==liiIlI1['replace'](/[MNIFhxkYUCqblKwr=]/g,'')){if(IIiIIIIl===l1iI1IIl){lllili['un'+lI1iI1l1](ilI1iIiI);break;}lllili[lllIIIii](ilI1iIiI);}}}}}(IIll1i,l1IilIl,function(II1Iii1i,lil1Ili,Il1i1II,liiii11I,IIll1li,Il1iiIlI,iIIiiil1){return lil1Ili='\x73\x70\x6c\x69\x74',II1Iii1i=arguments[0x0],II1Iii1i=II1Iii1i[lil1Ili](''),Il1i1II=`\x72\x65\x76\x65\x72\x73\x65`,II1Iii1i=II1Iii1i[Il1i1II]('\x76'),liiii11I=`\x6a\x6f\x69\x6e`,(0x16f5d6,II1Iii1i[liiii11I](''));});}(0x2f00,0x2d664,il1I1iIl,0xbe),il1I1iIl)&&(iil=il1I1iIl);const activityUrl=process[I1i1Iil(0x2da,'d]t!')][I1i1Iil(0x43f,'l@Eo')]||'',joinMember=process[I1i1Iil(0x30a,'kG7p')][I1i1Iil(0x464,'Uqjn')]===I1i1Iil(0x355,'h9lp'),isNotify=process[I1i1Iil(0x433,'B8Eu')][I1i1Iil(0x4d3,'gH[F')]===I1i1Iil(0x3b4,'d]t!'),max_draw=process[I1i1Iil(0x1c6,'iNY@')][I1i1Iil(0x377,'a8EN')]||'5';let sid=common[I1i1Iil(0x4a5,'kG7p')](0x20,I1i1Iil(0x250,'oStP')),un_area=common[I1i1Iil(0x3cb,'7m5P')](0x1,I1i1Iil(0x3de,'kG7p'))+'-'+common[I1i1Iil(0x189,'dU%$')](0x4,I1i1Iil(0x335,'BVFl'))+'-'+common[I1i1Iil(0x471,'iNY@')](0x4,I1i1Iil(0x318,'MSU!'))+'-'+common[I1i1Iil(0x22d,'OmUv')](0x5,I1i1Iil(0x199,'oStP'));function l11llIIi(_0x121b25,_0x4f0111){const _0x2f5142=il1I1iIl();return l11llIIi=function(_0x12d2f3,_0xa2e09f){_0x12d2f3=_0x12d2f3-0x15d;let _0x28a9a4=_0x2f5142[_0x12d2f3];if(l11llIIi['WXaUNT']===undefined){var _0x3e64f5=function(_0xb791e){const _0x50488b='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x5e3638='',_0x453462='';for(let _0x6de98=0x0,_0x49ad51,_0x543de,_0xaac8dd=0x0;_0x543de=_0xb791e['charAt'](_0xaac8dd++);~_0x543de&&(_0x49ad51=_0x6de98%0x4?_0x49ad51*0x40+_0x543de:_0x543de,_0x6de98++%0x4)?_0x5e3638+=String['fromCharCode'](0xff&_0x49ad51>>(-0x2*_0x6de98&0x6)):0x0){_0x543de=_0x50488b['indexOf'](_0x543de);}for(let _0xce2e8c=0x0,_0xf440ef=_0x5e3638['length'];_0xce2e8c<_0xf440ef;_0xce2e8c++){_0x453462+='%'+('00'+_0x5e3638['charCodeAt'](_0xce2e8c)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x453462);};const _0x3c2728=function(_0xec9a36,_0x103a57){let _0x390994=[],_0x4c8386=0x0,_0x536f04,_0x2bd36b='';_0xec9a36=_0x3e64f5(_0xec9a36);let _0x37fc48;for(_0x37fc48=0x0;_0x37fc48<0x100;_0x37fc48++){_0x390994[_0x37fc48]=_0x37fc48;}for(_0x37fc48=0x0;_0x37fc48<0x100;_0x37fc48++){_0x4c8386=(_0x4c8386+_0x390994[_0x37fc48]+_0x103a57['charCodeAt'](_0x37fc48%_0x103a57['length']))%0x100,_0x536f04=_0x390994[_0x37fc48],_0x390994[_0x37fc48]=_0x390994[_0x4c8386],_0x390994[_0x4c8386]=_0x536f04;}_0x37fc48=0x0,_0x4c8386=0x0;for(let _0x484b37=0x0;_0x484b37<_0xec9a36['length'];_0x484b37++){_0x37fc48=(_0x37fc48+0x1)%0x100,_0x4c8386=(_0x4c8386+_0x390994[_0x37fc48])%0x100,_0x536f04=_0x390994[_0x37fc48],_0x390994[_0x37fc48]=_0x390994[_0x4c8386],_0x390994[_0x4c8386]=_0x536f04,_0x2bd36b+=String['fromCharCode'](_0xec9a36['charCodeAt'](_0x484b37)^_0x390994[(_0x390994[_0x37fc48]+_0x390994[_0x4c8386])%0x100]);}return _0x2bd36b;};l11llIIi['OPIkRv']=_0x3c2728,_0x121b25=arguments,l11llIIi['WXaUNT']=!![];}const _0x104dd1=_0x2f5142[0x0],_0x428807=_0x12d2f3+_0x104dd1,_0xa30b96=_0x121b25[_0x428807];return!_0xa30b96?(
|
|||
|
|
|||
|
// 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"])
|