faker3/jd_OpenCard.js

20 lines
49 KiB
JavaScript
Raw Normal View History

2024-06-28 15:38:28 +08:00
/*
入会开卡领取礼包
环境变量
VENDER_ID // venderId或vendorId的值多个用&、@或逗号连接,但是不要混用
OPENCARD_BEAN // 最小入会京豆默认10
7 7 7 7 * jd_OpenCard.js
*/
const $ = new Env('入会开卡领取礼包')
const jdCookieNode = $.isNode() ? require('./jdCookie') : ''
const getH5st = require('./function/getH5st3_0')
var version_='jsjiami.com.v7';const Ii1Iiili=IiI1ilii;(function(iiIIIIii,l1lllil1,IIill1II,llIlli1l,iIll1iil,I1iIl1i,I1IiIlIi){return iiIIIIii=iiIIIIii>>0x5,I1iIl1i='hs',I1IiIlIi='hs',function(II1lli1i,llliIIii,Ii1111II,iIl1IIl1,ii1111II){const iiIillIl=IiI1ilii;iIl1IIl1='tfi',I1iIl1i=iIl1IIl1+I1iIl1i,ii1111II='up',I1IiIlIi+=ii1111II,I1iIl1i=Ii1111II(I1iIl1i),I1IiIlIi=Ii1111II(I1IiIlIi),Ii1111II=0x0;const iIIiiliI=II1lli1i();while(!![]&&--llIlli1l+llliIIii){try{iIl1IIl1=parseInt(iiIillIl(0x28b,'(ep*'))/0x1+-parseInt(iiIillIl(0x153,'yQfV'))/0x2+parseInt(iiIillIl(0x167,'pyNa'))/0x3*(-parseInt(iiIillIl(0x133,'pyNa'))/0x4)+parseInt(iiIillIl(0x276,'aJSl'))/0x5*(parseInt(iiIillIl(0x323,'3ARt'))/0x6)+parseInt(iiIillIl(0x305,'Vtv('))/0x7+parseInt(iiIillIl(0x300,'pdOq'))/0x8*(-parseInt(iiIillIl(0x2be,'YON['))/0x9)+parseInt(iiIillIl(0x18c,'JyoO'))/0xa;}catch(lIi1lI1i){iIl1IIl1=Ii1111II;}finally{ii1111II=iIIiiliI[I1iIl1i]();if(iiIIIIii<=llIlli1l)Ii1111II?iIll1iil?iIl1IIl1=ii1111II:iIll1iil=ii1111II:Ii1111II=ii1111II;else{if(Ii1111II==iIll1iil['replace'](/[nHXSkGTOBqJuEVpPUQbK=]/g,'')){if(iIl1IIl1===llliIIii){iIIiiliI['un'+I1iIl1i](ii1111II);break;}iIIiiliI[I1IiIlIi](ii1111II);}}}}}(IIill1II,l1lllil1,function(ii11lilI,l11llilI,Ili1il,iIiIIlli,IiI1IIil,ilIili,illli1lI){return l11llilI='\x73\x70\x6c\x69\x74',ii11lilI=arguments[0x0],ii11lilI=ii11lilI[l11llilI](''),Ili1il=`\x72\x65\x76\x65\x72\x73\x65`,ii11lilI=ii11lilI[Ili1il]('\x76'),iIiIIlli=`\x6a\x6f\x69\x6e`,(0x13d049,ii11lilI[iIiIIlli](''));});}(0x1840,0x864b0,iiIillll,0xc4),iiIillll)&&(version_=iiIillll);const OPENCARD_BEAN=process[Ii1Iiili(0x2d1,'WaYf')][Ii1Iiili(0x1a2,'JD5d')]||'10';let VENDER_IDs=[];if(process[Ii1Iiili(0x214,'aJSl')][Ii1Iiili(0x285,'WaYf')]){if(process[Ii1Iiili(0x2f4,'R[LE')][Ii1Iiili(0x147,'*)CH')][Ii1Iiili(0x30b,'t#$r')]('&')>-0x1)VENDER_IDs=process[Ii1Iiili(0x1c9,'9l^1')][Ii1Iiili(0x176,'5L[1')][Ii1Iiili(0x231,'*)CH')]('&');else{if(process[Ii1Iiili(0x1c2,'$7*u')][Ii1Iiili(0x34b,'pyNa')][Ii1Iiili(0x329,'GtH6')]('@')>-0x1)VENDER_IDs=process[Ii1Iiili(0x138,'c!Cg')][Ii1Iiili(0x187,'Qd&q')][Ii1Iiili(0x1f4,'0rUC')]('@');else process[Ii1Iiili(0x1a6,'w9aS')][Ii1Iiili(0x2a8,'1vEr')][Ii1Iiili(0x22d,'MpfF')](',')>-0x1?VENDER_IDs=process[Ii1Iiili(0x13c,'yQfV')][Ii1Iiili(0x176,'5L[1')][Ii1Iiili(0x132,'yb(5')](','):VENDER_IDs=[process[Ii1Iiili(0x225,'0rUC')][Ii1Iiili(0x20d,'A&YD')]];}}let nobeans_mark=0x0,cookiesArr=[],cookie='';if($[Ii1Iiili(0x12c,'YON[')]()){Object[Ii1Iiili(0x265,'dDEa')](jdCookieNode)[Ii1Iiili(0x14f,'[fVm')](IIIIlII=>{const lIlil1l1=Ii1Iiili;cookiesArr[lIlil1l1(0x18e,'2XVK')](jdCookieNode[IIIIlII]);});if(process[Ii1Iiili(0x144,'![9W')][Ii1Iiili(0x232,'JD5d')]&&process[Ii1Iiili(0x158,'Qd&q')][Ii1Iiili(0x24c,'c!Cg')]===Ii1Iiili(0x194,'pdOq'))console[Ii1Iiili(0x2e2,'jOcB')]=()=>{};}else cookiesArr=[$[Ii1Iiili(0x29f,'Vtv(')](Ii1Iiili(0x200,'yb(5')),$[Ii1Iiili(0x26f,'pyNa')](Ii1Iiili(0x219,'yQfV')),...jsonParse($[Ii1Iiili(0x289,'rmP1')](Ii1Iiili(0x163,'t#$r'))||'[]')[Ii1Iiili(0x17d,'pdOq')](I1IIli1=>I1IIli1[Ii1Iiili(0x198,'%T$%')])][Ii1Iiili(0x127,'JyoO')](lI1lI1i=>!!lI1lI1i);allMessage='',message='',!(async()=>{const illIIl1=Ii1Iiili,IlIliiiI={'tjlCM':illIIl1(0x179,'dDEa'),'jGpeI':illIIl1(0x33e,'1vEr'),'FVRXC':function(l1ll11iI,i11li1II){return l1ll11iI<i11li1II;},'qlcoD':function(lIiIiI1,l1ilI1Ii){return lIiIiI1(l1ilI1Ii);},'FICvz':function(IlIlIiII,li1I11I){return IlIlIiII+li1I11I;},'ksrtQ':function(iilllIlI,l111111I){return iilllIlI>=l111111I;},'GHPou':illIIl1(0x21f,'5L[1'),'yKtxe':function(iil1Iill){return iil1Iill();},'BwftY':function(i1lii1l){return i1lii1l();}};if(!cookiesArr[0x0]){$[illIIl1(0x336,'(ep*')]($[illIIl1(0x17e,'dDEa')],IlIliiiI[illIIl1(0x134,'1vEr')],IlIliiiI[illIIl1(0x1a4,'c!Cg')],{'open-url':IlIliiiI[illIIl1(0x159,'$7*u')]});return;}for(let li1l1i11=0x0;IlIliiiI[illIIl1(0x1d8,'yQfV')](li1l1i11,cookiesArr[illIIl1(0x1af,'![9W')]);li1l1i11++){cookie=cookiesArr[li1l1i11];if(cookie){$[illIIl1(0x294,'6t8Z')]=IlIliiiI[illIIl1(0x1e0,'*qD3')](decodeURIComponent,cookie[illIIl1(0x1e7,'(E)A')](/pt_pin=([^; ]+)(?=;?)/)&&cookie[illIIl1(0x344,'$7*u
// 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"])