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
be503618
Commit
be503618
authored
Feb 02, 2017
by
Mygod
Committed by
Max Lv
Feb 08, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix issues about SIP002
parent
212c3f66
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
15 deletions
+18
-15
mobile/src/main/scala/com/github/shadowsocks/database/Profile.scala
.../main/scala/com/github/shadowsocks/database/Profile.scala
+2
-2
mobile/src/main/scala/com/github/shadowsocks/utils/Parser.scala
.../src/main/scala/com/github/shadowsocks/utils/Parser.scala
+16
-13
No files found.
mobile/src/main/scala/com/github/shadowsocks/database/Profile.scala
View file @
be503618
...
@@ -96,12 +96,12 @@ class Profile {
...
@@ -96,12 +96,12 @@ class Profile {
def
toUri
:
Uri
=
{
def
toUri
:
Uri
=
{
val
builder
=
new
Uri
.
Builder
()
val
builder
=
new
Uri
.
Builder
()
.
scheme
(
"ss"
)
.
scheme
(
"ss"
)
.
a
uthority
(
"%s@%s:%d"
.
formatLocal
(
Locale
.
ENGLISH
,
.
encodedA
uthority
(
"%s@%s:%d"
.
formatLocal
(
Locale
.
ENGLISH
,
Base64
.
encodeToString
(
"%s:%s"
.
formatLocal
(
Locale
.
ENGLISH
,
method
,
password
).
getBytes
,
Base64
.
encodeToString
(
"%s:%s"
.
formatLocal
(
Locale
.
ENGLISH
,
method
,
password
).
getBytes
,
Base64
.
NO_PADDING
|
Base64
.
NO_WRAP
|
Base64
.
URL_SAFE
),
host
,
remotePort
))
Base64
.
NO_PADDING
|
Base64
.
NO_WRAP
|
Base64
.
URL_SAFE
),
host
,
remotePort
))
val
configuration
=
new
PluginConfiguration
(
plugin
)
val
configuration
=
new
PluginConfiguration
(
plugin
)
if
(
configuration
.
selected
.
nonEmpty
)
if
(
configuration
.
selected
.
nonEmpty
)
builder
.
appendQueryParameter
(
Key
.
plugin
,
configuration
.
selectedOptions
.
toString
)
builder
.
appendQueryParameter
(
Key
.
plugin
,
configuration
.
selectedOptions
.
toString
(
false
)
)
if
(!
nameIsEmpty
)
builder
.
fragment
(
name
)
if
(!
nameIsEmpty
)
builder
.
fragment
(
name
)
builder
.
build
()
builder
.
build
()
}
}
...
...
mobile/src/main/scala/com/github/shadowsocks/utils/Parser.scala
View file @
be503618
...
@@ -21,7 +21,7 @@
...
@@ -21,7 +21,7 @@
package
com.github.shadowsocks.utils
package
com.github.shadowsocks.utils
import
android.net.Uri
import
android.net.Uri
import
android.util.
Log
import
android.util.
{
Base64
,
Log
}
import
com.github.shadowsocks.database.Profile
import
com.github.shadowsocks.database.Profile
object
Parser
{
object
Parser
{
...
@@ -48,18 +48,21 @@ object Parser {
...
@@ -48,18 +48,21 @@ object Parser {
Log
.
e
(
TAG
,
"Unrecognized URI: "
+
m
.
matched
)
Log
.
e
(
TAG
,
"Unrecognized URI: "
+
m
.
matched
)
null
null
}
}
case
userInfoPattern
(
method
,
password
)
=>
case
userInfo
=>
val
profile
=
new
Profile
new
String
(
Base64
.
decode
(
userInfo
,
Base64
.
NO_PADDING
|
Base64
.
NO_WRAP
|
Base64
.
URL_SAFE
))
match
{
profile
.
method
=
method
case
userInfoPattern
(
method
,
password
)
=>
profile
.
password
=
password
val
profile
=
new
Profile
profile
.
host
=
uri
.
getHost
profile
.
method
=
method
profile
.
remotePort
=
uri
.
getPort
profile
.
password
=
password
profile
.
plugin
=
uri
.
getQueryParameter
(
Key
.
plugin
)
profile
.
host
=
uri
.
getHost
profile
.
name
=
uri
.
getFragment
profile
.
remotePort
=
uri
.
getPort
profile
profile
.
plugin
=
uri
.
getQueryParameter
(
Key
.
plugin
)
case
_
=>
profile
.
name
=
uri
.
getFragment
Log
.
e
(
TAG
,
"Unknown user info: "
+
m
.
matched
)
profile
null
case
_
=>
Log
.
e
(
TAG
,
"Unknown user info: "
+
m
.
matched
)
null
}
}
}
}).
filter
(
_
!=
null
)
}).
filter
(
_
!=
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