devicely 2.2.15 → 2.2.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/devicely.js CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- const _0x208b89=_0x224b;(function(_0x4c8b38,_0x3efa7d){const _0x1884ac=_0x224b,_0x22cdb6=_0x4c8b38();while(!![]){try{const _0x421822=parseInt(_0x1884ac(0xe2))/0x1+parseInt(_0x1884ac(0xda))/0x2*(parseInt(_0x1884ac(0xd3))/0x3)+parseInt(_0x1884ac(0xbc))/0x4*(parseInt(_0x1884ac(0xa6))/0x5)+-parseInt(_0x1884ac(0xe0))/0x6+parseInt(_0x1884ac(0xa3))/0x7+-parseInt(_0x1884ac(0xdc))/0x8*(parseInt(_0x1884ac(0xb4))/0x9)+-parseInt(_0x1884ac(0xce))/0xa;if(_0x421822===_0x3efa7d)break;else _0x22cdb6['push'](_0x22cdb6['shift']());}catch(_0x557f38){_0x22cdb6['push'](_0x22cdb6['shift']());}}}(_0x486b,0x505e6));function _0x486b(){const _0x33e1dc=['lweSic0TywXS','AgvSCe9WDgLVBG','BwvZC2fNzq','lwqSic0Tzgv2AwnLidXUyw1LpG','rgv0zwn0ifDPrMKGzgv2AwnLCYbVBMX5','rffuqMi','zxHLyYa8y29TBwfUzd4','ugPtr1O','D2HPDgu','ls13AwzPlw9UBhK','u2HVDYbKzxrHAwXLzcbKzxzPy2uGAw5MB3jTyxrPB24','A0HIDge','lwGSic0TAgvSCa','rxHLy3v0zsbJB21Tyw5Kig9UignVBM5Ly3rLzcbPt1mVqw5KCM9PzcbKzxzPy2vZ','mJu3nJuZmNHXwhbAsG','DMjisK4','ls1Kzwj1zW','mJvTr2PwsM0','lI4VCgfJA2fNzs5QC29U','AfLQwgq','Bg9N','rgv2AwnLBhKGlsbpBMuGq29TBwfUzcWGqwXSierLDMLJzxmUiefjifbVD2vYzwqGtw9IAwXLief1Dg9TyxrPB24','tNferMu','zxHPDa','tLLJwfO','iYbdAgvJAYbZExn0zw0','BMfTzq','lxySic0TDMvYC2LVBG','y29TBwfUzgvY','cVcFMOaGrgv2AwnLBhKGlsbpBMuGq29TBwfUzcWGqwXSierLDMLJzxm','CfvIvNm','mtu4odC3qMresMLg','yxjNDG','cVcFKQeGuxvPy2SGC3rHCNq6','r05wse8','vw9VzKi','AhPbD0e','rgLZCgXHEsbOzwXWigLUzM9YBwf0Aw9U','iYbtDgfYDcb0AguGC2vYDMvY','mtyXmtq0uhj6zNPH','Cvfesuq','icaGquKGug93zxjLzcbnB2jPBguGqxv0B21HDgLVBG','ls11C2iTB25SEq','C3rHCNq','iYbmAxn0igrLDMLJzxm','ywn0Aw9U','q2HLy2SGC3LZDgvTihjLCxvPCMvTzw50CYbMB3iGAu9tigfUzcbbBMrYB2LKigf1Dg9TyxrPB24','reDXuuK','icbKzxzPy2vSEsbKB2n0B3iGica','lI4VBgLIl2v4zwn1Dg9Y','EeHMBxm','y0Lnr2G','CuXns2y','tgf6rLq','zgvZy3jPChrPB24','EfjQCvC','lI4VBgLIl2rLDMLJzxm','ndu2mZa3mgD5sLnUDq','y3LHBG','u3rHCNqGrgv2AwnLBhKGC2vYDMvYigfUzcbVCgvUihDLyIbPBNrLCMzHy2u','BK92qw8','BgLZDa','nJaYnta1wLb1u3nI','DMr0BNy','y2HHBgS','qvzyueG','rw5HyMXLigrLyNvNigXVz2DPBMC','mZaWmq','lI4VBgLIl2rVy3rVCG','neTJDMjwsW','wMPiteO','mti4yMTetLzm','CMvK','AejIy3u','BgvUz3rO','mJm2nZa3mKPQwuHRCq','y29TBwfUza','ndKXmJGXBxfSB2fz','tLfoyM4','t1bpB0S','CMvWzwf0','C2vLAu8','ls1UBY1ICM93C2vY','Bvb6r00','rgLZCgXHEsb2zxjZAw9Uig51BwjLCG','EwDICe8','zxjpuem','icbKzxzPy2vSEsbSAxn0icaGica','cUkDJcbfCNjVCJO','rxHLy3v0zsbVBIbHBgWGzgv2AwnLCYaOzgvMyxvSDcK','tfr6r3y','we56D3C','B3b0Aw9U','yM9Sza','mNW1Fdr8mxWWFdm','tgLZDcbHBgWGy29UBMvJDgvKigLpuYbHBMqGqw5KCM9PzcbKzxzPy2vZ','lxaSic0TCg9YDca8Cg9YDd4','CgfYC2u','lI4VBgLIl3nLCNzLCG','rgv0zwn0ifvtqIbKzxzPy2vZig9UBhK','C2nStei','B3v0Chv0sgvSCa','zxjYB3i','DMvYC2LVBG','lxySic0TDMvYyM9Zzq','reveChC','C2jqwuK','z3jHEq'];_0x486b=function(){return _0x33e1dc;};return _0x486b();}function _0x224b(_0x7d7b3a,_0x5c3ba9){_0x7d7b3a=_0x7d7b3a-0x81;const _0x486bab=_0x486b();let _0x224b51=_0x486bab[_0x7d7b3a];if(_0x224b['MYzFFG']===undefined){var _0x2fe1cd=function(_0x4d269a){const _0x50cf0a='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x3a82b5='',_0x591a44='';for(let _0x51e70e=0x0,_0x575341,_0x591990,_0x3b3249=0x0;_0x591990=_0x4d269a['charAt'](_0x3b3249++);~_0x591990&&(_0x575341=_0x51e70e%0x4?_0x575341*0x40+_0x591990:_0x591990,_0x51e70e++%0x4)?_0x3a82b5+=String['fromCharCode'](0xff&_0x575341>>(-0x2*_0x51e70e&0x6)):0x0){_0x591990=_0x50cf0a['indexOf'](_0x591990);}for(let _0xdb5fe2=0x0,_0x29bca5=_0x3a82b5['length'];_0xdb5fe2<_0x29bca5;_0xdb5fe2++){_0x591a44+='%'+('00'+_0x3a82b5['charCodeAt'](_0xdb5fe2)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x591a44);};_0x224b['drEnUt']=_0x2fe1cd,_0x224b['HZOlne']={},_0x224b['MYzFFG']=!![];}const _0x1b08b8=_0x486bab[0x0],_0x58c2d8=_0x7d7b3a+_0x1b08b8,_0x395203=_0x224b['HZOlne'][_0x58c2d8];return!_0x395203?(_0x224b51=_0x224b['drEnUt'](_0x224b51),_0x224b['HZOlne'][_0x58c2d8]=_0x224b51):_0x224b51=_0x395203,_0x224b51;}const {program}=require(_0x208b89(0xb1)),chalk=require(_0x208b89(0xd5)),packageJson=require(_0x208b89(0xa7)),{startServer}=require(_0x208b89(0x8b)),{listDevices}=require(_0x208b89(0xcd)),{checkDoctor}=require(_0x208b89(0xd9)),{executeCommand}=require(_0x208b89(0xc6));program[_0x208b89(0xaf)]('devicely')['description'](_0x208b89(0xaa))[_0x208b89(0x90)](packageJson[_0x208b89(0x90)],_0x208b89(0xb0),_0x208b89(0xe9))[_0x208b89(0x96)](_0x208b89(0xa1),_0x208b89(0xba)),program['command'](_0x208b89(0xc0))[_0x208b89(0xcb)](_0x208b89(0xd0))[_0x208b89(0x85)](_0x208b89(0x89),'Server\x20port',_0x208b89(0xd8))['option'](_0x208b89(0xe7),'Don\x27t\x20open\x20browser\x20automatically')[_0x208b89(0x85)](_0x208b89(0xa5),_0x208b89(0xd7))[_0x208b89(0x85)](_0x208b89(0xbf),_0x208b89(0x8c))['option'](_0x208b89(0x9e),_0x208b89(0x99))[_0x208b89(0xc2)](async _0x357d95=>{const _0xd6ec29=_0x208b89,_0x458b39={'DGqQI':_0xd6ec29(0xb2),'DEDpw':_0xd6ec29(0xbe),'sbPYI':function(_0xbe404e,_0x6c2ddd){return _0xbe404e(_0x6c2ddd);},'CALNY':_0xd6ec29(0x81)};try{console[_0xd6ec29(0xa9)](chalk[_0xd6ec29(0xcf)][_0xd6ec29(0x86)](_0x458b39[_0xd6ec29(0xc4)])),console['log'](chalk[_0xd6ec29(0x94)](_0x458b39[_0xd6ec29(0x92)])),console['log'](chalk[_0xd6ec29(0x94)]('━'[_0xd6ec29(0xe5)](0x32))),await _0x458b39[_0xd6ec29(0x93)](startServer,_0x357d95);}catch(_0x4425da){console[_0xd6ec29(0x8f)](chalk[_0xd6ec29(0xdd)](_0x458b39['CALNY']),_0x4425da[_0xd6ec29(0x97)]),process[_0xd6ec29(0xac)](0x1);}}),program[_0x208b89(0xe1)](_0x208b89(0xd2))[_0x208b89(0xcb)](_0x208b89(0x88))['option'](_0x208b89(0x91),_0x208b89(0x9f))[_0x208b89(0xc2)](async _0x1abac8=>{const _0x7ebbd6=_0x208b89,_0x33f638={'vdtnv':_0x7ebbd6(0x87),'XNzww':_0x7ebbd6(0xc5),'qQDID':'#\x20Check\x20system','VUYWB':function(_0x5f59b5,_0x1e78c5){return _0x5f59b5+_0x1e78c5;},'xRjqW':_0x7ebbd6(0xec),'vbHJN':_0x7ebbd6(0xc1),'kHbta':'\x20\x20devicely\x20start\x20\x20\x20\x20','cIMGh':_0x7ebbd6(0xbb),'NqDFe':'\x0a💡\x20Quick\x20start:','ygbpO':_0x7ebbd6(0xeb),'DQTBb':'\x0a📱\x20Scanning\x20for\x20devices...','nOvAo':function(_0x275fa1,_0x59e899){return _0x275fa1(_0x59e899);},'LazFT':_0x7ebbd6(0x81)};try{if(_0x7ebbd6(0xde)!==_0x33f638[_0x7ebbd6(0xea)])console[_0x7ebbd6(0xa9)](chalk[_0x7ebbd6(0xcf)][_0x7ebbd6(0x86)](_0x33f638[_0x7ebbd6(0x9a)])),console['log'](chalk[_0x7ebbd6(0x94)]('━'[_0x7ebbd6(0xe5)](0x32))),await _0x33f638[_0x7ebbd6(0xd1)](listDevices,_0x1abac8);else{const _0xc33964=_0x33f638[_0x7ebbd6(0xd4)]['split']('|');let _0x293499=0x0;while(!![]){switch(_0xc33964[_0x293499++]){case'0':_0x37e62e[_0x7ebbd6(0xa9)](_0x5ea213[_0x7ebbd6(0x94)](_0x33f638[_0x7ebbd6(0x84)])+_0x2ef42d[_0x7ebbd6(0x9d)](_0x33f638[_0x7ebbd6(0xbd)]));continue;case'1':_0x5ee582['log'](_0x33f638['VUYWB'](_0x5b7cc8[_0x7ebbd6(0x94)](_0x33f638[_0x7ebbd6(0xcc)]),_0xa18701[_0x7ebbd6(0x9d)](_0x33f638[_0x7ebbd6(0xa4)])));continue;case'2':_0x507ef0[_0x7ebbd6(0x8e)]();continue;case'3':_0x2974b2[_0x7ebbd6(0xa9)]('');continue;case'4':_0x37de95[_0x7ebbd6(0xa9)](_0x2115c9[_0x7ebbd6(0x94)](_0x33f638[_0x7ebbd6(0xa0)])+_0x3e3fb7[_0x7ebbd6(0x9d)](_0x33f638[_0x7ebbd6(0xc8)]));continue;case'5':_0x46b574['log'](_0x3c0ed3['cyan'](_0x33f638[_0x7ebbd6(0xab)]));continue;}break;}}}catch(_0x2f551a){console[_0x7ebbd6(0x8f)](chalk[_0x7ebbd6(0xdd)](_0x33f638[_0x7ebbd6(0xca)]),_0x2f551a[_0x7ebbd6(0x97)]),process['exit'](0x1);}}),program[_0x208b89(0xe1)]('doctor')['description'](_0x208b89(0xc3))[_0x208b89(0xc2)](async()=>{const _0x35e17e=_0x208b89,_0x20ecbe={};_0x20ecbe[_0x35e17e(0x83)]='\x0a❌\x20Error:',_0x20ecbe[_0x35e17e(0xe8)]='\x0a🔍\x20Checking\x20system\x20requirements...',_0x20ecbe[_0x35e17e(0x8d)]=function(_0x2e41ed,_0x149f60){return _0x2e41ed!==_0x149f60;},_0x20ecbe[_0x35e17e(0xa8)]=_0x35e17e(0xe4),_0x20ecbe[_0x35e17e(0x9c)]=_0x35e17e(0xdb);const _0x11302b=_0x20ecbe;try{console['log'](chalk[_0x35e17e(0xcf)]['bold'](_0x11302b[_0x35e17e(0xe8)])),console[_0x35e17e(0xa9)](chalk[_0x35e17e(0x94)]('━'[_0x35e17e(0xe5)](0x32))),await checkDoctor();}catch(_0x44208f){_0x11302b['sclLB'](_0x11302b[_0x35e17e(0xa8)],_0x11302b[_0x35e17e(0x9c)])?(console[_0x35e17e(0x8f)](chalk[_0x35e17e(0xdd)](_0x11302b['LTzGv']),_0x44208f['message']),process[_0x35e17e(0xac)](0x1)):(_0x35931e[_0x35e17e(0x8f)](_0x9ae9d5['red'](_0x11302b['LTzGv']),_0xe08fa2[_0x35e17e(0x97)]),_0x1d9313['exit'](0x1));}}),program[_0x208b89(0xe1)](_0x208b89(0x9b))[_0x208b89(0xcb)](_0x208b89(0xa2))[_0x208b89(0x85)](_0x208b89(0x98),'Execute\x20on\x20specific\x20device')[_0x208b89(0x85)](_0x208b89(0x95),_0x208b89(0x82))[_0x208b89(0xc2)](async(_0x1a638e,_0xd8508a)=>{const _0x10d7d1=_0x208b89,_0x11466f={};_0x11466f[_0x10d7d1(0xb8)]=_0x10d7d1(0x81),_0x11466f[_0x10d7d1(0xad)]=function(_0x4ce7b5,_0x5381df){return _0x4ce7b5===_0x5381df;},_0x11466f[_0x10d7d1(0xc9)]='\x0a⚡\x20Executing\x20command...',_0x11466f['hzAwA']=function(_0x57f0e2,_0x3f15b3){return _0x57f0e2===_0x3f15b3;},_0x11466f[_0x10d7d1(0xb3)]=_0x10d7d1(0xc7),_0x11466f[_0x10d7d1(0xb7)]=_0x10d7d1(0xe3);const _0x1e437b=_0x11466f;try{_0x1e437b[_0x10d7d1(0xad)](_0x10d7d1(0xe6),_0x10d7d1(0xd6))?(_0x591990[_0x10d7d1(0x8f)](_0x3b3249[_0x10d7d1(0xdd)](JsRHga['UoofB']),_0xdb5fe2[_0x10d7d1(0x97)]),_0x29bca5['exit'](0x1)):(console[_0x10d7d1(0xa9)](chalk[_0x10d7d1(0xcf)]['bold'](_0x1e437b[_0x10d7d1(0xc9)])),console[_0x10d7d1(0xa9)](chalk[_0x10d7d1(0x94)]('━'[_0x10d7d1(0xe5)](0x32))),await executeCommand(_0x1a638e,_0xd8508a));}catch(_0x15a848){_0x1e437b[_0x10d7d1(0xb9)](_0x1e437b['pUbVs'],_0x1e437b[_0x10d7d1(0xb7)])?(_0x5a763e['error'](_0x1d3799[_0x10d7d1(0xdd)](JsRHga[_0x10d7d1(0xb8)]),_0x2ea29d[_0x10d7d1(0x97)]),_0x58ed68['exit'](0x1)):(console[_0x10d7d1(0x8f)](chalk[_0x10d7d1(0xdd)](_0x1e437b[_0x10d7d1(0xb8)]),_0x15a848[_0x10d7d1(0x97)]),process['exit'](0x1));}}),program[_0x208b89(0x8a)](process[_0x208b89(0xb5)]);if(!process[_0x208b89(0xb5)]['slice'](0x2)[_0x208b89(0xdf)]){const VbGsIr='5|4|2|0|3|1'['split']('|');let AksZZZ=0x0;while(!![]){switch(VbGsIr[AksZZZ++]){case'0':console[_0x208b89(0xa9)](chalk[_0x208b89(0x94)](_0x208b89(0xec))+chalk[_0x208b89(0x9d)]('#\x20List\x20devices'));continue;case'1':console[_0x208b89(0xa9)]('');continue;case'2':console['log'](chalk['gray']('\x20\x20devicely\x20start\x20\x20\x20\x20')+chalk[_0x208b89(0x9d)](_0x208b89(0xbb)));continue;case'3':console[_0x208b89(0xa9)](chalk['gray'](_0x208b89(0xc5))+chalk['white'](_0x208b89(0xae)));continue;case'4':console[_0x208b89(0xa9)](chalk[_0x208b89(0xcf)](_0x208b89(0xb6)));continue;case'5':program[_0x208b89(0x8e)]();continue;}break;}}
3
+ function _0x33b0(_0x4ab8c3,_0x494540){_0x4ab8c3=_0x4ab8c3-0x1e2;const _0x123cbf=_0x123c();let _0x33b0d=_0x123cbf[_0x4ab8c3];if(_0x33b0['OcBqwc']===undefined){var _0x3ea21b=function(_0xee932d){const _0x2767e1='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0xc30e2f='',_0x257f43='';for(let _0xf7f152=0x0,_0x3bf341,_0x492b29,_0x4f914f=0x0;_0x492b29=_0xee932d['charAt'](_0x4f914f++);~_0x492b29&&(_0x3bf341=_0xf7f152%0x4?_0x3bf341*0x40+_0x492b29:_0x492b29,_0xf7f152++%0x4)?_0xc30e2f+=String['fromCharCode'](0xff&_0x3bf341>>(-0x2*_0xf7f152&0x6)):0x0){_0x492b29=_0x2767e1['indexOf'](_0x492b29);}for(let _0x40ba60=0x0,_0x5f5122=_0xc30e2f['length'];_0x40ba60<_0x5f5122;_0x40ba60++){_0x257f43+='%'+('00'+_0xc30e2f['charCodeAt'](_0x40ba60)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x257f43);};_0x33b0['wmKEzq']=_0x3ea21b,_0x33b0['eyMGtg']={},_0x33b0['OcBqwc']=!![];}const _0xeb3692=_0x123cbf[0x0],_0x1787e6=_0x4ab8c3+_0xeb3692,_0x16ac7c=_0x33b0['eyMGtg'][_0x1787e6];return!_0x16ac7c?(_0x33b0d=_0x33b0['wmKEzq'](_0x33b0d),_0x33b0['eyMGtg'][_0x1787e6]=_0x33b0d):_0x33b0d=_0x16ac7c,_0x33b0d;}const _0x54145b=_0x33b0;(function(_0x467cdd,_0x51224d){const _0x448e77=_0x33b0,_0x5d290c=_0x467cdd();while(!![]){try{const _0x25d85e=-parseInt(_0x448e77(0x214))/0x1*(parseInt(_0x448e77(0x211))/0x2)+parseInt(_0x448e77(0x1e8))/0x3+parseInt(_0x448e77(0x20f))/0x4+-parseInt(_0x448e77(0x201))/0x5*(-parseInt(_0x448e77(0x216))/0x6)+parseInt(_0x448e77(0x1f4))/0x7*(-parseInt(_0x448e77(0x1ed))/0x8)+parseInt(_0x448e77(0x20d))/0x9*(parseInt(_0x448e77(0x229))/0xa)+-parseInt(_0x448e77(0x202))/0xb;if(_0x25d85e===_0x51224d)break;else _0x5d290c['push'](_0x5d290c['shift']());}catch(_0x2fea31){_0x5d290c['push'](_0x5d290c['shift']());}}}(_0x123c,0x84632));const {program}=require('commander'),chalk=require('chalk'),packageJson=require(_0x54145b(0x1e3)),{startServer}=require('../lib/server'),{listDevices}=require(_0x54145b(0x212)),{checkDoctor}=require('../lib/doctor'),{executeCommand}=require(_0x54145b(0x208));program[_0x54145b(0x1f6)](_0x54145b(0x1fa))[_0x54145b(0x1ee)](_0x54145b(0x22b))['version'](packageJson[_0x54145b(0x20b)],_0x54145b(0x1e2),_0x54145b(0x21e))[_0x54145b(0x1e4)]('-h,\x20--help','Display\x20help\x20information'),program[_0x54145b(0x1ec)](_0x54145b(0x226))['description'](_0x54145b(0x1eb))['option']('-p,\x20--port\x20<port>',_0x54145b(0x218),_0x54145b(0x207))[_0x54145b(0x20c)](_0x54145b(0x210),_0x54145b(0x1ff))[_0x54145b(0x20c)](_0x54145b(0x1fb),_0x54145b(0x225))[_0x54145b(0x20c)]('--usb-only','Detect\x20USB\x20devices\x20only')[_0x54145b(0x20c)](_0x54145b(0x215),'Detect\x20WiFi\x20devices\x20only')['action'](async _0x105dbb=>{const _0xca9240=_0x54145b,_0xf2fbe6={};_0xf2fbe6[_0xca9240(0x1f2)]='\x0a🚀\x20Devicely\x20-\x20One\x20Command,\x20All\x20Devices',_0xf2fbe6[_0xca9240(0x1e7)]=_0xca9240(0x1f0),_0xf2fbe6['SmodJ']=_0xca9240(0x205);const _0x4d30f6=_0xf2fbe6;try{console['log'](chalk['cyan']['bold'](_0x4d30f6[_0xca9240(0x1f2)])),console[_0xca9240(0x222)](chalk[_0xca9240(0x209)](_0x4d30f6[_0xca9240(0x1e7)])),console['log'](chalk[_0xca9240(0x209)]('━'['repeat'](0x32))),await startServer(_0x105dbb);}catch(_0x5a477b){console[_0xca9240(0x1ea)](chalk[_0xca9240(0x20a)](_0x4d30f6[_0xca9240(0x1e5)]),_0x5a477b['message']),process[_0xca9240(0x21f)](0x1);}}),program[_0x54145b(0x1ec)](_0x54145b(0x213))[_0x54145b(0x1ee)](_0x54145b(0x21a))[_0x54145b(0x20c)](_0x54145b(0x217),_0x54145b(0x1e6))[_0x54145b(0x200)](async _0x113fbb=>{const _0x3633ea=_0x54145b,_0x308db3={'nYMGE':_0x3633ea(0x205),'JTivF':function(_0x47b717,_0x5c4e5b){return _0x47b717!==_0x5c4e5b;},'ApryC':'VKFXz','skbwf':function(_0x2eb6c4,_0x1e5631){return _0x2eb6c4(_0x1e5631);}};try{_0x308db3['JTivF'](_0x308db3[_0x3633ea(0x21d)],_0x308db3['ApryC'])?(_0x44e222[_0x3633ea(0x1ea)](_0x51bc46['red'](_0x308db3[_0x3633ea(0x1fe)]),_0x45ed33[_0x3633ea(0x1fd)]),_0x3523b3[_0x3633ea(0x21f)](0x1)):(console['log'](chalk[_0x3633ea(0x227)][_0x3633ea(0x22c)]('\x0a📱\x20Scanning\x20for\x20devices...')),console[_0x3633ea(0x222)](chalk['gray']('━'[_0x3633ea(0x1f1)](0x32))),await _0x308db3['skbwf'](listDevices,_0x113fbb));}catch(_0x28be88){console[_0x3633ea(0x1ea)](chalk[_0x3633ea(0x20a)](_0x308db3['nYMGE']),_0x28be88[_0x3633ea(0x1fd)]),process[_0x3633ea(0x21f)](0x1);}}),program['command'](_0x54145b(0x1f3))['description']('Check\x20system\x20requirements\x20for\x20iOS\x20and\x20Android\x20automation')[_0x54145b(0x200)](async()=>{const _0x39c02d=_0x54145b,_0xced9c6={'lFYDL':_0x39c02d(0x205),'bARyP':'\x0a🔍\x20Checking\x20system\x20requirements...','ThilG':function(_0x3c1355){return _0x3c1355();}};try{console[_0x39c02d(0x222)](chalk[_0x39c02d(0x227)][_0x39c02d(0x22c)](_0xced9c6['bARyP'])),console['log'](chalk['gray']('━'[_0x39c02d(0x1f1)](0x32))),await _0xced9c6[_0x39c02d(0x21c)](checkDoctor);}catch(_0x3d9033){_0x39c02d(0x1f7)==='zvUSK'?(_0x59dc26[_0x39c02d(0x1ea)](_0x313efb[_0x39c02d(0x20a)](_0xced9c6[_0x39c02d(0x21b)]),_0x1605a1[_0x39c02d(0x1fd)]),_0x1168df[_0x39c02d(0x21f)](0x1)):(console[_0x39c02d(0x1ea)](chalk[_0x39c02d(0x20a)](_0xced9c6[_0x39c02d(0x21b)]),_0x3d9033['message']),process[_0x39c02d(0x21f)](0x1));}}),program[_0x54145b(0x1ec)](_0x54145b(0x1fc))['description']('Execute\x20command\x20on\x20connected\x20iOS/Android\x20devices')[_0x54145b(0x20c)](_0x54145b(0x228),_0x54145b(0x1f5))[_0x54145b(0x20c)](_0x54145b(0x1f8),'Execute\x20on\x20all\x20devices\x20(default)')[_0x54145b(0x200)](async(_0x2413b8,_0x5e4529)=>{const _0x772724=_0x54145b,_0x4aab91={'WRnin':_0x772724(0x206),'RpFgf':function(_0x1a865d,_0x414f1f,_0x528e05){return _0x1a865d(_0x414f1f,_0x528e05);}};try{console[_0x772724(0x222)](chalk['cyan'][_0x772724(0x22c)](_0x4aab91['WRnin'])),console[_0x772724(0x222)](chalk[_0x772724(0x209)]('━'[_0x772724(0x1f1)](0x32))),await _0x4aab91[_0x772724(0x1e9)](executeCommand,_0x2413b8,_0x5e4529);}catch(_0x26f596){console[_0x772724(0x1ea)](chalk[_0x772724(0x20a)](_0x772724(0x205)),_0x26f596[_0x772724(0x1fd)]),process['exit'](0x1);}}),program[_0x54145b(0x223)](process[_0x54145b(0x219)]);function _0x123c(){const _0x2c8769=['rg9Uj3qGB3bLBIbICM93C2vYigf1Dg9TyxrPy2fSBhK','ywn0Aw9U','mtaWthb0qNbJ','mJK4mdiZC2nLrhzq','iYbtDgfYDcb0AguGC2vYDMvY','C2XPy2u','cUkDJcbfCNjVCJO','cUkAOsbfEgvJDxrPBMCGy29TBwfUzc4UlG','mZaWmq','lI4VBgLIl2v4zwn1Dg9Y','z3jHEq','CMvK','DMvYC2LVBG','B3b0Aw9U','otaXnZfJq2jguvm','D2HPDgu','nde2ndCYmgnWD3njCG','ls1UBY1ICM93C2vY','mZG2mtrszgXVquK','lI4VBgLIl2rLDMLJzxm','BgLZDa','mtfdEhLrCuK','ls13AwzPlw9UBhK','mtGYnJrdueXVDxm','lxySic0TDMvYyM9Zzq','u2vYDMvYihbVCNq','yxjNDG','tgLZDcbHBgWGy29UBMvJDgvKigLpuYbHBMqGqw5KCM9PzcbKzxzPy2vZ','BezzreW','vgHPBeC','qxbYEum','rgLZCgXHEsb2zxjZAw9Uig51BwjLCG','zxHPDa','iYbmAxn0igrLDMLJzxm','icbKzxzPy2vSEsbSAxn0icaGica','Bg9N','CgfYC2u','m3WWFdj8nxWXFdq','rw5HyMXLigrLyNvNigXVz2DPBMC','C3rHCNq','y3LHBG','lwqSic0Tzgv2AwnLidXUyw1LpG','mJuWAe1tDhHU','C3bSAxq','rgv2AwnLBhKGlsbpBMuGq29TBwfUzcWGqwXSierLDMLJzxmUiefjifbVD2vYzwqGtw9IAwXLief1Dg9TyxrPB24','yM9Sza','lxySic0TDMvYC2LVBG','lI4VCgfJA2fNzs5QC29U','AgvSCe9WDgLVBG','u21VzeO','u2HVDYbKzxrHAwXLzcbKzxzPy2uGAw5MB3jTyxrPB24','ELLqAwu','mtmYnZe3mfj0yLfnyG','uNbgz2y','zxjYB3i','u3rHCNqGrgv2AwnLBhKGC2vYDMvYigfUzcbVCgvUihDLyIbPBNrLCMzHy2u','y29TBwfUza','odeWntu3nK52twn0qq','zgvZy3jPChrPB24','cVcFKQeGuxvPy2SGC3rHCNq6','icaGquKGug93zxjLzcbnB2jPBguGqxv0B21HDgLVBG','CMvWzwf0','qvjlBfe','zg9JDg9Y','n21nELDSDq','rxHLy3v0zsbVBIbZCgvJAwzPyYbKzxzPy2u','BMfTzq','thPgBeC','lweSic0TywXS','BgvUz3rO','zgv2AwnLBhK','ls1Kzwj1zW','zxHLyYa8y29TBwfUzd4','BwvZC2fNzq','BLLnr0u'];_0x123c=function(){return _0x2c8769;};return _0x123c();}if(!process[_0x54145b(0x219)][_0x54145b(0x204)](0x2)[_0x54145b(0x1f9)]){const PFbMAg=_0x54145b(0x224)[_0x54145b(0x22a)]('|');let pUZdda=0x0;while(!![]){switch(PFbMAg[pUZdda++]){case'0':console[_0x54145b(0x222)](chalk[_0x54145b(0x227)](_0x54145b(0x1ef)));continue;case'1':console[_0x54145b(0x222)](chalk[_0x54145b(0x209)]('\x20\x20devicely\x20doctor\x20\x20\x20')+chalk[_0x54145b(0x20e)]('#\x20Check\x20system'));continue;case'2':console[_0x54145b(0x222)](chalk['gray']('\x20\x20devicely\x20start\x20\x20\x20\x20')+chalk[_0x54145b(0x20e)](_0x54145b(0x203)));continue;case'3':program['outputHelp']();continue;case'4':console[_0x54145b(0x222)]('');continue;case'5':console[_0x54145b(0x222)](chalk[_0x54145b(0x209)](_0x54145b(0x221))+chalk[_0x54145b(0x20e)](_0x54145b(0x220)));continue;}break;}}
@@ -1 +1,515 @@
1
- const _0x56a45d=_0x432e;(function(_0x480feb,_0x21c7bc){const _0x25cce4=_0x432e,_0x4a2358=_0x480feb();while(!![]){try{const _0x14c042=-parseInt(_0x25cce4(0x1fd))/0x1+-parseInt(_0x25cce4(0x160))/0x2*(-parseInt(_0x25cce4(0x220))/0x3)+parseInt(_0x25cce4(0x1af))/0x4*(-parseInt(_0x25cce4(0x188))/0x5)+parseInt(_0x25cce4(0x139))/0x6*(parseInt(_0x25cce4(0x217))/0x7)+parseInt(_0x25cce4(0x1e0))/0x8*(parseInt(_0x25cce4(0x18b))/0x9)+parseInt(_0x25cce4(0x1da))/0xa*(parseInt(_0x25cce4(0x1de))/0xb)+-parseInt(_0x25cce4(0x13f))/0xc*(-parseInt(_0x25cce4(0x198))/0xd);if(_0x14c042===_0x21c7bc)break;else _0x4a2358['push'](_0x4a2358['shift']());}catch(_0x117e7c){_0x4a2358['push'](_0x4a2358['shift']());}}}(_0x1c2d,0x5ffb7));const consola=require(_0x56a45d(0x16a)),{v4:uuidv4}=require(_0x56a45d(0x238)),fs=require('fs')['promises'],path=require(_0x56a45d(0x151)),os=require('os'),_0x14a91d={};_0x14a91d['PUBLIC']=0x0,_0x14a91d[_0x56a45d(0x230)]=0x1,_0x14a91d[_0x56a45d(0x1a4)]=0x2;const LOG_LEVELS=_0x14a91d,CURRENT_LEVEL=((()=>{const _0x1d205a=_0x56a45d,_0x35ea05={};_0x35ea05['UeilC']=function(_0x545df3,_0x40392a){return _0x545df3===_0x40392a;},_0x35ea05[_0x1d205a(0x179)]=_0x1d205a(0x190),_0x35ea05[_0x1d205a(0x22e)]='--debug',_0x35ea05[_0x1d205a(0x219)]=function(_0x5196b7,_0x50b986){return _0x5196b7===_0x50b986;},_0x35ea05[_0x1d205a(0x204)]=_0x1d205a(0x166);const _0xb0050a=_0x35ea05;if(_0xb0050a[_0x1d205a(0x13a)](process.env.CREATOR_MODE,_0xb0050a[_0x1d205a(0x179)])||process[_0x1d205a(0x1c8)][_0x1d205a(0x15f)](_0x1d205a(0x1c1)))return LOG_LEVELS[_0x1d205a(0x1a4)];if(process[_0x1d205a(0x1c8)][_0x1d205a(0x15f)](_0xb0050a['AiUua'])||process.env.DEBUG===_0xb0050a[_0x1d205a(0x179)]||_0xb0050a[_0x1d205a(0x219)](process.env.NODE_ENV,_0xb0050a['PeuhL'])){if(_0xb0050a[_0x1d205a(0x13a)]('yNtfJ',_0x1d205a(0x19c)))_0x2e7424['debug']('🌐\x20'+_0x2d5cdb+(_0x5e4d8a?'\x20('+_0x3f86ce+_0x1d205a(0x161):''));else return LOG_LEVELS[_0x1d205a(0x230)];}return LOG_LEVELS['PUBLIC'];})()),SENSITIVE_PATTERNS={'udid':/([a-fA-F0-9]{8}-[a-fA-F0-9]{16})/g,'serial':/([A-Z0-9]{10,})/g,'token':/(token|auth|key|secret|password)/i,'ip':/(\b(?:[0-9]{1,3}\.){3}[0-9]{1,3}\b)/g,'port':/(localhost:\d+|127\.0\.0\.1:\d+)/g,'homePath':new RegExp(os['homedir']()['replace'](/[.*+?^${}()|[\]\\]/g,_0x56a45d(0x221)),'g'),'coordinates':/("x":\d+,"y":\d+)/g};function redactSensitiveData(_0x26fe88,_0xeacee4=CURRENT_LEVEL){const _0x8bb131=_0x56a45d,_0x8f0be6={'lBzVP':function(_0x6c8ea6,_0xf5c258){return _0x6c8ea6===_0xf5c258;},'WdzUZ':'object','KofxG':function(_0x1692d8,_0x4cf688){return _0x1692d8(_0x4cf688);},'aTLuL':function(_0x3d0209,_0x3b4c1c){return _0x3d0209===_0x3b4c1c;},'CCapa':'[USER-PATH]','BIObd':'\x22x\x22:[X],\x22y\x22:[Y]','GoiXH':_0x8bb131(0x1f9),'XIpBQ':_0x8bb131(0x20c),'HeCVb':'[ENDPOINT]'};if(_0x8f0be6[_0x8bb131(0x16f)](_0xeacee4,LOG_LEVELS[_0x8bb131(0x1a4)]))return _0x26fe88;let _0x3da65e=_0x8f0be6['lBzVP'](typeof _0x26fe88,_0x8f0be6[_0x8bb131(0x19f)])?JSON[_0x8bb131(0x197)](_0x26fe88,null,0x2):_0x8f0be6['KofxG'](String,_0x26fe88);if(_0x8f0be6[_0x8bb131(0x131)](_0xeacee4,LOG_LEVELS[_0x8bb131(0x21d)])){const _0x5535e9=_0x8bb131(0x208)[_0x8bb131(0x14d)]('|');let _0xe654e0=0x0;while(!![]){switch(_0x5535e9[_0xe654e0++]){case'0':_0x3da65e=_0x3da65e[_0x8bb131(0x1cc)](SENSITIVE_PATTERNS[_0x8bb131(0x1d7)],_0x8f0be6['CCapa']);continue;case'1':_0x3da65e=_0x3da65e['replace'](SENSITIVE_PATTERNS[_0x8bb131(0x19a)],_0x8f0be6[_0x8bb131(0x1b7)]);continue;case'2':_0x3da65e=_0x3da65e['replace'](SENSITIVE_PATTERNS[_0x8bb131(0x187)],_0x8f0be6[_0x8bb131(0x233)]);continue;case'3':_0x3da65e=_0x3da65e[_0x8bb131(0x1cc)](SENSITIVE_PATTERNS['ip'],_0x8f0be6[_0x8bb131(0x226)]);continue;case'4':_0x3da65e=_0x3da65e[_0x8bb131(0x1cc)](SENSITIVE_PATTERNS[_0x8bb131(0x18e)],_0x8f0be6[_0x8bb131(0x133)]);continue;}break;}}else _0xeacee4===LOG_LEVELS[_0x8bb131(0x230)]&&(_0x3da65e=_0x3da65e[_0x8bb131(0x1cc)](SENSITIVE_PATTERNS['udid'],_0x17f0a2=>_0x17f0a2[_0x8bb131(0x194)](0x0,0x8)+_0x8bb131(0x1a5)+_0x17f0a2[_0x8bb131(0x194)](-0x4)),_0x3da65e=_0x3da65e[_0x8bb131(0x1cc)](SENSITIVE_PATTERNS[_0x8bb131(0x1d7)],_0x8bb131(0x1c3)));return _0x3da65e;}function _0x432e(_0x1d72b3,_0x24f5d2){_0x1d72b3=_0x1d72b3-0x12d;const _0x1c2d46=_0x1c2d();let _0x432e56=_0x1c2d46[_0x1d72b3];if(_0x432e['oSpGMu']===undefined){var _0x1bf23b=function(_0x3d4bbf){const _0x58b1eb='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x548d6f='',_0x351839='';for(let _0x5d2947=0x0,_0x17f161,_0x31f368,_0x36d82f=0x0;_0x31f368=_0x3d4bbf['charAt'](_0x36d82f++);~_0x31f368&&(_0x17f161=_0x5d2947%0x4?_0x17f161*0x40+_0x31f368:_0x31f368,_0x5d2947++%0x4)?_0x548d6f+=String['fromCharCode'](0xff&_0x17f161>>(-0x2*_0x5d2947&0x6)):0x0){_0x31f368=_0x58b1eb['indexOf'](_0x31f368);}for(let _0x3c2706=0x0,_0x390ac9=_0x548d6f['length'];_0x3c2706<_0x390ac9;_0x3c2706++){_0x351839+='%'+('00'+_0x548d6f['charCodeAt'](_0x3c2706)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x351839);};_0x432e['faZHyv']=_0x1bf23b,_0x432e['oLvMcH']={},_0x432e['oSpGMu']=!![];}const _0x741bca=_0x1c2d46[0x0],_0x38cce4=_0x1d72b3+_0x741bca,_0x238447=_0x432e['oLvMcH'][_0x38cce4];return!_0x238447?(_0x432e56=_0x432e['faZHyv'](_0x432e56),_0x432e['oLvMcH'][_0x38cce4]=_0x432e56):_0x432e56=_0x238447,_0x432e56;}class SessionTracker{constructor(){const _0x45448f=_0x56a45d,_0x20aae9={'UitcQ':function(_0xaa73d9){return _0xaa73d9();}};this[_0x45448f(0x191)]=_0x20aae9['UitcQ'](uuidv4)[_0x45448f(0x14d)]('-')[0x0],this[_0x45448f(0x1f3)]=Date[_0x45448f(0x136)](),this[_0x45448f(0x1e2)]=new Map(),this[_0x45448f(0x143)]=[],this[_0x45448f(0x1a2)]={'memory':[],'timing':new Map()};}[_0x56a45d(0x1b3)](_0x4c61e7,_0x269b5f){const _0x2961a9=_0x56a45d;this[_0x2961a9(0x1e2)][_0x2961a9(0x1ff)](_0x4c61e7,{..._0x269b5f,'connectedAt':Date['now'](),'commandCount':0x0});}['addCommand'](_0x2e74c6,_0x29336e,_0x3156a0){const _0x592a28=_0x56a45d,_0x4934b6={'VNzDo':function(_0xf102ba,_0xcfb5ac,_0x236a6f){return _0xf102ba(_0xcfb5ac,_0x236a6f);},'AXxkS':'debug','sjlXv':function(_0xee8387,_0x3c01b3){return _0xee8387-_0x3c01b3;},'XHjkP':function(_0x23345b,_0x438d4c){return _0x23345b!==_0x438d4c;},'DntGt':_0x592a28(0x237)},_0x1f8f00={'deviceId':_0x2e74c6,'command':_0x29336e,'duration':_0x3156a0,'timestamp':Date['now'](),'sessionTime':_0x4934b6[_0x592a28(0x1e5)](Date[_0x592a28(0x136)](),this['startTime'])};this[_0x592a28(0x143)][_0x592a28(0x1f6)](_0x1f8f00);if(this[_0x592a28(0x1e2)]['has'](_0x2e74c6)){if(_0x4934b6[_0x592a28(0x1b4)](_0x4934b6[_0x592a28(0x19e)],_0x4934b6['DntGt'])){if(_0x3297ff<_0x2fe81d[_0x592a28(0x230)])return;const _0x4965c2=_0x4934b6[_0x592a28(0x228)](_0x3a5829,_0x25a347,_0x5dd77a[_0x592a28(0x230)]),_0xd4dd34=_0x4934b6[_0x592a28(0x228)](_0x1a0edc,_0x1466eb,_0x5974bc[_0x592a28(0x230)]);_0x40aa19[_0x592a28(0x14b)]('🔍\x20['+this['module']+']\x20'+_0x4965c2,_0xd4dd34);const _0x93ec76={};_0x93ec76[_0x592a28(0x1e7)]=_0x46304e,_0x4cd472[_0x592a28(0x222)](this['module'],_0x4934b6[_0x592a28(0x1e1)],_0xa7e284,_0x93ec76);}else this[_0x592a28(0x1e2)][_0x592a28(0x22d)](_0x2e74c6)[_0x592a28(0x1e4)]++;}}['startTimer'](_0x935421){const _0x517b9b=_0x56a45d;this[_0x517b9b(0x1a2)][_0x517b9b(0x1d2)]['set'](_0x935421,Date[_0x517b9b(0x136)]());}[_0x56a45d(0x189)](_0x3cfed4){const _0x1715a0=_0x56a45d,_0x2f20e3={};_0x2f20e3[_0x1715a0(0x201)]=function(_0x1b8ccf,_0x5c6197){return _0x1b8ccf-_0x5c6197;};const _0x473a4e=_0x2f20e3,_0xda2a3c=this['performance'][_0x1715a0(0x1d2)][_0x1715a0(0x22d)](_0x3cfed4);if(_0xda2a3c){const _0x1d150c=_0x473a4e[_0x1715a0(0x201)](Date['now'](),_0xda2a3c);return this[_0x1715a0(0x1a2)][_0x1715a0(0x1d2)]['delete'](_0x3cfed4),_0x1d150c;}return 0x0;}[_0x56a45d(0x213)](){const _0x29884d=_0x56a45d,_0x5f5796={};_0x5f5796['bVkIL']=function(_0xace546,_0x34958d){return _0xace546/_0x34958d;},_0x5f5796['RsOjD']=function(_0x17d7f2,_0x21f04e){return _0x17d7f2/_0x21f04e;},_0x5f5796[_0x29884d(0x22b)]=function(_0x2230af,_0x4eb9a6){return _0x2230af/_0x4eb9a6;},_0x5f5796[_0x29884d(0x207)]=function(_0x4869cc,_0x487ac0){return _0x4869cc/_0x487ac0;};const _0x22b5c9=_0x5f5796,_0x303fca=process['memoryUsage'](),_0x1e68b7={'rss':Math[_0x29884d(0x1c9)](_0x22b5c9[_0x29884d(0x18c)](_0x303fca[_0x29884d(0x13b)],0x400)/0x400),'heapUsed':Math[_0x29884d(0x1c9)](_0x22b5c9['bVkIL'](_0x22b5c9['RsOjD'](_0x303fca[_0x29884d(0x1f2)],0x400),0x400)),'heapTotal':Math[_0x29884d(0x1c9)](_0x22b5c9[_0x29884d(0x22b)](_0x22b5c9[_0x29884d(0x207)](_0x303fca['heapTotal'],0x400),0x400)),'external':Math['round'](_0x22b5c9[_0x29884d(0x22b)](_0x22b5c9[_0x29884d(0x22b)](_0x303fca['external'],0x400),0x400)),'timestamp':Date[_0x29884d(0x136)]()};return this['performance'][_0x29884d(0x156)]['push'](_0x1e68b7),_0x1e68b7;}[_0x56a45d(0x192)](){const _0xbd9bf3=_0x56a45d,_0x354e09={};_0x354e09['SfUFF']=function(_0x2490a4,_0x1b934b){return _0x2490a4-_0x1b934b;},_0x354e09[_0xbd9bf3(0x216)]=function(_0x131b4e,_0x51aa3b){return _0x131b4e/_0x51aa3b;};const _0x1b6cb6=_0x354e09;return{'sessionId':this[_0xbd9bf3(0x191)],'uptime':_0x1b6cb6[_0xbd9bf3(0x214)](Date[_0xbd9bf3(0x136)](),this[_0xbd9bf3(0x1f3)]),'deviceCount':this['devices'][_0xbd9bf3(0x1fb)],'totalCommands':this[_0xbd9bf3(0x143)][_0xbd9bf3(0x1e9)],'avgCommandTime':this[_0xbd9bf3(0x143)][_0xbd9bf3(0x1e9)]?_0x1b6cb6['ajydh'](this[_0xbd9bf3(0x143)][_0xbd9bf3(0x1a3)]((_0x362fbb,_0x3c55d7)=>_0x362fbb+_0x3c55d7['duration'],0x0),this['commands'][_0xbd9bf3(0x1e9)]):0x0,'currentMemory':this[_0xbd9bf3(0x213)]()};}}const sessionTracker=new SessionTracker();class FileLogger{constructor(){const _0x3bc778=_0x56a45d;this['logDir']=path[_0x3bc778(0x232)](__dirname,_0x3bc778(0x184)),this['initPromise']=this['initialize']();}async[_0x56a45d(0x14e)](){const _0x2eb943=_0x56a45d,_0x37c056={};_0x37c056[_0x2eb943(0x1ac)]=_0x2eb943(0x1e2),_0x37c056[_0x2eb943(0x1ef)]=_0x2eb943(0x168),_0x37c056[_0x2eb943(0x23b)]=_0x2eb943(0x1a2);const _0x5ce42d=_0x37c056;try{const _0x574094={};_0x574094[_0x2eb943(0x1f7)]=!![],await fs[_0x2eb943(0x239)](this[_0x2eb943(0x130)],_0x574094);const _0x343e82={};_0x343e82['recursive']=!![],await fs[_0x2eb943(0x239)](path[_0x2eb943(0x232)](this[_0x2eb943(0x130)],_0x5ce42d['gMPOU']),_0x343e82);const _0x5bfc5d={};_0x5bfc5d[_0x2eb943(0x1f7)]=!![],await fs[_0x2eb943(0x239)](path[_0x2eb943(0x232)](this['logDir'],_0x5ce42d[_0x2eb943(0x1ef)]),_0x5bfc5d);const _0x3884f0={};_0x3884f0[_0x2eb943(0x1f7)]=!![],await fs[_0x2eb943(0x239)](path[_0x2eb943(0x232)](this[_0x2eb943(0x130)],_0x5ce42d[_0x2eb943(0x23b)]),_0x3884f0);}catch(_0x4957f2){}}async[_0x56a45d(0x222)](_0x5a2749,_0x4c7cd2,_0xfe4e41,_0x2809d9={}){const _0x108b39=_0x56a45d,_0x3cec3b={'ODjMl':function(_0xfc2203,_0x609520,_0x5771ba){return _0xfc2203(_0x609520,_0x5771ba);},'avRSY':_0x108b39(0x235),'pKSiX':function(_0x1ccaf1,_0x39251b){return _0x1ccaf1>=_0x39251b;},'MrMoq':function(_0x1f3bd6,_0x77a616){return _0x1f3bd6+_0x77a616;},'LIScH':_0x108b39(0x165),'VysmI':_0x108b39(0x21a)};if(CURRENT_LEVEL<LOG_LEVELS[_0x108b39(0x230)])return;await this[_0x108b39(0x17e)];const _0x5c5f62={'timestamp':new Date()[_0x108b39(0x1a1)](),'sessionId':sessionTracker[_0x108b39(0x191)],'level':_0x4c7cd2,'category':_0x5a2749,'message':_0xfe4e41,'data':_0x3cec3b['pKSiX'](CURRENT_LEVEL,LOG_LEVELS[_0x108b39(0x1a4)])?_0x2809d9:_0x3cec3b['ODjMl'](redactSensitiveData,_0x2809d9,CURRENT_LEVEL)},_0x28a3e9=_0x3cec3b[_0x108b39(0x23a)](JSON[_0x108b39(0x197)](_0x5c5f62),'\x0a');try{const _0x4529c5=path['join'](this[_0x108b39(0x130)],_0x3cec3b[_0x108b39(0x152)]);await fs[_0x108b39(0x15d)](_0x4529c5,_0x28a3e9);if(_0x5a2749){if('NwcOi'!==_0x3cec3b[_0x108b39(0x145)]){const _0xfd8f07=_0x3cec3b[_0x108b39(0x1df)](_0x5f1623,_0x297c84,_0x390997['PUBLIC']),_0x5d1d53=/[\u{1F000}-\u{1F6FF}\u{1F900}-\u{1F9FF}\u{2600}-\u{26FF}\u{2700}-\u{27BF}]/u[_0x108b39(0x21b)](_0x5d84a7);_0x575569[_0x108b39(0x235)](_0x5d1d53?_0xfd8f07:'✅\x20'+_0xfd8f07);const _0x35d0c3={};_0x35d0c3[_0x108b39(0x218)]=_0x262ea0,_0x326b71[_0x108b39(0x222)](this[_0x108b39(0x135)],_0x3cec3b['avRSY'],_0xa19148,_0x35d0c3);}else{const _0x5875d5=path['join'](this[_0x108b39(0x130)],_0x5a2749+'.log');await fs[_0x108b39(0x15d)](_0x5875d5,_0x28a3e9);}}}catch(_0x3fd2a9){}}}const fileLogger=new FileLogger();class DevicelyLogger{constructor(_0x1fb02b){const _0x188ff1=_0x56a45d;this[_0x188ff1(0x135)]=_0x1fb02b,this['deviceLoggers']=new Map(),this['timers']=new Map();}[_0x56a45d(0x235)](_0x3fda00,..._0x2e33ef){const _0x493716=_0x56a45d,_0x2c50bb={'vasDT':function(_0x3094ca,_0x195251,_0x570345){return _0x3094ca(_0x195251,_0x570345);}},_0xb21d93=_0x2c50bb[_0x493716(0x1aa)](redactSensitiveData,_0x3fda00,LOG_LEVELS[_0x493716(0x21d)]),_0x48a3f7=/[\u{1F000}-\u{1F6FF}\u{1F900}-\u{1F9FF}\u{2600}-\u{26FF}\u{2700}-\u{27BF}]/u[_0x493716(0x21b)](_0x3fda00);consola['success'](_0x48a3f7?_0xb21d93:'✅\x20'+_0xb21d93);const _0x559801={};_0x559801[_0x493716(0x218)]=_0x2e33ef,fileLogger[_0x493716(0x222)](this[_0x493716(0x135)],'success',_0x3fda00,_0x559801);}['info'](_0x59ef30,..._0x1f21a4){const _0x19f49f=_0x56a45d,_0x3f63d2={};_0x3f63d2[_0x19f49f(0x1f8)]=_0x19f49f(0x14a);const _0x1a038e=_0x3f63d2,_0x310630=redactSensitiveData(_0x59ef30,LOG_LEVELS[_0x19f49f(0x21d)]),_0x4ce762=/[\u{1F000}-\u{1F6FF}\u{1F900}-\u{1F9FF}\u{2600}-\u{26FF}\u{2700}-\u{27BF}]/u[_0x19f49f(0x21b)](_0x59ef30);consola[_0x19f49f(0x14a)](_0x4ce762?_0x310630:_0x19f49f(0x20d)+_0x310630);const _0x5c4a07={};_0x5c4a07[_0x19f49f(0x218)]=_0x1f21a4,fileLogger[_0x19f49f(0x222)](this[_0x19f49f(0x135)],_0x1a038e[_0x19f49f(0x1f8)],_0x59ef30,_0x5c4a07);}[_0x56a45d(0x182)](_0x57d3c0,..._0x12327a){const _0x5b0c48=_0x56a45d,_0x8e3009={'Pgdoj':function(_0x237efe,_0x387fff,_0x664d17){return _0x237efe(_0x387fff,_0x664d17);},'awjCG':_0x5b0c48(0x182)},_0x3c5b49=_0x8e3009[_0x5b0c48(0x132)](redactSensitiveData,_0x57d3c0,LOG_LEVELS[_0x5b0c48(0x21d)]),_0x481d3c=_0x12327a['map'](_0x1b17f8=>redactSensitiveData(_0x1b17f8,LOG_LEVELS[_0x5b0c48(0x21d)])),_0x2c4178=/[\u{1F000}-\u{1F6FF}\u{1F900}-\u{1F9FF}\u{2600}-\u{26FF}\u{2700}-\u{27BF}]/u['test'](_0x57d3c0);consola['warn'](_0x2c4178?''+_0x3c5b49:_0x5b0c48(0x13c)+_0x3c5b49,..._0x481d3c);const _0xe4115a={};_0xe4115a['args']=_0x12327a,fileLogger['log'](this[_0x5b0c48(0x135)],_0x8e3009['awjCG'],_0x57d3c0,_0xe4115a);}['error'](_0x4d59ef,_0x19f262,..._0x4cd315){const _0x58b0cb=_0x56a45d,_0x29eac6={'EAKrQ':function(_0x25fd50,_0x2cc405,_0x57b4bd){return _0x25fd50(_0x2cc405,_0x57b4bd);},'jUJOl':_0x58b0cb(0x1fa),'eAaTj':function(_0x15c495,_0x5e8828){return _0x15c495>=_0x5e8828;}},_0x50f291=_0x29eac6[_0x58b0cb(0x1c7)](redactSensitiveData,_0x4d59ef,LOG_LEVELS['PUBLIC']),_0x363cbc=/[\u{1F000}-\u{1F6FF}\u{1F900}-\u{1F9FF}\u{2600}-\u{26FF}\u{2700}-\u{27BF}]/u['test'](_0x4d59ef);consola[_0x58b0cb(0x1fa)](_0x363cbc?_0x50f291:'❌\x20'+_0x50f291,_0x19f262?.[_0x58b0cb(0x236)]||_0x19f262),fileLogger[_0x58b0cb(0x222)](this[_0x58b0cb(0x135)],_0x29eac6[_0x58b0cb(0x13e)],_0x4d59ef,{'error':{'message':_0x19f262?.[_0x58b0cb(0x236)],'stack':_0x29eac6[_0x58b0cb(0x20e)](CURRENT_LEVEL,LOG_LEVELS[_0x58b0cb(0x1a4)])?_0x19f262?.['stack']:'[REDACTED]','name':_0x19f262?.['name']},'args':_0x4cd315});}[_0x56a45d(0x14b)](_0x197def,_0x1861ed={}){const _0x317b86=_0x56a45d,_0x4bf9f3={'xcDNp':function(_0x4daacd,_0x363739){return _0x4daacd<_0x363739;},'Zwehl':function(_0x58544e,_0x108a2e,_0x3a8bba){return _0x58544e(_0x108a2e,_0x3a8bba);},'Uwtuf':function(_0x343cbd,_0x6db42c,_0x5ebf0d){return _0x343cbd(_0x6db42c,_0x5ebf0d);},'GorWW':_0x317b86(0x14b)};if(_0x4bf9f3[_0x317b86(0x18d)](CURRENT_LEVEL,LOG_LEVELS[_0x317b86(0x230)]))return;const _0x545e36=_0x4bf9f3['Zwehl'](redactSensitiveData,_0x197def,LOG_LEVELS[_0x317b86(0x230)]),_0x3997eb=_0x4bf9f3[_0x317b86(0x162)](redactSensitiveData,_0x1861ed,LOG_LEVELS[_0x317b86(0x230)]);consola['debug'](_0x317b86(0x1b0)+this[_0x317b86(0x135)]+']\x20'+_0x545e36,_0x3997eb);const _0x57574c={};_0x57574c[_0x317b86(0x1e7)]=_0x1861ed,fileLogger[_0x317b86(0x222)](this[_0x317b86(0x135)],_0x4bf9f3[_0x317b86(0x148)],_0x197def,_0x57574c);}['command'](_0x5ea46c,_0x172aa7,_0x321aa8={},_0x184fa9=null){const _0x3c38bb=_0x56a45d,_0x58cfb8={'CJUhW':function(_0x17a8e0,_0x165898){return _0x17a8e0<_0x165898;},'jXgix':_0x3c38bb(0x146),'cXqwf':function(_0x129eb4,_0xef4cb7){return _0x129eb4===_0xef4cb7;},'bUsLP':function(_0x5976d4,_0x28433a){return _0x5976d4!==_0x28433a;},'jEYoR':_0x3c38bb(0x18f),'TxxBO':_0x3c38bb(0x1e3),'IkdXH':'cxYbk','tSGDZ':function(_0x4fa18f,_0x4ccbcd,_0x13c476){return _0x4fa18f(_0x4ccbcd,_0x13c476);},'albZb':_0x3c38bb(0x1cf),'wenpL':_0x3c38bb(0x1bf),'pWczl':function(_0xaa8bf4,_0x35619e,_0x2c832d){return _0xaa8bf4(_0x35619e,_0x2c832d);}};_0x184fa9&&sessionTracker['addCommand'](_0x5ea46c,_0x172aa7,_0x184fa9);const _0x126f97=_0x3c38bb(0x1b9)+_0x172aa7;if(_0x58cfb8[_0x3c38bb(0x178)](CURRENT_LEVEL,LOG_LEVELS[_0x3c38bb(0x21d)]))_0x58cfb8['bUsLP'](_0x3c38bb(0x18f),_0x58cfb8['jEYoR'])?this['devices'][_0x3c38bb(0x1ff)](_0x5159fa,{..._0x5ad0cf,'connectedAt':_0x9278c8['now'](),'commandCount':0x0}):consola[_0x3c38bb(0x14a)](_0x3c38bb(0x15c)+_0x172aa7);else{if(CURRENT_LEVEL===LOG_LEVELS['DEVELOPER']){if(_0x58cfb8['cXqwf'](_0x58cfb8[_0x3c38bb(0x1dc)],_0x58cfb8[_0x3c38bb(0x185)])){if(_0x58cfb8[_0x3c38bb(0x15a)](_0x3e4555,_0x5981ac['CREATOR']))return;const _0x327db5=_0x2449e4[_0x3c38bb(0x213)]();_0x5ea506['debug'](_0x3c38bb(0x15b)+_0x327db5[_0x3c38bb(0x1f2)]+_0x3c38bb(0x12e)+_0x327db5[_0x3c38bb(0x1a0)]+_0x3c38bb(0x16c)+_0x327db5[_0x3c38bb(0x13b)]+_0x3c38bb(0x169)),this['performance'](_0x58cfb8[_0x3c38bb(0x22f)],_0x327db5['heapUsed'],'MB'),this[_0x3c38bb(0x1a2)](_0x3c38bb(0x1c0),_0x327db5['rss'],'MB');}else{const _0x567a21=_0x58cfb8[_0x3c38bb(0x1b6)](redactSensitiveData,_0x321aa8,LOG_LEVELS[_0x3c38bb(0x230)]),_0x4ae156=redactSensitiveData(_0x5ea46c,LOG_LEVELS['DEVELOPER']);consola[_0x3c38bb(0x14a)]('📱\x20['+_0x4ae156+']\x20'+_0x172aa7+(_0x184fa9?'\x20('+_0x184fa9+'ms)':''),_0x567a21);}}else consola[_0x3c38bb(0x14a)](_0x3c38bb(0x141)+_0x5ea46c+']\x20'+_0x172aa7+(_0x184fa9?'\x20('+_0x184fa9+_0x3c38bb(0x161):''),_0x321aa8);}fileLogger[_0x3c38bb(0x222)](_0x58cfb8[_0x3c38bb(0x17d)],_0x58cfb8[_0x3c38bb(0x144)],_0x126f97,{'command':_0x172aa7,'data':_0x321aa8,'duration':_0x184fa9,'deviceId':CURRENT_LEVEL>=LOG_LEVELS[_0x3c38bb(0x1a4)]?_0x5ea46c:_0x58cfb8[_0x3c38bb(0x1db)](redactSensitiveData,_0x5ea46c,CURRENT_LEVEL)});}['network'](_0x4550e8,_0x3a5571,_0x69ac32,_0x130937={},_0x2c1c4e=null){const _0x206daa=_0x56a45d,_0x5039e6={'NcQLZ':function(_0x29cd5b,_0x2af420){return _0x29cd5b>=_0x2af420;},'dDmtG':function(_0xb22546,_0x40fd57){return _0xb22546===_0x40fd57;},'vYnCV':_0x206daa(0x1ad),'HXzaD':'PARTIAL','oiHWB':_0x206daa(0x193),'FMYfy':_0x206daa(0x1d8),'KWgPL':function(_0x39b32b,_0x1870b9){return _0x39b32b<_0x1870b9;},'rQigU':function(_0x37bdc2,_0x59b66b,_0x35840b){return _0x37bdc2(_0x59b66b,_0x35840b);},'yklUo':function(_0x2202de,_0x253c80){return _0x2202de>=_0x253c80;},'qKumC':function(_0x5d6db9,_0x36e12e){return _0x5d6db9!==_0x36e12e;},'bHEDt':'tPvqG','azGxt':_0x206daa(0x167),'nYxeK':_0x206daa(0x157),'HULZk':_0x206daa(0x1c4)};if(_0x5039e6[_0x206daa(0x175)](CURRENT_LEVEL,LOG_LEVELS[_0x206daa(0x230)]))return;const _0x12c602=_0x5039e6[_0x206daa(0x134)](redactSensitiveData,_0x3a5571,CURRENT_LEVEL),_0x3ec0d7=_0x4550e8+'\x20'+_0x12c602+_0x206daa(0x17f)+_0x69ac32;_0x5039e6[_0x206daa(0x1d6)](_0x69ac32,0x190)?consola[_0x206daa(0x1fa)](_0x206daa(0x170)+_0x3ec0d7+(_0x2c1c4e?'\x20('+_0x2c1c4e+_0x206daa(0x161):'')):_0x5039e6[_0x206daa(0x15e)](_0x5039e6['bHEDt'],_0x5039e6['bHEDt'])?_0x46cfd2[_0x206daa(0x180)]({'title':'🚀\x20Devicely\x20Advanced\x20Logging\x20System','message':['📊\x20Mode:\x20'+_0x42f4e6,_0x206daa(0x1fe)+_0x3d1cce[_0x206daa(0x191)],_0x206daa(0x18a)+(_0x5039e6[_0x206daa(0x1e6)](_0x35ecdc,_0x78270c[_0x206daa(0x1a4)])?'ON':_0x206daa(0x193)),_0x206daa(0x173)+(_0x5039e6['dDmtG'](_0x408181,_0x3f31de[_0x206daa(0x21d)])?_0x5039e6[_0x206daa(0x153)]:_0x5039e6['dDmtG'](_0x1737c6,_0x197dd3[_0x206daa(0x230)])?_0x5039e6[_0x206daa(0x137)]:_0x5039e6[_0x206daa(0x20f)]),_0x206daa(0x16e)+(_0x5039e6[_0x206daa(0x1e6)](_0x20675d,_0xd2b041['DEVELOPER'])?'ON':_0x5039e6[_0x206daa(0x20f)]),'',_0x4162f7===_0xce74a1[_0x206daa(0x230)]?_0x5039e6['FMYfy']:'💡\x20Remove\x20--debug\x20for\x20clean\x20public\x20mode'][_0x206daa(0x232)]('\x0a')}):consola[_0x206daa(0x14b)]('🌐\x20'+_0x3ec0d7+(_0x2c1c4e?'\x20('+_0x2c1c4e+_0x206daa(0x161):'')),fileLogger[_0x206daa(0x222)](_0x5039e6[_0x206daa(0x1e8)],_0x5039e6[_0x206daa(0x1f0)],_0x5039e6[_0x206daa(0x1bd)],{'method':_0x4550e8,'url':CURRENT_LEVEL>=LOG_LEVELS['CREATOR']?_0x3a5571:_0x12c602,'statusCode':_0x69ac32,'duration':_0x2c1c4e,'data':CURRENT_LEVEL>=LOG_LEVELS[_0x206daa(0x1a4)]?_0x130937:_0x5039e6[_0x206daa(0x134)](redactSensitiveData,_0x130937,CURRENT_LEVEL)});}[_0x56a45d(0x195)](_0x17cc1c,_0xd73b4c={}){const _0x4815fc=_0x56a45d,_0x585f3b={};_0x585f3b['AStNT']=_0x4815fc(0x195);const _0x20bf20=_0x585f3b;if(CURRENT_LEVEL<LOG_LEVELS['CREATOR'])return;consola[_0x4815fc(0x14b)]('🔧\x20[TRACE]['+this[_0x4815fc(0x135)]+']\x20'+_0x17cc1c,_0xd73b4c);const _0x1ebd00={};_0x1ebd00['data']=_0xd73b4c,fileLogger[_0x4815fc(0x222)](this[_0x4815fc(0x135)],_0x20bf20[_0x4815fc(0x1f5)],_0x17cc1c,_0x1ebd00);}[_0x56a45d(0x177)](_0x42d69b,_0x528688={}){const _0x48de41=_0x56a45d,_0x2f8969={};_0x2f8969[_0x48de41(0x21c)]=_0x48de41(0x177);const _0x4bc447=_0x2f8969;if(CURRENT_LEVEL<LOG_LEVELS['CREATOR'])return;consola[_0x48de41(0x182)](_0x48de41(0x1ea)+this[_0x48de41(0x135)]+']\x20'+_0x42d69b,_0x528688);const _0x1ac5b1={};_0x1ac5b1['details']=_0x528688,fileLogger['log'](_0x4bc447[_0x48de41(0x21c)],_0x48de41(0x177),_0x42d69b,_0x1ac5b1);}['performance'](_0x29d568,_0x4dc2ce,_0x804428='ms'){const _0x474419=_0x56a45d,_0x253188={};_0x253188[_0x474419(0x1bb)]=function(_0xb7d849,_0x99d255){return _0xb7d849-_0x99d255;},_0x253188[_0x474419(0x231)]=function(_0x586061,_0x4b1ebb){return _0x586061>=_0x4b1ebb;},_0x253188['cRNGC']=function(_0x3c1028,_0xb41acd){return _0x3c1028>=_0xb41acd;},_0x253188[_0x474419(0x181)]='iHJUm',_0x253188[_0x474419(0x155)]=_0x474419(0x1a2),_0x253188['IAGeR']='metric';const _0x2d0449=_0x253188;if(_0x2d0449[_0x474419(0x1d0)](CURRENT_LEVEL,LOG_LEVELS[_0x474419(0x230)])){if(_0x2d0449[_0x474419(0x181)]!==_0x2d0449[_0x474419(0x181)]){const _0xfda429=this['timers'][_0x474419(0x22d)](_0x2c6371),_0x4e299d=_0x372563['endTimer'](_0x5aef53);if(_0xfda429){const _0x4760a9=_0x2d0449[_0x474419(0x1bb)](_0x5b71bb['now'](),_0xfda429);return this[_0x474419(0x154)]['delete'](_0x4ab9cd),_0x2143c4&&_0x2d0449[_0x474419(0x231)](_0x47cc89,_0x32cee6[_0x474419(0x230)])&&this['performance'](_0x5e72dd,_0x4760a9),_0x4760a9;}return _0x4e299d;}else consola['debug']('📊\x20'+_0x29d568+':\x20'+_0x4dc2ce+_0x804428);}fileLogger[_0x474419(0x222)](_0x2d0449['MYOSI'],_0x2d0449[_0x474419(0x17b)],_0x474419(0x142)+_0x29d568,{'metric':_0x29d568,'value':_0x4dc2ce,'unit':_0x804428,'timestamp':Date[_0x474419(0x136)](),'sessionId':sessionTracker[_0x474419(0x191)]});}[_0x56a45d(0x156)](){const _0x2ac78a=_0x56a45d,_0x570c0e={};_0x570c0e[_0x2ac78a(0x209)]=function(_0x253f98,_0x43f42f){return _0x253f98<_0x43f42f;},_0x570c0e[_0x2ac78a(0x1c6)]='memory_rss';const _0x3e304b=_0x570c0e;if(_0x3e304b[_0x2ac78a(0x209)](CURRENT_LEVEL,LOG_LEVELS[_0x2ac78a(0x1a4)]))return;const _0x29d561=sessionTracker[_0x2ac78a(0x213)]();consola[_0x2ac78a(0x14b)]('💾\x20Memory:\x20'+_0x29d561[_0x2ac78a(0x1f2)]+_0x2ac78a(0x12e)+_0x29d561[_0x2ac78a(0x1a0)]+'MB\x20(RSS:\x20'+_0x29d561[_0x2ac78a(0x13b)]+_0x2ac78a(0x169)),this[_0x2ac78a(0x1a2)](_0x2ac78a(0x146),_0x29d561['heapUsed'],'MB'),this['performance'](_0x3e304b[_0x2ac78a(0x1c6)],_0x29d561[_0x2ac78a(0x13b)],'MB');}[_0x56a45d(0x1cf)](_0x5b92f2,_0x2244dd=null){const _0x103569=_0x56a45d,_0x21cb9c={'gQbjE':function(_0x391e74,_0x2b23ef){return _0x391e74===_0x2b23ef;},'bAdOC':_0x103569(0x1cf),'ZPLEv':function(_0x795ea6,_0x267086){return _0x795ea6===_0x267086;},'LXGtH':function(_0x5eeebd,_0x3ce686,_0x348f96){return _0x5eeebd(_0x3ce686,_0x348f96);},'wJRXs':_0x103569(0x1cb),'zetfS':function(_0x4c02ff,_0x19f1c7){return _0x4c02ff>=_0x19f1c7;},'YpQZg':function(_0x157445,_0x14f82e,_0x79de6b){return _0x157445(_0x14f82e,_0x79de6b);},'MQfXk':function(_0x4892bf,_0x95c480){return _0x4892bf<_0x95c480;},'rwvsN':function(_0x2c35aa,_0x39c07f,_0x59c2fc){return _0x2c35aa(_0x39c07f,_0x59c2fc);},'Brqjv':_0x103569(0x167),'IJQPw':_0x103569(0x1c4),'sxDUq':function(_0x18ac66,_0x3b491b){return _0x18ac66>=_0x3b491b;},'ictih':function(_0x185a53,_0x5a6c3f){return _0x185a53>=_0x5a6c3f;},'ktnmZ':function(_0xf421df,_0x46145f,_0x42114d){return _0xf421df(_0x46145f,_0x42114d);},'ZELZV':_0x103569(0x14f),'WhZhK':_0x103569(0x23c),'xosdu':_0x103569(0x227),'dihvh':'AvlKS','doScE':function(_0xa21e21,_0x43ec2e){return _0xa21e21!==_0x43ec2e;},'epzjs':_0x103569(0x163),'zaAYC':_0x103569(0x149),'cczwK':_0x103569(0x22a),'HQsYK':_0x103569(0x20b),'HMQJe':function(_0x6b6c5f,_0x21a27d,_0x53a2a7){return _0x6b6c5f(_0x21a27d,_0x53a2a7);},'xVpie':_0x103569(0x1ee),'jvUJc':'error','SGfYF':_0x103569(0x13d),'YOMCR':function(_0x569d0d,_0x62d496,_0x484cd5){return _0x569d0d(_0x62d496,_0x484cd5);}};return _0x2244dd&&sessionTracker[_0x103569(0x1b3)](_0x5b92f2,_0x2244dd),{'connect':_0x4424bb=>{const _0x1abd9b=_0x103569;if(_0x21cb9c[_0x1abd9b(0x150)](CURRENT_LEVEL,LOG_LEVELS['PUBLIC']))consola[_0x1abd9b(0x235)](_0x1abd9b(0x1b2)+(_0x4424bb[_0x1abd9b(0x176)]||_0x21cb9c['bAdOC'])+'-'+_0x5b92f2[_0x1abd9b(0x194)](-0x5));else{if(_0x21cb9c[_0x1abd9b(0x186)](CURRENT_LEVEL,LOG_LEVELS[_0x1abd9b(0x230)])){const _0x4b1433=redactSensitiveData(_0x5b92f2,CURRENT_LEVEL);consola[_0x1abd9b(0x235)](_0x1abd9b(0x1b2)+_0x4b1433,_0x21cb9c[_0x1abd9b(0x210)](redactSensitiveData,_0x4424bb,CURRENT_LEVEL));}else consola[_0x1abd9b(0x235)](_0x1abd9b(0x1b2)+_0x5b92f2,_0x4424bb);}fileLogger['log'](_0x1abd9b(0x1cf),_0x21cb9c['wJRXs'],_0x1abd9b(0x1d3),{'deviceId':_0x21cb9c[_0x1abd9b(0x1f4)](CURRENT_LEVEL,LOG_LEVELS[_0x1abd9b(0x1a4)])?_0x5b92f2:_0x21cb9c[_0x1abd9b(0x224)](redactSensitiveData,_0x5b92f2,CURRENT_LEVEL),'info':_0x4424bb});},'disconnect':()=>{const _0x423e5c=_0x103569,_0x57a50e={};_0x57a50e[_0x423e5c(0x12d)]=function(_0x1bd8b4,_0x44553d){return _0x1bd8b4-_0x44553d;};const _0xe112c5=_0x57a50e;if(_0x21cb9c[_0x423e5c(0x150)](_0x21cb9c[_0x423e5c(0x229)],_0x21cb9c[_0x423e5c(0x19d)]))_0xbba27b['info']('📱\x20Device\x20disconnected');else{if(_0x21cb9c[_0x423e5c(0x150)](CURRENT_LEVEL,LOG_LEVELS[_0x423e5c(0x21d)])){if(_0x21cb9c[_0x423e5c(0x186)](_0x21cb9c[_0x423e5c(0x1a8)],_0x21cb9c[_0x423e5c(0x1c2)]))return{'sessionId':this[_0x423e5c(0x191)],'uptime':MMELqg['OLkPP'](_0x528974['now'](),this['startTime']),'deviceCount':this['devices'][_0x423e5c(0x1fb)],'totalCommands':this[_0x423e5c(0x143)]['length'],'avgCommandTime':this[_0x423e5c(0x143)][_0x423e5c(0x1e9)]?this[_0x423e5c(0x143)][_0x423e5c(0x1a3)]((_0x42f7c9,_0x2f368e)=>_0x42f7c9+_0x2f368e[_0x423e5c(0x22c)],0x0)/this[_0x423e5c(0x143)][_0x423e5c(0x1e9)]:0x0,'currentMemory':this[_0x423e5c(0x213)]()};else consola['info']('📱\x20Device\x20disconnected');}else{if(_0x21cb9c[_0x423e5c(0x138)](_0x21cb9c[_0x423e5c(0x1dd)],_0x21cb9c[_0x423e5c(0x1ed)])){const _0x2aa616=_0x21cb9c[_0x423e5c(0x174)](redactSensitiveData,_0x5b92f2,CURRENT_LEVEL);consola[_0x423e5c(0x14a)](_0x423e5c(0x20d)+_0x2aa616+_0x423e5c(0x21e));}else{if(uYJkWG[_0x423e5c(0x1d1)](_0xed498d,_0x59e719['DEVELOPER']))return;const _0x50c5ba=uYJkWG[_0x423e5c(0x174)](_0x12bc8d,_0x367434,_0x4a39e4),_0x1af78f=_0x2c68c7+'\x20'+_0x50c5ba+'\x20→\x20'+_0x3ab5da;uYJkWG['zetfS'](_0xa7ca1a,0x190)?_0x1af575['error'](_0x423e5c(0x170)+_0x1af78f+(_0x2cbd9d?'\x20('+_0x86f38d+'ms)':'')):_0x4a61ed[_0x423e5c(0x14b)](_0x423e5c(0x170)+_0x1af78f+(_0x4f0de7?'\x20('+_0x43a45d+_0x423e5c(0x161):'')),_0x2d2913[_0x423e5c(0x222)](uYJkWG[_0x423e5c(0x140)],_0x423e5c(0x157),uYJkWG[_0x423e5c(0x1a6)],{'method':_0xbd27a8,'url':uYJkWG[_0x423e5c(0x16b)](_0x11c4fa,_0x3aced5[_0x423e5c(0x1a4)])?_0x35740d:_0x50c5ba,'statusCode':_0x3b6236,'duration':_0x5a0a0f,'data':uYJkWG['ictih'](_0x590776,_0x5ce0c3[_0x423e5c(0x1a4)])?_0x3baf2a:uYJkWG[_0x423e5c(0x1eb)](_0x3fd954,_0x699381,_0x3cec96)});}}fileLogger[_0x423e5c(0x222)](_0x423e5c(0x1cf),_0x21cb9c[_0x423e5c(0x147)],_0x21cb9c[_0x423e5c(0x183)],{'deviceId':_0x21cb9c[_0x423e5c(0x225)](CURRENT_LEVEL,LOG_LEVELS[_0x423e5c(0x1a4)])?_0x5b92f2:_0x21cb9c[_0x423e5c(0x1a7)](redactSensitiveData,_0x5b92f2,CURRENT_LEVEL)});}},'error':(_0x4008a1,_0x1bdb30)=>{const _0x15d4d3=_0x103569;if(_0x21cb9c[_0x15d4d3(0x138)](_0x21cb9c['xVpie'],'lcCCO')){const _0x2a040b=redactSensitiveData(_0x4008a1,LOG_LEVELS[_0x15d4d3(0x21d)]);consola['error'](_0x15d4d3(0x158)+_0x2a040b,_0x1bdb30?.[_0x15d4d3(0x236)]||_0x1bdb30),fileLogger['log'](_0x21cb9c[_0x15d4d3(0x171)],_0x21cb9c[_0x15d4d3(0x203)],_0x15d4d3(0x206),{'message':_0x4008a1,'error':{'message':_0x1bdb30?.[_0x15d4d3(0x236)],'stack':_0x21cb9c[_0x15d4d3(0x1f4)](CURRENT_LEVEL,LOG_LEVELS[_0x15d4d3(0x1a4)])?_0x1bdb30?.[_0x15d4d3(0x1be)]:_0x21cb9c['SGfYF']},'deviceId':_0x21cb9c[_0x15d4d3(0x16b)](CURRENT_LEVEL,LOG_LEVELS[_0x15d4d3(0x1a4)])?_0x5b92f2:_0x21cb9c[_0x15d4d3(0x1b5)](redactSensitiveData,_0x5b92f2,CURRENT_LEVEL)});}else this[_0x15d4d3(0x1a2)](_0x53766e,_0x1cea8e);}};}['startTimer'](_0x237b78){const _0x1f5f94=_0x56a45d,_0x447339={};_0x447339['LSKdt']=function(_0x309358,_0x2e7d27){return _0x309358>=_0x2e7d27;};const _0xfdf9a=_0x447339;this[_0x1f5f94(0x154)]['set'](_0x237b78,Date['now']()),sessionTracker[_0x1f5f94(0x215)](_0x237b78),_0xfdf9a[_0x1f5f94(0x1ca)](CURRENT_LEVEL,LOG_LEVELS['CREATOR'])&&this['trace'](_0x1f5f94(0x1f1)+_0x237b78);}[_0x56a45d(0x189)](_0xb0eab7,_0x1ae434=!![]){const _0x29910e=_0x56a45d,_0x2c7ac1={};_0x2c7ac1[_0x29910e(0x205)]=function(_0x1a2ae1,_0x44c67b){return _0x1a2ae1!==_0x44c67b;},_0x2c7ac1[_0x29910e(0x202)]='QwZaY',_0x2c7ac1[_0x29910e(0x1c5)]=function(_0xdb8299,_0x69cd8e){return _0xdb8299-_0x69cd8e;},_0x2c7ac1['OQCLr']=function(_0x2d3bd8,_0x3cc0d4){return _0x2d3bd8>=_0x3cc0d4;},_0x2c7ac1[_0x29910e(0x212)]=_0x29910e(0x1ae),_0x2c7ac1[_0x29910e(0x12f)]=_0x29910e(0x1fc);const _0xf0d2b1=_0x2c7ac1,_0x2f1b63=this[_0x29910e(0x154)]['get'](_0xb0eab7),_0x45d12f=sessionTracker[_0x29910e(0x189)](_0xb0eab7);if(_0x2f1b63){if(_0xf0d2b1[_0x29910e(0x205)](_0xf0d2b1[_0x29910e(0x202)],_0xf0d2b1[_0x29910e(0x202)]))this[_0x29910e(0x1e2)][_0x29910e(0x22d)](_0x499728)[_0x29910e(0x1e4)]++;else{const _0x1ad877=_0xf0d2b1['bVNwK'](Date[_0x29910e(0x136)](),_0x2f1b63);this[_0x29910e(0x154)][_0x29910e(0x1ab)](_0xb0eab7);if(_0x1ae434&&_0xf0d2b1[_0x29910e(0x223)](CURRENT_LEVEL,LOG_LEVELS[_0x29910e(0x230)])){if(_0xf0d2b1[_0x29910e(0x205)](_0xf0d2b1[_0x29910e(0x212)],_0xf0d2b1[_0x29910e(0x12f)]))this[_0x29910e(0x1a2)](_0xb0eab7,_0x1ad877);else{const _0x19f8ad=_0x2a3554['now']()-_0x400153;return this['performance'][_0x29910e(0x1d2)][_0x29910e(0x1ab)](_0x2394d3),_0x19f8ad;}}return _0x1ad877;}}return _0x45d12f;}[_0x56a45d(0x1ec)](){return sessionTracker['getStats']();}static[_0x56a45d(0x211)](){const _0xba82bf=_0x56a45d,_0x15bbf5={};_0x15bbf5[_0xba82bf(0x1b8)]=_0xba82bf(0x21d),_0x15bbf5[_0xba82bf(0x14c)]='DEVELOPER',_0x15bbf5['JfGLk']=function(_0x1a6a1c,_0x19584b){return _0x1a6a1c===_0x19584b;},_0x15bbf5['LUVgE']=_0xba82bf(0x234),_0x15bbf5[_0xba82bf(0x20a)]=function(_0x38a38e,_0x9a4bcb){return _0x38a38e===_0x9a4bcb;},_0x15bbf5[_0xba82bf(0x1d5)]='ARPcs',_0x15bbf5[_0xba82bf(0x1ba)]=_0xba82bf(0x1d9),_0x15bbf5['vSIQv']=_0xba82bf(0x199),_0x15bbf5[_0xba82bf(0x17a)]=function(_0x6fb8a6,_0x2bb9f5){return _0x6fb8a6>=_0x2bb9f5;},_0x15bbf5[_0xba82bf(0x1a9)]=function(_0x3bcd55,_0x140b19){return _0x3bcd55===_0x140b19;},_0x15bbf5[_0xba82bf(0x21f)]='FULL',_0x15bbf5[_0xba82bf(0x164)]=function(_0x31be13,_0x3ef1d9){return _0x31be13===_0x3ef1d9;},_0x15bbf5[_0xba82bf(0x159)]=_0xba82bf(0x193),_0x15bbf5[_0xba82bf(0x1b1)]=_0xba82bf(0x1d8),_0x15bbf5[_0xba82bf(0x1ce)]='💡\x20Remove\x20--debug\x20for\x20clean\x20public\x20mode';const _0x477b4a=_0x15bbf5,_0x4c9119=[_0x477b4a['WQPsQ'],_0x477b4a[_0xba82bf(0x14c)],_0xba82bf(0x1a4)],_0xaafd84=_0x4c9119[CURRENT_LEVEL];if(_0x477b4a[_0xba82bf(0x1bc)](CURRENT_LEVEL,LOG_LEVELS[_0xba82bf(0x21d)]))consola['info'](_0x477b4a[_0xba82bf(0x16d)]);else{if(_0x477b4a[_0xba82bf(0x20a)](_0x477b4a[_0xba82bf(0x1d5)],_0x477b4a[_0xba82bf(0x1ba)]))return _0xfb7e86[_0xba82bf(0x192)]();else consola[_0xba82bf(0x180)]({'title':_0x477b4a[_0xba82bf(0x1d4)],'message':['📊\x20Mode:\x20'+_0xaafd84,_0xba82bf(0x1fe)+sessionTracker['sessionId'],_0xba82bf(0x18a)+(_0x477b4a['VbVhr'](CURRENT_LEVEL,LOG_LEVELS[_0xba82bf(0x1a4)])?'ON':'OFF'),_0xba82bf(0x173)+(_0x477b4a[_0xba82bf(0x1a9)](CURRENT_LEVEL,LOG_LEVELS[_0xba82bf(0x21d)])?_0x477b4a[_0xba82bf(0x21f)]:_0x477b4a[_0xba82bf(0x164)](CURRENT_LEVEL,LOG_LEVELS['DEVELOPER'])?_0xba82bf(0x200):_0x477b4a['MKpzS']),_0xba82bf(0x16e)+(CURRENT_LEVEL>=LOG_LEVELS[_0xba82bf(0x230)]?'ON':_0x477b4a[_0xba82bf(0x159)]),'',CURRENT_LEVEL===LOG_LEVELS[_0xba82bf(0x230)]?_0x477b4a['WLjzY']:_0x477b4a['moTJz']][_0xba82bf(0x232)]('\x0a')});}}}function _0x1c2d(){const _0xba9e8=['C3rHCNruAw1L','EMv0zLm','qvn0tLq','ChvZAa','CMvJDxjZAxzL','wKXtvge','w0rfvKLdrs1jrf0','zxjYB3i','C2L6zq','DwLuwKO','nJG3ndG5vePcs1vU','8j+uPYbtzxnZAw9UoIa','C2v0','uefsveLbta','ugPYr1K','s1PQA1G','ANzvsMm','ugv1AeW','teHfuwi','rgv2AwnLigvYCM9Y','EuXwz0m','mNWZFdr8mhWX','tuvADe4','AKfdDvm','rgv2AwnLigrPC2nVBM5Ly3rLza','w0Lqluferfjfu1nD','8j+tSsa','zufHvgO','B2Liv0i','tfHhDeG','C2HVD1n0yxj0Dxbcyw5Uzxi','ALHnvw4','z2v0twvTB3j5vxnHz2u','u2zvrKy','C3rHCNruAw1LCG','ywP5zgG','ndCWodjcvMXqqK8','yxjNCW','DuTHwfq','tNDJt2K','DgvZDa','CKDQrKi','ufvcteLd','igrPC2nVBM5Ly3rLza','CeLetKS','mJG3ngjWsM5pwa','xcqM','Bg9N','t1fdthi','wxbrwMC','Awn0AwG','weLWqLe','wgHwB0O','vK56rg8','wKvmwLy','zgLZy29UBMvJDa','De1WDgi','zhvYyxrPB24','z2v0','qwLvDwe','ALHNAxG','revwruXpuevs','BLzfChu','AM9PBG','r29PweG','8j+AGcbezxzPy2vSEsbZDgfYDgLUzY4UlG','C3vJy2vZCW','BwvZC2fNzq','DNDVCxi','DxvPza','BwTKAxi','txjnB3e','CgrVr2i','DxP5u1K','t0XRufa','tuiGlYa','D2rYq1y','Bg9NrgLY','yvrmDuW','ugDKB2O','sgvdvMi','CLfPz1u','Bw9KDwXL','BM93','sfH6yuq','zg9ty0u','mtjMExjWr1q','vwvPBem','CNnZ','4PQG77Ipica','w1jfrefdvevexq','ALvkt2W','mJi0nJC2wMrJBvb3','qNjXANy','8j+tSsbB','ugvYzM9YBwfUy2uGBwv0CMLJoIa','y29TBwfUzhm','D2vUCeW','vNLZBuK','BwvTB3j5x2HLyxbFDxnLza','y2n6D0S','r29Yv1C','Avbbvhi','Aw5MBW','zgvIDwC','Cuvhzhi','C3bSAxq','Aw5PDgLHBgL6zq','wuvgCKK','z1fIAKu','Cgf0Aa','teLty0G','DLLUq1y','DgLTzxjZ','tvLpu0K','BwvTB3j5','Ahr0Ca','4P2mierLDMLJzsbLCNjVCJOG','tuTWELm','q0PvAfC','8j+sVIbnzw1VCNK6ia','8j+tSsbfEgvJDxrPBMCG','yxbWzw5KrMLSzq','CuT1Bum','Aw5JBhvKzxm','mtu4ohroyK5SAq','BxmP','vxD0Dwy','EvvpvM4','wu9sqKy','zgv2AwnLBhKTBwfPBI5SB2C','zgv2zwXVCg1LBNq','BMv0D29YAW','C2vZC2LVBNm','tuiP','y29UC29Syq','C3Hevxe','tuiGkfjtuZOG','tfvwz0u','8j+tGsbgAwXLigXVz2DPBMC6ia','Bej6vLa','8j+mKca','yKfKt0m','tg9Nz2vY','8j+uKIbeyxrHihjLzgfJDgLVBJOG','CND2C04','s1DNueW','CgXHDgzVCM0','C2vJDxjPDhK','y1HXD2y','u0PStuq','vMjwAhi','sufhzvi','rgv2AwnLBhLmB2DNzxi','ywXIwMi','Aw5PDfbYB21PC2u','iokgKIa','yM94','s2LxqNy','D2fYBG','sffZwuS','lI4VlI4VBg9NCW','swTKweG','wLbmrxy','DwrPza','nJi4mdCWEgHRsNLl','zw5KvgLTzxi','8j+sVIbnzw1VCNKGDhjHy2TPBMC6ia','ovjbsuH3vq','yLzRsuW','EgnetNa','Cg9YDa','yKvQCfO','Dhj1zq','C2vZC2LVBKLK','z2v0u3rHDhm','t0zg','C2XPy2u','DhjHy2u','C2vZC2LVBLrYywnRzxi','C3rYAw5NAwz5','ntjUuNDeAwm','8j+AGcbezxzPy2vSEsbbzhzHBMnLzcbmB2DNAw5Nifn5C3rLBq','y29VCMrPBMf0zxm','te9hx0XfvKvmuW','ufvVtva','v2HAAeS','rg50r3q','v2r6vvO','AgvHCfrVDgfS','Dg9ju09tDhjPBMC','CgvYzM9YBwfUy2u','CMvKDwnL','q1jfqvrpuG','lI4U','suPruhC','se1rsMu','Eg9Zzhu','B2PuCNy','DMfZrfq','zgvSzxrL','z01qt1u','rLvmta','qLHWDNe','mJrvBKfyA2O','8j+uJsbB','v0XQELK','4PYfienVBM5Ly3rLzcb0BYa','ywrKrgv2AwnL','weHQA1a','wu9nq1i','DfnhrfO','qKLpyMq','v1fqC1e','q29TBwfUzdOG','y2HjvNC','qLnMANG','sMzhtgS','sfvmwMS','C3rHy2S','y29TBwfUza','BwvTB3j5x3jZCW','ls1KzxyTBw9Kzq','zgLODMG','FI9BlI4Uxq','sfruucbszxf1zxn0','yLzoD0S','zhbxt3q','ruflCLe','yxjNDG','CM91BMq','tfnlzhq','y29UBMvJDa','CMvWBgfJzq','zxHWB3j0CW','Bw9usNO','zgv2AwnL','y1jor0m','tvfMwgS','DgLTAw5N','rgv2AwnLignVBM5Ly3rLza','DLnjuxy','sNr2wKi','EwTSvw8','Ag9TzvbHDgG','8j+sOsbvC2uGls1KzxyTBw9KzsbMB3iGzNvSBcbJCMvHDg9YigXVz2DPBMC','D0PXvgS','mJb4r2nmAKK','CfDJEMW','vhH4qK8','zxb6ANm','mJa0nJa3n1PyAejhza','t0rQtwW','ndKWnJq0oezKChPdBW','qvH4A1m','zgv2AwnLCW','Ee55wxq','y29TBwfUzenVDw50','C2PSwhy','tMnrtfO','zgf0yq','yxPhEhq','BgvUz3rO','8j+uKIbBu0vdvvjjvfLDwW','A3rUBvO','z2v0u2vZC2LVBLn0yxrZ','EMfbwum','suDWyMy','ALPurMm','BLL4zuS','vgLTzxiGC3rHCNrLzdOG','AgvHCfvZzwq'];_0x1c2d=function(){return _0xba9e8;};return _0x1c2d();}DevicelyLogger[_0x56a45d(0x211)]();const _0x5dace4={};_0x5dace4[_0x56a45d(0x17c)]=DevicelyLogger,_0x5dace4[_0x56a45d(0x19b)]=LOG_LEVELS,_0x5dace4['CURRENT_LEVEL']=CURRENT_LEVEL,_0x5dace4[_0x56a45d(0x196)]=sessionTracker,_0x5dace4[_0x56a45d(0x172)]=DevicelyLogger,module[_0x56a45d(0x1cd)]=_0x5dace4;
1
+ /**
2
+ * Devicely Advanced Logging System v2.0
3
+ * 3-Tier Logging: Public → Developer → Creator
4
+ * Technologies: Consola + Custom Analytics + File Logging
5
+ * Security: Built-in sensitive data redaction
6
+ */
7
+
8
+ const consola = require('consola');
9
+ const { v4: uuidv4 } = require('uuid');
10
+ const fs = require('fs').promises;
11
+ const path = require('path');
12
+ const os = require('os');
13
+
14
+ // ============================================================================
15
+ // LOGGING LEVELS & MODES
16
+ // ============================================================================
17
+
18
+ const LOG_LEVELS = {
19
+ PUBLIC: 0, // Clean user experience only
20
+ DEVELOPER: 1, // --debug flag
21
+ CREATOR: 2 // --dev-mode or CREATOR_MODE=true
22
+ };
23
+
24
+ const CURRENT_LEVEL = (() => {
25
+ if (process.env.CREATOR_MODE === 'true' || process.argv.includes('--dev-mode')) {
26
+ return LOG_LEVELS.CREATOR;
27
+ }
28
+ if (process.argv.includes('--debug') || process.env.DEBUG === 'true' || process.env.NODE_ENV === 'development') {
29
+ return LOG_LEVELS.DEVELOPER;
30
+ }
31
+ return LOG_LEVELS.PUBLIC;
32
+ })();
33
+
34
+ // ============================================================================
35
+ // SENSITIVE DATA REDACTION
36
+ // ============================================================================
37
+
38
+ const SENSITIVE_PATTERNS = {
39
+ // Device identifiers
40
+ udid: /([a-fA-F0-9]{8}-[a-fA-F0-9]{16})/g,
41
+ serial: /([A-Z0-9]{10,})/g,
42
+
43
+ // Network & Auth
44
+ token: /(token|auth|key|secret|password)/i,
45
+ ip: /(\b(?:[0-9]{1,3}\.){3}[0-9]{1,3}\b)/g,
46
+ port: /(localhost:\d+|127\.0\.0\.1:\d+)/g,
47
+
48
+ // Paths & URLs
49
+ homePath: new RegExp(os.homedir().replace(/[.*+?^${}()|[\]\\]/g, '\\$&'), 'g'),
50
+
51
+ // Command data
52
+ coordinates: /("x":\d+,"y":\d+)/g,
53
+ };
54
+
55
+ function redactSensitiveData(data, level = CURRENT_LEVEL) {
56
+ if (level === LOG_LEVELS.CREATOR) return data; // No redaction for creator
57
+
58
+ let str = typeof data === 'object' ? JSON.stringify(data, null, 2) : String(data);
59
+
60
+ if (level === LOG_LEVELS.PUBLIC) {
61
+ // Heavy redaction for public
62
+ str = str.replace(SENSITIVE_PATTERNS.udid, '[DEVICE-ID]');
63
+ str = str.replace(SENSITIVE_PATTERNS.ip, '[IP-ADDRESS]');
64
+ str = str.replace(SENSITIVE_PATTERNS.port, '[ENDPOINT]');
65
+ str = str.replace(SENSITIVE_PATTERNS.homePath, '[USER-PATH]');
66
+ str = str.replace(SENSITIVE_PATTERNS.coordinates, '"x":[X],"y":[Y]');
67
+ } else if (level === LOG_LEVELS.DEVELOPER) {
68
+ // Partial redaction for developers
69
+ str = str.replace(SENSITIVE_PATTERNS.udid, (match) => `${match.slice(0, 8)}...${match.slice(-4)}`);
70
+ str = str.replace(SENSITIVE_PATTERNS.homePath, '~/[...]');
71
+ }
72
+
73
+ return str;
74
+ }
75
+
76
+ // ============================================================================
77
+ // SESSION & PERFORMANCE TRACKING
78
+ // ============================================================================
79
+
80
+ class SessionTracker {
81
+ constructor() {
82
+ this.sessionId = uuidv4().split('-')[0];
83
+ this.startTime = Date.now();
84
+ this.devices = new Map();
85
+ this.commands = [];
86
+ this.performance = {
87
+ memory: [],
88
+ timing: new Map()
89
+ };
90
+ }
91
+
92
+ addDevice(deviceId, deviceInfo) {
93
+ this.devices.set(deviceId, {
94
+ ...deviceInfo,
95
+ connectedAt: Date.now(),
96
+ commandCount: 0
97
+ });
98
+ }
99
+
100
+ addCommand(deviceId, command, duration) {
101
+ const cmd = {
102
+ deviceId,
103
+ command,
104
+ duration,
105
+ timestamp: Date.now(),
106
+ sessionTime: Date.now() - this.startTime
107
+ };
108
+ this.commands.push(cmd);
109
+
110
+ if (this.devices.has(deviceId)) {
111
+ this.devices.get(deviceId).commandCount++;
112
+ }
113
+ }
114
+
115
+ startTimer(label) {
116
+ this.performance.timing.set(label, Date.now());
117
+ }
118
+
119
+ endTimer(label) {
120
+ const start = this.performance.timing.get(label);
121
+ if (start) {
122
+ const duration = Date.now() - start;
123
+ this.performance.timing.delete(label);
124
+ return duration;
125
+ }
126
+ return 0;
127
+ }
128
+
129
+ getMemoryUsage() {
130
+ const usage = process.memoryUsage();
131
+ const memInfo = {
132
+ rss: Math.round(usage.rss / 1024 / 1024), // MB
133
+ heapUsed: Math.round(usage.heapUsed / 1024 / 1024),
134
+ heapTotal: Math.round(usage.heapTotal / 1024 / 1024),
135
+ external: Math.round(usage.external / 1024 / 1024),
136
+ timestamp: Date.now()
137
+ };
138
+ this.performance.memory.push(memInfo);
139
+ return memInfo;
140
+ }
141
+
142
+ getStats() {
143
+ return {
144
+ sessionId: this.sessionId,
145
+ uptime: Date.now() - this.startTime,
146
+ deviceCount: this.devices.size,
147
+ totalCommands: this.commands.length,
148
+ avgCommandTime: this.commands.length ?
149
+ this.commands.reduce((sum, cmd) => sum + cmd.duration, 0) / this.commands.length : 0,
150
+ currentMemory: this.getMemoryUsage()
151
+ };
152
+ }
153
+ }
154
+
155
+ const sessionTracker = new SessionTracker();
156
+
157
+ // ============================================================================
158
+ // FILE LOGGING SYSTEM
159
+ // ============================================================================
160
+
161
+ class FileLogger {
162
+ constructor() {
163
+ this.logDir = path.join(__dirname, '../../logs');
164
+ this.initPromise = this.initialize();
165
+ }
166
+
167
+ async initialize() {
168
+ try {
169
+ await fs.mkdir(this.logDir, { recursive: true });
170
+ await fs.mkdir(path.join(this.logDir, 'devices'), { recursive: true });
171
+ await fs.mkdir(path.join(this.logDir, 'sessions'), { recursive: true });
172
+ await fs.mkdir(path.join(this.logDir, 'performance'), { recursive: true });
173
+ } catch (error) {
174
+ // Continue without file logging if directory creation fails
175
+ }
176
+ }
177
+
178
+ async log(category, level, message, data = {}) {
179
+ if (CURRENT_LEVEL < LOG_LEVELS.DEVELOPER) return;
180
+
181
+ await this.initPromise;
182
+
183
+ const logEntry = {
184
+ timestamp: new Date().toISOString(),
185
+ sessionId: sessionTracker.sessionId,
186
+ level,
187
+ category,
188
+ message,
189
+ data: CURRENT_LEVEL >= LOG_LEVELS.CREATOR ? data : redactSensitiveData(data, CURRENT_LEVEL)
190
+ };
191
+
192
+ const logLine = JSON.stringify(logEntry) + '\n';
193
+
194
+ try {
195
+ // Write to main log
196
+ const mainLogFile = path.join(this.logDir, 'devicely-main.log');
197
+ await fs.appendFile(mainLogFile, logLine);
198
+
199
+ // Write to category-specific log
200
+ if (category) {
201
+ const categoryLogFile = path.join(this.logDir, `${category}.log`);
202
+ await fs.appendFile(categoryLogFile, logLine);
203
+ }
204
+ } catch (error) {
205
+ // Silent fail if file logging doesn't work
206
+ }
207
+ }
208
+ }
209
+
210
+ const fileLogger = new FileLogger();
211
+
212
+ // ============================================================================
213
+ // ADVANCED DEVICELY LOGGER CLASS
214
+ // ============================================================================
215
+
216
+ class DevicelyLogger {
217
+ constructor(module) {
218
+ this.module = module;
219
+ this.deviceLoggers = new Map();
220
+ this.timers = new Map();
221
+ }
222
+
223
+ // ========================================================================
224
+ // PUBLIC LEVEL METHODS (Always visible, user-friendly)
225
+ // ========================================================================
226
+
227
+ success(message, ...args) {
228
+ const cleanMessage = redactSensitiveData(message, LOG_LEVELS.PUBLIC);
229
+ // Don't add emoji prefix if message already contains emojis
230
+ const hasEmoji = /[\u{1F000}-\u{1F6FF}\u{1F900}-\u{1F9FF}\u{2600}-\u{26FF}\u{2700}-\u{27BF}]/u.test(message);
231
+ consola.success(hasEmoji ? cleanMessage : `✅ ${cleanMessage}`);
232
+
233
+ fileLogger.log(this.module, 'success', message, { args });
234
+ }
235
+
236
+ info(message, ...args) {
237
+ const cleanMessage = redactSensitiveData(message, LOG_LEVELS.PUBLIC);
238
+ // Don't add emoji prefix if message already contains emojis
239
+ const hasEmoji = /[\u{1F000}-\u{1F6FF}\u{1F900}-\u{1F9FF}\u{2600}-\u{26FF}\u{2700}-\u{27BF}]/u.test(message);
240
+ consola.info(hasEmoji ? cleanMessage : `📱 ${cleanMessage}`);
241
+
242
+ fileLogger.log(this.module, 'info', message, { args });
243
+ }
244
+
245
+ warn(message, ...args) {
246
+ const cleanMessage = redactSensitiveData(message, LOG_LEVELS.PUBLIC);
247
+ const cleanArgs = args.map(arg => redactSensitiveData(arg, LOG_LEVELS.PUBLIC));
248
+ // Don't add emoji prefix if message already contains emojis
249
+ const hasEmoji = /[\u{1F000}-\u{1F6FF}\u{1F900}-\u{1F9FF}\u{2600}-\u{26FF}\u{2700}-\u{27BF}]/u.test(message);
250
+ consola.warn(hasEmoji ? `${cleanMessage}` : `⚠️ ${cleanMessage}`, ...cleanArgs);
251
+
252
+ fileLogger.log(this.module, 'warn', message, { args });
253
+ }
254
+
255
+ error(message, error, ...args) {
256
+ const cleanMessage = redactSensitiveData(message, LOG_LEVELS.PUBLIC);
257
+ // Don't add emoji prefix if message already contains emojis
258
+ const hasEmoji = /[\u{1F000}-\u{1F6FF}\u{1F900}-\u{1F9FF}\u{2600}-\u{26FF}\u{2700}-\u{27BF}]/u.test(message);
259
+ consola.error(hasEmoji ? cleanMessage : `❌ ${cleanMessage}`, error?.message || error);
260
+
261
+ fileLogger.log(this.module, 'error', message, {
262
+ error: {
263
+ message: error?.message,
264
+ stack: CURRENT_LEVEL >= LOG_LEVELS.CREATOR ? error?.stack : '[REDACTED]',
265
+ name: error?.name
266
+ },
267
+ args
268
+ });
269
+ }
270
+
271
+ // ========================================================================
272
+ // DEVELOPER LEVEL METHODS (--debug flag)
273
+ // ========================================================================
274
+
275
+ debug(message, data = {}) {
276
+ if (CURRENT_LEVEL < LOG_LEVELS.DEVELOPER) return;
277
+
278
+ const cleanMessage = redactSensitiveData(message, LOG_LEVELS.DEVELOPER);
279
+ const cleanData = redactSensitiveData(data, LOG_LEVELS.DEVELOPER);
280
+
281
+ consola.debug(`🔍 [${this.module}] ${cleanMessage}`, cleanData);
282
+ fileLogger.log(this.module, 'debug', message, { data });
283
+ }
284
+
285
+ command(deviceId, command, data = {}, duration = null) {
286
+ if (duration) {
287
+ sessionTracker.addCommand(deviceId, command, duration);
288
+ }
289
+
290
+ const message = `Command: ${command}`;
291
+
292
+ if (CURRENT_LEVEL === LOG_LEVELS.PUBLIC) {
293
+ consola.info(`📱 Executing ${command}`);
294
+ } else if (CURRENT_LEVEL === LOG_LEVELS.DEVELOPER) {
295
+ const cleanData = redactSensitiveData(data, LOG_LEVELS.DEVELOPER);
296
+ const deviceDisplay = redactSensitiveData(deviceId, LOG_LEVELS.DEVELOPER);
297
+ consola.info(`📱 [${deviceDisplay}] ${command}${duration ? ` (${duration}ms)` : ''}`, cleanData);
298
+ } else {
299
+ // Creator mode - full details
300
+ consola.info(`📱 [${deviceId}] ${command}${duration ? ` (${duration}ms)` : ''}`, data);
301
+ }
302
+
303
+ fileLogger.log('device', 'command', message, {
304
+ command,
305
+ data,
306
+ duration,
307
+ deviceId: CURRENT_LEVEL >= LOG_LEVELS.CREATOR ? deviceId : redactSensitiveData(deviceId, CURRENT_LEVEL)
308
+ });
309
+ }
310
+
311
+ network(method, url, statusCode, data = {}, duration = null) {
312
+ if (CURRENT_LEVEL < LOG_LEVELS.DEVELOPER) return;
313
+
314
+ const cleanUrl = redactSensitiveData(url, CURRENT_LEVEL);
315
+ const message = `${method} ${cleanUrl} → ${statusCode}`;
316
+
317
+ if (statusCode >= 400) {
318
+ consola.error(`🌐 ${message}${duration ? ` (${duration}ms)` : ''}`);
319
+ } else {
320
+ consola.debug(`🌐 ${message}${duration ? ` (${duration}ms)` : ''}`);
321
+ }
322
+
323
+ fileLogger.log('network', 'http', 'HTTP Request', {
324
+ method,
325
+ url: CURRENT_LEVEL >= LOG_LEVELS.CREATOR ? url : cleanUrl,
326
+ statusCode,
327
+ duration,
328
+ data: CURRENT_LEVEL >= LOG_LEVELS.CREATOR ? data : redactSensitiveData(data, CURRENT_LEVEL)
329
+ });
330
+ }
331
+
332
+ // ========================================================================
333
+ // CREATOR LEVEL METHODS (Full system visibility)
334
+ // ========================================================================
335
+
336
+ trace(message, data = {}) {
337
+ if (CURRENT_LEVEL < LOG_LEVELS.CREATOR) return;
338
+
339
+ consola.debug(`🔧 [TRACE][${this.module}] ${message}`, data);
340
+ fileLogger.log(this.module, 'trace', message, { data });
341
+ }
342
+
343
+ security(event, details = {}) {
344
+ if (CURRENT_LEVEL < LOG_LEVELS.CREATOR) return;
345
+
346
+ consola.warn(`🔒 [SECURITY][${this.module}] ${event}`, details);
347
+ fileLogger.log('security', 'security', event, { details });
348
+ }
349
+
350
+ performance(metric, value, unit = 'ms') {
351
+ if (CURRENT_LEVEL >= LOG_LEVELS.DEVELOPER) {
352
+ consola.debug(`📊 ${metric}: ${value}${unit}`);
353
+ }
354
+
355
+ fileLogger.log('performance', 'metric', `Performance metric: ${metric}`, {
356
+ metric,
357
+ value,
358
+ unit,
359
+ timestamp: Date.now(),
360
+ sessionId: sessionTracker.sessionId
361
+ });
362
+ }
363
+
364
+ memory() {
365
+ if (CURRENT_LEVEL < LOG_LEVELS.CREATOR) return;
366
+
367
+ const usage = sessionTracker.getMemoryUsage();
368
+ consola.debug(`💾 Memory: ${usage.heapUsed}MB / ${usage.heapTotal}MB (RSS: ${usage.rss}MB)`);
369
+
370
+ this.performance('memory_heap_used', usage.heapUsed, 'MB');
371
+ this.performance('memory_rss', usage.rss, 'MB');
372
+ }
373
+
374
+ // ========================================================================
375
+ // DEVICE-SPECIFIC LOGGING
376
+ // ========================================================================
377
+
378
+ device(deviceId, deviceInfo = null) {
379
+ if (deviceInfo) {
380
+ sessionTracker.addDevice(deviceId, deviceInfo);
381
+ }
382
+
383
+ return {
384
+ connect: (info) => {
385
+ if (CURRENT_LEVEL === LOG_LEVELS.PUBLIC) {
386
+ consola.success(`✅ Connected to ${info.platform || 'device'}-${deviceId.slice(-5)}`);
387
+ } else if (CURRENT_LEVEL === LOG_LEVELS.DEVELOPER) {
388
+ const cleanDeviceId = redactSensitiveData(deviceId, CURRENT_LEVEL);
389
+ consola.success(`✅ Connected to ${cleanDeviceId}`, redactSensitiveData(info, CURRENT_LEVEL));
390
+ } else {
391
+ consola.success(`✅ Connected to ${deviceId}`, info);
392
+ }
393
+
394
+ fileLogger.log('device', 'connect', 'Device connected', {
395
+ deviceId: CURRENT_LEVEL >= LOG_LEVELS.CREATOR ? deviceId : redactSensitiveData(deviceId, CURRENT_LEVEL),
396
+ info
397
+ });
398
+ },
399
+
400
+ disconnect: () => {
401
+ if (CURRENT_LEVEL === LOG_LEVELS.PUBLIC) {
402
+ consola.info(`📱 Device disconnected`);
403
+ } else {
404
+ const cleanDeviceId = redactSensitiveData(deviceId, CURRENT_LEVEL);
405
+ consola.info(`📱 ${cleanDeviceId} disconnected`);
406
+ }
407
+
408
+ fileLogger.log('device', 'disconnect', 'Device disconnected', {
409
+ deviceId: CURRENT_LEVEL >= LOG_LEVELS.CREATOR ? deviceId : redactSensitiveData(deviceId, CURRENT_LEVEL)
410
+ });
411
+ },
412
+
413
+ error: (message, error) => {
414
+ const cleanMessage = redactSensitiveData(message, LOG_LEVELS.PUBLIC);
415
+ consola.error(`❌ Device error: ${cleanMessage}`, error?.message || error);
416
+
417
+ fileLogger.log('device', 'error', 'Device error', {
418
+ message,
419
+ error: {
420
+ message: error?.message,
421
+ stack: CURRENT_LEVEL >= LOG_LEVELS.CREATOR ? error?.stack : '[REDACTED]'
422
+ },
423
+ deviceId: CURRENT_LEVEL >= LOG_LEVELS.CREATOR ? deviceId : redactSensitiveData(deviceId, CURRENT_LEVEL)
424
+ });
425
+ }
426
+ };
427
+ }
428
+
429
+ // ========================================================================
430
+ // PERFORMANCE TIMING
431
+ // ========================================================================
432
+
433
+ startTimer(label) {
434
+ this.timers.set(label, Date.now());
435
+ sessionTracker.startTimer(label);
436
+
437
+ if (CURRENT_LEVEL >= LOG_LEVELS.CREATOR) {
438
+ this.trace(`Timer started: ${label}`);
439
+ }
440
+ }
441
+
442
+ endTimer(label, logResult = true) {
443
+ const startTime = this.timers.get(label);
444
+ const sessionDuration = sessionTracker.endTimer(label);
445
+
446
+ if (startTime) {
447
+ const duration = Date.now() - startTime;
448
+ this.timers.delete(label);
449
+
450
+ if (logResult && CURRENT_LEVEL >= LOG_LEVELS.DEVELOPER) {
451
+ this.performance(label, duration);
452
+ }
453
+
454
+ return duration;
455
+ }
456
+ return sessionDuration;
457
+ }
458
+
459
+ // ========================================================================
460
+ // HELPER METHODS
461
+ // ========================================================================
462
+
463
+ getSessionStats() {
464
+ return sessionTracker.getStats();
465
+ }
466
+
467
+ // ========================================================================
468
+ // STARTUP BANNER
469
+ // ========================================================================
470
+
471
+ static showStartupBanner() {
472
+ const modeNames = ['PUBLIC', 'DEVELOPER', 'CREATOR'];
473
+ const currentMode = modeNames[CURRENT_LEVEL];
474
+
475
+ if (CURRENT_LEVEL === LOG_LEVELS.PUBLIC) {
476
+ consola.info('🚀 Devicely starting...');
477
+ } else {
478
+ consola.box({
479
+ title: '🚀 Devicely Advanced Logging System',
480
+ message: [
481
+ `📊 Mode: ${currentMode}`,
482
+ `🔧 Session: ${sessionTracker.sessionId}`,
483
+ `💾 Memory tracking: ${CURRENT_LEVEL >= LOG_LEVELS.CREATOR ? 'ON' : 'OFF'}`,
484
+ `🔒 Data redaction: ${CURRENT_LEVEL === LOG_LEVELS.PUBLIC ? 'FULL' : CURRENT_LEVEL === LOG_LEVELS.DEVELOPER ? 'PARTIAL' : 'OFF'}`,
485
+ `📁 File logging: ${CURRENT_LEVEL >= LOG_LEVELS.DEVELOPER ? 'ON' : 'OFF'}`,
486
+ '',
487
+ CURRENT_LEVEL === LOG_LEVELS.DEVELOPER ?
488
+ '💡 Use --dev-mode for full creator logging' :
489
+ '💡 Remove --debug for clean public mode'
490
+ ].join('\n')
491
+ });
492
+ }
493
+ }
494
+ }
495
+
496
+ // ============================================================================
497
+ // INITIALIZATION
498
+ // ============================================================================
499
+
500
+ // Show startup banner
501
+ DevicelyLogger.showStartupBanner();
502
+
503
+ // ============================================================================
504
+ // EXPORTS
505
+ // ============================================================================
506
+
507
+ module.exports = {
508
+ DevicelyLogger,
509
+ LOG_LEVELS,
510
+ CURRENT_LEVEL,
511
+ sessionTracker,
512
+
513
+ // Backward compatibility
514
+ Logger: DevicelyLogger
515
+ };