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
c64e15ac
Commit
c64e15ac
authored
Mar 23, 2018
by
Mygod
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Catch URISyntaxException
parent
9ff33ec1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
8 deletions
+14
-8
mobile/src/main/java/com/github/shadowsocks/database/Profile.kt
.../src/main/java/com/github/shadowsocks/database/Profile.kt
+14
-8
No files found.
mobile/src/main/java/com/github/shadowsocks/database/Profile.kt
View file @
c64e15ac
...
@@ -31,6 +31,7 @@ import com.j256.ormlite.field.DataType
...
@@ -31,6 +31,7 @@ import com.j256.ormlite.field.DataType
import
com.j256.ormlite.field.DatabaseField
import
com.j256.ormlite.field.DatabaseField
import
java.io.Serializable
import
java.io.Serializable
import
java.net.URI
import
java.net.URI
import
java.net.URISyntaxException
import
java.util.*
import
java.util.*
class
Profile
:
Serializable
{
class
Profile
:
Serializable
{
...
@@ -67,14 +68,19 @@ class Profile : Serializable {
...
@@ -67,14 +68,19 @@ class Profile : Serializable {
profile
.
method
=
match
.
groupValues
[
1
]
profile
.
method
=
match
.
groupValues
[
1
]
profile
.
password
=
match
.
groupValues
[
2
]
profile
.
password
=
match
.
groupValues
[
2
]
// bug in Android: https://code.google.com/p/android/issues/detail?id=192855
// bug in Android: https://code.google.com/p/android/issues/detail?id=192855
val
javaURI
=
URI
(
it
.
value
)
try
{
profile
.
host
=
javaURI
.
host
?:
""
val
javaURI
=
URI
(
it
.
value
)
if
(
profile
.
host
.
firstOrNull
()
==
'['
&&
profile
.
host
.
lastOrNull
()
==
']'
)
profile
.
host
=
javaURI
.
host
?:
""
profile
.
host
=
profile
.
host
.
substring
(
1
,
profile
.
host
.
length
-
1
)
if
(
profile
.
host
.
firstOrNull
()
==
'['
&&
profile
.
host
.
lastOrNull
()
==
']'
)
profile
.
remotePort
=
javaURI
.
port
profile
.
host
=
profile
.
host
.
substring
(
1
,
profile
.
host
.
length
-
1
)
profile
.
plugin
=
uri
.
getQueryParameter
(
Key
.
plugin
)
profile
.
remotePort
=
javaURI
.
port
profile
.
name
=
uri
.
fragment
?:
""
profile
.
plugin
=
uri
.
getQueryParameter
(
Key
.
plugin
)
profile
profile
.
name
=
uri
.
fragment
?:
""
profile
}
catch
(
e
:
URISyntaxException
)
{
Log
.
e
(
TAG
,
"Invalid URI: ${it.value}"
)
null
}
}
else
{
}
else
{
Log
.
e
(
TAG
,
"Unknown user info: ${it.value}"
)
Log
.
e
(
TAG
,
"Unknown user info: ${it.value}"
)
null
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