Set V2rayConfig remarks based on ServerConfig in V2rayConfigUtil.kt
This commit is contained in:
1 parent
9142b9cfb4
commit
773bcc5658
1 file changed
+6
-2
@@ -49,7 +49,7 @@ object V2rayConfigUtil {
|
|||||||
return Result(true, customConfig)
|
return Result(true, customConfig)
|
||||||
}
|
}
|
||||||
val outbound = config.getProxyOutbound() ?: return Result(false, "")
|
val outbound = config.getProxyOutbound() ?: return Result(false, "")
|
||||||
val result = getV2rayNonCustomConfig(context, outbound)
|
val result = getV2rayNonCustomConfig(context, outbound, config.remarks)
|
||||||
//Log.d(ANG_PACKAGE, result.content)
|
//Log.d(ANG_PACKAGE, result.content)
|
||||||
return result
|
return result
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
@@ -63,7 +63,8 @@ object V2rayConfigUtil {
|
|||||||
*/
|
*/
|
||||||
private fun getV2rayNonCustomConfig(
|
private fun getV2rayNonCustomConfig(
|
||||||
context: Context,
|
context: Context,
|
||||||
outbound: V2rayConfig.OutboundBean
|
outbound: V2rayConfig.OutboundBean,
|
||||||
|
remarks: String,
|
||||||
): Result {
|
): Result {
|
||||||
val result = Result(false, "")
|
val result = Result(false, "")
|
||||||
//取得默认配置
|
//取得默认配置
|
||||||
@@ -98,6 +99,9 @@ object V2rayConfigUtil {
|
|||||||
v2rayConfig.stats = null
|
v2rayConfig.stats = null
|
||||||
v2rayConfig.policy = null
|
v2rayConfig.policy = null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
v2rayConfig.remarks = remarks
|
||||||
|
|
||||||
result.status = true
|
result.status = true
|
||||||
result.content = v2rayConfig.toPrettyPrinting()
|
result.content = v2rayConfig.toPrettyPrinting()
|
||||||
return result
|
return result
|
||||||
|
|||||||
Reference in new issue
Block a user