update subscription 4 custom configuration

This commit is contained in:
2dust committed 2024-01-19 17:44:35 +08:00
1 parent a18b8f4f2b
commit 52710020ea
3 files changed
+26

No files matched your search

@@ -975,4 +975,24 @@ object AngConfigManager {
return true
}
fun appendCustomConfigServer(server: String?, subid: String): Int {
if (server == null) {
return 0
}
if (server.contains("inbounds")
&& server.contains("outbounds")
&& server.contains("routing")
) {
val config = ServerConfig.create(EConfigType.CUSTOM)
config.remarks = System.currentTimeMillis().toString()
config.subscriptionId = subid
config.fullConfig = Gson().fromJson(server, V2rayConfig::class.java)
val key = MmkvManager.encodeServerConfig("", config)
serverRawStorage?.encode(key, server)
return 1
} else {
return 0
}
}
}