瀏覽代碼

Minor fixes

世界 4 年之前
父節點
當前提交
0d0a87e83c

+ 2 - 1
app/src/main/java/io/nekohasekai/sagernet/bg/ProxyInstance.kt

@@ -168,7 +168,7 @@ class ProxyInstance(val profile: ProxyEntity) {
             chain.entries.forEachIndexed { index, (port, profile) ->
                 val bean = profile.requireBean()
                 val needChain = index != chain.size - 1
-                val config = pluginConfigs[port] ?: return@forEachIndexed
+                val config = pluginConfigs[port] ?: ""
 
                 when {
                     profile.useExternalShadowsocks() -> {
@@ -349,6 +349,7 @@ class ProxyInstance(val profile: ProxyEntity) {
                         base.data.processes!!.start(commands)
                     }
                     bean is BrookBean -> {
+
                         if (needChain) error("brook is incompatible with chain")
 
                         val commands = mutableListOf(initPlugin("brook-plugin").path)

+ 8 - 0
app/src/main/java/io/nekohasekai/sagernet/ktx/Formats.kt

@@ -24,6 +24,7 @@ package io.nekohasekai.sagernet.ktx
 import cn.hutool.core.codec.Base64
 import cn.hutool.json.JSONObject
 import io.nekohasekai.sagernet.fmt.AbstractBean
+import io.nekohasekai.sagernet.fmt.brook.parseBrook
 import io.nekohasekai.sagernet.fmt.gson.gson
 import io.nekohasekai.sagernet.fmt.http.parseHttp
 import io.nekohasekai.sagernet.fmt.naive.parseNaive
@@ -129,6 +130,13 @@ fun parseProxies(text: String, initType: Int = 0, badType: Int = 4): Pair<Int, L
             }.onFailure {
                 Logs.w(it)
             }
+        } else if (startsWith("brook://")) {
+            Logs.d("Try parse brook link: $this")
+            runCatching {
+                entities.add(parseBrook(this))
+            }.onFailure {
+                Logs.w(it)
+            }
         }
     }
 

+ 3 - 1
buildSrc/src/main/kotlin/Helpers.kt

@@ -177,11 +177,13 @@ fun Project.setupAppCommon() {
             }
         }
         buildTypes {
-            getByName("release").signingConfig = if (keystorePwd != null) {
+            val key = if (keystorePwd != null) {
                 signingConfigs.getByName("release")
             } else {
                 signingConfigs.getByName("debug")
             }
+            getByName("release").signingConfig = key
+            getByName("debug").signingConfig = key
         }
 
     }