19 lines
869 B
Bash
19 lines
869 B
Bash
#!/system/bin/sh
|
|
export PATH="/data/adb/magisk:/data/adb/ksu/bin:/data/adb/ap/bin:$PATH"
|
|
echo "alive=$(pidof trusttunnel_client)"
|
|
# check listening: port 10800 = 0x2A30 -> little endian in /proc = 302A0000?
|
|
# actually format is hex IP:PORT where PORT is big-endian hex
|
|
# 10800 = 0x2A30
|
|
grep -E ':2A30 ' /proc/net/tcp /proc/net/tcp6 2>/dev/null && echo PORT_10800_LISTEN
|
|
# try magisk busybox wget/curl
|
|
which curl; which busybox
|
|
if command -v curl >/dev/null; then
|
|
curl -x socks5h://127.0.0.1:10800 -m 20 -sS https://1.1.1.1/cdn-cgi/trace | head -5
|
|
elif [ -x /data/adb/box/bin/curl ]; then
|
|
/data/adb/box/bin/curl -x socks5h://127.0.0.1:10800 -m 20 -sS https://1.1.1.1/cdn-cgi/trace | head -5
|
|
else
|
|
# minimal SOCKS5 handshake via toybox/dd? skip
|
|
echo "NO_CURL - checking CONNECTED in log"
|
|
grep 'Successfully connected' /data/adb/box/run/sidecar.log | tail -3
|
|
fi
|