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
5547b422
Commit
5547b422
authored
Dec 02, 2014
by
Max Lv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix some DNS issues
parent
3dba9663
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
8 deletions
+9
-8
build.sbt
build.sbt
+1
-1
src/main/scala/com/github/shadowsocks/ShadowsocksNatService.scala
.../scala/com/github/shadowsocks/ShadowsocksNatService.scala
+2
-1
src/main/scala/com/github/shadowsocks/utils/ConfigUtils.scala
...main/scala/com/github/shadowsocks/utils/ConfigUtils.scala
+6
-6
No files found.
build.sbt
View file @
5547b422
...
@@ -20,7 +20,7 @@ resolvers += "madeye private releases" at "http://madeye-maven-repository.google
...
@@ -20,7 +20,7 @@ resolvers += "madeye private releases" at "http://madeye-maven-repository.google
libraryDependencies
++=
Seq
(
libraryDependencies
++=
Seq
(
"dnsjava"
%
"dnsjava"
%
"2.1.5"
,
"dnsjava"
%
"dnsjava"
%
"2.1.5"
,
"
org.scalaj"
%%
"scalaj-http"
%
"0.3.10
"
,
"
com.github.kevinsawicki"
%
"http-request"
%
"5.6
"
,
"commons-net"
%
"commons-net"
%
"3.3"
,
"commons-net"
%
"commons-net"
%
"3.3"
,
"com.google.zxing"
%
"android-integration"
%
"2.2"
"com.google.zxing"
%
"android-integration"
%
"2.2"
)
)
...
...
src/main/scala/com/github/shadowsocks/ShadowsocksNatService.scala
View file @
5547b422
...
@@ -107,7 +107,7 @@ class ShadowsocksNatService extends Service with BaseService {
...
@@ -107,7 +107,7 @@ class ShadowsocksNatService extends Service with BaseService {
}
}
def
resetDns
()
=
{
def
resetDns
()
=
{
setDnsForAllNetwork
(
"
8.8.8.8 208.67.222.222 114.114.114.114
"
)
setDnsForAllNetwork
(
"
114.114.114.114 8.8.8.8 208.67.222.222
"
)
}
}
def
destroyConnectionReceiver
()
{
def
destroyConnectionReceiver
()
{
...
@@ -486,6 +486,7 @@ class ShadowsocksNatService extends Service with BaseService {
...
@@ -486,6 +486,7 @@ class ShadowsocksNatService extends Service with BaseService {
config
=
ConfigUtils
.
getPublicConfig
(
getBaseContext
,
holder
.
getContainer
,
config
)
config
=
ConfigUtils
.
getPublicConfig
(
getBaseContext
,
holder
.
getContainer
,
config
)
}
catch
{
}
catch
{
case
ex
:
Exception
=>
case
ex
:
Exception
=>
Log
.
e
(
TAG
,
ex
.
getMessage
)
changeState
(
State
.
STOPPED
,
getString
(
R
.
string
.
service_failed
))
changeState
(
State
.
STOPPED
,
getString
(
R
.
string
.
service_failed
))
stopRunner
()
stopRunner
()
config
=
null
config
=
null
...
...
src/main/scala/com/github/shadowsocks/utils/ConfigUtils.scala
View file @
5547b422
...
@@ -42,7 +42,7 @@ package com.github.shadowsocks.utils
...
@@ -42,7 +42,7 @@ package com.github.shadowsocks.utils
import
android.content.
{
SharedPreferences
,
Context
}
import
android.content.
{
SharedPreferences
,
Context
}
import
com.github.shadowsocks.ShadowsocksApplication
import
com.github.shadowsocks.ShadowsocksApplication
import
com.google.android.gms.tagmanager.Container
import
com.google.android.gms.tagmanager.Container
import
scalaj.http.
{
HttpOptions
,
Http
}
import
com.github.kevinsawicki.http.HttpRequest
import
com.github.shadowsocks.aidl.Config
import
com.github.shadowsocks.aidl.Config
object
ConfigUtils
{
object
ConfigUtils
{
...
@@ -183,12 +183,12 @@ object ConfigUtils {
...
@@ -183,12 +183,12 @@ object ConfigUtils {
def
getPublicConfig
(
context
:
Context
,
container
:
Container
,
config
:
Config
)
:
Config
=
{
def
getPublicConfig
(
context
:
Context
,
container
:
Container
,
config
:
Config
)
:
Config
=
{
val
url
=
container
.
getString
(
"proxy_url"
)
val
url
=
container
.
getString
(
"proxy_url"
)
val
sig
=
Utils
.
getSignature
(
context
)
val
sig
=
Utils
.
getSignature
(
context
)
val
list
=
Http
val
list
=
Http
Request
.
post
(
url
)
.
post
(
url
)
.
params
(
"sig"
->
sig
)
.
connectTimeout
(
2000
)
.
option
(
HttpOptions
.
connTimeout
(
1000
)
)
.
readTimeout
(
2000
)
.
option
(
HttpOptions
.
readTimeout
(
5000
)
)
.
send
(
"sig="
+
sig
)
.
asString
.
body
val
proxies
=
util
.
Random
.
shuffle
(
list
.
split
(
'|'
).
toSeq
).
toSeq
val
proxies
=
util
.
Random
.
shuffle
(
list
.
split
(
'|'
).
toSeq
).
toSeq
val
proxy
=
proxies
(
0
).
split
(
':'
)
val
proxy
=
proxies
(
0
).
split
(
':'
)
...
...
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