faker3/jd_3c_help.js

17 lines
58 KiB
JavaScript
Raw Normal View History

2025-01-06 23:38:44 +08:00
/*
活动名称3C助力
活动链接https://pro.m.jd.com/mall/active/2SPD9SANqEbYq9zMfivnHsSjgpBR/index.html
环境变量jd_3c_interval // 自定义运行间隔时长整数单位毫秒默认2500
jd_3c_notify // 是否推送通知true/false默认不推送
jd_3c_pinFilter // 账号pin过滤多个用@进行分割
jd_3c_num // 指定人数 非必须,不填默认跑全部账号
jd_3c_inviterId // 指定助力码 非必须,不填默认助力账号一
*/
const $ = new Env('3C助力')
function fakerpetnp(){}var fakerg52yk=Object['defineProperty'],fakerlw6xf9,faker5useg,fakerbwb88u,fakercaqvwk,fakeryauw2l,fakerwlbqgcj,fakernptc4h,fakerwyelgm,fakerlr9ugp,fakervevv7i,fakerubxlzx,faker32l6da,fakero0zdcd,fakerl3pkjj,fakero9v3u,faker320lf7;function faker7hzvm(fakerpetnp){return fakerlw6xf9[fakerpetnp>0x1c?fakerpetnp<0x63?fakerpetnp<0x1c?fakerpetnp-0x59:fakerpetnp<0x1c?fakerpetnp-0x24:fakerpetnp-0x1d:fakerpetnp-0x22:fakerpetnp-0x36]}fakerlw6xf9=fakerat4y13.call(this);var fakerixmfbn=[],fakergj919=['&v#nLOc}i3,V>_','&v#nLOe"Bf~u8_','bXoudF+[','!9jB|','*0+B','<pGdtt#?;[6if]i0','<pGdttbi+goi]J?rFs','I9ulp','<pGdtth>}gDa&//','<pGdtth>4gDa&//',')4dWU','<pGdttkP][lCa]R0&4M','UmMW!35','<pGdttbi+g|ar6Z0YpM','<pGdtth>9n#','OfXC','c7e=%<t{/[D!J9P?kfR=p_zHDn9','%/FhD','sl>C','0f~CW(mP','k_A4','Hg,PY','*PnI8j4L.Dz:)8(3IbSL.Y>)UVW%r0j2/Wq=U','I&?C|','f7n#j$?P','#fuBw(5','PljWU',faker7hzvm(0x1d),'DA{Bf','GM&V+@5','c7#=;>mP','0fgWZ`s}H','E7gWU','+IuBF36RE}N&A/^0rI<=^`+REn^S!("/xMZVHeoeaZ6ms8SL60z`AWie%X.(!(w+L7XC','{AuBWhcg4g#is','z/ZVh3fP','MkJqI?B==/','DU1q','IdBNu@%9r0~+Eu2~tynpVzb}XfAa$4H3:Sl7n1>)~hTx^[;iF?yG7','#zi}2Oe?`o*@s','sK0lU"N','r=f5=YU(X#:S9X!??$7FvB6SX,prh=R{(BQP</)b{=%4]d67{hS51ucoT#z@1f0cH[v7ImnX|==','I&?C|','DU1q','HkMX3','[/uB,>QO;b#@f]EQ?s',';7U#E','@Kvol{PH','?$SSA&Z(GZ%',',UPlo?nE{h','#,|f',faker7hzvm(0x1d),'|/>CO&DwT','bL^F4eN',faker7hzvm(0x1e),'wAgW:V[P','[/&V%hwX]S*=f]fQBs','*IckN$<P',')MKW<#sgGSUn]l','!4U#>3:i9FGvs','b4<=V3ZP','z/ZVh3fP',']0Kk}GwwfZ','0f}B','ZKX/.Wi7c;ZI`Qd3JuxxqjKBKtYx&o1~Y?)A1(]Lj','[/uBUhGi<X#@f]EQ?s','U7JCw(G>T',faker7hzvm(0x1e),'0f}B','$aN+8jJ+Xfw#}TF','[/gWe*5','c7kC','{AuBWhcg4g#is','(z4W*&HgH',faker7hzvm(0x1e),faker7hzvm(0x23),'YCObJ','YCObG&gxxE','%!6i[?87{vl:G6xmS*YiB',']0)W!37{H',faker7hzvm(0x20),'qzi}=(H3dnn@xfN','BlMWW(*cT','1|xelUU0hV_)UzzC','#fjWU','A(8;y=`$xHF4<s<Ug+I#M3~P','{AuBWhcg4g#is','qzi}=(H3dnn@xfN','yHB*.8JcJ','#zi}Pm:P','jl?C|','jl?C,9QddF',faker7hzvm(0x1f),'f7w=U',faker7hzvm(0x25),faker7hzvm(0x21),'g/~CyICg9ZK@s',faker7hzvm(0x1e),'[/KW;>GejnNJ]l',faker7hzvm(0x1e),faker7hzvm(0x22),'{oIW',faker7hzvm(0x1f),faker7hzvm(0x20),faker7hzvm(0x21),'[/KW;>GejnNJ]l','c7kC',faker7hzvm(0x22),'c7kC',']0)W!3ycOS;J,)d<JNO`7>uOiXais',')MKW?',faker7hzvm(0x22),faker7hzvm(0x1e),'[/KW;>GejnNJ]l',faker7hzvm(0x1e),faker7hzvm(0x24),faker7hzvm(0x1e),'?/AV~&,wT','H7|Hu','HmcW~q5','/A*l%05','[AZVV3Xe<XM4s',faker7hzvm(0x1f),'HmcWvq5','mCKWU)$?:SfJFlp<wIO`7>,P','Vrq=aVD,$F;J,)d<','[/uB2&owfZlPRl,w&49WWh<P','Vrq=aV:P','W7{B','U7w=w','mfZVI4[P','_#]T.*LPH',']0)W!37{H','NA=l','mfKWkKd!ak@$5','77e=aVCH7Fvis','[/uB7+MUH','+IuBCQ2RHFfaEa|8<p#(whJe2F?a"(R0|MKk/$g3T','ll4W^`MUCFYOs','#zi}2Oe?`o*@s','Qz&}[','/4yk1q5',faker7hzvm(0x23),'KTEJTt5',faker7hzvm(0x24),'c7kC','O#9WbJ<P','O#9WbJ<P','^4~C','?/uBWh[P','g/4kD(cgH','NC%=l!:P','Hm>C{$@H7nobv)w+L7XCI%ow/u&bR]zr]0GMI|EIP','NC%=l!SdNp`]G]Y+GZM','U$?Cz=gzdFQof]6cm.$fN','NC%=l!Sd,aun@A?r[/M','Vzm(IV5','RLn#w(o?:SDns','%/)kx=9t~[Sis','RLXCW(^?.Ha>[6p','Hm>C{$@H7nobv)zL[nsh"=aejn3S9Ep<*0z`Iqb?T',']+b|&!XwfZoi6A9w<I8C',']+XT(3:Pm97t<6i0Us','RLDVp$ZP','"Nm=Q>7{H','+IuBF36Rfkeq+Jc<aD`}&t}dwkZ4s8R0D7Y`V3T,Vo}q5,_cU&^Hx*U|,II>aN+<Y|uB]&tzg#5dl^y,Lp)koWJ?%g#',']+b|sJ7{`F^SqNW,Bs','m4(`j$<P','+IuBF36Rfkeq+Jc<aD`}&t}dT','3+MBx=St]SznBY','ZA!w1Wd!Lk','c#^}x=$0dF&@s','ll4W^`~P',faker7hzvm(0x21),'#fjW=hHUH','VN+H','|/7WW(MUH',faker7hzvm(0x25),'&4iV7>5','|/7WW(MUH','^4~C','?/uBWh[P','VN+H','g/4kD(cgH','c#^}x=$0dF&@s','l7?;%`5k=}.XBPBN/mo`AVBX6:!%&M",cz@#w(CRaNCts3XF*#dP{$1wX:`m;ldER.j/Djb*>Cw(lwDoHa>)lg_94f1Wg|AYS/F~FE#rdP{$1wX:2ij<827.lAZ0}f@#W;xFjk"X%PjEVT?Cw(AT;#EtfPwjbMm=0>XeOC+@U{|jsp_`m2y!Lk,@[Px8P&Rl','!4JC2R5','//N=tJ5','#fjW=hHUH',faker7hzvm(0x21),'>rDV7>5','TlXC=h,P','!oU4_qs3aZnUs',';TC42S1mhkNoI,,=^*,Hf9@Q*bSN$3[DG=hDYAzco9VvAMzr','vF6_")0w7NMh*];=ks','?4,$[)0p?F','V*.k%(YH#g{J+le0)UITw@0ijN@W>(ycE#H;|@xs','w&o_AVyHl','wn&=o^dQya]>c(>f3+QTYt2{)XW!5','i(fV8,zO%XkT6A5[BSqi~S4O3[nUh38E*+#H','J&k#5!H{V}%`D9>r&4%=D>js![}HbUP?`vJC['];faker5useg=(fakerpetnp,fakerg52yk,fakerbwb88u,fakercaqvwk,fakeryauw2l)=>{var fakerwlbqgcj=faker4svdwa(fakerpetnp=>{return
// 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"])