Skip to content

Feature/regex and protocol search#5364

Merged
2dust merged 6 commits into2dust:masterfrom
Q7DF1:feature/regexAndProtocolSearch
Mar 21, 2026
Merged

Feature/regex and protocol search#5364
2dust merged 6 commits into2dust:masterfrom
Q7DF1:feature/regexAndProtocolSearch

Conversation

@Q7DF1
Copy link
Copy Markdown
Contributor

@Q7DF1 Q7DF1 commented Mar 13, 2026

添加正则搜索 以及 支持特定协议过滤

Copy link
Copy Markdown
Contributor Author

@Q7DF1 Q7DF1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks Good To Me

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 MainViewModel to 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 #include paths in header files.
  • Added compile-hevtun.bat — a Windows build script for compiling hev-socks5-tunnel using 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.

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 @@
<# :
@@ -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
}
@Q7DF1
Copy link
Copy Markdown
Contributor Author

Q7DF1 commented Mar 13, 2026

脚本用来解决 windows 平台tun2socks 编译 和解决 头文件 无法识别问题
#5362

@2dust
Copy link
Copy Markdown
Owner

2dust commented Mar 13, 2026

把 bat 移除掉,可以合并。

@Q7DF1
Copy link
Copy Markdown
Contributor Author

Q7DF1 commented Mar 13, 2026

把 bat 移除掉,可以合并。

好的,我晚一点处理

@Q7DF1
Copy link
Copy Markdown
Contributor Author

Q7DF1 commented Mar 13, 2026

把 bat 移除掉,可以合并。

done

@2dust 2dust merged commit a12ca3e into 2dust:master Mar 21, 2026
1 check passed
@Q7DF1 Q7DF1 deleted the feature/regexAndProtocolSearch branch March 26, 2026 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants