mirror of
https://github.com/shufflewzc/faker3.git
synced 2024-11-10 09:39:18 +08:00
21 lines
63 KiB
JavaScript
21 lines
63 KiB
JavaScript
|
/*
|
|||
|
活动名称:分享有礼 · 超级无线
|
|||
|
活动链接:https://lzkjdz-isv.isvjd.com/wxShareActivity/activity/activity?activityId=<活动id>
|
|||
|
环境变量:jd_wxShareActivity_activityId // 活动id
|
|||
|
jd_wxShareActivity_helpnum // 需要助力的账号数量
|
|||
|
|
|||
|
7 7 7 7 *
|
|||
|
|
|||
|
*/
|
|||
|
|
|||
|
const $ = new Env('分享有礼(超级无线)')
|
|||
|
const jdCookieNode = $.isNode() ? require('./jdCookie') : ''
|
|||
|
const notify = $.isNode() ? require('./sendNotify') : ''
|
|||
|
const getToken = require('./function/getToken')
|
|||
|
const { wxSavePrize } = require('./function/savePrize')
|
|||
|
|
|||
|
var version_='jsjiami.com.v7';const _0x1d7790=_0x5a6d;(function(_0x16e0e1,_0x5589f7,_0x2f6ced,_0x1887ec,_0x3da957,_0x2eeac6,_0x7932b2){return _0x16e0e1=_0x16e0e1>>0x4,_0x2eeac6='hs',_0x7932b2='hs',function(_0x51d9b0,_0x157ff9,_0x328624,_0x1dacb8,_0x19e3e0){const _0x192611=_0x5a6d;_0x1dacb8='tfi',_0x2eeac6=_0x1dacb8+_0x2eeac6,_0x19e3e0='up',_0x7932b2+=_0x19e3e0,_0x2eeac6=_0x328624(_0x2eeac6),_0x7932b2=_0x328624(_0x7932b2),_0x328624=0x0;const _0x1e65d1=_0x51d9b0();while(!![]&&--_0x1887ec+_0x157ff9){try{_0x1dacb8=parseInt(_0x192611(0x233,'@BCe'))/0x1*(parseInt(_0x192611(0x1e9,'23sT'))/0x2)+parseInt(_0x192611(0x214,'0e^b'))/0x3+-parseInt(_0x192611(0x147,'T9v@'))/0x4+parseInt(_0x192611(0x9f,'(vX9'))/0x5+-parseInt(_0x192611(0x25f,'cWuc'))/0x6+parseInt(_0x192611(0x1cd,'KJpH'))/0x7+parseInt(_0x192611(0x1f2,'8^8l'))/0x8;}catch(_0x2585a7){_0x1dacb8=_0x328624;}finally{_0x19e3e0=_0x1e65d1[_0x2eeac6]();if(_0x16e0e1<=_0x1887ec)_0x328624?_0x3da957?_0x1dacb8=_0x19e3e0:_0x3da957=_0x19e3e0:_0x328624=_0x19e3e0;else{if(_0x328624==_0x3da957['replace'](/[CMlDLGtArqTBNwQbXnOE=]/g,'')){if(_0x1dacb8===_0x157ff9){_0x1e65d1['un'+_0x2eeac6](_0x19e3e0);break;}_0x1e65d1[_0x7932b2](_0x19e3e0);}}}}}(_0x2f6ced,_0x5589f7,function(_0x14d06e,_0x25ad9c,_0x1ad521,_0x58d5bd,_0x1a92d6,_0x31bd77,_0x5d01b3){return _0x25ad9c='\x73\x70\x6c\x69\x74',_0x14d06e=arguments[0x0],_0x14d06e=_0x14d06e[_0x25ad9c](''),_0x1ad521='\x72\x65\x76\x65\x72\x73\x65',_0x14d06e=_0x14d06e[_0x1ad521]('\x76'),_0x58d5bd='\x6a\x6f\x69\x6e',(0x135e5b,_0x14d06e[_0x58d5bd](''));});}(0xbc0,0xe7fb5,_0x2ab1,0xbe),_0x2ab1)&&(version_=_0x2ab1);let cookiesArr=[],cookie='',message='',CodeList=[],ownCookieNum=0x1,isGetAuthorCodeList=!![],activityId='';$[_0x1d7790(0x1d1,'$R&%')]=![],$[_0x1d7790(0x2a5,'[HDd')]=![],$['activityContent']=null;let lz_cookie={},prizesIdArr=[],prizesShareTimesArr=[];process[_0x1d7790(0x8a,'4m@w')][_0x1d7790(0xd5,'N]Ab')]&&process[_0x1d7790(0x112,'v$dL')][_0x1d7790(0x275,'r6$^')]!=''&&(ownCookieNum=process[_0x1d7790(0x95,'Zq*N')]['jd_wxShareActivity_helpnum']);process['env'][_0x1d7790(0xc9,'uVA)')]&&process[_0x1d7790(0x19e,'(vX9')][_0x1d7790(0x2c5,'23sT')]!=''&&(activityId=process[_0x1d7790(0x82,'wmhc')][_0x1d7790(0xeb,'[HDd')]);if($['isNode']()){Object[_0x1d7790(0x9e,'*V5n')](jdCookieNode)[_0x1d7790(0x149,'KQUf')](_0x19863b=>{const _0x2edcbc=_0x1d7790;cookiesArr[_0x2edcbc(0x104,'T9v@')](jdCookieNode[_0x19863b]);});if(process[_0x1d7790(0x26b,'8^8l')][_0x1d7790(0x84,'wp1D')]&&process['env'][_0x1d7790(0x26c,'cWuc')]==='false')console[_0x1d7790(0x173,'qf3I')]=()=>{};}else{let cookiesData=$[_0x1d7790(0x16a,'yGdW')]('CookiesJD')||'[]';cookiesData=JSON[_0x1d7790(0xa4,'(vX9')](cookiesData),cookiesArr=cookiesData['map'](_0x7347d4=>_0x7347d4[_0x1d7790(0x253,'43(Y')]),cookiesArr['reverse'](),cookiesArr[_0x1d7790(0x24f,'i4**')](...[$[_0x1d7790(0x1c7,'xhBI')](_0x1d7790(0x269,'uVA)')),$[_0x1d7790(0x128,'i4**')](_0x1d7790(0x1db,'wp1D'))]),cookiesArr['reverse'](),cookiesArr=cookiesArr[_0x1d7790(0x1e8,'AGQr')](_0x38ce8d=>!!_0x38ce8d);}!(async()=>{const _0x35515e=_0x1d7790,_0x455304={'Seygm':'\x0a奖品全是优惠券,不跑了~','wcKDH':'https://bean.m.jd.com/bean/signIndex.action','jOCwS':function(_0x10c512,_0x1d2431){return _0x10c512+_0x1d2431;},'tIGvm':function(_0x213e0a,_0x1969ef){return _0x213e0a<_0x1969ef;},'YoSKD':function(_0x4d4c95,_0x1d266b){return _0x4d4c95===_0x1d266b;},'NheZg':function(_0x413d19,_0x41596e,_0x564922){return _0x413d19(_0x41596e,_0x564922);},'UHsfo':'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx','fOfiB':_0x35515e(0xce,'KJpH'),'ETtuE':function(_0x1376be){return _0x1376be();},'wxAwp':function(_0x155a7b,_0xf150f0){return _0x155a7b==_0xf150f0;},'IaIio':_0x35515e(0x1bd,'cWuc'),'kJkWb':function(_0x438b95,_0x4d3478,_0x299cb6,_0x4e1980){return _0x438b95(_0x4d3478,_0x299cb6,_0x4e1980);},'MZPhB':_0x35515e(0x2ab,'KQUf'),'WBEFD':'活动不存在或已经结束!','aclwD':_0x35515e(0x217,'9)cb'),'nUGzI':_0x35515e(0x1d2,'uVA)'),'yoSgj':function(_0x489279,_0x1d3a73){return _0x489279(_0x1d3a73);},'YfNaJ':function(_0x50f503,_0x35e7d6,_0x5871ab){return _0x50f503(_0x35e7d6,_0x5871ab);},'r
|
|||
|
|
|||
|
// 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
|