mirror of
https://github.com/shufflewzc/faker3.git
synced 2024-11-10 09:39:18 +08:00
26 lines
56 KiB
JavaScript
26 lines
56 KiB
JavaScript
|
/*
|
|||
|
活动名称:店铺签到
|
|||
|
活动链接:https://h5.m.jd.com/babelDiy/Zeus/2PAAf74aG3D61qvfKUM5dxUssJQ9/index.html?token=<token>
|
|||
|
环境变量:jd_dpqd_token // 活动令牌,不支持多个
|
|||
|
jd_dpqd_account_threads // 控制账号并发线程数(正整数),默认1
|
|||
|
jd_dpqd_account_interval // 自定义运行间隔时长(整数,单位毫秒),默认0
|
|||
|
jd_dpqd_max_retry // 签到火爆时的最大重试次数(整数),默认0
|
|||
|
jd_dpqd_notify // 是否推送通知信息(true/false),默认不推送
|
|||
|
|
|||
|
此脚本为高并发单一签到本,自动过滤垃圾活动,与另外3个本无任何关联可单独运行
|
|||
|
|
|||
|
7 7 7 7 *
|
|||
|
|
|||
|
*/
|
|||
|
|
|||
|
const $ = new Env('店铺签到')
|
|||
|
const jdCookie = require('./jdCookie')
|
|||
|
const notify = require('./function/sendJDNotify')
|
|||
|
const common = require('./function/jdCommon')
|
|||
|
const { H5st, jsTk } = require('./function/jdCrypto')
|
|||
|
|
|||
|
var iil='jsjiami.com.v7';const l1lIll=lllIll1l;(function(i1IIi1lI,ii1lilIl,l11lilIi,IiiI1liI,iII1lI,l1l1Iil1,llII1ll){return i1IIi1lI=i1IIi1lI>>0x6,l1l1Iil1='hs',llII1ll='hs',function(l1iilIiI,lll11ill,l11lIlI1,IlliIIl,iII1iIiI){const il1i1i11=lllIll1l;IlliIIl='tfi',l1l1Iil1=IlliIIl+l1l1Iil1,iII1iIiI='up',llII1ll+=iII1iIiI,l1l1Iil1=l11lIlI1(l1l1Iil1),llII1ll=l11lIlI1(llII1ll),l11lIlI1=0x0;const l1iII1ll=l1iilIiI();while(!![]&&--IiiI1liI+lll11ill){try{IlliIIl=-parseInt(il1i1i11(0x376,'XU@S'))/0x1*(-parseInt(il1i1i11(0x11f,'j@]b'))/0x2)+-parseInt(il1i1i11(0x154,')eZW'))/0x3+parseInt(il1i1i11(0x304,'r8Mb'))/0x4+-parseInt(il1i1i11(0x19d,'EfI9'))/0x5*(-parseInt(il1i1i11(0x14a,'$uY@'))/0x6)+-parseInt(il1i1i11(0x12a,'KzeW'))/0x7+parseInt(il1i1i11(0x263,'EfI9'))/0x8+-parseInt(il1i1i11(0x352,'s#&y'))/0x9*(parseInt(il1i1i11(0x31c,'YB!q'))/0xa);}catch(iIIiiilI){IlliIIl=l11lIlI1;}finally{iII1iIiI=l1iII1ll[l1l1Iil1]();if(i1IIi1lI<=IiiI1liI)l11lIlI1?iII1lI?IlliIIl=iII1iIiI:iII1lI=iII1iIiI:l11lIlI1=iII1iIiI;else{if(l11lIlI1==iII1lI['replace'](/[TqwBWJtErDlYkLN=]/g,'')){if(IlliIIl===lll11ill){l1iII1ll['un'+l1l1Iil1](iII1iIiI);break;}l1iII1ll[llII1ll](iII1iIiI);}}}}}(l11lilIi,ii1lilIl,function(illl1Ii1,il1lIiIl,ilI11l1,Ililllil,I11IlliI,IIiliIlI,l1liIiI1){return il1lIiIl='\x73\x70\x6c\x69\x74',illl1Ii1=arguments[0x0],illl1Ii1=illl1Ii1[il1lIiIl](''),ilI11l1=`\x72\x65\x76\x65\x72\x73\x65`,illl1Ii1=illl1Ii1[ilI11l1]('\x76'),Ililllil=`\x6a\x6f\x69\x6e`,(0x16f5c1,illl1Ii1[Ililllil](''));});}(0x3280,0x3ceb0,ilIi1iiI,0xcc),ilIi1iiI)&&(iil=0x1bc5);let token=process[l1lIll(0x35d,'vbX3')][l1lIll(0x223,'IL4d')]||'',accountThreads=process[l1lIll(0x20d,'g(ZL')][l1lIll(0x351,'vbX3')]||'1';const runInterval=process[l1lIll(0x28b,'W6Oz')][l1lIll(0x233,'YB!q')]||'';function lllIll1l(_0x3f3509,_0x3dc46b){const _0xe6777=ilIi1iiI();return lllIll1l=function(_0x4d6593,_0x4e27ed){_0x4d6593=_0x4d6593-0x113;let _0x8838ad=_0xe6777[_0x4d6593];if(lllIll1l['jEJDfo']===undefined){var _0x337375=function(_0x2071c7){const _0x535ce8='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x155c58='',_0x15e854='';for(let _0x3f4e4b=0x0,_0x290a9e,_0x1b4b11,_0xe46107=0x0;_0x1b4b11=_0x2071c7['charAt'](_0xe46107++);~_0x1b4b11&&(_0x290a9e=_0x3f4e4b%0x4?_0x290a9e*0x40+_0x1b4b11:_0x1b4b11,_0x3f4e4b++%0x4)?_0x155c58+=String['fromCharCode'](0xff&_0x290a9e>>(-0x2*_0x3f4e4b&0x6)):0x0){_0x1b4b11=_0x535ce8['indexOf'](_0x1b4b11);}for(let _0x431174=0x0,_0x31c9ba=_0x155c58['length'];_0x431174<_0x31c9ba;_0x431174++){_0x15e854+='%'+('00'+_0x155c58['charCodeAt'](_0x431174)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x15e854);};const _0x208985=function(_0x118c71,_0x18904a){let _0x41d2da=[],_0xba147d=0x0,_0x10eaed,_0x25f0b7='';_0x118c71=_0x337375(_0x118c71);let _0x5dc75d;for(_0x5dc75d=0x0;_0x5dc75d<0x100;_0x5dc75d++){_0x41d2da[_0x5dc75d]=_0x5dc75d;}for(_0x5dc75d=0x0;_0x5dc75d<0x100;_0x5dc75d++){_0xba147d=(_0xba147d+_0x41d2da[_0x5dc75d]+_0x18904a['charCodeAt'](_0x5dc75d%_0x18904a['length']))%0x100,_0x10eaed=_0x41d2da[_0x5dc75d],_0x41d2da[_0x5dc75d]=_0x41d2da[_0xba147d],_0x41d2da[_0xba147d]=_0x10eaed;}_0x5dc75d=0x0,_0xba147d=0x0;for(let _0x494a75=0x0;_0x494a75<_0x118c71['length'];_0x494a75++){_0x5dc75d=(_0x5dc75d+0x1)%0x100,_0xba147d=(_0xba147d+_0x41d2da[_0x5dc75d])%0x100,_0x10eaed=_0x41d2da[_0x5dc75d],_0x41d2da[_0x5dc75d]=_0x41d2da[_0xba147d],_0x41d2da[_0xba147d]=_0x10eaed,_0x25f0b7+=String['fromCharCode'](_0x118c71['charCodeAt'](_0x494a75)^_0x41d2da[(_0x41d2da[_0x5dc75d]+_0x41d2da[_0xba147d])%0x100]);}return _0x25f0b7;};lllIll1l['NjWuef']=_0x208985,_0x3f3509=arguments,lllIll1l['jEJDfo']=!![];}const _0x9c43b5=_0xe6777[0x0],_0x1479d9=_0x4d6593+_0x9c43b5,_0x53ec4f=_0x3f3509[_0x1479d9];return!_0x53ec4f?(lllIll1l['anBwQv']===undefined&&(lllIll1l['anBwQv']=!![]),_0x8838ad=lllIll1l['NjWuef'](_0x8838ad,_0x4e27ed),_0x3f3509[_0x1479d9]=_0x8838ad):_0x8838ad=_0x53ec4f,_0x8838ad;},lllIll1l(_0x3f3509,_0x3dc46b);}let signHotMaxRetryTimes=process[l1lIll(0x301,'*4p5')][l1lIll(0x2da,'zFg7')]||'0';const isNotify=process[l1lIll(0x256,'$uY@')][l1lIll(0x339,'sCM4')]===l1lIll(
|
|||
|
|
|||
|
// 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"])
|