mirror of
https://github.com/MatsuriDayo/NekoBoxForAndroid.git
synced 2025-12-19 06:30:05 +08:00
Fix ConfigBuilder
This commit is contained in:
parent
29a5914e8b
commit
b65333b1c6
@ -336,13 +336,6 @@ fun buildConfig(
|
||||
bypassDNSBeans += proxyEntity.requireBean()
|
||||
}
|
||||
|
||||
if (needGlobal) {
|
||||
globalOutbounds[proxyEntity.id]?.let {
|
||||
if (index == 0) chainTagOut = it // single, duplicate chain
|
||||
return@forEachIndexed
|
||||
}
|
||||
}
|
||||
|
||||
// last profile set as "proxy"
|
||||
if (chainId == 0L && index == 0) {
|
||||
tagOut = TAG_PROXY
|
||||
@ -353,10 +346,6 @@ fun buildConfig(
|
||||
tagOut = selectorName(bean.displayName())
|
||||
}
|
||||
|
||||
// now tagOut is determined
|
||||
if (needGlobal) {
|
||||
globalOutbounds[proxyEntity.id] = tagOut
|
||||
}
|
||||
|
||||
// chain rules
|
||||
if (index > 0) {
|
||||
@ -374,6 +363,15 @@ fun buildConfig(
|
||||
chainTagOut = tagOut
|
||||
}
|
||||
|
||||
// now tagOut is determined
|
||||
if (needGlobal) {
|
||||
globalOutbounds[proxyEntity.id]?.let {
|
||||
if (index == 0) chainTagOut = it // single, duplicate chain
|
||||
return@forEachIndexed
|
||||
}
|
||||
globalOutbounds[proxyEntity.id] = tagOut
|
||||
}
|
||||
|
||||
// Chain outbound
|
||||
if (proxyEntity.needExternal()) {
|
||||
val localPort = mkPort()
|
||||
@ -465,8 +463,8 @@ fun buildConfig(
|
||||
}
|
||||
if (Plugins.isUsingMatsuriExe(pluginId)) {
|
||||
needExternal = false
|
||||
} else if (bean is HysteriaBean) {
|
||||
throw Exception("not supported hysteria-plugin (SagerNet)")
|
||||
} else if (pluginId.isNotBlank()) {
|
||||
throw Exception("You are using an unsupported $pluginId, please download the correct plugin.")
|
||||
}
|
||||
}
|
||||
if (needExternal) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user