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
d0117daf
Commit
d0117daf
authored
Jul 14, 2016
by
Max Lv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #759 #760
parent
b14ff708
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
9 deletions
+8
-9
src/main/scala/com/github/shadowsocks/AppManager.scala
src/main/scala/com/github/shadowsocks/AppManager.scala
+8
-9
No files found.
src/main/scala/com/github/shadowsocks/AppManager.scala
View file @
d0117daf
...
...
@@ -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