-
Notifications
You must be signed in to change notification settings - Fork 7
/
customize.sh
90 lines (72 loc) · 2.34 KB
/
customize.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#!/sbin/sh
ui_print " "
ui_print " ******************************* "
ui_print " * Magisk Module NFQTTL * "
ui_print " * Version 2.8 * "
ui_print " ******************************* "
ui_print " "
APP_ABI=$(getprop ro.product.cpu.abi)
ui_print " APP_ABI: $APP_ABI "
ui_print " unzip "
ui_print " "
if [ -f "$MODPATH/libs/$APP_ABI/nfqttl" ]
then
ui_print " * Copying binary for $APP_ABI! "
cp -afv $MODPATH/libs/$APP_ABI/nfqttl $MODPATH/nfqttl
rm -rf $MODPATH/libs
else
abort " Binary file for $APP_ABI is missing! Abort installing! "
fi
pkill -9 nfqttl
cd $MODPATH
chmod 755 nfqttl
ui_print " "
ui_print " Running nfqttl "
ui_print " "
if ./nfqttl -d -s -u
then
ui_print " "
ui_print " Running nfqttl success! "
else
ui_print " "
abort " Running nfqttl FAIL. Abort installing! "
fi
iptables -t mangle -D PREROUTING -j nfqttli
iptables -t mangle -D OUTPUT -j nfqttlo
iptables -t mangle -F nfqttli
iptables -t mangle -X nfqttli
iptables -t mangle -F nfqttlo
iptables -t mangle -X nfqttlo
ip6tables -t mangle -D PREROUTING -j nfqttli
ip6tables -t mangle -D POSTROUTING -j nfqttlo
ip6tables -t mangle -F nfqttli
ip6tables -t mangle -X nfqttli
ip6tables -t mangle -F nfqttlo
ip6tables -t mangle -X nfqttlo
ui_print " "
ui_print " Set rule iptables "
ui_print " "
if iptables -t mangle -N nfqttli &&\
iptables -t mangle -A nfqttli -j NFQUEUE --queue-num 6464 &&\
iptables -t mangle -N nfqttlo &&\
iptables -t mangle -A nfqttlo -j NFQUEUE --queue-num 6464 &&\
iptables -t mangle -A PREROUTING -j nfqttli &&\
iptables -t mangle -A OUTPUT -j nfqttlo &&\
ip6tables -t mangle -N nfqttli &&\
ip6tables -t mangle -A nfqttli -j NFQUEUE --queue-num 6464 &&\
ip6tables -t mangle -N nfqttlo &&\
ip6tables -t mangle -A nfqttlo -j NFQUEUE --queue-num 6464 &&\
ip6tables -t mangle -A PREROUTING -j nfqttli &&\
ip6tables -t mangle -A POSTROUTING -j nfqttlo
then
ui_print " Set rule iptables success! "
else
abort " Set rule iptables fail. Abort installing! "
fi
set_perm $MODPATH/nfqttl 0 0 0755
set_perm $MODPATH/service.sh 0 0 0755
ui_print " "
ui_print " ******************************* "
ui_print " * Install Success! * "
ui_print " ******************************* "
ui_print " "