本教程是对 [1], [2], [3] 的复现,实现了 Android 11+ 开机解锁屏幕后自动开启 ADB WiFi 的 5555 端口,无需 ROOT 和电脑。如需无人值守,请将屏幕锁设置为 无。本文不解释是什么,为什么,只介绍怎么做。
注意:本方法只适用于 WIFI 不会变化的场景,如果要在多个 WIFI 下使用,每个都要设置一次。
| #!/bin/sh | |
| # https://unix.stackexchange.com/questions/277202/use-a-different-socket-than-dev-log-system-wide | |
| # https://blog.daveeddy.com/2018/09/26/logging-for-runit-on-void-linux-with-svlogger/ | |
| # Define the new and old log paths | |
| NEW_LOG_PATH="/ved/log" | |
| OLD_LOG_PATH="/dev/log" | |
| # Function to patch binaries |
| #!/bin/sh | |
| reverse_all() { | |
| input_file="$1" | |
| # shellcheck disable=SC2016 | |
| sed '2,$G;h;$!d' "$input_file" | |
| } | |
| reverse_inner_group_by_prefix() { | |
| input_file="$1" |
| { | |
| "inbounds": [ | |
| { | |
| "type": "mixed", | |
| "listen": "::", | |
| "listen_port": 10000 | |
| } | |
| ], | |
| "outbounds": [ | |
| { |
| #!/bin/sh | |
| # NTP | |
| adb shell settings put global ntp_server ntp.aliyun.com | |
| # CPD | |
| adb shell settings put global captive_portal_http_url http://connect.rom.miui.com/generate_204 | |
| adb shell settings put global captive_portal_https_url https://connect.rom.miui.com/generate_204 | |
| adb shell settings put global captive_portal_use_https 1 | |
| adb shell settings put global captive_portal_detection_enabled 1 |
| #!/bin/sh | |
| find_ancestors() { | |
| pid=$1 | |
| while [ "$pid" -ne 0 ]; do | |
| echo "$pid" | |
| pid=$(awk '{print $4}' /proc/"$pid"/stat 2>/dev/null) | |
| done | |
| } |
| #!/bin/sh | |
| BASEDIR="$(dirname "$0")" | |
| ( | |
| cd "$BASEDIR" || exit 1 | |
| ./kill-xray | |
| sleep 3 | |
| ./start-xray | |
| ) |
本教程是对 [1], [2], [3] 的复现,实现了 Android 11+ 开机解锁屏幕后自动开启 ADB WiFi 的 5555 端口,无需 ROOT 和电脑。如需无人值守,请将屏幕锁设置为 无。本文不解释是什么,为什么,只介绍怎么做。
注意:本方法只适用于 WIFI 不会变化的场景,如果要在多个 WIFI 下使用,每个都要设置一次。
| Windows Registry Editor Version 5.00 | |
| [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NlaSvc\Parameters\Internet] | |
| "ActiveDnsProbeContent"="114.114.114.114" | |
| "ActiveDnsProbeContentV6"="2409:8088:2000:2002::98" | |
| "ActiveDnsProbeHost"="public1.114dns.com" | |
| "ActiveDnsProbeHostV6"="dns.ipv6dns.com" | |
| "ActiveWebProbeContent"="ok" | |
| "ActiveWebProbeContentV6"="ok" | |
| "ActiveWebProbeHost"="data.bilibili.com" |
| #!/usr/bin/env bash | |
| jq() { | |
| python3 -c "$( | |
| cat <<EOF | |
| import sys, json | |
| json.dump($1$2, sys.stdout, separators=(',', ':'), ensure_ascii=False) | |
| EOF | |
| )" |