Feature/regex and protocol search#5364
Merged
2dust merged 6 commits into2dust:masterfrom Mar 21, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds regex-based search and protocol type filtering to the server list in v2rayNG, and also includes two unrelated Windows batch build scripts.
Changes:
- Enhanced server search in
MainViewModelto support regex patterns (with fallback to literal search on invalid regex) and added protocol (configType.name) as a searchable field. - Added
fix_headers.bat— a Windows build utility for auto-fixing unquoted#includepaths in header files. - Added
compile-hevtun.bat— a Windows build script for compilinghev-socks5-tunnelusing the Android NDK.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
V2rayNG/app/src/main/java/com/v2ray/ang/viewmodel/MainViewModel.kt |
Adds regex search support and protocol filtering to updateCache(), plus a matchesPattern extension function |
fix_headers.bat |
New build utility script to fix header include paths (unrelated to PR description) |
compile-hevtun.bat |
New build script for compiling hev-socks5-tunnel via NDK (unrelated to PR description) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
V2rayNG/app/src/main/java/com/v2ray/ang/viewmodel/MainViewModel.kt
Outdated
Show resolved
Hide resolved
Comment on lines
+134
to
+137
| val remarks = profile.remarks.lowercase() | ||
| val description = profile.description.orEmpty().lowercase() | ||
| val server = profile.server.orEmpty().lowercase() | ||
|
|
||
| if (remarks.contains(kw) || description.contains(kw) || server.contains(kw)) { | ||
| val protocol = profile.configType.name.lowercase() |
Comment on lines
+138
to
+141
| if (remarks.matchesPattern(searchRegex,kw) | ||
| || description.matchesPattern(searchRegex,kw) | ||
| || server.matchesPattern(searchRegex,kw) | ||
| || protocol.matchesPattern(searchRegex,kw)) { |
fix_headers.bat
Outdated
| @@ -0,0 +1,49 @@ | |||
| <# : | |||
compile-hevtun.bat
Outdated
| @@ -0,0 +1,59 @@ | |||
| @echo off | |||
Comment on lines
+122
to
+126
| val searchRegex = try { | ||
| if (kw.isNotEmpty()) Regex(kw, setOf(RegexOption.IGNORE_CASE)) else null | ||
| } catch (e: PatternSyntaxException) { | ||
| null // Fallback to literal search if regex is invalid | ||
| } |
Contributor
Author
|
脚本用来解决 windows 平台tun2socks 编译 和解决 头文件 无法识别问题 |
Owner
|
把 bat 移除掉,可以合并。 |
Contributor
Author
好的,我晚一点处理 |
Contributor
Author
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
添加正则搜索 以及 支持特定协议过滤