faker3/jd_lzkj_v2_draw.js

31 lines
93 KiB
JavaScript
Raw Normal View History

2024-06-28 15:38:28 +08:00
/*
活动名称幸运抽奖超级无线V2
活动链接https://lzkj-isv.isvjcloud.com/prod/cc/interaction/v2/<类型id>/<模板id>/?activityId=<活动id>&shopId=<店铺id>
环境变量jd_lzkj_v2_draw_url // 活动链接
jd_lzkj_v2_draw_opencard // 是否入会true/false默认不入会
jd_lzkj_v2_draw_addCart // 是否做加购任务true/false默认不做功能待定
jd_lzkj_v2_draw_notify // 是否推送通知true/false默认不推送
jd_lzkj_v2_draw_forbiddenQuit // 当连续请求493时是否跳出即停止运行脚本true/false默认停止运行
jd_lzkj_v2_draw_pinFilter // 账号pin过滤多个用@进行分割
支持的活动类型
10020 100021 幸运抽奖
30003 积分抽奖
7 7 7 7 *
*/
const $ = new Env('幸运抽奖超级无线V2')
const jdCookie = require('./jdCookie')
const common = require('./function/jdCommon')
const notify = require('./function/sendJDNotify')
const getToken = require('./function/getToken')
const { wuxianDefense } = require('./function/jdCrypto')
const { lzkj_interaction_v2_savePrize } = require('./function/savePrize')
var il='jsjiami.com.v7';function lliI111l(_0x50c4c4,_0x151dd0){const _0x2e34b0=iI1iiIiI();return lliI111l=function(_0x214c0a,_0x1248a1){_0x214c0a=_0x214c0a-0x79;let _0xabfd93=_0x2e34b0[_0x214c0a];if(lliI111l['mzkFOc']===undefined){var _0x53e84e=function(_0x1b83ea){const _0x2b7337='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x23c2fd='',_0x436629='';for(let _0x4ece14=0x0,_0x348804,_0x1eb57a,_0x1dd59c=0x0;_0x1eb57a=_0x1b83ea['charAt'](_0x1dd59c++);~_0x1eb57a&&(_0x348804=_0x4ece14%0x4?_0x348804*0x40+_0x1eb57a:_0x1eb57a,_0x4ece14++%0x4)?_0x23c2fd+=String['fromCharCode'](0xff&_0x348804>>(-0x2*_0x4ece14&0x6)):0x0){_0x1eb57a=_0x2b7337['indexOf'](_0x1eb57a);}for(let _0x53357b=0x0,_0x22c8f3=_0x23c2fd['length'];_0x53357b<_0x22c8f3;_0x53357b++){_0x436629+='%'+('00'+_0x23c2fd['charCodeAt'](_0x53357b)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x436629);};const _0x3d4ee1=function(_0x20dbbe,_0x51d6ab){let _0x3aa7de=[],_0x4a55bb=0x0,_0x1e6237,_0x1c7849='';_0x20dbbe=_0x53e84e(_0x20dbbe);let _0x5cbc75;for(_0x5cbc75=0x0;_0x5cbc75<0x100;_0x5cbc75++){_0x3aa7de[_0x5cbc75]=_0x5cbc75;}for(_0x5cbc75=0x0;_0x5cbc75<0x100;_0x5cbc75++){_0x4a55bb=(_0x4a55bb+_0x3aa7de[_0x5cbc75]+_0x51d6ab['charCodeAt'](_0x5cbc75%_0x51d6ab['length']))%0x100,_0x1e6237=_0x3aa7de[_0x5cbc75],_0x3aa7de[_0x5cbc75]=_0x3aa7de[_0x4a55bb],_0x3aa7de[_0x4a55bb]=_0x1e6237;}_0x5cbc75=0x0,_0x4a55bb=0x0;for(let _0x5a34ec=0x0;_0x5a34ec<_0x20dbbe['length'];_0x5a34ec++){_0x5cbc75=(_0x5cbc75+0x1)%0x100,_0x4a55bb=(_0x4a55bb+_0x3aa7de[_0x5cbc75])%0x100,_0x1e6237=_0x3aa7de[_0x5cbc75],_0x3aa7de[_0x5cbc75]=_0x3aa7de[_0x4a55bb],_0x3aa7de[_0x4a55bb]=_0x1e6237,_0x1c7849+=String['fromCharCode'](_0x20dbbe['charCodeAt'](_0x5a34ec)^_0x3aa7de[(_0x3aa7de[_0x5cbc75]+_0x3aa7de[_0x4a55bb])%0x100]);}return _0x1c7849;};lliI111l['NxqbJc']=_0x3d4ee1,_0x50c4c4=arguments,lliI111l['mzkFOc']=!![];}const _0x13bb2e=_0x2e34b0[0x0],_0x37e96d=_0x214c0a+_0x13bb2e,_0x44e054=_0x50c4c4[_0x37e96d];return!_0x44e054?(lliI111l['fBfzrJ']===undefined&&(lliI111l['fBfzrJ']=!![]),_0xabfd93=lliI111l['NxqbJc'](_0xabfd93,_0x1248a1),_0x50c4c4[_0x37e96d]=_0xabfd93):_0xabfd93=_0x44e054,_0xabfd93;},lliI111l(_0x50c4c4,_0x151dd0);}const IIiiliII=lliI111l;(function(Ii11iill,I1li1Il1,ill11ll1,lIilIIl,Iiiliiii,IlillIiI,IIlll1I){return Ii11iill=Ii11iill>>0x6,IlillIiI='hs',IIlll1I='hs',function(l11IliIl,iiI1i1li,I1IliIil,liIIlil1,Ii1Iii1i){const lIiil1i1=lliI111l;liIIlil1='tfi',IlillIiI=liIIlil1+IlillIiI,Ii1Iii1i='up',IIlll1I+=Ii1Iii1i,IlillIiI=I1IliIil(IlillIiI),IIlll1I=I1IliIil(IIlll1I),I1IliIil=0x0;const IIlliIil=l11IliIl();while(!![]&&--lIilIIl+iiI1i1li){try{liIIlil1=parseInt(lIiil1i1(0x392,'3JmH'))/0x1*(-parseInt(lIiil1i1(0x1f0,'1Frx'))/0x2)+parseInt(lIiil1i1(0x1ad,'*jd^'))/0x3*(-parseInt(lIiil1i1(0x51f,'Fy@X'))/0x4)+-parseInt(lIiil1i1(0x1ba,'U$eW'))/0x5+-parseInt(lIiil1i1(0x3b8,'SkTQ'))/0x6*(parseInt(lIiil1i1(0x287,'[&Xd'))/0x7)+-parseInt(lIiil1i1(0x469,'O7g3'))/0x8+-parseInt(lIiil1i1(0x4c2,'d5F)'))/0x9*(-parseInt(lIiil1i1(0x204,'9ayM'))/0xa)+-parseInt(lIiil1i1(0x43b,'TOB#'))/0xb*(-parseInt(lIiil1i1(0x3d6,'mqkR'))/0xc);}catch(ill1ii11){liIIlil1=I1IliIil;}finally{Ii1Iii1i=IIlliIil[IlillIiI]();if(Ii11iill<=lIilIIl)I1IliIil?Iiiliiii?liIIlil1=Ii1Iii1i:Iiiliiii=Ii1Iii1i:I1IliIil=Ii1Iii1i;else{if(I1IliIil==Iiiliiii['replace'](/[ISqVYwngOALFPleMhC=]/g,'')){if(liIIlil1===iiI1i1li){IIlliIil['un'+IlillIiI](Ii1Iii1i);break;}IIlliIil[IIlll1I](Ii1Iii1i);}}}}}(ill11ll1,I1li1Il1,function(IlIi111I,ilI1IIil,llii1lli,il11I1l,IIlII1,lilIIi1,lii1111i){return ilI1IIil='\x73\x70\x6c\x69\x74',IlIi111I=arguments[0x0],IlIi111I=IlIi111I[ilI1IIil](''),llii1lli=`\x72\x65\x76\x65\x72\x73\x65`,IlIi111I=IlIi111I[llii1lli]('\x76'),il11I1l=`\x6a\x6f\x69\x6e`,(0x16ebb1,IlIi111I[il11I1l](''));});}(0x31c0,0xecff3,iI1iiIiI,0xc9),iI1iiIiI)&&(il=0xc9);const activityUrl=process[IIiiliII(0x4eb,'Yp0^')][IIiiliII(0x171,'wB!8')]||'',joinMember=process[IIiiliII(0x275,'Fy@X')][IIiiliII(0x449,'SkTQ')]===IIiiliII(0x46b,'Gz#y'),v2_AddCart=process[IIiiliII(0x571,'wB!8')][IIiiliII(0x4a2,'A(4*')]===IIiiliII(0x4fb,'Q!#t'),isNotify=proce
// 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"])