Last active
February 22, 2018 03:35
-
-
Save coolicer/75bec3fd7a617fb56d64e16051fc4268 to your computer and use it in GitHub Desktop.
shadowsocks android afwall
This file contains 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
IP6TABLES=/system/bin/ip6tables | |
IPTABLES=/system/bin/iptables | |
ULIMIT=/system/bin/ulimit | |
SS_UID=`dumpsys package com.github.shadowsocks | grep userId | cut -d= -f2 - | cut -d' ' -f1 -` | |
WZRY_UID=`dumpsys package com.tencent.tmgp.sgame | grep userId | cut -d= -f2 - | cut -d' ' -f1 -` | |
PORT_DNS=5450 | |
PORT_TRANSPROXY=8200 | |
$ULIMIT -n 4096 | |
$IP6TABLES -F | |
$IP6TABLES -A INPUT -j DROP | |
$IP6TABLES -A OUTPUT -j DROP | |
$IPTABLES -t nat -F OUTPUT | |
$IPTABLES -t nat -A OUTPUT -o lo -j RETURN | |
$IPTABLES -t nat -A OUTPUT -d 127.0.0.1 -j RETURN | |
$IPTABLES -t nat -A OUTPUT -m owner --uid-owner $SS_UID -j RETURN | |
$IPTABLES -t nat -A OUTPUT -m owner --uid-owner $WZRY_UID -j RETURN | |
$IPTABLES -t nat -A OUTPUT -p tcp --dport 53 -j DNAT --to-destination 127.0.0.1:$PORT_DNS | |
$IPTABLES -t nat -A OUTPUT -p udp --dport 53 -j DNAT --to-destination 127.0.0.1:$PORT_DNS | |
$IPTABLES -t nat -A OUTPUT -p tcp -j DNAT --to-destination 127.0.0.1:$PORT_TRANSPROXY | |
$IPTABLES -t nat -A OUTPUT -p udp -j DNAT --to-destination 127.0.0.1:$PORT_TRANSPROXY |
This file contains 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
IP6TABLES=/system/bin/ip6tables | |
IPTABLES=/system/bin/iptables | |
$IPTABLES -t nat -F OUTPUT | |
$IP6TABLES -F |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment