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
461a0bda
Commit
461a0bda
authored
May 24, 2016
by
Mygod
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unnecessary app.settings param in ConfigUtils.load
parent
c878d4da
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
21 deletions
+21
-21
src/main/scala/com/github/shadowsocks/Shadowsocks.scala
src/main/scala/com/github/shadowsocks/Shadowsocks.scala
+1
-1
src/main/scala/com/github/shadowsocks/ShadowsocksRunnerActivity.scala
...la/com/github/shadowsocks/ShadowsocksRunnerActivity.scala
+2
-2
src/main/scala/com/github/shadowsocks/ShadowsocksRunnerService.scala
...ala/com/github/shadowsocks/ShadowsocksRunnerService.scala
+2
-2
src/main/scala/com/github/shadowsocks/utils/ConfigUtils.scala
...main/scala/com/github/shadowsocks/utils/ConfigUtils.scala
+16
-16
No files found.
src/main/scala/com/github/shadowsocks/Shadowsocks.scala
View file @
461a0bda
...
...
@@ -605,7 +605,7 @@ class Shadowsocks extends AppCompatActivity with ServiceBoundContext {
/** Called when connect button is clicked. */
def
serviceLoad
()
{
bgService
.
use
(
ConfigUtils
.
load
(
app
.
settings
)
)
bgService
.
use
(
ConfigUtils
.
load
FromSharedPreferences
)
if
(
app
.
isVpnEnabled
)
{
changeSwitch
(
checked
=
false
)
...
...
src/main/scala/com/github/shadowsocks/ShadowsocksRunnerActivity.scala
View file @
461a0bda
...
...
@@ -73,7 +73,7 @@ class ShadowsocksRunnerActivity extends Activity with ServiceBoundContext {
onActivityResult
(
REQUEST_CONNECT
,
Activity
.
RESULT_OK
,
null
)
}
}
else
{
bgService
.
use
(
ConfigUtils
.
load
(
app
.
settings
)
)
bgService
.
use
(
ConfigUtils
.
load
FromSharedPreferences
)
finish
()
}
}
...
...
@@ -109,7 +109,7 @@ class ShadowsocksRunnerActivity extends Activity with ServiceBoundContext {
resultCode
match
{
case
Activity
.
RESULT_OK
=>
if
(
bgService
!=
null
)
{
bgService
.
use
(
ConfigUtils
.
load
(
app
.
settings
)
)
bgService
.
use
(
ConfigUtils
.
load
FromSharedPreferences
)
}
case
_
=>
Log
.
e
(
TAG
,
"Failed to start VpnService"
)
...
...
src/main/scala/com/github/shadowsocks/ShadowsocksRunnerService.scala
View file @
461a0bda
...
...
@@ -62,11 +62,11 @@ class ShadowsocksRunnerService extends Service with ServiceBoundContext {
val
intent
=
VpnService
.
prepare
(
ShadowsocksRunnerService
.
this
)
if
(
intent
==
null
)
{
if
(
bgService
!=
null
)
{
bgService
.
use
(
ConfigUtils
.
load
(
app
.
settings
)
)
bgService
.
use
(
ConfigUtils
.
load
FromSharedPreferences
)
}
}
}
else
{
bgService
.
use
(
ConfigUtils
.
load
(
app
.
settings
)
)
bgService
.
use
(
ConfigUtils
.
load
FromSharedPreferences
)
}
stopSelf
()
}
...
...
src/main/scala/com/github/shadowsocks/utils/ConfigUtils.scala
View file @
461a0bda
...
...
@@ -39,7 +39,7 @@
package
com.github.shadowsocks.utils
import
android.content.
{
Context
,
SharedPreferences
}
import
android.content.
Context
import
com.github.kevinsawicki.http.HttpRequest
import
com.github.shadowsocks.R
import
com.github.shadowsocks.ShadowsocksApplication.app
...
...
@@ -200,24 +200,24 @@ object ConfigUtils {
config
.
profileName
,
host
,
password
,
method
,
config
.
proxiedAppString
,
config
.
route
,
port
,
config
.
localPort
,
0
)
}
def
load
(
settings
:
SharedPreferences
)
:
Config
=
{
val
isProxyApps
=
settings
.
getBoolean
(
Key
.
isProxyApps
,
false
)
val
isBypassApps
=
settings
.
getBoolean
(
Key
.
isBypassApps
,
false
)
val
isUdpDns
=
settings
.
getBoolean
(
Key
.
isUdpDns
,
false
)
val
isAuth
=
settings
.
getBoolean
(
Key
.
isAuth
,
false
)
val
isIpv6
=
settings
.
getBoolean
(
Key
.
isIpv6
,
false
)
def
load
FromSharedPreferences
=
{
val
isProxyApps
=
app
.
settings
.
getBoolean
(
Key
.
isProxyApps
,
false
)
val
isBypassApps
=
app
.
settings
.
getBoolean
(
Key
.
isBypassApps
,
false
)
val
isUdpDns
=
app
.
settings
.
getBoolean
(
Key
.
isUdpDns
,
false
)
val
isAuth
=
app
.
settings
.
getBoolean
(
Key
.
isAuth
,
false
)
val
isIpv6
=
app
.
settings
.
getBoolean
(
Key
.
isIpv6
,
false
)
val
profileName
=
settings
.
getString
(
Key
.
profileName
,
"default"
)
val
proxy
=
settings
.
getString
(
Key
.
proxy
,
"127.0.0.1"
)
val
sitekey
=
settings
.
getString
(
Key
.
sitekey
,
"default"
)
val
encMethod
=
settings
.
getString
(
Key
.
encMethod
,
"table"
)
val
route
=
settings
.
getString
(
Key
.
route
,
"all"
)
val
profileName
=
app
.
settings
.
getString
(
Key
.
profileName
,
"default"
)
val
proxy
=
app
.
settings
.
getString
(
Key
.
proxy
,
"127.0.0.1"
)
val
sitekey
=
app
.
settings
.
getString
(
Key
.
sitekey
,
"default"
)
val
encMethod
=
app
.
settings
.
getString
(
Key
.
encMethod
,
"table"
)
val
route
=
app
.
settings
.
getString
(
Key
.
route
,
"all"
)
val
remotePort
=
settings
.
getInt
(
Key
.
remotePort
,
1984
)
val
localPort
=
settings
.
getInt
(
Key
.
localPort
,
1984
)
val
proxiedAppString
=
settings
.
getString
(
Key
.
proxied
,
""
)
val
remotePort
=
app
.
settings
.
getInt
(
Key
.
remotePort
,
1984
)
val
localPort
=
app
.
settings
.
getInt
(
Key
.
localPort
,
1984
)
val
proxiedAppString
=
app
.
settings
.
getString
(
Key
.
proxied
,
""
)
val
profileId
=
settings
.
getInt
(
Key
.
profileId
,
-
1
)
val
profileId
=
app
.
settings
.
getInt
(
Key
.
profileId
,
-
1
)
new
Config
(
isProxyApps
,
isBypassApps
,
isUdpDns
,
isAuth
,
isIpv6
,
profileName
,
proxy
,
sitekey
,
encMethod
,
proxiedAppString
,
route
,
remotePort
,
localPort
,
profileId
)
...
...
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