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
9f037d2a
Commit
9f037d2a
authored
Jan 14, 2019
by
Mygod
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Forbid usage of control characters in PluginOptions
parent
0bac32b7
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
1 deletion
+5
-1
mobile/src/main/java/com/github/shadowsocks/ProfileConfigFragment.kt
...main/java/com/github/shadowsocks/ProfileConfigFragment.kt
+1
-1
mobile/src/main/res/xml/pref_profile.xml
mobile/src/main/res/xml/pref_profile.xml
+1
-0
plugin/CHANGES.md
plugin/CHANGES.md
+2
-0
plugin/src/main/java/com/github/shadowsocks/plugin/PluginOptions.kt
.../main/java/com/github/shadowsocks/plugin/PluginOptions.kt
+1
-0
No files found.
mobile/src/main/java/com/github/shadowsocks/ProfileConfigFragment.kt
View file @
9f037d2a
...
...
@@ -149,7 +149,7 @@ class ProfileConfigFragment : PreferenceFragmentCompat(),
DataStore
.
plugin
=
pluginConfiguration
.
toString
()
DataStore
.
dirty
=
true
true
}
catch
(
exc
:
IllegalArgument
Exception
)
{
}
catch
(
exc
:
Runtime
Exception
)
{
(
activity
as
MainActivity
).
snackbar
(
exc
.
localizedMessage
).
show
()
false
}
...
...
mobile/src/main/res/xml/pref_profile.xml
View file @
9f037d2a
...
...
@@ -84,6 +84,7 @@
android:key=
"plugin.configure"
android:icon=
"@drawable/ic_action_settings"
android:persistent=
"false"
android:singleLine=
"true"
app:pref_summaryHasText=
"%s"
android:title=
"@string/plugin_configure"
/>
<Preference
...
...
plugin/CHANGES.md
View file @
9f037d2a
*
1.1.0:
*
Having control characters in plugin options is no longer allowed.
If this breaks your plugin, you are doing it wrong.
*
New helper method:
`PluginOptions.putWithDefault`
.
*
1.0.0:
*
`PathProvider`
now takes
`Int`
instead of
`String`
for file modes;
...
...
plugin/src/main/java/com/github/shadowsocks/plugin/PluginOptions.kt
View file @
9f037d2a
...
...
@@ -38,6 +38,7 @@ class PluginOptions : HashMap<String, String?> {
@Suppress
(
"NAME_SHADOWING"
)
var
parseId
=
parseId
if
(
options
.
isNullOrEmpty
())
return
check
(
options
.
all
{
!
it
.
isISOControl
()
})
{
"No control characters allowed."
}
val
tokenizer
=
StringTokenizer
(
"$options;"
,
"\\=;"
,
true
)
val
current
=
StringBuilder
()
var
key
:
String
?
=
null
...
...
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