Skip to content

Conversation

@DHR60
Copy link
Contributor

@DHR60 DHR60 commented Jan 16, 2026

No description provided.

t-e-s-tweb referenced this pull request Jan 16, 2026
Updated getV2rayCustomConfig to check for the presence of a 'tun' inbound in the configuration. If not present and HevTun is not used, the method adds a 'tun' inbound from the template configuration and updates the config accordingly.
@2dust
Copy link
Owner

2dust commented Jan 16, 2026

379266f

自定义配置中也会自动加入 tun inbound ,也需要修改。
所以干脆就修改 模板 文件 https://github.com/2dust/v2rayNG/blob/master/V2rayNG/app/src/main/assets/v2ray_config_with_tun.json

@2dust
Copy link
Owner

2dust commented Jan 16, 2026

或者把 getinbound 里面的 sniffing 部分代码独立出来复用

@DHR60 DHR60 marked this pull request as draft January 16, 2026 11:38
@DHR60 DHR60 marked this pull request as ready for review January 16, 2026 11:43
@DHR60
Copy link
Contributor Author

DHR60 commented Jan 16, 2026

感觉有点做复杂了,但是默认开启 sniffing 感觉也不太对

@DHR60
Copy link
Contributor Author

DHR60 commented Jan 16, 2026

这样从设置里读感觉也不对,自定义配置和设置又没关系

// add tun inbound from template
val templateConfig = initV2rayConfig(context) ?: return result
val inboundTun = templateConfig.inbounds.firstOrNull { it.tag == "tun" } ?: return result
inboundTun.settings?.mtu = SettingsManager.getVpnMtu()
Copy link
Owner

Choose a reason for hiding this comment

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

这样吧,这里不要了,就读取默认的json 就行了。用户如果需要更细控制,自己写tun 在自定义配置里就好了,完美

Copy link
Contributor Author

Choose a reason for hiding this comment

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

好了

@2dust 2dust merged commit 12b9349 into 2dust:master Jan 16, 2026
1 check passed
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.

2 participants