Merge pull request #1693 from amnezia-vpn/feature/android-awg1.5

feat: android awg1.5
This commit is contained in:
Nethius 2025-07-05 11:27:00 +08:00 committed by GitHub
commit fcd96d588e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 20 additions and 31 deletions

@ -1 +1 @@
Subproject commit 527b52f08cac102a6386a1fb49f365b4f861c9c2 Subproject commit ae4db58c73b8be07abcddc42295fd92d84d768f7

View file

@ -126,14 +126,14 @@ open class Wireguard : Protocol() {
configData.optStringOrNull("H2")?.let { setH2(it.toLong()) } configData.optStringOrNull("H2")?.let { setH2(it.toLong()) }
configData.optStringOrNull("H3")?.let { setH3(it.toLong()) } configData.optStringOrNull("H3")?.let { setH3(it.toLong()) }
configData.optStringOrNull("H4")?.let { setH4(it.toLong()) } configData.optStringOrNull("H4")?.let { setH4(it.toLong()) }
configData.optStringOrNull("I1")?.let { setI1(it.toString()) } configData.optStringOrNull("I1")?.let { setI1(it) }
configData.optStringOrNull("I2")?.let { setI2(it.toString()) } configData.optStringOrNull("I2")?.let { setI2(it) }
configData.optStringOrNull("I3")?.let { setI3(it.toString()) } configData.optStringOrNull("I3")?.let { setI3(it) }
configData.optStringOrNull("I4")?.let { setI4(it.toString()) } configData.optStringOrNull("I4")?.let { setI4(it) }
configData.optStringOrNull("I5")?.let { setI5(it.toString()) } configData.optStringOrNull("I5")?.let { setI5(it) }
configData.optStringOrNull("J1")?.let { setJ1(it.toString()) } configData.optStringOrNull("J1")?.let { setJ1(it) }
configData.optStringOrNull("J2")?.let { setJ2(it.toString()) } configData.optStringOrNull("J2")?.let { setJ2(it) }
configData.optStringOrNull("J3")?.let { setJ3(it.toString()) } configData.optStringOrNull("J3")?.let { setJ3(it) }
configData.optStringOrNull("Itime")?.let { setItime(it.toInt()) } configData.optStringOrNull("Itime")?.let { setItime(it.toInt()) }
} }

View file

@ -83,21 +83,21 @@ open class WireguardConfig protected constructor(
appendLine("jmax=$jmax") appendLine("jmax=$jmax")
appendLine("s1=$s1") appendLine("s1=$s1")
appendLine("s2=$s2") appendLine("s2=$s2")
appendLine("s3=$s3") s3?.let { appendLine("s3=$it") }
appendLine("s4=$s4") s4?.let { appendLine("s4=$it") }
appendLine("h1=$h1") appendLine("h1=$h1")
appendLine("h2=$h2") appendLine("h2=$h2")
appendLine("h3=$h3") appendLine("h3=$h3")
appendLine("h4=$h4") appendLine("h4=$h4")
appendLine("i1=$i1") i1?.let { appendLine("i1=$it") }
appendLine("i2=$i2") i2?.let { appendLine("i2=$it") }
appendLine("i3=$i3") i3?.let { appendLine("i3=$it") }
appendLine("i4=$i4") i4?.let { appendLine("i4=$it") }
appendLine("i5=$i5") i5?.let { appendLine("i5=$it") }
appendLine("j1=$j1") j1?.let { appendLine("j1=$it") }
appendLine("j2=$j2") j2?.let { appendLine("j2=$it") }
appendLine("j3=$j3") j3?.let { appendLine("j3=$it") }
appendLine("itime=$itime") itime?.let { appendLine("itime=$it") }
} }
} }
@ -107,21 +107,10 @@ open class WireguardConfig protected constructor(
if (jmax == null) throw BadConfigException("Parameter jmax is undefined") if (jmax == null) throw BadConfigException("Parameter jmax is undefined")
if (s1 == null) throw BadConfigException("Parameter s1 is undefined") if (s1 == null) throw BadConfigException("Parameter s1 is undefined")
if (s2 == null) throw BadConfigException("Parameter s2 is undefined") if (s2 == null) throw BadConfigException("Parameter s2 is undefined")
if (s3 == null) throw BadConfigException("Parameter s3 is undefined")
if (s4 == null) throw BadConfigException("Parameter s4 is undefined")
if (h1 == null) throw BadConfigException("Parameter h1 is undefined") if (h1 == null) throw BadConfigException("Parameter h1 is undefined")
if (h2 == null) throw BadConfigException("Parameter h2 is undefined") if (h2 == null) throw BadConfigException("Parameter h2 is undefined")
if (h3 == null) throw BadConfigException("Parameter h3 is undefined") if (h3 == null) throw BadConfigException("Parameter h3 is undefined")
if (h4 == null) throw BadConfigException("Parameter h4 is undefined") if (h4 == null) throw BadConfigException("Parameter h4 is undefined")
if (i1 == null) throw BadConfigException("Parameter i1 is undefined")
if (i2 == null) throw BadConfigException("Parameter i2 is undefined")
if (i3 == null) throw BadConfigException("Parameter i3 is undefined")
if (i4 == null) throw BadConfigException("Parameter i4 is undefined")
if (i5 == null) throw BadConfigException("Parameter i5 is undefined")
if (j1 == null) throw BadConfigException("Parameter j1 is undefined")
if (j2 == null) throw BadConfigException("Parameter j2 is undefined")
if (j3 == null) throw BadConfigException("Parameter j3 is undefined")
if (itime == null) throw BadConfigException("Parameter itime is undefined")
} }
open fun appendPeerLine(sb: StringBuilder) = with(sb) { open fun appendPeerLine(sb: StringBuilder) = with(sb) {