@echo off
setlocal EnableExtensions
cd /d "%~dp0\.."
set "ADB=platform-tools\adb.exe"

echo TECHNOZON X11: temporary TCP ADB maintenance mode
echo Connect the TV box by USB. TCP port 1325 will stay open only until reboot.
echo.

"%ADB%" devices
"%ADB%" shell su 0 sh -c "setprop service.adb.tcp.port 1325; stop adbd; start adbd"
if errorlevel 1 (
  echo ERROR: USB ADB or root is unavailable.
  pause
  exit /b 1
)

echo TCP ADB requested on port 1325. Reboot closes it again.
pause
