File tree Expand file tree Collapse file tree 8 files changed +16
-14
lines changed
app/src/main/kotlin/com/neko/v2ray/util Expand file tree Collapse file tree 8 files changed +16
-14
lines changed Original file line number Diff line number Diff line change @@ -40,19 +40,19 @@ object AngConfigManager {
40
40
return R .string.toast_none_data
41
41
}
42
42
val config = if (str.startsWith(EConfigType .VMESS .protocolScheme)) {
43
- VmessFmt .parseVmess (str)
43
+ VmessFmt .parse (str)
44
44
} else if (str.startsWith(EConfigType .SHADOWSOCKS .protocolScheme)) {
45
- ShadowsocksFmt .parseShadowsocks (str)
45
+ ShadowsocksFmt .parse (str)
46
46
} else if (str.startsWith(EConfigType .SOCKS .protocolScheme)) {
47
- SocksFmt .parseSocks (str)
47
+ SocksFmt .parse (str)
48
48
} else if (str.startsWith(EConfigType .TROJAN .protocolScheme)) {
49
- TrojanFmt .parseTrojan (str)
49
+ TrojanFmt .parse (str)
50
50
} else if (str.startsWith(EConfigType .VLESS .protocolScheme)) {
51
- VlessFmt .parseVless (str)
51
+ VlessFmt .parse (str)
52
52
} else if (str.startsWith(EConfigType .WIREGUARD .protocolScheme)) {
53
- WireguardFmt .parseWireguard (str)
53
+ WireguardFmt .parse (str)
54
54
} else if (str.startsWith(EConfigType .HYSTERIA2 .protocolScheme)) {
55
- Hysteria2Fmt .parseHysteria2 (str)
55
+ Hysteria2Fmt .parse (str)
56
56
} else {
57
57
null
58
58
}
Original file line number Diff line number Diff line change @@ -2,7 +2,9 @@ package com.neko.v2ray.util.fmt
2
2
3
3
import android.text.TextUtils
4
4
import com.neko.v2ray.AppConfig
5
+ import com.neko.v2ray.AppConfig.LOOPBACK
5
6
import com.neko.v2ray.dto.EConfigType
7
+ import com.neko.v2ray.dto.Hysteria2Bean
6
8
import com.neko.v2ray.dto.ServerConfig
7
9
import com.neko.v2ray.dto.V2rayConfig
8
10
import com.neko.v2ray.extension.idnHost
@@ -12,7 +14,7 @@ import java.net.URI
12
14
13
15
object Hysteria2Fmt {
14
16
15
- fun parseHysteria2 (str : String ): ServerConfig {
17
+ fun parse (str : String ): ServerConfig {
16
18
var allowInsecure = settingsStorage?.decodeBool(AppConfig .PREF_ALLOW_INSECURE ) ? : false
17
19
val config = ServerConfig .create(EConfigType .HYSTERIA2 )
18
20
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ import com.neko.v2ray.util.Utils
9
9
import java.net.URI
10
10
11
11
object ShadowsocksFmt {
12
- fun parseShadowsocks (str : String ): ServerConfig ? {
12
+ fun parse (str : String ): ServerConfig ? {
13
13
val config = ServerConfig .create(EConfigType .SHADOWSOCKS )
14
14
if (! tryResolveResolveSip002(str, config)) {
15
15
var result = str.replace(EConfigType .SHADOWSOCKS .protocolScheme, " " )
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import com.neko.v2ray.dto.V2rayConfig
6
6
import com.neko.v2ray.util.Utils
7
7
8
8
object SocksFmt {
9
- fun parseSocks (str : String ): ServerConfig ? {
9
+ fun parse (str : String ): ServerConfig ? {
10
10
val config = ServerConfig .create(EConfigType .SOCKS )
11
11
var result = str.replace(EConfigType .SOCKS .protocolScheme, " " )
12
12
val indexSplit = result.indexOf(" #" )
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ import java.net.URI
12
12
13
13
object TrojanFmt {
14
14
15
- fun parseTrojan (str : String ): ServerConfig {
15
+ fun parse (str : String ): ServerConfig {
16
16
var allowInsecure = settingsStorage?.decodeBool(AppConfig .PREF_ALLOW_INSECURE ) ? : false
17
17
val config = ServerConfig .create(EConfigType .TROJAN )
18
18
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ import java.net.URI
12
12
13
13
object VlessFmt {
14
14
15
- fun parseVless (str : String ): ServerConfig ? {
15
+ fun parse (str : String ): ServerConfig ? {
16
16
var allowInsecure = settingsStorage?.decodeBool(AppConfig .PREF_ALLOW_INSECURE ) ? : false
17
17
val config = ServerConfig .create(EConfigType .VLESS )
18
18
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ import java.net.URI
15
15
16
16
object VmessFmt {
17
17
18
- fun parseVmess (str : String ): ServerConfig ? {
18
+ fun parse (str : String ): ServerConfig ? {
19
19
if (str.indexOf(' ?' ) > 0 && str.indexOf(' &' ) > 0 ) {
20
20
return parseVmessStd(str)
21
21
}
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ import com.neko.v2ray.util.Utils
9
9
import java.net.URI
10
10
11
11
object WireguardFmt {
12
- fun parseWireguard (str : String ): ServerConfig ? {
12
+ fun parse (str : String ): ServerConfig ? {
13
13
val uri = URI (Utils .fixIllegalUrl(str))
14
14
if (uri.rawQuery != null ) {
15
15
val config = ServerConfig .create(EConfigType .WIREGUARD )
You can’t perform that action at this time.
0 commit comments