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
10de6ea6
Commit
10de6ea6
authored
Dec 10, 2014
by
Max Lv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remote the DNS WAR
parent
c1f55c80
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
33 deletions
+6
-33
src/main/scala/com/github/shadowsocks/Shadowsocks.scala
src/main/scala/com/github/shadowsocks/Shadowsocks.scala
+0
-1
src/main/scala/com/github/shadowsocks/ShadowsocksNatService.scala
.../scala/com/github/shadowsocks/ShadowsocksNatService.scala
+6
-32
No files found.
src/main/scala/com/github/shadowsocks/Shadowsocks.scala
View file @
10de6ea6
...
...
@@ -847,7 +847,6 @@ class Shadowsocks
}
ab
.
append
(
"mount -o ro,remount -t yaffs2 /dev/block/mtdblock3 /system"
)
Console
.
runRootCommand
(
ab
.
toArray
)
}
def
reset
()
{
...
...
src/main/scala/com/github/shadowsocks/ShadowsocksNatService.scala
View file @
10de6ea6
...
...
@@ -228,19 +228,11 @@ class ShadowsocksNatService extends Service with BaseService {
,
"-c"
,
Path
.
BASE
+
"ss-tunnel-nat.conf"
,
"-f"
,
Path
.
BASE
+
"ss-tunnel-nat.pid"
)
if
(
Utils
.
isLollipopOrAbove
)
{
cmd
+=
(
"-l"
,
"53"
)
}
else
{
cmd
+=
(
"-l"
,
"8153"
)
}
if
(
BuildConfig
.
DEBUG
)
Log
.
d
(
TAG
,
cmd
.
mkString
(
" "
))
if
(
Utils
.
isLollipopOrAbove
)
{
Console
.
runRootCommand
(
cmd
.
mkString
(
" "
))
}
else
{
Console
.
runCommand
(
cmd
.
mkString
(
" "
))
}
}
else
{
val
conf
=
ConfigUtils
...
...
@@ -263,13 +255,8 @@ class ShadowsocksNatService extends Service with BaseService {
}
def
startDnsDaemon
()
{
val
conf
=
if
(
Utils
.
isLollipopOrAbove
)
{
ConfigUtils
.
PDNSD_BYPASS
.
formatLocal
(
Locale
.
ENGLISH
,
"127.0.0.1"
,
53
,
Path
.
BASE
+
"pdnsd-nat.pid"
,
getString
(
R
.
string
.
exclude
),
8163
)
}
else
{
ConfigUtils
val
conf
=
ConfigUtils
.
PDNSD_BYPASS
.
formatLocal
(
Locale
.
ENGLISH
,
"127.0.0.1"
,
8153
,
Path
.
BASE
+
"pdnsd-nat.pid"
,
getString
(
R
.
string
.
exclude
),
8163
)
}
ConfigUtils
.
printToFile
(
new
File
(
Path
.
BASE
+
"pdnsd-nat.conf"
))(
p
=>
{
p
.
println
(
conf
)
})
...
...
@@ -277,11 +264,7 @@ class ShadowsocksNatService extends Service with BaseService {
if
(
BuildConfig
.
DEBUG
)
Log
.
d
(
TAG
,
cmd
)
if
(
Utils
.
isLollipopOrAbove
)
{
Console
.
runRootCommand
(
cmd
)
}
else
{
Console
.
runCommand
(
cmd
)
}
}
...
...
@@ -428,10 +411,8 @@ class ShadowsocksNatService extends Service with BaseService {
init_sb
.
append
(
cmd_bypass
.
replace
(
"-d 0.0.0.0"
,
"-m owner --uid-owner "
+
myUid
))
init_sb
.
append
(
cmd_bypass
.
replace
(
"-d 0.0.0.0"
,
"--dport 53"
))
if
(!
Utils
.
isLollipopOrAbove
)
{
init_sb
.
append
(
Utils
.
getIptables
+
" -t nat -A OUTPUT -p udp --dport 53 -j DNAT --to-destination 127.0.0.1:"
+
DNS_PORT
)
}
if
(
config
.
isGlobalProxy
||
config
.
isBypassApps
)
{
http_sb
.
append
(
Utils
.
getIptables
+
CMD_IPTABLES_DNAT_ADD_SOCKS
)
...
...
@@ -500,9 +481,6 @@ class ShadowsocksNatService extends Service with BaseService {
config
=
c
// register connection receiver
if
(
Utils
.
isLollipopOrAbove
)
initConnectionReceiver
()
// register close receiver
val
filter
=
new
IntentFilter
()
filter
.
addAction
(
Intent
.
ACTION_SHUTDOWN
)
...
...
@@ -559,7 +537,6 @@ class ShadowsocksNatService extends Service with BaseService {
if
(
resolved
&&
handleConnection
)
{
// Set DNS
if
(
Utils
.
isLollipopOrAbove
)
setupDns
()
flushDns
()
notifyForegroundAlert
(
getString
(
R
.
string
.
forward_success
),
...
...
@@ -583,9 +560,6 @@ class ShadowsocksNatService extends Service with BaseService {
unregisterReceiver
(
closeReceiver
)
closeReceiver
=
null
}
if
(
Utils
.
isLollipopOrAbove
)
{
destroyConnectionReceiver
()
}
// send event
application
.
tracker
.
send
(
new
HitBuilders
.
EventBuilder
()
...
...
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