Fix #989
This commit is contained in:
@@ -25,7 +25,7 @@ import com.github.shadowsocks.database.Profile
|
||||
|
||||
object Parser {
|
||||
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
|
||||
|
||||
def findAll(data: CharSequence) = pattern.findAllMatchIn(if (data == null) "" else data).map(m => try
|
||||
@@ -38,6 +38,7 @@ object Parser {
|
||||
profile.name = ss.group(5)
|
||||
profile.host = profile.name
|
||||
profile.remotePort = ss.group(6).toInt
|
||||
if (m.group(2) != null) profile.name = m.group(2).substring(1)
|
||||
profile
|
||||
case _ => null
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user