forked from wpc009/huaweigeneric-ril
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME
86 lines (67 loc) · 2.14 KB
/
README
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
The modules has still a few problems:
* required modify init.rc add:
on device-added-/dev/ttyUSB0
chmod 0777 /dev/ttyUSB0
on device-added-/dev/ttyUSB1
chmod 0777 /dev/ttyUSB1
on device-added-/dev/ttyUSB2
chmod 0777 /dev/ttyUSB2
on device-added-/dev/ttyUSB3
chmod 0777 /dev/ttyUSB3
on device-added-/dev/ttyUSB4
chmod 0777 /dev/ttyUSB4
on device-added-/dev/ttyUSB5
chmod 0777 /dev/ttyUSB5
on boot
service ril-daemon /system/bin/rild
socket rild stream 660 root radio
socket rild-debug stream 660 radio system
user root
group radio cache inet misc audio
* Edit system/build.prop ,add:
# for 3g
rild.libpath=/system/lib/libhuaweigeneric-ril.so
rild.libargs=-d /dev/ttyUSB2 -v /dev/ttyUSB1
keyguard.no_require_sim=1
----
pppd must be suid ROOT, and kernel must include ppp support compiled in
/system/etc/ppp/ip-up and also /system/etc/ppp/ip-down must also be suid ROOT
----
You also need the following files in /system/etc/ppp
----
/system/etc/ppp/ip-up:
#!/system/bin/sh
case $1 in
ppp1)
/android/bin/iptables --flush;
/android/bin/iptables --table nat --flush;
/android/bin/iptables --delete-chain;
/android/bin/iptables --table nat --append POSTROUTING --out-interface ppp0 -j MASQUERADE;
/android/bin/iptables --append FORWARD --in-interface ppp1 -j ACCEPT;
echo 0 > /proc/sys/net/ipv4/ip_forward;
echo 1 > /proc/sys/net/ipv4/ip_forward;
;;
ppp0)
/system/bin/setprop "net.interfaces.defaultroute" "$LINKNAME";
;;
esac
/system/bin/setprop "net.$LINKNAME.dns1" "$DNS1"
/system/bin/setprop "net.$LINKNAME.dns2" "$DNS2"
/system/bin/setprop "net.$LINKNAME.local-ip" "$IPLOCAL"
/system/bin/setprop "net.$LINKNAME.remote-ip" "$IPREMOTE"
/system/bin/setprop "net.$LINKNAME.gw" "$IPREMOTE"
/system/bin/setprop "net.$LINKNAME.if" "$IFNAME"
----
/system/etc/ppp/ip-down:
#!/system/bin/sh
case $1 in
ppp1)
echo 0 > /proc/sys/net/ipv4/ip_forward;
;;
esac
/system/bin/setprop "net.$LINKNAME.dns1" ""
/system/bin/setprop "net.$LINKNAME.dns2" ""
/system/bin/setprop "net.$LINKNAME.local-ip" ""
/system/bin/setprop "net.$LINKNAME.remote-ip" ""
/system/bin/setprop "net.$LINKNAME.gw" ""
/system/bin/setprop "net.$LINKNAME.if" ""