Refine #609
This commit is contained in:
@@ -39,8 +39,6 @@
|
||||
|
||||
package com.github.shadowsocks.utils
|
||||
|
||||
import java.util.Locale
|
||||
|
||||
import android.util.{Base64, Log}
|
||||
import com.github.shadowsocks.database.Profile
|
||||
|
||||
@@ -48,9 +46,6 @@ object Parser {
|
||||
val TAG = "ShadowParser"
|
||||
private val pattern = "(?i)ss://([A-Za-z0-9+-/=_]+)".r
|
||||
|
||||
def generate (profile: Profile): String = "ss://" + Base64.encodeToString("%s:%s@%s:%d".formatLocal(Locale.ENGLISH,
|
||||
profile.method, profile.password, profile.host, profile.remotePort).getBytes, Base64.NO_PADDING | Base64.NO_WRAP)
|
||||
|
||||
def findAll(data: CharSequence) = pattern.findAllMatchIn(data).map(m => try {
|
||||
val content = new String(Base64.decode(m.group(1), Base64.NO_PADDING), "UTF-8")
|
||||
val methodIdx = content.indexOf(':')
|
||||
|
||||
Reference in New Issue
Block a user