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
eb174247
Commit
eb174247
authored
May 05, 2013
by
Max Lv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update Crouton
parent
5808d574
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
8 deletions
+28
-8
src/main/res/values/strings.xml
src/main/res/values/strings.xml
+1
-0
src/main/scala/com/github/shadowsocks/Shadowsocks.scala
src/main/scala/com/github/shadowsocks/Shadowsocks.scala
+27
-8
No files found.
src/main/res/values/strings.xml
View file @
eb174247
...
@@ -57,6 +57,7 @@
...
@@ -57,6 +57,7 @@
<string
name=
"forward_stop"
>
Shadowsocks stopped.
</string>
<string
name=
"forward_stop"
>
Shadowsocks stopped.
</string>
<string
name=
"service_failed"
>
Please check your network status and try again.
</string>
<string
name=
"service_failed"
>
Please check your network status and try again.
</string>
<string
name=
"stop"
>
Stop the service
</string>
<string
name=
"stop"
>
Stop the service
</string>
<string
name=
"vpn_status"
>
You can only disable the VPN service through the notification bar.
</string>
<!-- alert category -->
<!-- alert category -->
<string
name=
"ok_iknow"
>
OK
</string>
<string
name=
"ok_iknow"
>
OK
</string>
...
...
src/main/scala/com/github/shadowsocks/Shadowsocks.scala
View file @
eb174247
...
@@ -252,16 +252,16 @@ class Shadowsocks extends UnifiedSherlockPreferenceActivity with CompoundButton.
...
@@ -252,16 +252,16 @@ class Shadowsocks extends UnifiedSherlockPreferenceActivity with CompoundButton.
checked
match
{
checked
match
{
case
true
=>
{
case
true
=>
{
if
(
isVpnEnabled
)
{
if
(
isVpnEnabled
)
{
if
(!
serviceStart
)
{
switchButton
.
setChecked
(
false
)
}
}
else
{
val
intent
=
VpnService
.
prepare
(
this
)
val
intent
=
VpnService
.
prepare
(
this
)
if
(
intent
!=
null
)
{
if
(
intent
!=
null
)
{
startActivityForResult
(
intent
,
Shadowsocks
.
REQUEST_CONNECT
)
startActivityForResult
(
intent
,
Shadowsocks
.
REQUEST_CONNECT
)
}
else
{
}
else
{
onActivityResult
(
Shadowsocks
.
REQUEST_CONNECT
,
Activity
.
RESULT_OK
,
null
)
onActivityResult
(
Shadowsocks
.
REQUEST_CONNECT
,
Activity
.
RESULT_OK
,
null
)
}
}
}
else
{
if
(!
serviceStart
)
{
switchButton
.
setChecked
(
false
)
}
}
}
}
}
case
false
=>
{
case
false
=>
{
...
@@ -364,6 +364,14 @@ class Shadowsocks extends UnifiedSherlockPreferenceActivity with CompoundButton.
...
@@ -364,6 +364,14 @@ class Shadowsocks extends UnifiedSherlockPreferenceActivity with CompoundButton.
val
settings
:
SharedPreferences
=
PreferenceManager
.
getDefaultSharedPreferences
(
this
)
val
settings
:
SharedPreferences
=
PreferenceManager
.
getDefaultSharedPreferences
(
this
)
if
(
isServiceStarted
)
{
if
(
isServiceStarted
)
{
switchButton
.
setChecked
(
true
)
switchButton
.
setChecked
(
true
)
if
(
ShadowVpnService
.
isServiceStarted
)
{
val
style
=
new
Style
.
Builder
()
.
setBackgroundColorValue
(
Style
.
holoBlueLight
)
.
setDuration
(
Style
.
DURATION_INFINITE
)
.
build
()
switchButton
.
setEnabled
(
false
)
Crouton
.
makeText
(
Shadowsocks
.
this
,
R
.
string
.
vpn_status
,
style
).
show
()
}
}
}
else
{
else
{
if
(
settings
.
getBoolean
(
"isRunning"
,
false
))
{
if
(
settings
.
getBoolean
(
"isRunning"
,
false
))
{
...
@@ -448,6 +456,11 @@ class Shadowsocks extends UnifiedSherlockPreferenceActivity with CompoundButton.
...
@@ -448,6 +456,11 @@ class Shadowsocks extends UnifiedSherlockPreferenceActivity with CompoundButton.
}
}
}
}
override
def
onDestroy
()
{
super
.
onDestroy
()
Crouton
.
cancelAllCroutons
()
}
def
reset
()
{
def
reset
()
{
crash_recovery
()
crash_recovery
()
copyAssets
(
""
)
copyAssets
(
""
)
...
@@ -538,13 +551,19 @@ class Shadowsocks extends UnifiedSherlockPreferenceActivity with CompoundButton.
...
@@ -538,13 +551,19 @@ class Shadowsocks extends UnifiedSherlockPreferenceActivity with CompoundButton.
}
}
if
(
isVpnEnabled
)
{
if
(
isVpnEnabled
)
{
if
(
ShadowsocksService
.
isServiceStarted
)
return
false
val
it
:
Intent
=
new
Intent
(
this
,
classOf
[
ShadowsocksService
])
startService
(
it
)
}
else
{
if
(
ShadowVpnService
.
isServiceStarted
)
return
false
if
(
ShadowVpnService
.
isServiceStarted
)
return
false
val
it
:
Intent
=
new
Intent
(
this
,
classOf
[
ShadowVpnService
])
val
it
:
Intent
=
new
Intent
(
this
,
classOf
[
ShadowVpnService
])
startService
(
it
)
startService
(
it
)
val
style
=
new
Style
.
Builder
()
.
setBackgroundColorValue
(
Style
.
holoBlueLight
)
.
setDuration
(
Style
.
DURATION_INFINITE
)
.
build
()
Crouton
.
makeText
(
Shadowsocks
.
this
,
R
.
string
.
vpn_status
,
style
).
show
()
switchButton
.
setEnabled
(
false
)
}
else
{
if
(
ShadowsocksService
.
isServiceStarted
)
return
false
val
it
:
Intent
=
new
Intent
(
this
,
classOf
[
ShadowsocksService
])
startService
(
it
)
}
}
true
true
...
...
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