forked from Ohtenare/zoo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzooLimitbox.js
17 lines (17 loc) · 36.7 KB
/
zooLimitbox.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/**
* Author:Panda
* Date:2021-06-05
* Version:1.0
* Url:https://raw.githubusercontent.com/zooPanda/zoo/dev/zooLimitbox.js
* 限时盲盒
* 活动地址:京东app-领京豆-左侧6.18亿图标
* 活动时间:2021-06-01至2021-06-18
* 推荐cron: 15 12 1-18 6 *
* 账号内循环
*
*/
const $ = new Env("限时盲盒");
var _0xodV='zoo.20210605',_0x4e21=[_0xodV,'wr85wqvDvS8=','Fg/DpcKMKA==','bTPCu8KGw5sg','w4TClMK5wrHCjMOdQkDDiDbCkcKMwqDCrsKgF8OBwoY0EMKLchrDoTUXwpTCh0BXwoTDlMK6w67CqgHDgE4RWA==','FE5uSWo=','RcKQw6Nuw6gD','eRVAKQA=','Z8KZw6pvw78=','MkTDvcOawoB0wq7CsQ==','OnjCtAvDmsOhFcOhF8K/fQ==','5LuE5Lu26L6Y5ZqF5Lqq56iw5peA5o+p','w6LCnXjDgX9lwoRFHMOIZ8KQFw==','w47CpMKl','UsKEKcO4w4nDj3kGP8OZ','w4vDi3cKwq3CmsOMKX7CrcK0w4JyQ3jCmizCrVpKwqgswrHDscKyc07CnFtHwoMAwovDqFxAQcKVwpB5MzV8UcOjw5zDsxlaOiHDpcK8eMK6w4DCqhM=','wpY6w75TVx3ChnrCjBHDgR7DjcOmcMKnw4HCtcK5wqrCpMKbDMKpwrjCqcK9HSA4UcKzaU1pw6bDpMOmwrowWQTDrsK8WFQ1w4tgMCpyw5LCgw==','ecO5wpI0dQ==','wpZ+w7wFYw==','S8Ktw7zCiTQ=','KE/Dh8OCwqQ=','wovDlSVpwpw=','w5vCicK1','FFVbT2c=','wrTCosKIwpvDmQ==','S8KEOMOrwovDinA=','fVbDnsOETw==','wq7Cml3CiXhvw4Y=','woDDgE9Xw7xRwpU=','wpYvw7lsU0nDuSfCjgTCiQ3DicO2','wqrDo2fDtcO/w5jCpMKd','wrrDgGpQ','eiQrMy3CsMK3Pw==','wrTDgyU=','wo3CkGkewp3Dj8KMbX/Cp8O3w40v','J1/DsHhBOA==','IH1BAgwkAsOVHMK5c8KL','w7rDsRdv','w4/Dvn1BOcOYw7g=','wq/DpXHDrw==','w5zDmMOk','RsKyw401N8OCUjU=','wqLCh2c=','OifDlcKnH0F5QA==','wpgvw6ZQQQ==','wr/DiTZsEsKqKw==','wpBJw6Q9YjbDuQRP','w5bDkMOjw6k4','wqrCiGE=','woTCi8KkPTwmRg==','wqrCqGlbwrJYw7LChA==','w7wfw5HDqsKGC8KS','FgrDpsKXP3E=','wpwgwobDjBTDn8OjwrLChGfCrAVvZnPCkcK2V8KNwrvDh8K0XcOiSx3DsCPCrMKwwrsewpHCqG9OGnDCn8KIZcOqwpY=','TcKmw4IuM8OCRSBtw65gRcO+w5E=','bkTDlsObYVcfw5vDu8O9PMKGBErCssOswq3Ct1snw7TDmsKxwokSSsOyXnNsZhrCq8KCUw0=','44G05o+k56ST44Ct6K+15YWi6I2K5Yym5LmI5LqW6LWQ5Y+B5Lm2wq1IwpoJw6DDhTXnmY/mjaXkvKznlY44OWvCgsK3wqbnmLPku4fkuInnrIfli5LojpzljrE=','Q3hkwrYM','RsObwoEnaw==','JFrCrzjDgw==','woUETWLDmw==','wrgzwpPDtyE=','YcKXw6YSGg==','YzNGBAo=','w5HDhEQ2w4I=','asKjw4E5GQ==','w5DDmMO2RXg=','SsOEwr0tXcKpw6fCpA==','AcKZADRLI8Oe','YTYjJA==','44Cn5oyh56a344Cbw6QBGTHDqTXlt6TlpLHmlIY=','5LiV5Lqq6La05Y+X','w6PDiMO2BMOE','w6pcwp7Do8OHw6o2wrM=','JljDimdWZ8KuDcO1cMKxeWcTV8KaR8KuwoXCjTbCq8KCwqlRwoHDksOIw4pULnPCnxgjwqVow4kTwoI2wqvCjw==','RMKUw6Nuw4kBAjPDpik=','IHbCjB4=','w5/Cg8KuwqLCncOA5beI5aSJ5pe4bsOEw5Q=','PMKfwonDk0Icw6Ej','5Lmj5Lqv6LWw5Y+q','worDo2fDtcO4w5fCr8KX','wqnorYjph47ml4rnmqXlv7XojZTlj5B1wq3CtsOMNUs=','TcKyw5s1','w7zDgMOFFsOw','G0LCqD8=','w4nDjcKLw4dt','wqtew7MucyvDsjZzwpoXwozDkMKjw6VFwpDCnghGScOsw6EEUj1bGTXCv8OwUwUywr3CoVIcZMKe','wpc5woDDsAMD','wrHDuMOqbC3DvcOcw7Y=','YsKBw6PCqQk=','ZcKYw7YUCg==','DUdlU2VDwpM=','wr1Pw6g9RTLDpys=','BcKDwos=','w7zDhMO4cmR/CeW/oOWmheOCoOS7nuS6t+i2luWMtA==','ZjkqJBw=','w6HCkTbDi0Ftw4dK','d3tEwoIuWFEs','CCILw5pKExZjGSw=','fVwaUMKoA8KQ','ccOWwrU6','44OO5o2x56Sk44CgSMKPw7jCqsK4wqLltJblpprmlp8=','5Lmr5Lu16LS35YyR','woDCqWJVwqM=','wpAnw6lIakbDhDA=','M+islumGgeaUuOean+W/u+iOouWOuUPDlMO8wpHCsDQ9fsKaWWLCoxt9wo83EkwhPjTDvcOYwrHDo8KBBhdQw67Cl8KpSMKlKjZdwrrDlmVkP8KSw5o=','fiLCkMKkw5g=','w6PDlcOcDsOYwq8=','AwbDpMKHFGxYbsO/w4s=','w6bDhcKFw6dCA+W0muWmpuaWtkxmw7A=','w5rCizDDkkFtw4dK','5Lm/5Li66Lat5Y6h','S2ZFwpUY','w4TDpwtuCsO0wqfDhQ==','w7PDjMK9w7tn','QXofew==','w7LDnsOqGcOEwrLDtcOTw5ZhwrtRKcKDw6EoIsKKwqLCg8OKWAnCnsO7DMKFwrDCucKlwoTDnS7CkcO1wpnCisOVN8Kz','wrzCrMKawp7DvA==','w6PCnTvDh3tk','XgLChcK9w7UPRUbDusKnwqpcwpTCiQ==','wqMxwrjDmA8=','w6nCn8KkwrvCusOEV10=','wrbDvmbDosOO','GRDDhsKMPWpC','w7nCtCLDqGk=','w6nDhcKN','J3nChR7Dkg==','wo3Dnyd6PcK/J20=','Yh9ew6jDicK9w4FtfVA=','wr5Vw6w=','wpE+woAQ','44GY5o+l56WO44OTwoDDuMKELD4/5bSV5ae25per','5LmF5Lub6LSg5Y+H','wp06wpbDmR8=','JlwXwqnCrcO2woYi','JRDDr8KRFGJBYg==','wqTCsMKFwq/Dmw==','wrfDklBeT8KF','w5rDtGFgFsOUw6QiB8OW','TGlMwpU=','K1obwqnCisOy5bSZ5aW25pSfesOKw6c=','5Lui5LiL6LeH5Y6M','MUdMTkxLwpDClQ==','FeiupemEmOaVkuebj+W8mOiOsOWPgsKkwovCj3/CpMOX','JXBgeA==','w6DDtsOjG8OW','worDnUNMw6tNwogybMKRw58xccKRKkLDkQrDoMOoGH3CjCxUwqVtwpxHAEnDi8KZwrFXwo8=','woZzw4IS','wpE2wo4ew5DDscOfwrI=','L11uYUTDvsOxcMO6wqXCkOiNueW8j8Ox','w4HDmmIU','L+S7u+iwiOOBgw==','BsKLIT4=','wrXDnyU=','wrvDjTZrGw==','Mhgj','w4fDsGJh','wqbChuWmo+i1hMKdw6rljJLlmYvClDk=','wqHCgH/Ch3Nqw5E=','w5NGwpbDuMO9w4k0wq4mw4PDvsKI','LHzDrA==','wqnCqcKtwoDDg8KQUsOJIUBrUg==','wo1xw5XDkW0=','w7Q5w6Z2w5M=','w4kAw61Lw4PCnCNEdh4=','wr0jQUjDvw==','5rCH5p645ois5aeM5p2n5L2E','wqTCiH/Crnpqw5g=','wrTDiSxvB8K2','eEAx','XMKZw7kSBg==','w4oVw6ZCw7XCmw==','wrTDhS9hB8KcJXDDqMOlw5PDug==','w4xHwprDo8Osw486wqIL','KRYtVg==','Yz4jKBDCnMK+KMKSw6rDncKr','wq3DjmtDSMKF','wqLCulc=','wrLDiHNYX8Kiw7jCucKVwqjCsMOKwqTDpw==','YcKXw6EFF8OyVxs+','f8Kew7MDF8OEZgY1','wr8/woXDjSI=','LcKiJRxF','DGzDpMONwos=','TcKAP8OjwqjDh2Yb','wrLDsXHDs8OTw4TCksKbwow=','wrBqw4HDg08=','dMOhwooKeQ==','w77Dn8OiBA==','a8OWwqs0QMK8w6vCtTHDgQ==','YFYmWg==','eDYnNQ==','elPDiQ==','Yl3DncOITUYTw4/Csw==','w7QOw77DjMK3','eMKXw6EaIcO0ZgYlw54=','w6Mbw5TDu8KRCsKnP8OH','Yzgp','5re35YmW5Yi75Yuq56Gz5Yqw5pyr5Z2C5Yu55Yi25rGK','GcKZwp/DiQ==','w4vDkMOiw644LMKhK8O+','wrbCqMKhwpvDksKWXMOFAA==','w4rDmMO8w7MpHMKeOsOYwoM4Dw==','w5TDg006w459w616YMKJKCI=','w6Zswr7DhMOm','HAzDrQ==','wqtdw6HDpUA=','wp7DjFZdw6d3wp8yCcKGw4os','eMKXw6EaPsOpdAY=','wpA1wobDnQ==','w4jCjcKywqLCuMOMSUw=','U8KQw7lr','w6fDh8OhFcOZwrjDncOCw4A=','IWfChBXDqMOrH8OsA8Kh','e8OWwqw+','w7PDuxZPLMO6wr3DqWTCiXA=','GsKEwo3Dk2k5w60ywrk=','SsKJLcO6woHDqnQbLA==','InjChg==','wp4uwpzDuAUmY2wGJ8KATw==','aMKXw6YQ','fsKTw78YHMOkSgE3','Kk3DinY=','wrRMw7bDuGdWTcO6QMKh','w4DDjsKOw41H','K17DjHhXHsOuRsOy','wrfDoUXDlsO1','Y8KPw7A=','wrZUw7k5eR7Drz14woMIwpE=','wqvDkiJ8','wpQLwrkYw4g=','DMKLODo=','w6jDg8OzD8Oywr/DoA==','Yj1V','6IyI5b6444Or','w4QVw6lLw4/ChjY=','44Oq5Luw6LKo','wq3Dljdz','w67Dh8OmAA==','wprCgcK1','w6PCosKvwo3DjsOv','X8KTw7AaGg==','G8KePjJCLcOZw6HDig==','eBY0UhHCtEnChsOiw6LDt8KNw5p1fgPCucOcARHDozpMwr0Sw49qw5zCiUXDrsKAUxo3N3jDmy8pR8OmLcKDAsKZwqnDqcKiTHzDuVvClg7Dnh14w5RiwrcfwqcBw5gBwrM6AWXCqsKpw6fDmhHClhQ=','wqoKwqQx','w71Tw6PDs0tMUcOdUcOx','dMOSwr0vPsKpw6bCqDLDlw==','wq7DgyZxwrNawrzCtATDqGXDucKswpE3wqfDhsO9RsKFK8KDdFxSGEzCgsO4bcOLTTk=','wpjDgVpEw6MOwpkaKcKGw4ksMsKNYhTCmVzDv8KrUTHDmjIX','wrHDnsOGWg==','wrUUw4LDu8KDF8KFPcKGwo3ChjYiwqRvQk/DvMO1','w6fDtcOYw54=','ZRorRh3CvFvCg8OWwqzDu8KPw5YhIlvCtcKKRhbDqyFMwqAVw7BrwoHDihfDoMKeHmlycCTCkTI+H8K0b8ONWcOQwqjDmcKISWnCtEPCjRzDs1plw4x5wr0JwrFHwodUw4NkTyLDtcOjw7PCgE3DnBnDnDXDp8KuWC86BHYjbD7DsG3CocKYw7LDvsKhw4kkHxPDnsODwrnChAHDlsOAX0BpwpUSV8Ocw6V6HA3CtEZldcKvw4ZJOFDCs8KjwrrCpMKYwpvDvMKQPsORw5Vew6vClmbCiiTCtcKgSm5sZsOjLw3CmMORwqkeImpaw5oWw6IrwrMlasOhw7TCgcOdw5ptw4XChMK9w4/DlWQxw7YCdsOIwrDDlGPDvxBOwog=','zoo.qTTrq2tg0w21w060J5elHWNHZM=='];(function(_0x3bdbff,_0x43ad7c,_0x3dbf97){var _0x108e5d=function(_0x3a49ea,_0x39f0b7,_0x36cc13,_0xdc285e,_0x98afb2){_0x39f0b7=_0x39f0b7>>0x8,_0x98afb2='po';var _0x22af06='shift',_0x19ac7c='push';if(_0x39f0b7<_0x3a49ea){while(--_0x3a49ea){_0xdc285e=_0x3bdbff[_0x22af06]();if(_0x39f0b7===_0x3a49ea){_0x39f0b7=_0xdc285e;_0x36cc13=_0x3bdbff[_0x98afb2+'p']();}else if(_0x39f0b7&&_0x36cc13['replace'](/[qTTrqtgwwJelHWNHZM=]/g,'')===_0x39f0b7){_0x3bdbff[_0x19ac7c](_0xdc285e);}}_0x3bdbff[_0x19ac7c](_0x3bdbff[_0x22af06]());}return 0x8d1db;};return _0x108e5d(++_0x43ad7c,_0x3dbf97)>>_0x43ad7c^_0x3dbf97;}(_0x4e21,0x11d,0x11d00));var _0x5a68=function(_0x1bedd3,_0x119bb3){_0x1bedd3=~~'0x'['concat'](_0x1bedd3);var _0x1585fb=_0x4e21[_0x1bedd3];if(_0x5a68['wYdGXv']===undefined){(function(){var _0x19c301;try{var _0x46587d=Function('return\x20(function()\x20'+'{}.constructor(\x22return\x20this\x22)(\x20)'+');');_0x19c301=_0x46587d();}catch(_0x31b2ec){_0x19c301=window;}var _0x2e29d9='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';_0x19c301['atob']||(_0x19c301['atob']=function(_0x3535e2){var _0x56914a=String(_0x3535e2)['replace'](/=+$/,'');for(var _0x32e6f1=0x0,_0x21114f,_0x20d3e3,_0x56cdd0=0x0,_0x5bcead='';_0x20d3e3=_0x56914a['charAt'](_0x56cdd0++);~_0x20d3e3&&(_0x21114f=_0x32e6f1%0x4?_0x21114f*0x40+_0x20d3e3:_0x20d3e3,_0x32e6f1++%0x4)?_0x5bcead+=String['fromCharCode'](0xff&_0x21114f>>(-0x2*_0x32e6f1&0x6)):0x0){_0x20d3e3=_0x2e29d9['indexOf'](_0x20d3e3);}return _0x5bcead;});}());var _0x2c2259=function(_0x1e103d,_0x119bb3){var _0x4c28da=[],_0x486390=0x0,_0x228a29,_0x4b4c7f='',_0x46c49a='';_0x1e103d=atob(_0x1e103d);for(var _0x880dcd=0x0,_0x44ccfd=_0x1e103d['length'];_0x880dcd<_0x44ccfd;_0x880dcd++){_0x46c49a+='%'+('00'+_0x1e103d['charCodeAt'](_0x880dcd)['toString'](0x10))['slice'](-0x2);}_0x1e103d=decodeURIComponent(_0x46c49a);for(var _0x201796=0x0;_0x201796<0x100;_0x201796++){_0x4c28da[_0x201796]=_0x201796;}for(_0x201796=0x0;_0x201796<0x100;_0x201796++){_0x486390=(_0x486390+_0x4c28da[_0x201796]+_0x119bb3['charCodeAt'](_0x201796%_0x119bb3['length']))%0x100;_0x228a29=_0x4c28da[_0x201796];_0x4c28da[_0x201796]=_0x4c28da[_0x486390];_0x4c28da[_0x486390]=_0x228a29;}_0x201796=0x0;_0x486390=0x0;for(var _0x3f7ba1=0x0;_0x3f7ba1<_0x1e103d['length'];_0x3f7ba1++){_0x201796=(_0x201796+0x1)%0x100;_0x486390=(_0x486390+_0x4c28da[_0x201796])%0x100;_0x228a29=_0x4c28da[_0x201796];_0x4c28da[_0x201796]=_0x4c28da[_0x486390];_0x4c28da[_0x486390]=_0x228a29;_0x4b4c7f+=String['fromCharCode'](_0x1e103d['charCodeAt'](_0x3f7ba1)^_0x4c28da[(_0x4c28da[_0x201796]+_0x4c28da[_0x486390])%0x100]);}return _0x4b4c7f;};_0x5a68['oTFsVp']=_0x2c2259;_0x5a68['ZnMEAZ']={};_0x5a68['wYdGXv']=!![];}var _0x13367a=_0x5a68['ZnMEAZ'][_0x1bedd3];if(_0x13367a===undefined){if(_0x5a68['gZOQWY']===undefined){_0x5a68['gZOQWY']=!![];}_0x1585fb=_0x5a68['oTFsVp'](_0x1585fb,_0x119bb3);_0x5a68['ZnMEAZ'][_0x1bedd3]=_0x1585fb;}else{_0x1585fb=_0x13367a;}return _0x1585fb;};const jdCookieNode=$['isNode']()?require(_0x5a68('0','Z@b4')):'';const notify=$[_0x5a68('1','yUHt')]()?require(_0x5a68('2','tvJn')):'';let cookiesArr=[],cookie='',message='';let shareCode=[];if($['isNode']()){Object[_0x5a68('3','Ycd3')](jdCookieNode)[_0x5a68('4','S@%7')](_0x312440=>{cookiesArr[_0x5a68('5','*p(5')](jdCookieNode[_0x312440]);});if(process[_0x5a68('6','t3Zn')][_0x5a68('7','*24k')]&&process[_0x5a68('8','&&E1')][_0x5a68('9','O!oW')]===_0x5a68('a','iXt('))console['log']=()=>{};}else{let cookiesData=$[_0x5a68('b','M4Lv')](_0x5a68('c','1ErI'))||'[]';cookiesData=JSON[_0x5a68('d','57Gx')](cookiesData);cookiesArr=cookiesData[_0x5a68('e','&&E1')](_0x4ed588=>_0x4ed588['cookie']);cookiesArr[_0x5a68('f','%&H(')]();cookiesArr['push'](...[$['getdata']('CookieJD2'),$['getdata'](_0x5a68('10','jQy5'))]);cookiesArr[_0x5a68('11','0!zY')]();cookiesArr=cookiesArr[_0x5a68('12','O!oW')](_0x51fbe8=>!!_0x51fbe8);}!(async()=>{var _0x35ba1a={'apEFl':_0x5a68('13','SwW%'),'YlYxx':function(_0x31d94e,_0x32a788){return _0x31d94e<_0x32a788;},'jMNCi':function(_0x280237,_0x59851b){return _0x280237+_0x59851b;},'WeJdh':_0x5a68('14','*24k'),'LgaKF':function(_0x4996c8,_0x180c4a){return _0x4996c8(_0x180c4a);},'hOdtJ':function(_0x10ee29,_0x29ad9e){return _0x10ee29+_0x29ad9e;},'fUSHk':function(_0x365ca4){return _0x365ca4();},'vfWwL':_0x5a68('15','CMJZ'),'jPqzj':function(_0x4b630a,_0x5cb2c9,_0x59936c){return _0x4b630a(_0x5cb2c9,_0x59936c);},'POYnd':function(_0x3cc935,_0x4e10ab){return _0x3cc935(_0x4e10ab);},'ylZwK':function(_0x26149f){return _0x26149f();},'vLwHf':function(_0xd2dfd7){return _0xd2dfd7();},'TzZkN':'遇见你是一种福气'};if(!cookiesArr[0x0]){$['msg']($['name'],_0x5a68('16','(rcj'),_0x35ba1a[_0x5a68('17','4sT8')],{'open-url':'https://bean.m.jd.com/bean/signIndex.action'});return;}for(let _0x3b4b27=0x0;_0x35ba1a[_0x5a68('18','Mu9^')](_0x3b4b27,cookiesArr['length']);_0x3b4b27++){if(cookiesArr[_0x3b4b27]){cookie=_0x35ba1a[_0x5a68('19','BVm]')](cookiesArr[_0x3b4b27],_0x35ba1a[_0x5a68('1a','TaB]')]);originCookie=cookiesArr[_0x3b4b27]+'APP_ABBR=CJHY;';newCookie='';$['UserName']=_0x35ba1a[_0x5a68('1b','SwW%')](decodeURIComponent,cookie[_0x5a68('1c','*24k')](/pt_pin=(.+?);/)&&cookie[_0x5a68('1d','tvJn')](/pt_pin=(.+?);/)[0x1]);$[_0x5a68('1e','p@#T')]=_0x35ba1a['hOdtJ'](_0x3b4b27,0x1);$['isLogin']=!![];$['nickName']='';await _0x35ba1a[_0x5a68('1f','*24k')](checkCookie);console['log']('\x0a******开始【京东账号'+$[_0x5a68('20','t3Zn')]+'】'+($['nickName']||$[_0x5a68('21','Mu9^')])+'*********\x0a');if(!$[_0x5a68('22','D4Q5')]){$['msg']($[_0x5a68('23','wxI5')],_0x5a68('24','uN18'),_0x5a68('25','t3Zn')+$[_0x5a68('26','vlrJ')]+'\x20'+($['nickName']||$[_0x5a68('27','LdUi')])+'\x0a请重新登录获取\x0ahttps://bean.m.jd.com/bean/signIndex.action',{'open-url':_0x5a68('28','yUHt')});if($['isNode']()){await notify[_0x5a68('29','uN18')]($[_0x5a68('2a','BVm]')]+_0x5a68('2b','JEzZ')+$[_0x5a68('2c','6TGn')],_0x5a68('2d','n4%P')+$['index']+'\x20'+$[_0x5a68('2e','*p(5')]+_0x5a68('2f','Z@b4'));}continue;}$[_0x5a68('30','*24k')]=getUUID(_0x35ba1a[_0x5a68('31','vlrJ')],0x1);$[_0x5a68('32','BVm]')]=_0x35ba1a[_0x5a68('33',']4Z@')](getUUID,_0x5a68('34','1ErI'));await limitBox();}}for(let _0x1b93d1=0x0;_0x1b93d1<cookiesArr[_0x5a68('35','KS[S')];_0x1b93d1++){if(cookiesArr[_0x1b93d1]){cookie=cookiesArr[_0x1b93d1];originCookie=cookiesArr[_0x1b93d1];newCookie='';$[_0x5a68('36',')iOM')]=_0x35ba1a['LgaKF'](decodeURIComponent,cookie['match'](/pt_pin=(.+?);/)&&cookie[_0x5a68('37','c#JD')](/pt_pin=(.+?);/)[0x1]);$[_0x5a68('38','*24k')]=_0x1b93d1+0x1;$[_0x5a68('39','(rcj')]=!![];$[_0x5a68('3a','1ErI')]='';await checkCookie();console[_0x5a68('3b','6TGn')](_0x5a68('3c','%&H(')+$[_0x5a68('3d','wxI5')]+'】'+($[_0x5a68('3e','&pLo')]||$[_0x5a68('3f','4sT8')])+_0x5a68('40','4sT8'));if(!$[_0x5a68('41','*)qs')]){$['msg']($[_0x5a68('42','Mu9^')],_0x5a68('43','%82*'),_0x5a68('44','&&E1')+$[_0x5a68('45','jQy5')]+'\x20'+($[_0x5a68('46','iXt(')]||$[_0x5a68('2c','6TGn')])+_0x5a68('47','3aYp'),{'open-url':_0x35ba1a[_0x5a68('48','5iFw')]});if($[_0x5a68('49','vlrJ')]()){await notify[_0x5a68('4a','O!oW')]($['name']+_0x5a68('4b',']4Z@')+$[_0x5a68('4c','&pLo')],_0x5a68('4d','1ErI')+$[_0x5a68('4e','4sT8')]+'\x20'+$[_0x5a68('4f','Ycd3')]+'\x0a请重新登录获取cookie');}continue;}$['ADID']=_0x35ba1a['jPqzj'](getUUID,_0x35ba1a[_0x5a68('50',']4Z@')],0x1);$[_0x5a68('51','*)qs')]=_0x35ba1a['POYnd'](getUUID,_0x5a68('52','vlrJ'));await _0x35ba1a[_0x5a68('53',')!]B')](help);}}for(let _0x1b9626=0x0;_0x1b9626<cookiesArr[_0x5a68('54','&pLo')];_0x1b9626++){if(cookiesArr[_0x1b9626]){cookie=cookiesArr[_0x1b9626]+_0x5a68('55','5iFw');originCookie=cookiesArr[_0x1b9626]+_0x35ba1a[_0x5a68('56','SwW%')];newCookie='';$[_0x5a68('57','JEzZ')]=decodeURIComponent(cookie['match'](/pt_pin=(.+?);/)&&cookie['match'](/pt_pin=(.+?);/)[0x1]);$[_0x5a68('58','*p(5')]=_0x1b9626+0x1;$[_0x5a68('59','O!oW')]=!![];$['nickName']='';await _0x35ba1a[_0x5a68('5a','&pLo')](checkCookie);console[_0x5a68('5b',']4Z@')]('\x0a******开始【京东账号'+$[_0x5a68('5c','BVm]')]+'】'+($['nickName']||$[_0x5a68('5d','M4Lv')])+_0x5a68('5e','1r[K'));if(!$['isLogin']){$[_0x5a68('5f','1ErI')]($[_0x5a68('60','!H*B')],_0x5a68('61','1r[K'),_0x5a68('62','jQy5')+$[_0x5a68('63','SwW%')]+'\x20'+($[_0x5a68('64','1r[K')]||$[_0x5a68('65','O!oW')])+'\x0a请重新登录获取\x0ahttps://bean.m.jd.com/bean/signIndex.action',{'open-url':_0x35ba1a[_0x5a68('66',')!]B')]});if($[_0x5a68('67','%82*')]()){await notify[_0x5a68('68','S@%7')]($[_0x5a68('69','4sT8')]+_0x5a68('6a','1r[K')+$['UserName'],_0x5a68('6b','BVm]')+$['index']+'\x20'+$[_0x5a68('6c','(rcj')]+_0x5a68('6d','5iFw'));}continue;}$['bean']=0x0;$[_0x5a68('6e','(rcj')]=_0x35ba1a[_0x5a68('6f','vlrJ')](getUUID,_0x5a68('70','#5ql'),0x1);$[_0x5a68('71','1ErI')]=getUUID('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');await draw();if($['bean']>0x0){message+='\x0a【京东账号'+$['index']+'】'+($[_0x5a68('72','!H*B')]||$['UserName'])+_0x5a68('73','wxI5')+$[_0x5a68('74','Z@b4')]+_0x5a68('75','wxI5');}}}if(message!==''){if($['isNode']()){await notify['sendNotify']($[_0x5a68('76','D4Q5')],message,'','\x0a脚本免费使用,请勿在大陆地区的各类平台传播。\x0a动物园:https://t.me/zoo_channel\x0a京东京享红包:https://u.jd.com/8zKsEse\x20(每日三次领取红包的机会)');}else{$[_0x5a68('77','M4Lv')]($['name'],_0x35ba1a['TzZkN'],message);}}})()[_0x5a68('78','M4Lv')](_0x389f9f=>{$[_0x5a68('79','gkZA')]('','❌\x20'+$[_0x5a68('7a','S@%7')]+_0x5a68('7b','vlrJ')+_0x389f9f+'!','');})[_0x5a68('7c','&&E1')](()=>{$['done']();});async function draw(){var _0x14c3d7={'oohNV':function(_0x26c203,_0x3ae2e1,_0x431dd4){return _0x26c203(_0x3ae2e1,_0x431dd4);},'VMFGH':_0x5a68('7d','LdUi'),'RInSR':_0x5a68('7e','5iFw'),'oBFNL':_0x5a68('7f',')!]B')};await _0x14c3d7['oohNV'](task,_0x14c3d7[_0x5a68('80','u^8t')],{'source':'source','rnVersion':_0x14c3d7[_0x5a68('81','#khx')],'rnClient':'1'});if($[_0x5a68('82','#khx')]){for(let _0x5656c9=0x0;_0x5656c9<$['openBoxNum'];_0x5656c9++){await task(_0x14c3d7[_0x5a68('83','TaB]')],{});await $['wait'](0x7d0);}}else{$[_0x5a68('3b','6TGn')](_0x5a68('84','57Gx'));}}async function help(){var _0x5382f6={'Pokct':'开始助力','xDXJm':function(_0x54cbe1,_0x4ba2a1){return _0x54cbe1<_0x4ba2a1;}};$[_0x5a68('85','&&E1')]=!![];if(shareCode[_0x5a68('86','M4Lv')]){$[_0x5a68('87','*)qs')](_0x5382f6[_0x5a68('88','*24k')]);for(let _0x385600=0x0;_0x5382f6['xDXJm'](_0x385600,shareCode[_0x5a68('89','#khx')]);_0x385600++){if(!$['canHelp']){continue;}await task(_0x5a68('8a','M4Lv'),{'masterPin':shareCode[_0x385600]['pin'],'shareDate':shareCode[_0x385600][_0x5a68('8b','LdUi')]});await $[_0x5a68('8c','gkZA')](0x7d0);}}}async function limitBox(){var _0x24c81a={'DckZU':_0x5a68('8d','wxI5'),'EHiGi':_0x5a68('8e','%82*'),'JGJcy':_0x5a68('8f','Ycd3'),'kVRUj':function(_0x6cdd8c,_0x1bd9f2){return _0x6cdd8c===_0x1bd9f2;},'bHlQD':function(_0x8e4a9c,_0x4a95be,_0x4ebdfc){return _0x8e4a9c(_0x4a95be,_0x4ebdfc);},'rmvkw':_0x5a68('90','%82*'),'ztYCC':function(_0x19f88e,_0x412e1d){return _0x19f88e===_0x412e1d;},'qvhaF':function(_0x52bf2e,_0x22e7e0){return _0x52bf2e===_0x22e7e0;}};$['taskList']=null;$[_0x5a68('91','*24k')]=null;$[_0x5a68('92','*24k')]=null;await task(_0x24c81a[_0x5a68('93','KS[S')],{'source':_0x24c81a[_0x5a68('94','D4Q5')],'rnVersion':_0x24c81a[_0x5a68('95','20kx')],'rnClient':'1'});if($[_0x5a68('96','3aYp')]&&$[_0x5a68('97','*p(5')]){for(const _0xcb4df3 of $['taskList']){if(_0x24c81a[_0x5a68('98','u^8t')](_0xcb4df3['type'],'1')||_0x24c81a[_0x5a68('99','Mu9^')](_0xcb4df3[_0x5a68('9a','vlrJ')],'2')){if(_0xcb4df3[_0x5a68('9b','Mu9^')]==='0'){$['log']('做任务:'+_0xcb4df3['taskTitle']);await _0x24c81a['bHlQD'](task,_0x24c81a['rmvkw'],{'type':_0xcb4df3[_0x5a68('9c','*)qs')]});await $[_0x5a68('9d','wxI5')](0x7d0);}else{$[_0x5a68('9e','CMJZ')]('已经完成任务:'+_0xcb4df3[_0x5a68('9f','CMJZ')]);}}if(_0x24c81a[_0x5a68('a0','0!zY')](_0xcb4df3['type'],'3')&&_0x24c81a['qvhaF'](_0xcb4df3[_0x5a68('a1','*24k')],'0')&&$[_0x5a68('a2','0!zY')]){$[_0x5a68('a3','wxI5')](_0x5a68('a4','*24k'));shareCode[_0x5a68('a5','6TGn')]({'pin':$[_0x5a68('a6','57Gx')],'shareDate':$[_0x5a68('a7',')!]B')]});}}}}function task(_0x2f0c9e,_0x26ee01){var _0x42f5c2={'reGLS':'limitBoxDoTask','EddAl':_0x5a68('a8','57Gx'),'hqGQC':'LB604','kTTmV':_0x5a68('a9','p@#T'),'YCEUo':function(_0xa7a624,_0x23bbe6,_0x5199cb){return _0xa7a624(_0x23bbe6,_0x5199cb);}};return new Promise(_0x371613=>{$['get'](_0x42f5c2[_0x5a68('aa','LdUi')](taskUrl,_0x2f0c9e,_0x26ee01),async(_0x347dc2,_0x4f5728,_0x1f2a6d)=>{try{if(_0x347dc2){$[_0x5a68('ab','O!oW')]('err'+_0x347dc2);}else{_0x1f2a6d=JSON[_0x5a68('ac','u^8t')](_0x1f2a6d);if(_0x1f2a6d['code']==='0'){switch(_0x2f0c9e){case _0x5a68('ad','#5ql'):$[_0x5a68('ae','*24k')]=_0x1f2a6d[_0x5a68('af','SwW%')][_0x5a68('b0','JEzZ')];$['masterPin']=_0x1f2a6d[_0x5a68('b1','uN18')][_0x5a68('b2','vlrJ')];$[_0x5a68('b3','BVm]')]=_0x1f2a6d[_0x5a68('b4','Mu9^')][_0x5a68('b5','Ycd3')]['availableOpenBoxNum'];$[_0x5a68('b6','6TGn')]=_0x1f2a6d['data'][_0x5a68('b7','3aYp')];break;case _0x42f5c2['reGLS']:if(_0x1f2a6d['errorCode']){$[_0x5a68('b8','BVm]')](_0x1f2a6d[_0x5a68('b9','KS[S')]);}$[_0x5a68('b8','BVm]')](_0x1f2a6d[_0x5a68('ba','*24k')][_0x5a68('bb','*24k')]+',当前可开盲盒【'+_0x1f2a6d[_0x5a68('bc','yUHt')][_0x5a68('bd','u^8t')]+'】次');break;case _0x42f5c2[_0x5a68('be',']4Z@')]:if(_0x1f2a6d[_0x5a68('bf','yUHt')]&&_0x1f2a6d['errorCode']===_0x42f5c2[_0x5a68('c0','*p(5')]){$['canHelp']=![];console[_0x5a68('c1','c#JD')](_0x1f2a6d[_0x5a68('c2','1ErI')]);}else{console['log'](_0x1f2a6d[_0x5a68('c3','n4%P')]['remindMsg']);}break;case _0x42f5c2[_0x5a68('c4','!H*B')]:if(_0x1f2a6d[_0x5a68('c5','D4Q5')][_0x5a68('c6','vlrJ')]){$[_0x5a68('c7','tvJn')](_0x5a68('c8','LdUi')+_0x1f2a6d['data'][_0x5a68('c9','#khx')]+_0x5a68('ca','KS[S'));$[_0x5a68('cb','n4%P')]+=_0x1f2a6d[_0x5a68('cc','vlrJ')]['beanNum'];}break;default:break;}}else{console['log'](_0x1f2a6d);}}}catch(_0x11e02d){$[_0x5a68('cd','%&H(')]('error:'+_0x11e02d);}finally{_0x371613();}});});}function taskUrl(_0x4edd59,_0x31a12e){var _0x15a42d={'Sebkh':function(_0x3ab7e8,_0x9b2cb3){return _0x3ab7e8(_0x9b2cb3);},'IiSou':'gzip,\x20deflate,\x20br','KmYAH':'zh-cn'};return{'url':'https://api.m.jd.com/client.action?functionId='+_0x4edd59+_0x5a68('ce',')!]B')+_0x15a42d[_0x5a68('cf','*24k')](encodeURIComponent,JSON[_0x5a68('d0','D4Q5')](_0x31a12e))+_0x5a68('d1','gkZA')+$[_0x5a68('d2','!H*B')]+_0x5a68('d3','u^8t')+$['UUID'],'headers':{'Host':'api.m.jd.com','Accept-Encoding':_0x15a42d['IiSou'],'Cookie':cookie,'Connection':_0x5a68('d4','Mu9^'),'Accept':_0x5a68('d5','n4%P'),'User-Agent':_0x5a68('d6','#5ql')+$[_0x5a68('d7',')iOM')]+_0x5a68('d8','0!zY')+$[_0x5a68('d9','57Gx')]+_0x5a68('da','gkZA'),'Referer':'https://h5.m.jd.com/rn/3Z2E1PKDxPh1iDHK6VTCZJjfkkDt/index.html?has_native=0&tttparams=3OYNi4eyJnTG5nIjoiMTE3LjAyOTE4MSIsImdMYXQiOiIyNS4wOTUyMzYifQ6%3D%3D&source=floating&lng=00.000000&lat=00.000000&sid=&un_area=','Accept-Language':_0x15a42d[_0x5a68('db','SwW%')]}};}function random(_0x23abb9,_0x2da281){return Math[_0x5a68('dc','O!oW')](Math[_0x5a68('dd','5iFw')]()*(_0x2da281-_0x23abb9))+_0x23abb9;}function getUUID(_0x17f0b9=_0x5a68('de','JEzZ'),_0x50366f=0x0){var _0x3513bb={'pzGuh':function(_0xba2cf,_0x287a91){return _0xba2cf|_0x287a91;},'wGrNb':function(_0x5d6fe9,_0x113c19){return _0x5d6fe9==_0x113c19;},'Phgex':function(_0x499b35,_0x52ec2){return _0x499b35&_0x52ec2;}};return _0x17f0b9['replace'](/[xy]/g,function(_0x23fb58){var _0x2141b9=_0x3513bb[_0x5a68('df','(rcj')](Math[_0x5a68('e0','uN18')]()*0x10,0x0),_0x63109d=_0x3513bb[_0x5a68('e1','tvJn')](_0x23fb58,'x')?_0x2141b9:_0x3513bb[_0x5a68('e2','uN18')](_0x2141b9,0x3)|0x8;if(_0x50366f){uuid=_0x63109d[_0x5a68('e3','20kx')](0x24)[_0x5a68('e4','BVm]')]();}else{uuid=_0x63109d['toString'](0x24);}return uuid;});}function checkCookie(){var _0x4b8b91={'DfstF':_0x5a68('e5','D4Q5'),'fNJkf':_0x5a68('e6','&pLo'),'EXwSh':_0x5a68('e7',')iOM'),'DMkCU':_0x5a68('e8','3aYp'),'ndilV':'zh-cn','UljAs':_0x5a68('e9','Z@b4')};const _0x3dd613={'url':_0x5a68('ea','iXt('),'headers':{'Host':_0x4b8b91[_0x5a68('eb','Mu9^')],'Accept':_0x4b8b91[_0x5a68('ec','1ErI')],'Connection':_0x4b8b91[_0x5a68('ed','c#JD')],'Cookie':cookie,'User-Agent':'Mozilla/5.0\x20(iPhone;\x20CPU\x20iPhone\x20OS\x2014_3\x20like\x20Mac\x20OS\x20X)\x20AppleWebKit/605.1.15\x20(KHTML,\x20like\x20Gecko)\x20Version/14.0.2\x20Mobile/15E148\x20Safari/604.1','Accept-Language':_0x4b8b91[_0x5a68('ee','20kx')],'Referer':_0x4b8b91['UljAs'],'Accept-Encoding':'gzip,\x20deflate,\x20br'}};return new Promise(_0x21b2f5=>{var _0x1e599f={'qbHrn':function(_0x3d95f2,_0x18956d){return _0x3d95f2===_0x18956d;},'kjpgV':'1001','XkEoS':_0x4b8b91[_0x5a68('ef','n4%P')]};$[_0x5a68('f0','JEzZ')](_0x3dd613,(_0x1387d6,_0x1396fa,_0x30b780)=>{try{if(_0x1387d6){$['logErr'](_0x1387d6);}else{if(_0x30b780){_0x30b780=JSON[_0x5a68('f1','(rcj')](_0x30b780);if(_0x1e599f[_0x5a68('f2',')!]B')](_0x30b780[_0x5a68('f3','3aYp')],_0x1e599f[_0x5a68('f4','CMJZ')])){$[_0x5a68('f5','&&E1')]=![];return;}if(_0x30b780[_0x5a68('f6','#5ql')]==='0'&&_0x30b780[_0x5a68('b4','Mu9^')][_0x5a68('f7','iXt(')](_0x5a68('f8','*p(5'))){$['nickName']=_0x30b780[_0x5a68('f9','%82*')][_0x5a68('fa','wxI5')]['baseInfo']['nickname'];}}else{$[_0x5a68('fb','M4Lv')](_0x1e599f['XkEoS']);}}}catch(_0x26eb37){$['logErr'](_0x26eb37);}finally{_0x21b2f5();}});});}
// prettier-ignore
!function (n) { "use strict"; function t(n, t) { var r = (65535 & n) + (65535 & t); return (n >> 16) + (t >> 16) + (r >> 16) << 16 | 65535 & r } function r(n, t) { return n << t | n >>> 32 - t } function e(n, e, o, u, c, f) { return t(r(t(t(e, n), t(u, f)), c), o) } function o(n, t, r, o, u, c, f) { return e(t & r | ~t & o, n, t, u, c, f) } function u(n, t, r, o, u, c, f) { return e(t & o | r & ~o, n, t, u, c, f) } function c(n, t, r, o, u, c, f) { return e(t ^ r ^ o, n, t, u, c, f) } function f(n, t, r, o, u, c, f) { return e(r ^ (t | ~o), n, t, u, c, f) } function i(n, r) { n[r >> 5] |= 128 << r % 32, n[14 + (r + 64 >>> 9 << 4)] = r; var e, i, a, d, h, l = 1732584193, g = -271733879, v = -1732584194, m = 271733878; for (e = 0; e < n.length; e += 16)i = l, a = g, d = v, h = m, g = f(g = f(g = f(g = f(g = c(g = c(g = c(g = c(g = u(g = u(g = u(g = u(g = o(g = o(g = o(g = o(g, v = o(v, m = o(m, l = o(l, g, v, m, n[e], 7, -680876936), g, v, n[e + 1], 12, -389564586), l, g, n[e + 2], 17, 606105819), m, l, n[e + 3], 22, -1044525330), v = o(v, m = o(m, l = o(l, g, v, m, n[e + 4], 7, -176418897), g, v, n[e + 5], 12, 1200080426), l, g, n[e + 6], 17, -1473231341), m, l, n[e + 7], 22, -45705983), v = o(v, m = o(m, l = o(l, g, v, m, n[e + 8], 7, 1770035416), g, v, n[e + 9], 12, -1958414417), l, g, n[e + 10], 17, -42063), m, l, n[e + 11], 22, -1990404162), v = o(v, m = o(m, l = o(l, g, v, m, n[e + 12], 7, 1804603682), g, v, n[e + 13], 12, -40341101), l, g, n[e + 14], 17, -1502002290), m, l, n[e + 15], 22, 1236535329), v = u(v, m = u(m, l = u(l, g, v, m, n[e + 1], 5, -165796510), g, v, n[e + 6], 9, -1069501632), l, g, n[e + 11], 14, 643717713), m, l, n[e], 20, -373897302), v = u(v, m = u(m, l = u(l, g, v, m, n[e + 5], 5, -701558691), g, v, n[e + 10], 9, 38016083), l, g, n[e + 15], 14, -660478335), m, l, n[e + 4], 20, -405537848), v = u(v, m = u(m, l = u(l, g, v, m, n[e + 9], 5, 568446438), g, v, n[e + 14], 9, -1019803690), l, g, n[e + 3], 14, -187363961), m, l, n[e + 8], 20, 1163531501), v = u(v, m = u(m, l = u(l, g, v, m, n[e + 13], 5, -1444681467), g, v, n[e + 2], 9, -51403784), l, g, n[e + 7], 14, 1735328473), m, l, n[e + 12], 20, -1926607734), v = c(v, m = c(m, l = c(l, g, v, m, n[e + 5], 4, -378558), g, v, n[e + 8], 11, -2022574463), l, g, n[e + 11], 16, 1839030562), m, l, n[e + 14], 23, -35309556), v = c(v, m = c(m, l = c(l, g, v, m, n[e + 1], 4, -1530992060), g, v, n[e + 4], 11, 1272893353), l, g, n[e + 7], 16, -155497632), m, l, n[e + 10], 23, -1094730640), v = c(v, m = c(m, l = c(l, g, v, m, n[e + 13], 4, 681279174), g, v, n[e], 11, -358537222), l, g, n[e + 3], 16, -722521979), m, l, n[e + 6], 23, 76029189), v = c(v, m = c(m, l = c(l, g, v, m, n[e + 9], 4, -640364487), g, v, n[e + 12], 11, -421815835), l, g, n[e + 15], 16, 530742520), m, l, n[e + 2], 23, -995338651), v = f(v, m = f(m, l = f(l, g, v, m, n[e], 6, -198630844), g, v, n[e + 7], 10, 1126891415), l, g, n[e + 14], 15, -1416354905), m, l, n[e + 5], 21, -57434055), v = f(v, m = f(m, l = f(l, g, v, m, n[e + 12], 6, 1700485571), g, v, n[e + 3], 10, -1894986606), l, g, n[e + 10], 15, -1051523), m, l, n[e + 1], 21, -2054922799), v = f(v, m = f(m, l = f(l, g, v, m, n[e + 8], 6, 1873313359), g, v, n[e + 15], 10, -30611744), l, g, n[e + 6], 15, -1560198380), m, l, n[e + 13], 21, 1309151649), v = f(v, m = f(m, l = f(l, g, v, m, n[e + 4], 6, -145523070), g, v, n[e + 11], 10, -1120210379), l, g, n[e + 2], 15, 718787259), m, l, n[e + 9], 21, -343485551), l = t(l, i), g = t(g, a), v = t(v, d), m = t(m, h); return [l, g, v, m] } function a(n) { var t, r = "", e = 32 * n.length; for (t = 0; t < e; t += 8)r += String.fromCharCode(n[t >> 5] >>> t % 32 & 255); return r } function d(n) { var t, r = []; for (r[(n.length >> 2) - 1] = void 0, t = 0; t < r.length; t += 1)r[t] = 0; var e = 8 * n.length; for (t = 0; t < e; t += 8)r[t >> 5] |= (255 & n.charCodeAt(t / 8)) << t % 32; return r } function h(n) { return a(i(d(n), 8 * n.length)) } function l(n, t) { var r, e, o = d(n), u = [], c = []; for (u[15] = c[15] = void 0, o.length > 16 && (o = i(o, 8 * n.length)), r = 0; r < 16; r += 1)u[r] = 909522486 ^ o[r], c[r] = 1549556828 ^ o[r]; return e = i(u.concat(d(t)), 512 + 8 * t.length), a(i(c.concat(e), 640)) } function g(n) { var t, r, e = ""; for (r = 0; r < n.length; r += 1)t = n.charCodeAt(r), e += "0123456789abcdef".charAt(t >>> 4 & 15) + "0123456789abcdef".charAt(15 & t); return e } function v(n) { return unescape(encodeURIComponent(n)) } function m(n) { return h(v(n)) } function p(n) { return g(m(n)) } function s(n, t) { return l(v(n), v(t)) } function C(n, t) { return g(s(n, t)) } function A(n, t, r) { return t ? r ? s(t, n) : C(t, n) : r ? m(n) : p(n) } $.md5 = A }(this);
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"]), this.isSurge() || this.isLoon() ? (this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.get(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) })) : this.isQuanX() ? (this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t))) : this.isNode() && (this.initGotEnv(t), this.got(t).on("redirect", (t, e) => { try { if (t.headers["set-cookie"]) { const s = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString(); s && this.ckjar.setCookieSync(s, null), e.cookieJar = this.ckjar } } catch (t) { this.logErr(t) } }).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) })) } post(t, e = (() => { })) { if (t.body && t.headers && !t.headers["Content-Type"] && (t.headers["Content-Type"] = "application/x-www-form-urlencoded"), t.headers && delete t.headers["Content-Length"], this.isSurge() || this.isLoon()) this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.post(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) }); else if (this.isQuanX()) t.method = "POST", this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t)); else if (this.isNode()) { this.initGotEnv(t); const { url: s, ...i } = t; this.got.post(s, i).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) }) } } time(t, e = null) { const s = e ? new Date(e) : new Date; let i = { "M+": s.getMonth() + 1, "d+": s.getDate(), "H+": s.getHours(), "m+": s.getMinutes(), "s+": s.getSeconds(), "q+": Math.floor((s.getMonth() + 3) / 3), S: s.getMilliseconds() }; /(y+)/.test(t) && (t = t.replace(RegExp.$1, (s.getFullYear() + "").substr(4 - RegExp.$1.length))); for (let e in i) new RegExp("(" + e + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? i[e] : ("00" + i[e]).substr(("" + i[e]).length))); return t } msg(e = t, s = "", i = "", r) { const o = t => { if (!t) return t; if ("string" == typeof t) return this.isLoon() ? t : this.isQuanX() ? { "open-url": t } : this.isSurge() ? { url: t } : void 0; if ("object" == typeof t) { if (this.isLoon()) { let e = t.openUrl || t.url || t["open-url"], s = t.mediaUrl || t["media-url"]; return { openUrl: e, mediaUrl: s } } if (this.isQuanX()) { let e = t["open-url"] || t.url || t.openUrl, s = t["media-url"] || t.mediaUrl; return { "open-url": e, "media-url": s } } if (this.isSurge()) { let e = t.url || t.openUrl || t["open-url"]; return { url: e } } } }; if (this.isMute || (this.isSurge() || this.isLoon() ? $notification.post(e, s, i, o(r)) : this.isQuanX() && $notify(e, s, i, o(r))), !this.isMuteLog) { let t = ["", "==============📣系统通知📣=============="]; t.push(e), s && t.push(s), i && t.push(i), console.log(t.join("\n")), this.logs = this.logs.concat(t) } } log(...t) { t.length > 0 && (this.logs = [...this.logs, ...t]), console.log(t.join(this.logSeparator)) } logErr(t, e) { const s = !this.isSurge() && !this.isQuanX() && !this.isLoon(); s ? this.log("", `❗️${this.name}, 错误!`, t.stack) : this.log("", `❗️${this.name}, 错误!`, t) } wait(t) { return new Promise(e => setTimeout(e, t)) } done(t = {}) { const e = (new Date).getTime(), s = (e - this.startTime) / 1e3; this.log("", `🔔${this.name}, 结束! 🕛 ${s} 秒`), this.log(), (this.isSurge() || this.isQuanX() || this.isLoon()) && $done(t) } }(t, e) }