devicely 2.1.4 → 2.1.5

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.
Files changed (89) hide show
  1. package/bin/devicely.js +105 -1
  2. package/lib/androidDeviceDetection.js +276 -1
  3. package/lib/appMappings.js +337 -1
  4. package/lib/deviceDetection.js +394 -1
  5. package/lib/devices.js +54 -1
  6. package/lib/doctor.js +94 -1
  7. package/lib/executor.js +104 -1
  8. package/lib/logger.js +35 -1
  9. package/lib/scriptLoader.js +75 -1
  10. package/lib/server.js +3483 -1
  11. package/package.json +3 -12
  12. package/scripts/compile-shell-scripts.js +208 -0
  13. package/scripts/encrypt-shell-simple.js +75 -0
  14. package/scripts/obfuscate-shell.js +160 -0
  15. package/scripts/shell/android_device_control +0 -0
  16. package/scripts/shell/android_device_control.sh +848 -0
  17. package/scripts/shell/apps_presets.conf +271 -0
  18. package/scripts/shell/connect_android_usb +0 -0
  19. package/scripts/shell/connect_android_usb_multi_final +0 -0
  20. package/scripts/shell/connect_android_usb_multi_final.sh +289 -0
  21. package/scripts/shell/connect_android_wireless +0 -0
  22. package/scripts/shell/connect_android_wireless.sh +58 -0
  23. package/scripts/shell/connect_android_wireless_multi_final +0 -0
  24. package/scripts/shell/connect_android_wireless_multi_final.sh +476 -0
  25. package/scripts/shell/connect_ios_usb +0 -0
  26. package/scripts/shell/connect_ios_usb_multi_final +0 -0
  27. package/scripts/shell/connect_ios_usb_multi_final.sh +4225 -0
  28. package/scripts/shell/connect_ios_wireless_multi_final +0 -0
  29. package/scripts/shell/connect_ios_wireless_multi_final.sh +4167 -0
  30. package/scripts/shell/create_production_scripts +0 -0
  31. package/scripts/shell/create_production_scripts.sh +38 -0
  32. package/scripts/shell/devices.conf +24 -0
  33. package/scripts/shell/diagnose_wireless_ios +0 -0
  34. package/scripts/shell/find_element_coordinates +0 -0
  35. package/scripts/shell/find_wda +0 -0
  36. package/scripts/shell/install_uiautomator2 +0 -0
  37. package/scripts/shell/install_uiautomator2.sh +93 -0
  38. package/scripts/shell/ios_device_control +0 -0
  39. package/scripts/shell/ios_device_control.sh +220 -0
  40. package/scripts/shell/organize_project +0 -0
  41. package/scripts/shell/organize_project.sh +59 -0
  42. package/scripts/shell/pre-publish-check +0 -0
  43. package/scripts/shell/pre-publish-check.sh +238 -0
  44. package/scripts/shell/publish +0 -0
  45. package/scripts/shell/publish-to-npm +0 -0
  46. package/scripts/shell/publish-to-npm.sh +366 -0
  47. package/scripts/shell/publish.sh +100 -0
  48. package/scripts/shell/setup +0 -0
  49. package/scripts/shell/setup.sh +121 -0
  50. package/scripts/shell/setup_android +0 -0
  51. package/scripts/shell/start +0 -0
  52. package/scripts/shell/start.sh +59 -0
  53. package/scripts/shell/sync-to-npm-package-final +0 -0
  54. package/scripts/shell/sync-to-npm-package-final.sh +60 -0
  55. package/scripts/shell/test-local-package.sh +95 -0
  56. package/scripts/shell/test_android_locators +0 -0
  57. package/scripts/shell/test_connect +0 -0
  58. package/scripts/shell/test_device_detection +0 -0
  59. package/scripts/shell/test_fixes +0 -0
  60. package/scripts/shell/test_getlocators_fix +0 -0
  61. package/scripts/shell/test_recording_feature +0 -0
  62. package/scripts/shell/verify-shell-protection +0 -0
  63. package/scripts/shell/verify-shell-protection.sh +73 -0
  64. package/scripts/shell/verify_distribution +0 -0
  65. package/lib/package-lock.json +0 -1678
  66. package/lib/package.json +0 -30
  67. package/lib/screenshots/screenshot_ios_iPhone17_20260205_225900.png +0 -0
  68. package/lib/screenshots/screenshot_ios_iPhone17_20260205_225942.png +0 -0
  69. package/lib/screenshots/screenshot_ios_iPhone17_20260205_231101.png +0 -0
  70. package/lib/screenshots/screenshot_ios_iPhone17_20260205_232911.png +0 -0
  71. package/lib/screenshots/screenshot_ios_iPhone17_20260208_095103.png +0 -0
  72. package/lib/screenshots/screenshot_ios_iPhone17_20260208_095720.png +0 -0
  73. package/lib/screenshots/screenshot_ios_iPhoneXR17x_20260206_115040.png +0 -0
  74. package/lib/screenshots/screenshot_ios_iPhoneXR17x_20260206_115047.png +0 -0
  75. package/lib/screenshots/screenshot_ios_iPhoneXR17x_20260206_115118.png +0 -0
  76. package/lib/screenshots/screenshot_ios_iPhoneXR17x_20260206_115125.png +0 -0
  77. package/lib/screenshots/screenshot_ios_iPhoneXR17x_20260206_115143.png +0 -0
  78. package/lib/screenshots/screenshot_ios_iPhoneXR17x_20260206_120107.png +0 -0
  79. package/lib/screenshots/screenshot_ios_iPhoneXR17x_20260206_120118.png +0 -0
  80. package/lib/screenshots/screenshot_ios_iPhoneXR17x_20260206_120137.png +0 -0
  81. package/lib/screenshots/screenshot_ios_iPhoneXR17x_20260206_120201.png +0 -0
  82. package/lib/screenshots/screenshot_ios_iPhoneXR17x_20260206_134529.png +0 -0
  83. package/scripts/shell/android_device_control.enc +0 -1
  84. package/scripts/shell/connect_android_usb_multi_final.enc +0 -1
  85. package/scripts/shell/connect_android_wireless.enc +0 -1
  86. package/scripts/shell/connect_android_wireless_multi_final.enc +0 -1
  87. package/scripts/shell/connect_ios_usb_multi_final.enc +0 -1
  88. package/scripts/shell/connect_ios_wireless_multi_final.enc +0 -1
  89. package/scripts/shell/ios_device_control.enc +0 -1
package/lib/doctor.js CHANGED
@@ -1 +1,94 @@
1
- const _0x34e9b7=_0x59ba;(function(_0x5bae15,_0x30e766){const _0x4e7b70=_0x59ba,_0x35b974=_0x5bae15();while(!![]){try{const _0x174f86=-parseInt(_0x4e7b70(0x15c))/0x1+-parseInt(_0x4e7b70(0x14d))/0x2+parseInt(_0x4e7b70(0x15a))/0x3*(parseInt(_0x4e7b70(0x14e))/0x4)+parseInt(_0x4e7b70(0x188))/0x5*(-parseInt(_0x4e7b70(0x153))/0x6)+parseInt(_0x4e7b70(0x1a2))/0x7*(-parseInt(_0x4e7b70(0x17c))/0x8)+-parseInt(_0x4e7b70(0x17d))/0x9+parseInt(_0x4e7b70(0x176))/0xa*(parseInt(_0x4e7b70(0x17f))/0xb);if(_0x174f86===_0x30e766)break;else _0x35b974['push'](_0x35b974['shift']());}catch(_0x346a7d){_0x35b974['push'](_0x35b974['shift']());}}}(_0x49e9,0x2ae8b));const {execSync}=require(_0x34e9b7(0x1a0)),chalk=require(_0x34e9b7(0x19d));function checkCommand(_0x2a8b3c,_0x2d80b8){const _0x35e83e=_0x34e9b7,_0x4ec742={'TnBum':function(_0x47f670,_0x166008,_0xf60255){return _0x47f670(_0x166008,_0xf60255);},'CWxxs':_0x35e83e(0x164)};try{return _0x4ec742[_0x35e83e(0x177)](execSync,'which\x20'+_0x2a8b3c,{'stdio':_0x4ec742[_0x35e83e(0x183)]}),console['log'](chalk['green']('✓')+'\x20'+_0x2d80b8+_0x35e83e(0x155)),!![];}catch(_0x122b76){return console[_0x35e83e(0x14f)](chalk[_0x35e83e(0x1a5)]('✗')+'\x20'+_0x2d80b8+_0x35e83e(0x17a)),![];}}function getVersion(_0x49be5b){const _0x4ba308=_0x34e9b7,_0x3f3dc1={'gOXWL':function(_0x3e076b,_0x27fe35,_0x59b026){return _0x3e076b(_0x27fe35,_0x59b026);},'SgayV':_0x4ba308(0x16d),'YovTB':_0x4ba308(0x164),'UbAPB':'Unknown'};try{const _0x108695=_0x3f3dc1[_0x4ba308(0x179)](execSync,_0x49be5b,{'encoding':_0x3f3dc1[_0x4ba308(0x189)],'stdio':[_0x4ba308(0x172),_0x4ba308(0x172),_0x3f3dc1[_0x4ba308(0x185)]]});return _0x108695[_0x4ba308(0x190)]()['split']('\x0a')[0x0];}catch(_0x165bdc){return _0x3f3dc1['UbAPB'];}}function _0x49e9(){const _0x5e38c6=['igLUC3rHBgXLza','qw5KCM9PzcbbDxrVBwf0Aw9UifrVB2XZoG','vvfuugm','vfzuA3q','EuvcEK8','mtqXnJu0ufPztxPM','zev6DgC','mtq5mJDcyKLQq0O','q2XereG','D3DiqMy','ChL0Ag9UmW','cKzVCIbbBMrYB2LKihn1ChbVCNq6','wMvkueq','zNfmAvC','uhL0Ag9UoG','AwDUB3jL','icbwzxjZAw9UoIa','qw5KCM9Pzcbezwj1zYbcCMLKz2uGkgfKyIK','AxbYB3H5','EwfQA1G','yM9Sza','DMvYC2LVBG','zeziA2S','yMDyCfq','DxrMltG','A3bbsgW','uNzzr08','Au9tief1Dg9TyxrPB24Gvg9VBhm6','mhWYFdn8mxW0','CgLWzq','wLDxv0K','C3bSAxq','EMLxquK','mte4mgL1vKXxsG','vg5cDw0','t0niDK4','z09yv0W','ig5VDcbMB3vUza','C1ztCe4','mJa4ze1QDNDK','mtm2mJe2og1cDvrODq','tM9Kzs5QCZO','nJi1mtnzt21fDeG','A0HqDxm','yuDRzKC','cLLVDsbJyw4GC3rHCNqGDxnPBMCGrgv2AwnLBhKGD2L0AdOGzgv2AwnLBhKGC3rHCNq','q1D4Ehm','z2Xfuw4','ww92vei','A1n2twC','sevyqwe','nuHNseTiCq','u2DHEvy','icbICMv3igLUC3rHBgWGyw5KCM9Pzc1WBgf0zM9YBs10B29SCW','u2fHqKW','vLjHqK8','EgnVzgvIDwLSza','cKzVCIbqExrOB246','EwvSBg93','DhjPBq','wgf0zfy','tfDpuxa','cVcFK5yGsw5ZDgfSBgf0Aw9UieD1AwrLoG','AvrJu1O','y3r5tue','ifzLCNnPB246ia','shjhsNq','icbICMv3igLUC3rHBgWGBgLIAw1VyMLSzwrLDMLJzsb1C2jTDxHK','cVcFK4SGu3LZDgvTifjLCxvPCMvTzw50CYbdAgvJAWO','AwrLDMLJzv9Pza','icbICMv3igLUC3rHBgWGChL0Ag9UmW','Ag9IBwG','y2HHBgS','y2HLy2TeB2n0B3i','ywHXtM4','y2HPBgrFChjVy2vZCW','wurnwue','nte0nur2wenjsq','4PQG77IpicbtB21LihjLCxvPCMvTzw50CYbHCMuGBwLZC2LUzW','sNDcCw0','CMvK','DxnIBxv4za','uwnnuuW','4PYfiefSBcbYzxf1AxjLBwvUDhmGBwv0iq','uuLssxm','BgjkuLK','ruH2Dg0','nJq1nJaYy1PYuM1O','neLUC3LytW','Bg9N','z3jLzw4','vNrkwgq','z3jHEq','mJaZmJaYswfrtenK','zwLvrg4'];_0x49e9=function(){return _0x5e38c6;};return _0x49e9();}async function checkDoctor(){const _0x472b64=_0x34e9b7,_0x350706={'glEQn':_0x472b64(0x160),'xcvFy':_0x472b64(0x18a),'RvYGO':_0x472b64(0x193),'JwBqm':function(_0x13d3d7,_0x2debca){return _0x13d3d7||_0x2debca;},'bgXpT':'\x0aFor\x20iOS\x20support:','OCHvN':_0x472b64(0x198),'XatdV':_0x472b64(0x18e),'lbJRY':_0x472b64(0x149),'ClDDH':_0x472b64(0x182),'HPZiS':_0x472b64(0x199),'dEztg':_0x472b64(0x17e),'ziWAI':_0x472b64(0x170),'SaaBL':function(_0x41f5f3,_0x39d120,_0x64813e){return _0x41f5f3(_0x39d120,_0x64813e);},'HEXAa':_0x472b64(0x18d),'iTcSZ':function(_0x444694,_0x50eda9,_0x1da090){return _0x444694(_0x50eda9,_0x1da090);},'yEBzO':_0x472b64(0x19a),'ctyMA':'libimobiledevice','rYUVY':_0x472b64(0x147),'QgoNT':_0x472b64(0x156),'ZWWWI':'adb','QIRIs':_0x472b64(0x166),'nOqKo':function(_0x3b6bcc,_0x41cd9e){return _0x3b6bcc&&_0x41cd9e;},'TVTkt':function(_0x53be80,_0x4a772c){return _0x53be80(_0x4a772c);},'sVSpN':'adb\x20--version','eiUDn':_0x472b64(0x163),'VtJXd':function(_0x1610b8,_0x456830,_0xdd4e74){return _0x1610b8(_0x456830,_0xdd4e74);},'QcMQL':_0x472b64(0x15f),'kSvMg':'Python\x203','aGkfG':function(_0x494da1,_0x3c4ab3){return _0x494da1(_0x3c4ab3);},'dFHkk':'python3\x20--version','fqLiW':function(_0x447275,_0x19c2ee){return _0x447275!==_0x19c2ee;},'hobmh':'FryNl','YDMYA':function(_0x2d132c,_0x514aab){return _0x2d132c===_0x514aab;},'kpAHl':_0x472b64(0x19f),'UQTPc':_0x472b64(0x192),'ZeJPD':_0x472b64(0x1a3),'kHPus':function(_0x1cfe0b,_0x38e7b0){return _0x1cfe0b||_0x38e7b0;},'EHvtm':function(_0x220bb1,_0x2e80a5){return _0x220bb1===_0x2e80a5;},'SeoYu':_0x472b64(0x18c),'wwHBf':_0x472b64(0x197)};console[_0x472b64(0x14f)](_0x350706['HPZiS']);let _0x19f7cd=!![];console[_0x472b64(0x14f)](chalk['bold'](_0x350706[_0x472b64(0x15b)]));const _0x4baccd=process[_0x472b64(0x16a)];console[_0x472b64(0x14f)](chalk[_0x472b64(0x150)]('✓')+_0x472b64(0x196)+_0x4baccd+'\x0a'),console[_0x472b64(0x14f)](chalk[_0x472b64(0x169)](_0x350706[_0x472b64(0x175)]));const _0x9d22fc=_0x350706[_0x472b64(0x18b)](checkCommand,_0x350706[_0x472b64(0x187)],'Xcode'),_0xca9e70=_0x350706[_0x472b64(0x194)](checkCommand,_0x350706[_0x472b64(0x159)],_0x350706[_0x472b64(0x195)]),_0x257880=checkCommand(_0x472b64(0x167),_0x350706['rYUVY']);_0x19f7cd=_0x19f7cd&&_0x9d22fc&&_0xca9e70&&_0x257880,console[_0x472b64(0x14f)](''),console[_0x472b64(0x14f)](chalk[_0x472b64(0x169)](_0x350706['QgoNT']));const _0x73d1de=_0x350706['SaaBL'](checkCommand,_0x350706[_0x472b64(0x173)],_0x350706[_0x472b64(0x14a)]);_0x19f7cd=_0x350706['nOqKo'](_0x19f7cd,_0x73d1de);if(_0x73d1de){const _0x122871=_0x350706[_0x472b64(0x158)](getVersion,_0x350706[_0x472b64(0x17b)]);console[_0x472b64(0x14f)](_0x472b64(0x165)+_0x122871);}console['log'](''),console['log'](chalk[_0x472b64(0x169)](_0x350706[_0x472b64(0x154)]));const _0x1518c5=_0x350706[_0x472b64(0x151)](checkCommand,_0x350706[_0x472b64(0x148)],_0x350706[_0x472b64(0x186)]);if(_0x1518c5){if(_0x472b64(0x168)===_0x472b64(0x168)){const _0x293c81=_0x350706[_0x472b64(0x181)](getVersion,_0x350706[_0x472b64(0x16b)]);console[_0x472b64(0x14f)](_0x472b64(0x165)+_0x293c81);}else{const _0x411c88=_0x472b64(0x171)[_0x472b64(0x174)]('|');let _0x51dbda=0x0;while(!![]){switch(_0x411c88[_0x51dbda++]){case'0':_0x47e756[_0x472b64(0x14f)](_0x2200cc['yellow'][_0x472b64(0x169)](_0x472b64(0x1a3)));continue;case'1':!_0x3411f3&&(_0x13127b['log'](_0x1ae021['gray'](_0x350706[_0x472b64(0x184)])),_0x3a6846['log'](_0x350706['xcvFy']));continue;case'2':_0x1242b4['log'](_0x3ecdb1['gray'](_0x350706[_0x472b64(0x16f)]));continue;case'3':_0x350706[_0x472b64(0x1a4)](!_0x30627d,!_0x4c0331)&&(_0x2deb4d[_0x472b64(0x14f)](_0x2519ce[_0x472b64(0x152)](_0x350706[_0x472b64(0x16c)])),_0x59d1ec[_0x472b64(0x14f)](_0x350706['OCHvN']));continue;case'4':!_0x3c1638&&(_0x18e4e3['log'](_0x599734[_0x472b64(0x152)](_0x350706[_0x472b64(0x191)])),_0x4a6c1b['log'](_0x472b64(0x19b)));continue;}break;}}}console[_0x472b64(0x14f)]('');if(_0x19f7cd){if(_0x350706[_0x472b64(0x162)](_0x350706[_0x472b64(0x19c)],_0x350706['hobmh']))return'Unknown';else console[_0x472b64(0x14f)](chalk[_0x472b64(0x150)][_0x472b64(0x169)](_0x472b64(0x149))),console[_0x472b64(0x14f)](chalk[_0x472b64(0x152)](_0x472b64(0x182)));}else _0x350706[_0x472b64(0x1a1)](_0x350706[_0x472b64(0x16e)],_0x350706[_0x472b64(0x157)])?(_0x525e43['log'](_0x2f8559['gray'](_0x350706['glEQn'])),_0xa8ae01[_0x472b64(0x14f)](_0x350706['xcvFy'])):(console[_0x472b64(0x14f)](chalk[_0x472b64(0x18f)][_0x472b64(0x169)](_0x350706[_0x472b64(0x161)])),console['log'](chalk['gray'](_0x350706[_0x472b64(0x16f)])),_0x350706[_0x472b64(0x180)](!_0xca9e70,!_0x257880)&&(console[_0x472b64(0x14f)](chalk['gray'](_0x350706['bgXpT'])),console[_0x472b64(0x14f)](_0x350706[_0x472b64(0x178)])),!_0x73d1de&&(_0x350706[_0x472b64(0x14c)](_0x350706['SeoYu'],_0x350706[_0x472b64(0x15e)])?(_0x26187d[_0x472b64(0x14f)](_0x456d9b[_0x472b64(0x150)][_0x472b64(0x169)](_0x350706[_0x472b64(0x14b)])),_0x544f43['log'](_0x489b08[_0x472b64(0x152)](_0x350706[_0x472b64(0x15d)]))):(console[_0x472b64(0x14f)](chalk[_0x472b64(0x152)](_0x472b64(0x160))),console[_0x472b64(0x14f)](_0x472b64(0x18a)))),!_0x1518c5&&(console[_0x472b64(0x14f)](chalk[_0x472b64(0x152)](_0x350706[_0x472b64(0x191)])),console[_0x472b64(0x14f)](_0x472b64(0x19b))));console[_0x472b64(0x14f)]('');}function _0x59ba(_0x4280ba,_0x566834){_0x4280ba=_0x4280ba-0x147;const _0x49e98a=_0x49e9();let _0x59ba3d=_0x49e98a[_0x4280ba];if(_0x59ba['jdxAwQ']===undefined){var _0x4c328c=function(_0x56330c){const _0x4f40d4='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x3260bf='',_0x7c9a8b='';for(let _0x1f0b6c=0x0,_0x4aa701,_0x3e6b11,_0x14fbd2=0x0;_0x3e6b11=_0x56330c['charAt'](_0x14fbd2++);~_0x3e6b11&&(_0x4aa701=_0x1f0b6c%0x4?_0x4aa701*0x40+_0x3e6b11:_0x3e6b11,_0x1f0b6c++%0x4)?_0x3260bf+=String['fromCharCode'](0xff&_0x4aa701>>(-0x2*_0x1f0b6c&0x6)):0x0){_0x3e6b11=_0x4f40d4['indexOf'](_0x3e6b11);}for(let _0x266ebf=0x0,_0x50f750=_0x3260bf['length'];_0x266ebf<_0x50f750;_0x266ebf++){_0x7c9a8b+='%'+('00'+_0x3260bf['charCodeAt'](_0x266ebf)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x7c9a8b);};_0x59ba['uJTQTH']=_0x4c328c,_0x59ba['Iyhhnt']={},_0x59ba['jdxAwQ']=!![];}const _0x60a674=_0x49e98a[0x0],_0x3470ef=_0x4280ba+_0x60a674,_0x40f431=_0x59ba['Iyhhnt'][_0x3470ef];return!_0x40f431?(_0x59ba3d=_0x59ba['uJTQTH'](_0x59ba3d),_0x59ba['Iyhhnt'][_0x3470ef]=_0x59ba3d):_0x59ba3d=_0x40f431,_0x59ba3d;}const _0x3c0e4d={};_0x3c0e4d[_0x34e9b7(0x19e)]=checkDoctor,module['exports']=_0x3c0e4d;
1
+ /**
2
+ * System requirements checker for Devicely
3
+ */
4
+
5
+ const { execSync } = require('child_process');
6
+ const chalk = require('chalk');
7
+
8
+ function checkCommand(command, name) {
9
+ try {
10
+ execSync(`which ${command}`, { stdio: 'ignore' });
11
+ console.log(`${chalk.green('✓')} ${name} installed`);
12
+ return true;
13
+ } catch (error) {
14
+ console.log(`${chalk.red('✗')} ${name} not found`);
15
+ return false;
16
+ }
17
+ }
18
+
19
+ function getVersion(command) {
20
+ try {
21
+ const version = execSync(command, { encoding: 'utf-8', stdio: ['pipe', 'pipe', 'ignore'] });
22
+ return version.trim().split('\n')[0];
23
+ } catch (error) {
24
+ return 'Unknown';
25
+ }
26
+ }
27
+
28
+ async function checkDoctor() {
29
+ console.log('\n📋 System Requirements Check\n');
30
+
31
+ let allGood = true;
32
+
33
+ // Node.js
34
+ console.log(chalk.bold('Node.js:'));
35
+ const nodeVersion = process.version;
36
+ console.log(`${chalk.green('✓')} Version: ${nodeVersion}\n`);
37
+
38
+ // iOS Tools
39
+ console.log(chalk.bold('iOS Automation Tools:'));
40
+ const hasXcode = checkCommand('xcodebuild', 'Xcode');
41
+ const hasIdevice = checkCommand('idevice_id', 'libimobiledevice');
42
+ const hasIproxy = checkCommand('iproxy', 'usbmuxd');
43
+ allGood = allGood && hasXcode && hasIdevice && hasIproxy;
44
+ console.log('');
45
+
46
+ // Android Tools
47
+ console.log(chalk.bold('Android Automation Tools:'));
48
+ const hasAdb = checkCommand('adb', 'Android Debug Bridge (adb)');
49
+ allGood = allGood && hasAdb;
50
+
51
+ if (hasAdb) {
52
+ const adbVersion = getVersion('adb --version');
53
+ console.log(` Version: ${adbVersion}`);
54
+ }
55
+ console.log('');
56
+
57
+ // Python (for UIAutomator2)
58
+ console.log(chalk.bold('Python:'));
59
+ const hasPython = checkCommand('python3', 'Python 3');
60
+ if (hasPython) {
61
+ const pythonVersion = getVersion('python3 --version');
62
+ console.log(` Version: ${pythonVersion}`);
63
+ }
64
+ console.log('');
65
+
66
+ // Summary
67
+ if (allGood) {
68
+ console.log(chalk.green.bold('✅ All requirements met!'));
69
+ console.log(chalk.gray('\nYou can start using Devicely with: devicely start'));
70
+ } else {
71
+ console.log(chalk.yellow.bold('⚠️ Some requirements are missing'));
72
+ console.log(chalk.gray('\n📖 Installation Guide:'));
73
+
74
+ if (!hasIdevice || !hasIproxy) {
75
+ console.log(chalk.gray('\nFor iOS support:'));
76
+ console.log(' brew install libimobiledevice usbmuxd');
77
+ }
78
+
79
+ if (!hasAdb) {
80
+ console.log(chalk.gray('\nFor Android support:'));
81
+ console.log(' brew install android-platform-tools');
82
+ }
83
+
84
+ if (!hasPython) {
85
+ console.log(chalk.gray('\nFor Python:'));
86
+ console.log(' brew install python3');
87
+ }
88
+ }
89
+ console.log('');
90
+ }
91
+
92
+ module.exports = {
93
+ checkDoctor
94
+ };
package/lib/executor.js CHANGED
@@ -1 +1,104 @@
1
- const _0x1b9331=_0x1ba3;(function(_0x426aa6,_0x1cee04){const _0x5094ea=_0x1ba3,_0x43d826=_0x426aa6();while(!![]){try{const _0xce89ca=-parseInt(_0x5094ea(0x151))/0x1+parseInt(_0x5094ea(0x12f))/0x2*(parseInt(_0x5094ea(0x126))/0x3)+parseInt(_0x5094ea(0x147))/0x4*(-parseInt(_0x5094ea(0x134))/0x5)+parseInt(_0x5094ea(0x16a))/0x6+parseInt(_0x5094ea(0x14e))/0x7+parseInt(_0x5094ea(0x179))/0x8*(parseInt(_0x5094ea(0x15a))/0x9)+parseInt(_0x5094ea(0x158))/0xa*(-parseInt(_0x5094ea(0x142))/0xb);if(_0xce89ca===_0x1cee04)break;else _0x43d826['push'](_0x43d826['shift']());}catch(_0x15a672){_0x43d826['push'](_0x43d826['shift']());}}}(_0x4c50,0x3fded));const {spawn}=require('child_process'),path=require(_0x1b9331(0x144)),chalk=require(_0x1b9331(0x148));let discoverAllDevices;function _0x4c50(){const _0xa32c4=['xsbsDw5UAw5NignVBw1HBMqUlI4','AKHjv1G','y29UBMvJDf9PB3nFD2LYzwXLC3nFBxvSDgLFzMLUywWUC2G','mJaZotKXmKTRBgzowa','4PQG77IpicbvBNn1ChbVCNrLzcbKzxzPy2uGDhLWztOG','z3jHEq','mtm0nZaWELDqDKn0','DgjqBNa','zxHLy3v0zunVBw1HBMq','y2XVC2u','CezTthi','ALfmD2i','C3bSAxq','nJK1mtG5mgrxquvpva','zgv2AwnL','nJiXovb6rejHBG','cUkDJcboBYbKzxzPy2vZigzVDw5K','CMvK','icdIGkiG','xsdINyWGrMfPBgvKicHLEgL0ignVzgu6ia','cKv4zwn1DgLUzYbVBIa','D095B1K','t25kAeC','cUkDJcbezxzPy2uGiG','CxvWs2u','CMzgvw4','AMf1vMe','z3jLzw4','Bg9N','ALnMCLa','BeLhD1G','mZaZmdq4mgzuy1fyrq','igrLDMLJzsHZktO','C2DLs3u','Agf1BKe','DhjPBq','D2LYzwXLC3m','zMLSDgvY','AKXrveO','zgf0yq','zM9YrwfJAa','zgzhvxO','C3rHDhvZ','y29UBMvJDf9PB3nFDxnIx211BhrPx2zPBMfSlNnO','DhLWzq','BxDOqwu','ntqXnNzltvjurG','t2ngzNu','Dg9tDhjPBMC','tND5B20','u2fxre0','m1nnsxLyqG','B25SAw5L','lI9KzxzPy2vezxrLy3rPB24','cUkAOo+4JYaGtM8GB25SAw5LigrLDMLJzxmGzM91BMq','C3rKB3v0','Bgrjqum','y29UBMvJDf9HBMrYB2LKx3DPCMvSzxnZx211BhrPx2zPBMfSlNnO','qwrjrLa','y3LHBG','mZi0mJe0yMD0tLD5','BgnUqxm','AM9PBG','BgvUz3rO','yMX1zq','mJm5mJiWvxHNCMXe','rfL4rum','BvfcvK0','Aw9Z','iIbUB3qGzM91BMqGB3iGB2zMBgLUzq','BMfTzq','EwvSBg93','sw5VDu4','sxzOEhy','lI4VlI4Vzgv2AwnLrgv0zwn0Aw9U','y29UBMvJDf9HBMrYB2LKx3vZyL9TDwX0Av9MAw5HBc5ZAa','qKX3wM0','CgXHDgzVCM0','yw5KCM9Pza','mtfivwnXteS','u2HqEMK','Cgf0Aa','yLvyq28','C3rKzxjY','mJHlzhf3wLm','y2HHBgS','CfDezgW','CgLWzq'];_0x4c50=function(){return _0xa32c4;};return _0x4c50();}try{({discoverAllDevices}=require(_0x1b9331(0x128)));}catch(_0x10fec0){({discoverAllDevices}=require(_0x1b9331(0x13d)));}function _0x1ba3(_0x2fdcdf,_0x1f9efb){_0x2fdcdf=_0x2fdcdf-0x124;const _0x4c5081=_0x4c50();let _0x1ba359=_0x4c5081[_0x2fdcdf];if(_0x1ba3['dMcecc']===undefined){var _0x17c14c=function(_0x5ee68c){const _0x2f8926='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x325662='',_0x30c7dc='';for(let _0xfb2c8e=0x0,_0xa7148,_0x3ac5dc,_0x45e85e=0x0;_0x3ac5dc=_0x5ee68c['charAt'](_0x45e85e++);~_0x3ac5dc&&(_0xa7148=_0xfb2c8e%0x4?_0xa7148*0x40+_0x3ac5dc:_0x3ac5dc,_0xfb2c8e++%0x4)?_0x325662+=String['fromCharCode'](0xff&_0xa7148>>(-0x2*_0xfb2c8e&0x6)):0x0){_0x3ac5dc=_0x2f8926['indexOf'](_0x3ac5dc);}for(let _0x17125f=0x0,_0x288bc8=_0x325662['length'];_0x17125f<_0x288bc8;_0x17125f++){_0x30c7dc+='%'+('00'+_0x325662['charCodeAt'](_0x17125f)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x30c7dc);};_0x1ba3['CsYQVd']=_0x17c14c,_0x1ba3['AUAIlT']={},_0x1ba3['dMcecc']=!![];}const _0x24222a=_0x4c5081[0x0],_0x2fba10=_0x2fdcdf+_0x24222a,_0x4d4583=_0x1ba3['AUAIlT'][_0x2fba10];return!_0x4d4583?(_0x1ba359=_0x1ba3['CsYQVd'](_0x1ba359),_0x1ba3['AUAIlT'][_0x2fba10]=_0x1ba359):_0x1ba359=_0x4d4583,_0x1ba359;}async function executeCommand(_0x1d7685,_0x3c552e={}){const _0x4f6762=_0x1b9331,_0x4c1436={'BLwZm':_0x4f6762(0x12c),'Nwyom':function(_0x5e5f01){return _0x5e5f01();},'jQLwb':_0x4f6762(0x154),'SaWDM':function(_0x3565c1,_0x55928b){return _0x3565c1===_0x55928b;},'jHIWX':_0x4f6762(0x145),'jSfrP':_0x4f6762(0x15b),'mQBVM':function(_0x285d91,_0x4d61df){return _0x285d91!==_0x4d61df;},'ShPzi':_0x4f6762(0x169),'InouN':function(_0x4debe2){return _0x4debe2();},'AdIFP':function(_0x57171b,_0xf32eec){return _0x57171b===_0xf32eec;},'dfGUz':function(_0x4f5063,_0x4a66f2){return _0x4f5063===_0x4a66f2;},'Ivhxv':function(_0x12b9a2,_0x50d153){return _0x12b9a2!==_0x50d153;},'rfFUn':'WAvBs','ldIAC':_0x4f6762(0x129),'jauVa':function(_0xd93ea5,_0x38e4b7){return _0xd93ea5===_0x38e4b7;},'qupKe':'usb','haunA':_0x4f6762(0x137),'rVkyf':_0x4f6762(0x16f),'pFmLr':_0x4f6762(0x14d),'mwhAe':_0x4f6762(0x141),'ZgObf':_0x4f6762(0x13e),'wOyoY':function(_0x23d215,_0x574591){return _0x23d215===_0x574591;},'OcFfu':function(_0x4bef02,_0x3d2c59){return _0x4bef02===_0x3d2c59;},'lcnAs':_0x4f6762(0x16c),'UduUh':function(_0x4853c1,_0xe75386,_0x2f0f92,_0x4a1937){return _0x4853c1(_0xe75386,_0x2f0f92,_0x4a1937);},'jLQTJ':_0x4f6762(0x14a),'tbPnp':_0x4f6762(0x172)},_0x4fe13c=await _0x4c1436[_0x4f6762(0x13b)](discoverAllDevices);if(!_0x4fe13c||_0x4c1436[_0x4f6762(0x12d)](_0x4fe13c[_0x4f6762(0x132)],0x0)){console['log'](chalk['red'](_0x4c1436[_0x4f6762(0x168)]));return;}let _0x590ca1=_0x4fe13c['filter'](_0x3fdc8d=>_0x3fdc8d[_0x4f6762(0x175)]===_0x4f6762(0x127));if(_0x3c552e[_0x4f6762(0x159)]){if(_0x4f6762(0x161)!=='OnJhG')_0x3c2583=_0x4c1436[_0x4f6762(0x13f)];else{_0x590ca1=_0x4fe13c[_0x4f6762(0x170)](_0x30a3a1=>_0x30a3a1[_0x4f6762(0x139)]===_0x3c552e[_0x4f6762(0x159)]&&_0x30a3a1[_0x4f6762(0x175)]==='online');if(_0x4c1436[_0x4f6762(0x174)](_0x590ca1['length'],0x0)){if(_0x4c1436[_0x4f6762(0x13c)](_0x4c1436[_0x4f6762(0x164)],_0x4c1436[_0x4f6762(0x164)])){const _0xbd7c0a={'pWDdl':function(_0x4340d7,_0x4d5b8c){return _0x4340d7===_0x4d5b8c;},'xDtOy':function(_0x4998d0){return _0x4c1436['Nwyom'](_0x4998d0);}};_0x548f06['on'](_0x4c1436[_0x4f6762(0x156)],_0x562c69=>{const _0x590731=_0x4f6762;_0xbd7c0a[_0x590731(0x149)](_0x562c69,0x0)?_0x10bdcc[_0x590731(0x167)](_0x393489[_0x590731(0x166)]('['+_0x4e307[_0x590731(0x139)]+']\x20✅\x20Success\x0a')):_0x5278c1[_0x590731(0x167)](_0x24d54f['red']('['+_0x21aece['name']+_0x590731(0x15e)+_0x562c69+')\x0a')),_0xbd7c0a['xDtOy'](_0x27d9d7);});}else{console[_0x4f6762(0x167)](chalk['red'](_0x4f6762(0x162)+_0x3c552e[_0x4f6762(0x159)]+_0x4f6762(0x138)));return;}}}}if(_0x4c1436['AdIFP'](_0x590ca1[_0x4f6762(0x132)],0x0)){console['log'](chalk[_0x4f6762(0x13a)](_0x4c1436[_0x4f6762(0x12b)]));return;}console[_0x4f6762(0x167)](chalk[_0x4f6762(0x12e)](_0x4f6762(0x15f)+_0x590ca1['length']+_0x4f6762(0x16b))),_0x590ca1[_0x4f6762(0x173)](_0x26d0d7=>console[_0x4f6762(0x167)](_0x4f6762(0x15d)+_0x26d0d7[_0x4f6762(0x139)])),console[_0x4f6762(0x167)]('');const _0x47b899=path[_0x4f6762(0x131)](__dirname,'../../scripts/shell');for(const _0x44d452 of _0x590ca1){const _0x527f64=_0x44d452[_0x4f6762(0x140)],_0x164abc=_0x44d452[_0x4f6762(0x177)];let _0xf822d2;if(_0x4c1436[_0x4f6762(0x165)](_0x527f64,_0x4f6762(0x137))&&_0x4c1436['jauVa'](_0x164abc,_0x4c1436[_0x4f6762(0x163)]))_0xf822d2=_0x4f6762(0x176);else{if(_0x527f64===_0x4c1436[_0x4f6762(0x16d)]&&_0x164abc===_0x4c1436['rVkyf'])_0xf822d2=_0x4c1436[_0x4f6762(0x155)];else{if(_0x4c1436['jauVa'](_0x527f64,_0x4c1436['mwhAe'])&&_0x4c1436[_0x4f6762(0x165)](_0x164abc,_0x4c1436['qupKe']))_0xf822d2=_0x4c1436['ZgObf'];else{if(_0x4c1436[_0x4f6762(0x160)](_0x527f64,_0x4c1436[_0x4f6762(0x178)])&&_0x4c1436[_0x4f6762(0x17a)](_0x164abc,_0x4f6762(0x16f))){if(_0x4c1436[_0x4f6762(0x130)]!==_0x4c1436[_0x4f6762(0x130)]){_0x51f9ef[_0x4f6762(0x167)](_0x260881[_0x4f6762(0x15c)](_0x4f6762(0x162)+_0x4bd0d6[_0x4f6762(0x159)]+'\x22\x20not\x20found\x20or\x20offline'));return;}else _0xf822d2=_0x4f6762(0x12c);}else{console['log'](chalk[_0x4f6762(0x13a)](_0x4f6762(0x14f)+_0x527f64+'-'+_0x164abc));continue;}}}}const _0x73bca2=path['join'](_0x47b899,_0xf822d2);console[_0x4f6762(0x167)](chalk[_0x4f6762(0x133)]('['+_0x44d452[_0x4f6762(0x139)]+_0x4f6762(0x14b)));const _0x2a6888=_0x4c1436['UduUh'](spawn,_0x73bca2,['-d',_0x44d452[_0x4f6762(0x139)],..._0x1d7685[_0x4f6762(0x157)]('\x20')],{'stdio':_0x4c1436[_0x4f6762(0x171)]});_0x2a6888[_0x4f6762(0x12a)]['on'](_0x4c1436['tbPnp'],_0x48c86f=>{const _0xb82a76=_0x4f6762,_0xa0c850=_0x48c86f[_0xb82a76(0x17b)]()[_0xb82a76(0x157)]('\x0a')[_0xb82a76(0x170)](_0x543513=>_0x543513[_0xb82a76(0x16e)]());_0xa0c850[_0xb82a76(0x173)](_0xba8689=>{const _0xc5040c=_0xb82a76;console[_0xc5040c(0x167)](chalk[_0xc5040c(0x150)]('\x20\x20'+_0xba8689));});}),_0x2a6888[_0x4f6762(0x146)]['on'](_0x4c1436[_0x4f6762(0x152)],_0x2f0bd5=>{const _0x28da1c=_0x4f6762,_0x17ce7f=_0x2f0bd5[_0x28da1c(0x17b)]()[_0x28da1c(0x157)]('\x0a')['filter'](_0x1d00c2=>_0x1d00c2[_0x28da1c(0x16e)]());_0x17ce7f['forEach'](_0x25eae0=>{const _0xb9c88b=_0x28da1c;console[_0xb9c88b(0x167)](chalk['red']('\x20\x20'+_0x25eae0));});}),await new Promise(_0x1492ea=>{const _0x4f45ae=_0x4f6762,_0x41f8df={};_0x41f8df[_0x4f45ae(0x135)]=_0x4c1436[_0x4f45ae(0x168)];const _0x3f9cca=_0x41f8df;if(_0x4c1436[_0x4f45ae(0x136)](_0x4c1436['ShPzi'],_0x4c1436[_0x4f45ae(0x143)])){_0x1ca2ae['log'](_0x499f9a[_0x4f45ae(0x15c)](cujpFU[_0x4f45ae(0x135)]));return;}else _0x2a6888['on'](_0x4c1436['jQLwb'],_0x9e5e9c=>{const _0x5bd804=_0x4f45ae;if(_0x4c1436[_0x5bd804(0x125)](_0x9e5e9c,0x0)){if(_0x4c1436[_0x5bd804(0x14c)]!==_0x5bd804(0x145)){const _0x118b87=_0x3c509f[_0x5bd804(0x17b)]()['split']('\x0a')['filter'](_0x5ea2f5=>_0x5ea2f5[_0x5bd804(0x16e)]());_0x118b87['forEach'](_0x5ee6ce=>{const _0x2857e1=_0x5bd804;_0x3fdecf[_0x2857e1(0x167)](_0x2f5253[_0x2857e1(0x15c)]('\x20\x20'+_0x5ee6ce));});}else console['log'](chalk[_0x5bd804(0x166)]('['+_0x44d452[_0x5bd804(0x139)]+']\x20✅\x20Success\x0a'));}else console[_0x5bd804(0x167)](chalk['red']('['+_0x44d452['name']+_0x5bd804(0x15e)+_0x9e5e9c+')\x0a'));_0x4c1436[_0x5bd804(0x124)](_0x1492ea);});});}}const _0x3ed95f={};_0x3ed95f[_0x1b9331(0x153)]=executeCommand,module['exports']=_0x3ed95f;
1
+ /**
2
+ * Command executor for Devicely CLI
3
+ */
4
+
5
+ const { spawn } = require('child_process');
6
+ const path = require('path');
7
+ const chalk = require('chalk');
8
+
9
+ // Import deviceDetection from appropriate location
10
+ let discoverAllDevices;
11
+ try {
12
+ ({ discoverAllDevices } = require('./deviceDetection'));
13
+ } catch (err) {
14
+ ({ discoverAllDevices } = require('../../deviceDetection'));
15
+ }
16
+
17
+ async function executeCommand(command, options = {}) {
18
+ const devices = await discoverAllDevices();
19
+
20
+ if (!devices || devices.length === 0) {
21
+ console.log(chalk.red('\n❌ No devices found'));
22
+ return;
23
+ }
24
+
25
+ let targetDevices = devices.filter(d => d.status === 'online');
26
+
27
+ if (options.device) {
28
+ targetDevices = devices.filter(d =>
29
+ d.name === options.device && d.status === 'online'
30
+ );
31
+
32
+ if (targetDevices.length === 0) {
33
+ console.log(chalk.red(`\n❌ Device "${options.device}" not found or offline`));
34
+ return;
35
+ }
36
+ }
37
+
38
+ if (targetDevices.length === 0) {
39
+ console.log(chalk.yellow('\n⚠️ No online devices found'));
40
+ return;
41
+ }
42
+
43
+ console.log(chalk.cyan(`\nExecuting on ${targetDevices.length} device(s):`));
44
+ targetDevices.forEach(d => console.log(` • ${d.name}`));
45
+ console.log('');
46
+
47
+ const scriptDir = path.join(__dirname, '../../scripts/shell');
48
+
49
+ for (const device of targetDevices) {
50
+ const platform = device.platform;
51
+ const type = device.type;
52
+
53
+ let scriptName;
54
+ if (platform === 'ios' && type === 'usb') {
55
+ scriptName = 'connect_ios_usb_multi_final.sh';
56
+ } else if (platform === 'ios' && type === 'wireless') {
57
+ scriptName = 'connect_ios_wireless_multi_final.sh';
58
+ } else if (platform === 'android' && type === 'usb') {
59
+ scriptName = 'connect_android_usb_multi_final.sh';
60
+ } else if (platform === 'android' && type === 'wireless') {
61
+ scriptName = 'connect_android_wireless_multi_final.sh';
62
+ } else {
63
+ console.log(chalk.yellow(`⚠️ Unsupported device type: ${platform}-${type}`));
64
+ continue;
65
+ }
66
+
67
+ const scriptPath = path.join(scriptDir, scriptName);
68
+
69
+ console.log(chalk.blue(`[${device.name}] Running command...`));
70
+
71
+ const child = spawn(scriptPath, ['-d', device.name, ...command.split(' ')], {
72
+ stdio: 'pipe'
73
+ });
74
+
75
+ child.stdout.on('data', (data) => {
76
+ const lines = data.toString().split('\n').filter(l => l.trim());
77
+ lines.forEach(line => {
78
+ console.log(chalk.gray(` ${line}`));
79
+ });
80
+ });
81
+
82
+ child.stderr.on('data', (data) => {
83
+ const lines = data.toString().split('\n').filter(l => l.trim());
84
+ lines.forEach(line => {
85
+ console.log(chalk.red(` ${line}`));
86
+ });
87
+ });
88
+
89
+ await new Promise((resolve) => {
90
+ child.on('close', (code) => {
91
+ if (code === 0) {
92
+ console.log(chalk.green(`[${device.name}] ✅ Success\n`));
93
+ } else {
94
+ console.log(chalk.red(`[${device.name}] ❌ Failed (exit code: ${code})\n`));
95
+ }
96
+ resolve();
97
+ });
98
+ });
99
+ }
100
+ }
101
+
102
+ module.exports = {
103
+ executeCommand
104
+ };
package/lib/logger.js CHANGED
@@ -1 +1,35 @@
1
- const _0x137111=_0x286c;function _0x6a23(){const _0x4c7d82=['mZzPyu1VA00','mtbwCKn6EhK','mJHLt1vrzxe','ntz5ANbyEK4','mJa2ntHcA1vgBgi','otCXotbfzuTVCwO','w1nuqvjuvvbDwW','Dhj1zq','Bg9N','odyXnte2n1DnteHksG','w1DbuK5DwW','zgvIDwC','w0rfqLvhxvS','nZG5nJngrKPvugy','nte1otmWsNHREgTM','ndi3odq4mevZvgLtuW','D2fYBG','zxHWB3j0CW','zxjYB3i','mJe0oda4AuLqy05j','Aw5MBW','nhftD3PcCW','Bw9KDwXL'];_0x6a23=function(){return _0x4c7d82;};return _0x6a23();}function _0x286c(_0x39302b,_0x134436){_0x39302b=_0x39302b-0xc5;const _0x6a2381=_0x6a23();let _0x286cba=_0x6a2381[_0x39302b];if(_0x286c['EiZqSk']===undefined){var _0x4c3d79=function(_0x16bd32){const _0x15746d='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x568a33='',_0x59040b='';for(let _0xc562c4=0x0,_0x2f99ca,_0x295be2,_0x2bb968=0x0;_0x295be2=_0x16bd32['charAt'](_0x2bb968++);~_0x295be2&&(_0x2f99ca=_0xc562c4%0x4?_0x2f99ca*0x40+_0x295be2:_0x295be2,_0xc562c4++%0x4)?_0x568a33+=String['fromCharCode'](0xff&_0x2f99ca>>(-0x2*_0xc562c4&0x6)):0x0){_0x295be2=_0x15746d['indexOf'](_0x295be2);}for(let _0x28e1b9=0x0,_0x4f5beb=_0x568a33['length'];_0x28e1b9<_0x4f5beb;_0x28e1b9++){_0x59040b+='%'+('00'+_0x568a33['charCodeAt'](_0x28e1b9)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x59040b);};_0x286c['fDBmZT']=_0x4c3d79,_0x286c['XUNXcO']={},_0x286c['EiZqSk']=!![];}const _0x461fd3=_0x6a2381[0x0],_0x4182e0=_0x39302b+_0x461fd3,_0xd2440a=_0x286c['XUNXcO'][_0x4182e0];return!_0xd2440a?(_0x286cba=_0x286c['fDBmZT'](_0x286cba),_0x286c['XUNXcO'][_0x4182e0]=_0x286cba):_0x286cba=_0xd2440a,_0x286cba;}(function(_0x425634,_0x11593a){const _0x191dfb=_0x286c,_0x1848e4=_0x425634();while(!![]){try{const _0x10c161=parseInt(_0x191dfb(0xce))/0x1+-parseInt(_0x191dfb(0xcc))/0x2*(-parseInt(_0x191dfb(0xd6))/0x3)+-parseInt(_0x191dfb(0xc7))/0x4*(-parseInt(_0x191dfb(0xd7))/0x5)+-parseInt(_0x191dfb(0xcd))/0x6*(-parseInt(_0x191dfb(0xcb))/0x7)+-parseInt(_0x191dfb(0xc5))/0x8*(parseInt(_0x191dfb(0xc9))/0x9)+parseInt(_0x191dfb(0xca))/0xa*(-parseInt(_0x191dfb(0xd2))/0xb)+parseInt(_0x191dfb(0xd8))/0xc;if(_0x10c161===_0x11593a)break;else _0x1848e4['push'](_0x1848e4['shift']());}catch(_0x3504ef){_0x1848e4['push'](_0x1848e4['shift']());}}}(_0x6a23,0x65d33));const DEBUG_MODE=process.env.DEBUG===_0x137111(0xd0)||process.env.NODE_ENV==='development';class Logger{constructor(_0x55af2b){const _0x3a46a2=_0x137111;this[_0x3a46a2(0xc8)]=_0x55af2b;}[_0x137111(0xd4)](..._0x1a5ae9){const _0x2b3ad2=_0x137111;DEBUG_MODE&&console[_0x2b3ad2(0xd1)](_0x2b3ad2(0xd5)+this[_0x2b3ad2(0xc8)]+']',..._0x1a5ae9);}[_0x137111(0xc6)](..._0x4b9c4a){const _0x13a0d9=_0x137111;console[_0x13a0d9(0xd1)]('[INFO]['+this[_0x13a0d9(0xc8)]+']',..._0x4b9c4a);}[_0x137111(0xd9)](..._0x498088){const _0x1fd0b6=_0x137111;console['warn'](_0x1fd0b6(0xd3)+this[_0x1fd0b6(0xc8)]+']',..._0x498088);}[_0x137111(0xdb)](..._0x12e82d){const _0xea5e5a=_0x137111;console[_0xea5e5a(0xdb)]('[ERROR]['+this[_0xea5e5a(0xc8)]+']',..._0x12e82d);}['startup'](..._0x575dd5){const _0x140cda=_0x137111;console[_0x140cda(0xd1)](_0x140cda(0xcf)+this['module']+']',..._0x575dd5);}}module[_0x137111(0xda)]=Logger;
1
+ // Centralized Logger for Production
2
+ // Use environment variable to control debug output
3
+
4
+ const DEBUG_MODE = process.env.DEBUG === 'true' || process.env.NODE_ENV === 'development';
5
+
6
+ class Logger {
7
+ constructor(module) {
8
+ this.module = module;
9
+ }
10
+
11
+ debug(...args) {
12
+ if (DEBUG_MODE) {
13
+ console.log(`[DEBUG][${this.module}]`, ...args);
14
+ }
15
+ }
16
+
17
+ info(...args) {
18
+ console.log(`[INFO][${this.module}]`, ...args);
19
+ }
20
+
21
+ warn(...args) {
22
+ console.warn(`[WARN][${this.module}]`, ...args);
23
+ }
24
+
25
+ error(...args) {
26
+ console.error(`[ERROR][${this.module}]`, ...args);
27
+ }
28
+
29
+ // Keep critical startup/connection messages
30
+ startup(...args) {
31
+ console.log(`[STARTUP][${this.module}]`, ...args);
32
+ }
33
+ }
34
+
35
+ module.exports = Logger;
@@ -1 +1,75 @@
1
- const _0x3e2bd4=_0x5126;(function(_0x531d74,_0x3f2586){const _0x4ff76b=_0x5126,_0x316991=_0x531d74();while(!![]){try{const _0x17b955=parseInt(_0x4ff76b(0x1c1))/0x1*(-parseInt(_0x4ff76b(0x19f))/0x2)+-parseInt(_0x4ff76b(0x19b))/0x3*(-parseInt(_0x4ff76b(0x184))/0x4)+-parseInt(_0x4ff76b(0x1b8))/0x5+-parseInt(_0x4ff76b(0x17a))/0x6*(parseInt(_0x4ff76b(0x1ab))/0x7)+parseInt(_0x4ff76b(0x198))/0x8*(parseInt(_0x4ff76b(0x1ac))/0x9)+-parseInt(_0x4ff76b(0x1a4))/0xa+parseInt(_0x4ff76b(0x185))/0xb;if(_0x17b955===_0x3f2586)break;else _0x316991['push'](_0x316991['shift']());}catch(_0x329694){_0x316991['push'](_0x316991['shift']());}}}(_0x3a42,0x93e7d));const fs=require('fs'),path=require(_0x3e2bd4(0x1b3)),crypto=require(_0x3e2bd4(0x1b7)),os=require('os');function generateKey(){const _0x37cec8=_0x3e2bd4,_0x43a69b={'xVBJv':function(_0x4f1b2c,_0x307875){return _0x4f1b2c(_0x307875);},'sdeYc':_0x37cec8(0x1c2),'OWDWI':_0x37cec8(0x175),'ufORU':function(_0x1cfa3c,_0x46abae){return _0x1cfa3c+_0x46abae;}},_0x1796e5=_0x43a69b[_0x37cec8(0x1bd)](require,_0x43a69b[_0x37cec8(0x197)]);return crypto[_0x37cec8(0x181)](_0x43a69b[_0x37cec8(0x1a3)])['update'](_0x43a69b[_0x37cec8(0x195)](_0x1796e5[_0x37cec8(0x1c6)],_0x1796e5[_0x37cec8(0x19a)]))[_0x37cec8(0x1a9)]();}function decryptScript(_0x5d389a){const _0x277681=_0x3e2bd4,_0x30d39c={'BnmNg':_0x277681(0x1be),'ICSFY':function(_0x3d8e77){return _0x3d8e77();},'ddzag':_0x277681(0x1ad),'DxcGn':_0x277681(0x1c3)},_0x2ab1fd=JSON[_0x277681(0x188)](fs[_0x277681(0x179)](_0x5d389a,_0x30d39c[_0x277681(0x1a2)])),_0x4ccb02=_0x30d39c[_0x277681(0x178)](generateKey),_0x234906=crypto[_0x277681(0x190)](_0x30d39c['ddzag'],_0x4ccb02,Buffer['from'](_0x2ab1fd['iv'],_0x30d39c[_0x277681(0x180)]));let _0xc4cf78=_0x234906[_0x277681(0x186)](_0x2ab1fd[_0x277681(0x17c)],'hex',_0x277681(0x1be));return _0xc4cf78+=_0x234906[_0x277681(0x1a5)](_0x277681(0x1be)),_0xc4cf78;}function prepareScripts(){const _0xef9709=_0x3e2bd4,_0x3a6525={'PIKNq':function(_0x36f6a7,_0x2b259f){return _0x36f6a7(_0x2b259f);},'Liprf':_0xef9709(0x19e),'rlSjA':_0xef9709(0x1c5),'skocA':'.sh','uEMgn':function(_0x20ce65,_0x24f560){return _0x20ce65!==_0x24f560;},'XeVNQ':function(_0x12a27f,_0x4c3cba){return _0x12a27f!==_0x4c3cba;},'Jfwux':function(_0x416235,_0x2e02cf){return _0x416235===_0x2e02cf;},'ljWrO':_0xef9709(0x1bc),'khHqM':function(_0x10ab3e){return _0x10ab3e();},'xNfIA':_0xef9709(0x1ad),'aUOFs':_0xef9709(0x1c3),'VUHHi':function(_0x3018cc,_0x45334c){return _0x3018cc!==_0x45334c;},'rownq':_0xef9709(0x17d),'defVy':_0xef9709(0x17f),'HByqF':function(_0x54a53d,_0x328d7e){return _0x54a53d!==_0x328d7e;},'fIzyx':'../scripts/shell','abfej':function(_0xdde0da,_0x147323){return _0xdde0da+_0x147323;},'JqiKj':_0xef9709(0x1b1),'lEKLN':_0xef9709(0x19d),'BYKxf':_0xef9709(0x191)},_0x152441=path[_0xef9709(0x1aa)](__dirname,_0x3a6525['fIzyx']),_0x3d1cc8=path[_0xef9709(0x1aa)](os[_0xef9709(0x172)](),_0x3a6525[_0xef9709(0x17b)](_0xef9709(0x17e),process[_0xef9709(0x187)]));if(!fs[_0xef9709(0x1b5)](_0x3d1cc8)){if(_0x3a6525['uEMgn'](_0xef9709(0x1b1),_0x3a6525[_0xef9709(0x1bf)])){const _0x424921=_0x3a6525['PIKNq'](_0x36cea2,_0x14dc64),_0x5961ad={};_0x5961ad[_0xef9709(0x1ae)]=0x1ed,_0x122d58[_0xef9709(0x1af)](_0xde5b51,_0x424921,_0x5961ad);}else{const _0x1f578e={};_0x1f578e[_0xef9709(0x1ba)]=!![],_0x1f578e[_0xef9709(0x1ae)]=0x1c0,fs['mkdirSync'](_0x3d1cc8,_0x1f578e);}}if(!fs['existsSync'](_0x152441))return _0x3d1cc8;const _0xdd742=fs['readdirSync'](_0x152441)[_0xef9709(0x1c8)](_0x585f81=>_0x585f81[_0xef9709(0x1c0)](_0xef9709(0x1c5)));if(_0x3a6525[_0xef9709(0x18b)](_0xdd742[_0xef9709(0x18f)],0x0))return _0x3d1cc8;return console[_0xef9709(0x174)](_0xef9709(0x192)+_0xdd742['length']+_0xef9709(0x1b0)),_0xdd742[_0xef9709(0x173)](_0x4b963f=>{const _0x2fc985=_0xef9709;if(_0x3a6525[_0x2fc985(0x1a6)]===_0x3a6525[_0x2fc985(0x1a6)]){const _0x3ca349=path[_0x2fc985(0x1aa)](_0x152441,_0x4b963f),_0x22d2df=_0x4b963f[_0x2fc985(0x1b2)](_0x3a6525[_0x2fc985(0x182)],_0x3a6525['skocA']),_0x5f4f99=path[_0x2fc985(0x1aa)](_0x3d1cc8,_0x22d2df);try{if(_0x3a6525[_0x2fc985(0x177)](_0x2fc985(0x1a7),_0x2fc985(0x1a0))){const _0x353516=_0x3a6525['PIKNq'](decryptScript,_0x3ca349),_0x478f35={};_0x478f35['mode']=0x1ed,fs[_0x2fc985(0x1af)](_0x5f4f99,_0x353516,_0x478f35);}else return _0x440a54;}catch(_0x252361){console[_0x2fc985(0x196)]('\x20\x20\x20❌\x20Failed\x20to\x20decrypt\x20'+_0x4b963f+':\x20'+_0x252361[_0x2fc985(0x194)]);}}else return _0x3527d6;}),console[_0xef9709(0x174)](_0xef9709(0x1bb)),process['on'](_0x3a6525[_0xef9709(0x1b6)],()=>{const _0x5262c1=_0xef9709;if(_0x3a6525[_0x5262c1(0x18e)](_0x5262c1(0x1c7),_0x5262c1(0x1c7))){const _0xf6601d={};_0xf6601d[_0x5262c1(0x1ba)]=!![],_0xf6601d[_0x5262c1(0x1a8)]=!![],_0x2bfac4[_0x5262c1(0x1c4)](_0x12a2f1,_0xf6601d);}else try{if(fs[_0x5262c1(0x1b5)](_0x3d1cc8)){if(_0x3a6525[_0x5262c1(0x18b)](_0x3a6525[_0x5262c1(0x183)],_0x3a6525[_0x5262c1(0x183)])){const _0x4204d4={};_0x4204d4[_0x5262c1(0x1ba)]=!![],_0x4204d4[_0x5262c1(0x1a8)]=!![],fs[_0x5262c1(0x1c4)](_0x3d1cc8,_0x4204d4);}else{const _0x41c894={};_0x41c894['recursive']=!![],_0x41c894[_0x5262c1(0x1ae)]=0x1c0,_0x10079b[_0x5262c1(0x18d)](_0xdd61b5,_0x41c894);}}}catch(_0x190528){}}),process['on'](_0x3a6525[_0xef9709(0x176)],()=>{const _0x29ed0c=_0xef9709,_0x51f5af={'zSEvz':function(_0x5e4305){const _0x477733=_0x5126;return _0x3a6525[_0x477733(0x193)](_0x5e4305);},'ECKqf':_0x3a6525[_0x29ed0c(0x189)],'OAAVh':_0x3a6525['aUOFs']};if(_0x3a6525['VUHHi'](_0x3a6525[_0x29ed0c(0x18c)],_0x3a6525['defVy'])){try{if(_0x3a6525[_0x29ed0c(0x199)](_0x29ed0c(0x1a1),_0x29ed0c(0x19c))){if(fs['existsSync'](_0x3d1cc8)){const _0x5077ea={};_0x5077ea[_0x29ed0c(0x1ba)]=!![],_0x5077ea[_0x29ed0c(0x1a8)]=!![],fs['rmSync'](_0x3d1cc8,_0x5077ea);}}else{const _0xdfc406=_0x333d81[_0x29ed0c(0x188)](_0x3fec99[_0x29ed0c(0x179)](_0x51f734,_0x29ed0c(0x1be))),_0x204565=DMRCsy['zSEvz'](_0x1c0645),_0x548052=_0x49f73f[_0x29ed0c(0x190)](DMRCsy['ECKqf'],_0x204565,_0x400cee[_0x29ed0c(0x1b9)](_0xdfc406['iv'],DMRCsy[_0x29ed0c(0x18a)]));let _0x2bbc87=_0x548052[_0x29ed0c(0x186)](_0xdfc406[_0x29ed0c(0x17c)],DMRCsy[_0x29ed0c(0x18a)],_0x29ed0c(0x1be));return _0x2bbc87+=_0x548052[_0x29ed0c(0x1a5)](_0x29ed0c(0x1be)),_0x2bbc87;}}catch(_0x2512dc){}process[_0x29ed0c(0x19d)]();}else{if(_0x161d2d[_0x29ed0c(0x1b5)](_0xbe7106)){const _0x5231a1={};_0x5231a1['recursive']=!![],_0x5231a1['force']=!![],_0x33ffb2[_0x29ed0c(0x1c4)](_0x5afd91,_0x5231a1);}}}),_0x3d1cc8;}const _0x3a84d1={};function _0x5126(_0x245466,_0xe80e9){_0x245466=_0x245466-0x172;const _0x3a42d9=_0x3a42();let _0x5126a2=_0x3a42d9[_0x245466];if(_0x5126['ybBXEj']===undefined){var _0x5a0948=function(_0x1f413a){const _0x4b6f32='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x1c40cc='',_0x454679='';for(let _0x4b2098=0x0,_0x34b698,_0x542a61,_0x49137b=0x0;_0x542a61=_0x1f413a['charAt'](_0x49137b++);~_0x542a61&&(_0x34b698=_0x4b2098%0x4?_0x34b698*0x40+_0x542a61:_0x542a61,_0x4b2098++%0x4)?_0x1c40cc+=String['fromCharCode'](0xff&_0x34b698>>(-0x2*_0x4b2098&0x6)):0x0){_0x542a61=_0x4b6f32['indexOf'](_0x542a61);}for(let _0x22c6cc=0x0,_0x1bb404=_0x1c40cc['length'];_0x22c6cc<_0x1bb404;_0x22c6cc++){_0x454679+='%'+('00'+_0x1c40cc['charCodeAt'](_0x22c6cc)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x454679);};_0x5126['uANKtm']=_0x5a0948,_0x5126['JJtIXc']={},_0x5126['ybBXEj']=!![];}const _0x539ae4=_0x3a42d9[0x0],_0xa01560=_0x245466+_0x539ae4,_0x5cf2f6=_0x5126['JJtIXc'][_0xa01560];return!_0x5cf2f6?(_0x5126a2=_0x5126['uANKtm'](_0x5126a2),_0x5126['JJtIXc'][_0xa01560]=_0x5126a2):_0x5126a2=_0x5cf2f6,_0x5126a2;}_0x3a84d1[_0x3e2bd4(0x1b4)]=prepareScripts,_0x3a84d1['decryptScript']=decryptScript,module['exports']=_0x3a84d1;function _0x3a42(){const _0x4eb60f=['Bw9Kzq','D3jPDgvgAwXLu3LUyW','ihbYB3rLy3rLzcbZy3jPChrZlI4U','CgDTugi','CMvWBgfJzq','Cgf0Aa','ChjLCgfYzvnJCMLWDhm','zxHPC3rZu3LUyW','Bevlte4','y3j5ChrV','mZa5otG3mhr4yLLcCG','zNjVBq','CMvJDxjZAxzL','4PYfifnJCMLWDhmGCMvHzhKGAw4GDgvTCcbKAxjLy3rVCNKk','rg9Is2u','EfzcsNy','DxrMoa','sNfPs2O','zw5KC1DPDgG','mtqYntaZvuvwv1P3','lI4VCgfJA2fNzs5QC29U','Agv4','CM1tEw5J','lMvUyW','BMfTzq','s0DRALO','zMLSDgvY','Dg1WzgLY','zM9YrwfJAa','Bg9N','C2HHmJu2','qLLlEgy','Duvnz24','suntrLK','CMvHzezPBgvtEw5J','nKPWD2HnBa','ywjMzwO','y29UDgvUDa','rxfkrfa','zgv2AwnLBhLFC2nYAxb0C18','z1n0rwC','rhHJr24','y3jLyxrLsgfZAa','CMXtAKe','BgPxCK8','mJG4mZu4nfr2Ce13uG','nJe1nZC4owzvDvLYwq','DxbKyxrL','CgLK','CgfYC2u','Ee5Msue','t0fbvMG','sMz3DxG','CM93BNe','BwTKAxjtEw5J','wgvwtLe','BgvUz3rO','y3jLyxrLrgvJAxbOzxjPDG','u0Lhsu5u','8j+uKYbezwnYExb0Aw5Nia','A2HiCu0','BwvZC2fNzq','DwzpuLu','zxjYB3i','C2rLwwm','mtziAg1Jrgu','sej5Cuy','DMvYC2LVBG','m3reAePQwq','BK92tKC','zxHPDa','y0TLwM4','mMjxze9cyq','sxPUs0u','AMzxvuu','qM5TtMC','t1Dev0K','ntmWmZiYmffyANbnAq','zMLUywW','tgLWCMy','DgPlr3q','zM9Yy2u','zgLNzxn0','AM9PBG','mZKYotyXmxbjBNz1uG','ntmWnJG0muntvhHVBq','ywvZlti1nI1JyMm'];_0x3a42=function(){return _0x4eb60f;};return _0x3a42();}
1
+ const fs = require('fs');
2
+ const path = require('path');
3
+ const crypto = require('crypto');
4
+ const os = require('os');
5
+
6
+ function generateKey() {
7
+ const pkg = require('../package.json');
8
+ return crypto.createHash('sha256').update(pkg.name + pkg.version).digest();
9
+ }
10
+
11
+ function decryptScript(encPath) {
12
+ const data = JSON.parse(fs.readFileSync(encPath, 'utf8'));
13
+ const key = generateKey();
14
+ const decipher = crypto.createDecipheriv('aes-256-cbc', key, Buffer.from(data.iv, 'hex'));
15
+ let decrypted = decipher.update(data.content, 'hex', 'utf8');
16
+ decrypted += decipher.final('utf8');
17
+ return decrypted;
18
+ }
19
+
20
+ function prepareScripts() {
21
+ const shellDir = path.join(__dirname, '../scripts/shell');
22
+ const tmpDir = path.join(os.tmpdir(), 'devicely_scripts_' + process.pid);
23
+
24
+ if (!fs.existsSync(tmpDir)) {
25
+ fs.mkdirSync(tmpDir, { recursive: true, mode: 0o700 });
26
+ }
27
+
28
+ if (!fs.existsSync(shellDir)) {
29
+ return tmpDir;
30
+ }
31
+
32
+ const encFiles = fs.readdirSync(shellDir).filter(f => f.endsWith('.enc'));
33
+
34
+ if (encFiles.length === 0) {
35
+ return tmpDir;
36
+ }
37
+
38
+ console.log(`🔓 Decrypting ${encFiles.length} protected scripts...`);
39
+
40
+ encFiles.forEach(encFile => {
41
+ const encPath = path.join(shellDir, encFile);
42
+ const scriptName = encFile.replace('.enc', '.sh');
43
+ const tmpScript = path.join(tmpDir, scriptName);
44
+
45
+ try {
46
+ const content = decryptScript(encPath);
47
+ fs.writeFileSync(tmpScript, content, { mode: 0o755 });
48
+ } catch (error) {
49
+ console.error(` ❌ Failed to decrypt ${encFile}: ${error.message}`);
50
+ }
51
+ });
52
+
53
+ console.log(`✅ Scripts ready in temp directory\n`);
54
+
55
+ process.on('exit', () => {
56
+ try {
57
+ if (fs.existsSync(tmpDir)) {
58
+ fs.rmSync(tmpDir, { recursive: true, force: true });
59
+ }
60
+ } catch(e) {}
61
+ });
62
+
63
+ process.on('SIGINT', () => {
64
+ try {
65
+ if (fs.existsSync(tmpDir)) {
66
+ fs.rmSync(tmpDir, { recursive: true, force: true });
67
+ }
68
+ } catch(e) {}
69
+ process.exit();
70
+ });
71
+
72
+ return tmpDir;
73
+ }
74
+
75
+ module.exports = { prepareScripts, decryptScript };