Parse SOCKS userInfo without unnecessary decoding

https://github.com/2dust/v2rayNG/issues/5657
This commit is contained in:
2dust
2026-05-20 13:59:54 +08:00
parent ef13e336da
commit 7c68aa9d83
@@ -26,7 +26,11 @@ object SocksFmt : FmtBase() {
config.serverPort = uri.port.toString()
if (uri.userInfo?.isEmpty() == false) {
val result = Utils.decode(uri.userInfo).split(":", limit = 2)
val result = if (uri.userInfo.contains(":")) {
uri.userInfo.split(":", limit = 2)
} else {
Utils.decode(uri.userInfo).split(":", limit = 2)
}
if (result.count() == 2) {
config.username = result.first()
config.password = result.last()