devicely 2.2.14 → 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 +1 -1
- package/lib/advanced-logger.js +515 -1
- package/lib/aiProviders.js +1 -657
- package/lib/aiProvidersConfig.js +1 -86
- package/lib/androidDeviceDetection.js +1 -1
- package/lib/appMappings.js +1 -1
- package/lib/commanderService.js +1 -1
- package/lib/deviceDetection.js +1 -1
- package/lib/devices.js +1 -1
- package/lib/doctor.js +1 -1
- package/lib/encryption.js +1 -1
- package/lib/executor.js +1 -1
- package/lib/hybridAI.js +1 -1
- package/lib/intelligentLocatorService.js +1 -1
- package/lib/lightweightAI.js +1 -1
- package/lib/localBuiltInAI.js +1 -1
- package/lib/localBuiltInAI_backup.js +1 -1
- package/lib/localBuiltInAI_simple.js +1 -1
- package/lib/locatorStrategy.js +1 -1
- package/lib/logger-demo.js +180 -1
- package/lib/logger.js +40 -1
- package/lib/quick-start-logger.js +83 -1
- package/lib/scriptLoader.js +1 -1
- package/lib/server.js +1 -1
- package/lib/tensorflowAI.js +1 -1
- package/lib/tinyAI.js +1 -1
- package/lib/universalSessionManager.js +1 -1
- package/package.json +1 -1
- package/lib/aiProviders_new.js +0 -70
package/bin/devicely.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
const _0x1ce38f=_0x4a76;function _0x5efe(){const _0x287cfd=['sgTzr2K','s3HOBgO','cVcFMOaGrgv2AwnLBhKGlsbpBMuGq29TBwfUzcWGqwXSierLDMLJzxm','zxjYB3i','wMHeAfy','zg9JDg9Y','AhbyqLO','vNvqqxK','icbKzxzPy2vSEsbKB2n0B3iGica','lI4VBgLIl2v4zwn1Dg9Y','yM9Sza','lxaSic0TCg9YDca8Cg9YDd4','iYbdAgvJAYbZExn0zw0','B3v0Chv0sgvSCa','u3rHCNqGrgv2AwnLBhKGC2vYDMvYigfUzcbVCgvUihDLyIbPBNrLCMzHy2u','nxWWFdf8nhWYFdm','odyZnZi1nwH2yvrnrW','mtK3odKWwwX1rwzX','z1rTBK8','Bg9N','vM91sve','cVcFK7eGu2nHBM5PBMCGzM9YigrLDMLJzxmUlI4','y2HHBgS','ls13AwzPlw9UBhK','rgLZCgXHEsb2zxjZAw9Uig51BwjLCG','lI4VCgfJA2fNzs5QC29U','nJK5oda0wwnTD1vW','y3LHBG','BLPyCvG','uhbjthy','B3b0Aw9U','vfvrqxi','q2HLy2SGC3LZDgvTihjLCxvPCMvTzw50CYbMB3iGAu9tigfUzcbbBMrYB2LKigf1Dg9TyxrPB24','qwvmEMu','rxHLy3v0zsbVBIbZCgvJAwzPyYbKzxzPy2u','vKvVs3C','iYbtDgfYDcb0AguGC2vYDMvY','mNzZz3Purq','BeHQsuW','DMvYC2LVBG','zgf5zeO','rgLZCgXHEsbOzwXWigLUzM9YBwf0Aw9U','CMvK','u2vYDMvYihbVCNq','rgv2AwnLBhKGlsbpBMuGq29TBwfUzcWGqwXSierLDMLJzxmUiefjifbVD2vYzwqGtw9IAwXLief1Dg9TyxrPB24','C2XPy2u','ls1Kzwj1zW','mZaWmq','mtmZmdK1nMTbq3Llta','zxHLyYa8y29TBwfUzd4','y29TBwfUza','lweSic0TywXS','rg9Uj3qGB3bLBIbICM93C2vYigf1Dg9TyxrPy2fSBhK','ndGYm3vrAeDLyq','BgLZDa','rgv0zwn0ifvtqIbKzxzPy2vZig9UBhK','mtm4sgTbt29R','lxySic0TDMvYC2LVBG','ueLXwxm','lI4VBgLIl3nLCNzLCG','mtbOv1ncu3q','D2HPDgu','zgvZy3jPChrPB24','CMvWzwf0','rw5HyMXLigrLyNvNigXVz2DPBMC','iYbmAxn0igrLDMLJzxm','rgv0zwn0ifDPrMKGzgv2AwnLCYbVBMX5','q1Hrz0O','BKjJvfe','mJm5ndmZoxfSuu9UBG','ls11C2iTB25SEq','icbKzxzPy2vSEsbZDgfYDcaGica','cUkDJcbfCNjVCJO','cVcFKQeGuxvPy2SGC3rHCNq6','qLvHrKS','ugvys00','z3jHEq','lwqSic0Tzgv2AwnLidXUyw1LpG','t1jLEMK','zxHPDa','zNHSCgi','uezqyvy','Bg15ug4','odu5mLDdvuX4qq','uxb3uKG','tgLZDcbHBgWGy29UBMvJDgvKigLpuYbHBMqGqw5KCM9PzcbKzxzPy2vZ','icbKzxzPy2vSEsbSAxn0icaGica','BwvZC2fNzq','C3rHCNq','mhW0Fdj8nxWXFdm','zMT2Bgu','lwGSic0TAgvSCa','cUkAOsbfEgvJDxrPBMCGy29TBwfUzc4UlG','rhnxDxK','rxHLy3v0zsbVBIbHBgWGzgv2AwnLCYaOzgvMyxvSDcK','ody0otbkEvPKt2K','CgfYC2u','u2HVDYbKzxrHAwXLzcbKzxzPy2uGAw5MB3jTyxrPB24','DxLnBLO','ywn0Aw9U','C3bSAxq','tef4Dxu','lI4VBgLIl2rVy3rVCG','yxjNDG'];_0x5efe=function(){return _0x287cfd;};return _0x5efe();}(function(_0x48511b,_0x59d619){const _0x4c71e3=_0x4a76,_0xea0472=_0x48511b();while(!![]){try{const _0x31aab1=parseInt(_0x4c71e3(0x82))/0x1+-parseInt(_0x4c71e3(0x96))/0x2*(parseInt(_0x4c71e3(0xb6))/0x3)+-parseInt(_0x4c71e3(0x8b))/0x4+parseInt(_0x4c71e3(0xd0))/0x5*(-parseInt(_0x4c71e3(0xa9))/0x6)+parseInt(_0x4c71e3(0xa6))/0x7*(parseInt(_0x4c71e3(0xc4))/0x8)+parseInt(_0x4c71e3(0xa1))/0x9+parseInt(_0x4c71e3(0xad))/0xa*(parseInt(_0x4c71e3(0x81))/0xb);if(_0x31aab1===_0x59d619)break;else _0xea0472['push'](_0xea0472['shift']());}catch(_0x492178){_0xea0472['push'](_0xea0472['shift']());}}}(_0x5efe,0x7a14f));const {program}=require('commander'),chalk=require(_0x1ce38f(0x87)),packageJson=require(_0x1ce38f(0x8a)),{startServer}=require(_0x1ce38f(0xac)),{listDevices}=require('../lib/devices'),{checkDoctor}=require(_0x1ce38f(0xd7)),{executeCommand}=require(_0x1ce38f(0xe2));program['name']('devicely')[_0x1ce38f(0xaf)](_0x1ce38f(0x9d))[_0x1ce38f(0x98)](packageJson['version'],_0x1ce38f(0xaa),_0x1ce38f(0x89))['helpOption'](_0x1ce38f(0xcc),_0x1ce38f(0x9a)),program[_0x1ce38f(0xa3)](_0x1ce38f(0xc9))[_0x1ce38f(0xaf)](_0x1ce38f(0x7f))[_0x1ce38f(0x8f)](_0x1ce38f(0xe4),_0x1ce38f(0x9c),_0x1ce38f(0xa0))[_0x1ce38f(0x8f)]('--no-browser',_0x1ce38f(0xa5))[_0x1ce38f(0x8f)](_0x1ce38f(0x9f),_0x1ce38f(0xb1))[_0x1ce38f(0x8f)](_0x1ce38f(0xb7),_0x1ce38f(0xa8))[_0x1ce38f(0x8f)](_0x1ce38f(0x88),_0x1ce38f(0xb3))['action'](async _0x50c60c=>{const _0xf89e47=_0x1ce38f,_0x57223a={'ZhDhV':_0xf89e47(0x80),'ORezi':_0xf89e47(0xba),'IyWCW':function(_0x766d5e,_0x35ff30){return _0x766d5e+_0x35ff30;},'bxTBH':_0xf89e47(0xb8),'PIqYs':_0xf89e47(0x95),'PeXKM':_0xf89e47(0xe1),'daydJ':_0xf89e47(0x7d),'hXbIN':function(_0x1d8755,_0x2bcac2){return _0x1d8755+_0x2bcac2;},'VouIQ':_0xf89e47(0xc7),'QpwRH':'\x0a❌\x20Error:','Kxhlj':_0xf89e47(0xbb),'fxlpb':_0xf89e47(0xdb),'PFPaV':'\x20\x20\x20AI\x20Powered\x20Mobile\x20Automation','PpILv':function(_0x70a083,_0x256c36){return _0x70a083(_0x256c36);},'AeLze':function(_0x40da16,_0x28a086){return _0x40da16===_0x28a086;},'TUQAr':_0xf89e47(0xcb),'uyMnZ':'nsoxh'};try{if(_0x57223a[_0xf89e47(0xda)]!==_0xf89e47(0xd6))console[_0xf89e47(0x84)](chalk[_0xf89e47(0x8c)]['bold'](_0x57223a[_0xf89e47(0xc1)])),console['log'](chalk[_0xf89e47(0xbd)](_0x57223a[_0xf89e47(0xc2)])),console[_0xf89e47(0x84)](chalk[_0xf89e47(0xbd)]('━'[_0xf89e47(0xb0)](0x32))),await _0x57223a[_0xf89e47(0x8e)](startServer,_0x50c60c);else{const _0x5ec1f6=_0x57223a[_0xf89e47(0xdd)][_0xf89e47(0xd5)]('|');let _0x4f4ce2=0x0;while(!![]){switch(_0x5ec1f6[_0x4f4ce2++]){case'0':_0x1ac97f[_0xf89e47(0x84)](_0x8d1c80[_0xf89e47(0x8c)](_0x57223a[_0xf89e47(0xbf)]));continue;case'1':_0x242fe2[_0xf89e47(0x84)](_0x57223a['IyWCW'](_0x41bfe6[_0xf89e47(0xbd)](_0x57223a['bxTBH']),_0x53dade[_0xf89e47(0xae)](_0x57223a[_0xf89e47(0xab)])));continue;case'2':_0x5b80e8['log'](_0x3a882d[_0xf89e47(0xbd)](_0x57223a[_0xf89e47(0xbc)])+_0x46145a[_0xf89e47(0xae)](_0x57223a[_0xf89e47(0x99)]));continue;case'3':_0x2582e9[_0xf89e47(0x84)]('');continue;case'4':_0x3d2064[_0xf89e47(0x84)](_0x57223a['hXbIN'](_0x5145d0['gray'](_0x57223a[_0xf89e47(0x85)]),_0x2aeaa5['white']('#\x20List\x20devices')));continue;case'5':_0x58d046[_0xf89e47(0x7e)]();continue;}break;}}}catch(_0x47ef57){_0x57223a[_0xf89e47(0x92)](_0x57223a[_0xf89e47(0x90)],_0x57223a[_0xf89e47(0xd3)])?(_0x3f3c13[_0xf89e47(0xdc)](_0x1dcf44[_0xf89e47(0x9b)](_0x57223a[_0xf89e47(0xc5)]),_0x634cf4[_0xf89e47(0xc8)]),_0x402979[_0xf89e47(0xc0)](0x1)):(console[_0xf89e47(0xdc)](chalk[_0xf89e47(0x9b)](_0x57223a['QpwRH']),_0x47ef57[_0xf89e47(0xc8)]),process[_0xf89e47(0xc0)](0x1));}}),program[_0x1ce38f(0xa3)](_0x1ce38f(0xa7))[_0x1ce38f(0xaf)](_0x1ce38f(0xc6))['option']('-v,\x20--verbose',_0x1ce38f(0xd2))[_0x1ce38f(0xd4)](async _0x3789a3=>{const _0x419c7b=_0x1ce38f,_0x42b47e={'nZXqX':function(_0x583193,_0x47a601){return _0x583193!==_0x47a601;},'nBcTQ':_0x419c7b(0xb4),'SvgrD':_0x419c7b(0x86),'pTAsX':function(_0x140a20,_0x4b8cd6){return _0x140a20(_0x4b8cd6);},'nEUVd':'\x0a❌\x20Error:'};try{_0x42b47e[_0x419c7b(0x8d)](_0x42b47e[_0x419c7b(0xb5)],_0x419c7b(0xb4))?(_0x4bab7c[_0x419c7b(0xdc)](_0x20e37b[_0x419c7b(0x9b)](_0x419c7b(0xb9)),_0x174a50[_0x419c7b(0xc8)]),_0x3dc202['exit'](0x1)):(console[_0x419c7b(0x84)](chalk[_0x419c7b(0x8c)][_0x419c7b(0xe3)](_0x42b47e['SvgrD'])),console[_0x419c7b(0x84)](chalk['gray']('━'[_0x419c7b(0xb0)](0x32))),await _0x42b47e['pTAsX'](listDevices,_0x3789a3));}catch(_0xf77757){console[_0x419c7b(0xdc)](chalk['red'](_0x42b47e['nEUVd']),_0xf77757[_0x419c7b(0xc8)]),process[_0x419c7b(0xc0)](0x1);}}),program['command'](_0x1ce38f(0xde))[_0x1ce38f(0xaf)](_0x1ce38f(0x91))['action'](async()=>{const _0x5ed13c=_0x1ce38f,_0x4d9d1f={};_0x4d9d1f['VEoKw']='\x0a🔍\x20Checking\x20system\x20requirements...',_0x4d9d1f[_0x5ed13c(0xce)]=_0x5ed13c(0xb9);const _0x3fd029=_0x4d9d1f;try{console[_0x5ed13c(0x84)](chalk[_0x5ed13c(0x8c)]['bold'](_0x3fd029[_0x5ed13c(0x94)])),console[_0x5ed13c(0x84)](chalk[_0x5ed13c(0xbd)]('━'[_0x5ed13c(0xb0)](0x32))),await checkDoctor();}catch(_0x199829){console[_0x5ed13c(0xdc)](chalk['red'](_0x3fd029[_0x5ed13c(0xce)]),_0x199829[_0x5ed13c(0xc8)]),process['exit'](0x1);}}),program[_0x1ce38f(0xa3)](_0x1ce38f(0xa2))[_0x1ce38f(0xaf)]('Execute\x20command\x20on\x20connected\x20iOS/Android\x20devices')['option'](_0x1ce38f(0xbe),_0x1ce38f(0x93))[_0x1ce38f(0x8f)](_0x1ce38f(0xa4),_0x1ce38f(0xcf))[_0x1ce38f(0xd4)](async(_0x577e11,_0x1ed1cb)=>{const _0x34ef4b=_0x1ce38f,_0x5e40dc={};_0x5e40dc['lHjIL']=_0x34ef4b(0xb9),_0x5e40dc['hpXBZ']=_0x34ef4b(0x83),_0x5e40dc[_0x34ef4b(0xd9)]=_0x34ef4b(0xc3),_0x5e40dc['VuPAy']=_0x34ef4b(0xcd);const _0x1f1799=_0x5e40dc;try{_0x1f1799[_0x34ef4b(0xdf)]!==_0x1f1799[_0x34ef4b(0xd9)]?(console[_0x34ef4b(0x84)](chalk[_0x34ef4b(0x8c)][_0x34ef4b(0xe3)](_0x1f1799[_0x34ef4b(0xe0)])),console[_0x34ef4b(0x84)](chalk[_0x34ef4b(0xbd)]('━'[_0x34ef4b(0xb0)](0x32))),await executeCommand(_0x577e11,_0x1ed1cb)):(_0x211923[_0x34ef4b(0xdc)](_0x54e042[_0x34ef4b(0x9b)](DLREjM[_0x34ef4b(0x97)]),_0xd2f1f6['message']),_0x1777b1[_0x34ef4b(0xc0)](0x1));}catch(_0x4b0580){console[_0x34ef4b(0xdc)](chalk['red'](_0x1f1799[_0x34ef4b(0x97)]),_0x4b0580[_0x34ef4b(0xc8)]),process[_0x34ef4b(0xc0)](0x1);}}),program[_0x1ce38f(0xd1)](process[_0x1ce38f(0xd8)]);function _0x4a76(_0x2990ca,_0x2af03b){_0x2990ca=_0x2990ca-0x7d;const _0x5efe9b=_0x5efe();let _0x4a76f2=_0x5efe9b[_0x2990ca];if(_0x4a76['lvIYJF']===undefined){var _0x5d2de7=function(_0x23c561){const _0x6fc38f='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x4402a3='',_0x417ed3='';for(let _0x31f08a=0x0,_0x3a8e81,_0x3f3c13,_0x1dcf44=0x0;_0x3f3c13=_0x23c561['charAt'](_0x1dcf44++);~_0x3f3c13&&(_0x3a8e81=_0x31f08a%0x4?_0x3a8e81*0x40+_0x3f3c13:_0x3f3c13,_0x31f08a++%0x4)?_0x4402a3+=String['fromCharCode'](0xff&_0x3a8e81>>(-0x2*_0x31f08a&0x6)):0x0){_0x3f3c13=_0x6fc38f['indexOf'](_0x3f3c13);}for(let _0x634cf4=0x0,_0x402979=_0x4402a3['length'];_0x634cf4<_0x402979;_0x634cf4++){_0x417ed3+='%'+('00'+_0x4402a3['charCodeAt'](_0x634cf4)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x417ed3);};_0x4a76['NGNKWM']=_0x5d2de7,_0x4a76['nEySKe']={},_0x4a76['lvIYJF']=!![];}const _0x156bfd=_0x5efe9b[0x0],_0x5071f8=_0x2990ca+_0x156bfd,_0x22254d=_0x4a76['nEySKe'][_0x5071f8];return!_0x22254d?(_0x4a76f2=_0x4a76['NGNKWM'](_0x4a76f2),_0x4a76['nEySKe'][_0x5071f8]=_0x4a76f2):_0x4a76f2=_0x22254d,_0x4a76f2;}if(!process[_0x1ce38f(0xd8)][_0x1ce38f(0x9e)](0x2)['length']){const lKDtYZ=_0x1ce38f(0xca)[_0x1ce38f(0xd5)]('|');let wDuqLb=0x0;while(!![]){switch(lKDtYZ[wDuqLb++]){case'0':program[_0x1ce38f(0x7e)]();continue;case'1':console['log'](chalk[_0x1ce38f(0xbd)](_0x1ce38f(0xe1))+chalk[_0x1ce38f(0xae)]('#\x20Check\x20system'));continue;case'2':console[_0x1ce38f(0x84)](chalk[_0x1ce38f(0xbd)](_0x1ce38f(0xb8))+chalk[_0x1ce38f(0xae)](_0x1ce38f(0x95)));continue;case'3':console[_0x1ce38f(0x84)]('');continue;case'4':console[_0x1ce38f(0x84)](chalk[_0x1ce38f(0x8c)](_0x1ce38f(0xba)));continue;case'5':console['log'](chalk[_0x1ce38f(0xbd)](_0x1ce38f(0xc7))+chalk['white'](_0x1ce38f(0xb2)));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;}}
|
package/lib/advanced-logger.js
CHANGED
|
@@ -1 +1,515 @@
|
|
|
1
|
-
function _0x3f94(){const _0x3ceab9=['B2jQzwn0','A1r0tMK','v3rWAuC','rgv2AwnLigrPC2nVBM5Ly3rLza','zxjYB3i','Cg5lzvu','DKD5ww8','mNWXFdb8m3W0','BwvTB3j5','Bg9N','rw9SBvK','C3rHCNruAw1L','C3vJy2vZCW','mZi0nti2zezICvnz','Cg9YDa','Aw5MBW','C2vZC2LVBLrYywnRzxi','4PQG77Ipica','y29TBwfUzhm','sfruucbszxf1zxn0','CMvJDxjZAxzL','rKD1Eha','BMv0D29YAW','sxfdCwu','C2vZC2LVBKLK','BxmP','8j+tSsbfEgvJDxrPBMCG','8j+tSsa','whfKy1i','wLPeuLy','ywvZseK','u0fjCwC','EKPSzwe','BwvZC2fNzq','nMD0A0L1Cq','s2D2shK','AM9PBG','CMvwrKy','z1LMvuy','Ahr0Ca','Bg9NrgLY','r1jWveu','s1DJCKW','mtGZmdK1ntvxA1DXDMm','wfzgy0i','rujoBg4','A0jJsKq','v2XAu2G','iNGIoLTyxsWIEsi6w1LD','ruzYtNG','mJiZmJu5tuDgzwrK','z1r4t1a','yxbWzw5KrMLSzq','FI9BlI4Uxq','rgrIvNG','rgv2AwnLBhLmB2DNzxi','vMnAy3O','weLrCNu','Aw5PDgLHBgL6zq','tNrkwu4','sePoBvu','C3bSAxq','C2vZC2LVBNm','C2vJDxjPDhK','DxvPza','CuzmDeS','BwvTB3j5vxnHz2u','z1vNtM0','y29VCMrPBMf0zxm','BhHxChG','tM50DLu','ywrKrgv2AwnL','B2DUq2S','AvLHEeS','C2v0','wxrWzuC','z2v0u3rHDhm','CuzgAfy','shDkvhq','rgv2AwnLigvYCM9Y','nZaXmtm5mefACeHkrW','C3rHy2S','BLziwfq','CMvKDwnL','te9hx0XfvKvmuW','y29UBMvJDa','sNf5EMq','qMvrC0G','yM94','DhjHy2u','C3DyCvC','ufvcteLd','zgvIDwC','zgv2AwnLCW','Ag9TzvbHDgG','uKrAtgW','w0Lqluferfjfu1nD','rLfZDgC','A0jirgy','sKDkzKG','CgXXrMK','zw5KvgLTzxi','r0XqB24','8j+sVIbnzw1VCNKGDhjHy2TPBMC6ia','igrPC2nVBM5Ly3rLza','tgXPshC','8j+sOsbszw1VDMuGls1Kzwj1zYbMB3iGy2XLyw4GChvIBgLJig1Vzgu','s0viB1K','Dhj1zq','q0fqD2K','tg9Nz2vY','tNrJCLK','uefsveLbta','uurpAfa','u3vAwfG','wfjNEeO','ywrKq29TBwfUza','zgv2AwnL','CgXHDgzVCM0','DNjQBxu','q29TBwfUzdOG','De95D1i','tujMDe8','DgLTzxjZ','q1vsuKvovf9mrvzfta','y29TBwfUzenVDw50','B25isum','B1DIBwC','AwXfu0W','zw5Vzge','tuDhEgi','DgLTAw5N','D2fYBG','Cu16wMO','xcqM','z2v0','tuiGlYa','DfjTCKi','CNnZ','zgvSzxrL','A0H5zfu','ChvZAa','DxvmAxO','AgvHCfrVDgfS','4PYfienVBM5Ly3rLzcb0BYa','w1vtrviTuefusf0','Aw5PDfbYB21PC2u','y3vIC24','uwvxEKi','8j+tIIa','8j+mKca','C21ovwG','t3zADKe','C3HPrwq','reH1u1y','wKXJuxG','shjtt1i','v0LZq0m','8j+AGcbezxzPy2vSEsbbzhzHBMnLzcbmB2DNAw5Nifn5C3rLBq','y2Dmuw4','ls1KzxyTBw9Kzq','D1zvqMy','Bwv0CMLJ','y1bOqMq','z2v0twvTB3j5vxnHz2u','CMvWBgfJzq','zxfVDeq','mJGYntG5ofPQvxzHuW','uvnJvhi','EMXirKG','reTer0S','z2v0u2vZC2LVBLn0yxrZ','yxjNCW','C3rYAw5NAwz5','q1jfqvrpuG','tenhAhC','CM91BMq','revwruXpuevs','rxP5Afy','tuiGkfjtuZOG','wuL2DKW','wgHxu0O','CLrgDgW','BgvUz3rO','Be9rr24','rNbHvfK','rw56CMq','Bw9KDwXL','8j+uJsbB','8j+tSsbezxzPy2uGzgLZy29UBMvJDgvK','8j+tGsbgAwXLigXVz2DPBMC6ia','BM93','w0vorfbpsu5uxq','C2L6zq','Ee1zD1m','zgv2zwXVCg1LBNq','C2XPy2u','CenPt3K','otaYnteYDfLVse1V','DgvZDa','BwvTB3j5x3jZCW','C2jzuem','BwfW','rMHLsKW','Aw5JBhvKzxm','s3PdufK','y29UC29Syq','uwjOCwO','8j+tIIbnB2rLoIa','lI4U','8j+uPYbtzxnZAw9UoIa','qNLbzM4','C2HVD1n0yxj0Dxbcyw5Uzxi','vgLTzxiGC3rHCNrLzdOG','q09pzLi','Dg9ju09tDhjPBMC','BwTKAxi','ywLgq3a','vM5Iz1a','uvvIAw4','w0rfvKLdrs1jrf0','yxjNDG','wuL0t2e','mJfuDKHdExm','uNruA2m','rgv2AwnLignVBM5Ly3rLza','B1vLtLO','whbZA2K','zgf0yq','BunAvgy','CgvYzM9YBwfUy2u','lMXVzW','yLzeD0i','q0nAzLi','8j+uPYbBvfjbq0vDwW','ode5mJGWohjzz0DYyG','EwrVB0u','8j+uKIbBu0vdvvjjvfLDwW','ChjVBwLZzxm','8j+sVIbnzw1VCNK6ia','zxH0zxjUywW','zgnsENa','zgv2AwnLBhKTBwfPBI5SB2C','AgvHCfvZzwq','ANnusK0','BwvTB3j5x2HLyxbFDxnLza','AxHlueO','lI4VlI4VBg9NCW','zxHWB3j0CW','8j+AGcbezxzPy2vSEsbZDgfYDgLUzY4UlG','8j+tSsbB','v0X1EgW','C3rHCNruAw1LCG','w1jfrefdvevexq','iokgKIa','DwrPza','zgDUvNK','sLbowK8'];_0x3f94=function(){return _0x3ceab9;};return _0x3f94();}const _0x3885aa=_0x1f8f;(function(_0x3c8067,_0x27d289){const _0x2c75da=_0x1f8f,_0x3ac3fa=_0x3c8067();while(!![]){try{const _0x22480e=-parseInt(_0x2c75da(0x219))/0x1+-parseInt(_0x2c75da(0x1f4))/0x2*(-parseInt(_0x2c75da(0x209))/0x3)+-parseInt(_0x2c75da(0x1ab))/0x4+parseInt(_0x2c75da(0x237))/0x5+-parseInt(_0x2c75da(0x28e))/0x6*(parseInt(_0x2c75da(0x1c4))/0x7)+-parseInt(_0x2c75da(0x1d0))/0x8+parseInt(_0x2c75da(0x212))/0x9;if(_0x22480e===_0x27d289)break;else _0x3ac3fa['push'](_0x3ac3fa['shift']());}catch(_0x31919b){_0x3ac3fa['push'](_0x3ac3fa['shift']());}}}(_0x3f94,0xd5afe));const consola=require(_0x3885aa(0x1b3)),{v4:uuidv4}=require(_0x3885aa(0x227)),fs=require('fs')[_0x3885aa(0x1d3)],path=require('path'),os=require('os'),_0x18b7aa={};_0x18b7aa[_0x3885aa(0x242)]=0x0,_0x18b7aa[_0x3885aa(0x298)]=0x1,_0x18b7aa['CREATOR']=0x2;const LOG_LEVELS=_0x18b7aa,CURRENT_LEVEL=((()=>{const _0x307adb=_0x3885aa,_0x703375={'VnbgP':function(_0x39fae2,_0x2999bd){return _0x39fae2===_0x2999bd;},'nVHXT':_0x307adb(0x1e7),'uMWQe':function(_0x4489d9,_0x28c360){return _0x4489d9(_0x28c360);},'sxiEd':_0x307adb(0x1c1),'vGyYo':_0x307adb(0x247),'PaeBr':_0x307adb(0x278),'WLuxl':'\x22x\x22:[X],\x22y\x22:[Y]','COOfR':function(_0x4610b0,_0x538489){return _0x4610b0===_0x538489;},'KzCPY':_0x307adb(0x21c),'bVDwB':function(_0x58bebb,_0x185ebe){return _0x58bebb-_0x185ebe;},'cPhBd':_0x307adb(0x253),'lxWpx':_0x307adb(0x287),'tRmrB':function(_0x1145d2,_0x1f730e){return _0x1145d2===_0x1f730e;},'JGJfH':'MgUza','JPNZO':_0x307adb(0x1a8),'DHuSV':_0x307adb(0x22d)};if(process.env.CREATOR_MODE===_0x703375[_0x307adb(0x28a)]||process[_0x307adb(0x1c2)][_0x307adb(0x1b1)](_0x703375[_0x307adb(0x22c)])){if(_0x703375[_0x307adb(0x270)](_0x307adb(0x1c5),_0x703375[_0x307adb(0x24a)])){if(_0x703375['VnbgP'](_0x5122ea,_0x1f0b7e[_0x307adb(0x295)]))return _0x5238bb;let _0x5c04c0=typeof _0x2186da===_0x703375[_0x307adb(0x239)]?_0x2af098[_0x307adb(0x294)](_0x492fef,null,0x2):_0x703375['uMWQe'](_0x29406c,_0x32428e);if(_0x703375[_0x307adb(0x1bf)](_0x17df0d,_0x2dec5b[_0x307adb(0x242)]))_0x5c04c0=_0x5c04c0['replace'](_0x13bf9e[_0x307adb(0x1e4)],_0x703375[_0x307adb(0x280)]),_0x5c04c0=_0x5c04c0['replace'](_0x11fc04['ip'],_0x703375[_0x307adb(0x1ed)]),_0x5c04c0=_0x5c04c0[_0x307adb(0x28c)](_0x212cca[_0x307adb(0x1f5)],'[ENDPOINT]'),_0x5c04c0=_0x5c04c0['replace'](_0x1e3542[_0x307adb(0x245)],_0x703375['PaeBr']),_0x5c04c0=_0x5c04c0[_0x307adb(0x28c)](_0x38bd2f[_0x307adb(0x22b)],_0x703375[_0x307adb(0x1e0)]);else _0x703375[_0x307adb(0x1bb)](_0x40a040,_0x5d68ba['DEVELOPER'])&&(_0x5c04c0=_0x5c04c0[_0x307adb(0x28c)](_0x2b08c0[_0x307adb(0x1e4)],_0x350897=>_0x350897[_0x307adb(0x1a9)](0x0,0x8)+_0x307adb(0x1b6)+_0x350897[_0x307adb(0x1a9)](-0x4)),_0x5c04c0=_0x5c04c0[_0x307adb(0x28c)](_0x521cf3[_0x307adb(0x245)],_0x703375[_0x307adb(0x1b2)]));return _0x5c04c0;}else return LOG_LEVELS[_0x307adb(0x295)];}if(process[_0x307adb(0x1c2)][_0x307adb(0x1b1)]('--debug')||process.env.DEBUG===_0x703375[_0x307adb(0x28a)]||_0x703375['tRmrB'](process.env.NODE_ENV,_0x703375[_0x307adb(0x1e6)])){if(_0x703375[_0x307adb(0x281)]===_0x703375[_0x307adb(0x281)])return LOG_LEVELS[_0x307adb(0x298)];else{const _0x5c6d02=_0x703375[_0x307adb(0x1cd)](_0x2b58bd['now'](),_0x4d7c1d);return this[_0x307adb(0x262)]['delete'](_0x1c1274),_0x3d98ae&&_0x3ce403>=_0x460e06[_0x307adb(0x298)]&&this[_0x307adb(0x1cb)](_0x2d4886,_0x5c6d02),_0x5c6d02;}}return LOG_LEVELS[_0x307adb(0x242)];})()),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']()[_0x3885aa(0x28c)](/[.*+?^${}()|[\]\\]/g,_0x3885aa(0x26d)),'g'),'coordinates':/("x":\d+,"y":\d+)/g};function redactSensitiveData(_0xc591bd,_0x372fed=CURRENT_LEVEL){const _0x175551=_0x3885aa,_0x31f2ce={'BeQsH':function(_0x598706,_0x4c734e){return _0x598706===_0x4c734e;},'plqFi':function(_0x2b8ed6,_0x485a46,_0x4121a0){return _0x2b8ed6(_0x485a46,_0x4121a0);},'uuLiz':_0x175551(0x25c),'YItOa':_0x175551(0x1ea),'ilESL':function(_0x318269,_0x1dedf8){return _0x318269>=_0x1dedf8;},'pCiOy':function(_0x5aee19,_0x1d2e23,_0x4d2ef2){return _0x5aee19(_0x1d2e23,_0x4d2ef2);},'kBcJD':function(_0x351729,_0x2fb63d){return _0x351729===_0x2fb63d;},'qMzZj':'object','sbYPC':_0x175551(0x299),'zhIcE':_0x175551(0x1be),'GRpTE':_0x175551(0x247),'cubsn':_0x175551(0x1a5),'XhWSJ':_0x175551(0x278),'enoda':_0x175551(0x217),'DKDGK':function(_0x106601,_0x5367b9){return _0x106601===_0x5367b9;},'eqotD':_0x175551(0x21c)};if(_0x31f2ce['BeQsH'](_0x372fed,LOG_LEVELS['CREATOR']))return _0xc591bd;let _0x587370=_0x31f2ce[_0x175551(0x215)](typeof _0xc591bd,_0x31f2ce[_0x175551(0x26c)])?JSON['stringify'](_0xc591bd,null,0x2):String(_0xc591bd);if(_0x31f2ce[_0x175551(0x23e)](_0x372fed,LOG_LEVELS[_0x175551(0x242)])){if(_0x31f2ce['kBcJD'](_0x31f2ce[_0x175551(0x1ae)],_0x31f2ce['zhIcE'])){if(_0x31f2ce[_0x175551(0x23e)](_0x4c2d54,_0x864627[_0x175551(0x242)]))_0x227f19[_0x175551(0x1f6)](_0x175551(0x2a4));else{const _0x59ebf9=_0x31f2ce[_0x175551(0x24b)](_0x5b7d96,_0x2cf762,_0x93f1c7);_0x7c2ab7[_0x175551(0x1f6)](_0x175551(0x202)+_0x59ebf9+_0x175551(0x24f));}_0x4fdfdb[_0x175551(0x1f0)](_0x31f2ce[_0x175551(0x275)],'disconnect',_0x31f2ce[_0x175551(0x1c3)],{'deviceId':_0x31f2ce[_0x175551(0x267)](_0x59d92d,_0x30e0d3[_0x175551(0x295)])?_0x13eb19:_0x31f2ce[_0x175551(0x1aa)](_0x204e01,_0x54b6bc,_0x161218)});}else _0x587370=_0x587370[_0x175551(0x28c)](SENSITIVE_PATTERNS[_0x175551(0x1e4)],'[DEVICE-ID]'),_0x587370=_0x587370[_0x175551(0x28c)](SENSITIVE_PATTERNS['ip'],_0x31f2ce[_0x175551(0x210)]),_0x587370=_0x587370[_0x175551(0x28c)](SENSITIVE_PATTERNS[_0x175551(0x1f5)],_0x31f2ce[_0x175551(0x27a)]),_0x587370=_0x587370[_0x175551(0x28c)](SENSITIVE_PATTERNS['homePath'],_0x31f2ce[_0x175551(0x29c)]),_0x587370=_0x587370[_0x175551(0x28c)](SENSITIVE_PATTERNS['coordinates'],_0x31f2ce[_0x175551(0x268)]);}else _0x31f2ce[_0x175551(0x291)](_0x372fed,LOG_LEVELS[_0x175551(0x298)])&&(_0x587370=_0x587370[_0x175551(0x28c)](SENSITIVE_PATTERNS[_0x175551(0x1e4)],_0x4b5b08=>_0x4b5b08[_0x175551(0x1a9)](0x0,0x8)+_0x175551(0x1b6)+_0x4b5b08[_0x175551(0x1a9)](-0x4)),_0x587370=_0x587370[_0x175551(0x28c)](SENSITIVE_PATTERNS[_0x175551(0x245)],_0x31f2ce[_0x175551(0x28d)]));return _0x587370;}class SessionTracker{constructor(){const _0x456b8b=_0x3885aa,_0xe87ae5={};_0xe87ae5[_0x456b8b(0x25e)]=_0x456b8b(0x1ee);const _0x1c458c=_0xe87ae5,_0x2998f2=_0x1c458c[_0x456b8b(0x25e)][_0x456b8b(0x224)]('|');let _0x28b8cd=0x0;while(!![]){switch(_0x2998f2[_0x28b8cd++]){case'0':this[_0x456b8b(0x244)]=new Map();continue;case'1':this[_0x456b8b(0x1f2)]=Date[_0x456b8b(0x1a4)]();continue;case'2':this['sessionId']=uuidv4()[_0x456b8b(0x224)]('-')[0x0];continue;case'3':this[_0x456b8b(0x1f9)]=[];continue;case'4':this['performance']={'memory':[],'timing':new Map()};continue;}break;}}[_0x3885aa(0x22e)](_0x49fbc0,_0xa5032e){const _0x3da3db=_0x3885aa;this[_0x3da3db(0x244)]['set'](_0x49fbc0,{..._0xa5032e,'connectedAt':Date['now'](),'commandCount':0x0});}[_0x3885aa(0x25b)](_0x4d5397,_0x25a913,_0x3747e8){const _0x334231=_0x3885aa,_0x2c2ab4={};_0x2c2ab4[_0x334231(0x258)]=function(_0x3e6dae,_0x1ca7d6){return _0x3e6dae-_0x1ca7d6;};const _0x4f0431=_0x2c2ab4,_0x531334={'deviceId':_0x4d5397,'command':_0x25a913,'duration':_0x3747e8,'timestamp':Date[_0x334231(0x1a4)](),'sessionTime':_0x4f0431[_0x334231(0x258)](Date[_0x334231(0x1a4)](),this['startTime'])};this[_0x334231(0x1f9)][_0x334231(0x274)](_0x531334),this[_0x334231(0x244)]['has'](_0x4d5397)&&this[_0x334231(0x244)][_0x334231(0x26e)](_0x4d5397)[_0x334231(0x264)]++;}[_0x3885aa(0x1e1)](_0x39ec8c){const _0x137965=_0x3885aa;this[_0x137965(0x1cb)][_0x137965(0x26a)][_0x137965(0x231)](_0x39ec8c,Date[_0x137965(0x1a4)]());}[_0x3885aa(0x24c)](_0x530c8e){const _0x12741e=_0x3885aa,_0x39e8f1={};_0x39e8f1['Enzrd']=_0x12741e(0x1de),_0x39e8f1['OMhWC']=function(_0xc8c9b5,_0x2bca1f){return _0xc8c9b5!==_0x2bca1f;},_0x39e8f1[_0x12741e(0x248)]=_0x12741e(0x22a),_0x39e8f1['QScTr']=function(_0x4a3ee6,_0x5eeb22){return _0x4a3ee6-_0x5eeb22;};const _0x2ec53a=_0x39e8f1,_0x28cdbc=this[_0x12741e(0x1cb)][_0x12741e(0x26a)]['get'](_0x530c8e);if(_0x28cdbc){if(_0x2ec53a['OMhWC'](_0x2ec53a['FQstg'],_0x2ec53a[_0x12741e(0x248)]))_0x2aa120[_0x12741e(0x1f6)](_0x2ec53a[_0x12741e(0x2a1)]);else{const _0x498260=_0x2ec53a[_0x12741e(0x28f)](Date['now'](),_0x28cdbc);return this['performance'][_0x12741e(0x26a)]['delete'](_0x530c8e),_0x498260;}}return 0x0;}[_0x3885aa(0x28b)](){const _0x2d6682=_0x3885aa,_0x39b059={};_0x39b059['iXNla']=function(_0x3bef85,_0x5814e7){return _0x3bef85/_0x5814e7;},_0x39b059[_0x2d6682(0x241)]=function(_0x599908,_0x47f7b0){return _0x599908/_0x47f7b0;},_0x39b059[_0x2d6682(0x260)]=function(_0x1f51a8,_0x25ee96){return _0x1f51a8/_0x25ee96;},_0x39b059[_0x2d6682(0x1c0)]=function(_0x52864d,_0x1041a3){return _0x52864d/_0x1041a3;};const _0x2f2071=_0x39b059,_0x338ccc=process[_0x2d6682(0x229)](),_0x2f8a3d={'rss':Math['round'](_0x2f2071['iXNla'](_0x2f2071[_0x2d6682(0x241)](_0x338ccc[_0x2d6682(0x271)],0x400),0x400)),'heapUsed':Math[_0x2d6682(0x297)](_0x2f2071['iXNla'](_0x2f2071[_0x2d6682(0x260)](_0x338ccc[_0x2d6682(0x1d8)],0x400),0x400)),'heapTotal':Math[_0x2d6682(0x297)](_0x2f2071[_0x2d6682(0x260)](_0x338ccc[_0x2d6682(0x276)],0x400)/0x400),'external':Math['round'](_0x2f2071[_0x2d6682(0x1c0)](_0x338ccc[_0x2d6682(0x1d5)]/0x400,0x400)),'timestamp':Date[_0x2d6682(0x1a4)]()};return this[_0x2d6682(0x1cb)][_0x2d6682(0x1ef)]['push'](_0x2f8a3d),_0x2f8a3d;}[_0x3885aa(0x233)](){const _0xb7d856=_0x3885aa,_0x439377={};_0x439377[_0xb7d856(0x284)]=function(_0x3ffc0d,_0x6b4507){return _0x3ffc0d/_0x6b4507;};const _0x2faaa0=_0x439377;return{'sessionId':this[_0xb7d856(0x1ff)],'uptime':Date['now']()-this[_0xb7d856(0x1f2)],'deviceCount':this[_0xb7d856(0x244)][_0xb7d856(0x1a6)],'totalCommands':this[_0xb7d856(0x1f9)][_0xb7d856(0x29e)],'avgCommandTime':this['commands'][_0xb7d856(0x29e)]?_0x2faaa0[_0xb7d856(0x284)](this[_0xb7d856(0x1f9)][_0xb7d856(0x23a)]((_0x2dedee,_0x150a5c)=>_0x2dedee+_0x150a5c['duration'],0x0),this[_0xb7d856(0x1f9)][_0xb7d856(0x29e)]):0x0,'currentMemory':this[_0xb7d856(0x28b)]()};}}const sessionTracker=new SessionTracker();class FileLogger{constructor(){const _0x2661e2=_0x3885aa,_0x55d7ae={};_0x55d7ae[_0x2661e2(0x261)]=_0x2661e2(0x1dc);const _0x16f454=_0x55d7ae;this[_0x2661e2(0x20f)]=path[_0x2661e2(0x20b)](__dirname,_0x16f454[_0x2661e2(0x261)]),this[_0x2661e2(0x279)]=this[_0x2661e2(0x221)]();}async[_0x3885aa(0x221)](){const _0x12a243=_0x3885aa;try{const _0x5baae7={};_0x5baae7[_0x12a243(0x1fb)]=!![],await fs[_0x12a243(0x1bd)](this[_0x12a243(0x20f)],_0x5baae7);const _0x2c9609={};_0x2c9609[_0x12a243(0x1fb)]=!![],await fs[_0x12a243(0x1bd)](path[_0x12a243(0x20b)](this[_0x12a243(0x20f)],_0x12a243(0x244)),_0x2c9609);const _0x23a45f={};_0x23a45f['recursive']=!![],await fs['mkdir'](path[_0x12a243(0x20b)](this['logDir'],_0x12a243(0x225)),_0x23a45f);const _0x1b2809={};_0x1b2809['recursive']=!![],await fs[_0x12a243(0x1bd)](path[_0x12a243(0x20b)](this[_0x12a243(0x20f)],_0x12a243(0x1cb)),_0x1b2809);}catch(_0x3e1bb4){}}async[_0x3885aa(0x1f0)](_0x43a77d,_0x27c7ed,_0x14f893,_0x1857f3={}){const _0x404426=_0x3885aa,_0x57dfb7={'MGGxb':function(_0x47df66,_0x54814c){return _0x47df66-_0x54814c;},'QeWzB':function(_0x45f2a6,_0x38863d){return _0x45f2a6<_0x38863d;},'aesHI':function(_0x12726,_0x53d327){return _0x12726>=_0x53d327;},'oUeNZ':function(_0x3b305e,_0x22646e,_0x36c8c7){return _0x3b305e(_0x22646e,_0x36c8c7);},'xMYwS':function(_0x10bed8,_0x28faae){return _0x10bed8+_0x28faae;},'tQsts':_0x404426(0x1d7),'reVFF':_0x404426(0x1fe)};if(_0x57dfb7[_0x404426(0x27b)](CURRENT_LEVEL,LOG_LEVELS[_0x404426(0x298)]))return;await this[_0x404426(0x279)];const _0x4ff586={'timestamp':new Date()[_0x404426(0x1bc)](),'sessionId':sessionTracker['sessionId'],'level':_0x27c7ed,'category':_0x43a77d,'message':_0x14f893,'data':_0x57dfb7[_0x404426(0x205)](CURRENT_LEVEL,LOG_LEVELS[_0x404426(0x295)])?_0x1857f3:_0x57dfb7[_0x404426(0x1c7)](redactSensitiveData,_0x1857f3,CURRENT_LEVEL)},_0x45eb06=_0x57dfb7[_0x404426(0x1a7)](JSON['stringify'](_0x4ff586),'\x0a');try{const _0x43e8b6=path[_0x404426(0x20b)](this[_0x404426(0x20f)],_0x57dfb7['tQsts']);await fs['appendFile'](_0x43e8b6,_0x45eb06);if(_0x43a77d){if(_0x57dfb7['reVFF']===_0x57dfb7[_0x404426(0x20c)]){const _0x1e3b51=path[_0x404426(0x20b)](this[_0x404426(0x20f)],_0x43a77d+_0x404426(0x1cc));await fs[_0x404426(0x21b)](_0x1e3b51,_0x45eb06);}else{const _0x22f6be=NBjEOR[_0x404426(0x269)](_0x3b7082['now'](),_0x4b0519);return this['performance'][_0x404426(0x26a)]['delete'](_0x3f5698),_0x22f6be;}}}catch(_0x48dbd1){}}}const fileLogger=new FileLogger();class DevicelyLogger{constructor(_0x133cf0){const _0x4822e6=_0x3885aa;this[_0x4822e6(0x2a2)]=_0x133cf0,this['deviceLoggers']=new Map(),this[_0x4822e6(0x262)]=new Map();}[_0x3885aa(0x1f3)](_0x2affa0,..._0x4ad5cf){const _0x2a54a2=_0x3885aa,_0x51487e={'ydooE':function(_0x4dd0f0,_0x2110c6,_0x848b2e){return _0x4dd0f0(_0x2110c6,_0x848b2e);}},_0x313d32=_0x51487e[_0x2a54a2(0x1d1)](redactSensitiveData,_0x2affa0,LOG_LEVELS[_0x2a54a2(0x242)]),_0x3ad984=/[\u{1F000}-\u{1F6FF}\u{1F900}-\u{1F9FF}\u{2600}-\u{26FF}\u{2700}-\u{27BF}]/u[_0x2a54a2(0x1ac)](_0x2affa0);consola[_0x2a54a2(0x1f3)](_0x3ad984?_0x313d32:'✅\x20'+_0x313d32);const _0x5701a3={};_0x5701a3[_0x2a54a2(0x293)]=_0x4ad5cf,fileLogger[_0x2a54a2(0x1f0)](this[_0x2a54a2(0x2a2)],_0x2a54a2(0x1f3),_0x2affa0,_0x5701a3);}[_0x3885aa(0x1f6)](_0x230cfe,..._0x19b3c0){const _0x11d8be=_0x3885aa,_0x161482={'QepMy':function(_0x5961c2,_0x2afae9,_0x243b59){return _0x5961c2(_0x2afae9,_0x243b59);},'ognCk':_0x11d8be(0x1f6)},_0x4b8dfc=_0x161482['QepMy'](redactSensitiveData,_0x230cfe,LOG_LEVELS[_0x11d8be(0x242)]),_0x17bcdf=/[\u{1F000}-\u{1F6FF}\u{1F900}-\u{1F9FF}\u{2600}-\u{26FF}\u{2700}-\u{27BF}]/u['test'](_0x230cfe);consola[_0x11d8be(0x1f6)](_0x17bcdf?_0x4b8dfc:_0x11d8be(0x202)+_0x4b8dfc);const _0x15a469={};_0x15a469[_0x11d8be(0x293)]=_0x19b3c0,fileLogger[_0x11d8be(0x1f0)](this[_0x11d8be(0x2a2)],_0x161482[_0x11d8be(0x22f)],_0x230cfe,_0x15a469);}[_0x3885aa(0x26b)](_0x511226,..._0x2d231e){const _0x1b9cbb=_0x3885aa,_0x142357={};_0x142357['dcRzp']=_0x1b9cbb(0x26b);const _0x571839=_0x142357,_0x3bcf16=redactSensitiveData(_0x511226,LOG_LEVELS[_0x1b9cbb(0x242)]),_0x462dea=_0x2d231e[_0x1b9cbb(0x1af)](_0x24f0ee=>redactSensitiveData(_0x24f0ee,LOG_LEVELS[_0x1b9cbb(0x242)])),_0x1b7e92=/[\u{1F000}-\u{1F6FF}\u{1F900}-\u{1F9FF}\u{2600}-\u{26FF}\u{2700}-\u{27BF}]/u[_0x1b9cbb(0x1ac)](_0x511226);consola['warn'](_0x1b7e92?''+_0x3bcf16:_0x1b9cbb(0x1f8)+_0x3bcf16,..._0x462dea);const _0x179993={};_0x179993[_0x1b9cbb(0x293)]=_0x2d231e,fileLogger[_0x1b9cbb(0x1f0)](this[_0x1b9cbb(0x2a2)],_0x571839[_0x1b9cbb(0x1d6)],_0x511226,_0x179993);}[_0x3885aa(0x1eb)](_0x14bf72,_0x5c258a,..._0x15ac12){const _0x2a45ea=_0x3885aa,_0x510c22={'KEHoY':function(_0xadc94d,_0x2768f2,_0x493d45){return _0xadc94d(_0x2768f2,_0x493d45);},'ixKPJ':_0x2a45ea(0x1eb),'DdbVx':function(_0x1c5319,_0x239ddf){return _0x1c5319>=_0x239ddf;},'XVFcB':_0x2a45ea(0x1e2)},_0x2413cb=_0x510c22[_0x2a45ea(0x252)](redactSensitiveData,_0x14bf72,LOG_LEVELS['PUBLIC']),_0x2834d9=/[\u{1F000}-\u{1F6FF}\u{1F900}-\u{1F9FF}\u{2600}-\u{26FF}\u{2700}-\u{27BF}]/u[_0x2a45ea(0x1ac)](_0x14bf72);consola[_0x2a45ea(0x1eb)](_0x2834d9?_0x2413cb:'❌\x20'+_0x2413cb,_0x5c258a?.[_0x2a45ea(0x208)]||_0x5c258a),fileLogger[_0x2a45ea(0x1f0)](this['module'],_0x510c22[_0x2a45ea(0x1db)],_0x14bf72,{'error':{'message':_0x5c258a?.[_0x2a45ea(0x208)],'stack':_0x510c22[_0x2a45ea(0x21d)](CURRENT_LEVEL,LOG_LEVELS[_0x2a45ea(0x295)])?_0x5c258a?.[_0x2a45ea(0x238)]:_0x510c22[_0x2a45ea(0x213)],'name':_0x5c258a?.['name']},'args':_0x15ac12});}[_0x3885aa(0x243)](_0x3b3b82,_0x4b5af4={}){const _0x4e2697=_0x3885aa,_0x169e9b={'HwJTt':function(_0x19ae61,_0x27fdb5,_0x47a3ab){return _0x19ae61(_0x27fdb5,_0x47a3ab);},'XRgxJ':'debug'};if(CURRENT_LEVEL<LOG_LEVELS[_0x4e2697(0x298)])return;const _0x422885=_0x169e9b[_0x4e2697(0x235)](redactSensitiveData,_0x3b3b82,LOG_LEVELS[_0x4e2697(0x298)]),_0x20aeb5=_0x169e9b[_0x4e2697(0x235)](redactSensitiveData,_0x4b5af4,LOG_LEVELS['DEVELOPER']);consola[_0x4e2697(0x243)](_0x4e2697(0x2a3)+this[_0x4e2697(0x2a2)]+']\x20'+_0x422885,_0x20aeb5);const _0x16ee76={};_0x16ee76[_0x4e2697(0x1c9)]=_0x4b5af4,fileLogger['log'](this[_0x4e2697(0x2a2)],_0x169e9b[_0x4e2697(0x25a)],_0x3b3b82,_0x16ee76);}['command'](_0x4d79a6,_0x439d13,_0x868aa4={},_0x505732=null){const _0x2862d3=_0x3885aa,_0x39d956={'SAIqg':function(_0x51da05,_0x31cc6f){return _0x51da05!==_0x31cc6f;},'kBHDf':_0x2862d3(0x29d),'XpZeZ':'oMDaC','NtJYN':function(_0x1556b7,_0x265a09,_0xd761ca){return _0x1556b7(_0x265a09,_0xd761ca);},'FpaTY':_0x2862d3(0x25c),'qFFhV':'command','GLPon':function(_0x57103c,_0x38837b){return _0x57103c>=_0x38837b;}};_0x505732&&sessionTracker[_0x2862d3(0x25b)](_0x4d79a6,_0x439d13,_0x505732);const _0x3cc51d=_0x2862d3(0x25f)+_0x439d13;if(CURRENT_LEVEL===LOG_LEVELS[_0x2862d3(0x242)])consola[_0x2862d3(0x1f6)](_0x2862d3(0x201)+_0x439d13);else{if(CURRENT_LEVEL===LOG_LEVELS[_0x2862d3(0x298)]){if(_0x39d956[_0x2862d3(0x206)](_0x39d956[_0x2862d3(0x249)],_0x39d956['XpZeZ'])){const _0xffbf82=_0x39d956[_0x2862d3(0x222)](redactSensitiveData,_0x868aa4,LOG_LEVELS[_0x2862d3(0x298)]),_0x199cc3=_0x39d956[_0x2862d3(0x222)](redactSensitiveData,_0x4d79a6,LOG_LEVELS[_0x2862d3(0x298)]);consola['info']('📱\x20['+_0x199cc3+']\x20'+_0x439d13+(_0x505732?'\x20('+_0x505732+_0x2862d3(0x200):''),_0xffbf82);}else _0x57c609[_0x2862d3(0x1eb)](_0x2862d3(0x27d)+_0x4fc7bc+(_0x3f2a5f?'\x20('+_0x3af857+_0x2862d3(0x200):''));}else consola[_0x2862d3(0x1f6)](_0x2862d3(0x1df)+_0x4d79a6+']\x20'+_0x439d13+(_0x505732?'\x20('+_0x505732+_0x2862d3(0x200):''),_0x868aa4);}fileLogger[_0x2862d3(0x1f0)](_0x39d956[_0x2862d3(0x2a0)],_0x39d956[_0x2862d3(0x234)],_0x3cc51d,{'command':_0x439d13,'data':_0x868aa4,'duration':_0x505732,'deviceId':_0x39d956[_0x2862d3(0x24d)](CURRENT_LEVEL,LOG_LEVELS[_0x2862d3(0x295)])?_0x4d79a6:_0x39d956['NtJYN'](redactSensitiveData,_0x4d79a6,CURRENT_LEVEL)});}[_0x3885aa(0x1fd)](_0x30651d,_0x41061a,_0x166102,_0x3a242c={},_0x47dca1=null){const _0x19da6d=_0x3885aa,_0x234c2b={'pnKeU':function(_0x3b91ae,_0x5b86ff,_0x3c881c){return _0x3b91ae(_0x5b86ff,_0x3c881c);},'WoOCH':function(_0xdbd7d7,_0x475d4e){return _0xdbd7d7>=_0x475d4e;},'BsoZD':'network','iYaxK':_0x19da6d(0x20e),'Qbhqj':_0x19da6d(0x1fa),'WtpiG':function(_0x5c5117,_0x4cb487){return _0x5c5117>=_0x4cb487;},'ZLcQx':function(_0x53682f,_0x44accf){return _0x53682f>=_0x44accf;}};if(CURRENT_LEVEL<LOG_LEVELS['DEVELOPER'])return;const _0x576011=_0x234c2b[_0x19da6d(0x1ec)](redactSensitiveData,_0x41061a,CURRENT_LEVEL),_0x2dcccb=_0x30651d+'\x20'+_0x576011+_0x19da6d(0x1e3)+_0x166102;_0x234c2b['WoOCH'](_0x166102,0x190)?consola[_0x19da6d(0x1eb)]('🌐\x20'+_0x2dcccb+(_0x47dca1?'\x20('+_0x47dca1+_0x19da6d(0x200):'')):consola[_0x19da6d(0x243)](_0x19da6d(0x27d)+_0x2dcccb+(_0x47dca1?'\x20('+_0x47dca1+_0x19da6d(0x200):'')),fileLogger[_0x19da6d(0x1f0)](_0x234c2b['BsoZD'],_0x234c2b[_0x19da6d(0x230)],_0x234c2b[_0x19da6d(0x1b4)],{'method':_0x30651d,'url':_0x234c2b[_0x19da6d(0x1e9)](CURRENT_LEVEL,LOG_LEVELS[_0x19da6d(0x295)])?_0x41061a:_0x576011,'statusCode':_0x166102,'duration':_0x47dca1,'data':_0x234c2b[_0x19da6d(0x282)](CURRENT_LEVEL,LOG_LEVELS['CREATOR'])?_0x3a242c:_0x234c2b['pnKeU'](redactSensitiveData,_0x3a242c,CURRENT_LEVEL)});}['trace'](_0x1d05aa,_0x79af6d={}){const _0x3266a1=_0x3885aa,_0x49216c={};_0x49216c['EBNln']=function(_0x26ed0a,_0xa2e7fa){return _0x26ed0a<_0xa2e7fa;},_0x49216c[_0x3266a1(0x27f)]='trace';const _0x2930b4=_0x49216c;if(_0x2930b4[_0x3266a1(0x214)](CURRENT_LEVEL,LOG_LEVELS[_0x3266a1(0x295)]))return;consola[_0x3266a1(0x243)](_0x3266a1(0x1cf)+this[_0x3266a1(0x2a2)]+']\x20'+_0x1d05aa,_0x79af6d);const _0x5bd91e={};_0x5bd91e[_0x3266a1(0x1c9)]=_0x79af6d,fileLogger[_0x3266a1(0x1f0)](this[_0x3266a1(0x2a2)],_0x2930b4[_0x3266a1(0x27f)],_0x1d05aa,_0x5bd91e);}['security'](_0x3e6c35,_0x33f105={}){const _0x2030a2=_0x3885aa,_0x22d833={};_0x22d833[_0x2030a2(0x266)]='security';const _0x1a838c=_0x22d833;if(CURRENT_LEVEL<LOG_LEVELS[_0x2030a2(0x295)])return;consola[_0x2030a2(0x26b)](_0x2030a2(0x1d2)+this[_0x2030a2(0x2a2)]+']\x20'+_0x3e6c35,_0x33f105);const _0x255add={};_0x255add['details']=_0x33f105,fileLogger[_0x2030a2(0x1f0)](_0x2030a2(0x226),_0x1a838c['oWbmg'],_0x3e6c35,_0x255add);}['performance'](_0x278b63,_0x474c00,_0x276289='ms'){const _0x5740ae=_0x3885aa,_0x574896={};_0x574896[_0x5740ae(0x20a)]=function(_0xb3f0b,_0x220a5b){return _0xb3f0b>=_0x220a5b;},_0x574896['YIvvL']=function(_0xba61af,_0x725c11){return _0xba61af!==_0x725c11;},_0x574896[_0x5740ae(0x265)]=_0x5740ae(0x288),_0x574896['BwGbk']='performance',_0x574896[_0x5740ae(0x1b0)]=_0x5740ae(0x289);const _0x182c6f=_0x574896;_0x182c6f['KgvHy'](CURRENT_LEVEL,LOG_LEVELS[_0x5740ae(0x298)])&&(_0x182c6f[_0x5740ae(0x29b)](_0x182c6f['onHIC'],_0x5740ae(0x21f))?consola['debug'](_0x5740ae(0x27c)+_0x278b63+':\x20'+_0x474c00+_0x276289):_0x3891e7[_0x5740ae(0x25b)](_0x60ea68,_0x10bbc5,_0x4782c3)),fileLogger[_0x5740ae(0x1f0)](_0x182c6f['BwGbk'],_0x182c6f[_0x5740ae(0x1b0)],'Performance\x20metric:\x20'+_0x278b63,{'metric':_0x278b63,'value':_0x474c00,'unit':_0x276289,'timestamp':Date[_0x5740ae(0x1a4)](),'sessionId':sessionTracker[_0x5740ae(0x1ff)]});}[_0x3885aa(0x1ef)](){const _0x5cc3f7=_0x3885aa,_0x560346={};_0x560346[_0x5cc3f7(0x203)]=function(_0x2c2cd8,_0x54a669){return _0x2c2cd8<_0x54a669;},_0x560346[_0x5cc3f7(0x20d)]=_0x5cc3f7(0x1ad);const _0x194122=_0x560346;if(_0x194122[_0x5cc3f7(0x203)](CURRENT_LEVEL,LOG_LEVELS[_0x5cc3f7(0x295)]))return;const _0x5ba064=sessionTracker[_0x5cc3f7(0x28b)]();consola[_0x5cc3f7(0x243)](_0x5cc3f7(0x1d4)+_0x5ba064[_0x5cc3f7(0x1d8)]+_0x5cc3f7(0x26f)+_0x5ba064[_0x5cc3f7(0x276)]+_0x5cc3f7(0x29a)+_0x5ba064['rss']+'MB)'),this[_0x5cc3f7(0x1cb)](_0x5cc3f7(0x1da),_0x5ba064[_0x5cc3f7(0x1d8)],'MB'),this[_0x5cc3f7(0x1cb)](_0x194122[_0x5cc3f7(0x20d)],_0x5ba064[_0x5cc3f7(0x271)],'MB');}[_0x3885aa(0x25c)](_0x475649,_0x4c8c20=null){const _0x220459=_0x3885aa,_0x95edbe={'zlAlT':function(_0x1616e2,_0x4bec43){return _0x1616e2===_0x4bec43;},'cgLQn':function(_0xa9b01,_0x1d2972){return _0xa9b01===_0x1d2972;},'jsTJM':_0x220459(0x1ce),'ipppR':_0x220459(0x218),'LCGhw':function(_0x5784d9,_0x4c4b82){return _0x5784d9!==_0x4c4b82;},'zJlea':_0x220459(0x1e8),'nUOJP':function(_0x307e3d,_0x453002,_0x22f955){return _0x307e3d(_0x453002,_0x22f955);},'LliHw':'device','ZnRCE':_0x220459(0x23c),'zlHFH':function(_0x4a96fe,_0x13dcb8){return _0x4a96fe>=_0x13dcb8;},'ByAfn':function(_0x482338,_0x2fb03c,_0x50e00c){return _0x482338(_0x2fb03c,_0x50e00c);},'lOQGn':'disconnect','EolmY':function(_0x2fe871,_0x5387f7,_0x1ad7fe){return _0x2fe871(_0x5387f7,_0x1ad7fe);},'NtcrY':_0x220459(0x1eb),'Goslp':_0x220459(0x236),'IJsAI':function(_0x3b988b,_0x22c7cb,_0x4c3db2){return _0x3b988b(_0x22c7cb,_0x4c3db2);},'gTxOP':function(_0x313f3f,_0x4290e6){return _0x313f3f===_0x4290e6;},'CAPwi':_0x220459(0x228)};if(_0x4c8c20){if(_0x95edbe[_0x220459(0x21a)](_0x220459(0x228),_0x95edbe[_0x220459(0x254)]))sessionTracker[_0x220459(0x22e)](_0x475649,_0x4c8c20);else return _0x1fd08d['getStats']();}return{'connect':_0x3406a5=>{const _0x5999e0=_0x220459;if(_0x95edbe['zlAlT'](CURRENT_LEVEL,LOG_LEVELS[_0x5999e0(0x242)])){if(_0x95edbe['cgLQn'](_0x95edbe[_0x5999e0(0x1d9)],_0x95edbe['ipppR']))return _0x1527d3['DEVELOPER'];else consola['success'](_0x5999e0(0x277)+(_0x3406a5[_0x5999e0(0x25d)]||'device')+'-'+_0x475649['slice'](-0x5));}else{if(_0x95edbe[_0x5999e0(0x286)](CURRENT_LEVEL,LOG_LEVELS[_0x5999e0(0x298)])){if(_0x95edbe[_0x5999e0(0x296)](_0x5999e0(0x1e8),_0x95edbe[_0x5999e0(0x207)]))_0x445eb5[_0x5999e0(0x22e)](_0x536f0f,_0x3601d2);else{const _0x9880ee=_0x95edbe['nUOJP'](redactSensitiveData,_0x475649,CURRENT_LEVEL);consola[_0x5999e0(0x1f3)]('✅\x20Connected\x20to\x20'+_0x9880ee,_0x95edbe['nUOJP'](redactSensitiveData,_0x3406a5,CURRENT_LEVEL));}}else consola[_0x5999e0(0x1f3)]('✅\x20Connected\x20to\x20'+_0x475649,_0x3406a5);}fileLogger['log'](_0x95edbe[_0x5999e0(0x250)],_0x95edbe['ZnRCE'],_0x5999e0(0x1c6),{'deviceId':_0x95edbe[_0x5999e0(0x290)](CURRENT_LEVEL,LOG_LEVELS[_0x5999e0(0x295)])?_0x475649:_0x95edbe[_0x5999e0(0x1b8)](redactSensitiveData,_0x475649,CURRENT_LEVEL),'info':_0x3406a5});},'disconnect':()=>{const _0xfa343=_0x220459;if(CURRENT_LEVEL===LOG_LEVELS[_0xfa343(0x242)])consola['info'](_0xfa343(0x2a4));else{const _0x1cd889=redactSensitiveData(_0x475649,CURRENT_LEVEL);consola[_0xfa343(0x1f6)]('📱\x20'+_0x1cd889+'\x20disconnected');}fileLogger[_0xfa343(0x1f0)](_0x95edbe['LliHw'],_0x95edbe[_0xfa343(0x29f)],_0xfa343(0x1ea),{'deviceId':_0x95edbe['zlHFH'](CURRENT_LEVEL,LOG_LEVELS['CREATOR'])?_0x475649:_0x95edbe[_0xfa343(0x1b8)](redactSensitiveData,_0x475649,CURRENT_LEVEL)});},'error':(_0x4b215b,_0x378bc7)=>{const _0x1d1eb2=_0x220459,_0x454f62=_0x95edbe[_0x1d1eb2(0x1f1)](redactSensitiveData,_0x4b215b,LOG_LEVELS[_0x1d1eb2(0x242)]);consola[_0x1d1eb2(0x1eb)]('❌\x20Device\x20error:\x20'+_0x454f62,_0x378bc7?.['message']||_0x378bc7);const _0x2843ce={};_0x2843ce['message']=_0x378bc7?.[_0x1d1eb2(0x208)],_0x2843ce[_0x1d1eb2(0x238)]=CURRENT_LEVEL>=LOG_LEVELS[_0x1d1eb2(0x295)]?_0x378bc7?.[_0x1d1eb2(0x238)]:_0x1d1eb2(0x1e2),fileLogger[_0x1d1eb2(0x1f0)](_0x95edbe['LliHw'],_0x95edbe[_0x1d1eb2(0x256)],_0x95edbe['Goslp'],{'message':_0x4b215b,'error':_0x2843ce,'deviceId':CURRENT_LEVEL>=LOG_LEVELS[_0x1d1eb2(0x295)]?_0x475649:_0x95edbe['IJsAI'](redactSensitiveData,_0x475649,CURRENT_LEVEL)});}};}['startTimer'](_0x27ddce){const _0x5cea6e=_0x3885aa,_0x46e0b6={};_0x46e0b6[_0x5cea6e(0x1fc)]=function(_0x1dd9e8,_0x54c76a){return _0x1dd9e8>=_0x54c76a;};const _0x1e90be=_0x46e0b6;this['timers'][_0x5cea6e(0x231)](_0x27ddce,Date[_0x5cea6e(0x1a4)]()),sessionTracker[_0x5cea6e(0x1e1)](_0x27ddce),_0x1e90be['FGuxp'](CURRENT_LEVEL,LOG_LEVELS[_0x5cea6e(0x295)])&&this[_0x5cea6e(0x240)](_0x5cea6e(0x1ba)+_0x27ddce);}[_0x3885aa(0x24c)](_0x13cb44,_0x3375a7=!![]){const _0x10704f=_0x3885aa,_0x4dedac={};_0x4dedac[_0x10704f(0x283)]=function(_0x274baa,_0x4285f3){return _0x274baa-_0x4285f3;},_0x4dedac[_0x10704f(0x259)]=function(_0x2adcd6,_0x33b238){return _0x2adcd6>=_0x33b238;};const _0x2c7552=_0x4dedac,_0x254c2f=this[_0x10704f(0x262)][_0x10704f(0x26e)](_0x13cb44),_0x51d44d=sessionTracker[_0x10704f(0x24c)](_0x13cb44);if(_0x254c2f){const _0x1ee270=_0x2c7552['HrSOR'](Date[_0x10704f(0x1a4)](),_0x254c2f);return this[_0x10704f(0x262)][_0x10704f(0x272)](_0x13cb44),_0x3375a7&&_0x2c7552[_0x10704f(0x259)](CURRENT_LEVEL,LOG_LEVELS[_0x10704f(0x298)])&&this[_0x10704f(0x1cb)](_0x13cb44,_0x1ee270),_0x1ee270;}return _0x51d44d;}[_0x3885aa(0x292)](){const _0x5a00e3=_0x3885aa;return sessionTracker[_0x5a00e3(0x233)]();}static[_0x3885aa(0x1b9)](){const _0x4a98eb=_0x3885aa,_0x5ebce1={};_0x5ebce1[_0x4a98eb(0x1e5)]=_0x4a98eb(0x242),_0x5ebce1['HJNmU']=_0x4a98eb(0x295),_0x5ebce1[_0x4a98eb(0x1ca)]=function(_0x23be70,_0x29b3eb){return _0x23be70===_0x29b3eb;},_0x5ebce1['Xpski']=_0x4a98eb(0x220),_0x5ebce1[_0x4a98eb(0x216)]=_0x4a98eb(0x1de),_0x5ebce1[_0x4a98eb(0x204)]=_0x4a98eb(0x285),_0x5ebce1['KWcrL']='OFF',_0x5ebce1[_0x4a98eb(0x23d)]=function(_0x9b997d,_0xf3d8ad){return _0x9b997d===_0xf3d8ad;},_0x5ebce1[_0x4a98eb(0x27e)]=_0x4a98eb(0x257),_0x5ebce1[_0x4a98eb(0x273)]=function(_0x131ef1,_0x37300f){return _0x131ef1>=_0x37300f;},_0x5ebce1['RDZLl']='💡\x20Use\x20--dev-mode\x20for\x20full\x20creator\x20logging';const _0x43cb81=_0x5ebce1,_0xfd910a=[_0x43cb81['dgnVy'],_0x4a98eb(0x298),_0x43cb81[_0x4a98eb(0x223)]],_0x32292e=_0xfd910a[CURRENT_LEVEL];_0x43cb81['mCZTf'](CURRENT_LEVEL,LOG_LEVELS[_0x4a98eb(0x242)])?_0x43cb81[_0x4a98eb(0x1c8)]!==_0x4a98eb(0x232)?consola[_0x4a98eb(0x1f6)](_0x43cb81[_0x4a98eb(0x216)]):_0x16729c['debug']('📊\x20'+_0x6b61e0+':\x20'+_0x12952b+_0x31d23d):consola[_0x4a98eb(0x23f)]({'title':_0x43cb81[_0x4a98eb(0x204)],'message':[_0x4a98eb(0x1b5)+_0x32292e,_0x4a98eb(0x1b7)+sessionTracker[_0x4a98eb(0x1ff)],_0x4a98eb(0x24e)+(CURRENT_LEVEL>=LOG_LEVELS['CREATOR']?'ON':_0x43cb81['KWcrL']),'🔒\x20Data\x20redaction:\x20'+(_0x43cb81['mCZTf'](CURRENT_LEVEL,LOG_LEVELS[_0x4a98eb(0x242)])?'FULL':_0x43cb81[_0x4a98eb(0x23d)](CURRENT_LEVEL,LOG_LEVELS[_0x4a98eb(0x298)])?_0x43cb81[_0x4a98eb(0x27e)]:_0x43cb81[_0x4a98eb(0x211)]),_0x4a98eb(0x2a5)+(_0x43cb81[_0x4a98eb(0x273)](CURRENT_LEVEL,LOG_LEVELS['DEVELOPER'])?'ON':'OFF'),'',CURRENT_LEVEL===LOG_LEVELS[_0x4a98eb(0x298)]?_0x43cb81[_0x4a98eb(0x246)]:_0x4a98eb(0x251)][_0x4a98eb(0x20b)]('\x0a')});}}function _0x1f8f(_0x2c7c11,_0x33c8a5){_0x2c7c11=_0x2c7c11-0x1a4;const _0x3f946e=_0x3f94();let _0x1f8f0c=_0x3f946e[_0x2c7c11];if(_0x1f8f['tDERYz']===undefined){var _0x5e6513=function(_0x1ce8c7){const _0x5a9caf='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x52f84c='',_0x1ccfb5='';for(let _0x25cb3c=0x0,_0x4f61f9,_0x82011,_0x426b75=0x0;_0x82011=_0x1ce8c7['charAt'](_0x426b75++);~_0x82011&&(_0x4f61f9=_0x25cb3c%0x4?_0x4f61f9*0x40+_0x82011:_0x82011,_0x25cb3c++%0x4)?_0x52f84c+=String['fromCharCode'](0xff&_0x4f61f9>>(-0x2*_0x25cb3c&0x6)):0x0){_0x82011=_0x5a9caf['indexOf'](_0x82011);}for(let _0x12284a=0x0,_0x2a1c17=_0x52f84c['length'];_0x12284a<_0x2a1c17;_0x12284a++){_0x1ccfb5+='%'+('00'+_0x52f84c['charCodeAt'](_0x12284a)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x1ccfb5);};_0x1f8f['GuqnPt']=_0x5e6513,_0x1f8f['AOvcgQ']={},_0x1f8f['tDERYz']=!![];}const _0x2dc4f1=_0x3f946e[0x0],_0x398fa9=_0x2c7c11+_0x2dc4f1,_0x364765=_0x1f8f['AOvcgQ'][_0x398fa9];return!_0x364765?(_0x1f8f0c=_0x1f8f['GuqnPt'](_0x1f8f0c),_0x1f8f['AOvcgQ'][_0x398fa9]=_0x1f8f0c):_0x1f8f0c=_0x364765,_0x1f8f0c;}DevicelyLogger[_0x3885aa(0x1b9)]();const _0x240f80={};_0x240f80[_0x3885aa(0x21e)]=DevicelyLogger,_0x240f80[_0x3885aa(0x23b)]=LOG_LEVELS,_0x240f80[_0x3885aa(0x263)]=CURRENT_LEVEL,_0x240f80[_0x3885aa(0x1f7)]=sessionTracker,_0x240f80[_0x3885aa(0x255)]=DevicelyLogger,module[_0x3885aa(0x1dd)]=_0x240f80;
|
|
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
|
+
};
|