Commit a7c72988 authored by Max Lv's avatar Max Lv

Fix #989

parent df9f0ad5
...@@ -25,7 +25,7 @@ import com.github.shadowsocks.database.Profile ...@@ -25,7 +25,7 @@ import com.github.shadowsocks.database.Profile
object Parser { object Parser {
val TAG = "ShadowParser" val TAG = "ShadowParser"
private val pattern = "(?i)ss://([A-Za-z0-9+-/=_]+)".r private val pattern = "(?i)ss://([A-Za-z0-9+-/=_]+)(#.+)?".r
private val decodedPattern = "(?i)^((.+?)(-auth)??:(.*)@(.+?):(\\d+?))$".r private val decodedPattern = "(?i)^((.+?)(-auth)??:(.*)@(.+?):(\\d+?))$".r
def findAll(data: CharSequence) = pattern.findAllMatchIn(if (data == null) "" else data).map(m => try def findAll(data: CharSequence) = pattern.findAllMatchIn(if (data == null) "" else data).map(m => try
...@@ -38,6 +38,7 @@ object Parser { ...@@ -38,6 +38,7 @@ object Parser {
profile.name = ss.group(5) profile.name = ss.group(5)
profile.host = profile.name profile.host = profile.name
profile.remotePort = ss.group(6).toInt profile.remotePort = ss.group(6).toInt
if (m.group(2) != null) profile.name = m.group(2).substring(1)
profile profile
case _ => null case _ => null
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment