1 parent cb6bcd4 commit 667c9adCopy full SHA for 667c9ad
1 file changed
app/src/main/java/io/nekohasekai/sagernet/fmt/wireguard/WireGuardFmt.kt
@@ -13,7 +13,10 @@ private const val BASE64_ALPHABET =
13
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
14
15
fun parseWireGuardConfig(conf: String): List<WireGuardBean> {
16
- val ini = Ini(StringReader(conf))
+ val ini = Ini().apply {
17
+ config.isMultiSection = true
18
+ load(StringReader(conf))
19
+ }
20
val iface = ini["Interface"] ?: error("Missing 'Interface' selection")
21
val localAddresses = iface.getAll("Address")
22
?.flatMap { value -> value.split(',') }
0 commit comments