Skip to content

Instantly share code, notes, and snippets.

@Howard20181
Created August 15, 2022 18:17
Show Gist options
  • Save Howard20181/cea5dcb86c7eb08725219f1b88e24a0c to your computer and use it in GitHub Desktop.
Save Howard20181/cea5dcb86c7eb08725219f1b88e24a0c to your computer and use it in GitHub Desktop.
Put it to `/data/adb/service.d`
#!/system/bin/sh
# start after emulated storage is setup
while [ ! -d "/storage/emulated/0/Android" ]; do
sleep 3
done
gethostip() {
ip=$(ip route list match 0 table all scope global | cut -F3)
if [ -z "$ip" ]; then
return 1
else
echo $ip
fi
}
while ! (gethostip); do
sleep 3
done
settings put global http_proxy $(gethostip):7890
settings put global https_proxy $(gethostip):7890
settings put global window_animation_scale 1
settings put global transition_animation_scale 1
settings put global animator_duration_scale 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment