|
@@ -93,7 +93,7 @@ class ProxyInstance(val profile: ProxyEntity) {
|
|
|
|
|
|
|
|
for ((index, profile) in config.index.entries) {
|
|
for ((index, profile) in config.index.entries) {
|
|
|
val port = socksPort + index
|
|
val port = socksPort + index
|
|
|
- val needChain = index == config.index.size - 1
|
|
|
|
|
|
|
+ val needChain = index != config.index.size - 1
|
|
|
when {
|
|
when {
|
|
|
profile.useExternalShadowsocks() -> {
|
|
profile.useExternalShadowsocks() -> {
|
|
|
val bean = profile.requireSS()
|
|
val bean = profile.requireSS()
|
|
@@ -162,8 +162,9 @@ class ProxyInstance(val profile: ProxyEntity) {
|
|
|
proxychainsConfigFile.writeText("strict_chain\n[ProxyList]\nsocks5 127.0.0.1 ${socksPort + index + 1}")
|
|
proxychainsConfigFile.writeText("strict_chain\n[ProxyList]\nsocks5 127.0.0.1 ${socksPort + index + 1}")
|
|
|
cacheFiles.add(proxychainsConfigFile)
|
|
cacheFiles.add(proxychainsConfigFile)
|
|
|
|
|
|
|
|
- env["LD_PRELOAD"] = File(SagerNet.application.applicationInfo.nativeLibraryDir,
|
|
|
|
|
- Executable.PROXYCHAINS).absolutePath
|
|
|
|
|
|
|
+ env["LD_PRELOAD"] =
|
|
|
|
|
+ File(SagerNet.application.applicationInfo.nativeLibraryDir,
|
|
|
|
|
+ Executable.PROXYCHAINS).absolutePath
|
|
|
env["PROXYCHAINS_CONF_FILE"] = proxychainsConfigFile.absolutePath
|
|
env["PROXYCHAINS_CONF_FILE"] = proxychainsConfigFile.absolutePath
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -201,8 +202,9 @@ class ProxyInstance(val profile: ProxyEntity) {
|
|
|
proxychainsConfigFile.writeText("strict_chain\n[ProxyList]\nsocks5 127.0.0.1 ${port + 1}")
|
|
proxychainsConfigFile.writeText("strict_chain\n[ProxyList]\nsocks5 127.0.0.1 ${port + 1}")
|
|
|
cacheFiles.add(proxychainsConfigFile)
|
|
cacheFiles.add(proxychainsConfigFile)
|
|
|
|
|
|
|
|
- env["LD_PRELOAD"] = File(SagerNet.application.applicationInfo.nativeLibraryDir,
|
|
|
|
|
- Executable.PROXYCHAINS).absolutePath
|
|
|
|
|
|
|
+ env["LD_PRELOAD"] =
|
|
|
|
|
+ File(SagerNet.application.applicationInfo.nativeLibraryDir,
|
|
|
|
|
+ Executable.PROXYCHAINS).absolutePath
|
|
|
env["PROXYCHAINS_CONF_FILE"] = proxychainsConfigFile.absolutePath
|
|
env["PROXYCHAINS_CONF_FILE"] = proxychainsConfigFile.absolutePath
|
|
|
}
|
|
}
|
|
|
|
|
|