Skip to content

Instantly share code, notes, and snippets.

View Howard20181's full-sized avatar
🏥
Running

Howard Wu Howard20181

🏥
Running
View GitHub Profile
@Howard20181
Howard20181 / WSA-custom.sh
Created August 15, 2022 18:17
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
#!/bin/bash
HOST_IP=$(cat /etc/resolv.conf | grep nameserver | awk '{ print $2 }')
PROXY_PORT="7890"
PROXY_HTTP="http://${HOST_IP}:${PROXY_PORT}"
export {http,https,ftp}_proxy="$PROXY_HTTP"
export {HTTP,HTTPS,FTP}_PROXY="$PROXY_HTTP"
git config --global http.proxy "$PROXY_HTTP"
git config --global https.proxy "$PROXY_HTTP"