Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c5617ac65a | ||
|
|
3795348b04 | ||
|
|
50bf9c8da0 | ||
|
|
78fe4e4bc4 |
@@ -205,8 +205,8 @@ data class V2rayConfig(
|
|||||||
tcpSetting.header.type = HTTP
|
tcpSetting.header.type = HTTP
|
||||||
if (!TextUtils.isEmpty(host) || !TextUtils.isEmpty(path)) {
|
if (!TextUtils.isEmpty(host) || !TextUtils.isEmpty(path)) {
|
||||||
val requestObj = TcpSettingsBean.HeaderBean.RequestBean()
|
val requestObj = TcpSettingsBean.HeaderBean.RequestBean()
|
||||||
requestObj.headers.Host = (host ?: "").split(",").map { it.trim() }
|
requestObj.headers.Host = (host ?: "").split(",").map { it.trim() }.filter { it.isNotEmpty() }
|
||||||
requestObj.path = (path ?: "").split(",").map { it.trim() }
|
requestObj.path = (path ?: "").split(",").map { it.trim() }.filter { it.isNotEmpty() }
|
||||||
tcpSetting.header.request = requestObj
|
tcpSetting.header.request = requestObj
|
||||||
sni = requestObj.headers.Host.getOrNull(0) ?: sni
|
sni = requestObj.headers.Host.getOrNull(0) ?: sni
|
||||||
}
|
}
|
||||||
@@ -236,7 +236,7 @@ data class V2rayConfig(
|
|||||||
"h2", "http" -> {
|
"h2", "http" -> {
|
||||||
network = "h2"
|
network = "h2"
|
||||||
val h2Setting = HttpSettingsBean()
|
val h2Setting = HttpSettingsBean()
|
||||||
h2Setting.host = (host ?: "").split(",").map { it.trim() }
|
h2Setting.host = (host ?: "").split(",").map { it.trim() }.filter { it.isNotEmpty() }
|
||||||
sni = h2Setting.host.getOrNull(0) ?: sni
|
sni = h2Setting.host.getOrNull(0) ?: sni
|
||||||
h2Setting.path = path ?: "/"
|
h2Setting.path = path ?: "/"
|
||||||
httpSettings = h2Setting
|
httpSettings = h2Setting
|
||||||
|
|||||||
@@ -102,9 +102,14 @@ object Utils {
|
|||||||
try {
|
try {
|
||||||
return Base64.decode(text, Base64.NO_WRAP).toString(charset("UTF-8"))
|
return Base64.decode(text, Base64.NO_WRAP).toString(charset("UTF-8"))
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
e.printStackTrace()
|
Log.i(AppConfig.ANG_PACKAGE, "Parse base64 standard failed $e")
|
||||||
return ""
|
|
||||||
}
|
}
|
||||||
|
try {
|
||||||
|
return Base64.decode(text, Base64.NO_WRAP.or(Base64.URL_SAFE)).toString(charset("UTF-8"))
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.i(AppConfig.ANG_PACKAGE, "Parse base64 url safe failed $e")
|
||||||
|
}
|
||||||
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user