Compare commits

...

6 Commits

Author SHA1 Message Date
2dust
dc36986255 up 1.7.28 2022-12-05 20:36:29 +08:00
2dust
5651e002c4 Merge pull request #1822 from yuhan6665/xtls-rv
Add Wireguard outbound (custom config)
2022-12-05 20:00:40 +08:00
yuhan6665
4e7849d1cb Add Wireguard outbound (custom config) 2022-12-04 18:15:17 -05:00
2dust
9e3dba8dbe up 1.7.27 2022-11-28 20:18:17 +08:00
2dust
79ba41354e Merge pull request #1784 from DanielBlackBeard/master
fix Persian language dictation
2022-11-19 11:33:25 +08:00
dany pm
85e866d462 fix Persian language dictation 2022-11-18 17:28:01 +03:30
6 changed files with 26 additions and 14 deletions

View File

@@ -18,8 +18,8 @@ android {
minSdkVersion 21
targetSdkVersion Integer.parseInt("$targetSdkVer")
multiDexEnabled true
versionCode 486
versionName "1.7.26"
versionCode 488
versionName "1.7.28"
}
if (props["sign"]) {

View File

@@ -6,7 +6,8 @@ enum class EConfigType(val value: Int, val protocolScheme: String) {
SHADOWSOCKS(3, "ss://"),
SOCKS(4, "socks://"),
VLESS(5, "vless://"),
TROJAN(6, "trojan://");
TROJAN(6, "trojan://"),
WIREGUARD(7, "wireguard://");
companion object {
fun fromInt(value: Int) = values().firstOrNull { it.value == value }

View File

@@ -26,7 +26,7 @@ data class ServerConfig(
vnext = listOf(V2rayConfig.OutboundBean.OutSettingsBean.VnextBean(
users = listOf(V2rayConfig.OutboundBean.OutSettingsBean.VnextBean.UsersBean())))),
streamSettings = V2rayConfig.OutboundBean.StreamSettingsBean()))
EConfigType.CUSTOM ->
EConfigType.CUSTOM, EConfigType.WIREGUARD ->
return ServerConfig(configType = configType)
EConfigType.SHADOWSOCKS, EConfigType.SOCKS, EConfigType.TROJAN ->
return ServerConfig(

View File

@@ -74,14 +74,18 @@ data class V2rayConfig(
var response: Response? = null,
/*DNS*/
val network: String? = null,
val address: String? = null,
val address: Any? = null,
val port: Int? = null,
/*Freedom*/
var domainStrategy: String? = null,
val redirect: String? = null,
val userLevel: Int? = null,
/*Loopback*/
val inboundTag: String? = null) {
val inboundTag: String? = null,
/*Wireguard*/
val secretKey: String? = null,
val peers: List<WireGuardBean>? = null,
) {
data class VnextBean(var address: String = "",
var port: Int = DEFAULT_PORT,
@@ -113,6 +117,9 @@ data class V2rayConfig(
}
data class Response(var type: String)
data class WireGuardBean(var publicKey: String = "",
var endpoint: String = "")
}
data class StreamSettingsBean(var network: String = DEFAULT_NETWORK,
@@ -286,6 +293,8 @@ data class V2rayConfig(
|| protocol.equals(EConfigType.SOCKS.name, true)
|| protocol.equals(EConfigType.TROJAN.name, true)) {
return settings?.servers?.get(0)?.address
} else if (protocol.equals(EConfigType.WIREGUARD.name, true)) {
return settings?.peers?.get(0)?.endpoint?.substringBeforeLast(":")
}
return null
}
@@ -298,6 +307,8 @@ data class V2rayConfig(
|| protocol.equals(EConfigType.SOCKS.name, true)
|| protocol.equals(EConfigType.TROJAN.name, true)) {
return settings?.servers?.get(0)?.port
} else if (protocol.equals(EConfigType.WIREGUARD.name, true)) {
return settings?.peers?.get(0)?.endpoint?.substringAfterLast(":")?.toInt()
}
return null
}
@@ -311,6 +322,8 @@ data class V2rayConfig(
return settings?.servers?.get(0)?.password
} else if (protocol.equals(EConfigType.SOCKS.name, true)) {
return settings?.servers?.get(0)?.users?.get(0)?.pass
} else if (protocol.equals(EConfigType.WIREGUARD.name, true)) {
return settings?.secretKey
}
return null
}
@@ -426,12 +439,10 @@ data class V2rayConfig(
fun getProxyOutbound(): OutboundBean? {
outbounds.forEach { outbound ->
if (outbound.protocol.equals(EConfigType.VMESS.name, true) ||
outbound.protocol.equals(EConfigType.VLESS.name, true) ||
outbound.protocol.equals(EConfigType.SHADOWSOCKS.name, true) ||
outbound.protocol.equals(EConfigType.SOCKS.name, true) ||
outbound.protocol.equals(EConfigType.TROJAN.name, true)) {
return outbound
EConfigType.values().forEach {
if (outbound.protocol.equals(it.name, true)) {
return outbound
}
}
}
return null

View File

@@ -486,7 +486,7 @@ object AngConfigManager {
val json = Gson().toJson(vmessQRCode)
Utils.encode(json)
}
EConfigType.CUSTOM -> ""
EConfigType.CUSTOM, EConfigType.WIREGUARD -> ""
EConfigType.SHADOWSOCKS -> {
val remark = "#" + Utils.urlEncode(config.remarks)
val pw = Utils.encode("${outbound.getSecurityEncryption()}:${outbound.getPassword()}")

View File

@@ -46,7 +46,7 @@
<string name="server_lab_more_function">انتقال</string>
<string name="server_lab_head_type">نوع head</string>
<string name="server_lab_mode_type">حالت gRPC</string>
<string name="server_lab_request_host">درخواست میزبان (میزبان/میزبان ws/ یزبان h2)/امنیت QUIC</string>
<string name="server_lab_request_host">درخواست میزبان (میزبان/میزبان ws/ میزبان h2)/امنیت QUIC</string>
<string name="server_lab_path">مسیر (مسیر ws/ مسیر h2) کلید QUIC/دانه kcp/نام‌خدمات gRPC</string>
<string name="server_lab_stream_security">tls</string>
<string name="server_lab_stream_fingerprint" translatable="false">uTLS</string>