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
cf9cb312
Commit
cf9cb312
authored
Jul 16, 2016
by
Mygod
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:shadowsocks/shadowsocks-android
parents
427ca9b1
781cfb33
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
9 deletions
+10
-9
build.sbt
build.sbt
+2
-0
src/main/scala/com/github/shadowsocks/AppManager.scala
src/main/scala/com/github/shadowsocks/AppManager.scala
+8
-9
No files found.
build.sbt
View file @
cf9cb312
...
...
@@ -24,6 +24,8 @@ typedResources in Android := false
resConfigs
in
Android
:=
Seq
(
"ru"
,
"zh"
,
"zh-rCN"
)
dexMaxHeap
in
Android
:=
"4g"
resolvers
+=
Resolver
.
jcenterRepo
resolvers
+=
"JRAF"
at
"http://JRAF.org/static/maven/2"
...
...
src/main/scala/com/github/shadowsocks/AppManager.scala
View file @
cf9cb312
...
...
@@ -158,23 +158,22 @@ class AppManager extends AppCompatActivity with OnMenuItemClickListener {
def
onMenuItemClick
(
item
:
MenuItem
)
:
Boolean
=
{
val
clipboard
=
getSystemService
(
Context
.
CLIPBOARD_SERVICE
).
asInstanceOf
[
ClipboardManager
]
val
prefs
=
PreferenceManager
.
getDefaultSharedPreferences
(
getBaseContext
)
item
.
getItemId
match
{
case
R
.
id
.
action_apply_all
=>
app
.
profileManager
.
getAllProfiles
match
{
case
Some
(
profiles
)
=>
val
proxiedAppString
=
pr
efs
.
getString
(
Key
.
individual
,
""
)
profiles
.
foreach
(
p
rofile
=>
{
p
rofile
.
individual
=
proxiedAppString
app
.
profileManager
.
updateProfile
(
p
rofile
)
val
proxiedAppString
=
pr
ofile
.
individual
profiles
.
foreach
(
p
=>
{
p
.
individual
=
proxiedAppString
app
.
profileManager
.
updateProfile
(
p
)
})
Toast
.
makeText
(
this
,
R
.
string
.
action_apply_all
,
Toast
.
LENGTH_SHORT
).
show
case
_
=>
Toast
.
makeText
(
this
,
R
.
string
.
action_export_err
,
Toast
.
LENGTH_SHORT
).
show
}
return
true
case
R
.
id
.
action_export
=>
val
bypass
=
pr
efs
.
getBoolean
(
Key
.
bypass
,
false
)
val
proxiedAppString
=
pr
efs
.
getString
(
Key
.
individual
,
""
)
val
bypass
=
pr
ofile
.
bypass
val
proxiedAppString
=
pr
ofile
.
individual
val
clip
=
ClipData
.
newPlainText
(
Key
.
individual
,
bypass
+
"\n"
+
proxiedAppString
)
clipboard
.
setPrimaryClip
(
clip
)
Toast
.
makeText
(
this
,
R
.
string
.
action_export_msg
,
Toast
.
LENGTH_SHORT
).
show
()
...
...
@@ -185,13 +184,13 @@ class AppManager extends AppCompatActivity with OnMenuItemClickListener {
if
(
proxiedAppSequence
!=
null
)
{
val
proxiedAppString
=
proxiedAppSequence
.
toString
if
(!
proxiedAppString
.
isEmpty
)
{
val
editor
=
prefs
.
edit
val
i
=
proxiedAppString
.
indexOf
(
'\n'
)
try
{
val
(
enabled
,
apps
)
=
if
(
i
<
0
)
(
proxiedAppString
,
""
)
else
(
proxiedAppString
.
substring
(
0
,
i
),
proxiedAppString
.
substring
(
i
+
1
))
bypassSwitch
.
setChecked
(
enabled
.
toBoolean
)
editor
.
putString
(
Key
.
individual
,
apps
).
apply
()
profile
.
individual
=
apps
app
.
profileManager
.
updateProfile
(
profile
)
Toast
.
makeText
(
this
,
R
.
string
.
action_import_msg
,
Toast
.
LENGTH_SHORT
).
show
()
appListView
.
setVisibility
(
View
.
GONE
)
loadingView
.
setVisibility
(
View
.
VISIBLE
)
...
...
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