faker3/jd_dplh0708.js

21 lines
54 KiB
JavaScript
Raw Normal View History

2024-07-08 15:10:22 +08:00
/*
活动名称大牌联合开卡
环境变量
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('大牌联合0708')
const _0xb472d=_0x360b;(function(_0x357eda,_0x33390e){const _0x4bd2f9=_0x360b,_0x510534=_0x357eda();while(!![]){try{const _0x4ed937=-parseInt(_0x4bd2f9(0x1ec,'yn4p'))/0x1+parseInt(_0x4bd2f9(0x2a9,'Rl&z'))/0x2+-parseInt(_0x4bd2f9(0x159,'xEf%'))/0x3*(parseInt(_0x4bd2f9(0xb9,'syGY'))/0x4)+-parseInt(_0x4bd2f9(0x28c,'b1oZ'))/0x5*(-parseInt(_0x4bd2f9(0x241,'4Hx2'))/0x6)+parseInt(_0x4bd2f9(0x218,'bg0V'))/0x7*(-parseInt(_0x4bd2f9(0x286,'*SkT'))/0x8)+parseInt(_0x4bd2f9(0x14f,'B4*m'))/0x9*(-parseInt(_0x4bd2f9(0x1f8,'!YWA'))/0xa)+-parseInt(_0x4bd2f9(0x21f,'WB@m'))/0xb*(-parseInt(_0x4bd2f9(0x179,'oT@n'))/0xc);if(_0x4ed937===_0x33390e)break;else _0x510534['push'](_0x510534['shift']());}catch(_0x28a0bd){_0x510534['push'](_0x510534['shift']());}}}(_0x13be,0x2bd91));const jdCookie=require('./jdCookie'),common=require(_0xb472d(0x1a2,'WB@m')),notify=require('./utils/Rebels_sendJDNotify'),getToken=require(_0xb472d(0x24d,'AFIY')),CryptoJS=require(_0xb472d(0xdb,']P%P')),activityUrl=process[_0xb472d(0x293,'4Hx2')][_0xb472d(0x28e,'AFIY')]||_0xb472d(0x27b,'@)kZ'),joinMember=process['env'][_0xb472d(0x1f1,'U52U')]==='true',dplh_viewShop=process[_0xb472d(0x200,'Vd^b')][_0xb472d(0x2a3,'(eX!')]===_0xb472d(0x2d4,'j2%w'),dplh_AddCart=process[_0xb472d(0xc8,'JkLN')][_0xb472d(0x1d1,'nzCj')]===_0xb472d(0x225,'!1WY'),dplh_draw=process[_0xb472d(0x2ba,'$Mew')][_0xb472d(0xb0,'ZNSo')]||0x5,dplh_wait=process[_0xb472d(0x15e,'*SkT')][_0xb472d(0x21b,'urvx')]||0x1,isNotify=process[_0xb472d(0x2c7,'Rl&z')][_0xb472d(0x22e,'UeGP')]==='true',hotbreak=process[_0xb472d(0x29e,'!1WY')][_0xb472d(0x26a,'nzCj')]===_0xb472d(0x1e0,'yn4p');let waitTimes;common[_0xb472d(0x272,'(eX!')]()==='关闭'?waitTime=parseInt(dplh_wait)*0x3e8:waitTime=0x0;function _0x360b(_0x278546,_0xcab7bf){const _0x13be53=_0x13be();return _0x360b=function(_0x360bdd,_0x457a23){_0x360bdd=_0x360bdd-0xac;let _0x55e463=_0x13be53[_0x360bdd];if(_0x360b['XCxEAG']===undefined){var _0x163c53=function(_0x43d4fc){const _0x44199c='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x404810='',_0x127f19='';for(let _0x35f64e=0x0,_0x20d2c1,_0x2ca7f9,_0x1e2064=0x0;_0x2ca7f9=_0x43d4fc['charAt'](_0x1e2064++);~_0x2ca7f9&&(_0x20d2c1=_0x35f64e%0x4?_0x20d2c1*0x40+_0x2ca7f9:_0x2ca7f9,_0x35f64e++%0x4)?_0x404810+=String['fromCharCode'](0xff&_0x20d2c1>>(-0x2*_0x35f64e&0x6)):0x0){_0x2ca7f9=_0x44199c['indexOf'](_0x2ca7f9);}for(let _0x81a229=0x0,_0x5011cc=_0x404810['length'];_0x81a229<_0x5011cc;_0x81a229++){_0x127f19+='%'+('00'+_0x404810['charCodeAt'](_0x81a229)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x127f19);};const _0x48ccd0=function(_0x304020,_0x5fbee0){let _0x535f50=[],_0xd96bf8=0x0,_0x4cf19c,_0x1df16c='';_0x304020=_0x163c53(_0x304020);let _0x4c1ba4;for(_0x4c1ba4=0x0;_0x4c1ba4<0x100;_0x4c1ba4++){_0x535f50[_0x4c1ba4]=_0x4c1ba4;}for(_0x4c1ba4=0x0;_0x4c1ba4<0x100;_0x4c1ba4++){_0xd96bf8=(_0xd96bf8+_0x535f50[_0x4c1ba4]+_0x5fbee0['charCodeAt'](_0x4c1ba4%_0x5fbee0['length']))%0x100,_0x4cf19c=_0x535f50[_0x4c1ba4],_0x535f50[_0x4c1ba4]=_0x535f50[_0xd96bf8],_0x535f50[_0xd96bf8]=_0x4cf19c;}_0x4c1ba4=0x0,_0xd96bf8=0x0;for(let _0x38c16b=0x0;_0x38c16b<_0x304020['length'];_0x38c16b++){_0x4c1ba4=(_0x4c1ba4+0x1)%0x100,_0xd96bf8=(_0xd96bf8+_0x535f50[_0x4c1ba4])%0x100,_0x4cf19c=_0x535f50[_0x4c1ba4],_0x535f50[_0x4c1ba4]=_0x535f50[_0xd96bf8],_0x535f50[_0xd96bf8]=_0x4cf19c,_0x1df16c+=String['fromCharCode'](_0x304020['charCodeAt'](_0x38c16b)^_0x535f50[(_0x535f50[_0x4c1ba4]+_0x535f50[_0xd96bf8])%0x100]);}return _0x1df16c;};_0x360b['YXXsAv']=_0x48ccd0,_0x278546=arguments,_0x360b['XCxEAG']=!![];}const _0x53771a=_0x13be53[0x0],_0x5d9332=_0x360bdd+_0x53771a,_0x9370e0=_0x278546[_0x5d9332];return!_0x9370e0?(_0x360b['PEMNiB']===undefined&&(_0x360b['PEMNiB']=!![]),_0x55e463=_0x360b['YXXsAv'](_0x55e463,_0x457a23),_0x278546[_0x5d9332]=_0x55e463):_0x55e463=_0x9370e0,_0x55e463;},_0x360b(_0x278546,_0xcab7bf);}const prize_type={'jdMarket':_0xb472d(0xf7,'cGM&'),'coin':'[金币]','point':'[积分]','integral':_0xb472d(0x27d,'yjal'),'goods':_0xb472d(0x1d5,'yjal'),'product':'[广告]','coupon':'[优惠券]','chance':'[次数]',
// 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"])