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
d4dd6929
Commit
d4dd6929
authored
Jun 12, 2013
by
Max Lv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix a bug in the individual proxy
parent
75334ad9
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
12 deletions
+17
-12
project/Build.scala
project/Build.scala
+2
-2
src/main/scala/com/github/shadowsocks/AppManager.scala
src/main/scala/com/github/shadowsocks/AppManager.scala
+3
-7
src/main/scala/com/github/shadowsocks/ShadowsocksService.scala
...ain/scala/com/github/shadowsocks/ShadowsocksService.scala
+3
-1
src/main/scala/com/github/shadowsocks/Utils.scala
src/main/scala/com/github/shadowsocks/Utils.scala
+9
-2
No files found.
project/Build.scala
View file @
d4dd6929
...
...
@@ -5,8 +5,8 @@ import org.scalasbt.androidplugin._
import
org.scalasbt.androidplugin.AndroidKeys._
object
App
{
val
version
=
"1.6.
3
"
val
versionCode
=
3
3
val
version
=
"1.6.
4
"
val
versionCode
=
3
4
}
object
General
{
...
...
src/main/scala/com/github/shadowsocks/AppManager.scala
View file @
d4dd6929
...
...
@@ -81,14 +81,10 @@ case class ListEntry(box: CheckBox, text: TextView, icon: ImageView)
object
AppManager
{
val
PREFS_KEY_PROXYED
=
"Proxyed"
implicit
def
anyrefarray_tools
[
T
<:
AnyRef
](
a
:
Array
[
T
])
=
new
ObjectArrayTools
(
a
)
def
getProxiedApps
(
context
:
Context
)
:
Array
[
ProxiedApp
]
=
{
def
getProxiedApps
(
context
:
Context
,
proxiedAppString
:
String
)
:
Array
[
ProxiedApp
]
=
{
val
prefs
:
SharedPreferences
=
PreferenceManager
.
getDefaultSharedPreferences
(
context
)
val
proxiedAppString
=
prefs
.
getString
(
PREFS_KEY_PROXYED
,
""
)
val
proxiedApps
=
proxiedAppString
.
split
(
'|'
).
sortWith
(
_
<
_
)
import
scala.collection.JavaConversions._
...
...
@@ -125,7 +121,7 @@ class AppManager extends SherlockActivity with OnCheckedChangeListener with OnCl
def
loadApps
(
context
:
Context
)
:
Array
[
ProxiedApp
]
=
{
val
prefs
:
SharedPreferences
=
PreferenceManager
.
getDefaultSharedPreferences
(
context
)
val
proxiedAppString
=
prefs
.
getString
(
AppManager
.
PREFS_KEY_PROXYED
,
""
)
val
proxiedAppString
=
prefs
.
getString
(
Key
.
proxied
,
""
)
val
proxiedApps
=
proxiedAppString
.
split
(
'|'
).
sortWith
(
_
<
_
)
import
scala.collection.JavaConversions._
...
...
@@ -267,7 +263,7 @@ class AppManager extends SherlockActivity with OnCheckedChangeListener with OnCl
proxiedApps
+=
'|'
})
val
edit
:
SharedPreferences.Editor
=
prefs
.
edit
edit
.
putString
(
AppManager
.
PREFS_KEY_PROXYED
,
proxiedApps
.
toString
())
edit
.
putString
(
Key
.
proxied
,
proxiedApps
.
toString
())
edit
.
commit
}
...
...
src/main/scala/com/github/shadowsocks/ShadowsocksService.scala
View file @
d4dd6929
...
...
@@ -518,7 +518,9 @@ class ShadowsocksService extends Service {
})
}
if
(!
config
.
isGlobalProxy
)
{
if
(
apps
==
null
||
apps
.
length
<=
0
)
apps
=
AppManager
.
getProxiedApps
(
this
)
if
(
apps
==
null
||
apps
.
length
<=
0
)
{
apps
=
AppManager
.
getProxiedApps
(
this
,
config
.
proxiedAppString
)
}
val
uidSet
:
mutable.HashSet
[
Int
]
=
new
mutable
.
HashSet
[
Int
]
for
(
app
<-
apps
)
{
if
(
app
.
proxied
)
{
...
...
src/main/scala/com/github/shadowsocks/Utils.scala
View file @
d4dd6929
...
...
@@ -53,6 +53,8 @@ import android.graphics.{Canvas, Bitmap}
import
android.app.ActivityManager
object
Key
{
val
proxied
=
"Proxyed"
val
isRoot
=
"isRoot"
val
status
=
"status"
val
proxyedApps
=
"proxyedApps"
...
...
@@ -72,7 +74,8 @@ object Key {
}
case
class
Config
(
isGlobalProxy
:
Boolean
,
isGFWList
:
Boolean
,
isBypassApps
:
Boolean
,
var
proxy
:
String
,
sitekey
:
String
,
encMethod
:
String
,
remotePort
:
Int
,
localPort
:
Int
)
var
proxy
:
String
,
sitekey
:
String
,
encMethod
:
String
,
remotePort
:
Int
,
localPort
:
Int
,
proxiedAppString
:
String
)
object
State
{
val
INIT
=
0
...
...
@@ -116,9 +119,10 @@ object Extra {
val
encMethod
=
intent
.
getStringExtra
(
Key
.
encMethod
)
val
remotePort
=
intent
.
getIntExtra
(
Key
.
remotePort
,
1984
)
val
localPort
=
intent
.
getIntExtra
(
Key
.
localPort
,
1984
)
val
proxiedString
=
intent
.
getStringExtra
(
Key
.
proxied
)
new
Config
(
isGlobalProxy
,
isGFWList
,
isBypassApps
,
proxy
,
sitekey
,
encMethod
,
remotePort
,
localPort
)
localPort
,
proxiedString
)
}
def
put
(
settings
:
SharedPreferences
,
intent
:
Intent
)
{
...
...
@@ -146,6 +150,7 @@ object Extra {
1984
}
}
val
proxiedAppString
=
settings
.
getString
(
Key
.
proxied
,
""
)
intent
.
putExtra
(
Key
.
isGlobalProxy
,
isGlobalProxy
)
intent
.
putExtra
(
Key
.
isGFWList
,
isGFWList
)
...
...
@@ -156,6 +161,8 @@ object Extra {
intent
.
putExtra
(
Key
.
encMethod
,
encMethod
)
intent
.
putExtra
(
Key
.
remotePort
,
remotePort
)
intent
.
putExtra
(
Key
.
localPort
,
localProt
)
intent
.
putExtra
(
Key
.
proxied
,
proxiedAppString
)
}
}
...
...
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