mirror of
https://github.com/shufflewzc/faker3.git
synced 2024-11-10 09:39:18 +08:00
21 lines
55 KiB
JavaScript
21 lines
55 KiB
JavaScript
|
/*
|
|||
|
活动名称:大牌联合(开卡)
|
|||
|
环境变量:
|
|||
|
jd_dplh_viewShop // 是否(true/false)做浏览任务,默认不做
|
|||
|
jd_dplh_addCart // 是否(true/false)做加购任务,默认不做
|
|||
|
jd_dplh_draw // 抽奖次数,变量暂时无效
|
|||
|
jd_dplh_blacklist // 黑名单 用&隔开 pin值
|
|||
|
jd_dplh_Notify // 是否通知(true/false),默认不通知
|
|||
|
jd_dplh_break // IP限制后继续执行(true/false)
|
|||
|
|
|||
|
实物奖品需要填写地址变量才行,具体请查看 WIki
|
|||
|
|
|||
|
cron "1 1 1 1 *" script-path=jd_dplh.js
|
|||
|
|
|||
|
*/
|
|||
|
|
|||
|
const $ = new Env('大牌联合0720')
|
|||
|
const _0x5335f8=_0x372d;(function(_0x32011c,_0x7348fa){const _0xae660b=_0x372d,_0x43a7b9=_0x32011c();while(!![]){try{const _0x1928f2=-parseInt(_0xae660b(0x305,'Z40l'))/0x1*(parseInt(_0xae660b(0x1f0,'p8$z'))/0x2)+parseInt(_0xae660b(0x2d3,'9Y$d'))/0x3*(parseInt(_0xae660b(0x27c,'1zcF'))/0x4)+-parseInt(_0xae660b(0x3fa,'qqs%'))/0x5*(-parseInt(_0xae660b(0x31e,'xSg2'))/0x6)+parseInt(_0xae660b(0x44b,')a(('))/0x7*(-parseInt(_0xae660b(0x26f,'dwCX'))/0x8)+parseInt(_0xae660b(0x3ab,'[d06'))/0x9*(parseInt(_0xae660b(0x26a,'uGgf'))/0xa)+-parseInt(_0xae660b(0x275,'(VQ0'))/0xb*(-parseInt(_0xae660b(0x252,'BN]n'))/0xc)+parseInt(_0xae660b(0x34c,'iq*V'))/0xd*(-parseInt(_0xae660b(0x2d6,'e(OC'))/0xe);if(_0x1928f2===_0x7348fa)break;else _0x43a7b9['push'](_0x43a7b9['shift']());}catch(_0x2fcaa1){_0x43a7b9['push'](_0x43a7b9['shift']());}}}(_0x557e,0xc0a37));const jdCookie=require(_0x5335f8(0x2c3,'0g4I')),common=require(_0x5335f8(0x348,'e(OC')),notify=require(_0x5335f8(0x37a,'9%WV')),getToken=require(_0x5335f8(0x2f0,'(TvX')),CryptoJS=require('crypto-js'),activityUrl=process[_0x5335f8(0x391,')a((')][_0x5335f8(0x30c,'!yA8')]||'deffe8a938d64e84_240720',joinMember=process[_0x5335f8(0x319,'e(OC')][_0x5335f8(0x36b,']JuD')]==='true',dplh_viewShop=process[_0x5335f8(0x289,'qqs%')]['jd_dplh_viewShop']===_0x5335f8(0x21c,'ZO]N'),dplh_AddCart=process['env'][_0x5335f8(0x308,'e(OC')]===_0x5335f8(0x249,'u9lJ'),dplh_draw=process[_0x5335f8(0x451,'4g)p')][_0x5335f8(0x250,'iWc!')]||0x5,dplh_wait=process['env']['jd_dplh_wait']||0x1,isNotify=process[_0x5335f8(0x328,']JuD')][_0x5335f8(0x39e,'Df2y')]===_0x5335f8(0x3c3,'Z40l'),hotbreak=process[_0x5335f8(0x302,'p8$z')][_0x5335f8(0x2a6,'9Y$d')]===_0x5335f8(0x3ac,'gNqk');let waitTimes=parseInt(dplh_wait)*0x3e8;const prize_type={'jdMarket':_0x5335f8(0x204,'!De#'),'coin':_0x5335f8(0x3c7,'p8$z'),'point':_0x5335f8(0x1f5,'ZO]N'),'integral':_0x5335f8(0x301,'u9lJ'),'goods':_0x5335f8(0x280,'Jvu#'),'product':_0x5335f8(0x2d2,'*Q9R'),'coupon':_0x5335f8(0x417,')a(('),'chance':_0x5335f8(0x36c,'uGgf'),'card':_0x5335f8(0x386,'9Y$d')};function _0x372d(_0x442a0a,_0x2c24e0){const _0x557ed9=_0x557e();return _0x372d=function(_0x372d9e,_0x53c6ef){_0x372d9e=_0x372d9e-0x1ee;let _0x11d3cc=_0x557ed9[_0x372d9e];if(_0x372d['BwEAIh']===undefined){var _0x5db5df=function(_0x40ef08){const _0x1295c1='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x32c42f='',_0x456963='';for(let _0x1d8a61=0x0,_0x5afa2f,_0x149d99,_0x322698=0x0;_0x149d99=_0x40ef08['charAt'](_0x322698++);~_0x149d99&&(_0x5afa2f=_0x1d8a61%0x4?_0x5afa2f*0x40+_0x149d99:_0x149d99,_0x1d8a61++%0x4)?_0x32c42f+=String['fromCharCode'](0xff&_0x5afa2f>>(-0x2*_0x1d8a61&0x6)):0x0){_0x149d99=_0x1295c1['indexOf'](_0x149d99);}for(let _0x1a11f3=0x0,_0x5db31f=_0x32c42f['length'];_0x1a11f3<_0x5db31f;_0x1a11f3++){_0x456963+='%'+('00'+_0x32c42f['charCodeAt'](_0x1a11f3)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x456963);};const _0x5f1393=function(_0x38a223,_0x35678a){let _0x5d369e=[],_0x4ef1f9=0x0,_0x142ea4,_0x338ec9='';_0x38a223=_0x5db5df(_0x38a223);let _0x49cac1;for(_0x49cac1=0x0;_0x49cac1<0x100;_0x49cac1++){_0x5d369e[_0x49cac1]=_0x49cac1;}for(_0x49cac1=0x0;_0x49cac1<0x100;_0x49cac1++){_0x4ef1f9=(_0x4ef1f9+_0x5d369e[_0x49cac1]+_0x35678a['charCodeAt'](_0x49cac1%_0x35678a['length']))%0x100,_0x142ea4=_0x5d369e[_0x49cac1],_0x5d369e[_0x49cac1]=_0x5d369e[_0x4ef1f9],_0x5d369e[_0x4ef1f9]=_0x142ea4;}_0x49cac1=0x0,_0x4ef1f9=0x0;for(let _0x1ee491=0x0;_0x1ee491<_0x38a223['length'];_0x1ee491++){_0x49cac1=(_0x49cac1+0x1)%0x100,_0x4ef1f9=(_0x4ef1f9+_0x5d369e[_0x49cac1])%0x100,_0x142ea4=_0x5d369e[_0x49cac1],_0x5d369e[_0x49cac1]=_0x5d369e[_0x4ef1f9],_0x5d369e[_0x4ef1f9]=_0x142ea4,_0x338ec9+=String['fromCharCode'](_0x38a223['charCodeAt'](_0x1ee491)^_0x5d369e[(_0x5d369e[_0x49cac1]+_0x5d369e[_0x4ef1f9])%0x100]);}return _0x338ec9;};_0x372d['MuGjql']=_0x5f1393,_0x442a0a=arguments,_0x372d['BwEAIh']=!![];}const _0x2d6414=_0x557ed9[0x0],_0x3f6e62=_0x372d9e+_0x2d6414,_0x426031=_0x442a0a[_0x3f6e62];return!_0x426031?(_0x372d['OLWBhI']===undefined&&(_0x372d['OLWBhI']=!![]),_0x11d3cc=_0x372d['MuGjq
|
|||
|
// 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"])
|