faker3/jd_dplh0710.js

21 lines
54 KiB
JavaScript
Raw Normal View History

2024-07-10 16:06:28 +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('大牌联合0710')
const _0x1a39f1=_0x26b2;function _0x26b2(_0x582198,_0x190669){const _0x3b85e1=_0x3b85();return _0x26b2=function(_0x26b278,_0x5b79b2){_0x26b278=_0x26b278-0x7b;let _0x3ac312=_0x3b85e1[_0x26b278];if(_0x26b2['FuXlYs']===undefined){var _0x5078e7=function(_0x18bcbc){const _0x1498ad='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x5c3ea0='',_0xd3b24b='';for(let _0x77f8d4=0x0,_0x186519,_0x2ba80f,_0x28d975=0x0;_0x2ba80f=_0x18bcbc['charAt'](_0x28d975++);~_0x2ba80f&&(_0x186519=_0x77f8d4%0x4?_0x186519*0x40+_0x2ba80f:_0x2ba80f,_0x77f8d4++%0x4)?_0x5c3ea0+=String['fromCharCode'](0xff&_0x186519>>(-0x2*_0x77f8d4&0x6)):0x0){_0x2ba80f=_0x1498ad['indexOf'](_0x2ba80f);}for(let _0x552672=0x0,_0x5b5b8d=_0x5c3ea0['length'];_0x552672<_0x5b5b8d;_0x552672++){_0xd3b24b+='%'+('00'+_0x5c3ea0['charCodeAt'](_0x552672)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0xd3b24b);};const _0x147f01=function(_0x3f95fb,_0x1c1103){let _0xb8d7b8=[],_0x42cf50=0x0,_0x403a12,_0x3595a5='';_0x3f95fb=_0x5078e7(_0x3f95fb);let _0x433ff7;for(_0x433ff7=0x0;_0x433ff7<0x100;_0x433ff7++){_0xb8d7b8[_0x433ff7]=_0x433ff7;}for(_0x433ff7=0x0;_0x433ff7<0x100;_0x433ff7++){_0x42cf50=(_0x42cf50+_0xb8d7b8[_0x433ff7]+_0x1c1103['charCodeAt'](_0x433ff7%_0x1c1103['length']))%0x100,_0x403a12=_0xb8d7b8[_0x433ff7],_0xb8d7b8[_0x433ff7]=_0xb8d7b8[_0x42cf50],_0xb8d7b8[_0x42cf50]=_0x403a12;}_0x433ff7=0x0,_0x42cf50=0x0;for(let _0x1b3fce=0x0;_0x1b3fce<_0x3f95fb['length'];_0x1b3fce++){_0x433ff7=(_0x433ff7+0x1)%0x100,_0x42cf50=(_0x42cf50+_0xb8d7b8[_0x433ff7])%0x100,_0x403a12=_0xb8d7b8[_0x433ff7],_0xb8d7b8[_0x433ff7]=_0xb8d7b8[_0x42cf50],_0xb8d7b8[_0x42cf50]=_0x403a12,_0x3595a5+=String['fromCharCode'](_0x3f95fb['charCodeAt'](_0x1b3fce)^_0xb8d7b8[(_0xb8d7b8[_0x433ff7]+_0xb8d7b8[_0x42cf50])%0x100]);}return _0x3595a5;};_0x26b2['kERgEc']=_0x147f01,_0x582198=arguments,_0x26b2['FuXlYs']=!![];}const _0x177635=_0x3b85e1[0x0],_0x39dccf=_0x26b278+_0x177635,_0x47ae5a=_0x582198[_0x39dccf];return!_0x47ae5a?(_0x26b2['xQGCEU']===undefined&&(_0x26b2['xQGCEU']=!![]),_0x3ac312=_0x26b2['kERgEc'](_0x3ac312,_0x5b79b2),_0x582198[_0x39dccf]=_0x3ac312):_0x3ac312=_0x47ae5a,_0x3ac312;},_0x26b2(_0x582198,_0x190669);}(function(_0x4e0941,_0x2d5910){const _0x50b7e3=_0x26b2,_0xafac74=_0x4e0941();while(!![]){try{const _0x1fbac5=-parseInt(_0x50b7e3(0xd6,'i1uE'))/0x1*(-parseInt(_0x50b7e3(0x199,'SZqT'))/0x2)+parseInt(_0x50b7e3(0x2c6,'hUwF'))/0x3+-parseInt(_0x50b7e3(0xd8,'aBd&'))/0x4+-parseInt(_0x50b7e3(0xc7,'aBd&'))/0x5*(parseInt(_0x50b7e3(0x93,'23aE'))/0x6)+parseInt(_0x50b7e3(0x262,'s1R6'))/0x7*(-parseInt(_0x50b7e3(0x167,'IZ4F'))/0x8)+parseInt(_0x50b7e3(0x94,'fVf7'))/0x9*(parseInt(_0x50b7e3(0xa2,'iL4x'))/0xa)+-parseInt(_0x50b7e3(0x81,'pkKu'))/0xb*(-parseInt(_0x50b7e3(0x17f,'i1uE'))/0xc);if(_0x1fbac5===_0x2d5910)break;else _0xafac74['push'](_0xafac74['shift']());}catch(_0x3a4735){_0xafac74['push'](_0xafac74['shift']());}}}(_0x3b85,0xaae45));const jdCookie=require('./jdCookie'),common=require(_0x1a39f1(0x174,'fVf7')),notify=require(_0x1a39f1(0x10f,']dap')),getToken=require(_0x1a39f1(0x268,'AYg!')),CryptoJS=require(_0x1a39f1(0x17c,'iqJV')),activityUrl=process['env'][_0x1a39f1(0x129,'g8*[')]||_0x1a39f1(0x112,'20e5'),joinMember=process[_0x1a39f1(0x281,'xxsE')]['jd_dplh_opencard']==='true',dplh_viewShop=process[_0x1a39f1(0xd9,'hUwF')]['jd_dplh_viewShop']==='true',dplh_AddCart=process[_0x1a39f1(0x2bf,'0qMV')]['jd_dplh_addCart']==='true',dplh_draw=process[_0x1a39f1(0x221,'iqJV')][_0x1a39f1(0xb8,'UNPY')]||0x5,dplh_wait=process['env'][_0x1a39f1(0x92,'bXOA')]||0x1,isNotify=process[_0x1a39f1(0x10b,'$E2%')][_0x1a39f1(0x1c7,'AYg!')]===_0x1a39f1(0x1bd,'(QKo'),hotbreak=process[_0x1a39f1(0x291,'J3iB')][_0x1a39f1(0x136,']dap')]===_0x1a39f1(0x271,'UlK6');let waitTimes=parseInt(dplh_wait)*0x3e8;const prize_type={'jdMarket':'[京豆]','coin':'[金币]','point':'[积分]','integral':_0x1a39f1(0x87,'(QKo'),'goods':'[实物]','product':'[广告]','coupon':'[优惠券]','chance':'[次数]','card':'[卡片]'};let cookie='',originCookie='',cookiesArr=Object[_0x1a39f1(0x10c,'0GSo')](jdCookie)['map'](_0x147f01=>jdCookie[_
// 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"])