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
4ee9eea2
Commit
4ee9eea2
authored
May 20, 2013
by
Max Lv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clean up
parent
fbcf90e6
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
20 deletions
+9
-20
src/main/scala/com/github/shadowsocks/AppManager.scala
src/main/scala/com/github/shadowsocks/AppManager.scala
+1
-2
src/main/scala/com/github/shadowsocks/ShadowVpnService.scala
src/main/scala/com/github/shadowsocks/ShadowVpnService.scala
+1
-5
src/main/scala/com/github/shadowsocks/ShadowsocksService.scala
...ain/scala/com/github/shadowsocks/ShadowsocksService.scala
+3
-7
src/main/scala/com/github/shadowsocks/preferences/PasswordEditTextPreference.scala
.../shadowsocks/preferences/PasswordEditTextPreference.scala
+2
-3
src/main/scala/com/github/shadowsocks/preferences/SummaryEditTextPreference.scala
...b/shadowsocks/preferences/SummaryEditTextPreference.scala
+2
-3
No files found.
src/main/scala/com/github/shadowsocks/AppManager.scala
View file @
4ee9eea2
...
@@ -221,8 +221,7 @@ class AppManager extends SherlockActivity with OnCheckedChangeListener with OnCl
...
@@ -221,8 +221,7 @@ class AppManager extends SherlockActivity with OnCheckedChangeListener with OnCl
super
.
onCreate
(
savedInstanceState
)
super
.
onCreate
(
savedInstanceState
)
this
.
setContentView
(
R
.
layout
.
layout_apps
)
this
.
setContentView
(
R
.
layout
.
layout_apps
)
this
.
overlay
=
View
.
inflate
(
this
,
R
.
layout
.
overlay
,
null
).
asInstanceOf
[
TextView
]
this
.
overlay
=
View
.
inflate
(
this
,
R
.
layout
.
overlay
,
null
).
asInstanceOf
[
TextView
]
getWindowManager
getWindowManager
.
addView
(
overlay
,
new
.
addView
(
overlay
,
new
WindowManager
.
LayoutParams
(
LayoutParams
.
WRAP_CONTENT
,
LayoutParams
.
WRAP_CONTENT
,
WindowManager
.
LayoutParams
(
LayoutParams
.
WRAP_CONTENT
,
LayoutParams
.
WRAP_CONTENT
,
WindowManager
.
LayoutParams
.
TYPE_APPLICATION
,
WindowManager
.
LayoutParams
.
TYPE_APPLICATION
,
WindowManager
.
LayoutParams
.
FLAG_NOT_FOCUSABLE
|
WindowManager
.
LayoutParams
.
FLAG_NOT_FOCUSABLE
|
...
...
src/main/scala/com/github/shadowsocks/ShadowVpnService.scala
View file @
4ee9eea2
...
@@ -250,7 +250,6 @@ class ShadowVpnService extends VpnService {
...
@@ -250,7 +250,6 @@ class ShadowVpnService extends VpnService {
val
t
:
Thread
=
new
Thread
{
val
t
:
Thread
=
new
Thread
{
override
def
run
()
{
override
def
run
()
{
Exec
.
waitFor
(-
pid
)
Exec
.
waitFor
(-
pid
)
Log
.
d
(
TAG
,
"Successfully exit pid: "
+
pid
)
}
}
}
}
t
.
start
()
t
.
start
()
...
@@ -326,16 +325,13 @@ class ShadowVpnService extends VpnService {
...
@@ -326,16 +325,13 @@ class ShadowVpnService extends VpnService {
+
"--socks-server-addr 127.0.0.1:%d "
+
"--socks-server-addr 127.0.0.1:%d "
+
"--tunfd %d "
+
"--tunfd %d "
+
"--tunmtu %d "
+
"--tunmtu %d "
+
"--pid %stun2socks.pid"
)
+
"--pid %stun2socks.pid"
).
format
(
localAddress
.
format
(
2
),
udpgw
,
localPort
,
fd
,
VPN_MTU
,
BASE
)
.
format
(
localAddress
.
format
(
2
),
udpgw
,
localPort
,
fd
,
VPN_MTU
,
BASE
)
Log
.
d
(
TAG
,
cmd
)
System
.
exec
(
cmd
)
System
.
exec
(
cmd
)
}
}
/** Called when the activity is first created. */
/** Called when the activity is first created. */
def
handleConnection
:
Boolean
=
{
def
handleConnection
:
Boolean
=
{
startShadowsocksDaemon
()
startShadowsocksDaemon
()
startVpn
()
startVpn
()
true
true
...
...
src/main/scala/com/github/shadowsocks/ShadowsocksService.scala
View file @
4ee9eea2
...
@@ -276,7 +276,6 @@ class ShadowsocksService extends Service {
...
@@ -276,7 +276,6 @@ class ShadowsocksService extends Service {
val
t
:
Thread
=
new
Thread
{
val
t
:
Thread
=
new
Thread
{
override
def
run
()
{
override
def
run
()
{
Exec
.
waitFor
(-
pid
)
Exec
.
waitFor
(-
pid
)
Log
.
d
(
TAG
,
"Successfully exit pid: "
+
pid
)
}
}
}
}
t
.
start
()
t
.
start
()
...
@@ -498,8 +497,7 @@ class ShadowsocksService extends Service {
...
@@ -498,8 +497,7 @@ class ShadowsocksService extends Service {
}
}
}
}
if
(
isGlobalProxy
||
isBypassApps
)
{
if
(
isGlobalProxy
||
isBypassApps
)
{
http_sb
http_sb
.
append
(
if
(
hasRedirectSupport
)
{
.
append
(
if
(
hasRedirectSupport
)
{
Utils
.
getIptables
+
CMD_IPTABLES_REDIRECT_ADD_SOCKS
Utils
.
getIptables
+
CMD_IPTABLES_REDIRECT_ADD_SOCKS
}
else
{
}
else
{
Utils
.
getIptables
+
CMD_IPTABLES_DNAT_ADD_SOCKS
Utils
.
getIptables
+
CMD_IPTABLES_DNAT_ADD_SOCKS
...
@@ -515,13 +513,11 @@ class ShadowsocksService extends Service {
...
@@ -515,13 +513,11 @@ class ShadowsocksService extends Service {
}
}
for
(
uid
<-
uidSet
)
{
for
(
uid
<-
uidSet
)
{
if
(!
isBypassApps
)
{
if
(!
isBypassApps
)
{
http_sb
http_sb
.
append
((
if
(
hasRedirectSupport
)
{
.
append
((
if
(
hasRedirectSupport
)
{
Utils
.
getIptables
+
CMD_IPTABLES_REDIRECT_ADD_SOCKS
Utils
.
getIptables
+
CMD_IPTABLES_REDIRECT_ADD_SOCKS
}
else
{
}
else
{
Utils
.
getIptables
+
CMD_IPTABLES_DNAT_ADD_SOCKS
Utils
.
getIptables
+
CMD_IPTABLES_DNAT_ADD_SOCKS
})
}).
replace
(
"-t nat"
,
"-t nat -m owner --uid-owner "
+
uid
))
.
replace
(
"-t nat"
,
"-t nat -m owner --uid-owner "
+
uid
))
}
else
{
}
else
{
init_sb
.
append
(
cmd_bypass
.
replace
(
"-d 0.0.0.0"
,
"-m owner --uid-owner "
+
uid
))
init_sb
.
append
(
cmd_bypass
.
replace
(
"-d 0.0.0.0"
,
"-m owner --uid-owner "
+
uid
))
}
}
...
...
src/main/scala/com/github/shadowsocks/preferences/PasswordEditTextPreference.scala
View file @
4ee9eea2
...
@@ -8,15 +8,14 @@ class PasswordEditTextPreference(context: Context, attrs: AttributeSet, defStyle
...
@@ -8,15 +8,14 @@ class PasswordEditTextPreference(context: Context, attrs: AttributeSet, defStyle
extends
EditTextPreference
(
context
,
attrs
,
defStyle
)
{
extends
EditTextPreference
(
context
,
attrs
,
defStyle
)
{
def
this
(
context
:
Context
,
attrs
:
AttributeSet
)
=
{
def
this
(
context
:
Context
,
attrs
:
AttributeSet
)
=
{
this
(
context
,
attrs
,
android
.
R
.
attr
.
editTextPreferenceStyle
)
this
(
context
,
attrs
,
android
.
R
.
attr
.
editTextPreferenceStyle
)
mDefaultSummary
=
getSummary
mDefaultSummary
=
getSummary
}
}
override
def
setSummary
(
summary
:
CharSequence
)
{
override
def
setSummary
(
summary
:
CharSequence
)
{
if
(
summary
.
toString
.
isEmpty
)
{
if
(
summary
.
toString
.
isEmpty
)
{
super
.
setSummary
(
mDefaultSummary
)
super
.
setSummary
(
mDefaultSummary
)
}
}
else
{
else
{
super
.
setSummary
(
summary
.
toString
.
map
(
c
=>
"*"
).
mkString
)
super
.
setSummary
(
summary
.
toString
.
map
(
c
=>
"*"
).
mkString
)
}
}
}
}
...
...
src/main/scala/com/github/shadowsocks/preferences/SummaryEditTextPreference.scala
View file @
4ee9eea2
...
@@ -8,15 +8,14 @@ class SummaryEditTextPreference(context: Context, attrs: AttributeSet, defStyle:
...
@@ -8,15 +8,14 @@ class SummaryEditTextPreference(context: Context, attrs: AttributeSet, defStyle:
extends
EditTextPreference
(
context
,
attrs
,
defStyle
)
{
extends
EditTextPreference
(
context
,
attrs
,
defStyle
)
{
def
this
(
context
:
Context
,
attrs
:
AttributeSet
)
=
{
def
this
(
context
:
Context
,
attrs
:
AttributeSet
)
=
{
this
(
context
,
attrs
,
android
.
R
.
attr
.
editTextPreferenceStyle
)
this
(
context
,
attrs
,
android
.
R
.
attr
.
editTextPreferenceStyle
)
mDefaultSummary
=
getSummary
mDefaultSummary
=
getSummary
}
}
override
def
setSummary
(
summary
:
CharSequence
)
{
override
def
setSummary
(
summary
:
CharSequence
)
{
if
(
summary
.
toString
.
isEmpty
)
{
if
(
summary
.
toString
.
isEmpty
)
{
super
.
setSummary
(
mDefaultSummary
)
super
.
setSummary
(
mDefaultSummary
)
}
}
else
{
else
{
super
.
setSummary
(
summary
)
super
.
setSummary
(
summary
)
}
}
}
}
...
...
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