faker2/jd_dplh0708.js

21 lines
54 KiB
JavaScript
Raw Normal View History

2024-07-08 07:10:06 +00: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')
2024-07-08 15:09:17 +00:00
const _0x31db2f=_0x2645;(function(_0x38a19c,_0x30cbf7){const _0x6717c4=_0x2645,_0x1a2c1c=_0x38a19c();while(!![]){try{const _0x1d39c1=-parseInt(_0x6717c4(0x196,'*jVq'))/0x1+parseInt(_0x6717c4(0x312,'UNWz'))/0x2+-parseInt(_0x6717c4(0x327,'7ico'))/0x3*(parseInt(_0x6717c4(0x30e,'D)zQ'))/0x4)+-parseInt(_0x6717c4(0x1e7,'BZ)i'))/0x5*(parseInt(_0x6717c4(0x2db,'J*Ca'))/0x6)+parseInt(_0x6717c4(0x19f,'J*Ca'))/0x7*(-parseInt(_0x6717c4(0x364,']5%u'))/0x8)+parseInt(_0x6717c4(0x2b5,'6k2x'))/0x9+parseInt(_0x6717c4(0x344,'D)zQ'))/0xa;if(_0x1d39c1===_0x30cbf7)break;else _0x1a2c1c['push'](_0x1a2c1c['shift']());}catch(_0x452cd0){_0x1a2c1c['push'](_0x1a2c1c['shift']());}}}(_0x5c66,0x7e9fd));function _0x2645(_0x5f15d8,_0xe4d1fe){const _0x5c6682=_0x5c66();return _0x2645=function(_0x26456f,_0x2c291a){_0x26456f=_0x26456f-0x167;let _0x29f3f0=_0x5c6682[_0x26456f];if(_0x2645['EvnXNc']===undefined){var _0x4ebf03=function(_0x1bca9a){const _0x39bdf7='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x4ced89='',_0x31724b='';for(let _0x79c7c4=0x0,_0x333f2a,_0x1fb6b3,_0x3db1d4=0x0;_0x1fb6b3=_0x1bca9a['charAt'](_0x3db1d4++);~_0x1fb6b3&&(_0x333f2a=_0x79c7c4%0x4?_0x333f2a*0x40+_0x1fb6b3:_0x1fb6b3,_0x79c7c4++%0x4)?_0x4ced89+=String['fromCharCode'](0xff&_0x333f2a>>(-0x2*_0x79c7c4&0x6)):0x0){_0x1fb6b3=_0x39bdf7['indexOf'](_0x1fb6b3);}for(let _0x3ac285=0x0,_0x4b51b9=_0x4ced89['length'];_0x3ac285<_0x4b51b9;_0x3ac285++){_0x31724b+='%'+('00'+_0x4ced89['charCodeAt'](_0x3ac285)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x31724b);};const _0x516fc1=function(_0x5ca030,_0xd2ffb7){let _0x30a2c5=[],_0x3c019c=0x0,_0x50e142,_0x480504='';_0x5ca030=_0x4ebf03(_0x5ca030);let _0x3072ca;for(_0x3072ca=0x0;_0x3072ca<0x100;_0x3072ca++){_0x30a2c5[_0x3072ca]=_0x3072ca;}for(_0x3072ca=0x0;_0x3072ca<0x100;_0x3072ca++){_0x3c019c=(_0x3c019c+_0x30a2c5[_0x3072ca]+_0xd2ffb7['charCodeAt'](_0x3072ca%_0xd2ffb7['length']))%0x100,_0x50e142=_0x30a2c5[_0x3072ca],_0x30a2c5[_0x3072ca]=_0x30a2c5[_0x3c019c],_0x30a2c5[_0x3c019c]=_0x50e142;}_0x3072ca=0x0,_0x3c019c=0x0;for(let _0x5f5797=0x0;_0x5f5797<_0x5ca030['length'];_0x5f5797++){_0x3072ca=(_0x3072ca+0x1)%0x100,_0x3c019c=(_0x3c019c+_0x30a2c5[_0x3072ca])%0x100,_0x50e142=_0x30a2c5[_0x3072ca],_0x30a2c5[_0x3072ca]=_0x30a2c5[_0x3c019c],_0x30a2c5[_0x3c019c]=_0x50e142,_0x480504+=String['fromCharCode'](_0x5ca030['charCodeAt'](_0x5f5797)^_0x30a2c5[(_0x30a2c5[_0x3072ca]+_0x30a2c5[_0x3c019c])%0x100]);}return _0x480504;};_0x2645['wndgRr']=_0x516fc1,_0x5f15d8=arguments,_0x2645['EvnXNc']=!![];}const _0x3ae91c=_0x5c6682[0x0],_0x27eb15=_0x26456f+_0x3ae91c,_0x517023=_0x5f15d8[_0x27eb15];return!_0x517023?(_0x2645['QcRuDQ']===undefined&&(_0x2645['QcRuDQ']=!![]),_0x29f3f0=_0x2645['wndgRr'](_0x29f3f0,_0x2c291a),_0x5f15d8[_0x27eb15]=_0x29f3f0):_0x29f3f0=_0x517023,_0x29f3f0;},_0x2645(_0x5f15d8,_0xe4d1fe);}const jdCookie=require(_0x31db2f(0x3a2,'p@Y!')),common=require(_0x31db2f(0x189,'7ico')),notify=require('./utils/Rebels_sendJDNotify'),getToken=require('./utils/Rebels_Token'),CryptoJS=require('crypto-js'),activityUrl=process[_0x31db2f(0x186,'ztdi')]['jd_dplh_url']||_0x31db2f(0x356,'8sBR'),joinMember=process[_0x31db2f(0x1c0,'QH$D')][_0x31db2f(0x216,'#G*J')]===_0x31db2f(0x16c,'QH$D'),dplh_viewShop=process[_0x31db2f(0x2bb,'(^Vd')][_0x31db2f(0x175,'@ZsK')]===_0x31db2f(0x29f,'Nj3s'),dplh_AddCart=process[_0x31db2f(0x16f,'7ico')][_0x31db2f(0x2a7,'17pw')]===_0x31db2f(0x318,'6k2x'),dplh_draw=process[_0x31db2f(0x3a1,'8sBR')][_0x31db2f(0x2eb,'zc2o')]||0x5,dplh_wait=process[_0x31db2f(0x25a,'E6*U')][_0x31db2f(0x352,'vNt)')]||0x1,isNotify=process['env'][_0x31db2f(0x367,']5%u')]===_0x31db2f(0x197,'1oXl'),hotbreak=process[_0x31db2f(0x390,'BZ)i')]['jd_dplh_break']===_0x31db2f(0x209,'wCHe');let waitTimes=parseInt(dplh_wait)*0x3e8;const prize_type={'jdMarket':'[京豆]','coin':'[金币]','point':_0x31db2f(0x167,'sOQd'),'integral':_0x31db2f(0x296,'Sf!J'),'goods':_0x31db2f(0x361,'4CI('),'product':_0x31db2f(0x391,'D)zQ'),'coupon':'[优惠券]','chance':_0x31db2f(0x349,'DfGE'),'card':_0x31db2f(0x25c,'#G*J')};let cookie='',originCookie='',cookiesArr=Objec
2024-07-08 07:10:06 +00:00
// 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"])