Skip to content

Commit e24dd3b

Browse files
xubeiyanxubeiyan
authored andcommitted
fix(MainRecyclerAdapter.kt): 将原有的主界面中服务器IP隐藏的逻辑中的1.23.45.67替换为1.23.45***更新为1.23.45.*** (#3585)
Co-authored-by: xubeiyan <[email protected]>
1 parent 5fef5a3 commit e24dd3b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app/src/main/kotlin/com/neko/v2ray/ui/MainRecyclerAdapter.kt

+3-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,9 @@ class MainRecyclerAdapter(val activity: MainActivity) : RecyclerView.Adapter<Mai
8484
}
8585
}
8686

87-
val strState = "${profile.server?.dropLast(3)}*** : ${profile.serverPort}"
87+
// 替换服务器地址的'.'之后的内容为'***',例如将'1.23.45.67'替换为'1.23.45.***'
88+
val modifiedServer = profile.server?.split('.')?.dropLast(1)?.joinToString(".", postfix = ".***")
89+
val strState = "$modifiedServer : ${profile.serverPort}"
8890

8991
holder.itemMainBinding.tvStatistics.text = strState
9092

0 commit comments

Comments
 (0)