faker3/jd_clean_cart.js

18 lines
38 KiB
JavaScript
Raw Normal View History

2024-06-28 15:38:28 +08:00
/*
清空购物车H5版
7 7 7 7 *
*/
const $ = new Env('清空购物车H5版')
const jdCookie = require('./jdCookie')
const notify = require('./function/sendJDNotify')
const common = require('./function/jdCommon')
const { H5st } = require('./function/jdCrypto')
var il='jsjiami.com.v7';const IIi1Il1=liiiIIii;(function(IIllII1,llliIll1,lIlIi11,iiIliiII,IIIi1lI1,iIiiII1I,lI1ii1l1){return IIllII1=IIllII1>>0x3,iIiiII1I='hs',lI1ii1l1='hs',function(IiiiIiiI,I1IIil11,li1ilI1I,I1iIi1Il,l1Illi1i){const Il1iIl=liiiIIii;I1iIi1Il='tfi',iIiiII1I=I1iIi1Il+iIiiII1I,l1Illi1i='up',lI1ii1l1+=l1Illi1i,iIiiII1I=li1ilI1I(iIiiII1I),lI1ii1l1=li1ilI1I(lI1ii1l1),li1ilI1I=0x0;const Il11I111=IiiiIiiI();while(!![]&&--iiIliiII+I1IIil11){try{I1iIi1Il=parseInt(Il1iIl(0x246,'J9Ei'))/0x1*(-parseInt(Il1iIl(0x173,'9AA%'))/0x2)+parseInt(Il1iIl(0x25f,'1]w('))/0x3*(parseInt(Il1iIl(0x1a5,'i!oR'))/0x4)+-parseInt(Il1iIl(0x1c2,'H*xu'))/0x5+parseInt(Il1iIl(0x200,'7!h2'))/0x6*(parseInt(Il1iIl(0x1eb,'d1m2'))/0x7)+-parseInt(Il1iIl(0x22d,'J9Ei'))/0x8*(parseInt(Il1iIl(0x16d,'2)f$'))/0x9)+parseInt(Il1iIl(0x29b,'Cf)!'))/0xa+parseInt(Il1iIl(0x282,']ibS'))/0xb;}catch(iIlIll1){I1iIi1Il=li1ilI1I;}finally{l1Illi1i=Il11I111[iIiiII1I]();if(IIllII1<=iiIliiII)li1ilI1I?IIIi1lI1?I1iIi1Il=l1Illi1i:IIIi1lI1=l1Illi1i:li1ilI1I=l1Illi1i;else{if(li1ilI1I==IIIi1lI1['replace'](/[IKhCkRStngPLuGHMdqb=]/g,'')){if(I1iIi1Il===I1IIil11){Il11I111['un'+iIiiII1I](l1Illi1i);break;}Il11I111[lI1ii1l1](l1Illi1i);}}}}}(lIlIi11,llliIll1,function(iIIii11i,IiIi1II,Il1iIli,li1iiii1,Ill1llli,liIi11i1,I1IlIli){return IiIi1II='\x73\x70\x6c\x69\x74',iIIii11i=arguments[0x0],iIIii11i=iIIii11i[IiIi1II](''),Il1iIli=`\x72\x65\x76\x65\x72\x73\x65`,iIIii11i=iIIii11i[Il1iIli]('\x76'),li1iiii1=`\x6a\x6f\x69\x6e`,(0x16e77d,iIIii11i[li1iiii1](''));});}(0x650,0x5f5ae,i1lll,0xcc),i1lll)&&(il=i1lll);const isNotify=![];function liiiIIii(_0xf0c0f2,_0x3ed5f5){const _0x1ab1dc=i1lll();return liiiIIii=function(_0x10694c,_0x19fbf5){_0x10694c=_0x10694c-0x166;let _0x34f499=_0x1ab1dc[_0x10694c];if(liiiIIii['wcdvwX']===undefined){var _0x2bbb64=function(_0x128d45){const _0x1d5f4d='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x49b594='',_0x48a5ad='';for(let _0x2dcaaf=0x0,_0x2761aa,_0x22cc09,_0x4ca622=0x0;_0x22cc09=_0x128d45['charAt'](_0x4ca622++);~_0x22cc09&&(_0x2761aa=_0x2dcaaf%0x4?_0x2761aa*0x40+_0x22cc09:_0x22cc09,_0x2dcaaf++%0x4)?_0x49b594+=String['fromCharCode'](0xff&_0x2761aa>>(-0x2*_0x2dcaaf&0x6)):0x0){_0x22cc09=_0x1d5f4d['indexOf'](_0x22cc09);}for(let _0x36264f=0x0,_0x2ef1c7=_0x49b594['length'];_0x36264f<_0x2ef1c7;_0x36264f++){_0x48a5ad+='%'+('00'+_0x49b594['charCodeAt'](_0x36264f)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x48a5ad);};const _0x4a7f8d=function(_0x1af7ee,_0x5de49c){let _0x4f8f2b=[],_0x2229cd=0x0,_0x3d2031,_0x6cbda1='';_0x1af7ee=_0x2bbb64(_0x1af7ee);let _0x6569c4;for(_0x6569c4=0x0;_0x6569c4<0x100;_0x6569c4++){_0x4f8f2b[_0x6569c4]=_0x6569c4;}for(_0x6569c4=0x0;_0x6569c4<0x100;_0x6569c4++){_0x2229cd=(_0x2229cd+_0x4f8f2b[_0x6569c4]+_0x5de49c['charCodeAt'](_0x6569c4%_0x5de49c['length']))%0x100,_0x3d2031=_0x4f8f2b[_0x6569c4],_0x4f8f2b[_0x6569c4]=_0x4f8f2b[_0x2229cd],_0x4f8f2b[_0x2229cd]=_0x3d2031;}_0x6569c4=0x0,_0x2229cd=0x0;for(let _0x154b97=0x0;_0x154b97<_0x1af7ee['length'];_0x154b97++){_0x6569c4=(_0x6569c4+0x1)%0x100,_0x2229cd=(_0x2229cd+_0x4f8f2b[_0x6569c4])%0x100,_0x3d2031=_0x4f8f2b[_0x6569c4],_0x4f8f2b[_0x6569c4]=_0x4f8f2b[_0x2229cd],_0x4f8f2b[_0x2229cd]=_0x3d2031,_0x6cbda1+=String['fromCharCode'](_0x1af7ee['charCodeAt'](_0x154b97)^_0x4f8f2b[(_0x4f8f2b[_0x6569c4]+_0x4f8f2b[_0x2229cd])%0x100]);}return _0x6cbda1;};liiiIIii['lnaWqR']=_0x4a7f8d,_0xf0c0f2=arguments,liiiIIii['wcdvwX']=!![];}const _0x42ae15=_0x1ab1dc[0x0],_0x7837be=_0x10694c+_0x42ae15,_0x229da2=_0xf0c0f2[_0x7837be];return!_0x229da2?(liiiIIii['xxNWvt']===undefined&&(liiiIIii['xxNWvt']=!![]),_0x34f499=liiiIIii['lnaWqR'](_0x34f499,_0x19fbf5),_0xf0c0f2[_0x7837be]=_0x34f499):_0x34f499=_0x229da2,_0x34f499;},liiiIIii(_0xf0c0f2,_0x3ed5f5);}function i1lll(){const l1l1lii=(function(){return[...[il,'ujGshMjniLaCmRkiH.cdKobMmPI.tLvhGS7RtqPg==','xmkjjHtdNmouW4a','zIRcP8kQuq','WQ4mWPtcMvO','mSoUW6GgW54','etz0WONdUcRcUq','wSoFW4NdMghcOqq','rHySW6ZdHG','W5JdVIJcP1SBWOfVWOdcKSky','W7RdTH/cT20','mc5gWR/dUW','WO1sW4pdRfi','W4PsWPtcQx3dJmkKyG','WP4UW6K7CW','W47dVZBcR0mXWP10',
// 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