Skip to content
This repository has been archived by the owner on Nov 14, 2024. It is now read-only.

Commit

Permalink
更新主页服务器地址ipv6隐藏效果 (#3615)
Browse files Browse the repository at this point in the history
* Update MainRecyclerAdapter.kt

* Update MainRecyclerAdapter.kt
  • Loading branch information
aaa8806 authored and AnGgIt86 committed Sep 29, 2024
1 parent 1258ce0 commit 9744ca6
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions app/src/main/kotlin/com/neko/v2ray/ui/MainRecyclerAdapter.kt
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,12 @@ class MainRecyclerAdapter(val activity: MainActivity) : RecyclerView.Adapter<Mai
}
}

// 替换服务器地址的'.'之后的内容为'***',例如将'1.23.45.67'替换为'1.23.45.***'
val modifiedServer = profile.server?.split('.')?.dropLast(1)?.joinToString(".", postfix = ".***")
val strState = "$modifiedServer : ${profile.serverPort}"
// 隐藏主页服务器地址为xxx:xxx:***/xxx.xxx.xxx.***
val strState = "${profile.server?.let {
if (it.contains(":"))
it.split(":").take(2).joinToString(":") + ":***"
else
it.split('.').dropLast(1).joinToString(".", postfix = ".***") }} : ${profile.serverPort}"

holder.itemMainBinding.tvStatistics.text = strState

Expand Down

0 comments on commit 9744ca6

Please sign in to comment.