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
87bc4673
Commit
87bc4673
authored
Jun 03, 2013
by
Max Lv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no more dns proxy option
parent
d516af3c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
30 deletions
+6
-30
src/main/res/xml/pref_feature.xml
src/main/res/xml/pref_feature.xml
+0
-6
src/main/scala/com/github/shadowsocks/ShadowsocksService.scala
...ain/scala/com/github/shadowsocks/ShadowsocksService.scala
+3
-8
src/main/scala/com/github/shadowsocks/Utils.scala
src/main/scala/com/github/shadowsocks/Utils.scala
+3
-16
No files found.
src/main/res/xml/pref_feature.xml
View file @
87bc4673
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<PreferenceScreen
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<CheckBoxPreference
android:defaultValue=
"true"
android:key=
"isDNSProxy"
android:summary=
"@string/dns_proxy_summary"
android:title=
"@string/dns_proxy"
>
</CheckBoxPreference>
<CheckBoxPreference
<CheckBoxPreference
android:defaultValue=
"true"
android:defaultValue=
"true"
android:key=
"isGFWList"
android:key=
"isGFWList"
...
...
src/main/scala/com/github/shadowsocks/ShadowsocksService.scala
View file @
87bc4673
...
@@ -272,9 +272,6 @@ class ShadowsocksService extends Service {
...
@@ -272,9 +272,6 @@ class ShadowsocksService extends Service {
/** Called when the activity is first created. */
/** Called when the activity is first created. */
def
handleConnection
:
Boolean
=
{
def
handleConnection
:
Boolean
=
{
if
(
config
.
isHTTPProxy
)
{
startPolipoDaemon
()
}
startShadowsocksDaemon
()
startShadowsocksDaemon
()
startDnsDaemon
()
startDnsDaemon
()
startRedsocksDaemon
()
startRedsocksDaemon
()
...
@@ -438,11 +435,9 @@ class ShadowsocksService extends Service {
...
@@ -438,11 +435,9 @@ class ShadowsocksService extends Service {
init_sb
.
append
(
cmd_bypass
.
replace
(
"-d 0.0.0.0"
,
"-d "
+
config
.
proxy
))
init_sb
.
append
(
cmd_bypass
.
replace
(
"-d 0.0.0.0"
,
"-d "
+
config
.
proxy
))
}
}
init_sb
.
append
(
cmd_bypass
.
replace
(
"0.0.0.0"
,
"127.0.0.1"
))
init_sb
.
append
(
cmd_bypass
.
replace
(
"0.0.0.0"
,
"127.0.0.1"
))
if
(!
config
.
isDNSProxy
)
{
init_sb
.
append
(
cmd_bypass
.
replace
(
"-d 0.0.0.0"
,
"--dport "
+
53
))
init_sb
.
append
(
cmd_bypass
.
replace
(
"-d 0.0.0.0"
,
"--dport "
+
53
))
init_sb
init_sb
.
append
(
cmd_bypass
.
replace
(
"-d 0.0.0.0"
,
"-m owner --uid-owner "
+
getApplicationInfo
.
uid
))
.
append
(
cmd_bypass
.
replace
(
"-d 0.0.0.0"
,
"-m owner --uid-owner "
+
getApplicationInfo
.
uid
))
}
if
(
hasRedirectSupport
)
{
if
(
hasRedirectSupport
)
{
init_sb
init_sb
.
append
(
Utils
.
getIptables
)
.
append
(
Utils
.
getIptables
)
...
...
src/main/scala/com/github/shadowsocks/Utils.scala
View file @
87bc4673
...
@@ -58,8 +58,6 @@ object Key {
...
@@ -58,8 +58,6 @@ object Key {
val
isGlobalProxy
=
"isGlobalProxy"
val
isGlobalProxy
=
"isGlobalProxy"
val
isGFWList
=
"isGFWList"
val
isGFWList
=
"isGFWList"
val
isBypassApps
=
"isBypassApps"
val
isBypassApps
=
"isBypassApps"
val
isDNSProxy
=
"isDNSProxy"
val
isHTTPProxy
=
"isHTTPProxy"
val
proxy
=
"proxy"
val
proxy
=
"proxy"
val
sitekey
=
"sitekey"
val
sitekey
=
"sitekey"
...
@@ -72,8 +70,6 @@ case class Config (
...
@@ -72,8 +70,6 @@ case class Config (
isGlobalProxy
:
Boolean
,
isGlobalProxy
:
Boolean
,
isGFWList
:
Boolean
,
isGFWList
:
Boolean
,
isBypassApps
:
Boolean
,
isBypassApps
:
Boolean
,
isDNSProxy
:
Boolean
,
isHTTPProxy
:
Boolean
,
var
proxy
:
String
,
var
proxy
:
String
,
sitekey
:
String
,
sitekey
:
String
,
encMethod
:
String
,
encMethod
:
String
,
...
@@ -104,8 +100,6 @@ object Extra {
...
@@ -104,8 +100,6 @@ object Extra {
edit
.
putBoolean
(
Key
.
isGlobalProxy
,
config
.
isGlobalProxy
)
edit
.
putBoolean
(
Key
.
isGlobalProxy
,
config
.
isGlobalProxy
)
edit
.
putBoolean
(
Key
.
isGFWList
,
config
.
isGFWList
)
edit
.
putBoolean
(
Key
.
isGFWList
,
config
.
isGFWList
)
edit
.
putBoolean
(
Key
.
isBypassApps
,
config
.
isBypassApps
)
edit
.
putBoolean
(
Key
.
isBypassApps
,
config
.
isBypassApps
)
edit
.
putBoolean
(
Key
.
isDNSProxy
,
config
.
isDNSProxy
)
edit
.
putBoolean
(
Key
.
isHTTPProxy
,
config
.
isHTTPProxy
)
edit
.
putString
(
Key
.
proxy
,
config
.
proxy
)
edit
.
putString
(
Key
.
proxy
,
config
.
proxy
)
edit
.
putString
(
Key
.
sitekey
,
config
.
sitekey
)
edit
.
putString
(
Key
.
sitekey
,
config
.
sitekey
)
...
@@ -120,24 +114,20 @@ object Extra {
...
@@ -120,24 +114,20 @@ object Extra {
val
isGlobalProxy
=
intent
.
getBooleanExtra
(
Key
.
isGlobalProxy
,
false
)
val
isGlobalProxy
=
intent
.
getBooleanExtra
(
Key
.
isGlobalProxy
,
false
)
val
isGFWList
=
intent
.
getBooleanExtra
(
Key
.
isGFWList
,
false
)
val
isGFWList
=
intent
.
getBooleanExtra
(
Key
.
isGFWList
,
false
)
val
isBypassApps
=
intent
.
getBooleanExtra
(
Key
.
isBypassApps
,
false
)
val
isBypassApps
=
intent
.
getBooleanExtra
(
Key
.
isBypassApps
,
false
)
val
isDNSProxy
=
intent
.
getBooleanExtra
(
Key
.
isDNSProxy
,
false
)
val
isHTTPProxy
=
intent
.
getBooleanExtra
(
Key
.
isHTTPProxy
,
false
)
val
proxy
=
intent
.
getStringExtra
(
Key
.
proxy
)
val
proxy
=
intent
.
getStringExtra
(
Key
.
proxy
)
val
sitekey
=
intent
.
getStringExtra
(
Key
.
sitekey
)
val
sitekey
=
intent
.
getStringExtra
(
Key
.
sitekey
)
val
encMethod
=
intent
.
getStringExtra
(
Key
.
encMethod
)
val
encMethod
=
intent
.
getStringExtra
(
Key
.
encMethod
)
val
remotePort
=
intent
.
getIntExtra
(
Key
.
remotePort
,
1984
)
val
remotePort
=
intent
.
getIntExtra
(
Key
.
remotePort
,
1984
)
val
localPort
=
intent
.
getIntExtra
(
Key
.
localPort
,
1984
)
val
localPort
=
intent
.
getIntExtra
(
Key
.
localPort
,
1984
)
new
Config
(
isGlobalProxy
,
isGFWList
,
isBypassApps
,
isDNSProxy
,
new
Config
(
isGlobalProxy
,
isGFWList
,
isBypassApps
,
isHTTPProxy
,
proxy
,
sitekey
,
encMethod
,
remotePort
,
localPort
)
proxy
,
sitekey
,
encMethod
,
remotePort
,
localPort
)
}
}
def
put
(
settings
:
SharedPreferences
,
intent
:
Intent
)
{
def
put
(
settings
:
SharedPreferences
,
intent
:
Intent
)
{
val
isGlobalProxy
=
settings
.
getBoolean
(
Key
.
isGlobalProxy
,
false
)
val
isGlobalProxy
=
settings
.
getBoolean
(
Key
.
isGlobalProxy
,
false
)
val
isGFWList
=
settings
.
getBoolean
(
Key
.
isGFWList
,
false
)
val
isGFWList
=
settings
.
getBoolean
(
Key
.
isGFWList
,
false
)
val
isBypassApps
=
settings
.
getBoolean
(
Key
.
isBypassApps
,
false
)
val
isBypassApps
=
settings
.
getBoolean
(
Key
.
isBypassApps
,
false
)
val
isDNSProxy
=
settings
.
getBoolean
(
Key
.
isDNSProxy
,
false
)
val
isHTTPProxy
=
settings
.
getBoolean
(
Key
.
isHTTPProxy
,
false
)
val
proxy
=
settings
.
getString
(
Key
.
proxy
,
"127.0.0.1"
)
match
{
val
proxy
=
settings
.
getString
(
Key
.
proxy
,
"127.0.0.1"
)
match
{
case
"198.199.101.152"
=>
"s.maxcdn.info"
case
"198.199.101.152"
=>
"s.maxcdn.info"
case
s
:
String
=>
s
case
s
:
String
=>
s
...
@@ -153,8 +143,7 @@ object Extra {
...
@@ -153,8 +143,7 @@ object Extra {
}
}
}
}
val
localProt
:
Int
=
try
{
val
localProt
:
Int
=
try
{
val
p
=
Integer
.
valueOf
(
settings
.
getString
(
Key
.
localPort
,
"1984"
))
Integer
.
valueOf
(
settings
.
getString
(
Key
.
localPort
,
"1984"
))
if
(
isHTTPProxy
)
p
-
1
else
p
}
catch
{
}
catch
{
case
ex
:
NumberFormatException
=>
{
case
ex
:
NumberFormatException
=>
{
1984
1984
...
@@ -164,8 +153,6 @@ object Extra {
...
@@ -164,8 +153,6 @@ object Extra {
intent
.
putExtra
(
Key
.
isGlobalProxy
,
isGlobalProxy
)
intent
.
putExtra
(
Key
.
isGlobalProxy
,
isGlobalProxy
)
intent
.
putExtra
(
Key
.
isGFWList
,
isGFWList
)
intent
.
putExtra
(
Key
.
isGFWList
,
isGFWList
)
intent
.
putExtra
(
Key
.
isBypassApps
,
isBypassApps
)
intent
.
putExtra
(
Key
.
isBypassApps
,
isBypassApps
)
intent
.
putExtra
(
Key
.
isDNSProxy
,
isDNSProxy
)
intent
.
putExtra
(
Key
.
isHTTPProxy
,
isHTTPProxy
)
intent
.
putExtra
(
Key
.
proxy
,
proxy
)
intent
.
putExtra
(
Key
.
proxy
,
proxy
)
intent
.
putExtra
(
Key
.
sitekey
,
sitekey
)
intent
.
putExtra
(
Key
.
sitekey
,
sitekey
)
...
...
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