This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/data/data/com.termux/files/usr/bin/bash | |
| termux-notification --id 1 -t "Scanning for ADB port..." | |
| adb_port=$(nmap -sT -p30000-50000 --open localhost | grep -m1 -oP "^\d+") | |
| if [[ -z $adb_port ]]; then | |
| termux-notification --id 1 -t "No debug port detected" -c "Tap to rescan." --action "$(realpath $0)" | |
| exit | |
| fi | |
| termux-notification --id 1 -t "ADB port detected: $adb_port. Restarting ADB..." |