diff --git a/V2rayNG/app/src/main/java/com/v2ray/ang/dto/Hysteria2Bean.kt b/V2rayNG/app/src/main/java/com/v2ray/ang/dto/Hysteria2Bean.kt
index 89900fb8..c4fc6582 100644
--- a/V2rayNG/app/src/main/java/com/v2ray/ang/dto/Hysteria2Bean.kt
+++ b/V2rayNG/app/src/main/java/com/v2ray/ang/dto/Hysteria2Bean.kt
@@ -9,6 +9,7 @@ data class Hysteria2Bean(
val http: Socks5Bean? = null,
val tls: TlsBean? = null,
val transport: TransportBean? = null,
+ val bandwidth: BandwidthBean? = null,
) {
data class ObfsBean(
val type: String?,
@@ -37,4 +38,9 @@ data class Hysteria2Bean(
val hopInterval: String?,
)
}
-}
+
+ data class BandwidthBean(
+ val down: String?,
+ val up: String?,
+ )
+}
\ No newline at end of file
diff --git a/V2rayNG/app/src/main/java/com/v2ray/ang/dto/ProfileItem.kt b/V2rayNG/app/src/main/java/com/v2ray/ang/dto/ProfileItem.kt
index 1a0c7807..7a1f7346 100644
--- a/V2rayNG/app/src/main/java/com/v2ray/ang/dto/ProfileItem.kt
+++ b/V2rayNG/app/src/main/java/com/v2ray/ang/dto/ProfileItem.kt
@@ -55,6 +55,8 @@ data class ProfileItem(
var portHopping: String? = null,
var portHoppingInterval: String? = null,
var pinSHA256: String? = null,
+ var bandwidthDown: String? = null,
+ var bandwidthUp: String? = null,
) {
companion object {
diff --git a/V2rayNG/app/src/main/java/com/v2ray/ang/fmt/Hysteria2Fmt.kt b/V2rayNG/app/src/main/java/com/v2ray/ang/fmt/Hysteria2Fmt.kt
index 0aad9c88..1c5dc99d 100644
--- a/V2rayNG/app/src/main/java/com/v2ray/ang/fmt/Hysteria2Fmt.kt
+++ b/V2rayNG/app/src/main/java/com/v2ray/ang/fmt/Hysteria2Fmt.kt
@@ -85,6 +85,12 @@ object Hysteria2Fmt : FmtBase() {
)
)
+ val bandwidth = if (config.bandwidthDown.isNullOrEmpty() || config.bandwidthUp.isNullOrEmpty()) null else
+ Hysteria2Bean.BandwidthBean(
+ down = config.bandwidthDown,
+ up = config.bandwidthUp,
+ )
+
val server =
if (config.portHopping.isNullOrEmpty())
config.getServerAddressAndPort()
@@ -96,6 +102,7 @@ object Hysteria2Fmt : FmtBase() {
auth = config.password,
obfs = obfs,
transport = transport,
+ bandwidth = bandwidth,
socks5 = Hysteria2Bean.Socks5Bean(
listen = "$LOOPBACK:${socksPort}",
),
diff --git a/V2rayNG/app/src/main/java/com/v2ray/ang/ui/ServerActivity.kt b/V2rayNG/app/src/main/java/com/v2ray/ang/ui/ServerActivity.kt
index 7cb66933..9d0a6b0e 100644
--- a/V2rayNG/app/src/main/java/com/v2ray/ang/ui/ServerActivity.kt
+++ b/V2rayNG/app/src/main/java/com/v2ray/ang/ui/ServerActivity.kt
@@ -126,6 +126,8 @@ class ServerActivity : BaseActivity() {
private val et_port_hop: EditText? by lazy { findViewById(R.id.et_port_hop) }
private val et_port_hop_interval: EditText? by lazy { findViewById(R.id.et_port_hop_interval) }
private val et_pinsha256: EditText? by lazy { findViewById(R.id.et_pinsha256) }
+ private val et_bandwidth_down: EditText? by lazy { findViewById(R.id.et_bandwidth_down) }
+ private val et_bandwidth_up: EditText? by lazy { findViewById(R.id.et_bandwidth_up) }
private val et_extra: EditText? by lazy { findViewById(R.id.et_extra) }
private val layout_extra: LinearLayout? by lazy { findViewById(R.id.layout_extra) }
@@ -334,6 +336,8 @@ class ServerActivity : BaseActivity() {
et_port_hop?.text = Utils.getEditable(config.portHopping)
et_port_hop_interval?.text = Utils.getEditable(config.portHoppingInterval)
et_pinsha256?.text = Utils.getEditable(config.pinSHA256)
+ et_bandwidth_down?.text = Utils.getEditable(config.bandwidthDown)
+ et_bandwidth_up?.text = Utils.getEditable(config.bandwidthUp)
}
val securityEncryptions =
if (config.configType == EConfigType.SHADOWSOCKS) shadowsocksSecuritys else securitys
@@ -513,6 +517,8 @@ class ServerActivity : BaseActivity() {
config.portHopping = et_port_hop?.text?.toString()
config.portHoppingInterval = et_port_hop_interval?.text?.toString()
config.pinSHA256 = et_pinsha256?.text?.toString()
+ config.bandwidthDown = et_bandwidth_down?.text?.toString()
+ config.bandwidthUp = et_bandwidth_up?.text?.toString()
}
}
diff --git a/V2rayNG/app/src/main/res/layout/activity_server_hysteria2.xml b/V2rayNG/app/src/main/res/layout/activity_server_hysteria2.xml
index 24a120a0..a0228555 100644
--- a/V2rayNG/app/src/main/res/layout/activity_server_hysteria2.xml
+++ b/V2rayNG/app/src/main/res/layout/activity_server_hysteria2.xml
@@ -90,6 +90,44 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Port Hopping
Port Hopping Interval
pinSHA256
+ Bandwidth down (units)
+ Bandwidth up (units)
XHTTP Mode
XHTTP Extra raw JSON, format: { XHTTPObject }
diff --git a/V2rayNG/app/src/main/res/values-bn/strings.xml b/V2rayNG/app/src/main/res/values-bn/strings.xml
index 86e9be71..272ee1ea 100644
--- a/V2rayNG/app/src/main/res/values-bn/strings.xml
+++ b/V2rayNG/app/src/main/res/values-bn/strings.xml
@@ -120,6 +120,8 @@
Port Hopping
Port Hopping Interval
pinSHA256
+ Bandwidth down (units)
+ Bandwidth up (units)
XHTTP Mode
XHTTP Extra raw JSON, format: { XHTTPObject }
diff --git a/V2rayNG/app/src/main/res/values-bqi-rIR/strings.xml b/V2rayNG/app/src/main/res/values-bqi-rIR/strings.xml
index 89efc19e..b6151b4e 100644
--- a/V2rayNG/app/src/main/res/values-bqi-rIR/strings.xml
+++ b/V2rayNG/app/src/main/res/values-bqi-rIR/strings.xml
@@ -120,6 +120,8 @@
پورت گوم (درگا سرورن ز نۊ هؽل اکونه)
فاسله پورت گوم (سانیه)
pinSHA256
+ Bandwidth down (units)
+ Bandwidth up (units)
هالت XHTTP
XHTTP Extra خام JSON، قالوو: { XHTTPObject }
diff --git a/V2rayNG/app/src/main/res/values-fa/strings.xml b/V2rayNG/app/src/main/res/values-fa/strings.xml
index a7d7d227..3a30f440 100644
--- a/V2rayNG/app/src/main/res/values-fa/strings.xml
+++ b/V2rayNG/app/src/main/res/values-fa/strings.xml
@@ -115,6 +115,8 @@
پورت پرش (درگاه سرور را بازنویسی می کند)
فاصله پورت پرش (ثانیه)
pinSHA256
+ Bandwidth down (units)
+ Bandwidth up (units)
حالت XHTTP
خام JSON XHTTP Extra، قالب: { XHTTPObject }
diff --git a/V2rayNG/app/src/main/res/values-ru/strings.xml b/V2rayNG/app/src/main/res/values-ru/strings.xml
index a4bbc55c..3dcc8704 100644
--- a/V2rayNG/app/src/main/res/values-ru/strings.xml
+++ b/V2rayNG/app/src/main/res/values-ru/strings.xml
@@ -119,6 +119,8 @@
Смена портов (переопределяет порт)
Интервал смены портов
pinSHA256
+ Bandwidth down (units)
+ Bandwidth up (units)
Режим XHTTP
Необработанный JSON XHTTP Extra, формат: { XHTTPObject }
diff --git a/V2rayNG/app/src/main/res/values-vi/strings.xml b/V2rayNG/app/src/main/res/values-vi/strings.xml
index 691ac1d8..f0acddf4 100644
--- a/V2rayNG/app/src/main/res/values-vi/strings.xml
+++ b/V2rayNG/app/src/main/res/values-vi/strings.xml
@@ -114,6 +114,8 @@
Port Hopping
Port Hopping Interval
pinSHA256
+ Bandwidth down (units)
+ Bandwidth up (units)
XHTTP Mode
XHTTP Extra raw JSON, format: { XHTTPObject }
diff --git a/V2rayNG/app/src/main/res/values-zh-rCN/strings.xml b/V2rayNG/app/src/main/res/values-zh-rCN/strings.xml
index 1a58e3ba..3542d89f 100644
--- a/V2rayNG/app/src/main/res/values-zh-rCN/strings.xml
+++ b/V2rayNG/app/src/main/res/values-zh-rCN/strings.xml
@@ -114,6 +114,8 @@
跳跃端口(会覆盖服务器端口)
端口跳跃间隔(秒)
SHA256证书指纹
+ 带宽下行 (单位)
+ 带宽上行 (单位)
XHTTP 模式
XHTTP Extra 原始 JSON,格式: { XHTTPObject }
diff --git a/V2rayNG/app/src/main/res/values-zh-rTW/strings.xml b/V2rayNG/app/src/main/res/values-zh-rTW/strings.xml
index 50b6b5a8..05fa03b5 100644
--- a/V2rayNG/app/src/main/res/values-zh-rTW/strings.xml
+++ b/V2rayNG/app/src/main/res/values-zh-rTW/strings.xml
@@ -114,6 +114,8 @@
跳躍連接埠(會覆蓋伺服器連接埠)
連接埠跳躍間隔(秒)
SHA256憑證指紋
+ 頻寬下行 (單位)
+ 頻寬上行 (單位)
XHTTP 模式
XHTTP Extra 原始 JSON,格式: { XHTTPObject }
diff --git a/V2rayNG/app/src/main/res/values/strings.xml b/V2rayNG/app/src/main/res/values/strings.xml
index da1fe1a3..efdee8df 100644
--- a/V2rayNG/app/src/main/res/values/strings.xml
+++ b/V2rayNG/app/src/main/res/values/strings.xml
@@ -120,6 +120,8 @@
Port Hopping(will override the port)
Port Hopping Interval
pinSHA256
+ Bandwidth down (units)
+ Bandwidth up (units)
XHTTP Mode
XHTTP Extra raw JSON, format: { XHTTPObject }