Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
com.ccwangluo.accelerator
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sheteng
com.ccwangluo.accelerator
Commits
3b6eff6d
Commit
3b6eff6d
authored
Sep 28, 2016
by
Max Lv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #905
parent
528fea13
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
14 deletions
+19
-14
src/main/AndroidManifest.xml
src/main/AndroidManifest.xml
+2
-2
src/main/res/values/arrays.xml
src/main/res/values/arrays.xml
+0
-1
src/main/scala/com/github/shadowsocks/ShadowsocksNatService.scala
.../scala/com/github/shadowsocks/ShadowsocksNatService.scala
+7
-3
src/main/scala/com/github/shadowsocks/ShadowsocksVpnService.scala
.../scala/com/github/shadowsocks/ShadowsocksVpnService.scala
+6
-4
src/main/scala/com/github/shadowsocks/utils/Constants.scala
src/main/scala/com/github/shadowsocks/utils/Constants.scala
+4
-4
No files found.
src/main/AndroidManifest.xml
View file @
3b6eff6d
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
package=
"com.github.shadowsocks"
xmlns:tools=
"http://schemas.android.com/tools"
package=
"com.github.shadowsocks"
android:versionCode=
"16
0
"
android:versionCode=
"16
1
"
android:versionName=
"3.2.
0
"
>
android:versionName=
"3.2.
1
"
>
<uses-permission
android:name=
"android.permission.INTERNET"
/>
<uses-permission
android:name=
"android.permission.INTERNET"
/>
<uses-permission
android:name=
"android.permission.ACCESS_NETWORK_STATE"
/>
<uses-permission
android:name=
"android.permission.ACCESS_NETWORK_STATE"
/>
...
...
src/main/res/values/arrays.xml
View file @
3b6eff6d
...
@@ -116,6 +116,5 @@
...
@@ -116,6 +116,5 @@
<item>
196.0.0.0/6
</item>
<item>
196.0.0.0/6
</item>
<item>
200.0.0.0/5
</item>
<item>
200.0.0.0/5
</item>
<item>
208.0.0.0/4
</item>
<item>
208.0.0.0/4
</item>
<item>
224.0.0.0/3
</item>
</string-array>
</string-array>
</resources>
</resources>
src/main/scala/com/github/shadowsocks/ShadowsocksNatService.scala
View file @
3b6eff6d
...
@@ -178,18 +178,22 @@ class ShadowsocksNatService extends BaseService {
...
@@ -178,18 +178,22 @@ class ShadowsocksNatService extends BaseService {
def
startDnsDaemon
()
{
def
startDnsDaemon
()
{
val
reject
=
if
(
profile
.
ipv6
)
"224.0.0.0/3"
else
"224.0.0.0/3, ::/0"
val
conf
=
profile
.
route
match
{
val
conf
=
profile
.
route
match
{
case
Route
.
BYPASS_CHN
|
Route
.
BYPASS_LAN_CHN
|
Route
.
GFWLIST
=>
{
case
Route
.
BYPASS_CHN
|
Route
.
BYPASS_LAN_CHN
|
Route
.
GFWLIST
=>
{
ConfigUtils
.
PDNSD_DIRECT
.
formatLocal
(
Locale
.
ENGLISH
,
getApplicationInfo
.
dataDir
,
ConfigUtils
.
PDNSD_DIRECT
.
formatLocal
(
Locale
.
ENGLISH
,
getApplicationInfo
.
dataDir
,
"127.0.0.1"
,
profile
.
localPort
+
53
,
"1.2.4.8, 114.114.114.114"
,
""
,
profile
.
localPort
+
63
,
""
)
"127.0.0.1"
,
profile
.
localPort
+
53
,
"1.2.4.8, 114.114.114.114"
,
reject
,
profile
.
localPort
+
63
,
reject
)
}
}
case
Route
.
CHINALIST
=>
{
case
Route
.
CHINALIST
=>
{
ConfigUtils
.
PDNSD_DIRECT
.
formatLocal
(
Locale
.
ENGLISH
,
getApplicationInfo
.
dataDir
,
ConfigUtils
.
PDNSD_DIRECT
.
formatLocal
(
Locale
.
ENGLISH
,
getApplicationInfo
.
dataDir
,
"127.0.0.1"
,
profile
.
localPort
+
53
,
"8.8.8.8, 208.67.222.222"
,
""
,
profile
.
localPort
+
63
,
""
)
"127.0.0.1"
,
profile
.
localPort
+
53
,
"8.8.8.8, 208.67.222.222"
,
reject
,
profile
.
localPort
+
63
,
reject
)
}
}
case
_
=>
{
case
_
=>
{
ConfigUtils
.
PDNSD_LOCAL
.
formatLocal
(
Locale
.
ENGLISH
,
getApplicationInfo
.
dataDir
,
ConfigUtils
.
PDNSD_LOCAL
.
formatLocal
(
Locale
.
ENGLISH
,
getApplicationInfo
.
dataDir
,
"127.0.0.1"
,
profile
.
localPort
+
53
,
profile
.
localPort
+
63
,
""
)
"127.0.0.1"
,
profile
.
localPort
+
53
,
profile
.
localPort
+
63
,
reject
)
}
}
}
}
...
...
src/main/scala/com/github/shadowsocks/ShadowsocksVpnService.scala
View file @
3b6eff6d
...
@@ -296,19 +296,21 @@ class ShadowsocksVpnService extends VpnService with BaseService {
...
@@ -296,19 +296,21 @@ class ShadowsocksVpnService extends VpnService with BaseService {
}
}
def
startDnsDaemon
()
{
def
startDnsDaemon
()
{
val
ipv6
=
if
(
profile
.
ipv6
)
""
else
"reject = ::/0;
"
val
reject
=
if
(
profile
.
ipv6
)
"224.0.0.0/3"
else
"224.0.0.0/3, ::/0
"
val
conf
=
profile
.
route
match
{
val
conf
=
profile
.
route
match
{
case
Route
.
BYPASS_CHN
|
Route
.
BYPASS_LAN_CHN
|
Route
.
GFWLIST
=>
{
case
Route
.
BYPASS_CHN
|
Route
.
BYPASS_LAN_CHN
|
Route
.
GFWLIST
=>
{
ConfigUtils
.
PDNSD_DIRECT
.
formatLocal
(
Locale
.
ENGLISH
,
getApplicationInfo
.
dataDir
,
ConfigUtils
.
PDNSD_DIRECT
.
formatLocal
(
Locale
.
ENGLISH
,
getApplicationInfo
.
dataDir
,
"0.0.0.0"
,
profile
.
localPort
+
53
,
"1.2.4.8, 114.114.114.114"
,
ipv6
,
profile
.
localPort
+
63
,
ipv6
)
"0.0.0.0"
,
profile
.
localPort
+
53
,
"1.2.4.8, 114.114.114.114"
,
reject
,
profile
.
localPort
+
63
,
reject
)
}
}
case
Route
.
CHINALIST
=>
{
case
Route
.
CHINALIST
=>
{
ConfigUtils
.
PDNSD_DIRECT
.
formatLocal
(
Locale
.
ENGLISH
,
getApplicationInfo
.
dataDir
,
ConfigUtils
.
PDNSD_DIRECT
.
formatLocal
(
Locale
.
ENGLISH
,
getApplicationInfo
.
dataDir
,
"0.0.0.0"
,
profile
.
localPort
+
53
,
"8.8.8.8, 208.67.222.222"
,
ipv6
,
profile
.
localPort
+
63
,
ipv6
)
"0.0.0.0"
,
profile
.
localPort
+
53
,
"8.8.8.8, 208.67.222.222"
,
reject
,
profile
.
localPort
+
63
,
reject
)
}
}
case
_
=>
{
case
_
=>
{
ConfigUtils
.
PDNSD_LOCAL
.
formatLocal
(
Locale
.
ENGLISH
,
getApplicationInfo
.
dataDir
,
ConfigUtils
.
PDNSD_LOCAL
.
formatLocal
(
Locale
.
ENGLISH
,
getApplicationInfo
.
dataDir
,
"0.0.0.0"
,
profile
.
localPort
+
53
,
profile
.
localPort
+
63
,
ipv6
)
"0.0.0.0"
,
profile
.
localPort
+
53
,
profile
.
localPort
+
63
,
reject
)
}
}
}
}
Utils
.
printToFile
(
new
File
(
getApplicationInfo
.
dataDir
+
"/pdnsd-vpn.conf"
))(
p
=>
{
Utils
.
printToFile
(
new
File
(
getApplicationInfo
.
dataDir
+
"/pdnsd-vpn.conf"
))(
p
=>
{
...
...
src/main/scala/com/github/shadowsocks/utils/Constants.scala
View file @
3b6eff6d
...
@@ -83,7 +83,7 @@ object ConfigUtils {
...
@@ -83,7 +83,7 @@ object ConfigUtils {
| label = "local";
| label = "local";
| ip = 127.0.0.1;
| ip = 127.0.0.1;
| port = %d;
| port = %d;
|
%s
|
reject = %s;
| reject_policy = negate;
| reject_policy = negate;
| reject_recursively = on;
| reject_recursively = on;
|}
|}
...
@@ -117,8 +117,8 @@ object ConfigUtils {
...
@@ -117,8 +117,8 @@ object ConfigUtils {
| ip = %s;
| ip = %s;
| timeout = 3;
| timeout = 3;
| query_method = udp_only;
| query_method = udp_only;
|
%s
|
reject = %s;
| reject_policy =
negate
;
| reject_policy =
fail
;
| reject_recursively = on;
| reject_recursively = on;
|}
|}
|
|
...
@@ -127,7 +127,7 @@ object ConfigUtils {
...
@@ -127,7 +127,7 @@ object ConfigUtils {
| ip = 127.0.0.1;
| ip = 127.0.0.1;
| query_method = tcp_only;
| query_method = tcp_only;
| port = %d;
| port = %d;
|
%s
|
reject = %s;
| reject_policy = negate;
| reject_policy = negate;
| reject_recursively = on;
| reject_recursively = on;
|}
|}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment