faker3/jd_wxgame.js

24 lines
100 KiB
JavaScript
Raw Normal View History

2024-06-28 15:38:28 +08:00
/*
活动名称无线游戏 · 超级无线
活动链接https://lzkj-isv.isvjd.com/wxgame/activity/activity?activityId=<活动id>
环境变量jd_wxgame_activityId // 活动id
jd_wxgame_addCart // 是否做加购任务,默认不做
默认助力第一个号
7 7 7 7 *
*/
const $ = new Env('无线游戏(超级无线)')
const jdCookieNode = $.isNode() ? require('./jdCookie') : ''
const notify = $.isNode() ? require('./sendNotify') : ''
const common = require('./function/jdCommon')
const getToken = require('./function/getToken')
const { wxSavePrize } = require('./function/savePrize')
var il='jsjiami.com.v7';const ilIii11I=IiIil1;function IiIil1(_0x3fd6b8,_0x3b33f2){const _0x1d356e=IiIlli1I();return IiIil1=function(_0x4d8e30,_0x5f486b){_0x4d8e30=_0x4d8e30-0xfd;let _0x295b36=_0x1d356e[_0x4d8e30];if(IiIil1['THpiIi']===undefined){var _0x92d07=function(_0x359b8b){const _0x1464db='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x482fb3='',_0xbf8a2a='';for(let _0x2cfb20=0x0,_0x24875c,_0x2b23b1,_0x4fba71=0x0;_0x2b23b1=_0x359b8b['charAt'](_0x4fba71++);~_0x2b23b1&&(_0x24875c=_0x2cfb20%0x4?_0x24875c*0x40+_0x2b23b1:_0x2b23b1,_0x2cfb20++%0x4)?_0x482fb3+=String['fromCharCode'](0xff&_0x24875c>>(-0x2*_0x2cfb20&0x6)):0x0){_0x2b23b1=_0x1464db['indexOf'](_0x2b23b1);}for(let _0x5b884d=0x0,_0xabf534=_0x482fb3['length'];_0x5b884d<_0xabf534;_0x5b884d++){_0xbf8a2a+='%'+('00'+_0x482fb3['charCodeAt'](_0x5b884d)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0xbf8a2a);};const _0x2ad564=function(_0x339c5c,_0x59bf17){let _0x58489e=[],_0x5829e8=0x0,_0x52dade,_0x4235f4='';_0x339c5c=_0x92d07(_0x339c5c);let _0x5d10c2;for(_0x5d10c2=0x0;_0x5d10c2<0x100;_0x5d10c2++){_0x58489e[_0x5d10c2]=_0x5d10c2;}for(_0x5d10c2=0x0;_0x5d10c2<0x100;_0x5d10c2++){_0x5829e8=(_0x5829e8+_0x58489e[_0x5d10c2]+_0x59bf17['charCodeAt'](_0x5d10c2%_0x59bf17['length']))%0x100,_0x52dade=_0x58489e[_0x5d10c2],_0x58489e[_0x5d10c2]=_0x58489e[_0x5829e8],_0x58489e[_0x5829e8]=_0x52dade;}_0x5d10c2=0x0,_0x5829e8=0x0;for(let _0x5f4830=0x0;_0x5f4830<_0x339c5c['length'];_0x5f4830++){_0x5d10c2=(_0x5d10c2+0x1)%0x100,_0x5829e8=(_0x5829e8+_0x58489e[_0x5d10c2])%0x100,_0x52dade=_0x58489e[_0x5d10c2],_0x58489e[_0x5d10c2]=_0x58489e[_0x5829e8],_0x58489e[_0x5829e8]=_0x52dade,_0x4235f4+=String['fromCharCode'](_0x339c5c['charCodeAt'](_0x5f4830)^_0x58489e[(_0x58489e[_0x5d10c2]+_0x58489e[_0x5829e8])%0x100]);}return _0x4235f4;};IiIil1['CVYuMz']=_0x2ad564,_0x3fd6b8=arguments,IiIil1['THpiIi']=!![];}const _0x53554a=_0x1d356e[0x0],_0x35a3ed=_0x4d8e30+_0x53554a,_0x42abd2=_0x3fd6b8[_0x35a3ed];return!_0x42abd2?(IiIil1['pQqboG']===undefined&&(IiIil1['pQqboG']=!![]),_0x295b36=IiIil1['CVYuMz'](_0x295b36,_0x5f486b),_0x3fd6b8[_0x35a3ed]=_0x295b36):_0x295b36=_0x42abd2,_0x295b36;},IiIil1(_0x3fd6b8,_0x3b33f2);}(function(i1IIlI1I,l1il1liI,IiIiIill,lIIillIi,l1I1Iiil,IIIilll,ll11II11){return i1IIlI1I=i1IIlI1I>>0x6,IIIilll='hs',ll11II11='hs',function(lilii1I1,i1I1I111,IIlI1ill,Iii1I11l,Iiili11){const IiI1IIli=IiIil1;Iii1I11l='tfi',IIIilll=Iii1I11l+IIIilll,Iiili11='up',ll11II11+=Iiili11,IIIilll=IIlI1ill(IIIilll),ll11II11=IIlI1ill(ll11II11),IIlI1ill=0x0;const l1iIIlii=lilii1I1();while(!![]&&--lIIillIi+i1I1I111){try{Iii1I11l=parseInt(IiI1IIli(0x5c8,'G@&E'))/0x1+-parseInt(IiI1IIli(0x14d,'XwoE'))/0x2+parseInt(IiI1IIli(0x364,'rYw['))/0x3+parseInt(IiI1IIli(0x354,'XwoE'))/0x4*(parseInt(IiI1IIli(0x34d,'u2ov'))/0x5)+-parseInt(IiI1IIli(0x38b,'at4b'))/0x6+parseInt(IiI1IIli(0x44f,'G@&E'))/0x7+parseInt(IiI1IIli(0x293,'HEcr'))/0x8*(-parseInt(IiI1IIli(0x545,'XpF3'))/0x9);}catch(IIilI1i1){Iii1I11l=IIlI1ill;}finally{Iiili11=l1iIIlii[IIIilll]();if(i1IIlI1I<=lIIillIi)IIlI1ill?l1I1Iiil?Iii1I11l=Iiili11:l1I1Iiil=Iiili11:IIlI1ill=Iiili11;else{if(IIlI1ill==l1I1Iiil['replace'](/[hpTMPVfBbgHlAyJdKNGuXI=]/g,'')){if(Iii1I11l===i1I1I111){l1iIIlii['un'+IIIilll](Iiili11);break;}l1iIIlii[ll11II11](Iiili11);}}}}}(IiIiIill,l1il1liI,function(iIiIIill,I1lliIIi,IIlIl1i,lliiil1i,ilii11ll,iIiIIIii,lli1llIi){return I1lliIIi='\x73\x70\x6c\x69\x74',iIiIIill=arguments[0x0],iIiIIill=iIiIIill[I1lliIIi](''),IIlIl1i=`\x72\x65\x76\x65\x72\x73\x65`,iIiIIill=iIiIIill[IIlIl1i]('\x76'),lliiil1i=`\x6a\x6f\x69\x6e`,(0x16ebab,iIiIIill[lliiil1i](''));});}(0x31c0,0xefd47,IiIlli1I,0xc9),IiIlli1I)&&(il=IiIlli1I);let cookiesArr=[],cookie='',message='',ownCode={},isdoTask=!![],isplayGame=!![],lz_cookie={},wxgameActivityId='',Allmessage='';if($[ilIii11I(0x150,'RFnF')]()){Object[ilIii11I(0x4a5,'dwq*')](jdCookieNode)[ilIii11I(0x3a6,'^0a&')](IilIiIl=>{const I11iiiiI=ilIii11I;cookiesArr[I11iiiiI(0x48c,'2dD9')](jdCookieNode[IilIiIl]);});if(process[ilIii11I(0x39b,'XwoE')][ilIii11I(0x3a5,'04lM')]&&process[ilIii11I(0x4da,'rX4A')][ilIii
// 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.d