mirror of
https://github.com/MatsuriDayo/NekoBoxForAndroid.git
synced 2025-12-19 06:30:05 +08:00
refactor: Singbox's type name
This commit is contained in:
parent
612d1643d1
commit
3eb688d1e0
@ -71,6 +71,8 @@ public abstract class StandardV2RayBean extends AbstractBean {
|
||||
if (JavaUtil.isNullOrBlank(type)) type = "tcp";
|
||||
else if ("h2".equals(type)) type = "http";
|
||||
|
||||
type = type.toLowerCase();
|
||||
|
||||
if (JavaUtil.isNullOrBlank(host)) host = "";
|
||||
if (JavaUtil.isNullOrBlank(path)) path = "";
|
||||
|
||||
@ -133,7 +135,7 @@ public abstract class StandardV2RayBean extends AbstractBean {
|
||||
case "grpc": {
|
||||
output.writeString(path);
|
||||
}
|
||||
case "httpUpgrade": {
|
||||
case "httpupgrade": {
|
||||
output.writeString(host);
|
||||
output.writeString(path);
|
||||
|
||||
@ -185,7 +187,7 @@ public abstract class StandardV2RayBean extends AbstractBean {
|
||||
case "grpc": {
|
||||
path = input.readString();
|
||||
}
|
||||
case "httpUpgrade": {
|
||||
case "httpupgrade": {
|
||||
host = input.readString();
|
||||
path = input.readString();
|
||||
}
|
||||
|
||||
@ -117,7 +117,7 @@ fun parseV2Ray(link: String): StandardV2RayBean {
|
||||
}
|
||||
}
|
||||
|
||||
"httpUpgrade" -> {
|
||||
"httpupgrade" -> {
|
||||
url.queryParameter("path")?.let {
|
||||
bean.path = it
|
||||
}
|
||||
@ -225,7 +225,7 @@ fun StandardV2RayBean.parseDuckSoft(url: HttpUrl) {
|
||||
}
|
||||
}
|
||||
|
||||
"httpUpgrade" -> {
|
||||
"httpupgrade" -> {
|
||||
url.queryParameter("host")?.let {
|
||||
host = it
|
||||
}
|
||||
@ -454,7 +454,7 @@ fun StandardV2RayBean.toUriVMessVLESSTrojan(isTrojan: Boolean): String {
|
||||
|
||||
when (type) {
|
||||
"tcp" -> {}
|
||||
"ws", "http", "httpUpgrade" -> {
|
||||
"ws", "http", "httpupgrade" -> {
|
||||
if (host.isNotBlank()) {
|
||||
builder.addQueryParameter("host", host)
|
||||
}
|
||||
@ -583,9 +583,9 @@ fun buildSingBoxOutboundStreamSettings(bean: StandardV2RayBean): V2RayTransportO
|
||||
}
|
||||
}
|
||||
|
||||
"httpUpgrade" -> {
|
||||
"httpupgrade" -> {
|
||||
return V2RayTransportOptions_HTTPUpgradeOptions().apply {
|
||||
type = "httpUpgrade"
|
||||
type = "httpupgrade"
|
||||
host = bean.host
|
||||
path = bean.path
|
||||
}
|
||||
|
||||
@ -143,7 +143,7 @@ abstract class StandardV2RaySettingsActivity : ProfileSettingsActivity<StandardV
|
||||
}
|
||||
}
|
||||
|
||||
fun updateView(network: String) {
|
||||
private fun updateView(network: String) {
|
||||
host.preference.isVisible = false
|
||||
path.preference.isVisible = false
|
||||
wsCategory.isVisible = false
|
||||
@ -153,6 +153,7 @@ abstract class StandardV2RaySettingsActivity : ProfileSettingsActivity<StandardV
|
||||
host.preference.setTitle(R.string.http_host)
|
||||
path.preference.setTitle(R.string.http_path)
|
||||
}
|
||||
|
||||
"http" -> {
|
||||
host.preference.setTitle(R.string.http_host)
|
||||
path.preference.setTitle(R.string.http_path)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user