From b9c2decb348cbc2343226d700f43194cbcaebb82 Mon Sep 17 00:00:00 2001 From: DHR60 <192860629+DHR60@users.noreply.github.com> Date: Fri, 11 Sep 2026 11:32:23 +0000 Subject: [PATCH] Delete redundant fields (#6216) --- V2rayNG/app/src/main/assets/v2ray_config.json | 162 +++++++-------- .../main/assets/v2ray_config_with_tun.json | 196 ++++++++---------- .../com/v2ray/ang/core/CoreOutboundBuilder.kt | 1 + 3 files changed, 160 insertions(+), 199 deletions(-) diff --git a/V2rayNG/app/src/main/assets/v2ray_config.json b/V2rayNG/app/src/main/assets/v2ray_config.json index f5829da93..10e2b7be3 100644 --- a/V2rayNG/app/src/main/assets/v2ray_config.json +++ b/V2rayNG/app/src/main/assets/v2ray_config.json @@ -1,106 +1,86 @@ { - "stats":{}, + "stats": {}, "log": { "loglevel": "warning" }, - "policy":{ - "levels": { - "8": { - "handshake": 4, - "connIdle": 300, - "uplinkOnly": 1, - "downlinkOnly": 1 + "policy": { + "levels": { + "8": { + "handshake": 4, + "connIdle": 300, + "uplinkOnly": 1, + "downlinkOnly": 1 + } + }, + "system": { + "statsOutboundUplink": true, + "statsOutboundDownlink": true + } + }, + "inbounds": [ + { + "tag": "socks", + "port": 10808, + "protocol": "socks", + "settings": { + "auth": "noauth", + "udp": true, + "userLevel": 8 + }, + "sniffing": { + "enabled": true, + "destOverride": [ + "http", + "tls", + "quic" + ] + } + } + ], + "outbounds": [ + { + "tag": "proxy", + "protocol": "vmess", + "settings": { + "address": "v2ray.cool", + "port": 10086 + }, + "streamSettings": { + "network": "tcp" + }, + "mux": { + "enabled": false + } + }, + { + "protocol": "freedom", + "streamSettings": { + "sockopt": { + "domainStrategy": "UseIP", + "happyEyeballs": { + "tryDelayMs": 250, + "interleave": 2 + } } }, - "system": { - "statsOutboundUplink": true, - "statsOutboundDownlink": true - } - }, - "inbounds": [{ - "tag": "socks", - "port": 10808, - "protocol": "socks", - "settings": { - "auth": "noauth", - "udp": true, - "userLevel": 8 + "tag": "direct" }, - "sniffing": { - "enabled": true, - "destOverride": [ - "http", - "tls", - "quic" - ] - } - } -], - "outbounds": [{ - "tag": "proxy", - "protocol": "vmess", - "settings": { - "vnext": [ - { - "address": "v2ray.cool", - "port": 10086, - "users": [ - { - "id": "a3482e88-686a-4a58-8126-99c9df64b7bf", - "alterId": 0, - "security": "auto", - "level": 8 - } - ] - } - ], - "servers": [ - { - "address": "v2ray.cool", - "method": "chacha20", - "ota": false, - "password": "123456", - "port": 10086, - "level": 8 - } - ] - }, - "streamSettings": { - "network": "tcp" - }, - "mux": { - "enabled": false - } - }, - { - "protocol": "freedom", - "streamSettings": { - "sockopt": { - "domainStrategy": "UseIP", - "happyEyeballs": { - "tryDelayMs": 250, - "interleave": 2 + { + "protocol": "blackhole", + "tag": "block", + "settings": { + "response": { + "type": "http" } } - }, - "tag": "direct" - }, - { - "protocol": "blackhole", - "tag": "block", - "settings": { - "response": { - "type": "http" - } } - } ], "routing": { - "domainStrategy": "AsIs", - "rules": [] + "domainStrategy": "AsIs", + "rules": [] }, "dns": { - "hosts": {}, - "servers": [] + "hosts": {}, + "servers": [] } -} +} \ No newline at end of file diff --git a/V2rayNG/app/src/main/assets/v2ray_config_with_tun.json b/V2rayNG/app/src/main/assets/v2ray_config_with_tun.json index 1b49cf746..409d4cfa6 100644 --- a/V2rayNG/app/src/main/assets/v2ray_config_with_tun.json +++ b/V2rayNG/app/src/main/assets/v2ray_config_with_tun.json @@ -1,123 +1,103 @@ { - "stats":{}, + "stats": {}, "log": { "loglevel": "warning" }, - "policy":{ - "levels": { - "8": { - "handshake": 4, - "connIdle": 300, - "uplinkOnly": 1, - "downlinkOnly": 1 + "policy": { + "levels": { + "8": { + "handshake": 4, + "connIdle": 300, + "uplinkOnly": 1, + "downlinkOnly": 1 + } + }, + "system": { + "statsOutboundUplink": true, + "statsOutboundDownlink": true + } + }, + "inbounds": [ + { + "tag": "socks", + "port": 10808, + "protocol": "socks", + "settings": { + "auth": "noauth", + "udp": true, + "userLevel": 8 + }, + "sniffing": { + "enabled": true, + "destOverride": [ + "http", + "tls", + "quic" + ] + } + }, + { + "tag": "tun", + "protocol": "tun", + "settings": { + "name": "xray0", + "MTU": 1500, + "userLevel": 8 + }, + "sniffing": { + "enabled": true, + "destOverride": [ + "http", + "tls", + "quic" + ] + } + } + ], + "outbounds": [ + { + "tag": "proxy", + "protocol": "vmess", + "settings": { + "address": "v2ray.cool", + "port": 10086 + }, + "streamSettings": { + "network": "tcp" + }, + "mux": { + "enabled": false + } + }, + { + "protocol": "freedom", + "streamSettings": { + "sockopt": { + "domainStrategy": "UseIP", + "happyEyeballs": { + "tryDelayMs": 250, + "interleave": 2 + } } }, - "system": { - "statsOutboundUplink": true, - "statsOutboundDownlink": true - } - }, - "inbounds": [{ - "tag": "socks", - "port": 10808, - "protocol": "socks", - "settings": { - "auth": "noauth", - "udp": true, - "userLevel": 8 + "tag": "direct" }, - "sniffing": { - "enabled": true, - "destOverride": [ - "http", - "tls", - "quic" - ] - } - }, - { - "tag": "tun", - "protocol": "tun", - "settings": { - "name": "xray0", - "MTU": 1500, - "userLevel": 8 - }, - "sniffing": { - "enabled": true, - "destOverride": [ - "http", - "tls", - "quic" - ] - } - } -], - "outbounds": [{ - "tag": "proxy", - "protocol": "vmess", - "settings": { - "vnext": [ - { - "address": "v2ray.cool", - "port": 10086, - "users": [ - { - "id": "a3482e88-686a-4a58-8126-99c9df64b7bf", - "alterId": 0, - "security": "auto", - "level": 8 - } - ] - } - ], - "servers": [ - { - "address": "v2ray.cool", - "method": "chacha20", - "ota": false, - "password": "123456", - "port": 10086, - "level": 8 - } - ] - }, - "streamSettings": { - "network": "tcp" - }, - "mux": { - "enabled": false - } - }, - { - "protocol": "freedom", - "streamSettings": { - "sockopt": { - "domainStrategy": "UseIP", - "happyEyeballs": { - "tryDelayMs": 250, - "interleave": 2 + { + "protocol": "blackhole", + "tag": "block", + "settings": { + "response": { + "type": "http" } } - }, - "tag": "direct" - }, - { - "protocol": "blackhole", - "tag": "block", - "settings": { - "response": { - "type": "http" - } } - } ], "routing": { - "domainStrategy": "AsIs", - "rules": [] + "domainStrategy": "AsIs", + "rules": [] }, "dns": { - "hosts": {}, - "servers": [] + "hosts": {}, + "servers": [] } -} +} \ No newline at end of file diff --git a/V2rayNG/app/src/main/java/com/v2ray/ang/core/CoreOutboundBuilder.kt b/V2rayNG/app/src/main/java/com/v2ray/ang/core/CoreOutboundBuilder.kt index aa951ff7f..85406608e 100644 --- a/V2rayNG/app/src/main/java/com/v2ray/ang/core/CoreOutboundBuilder.kt +++ b/V2rayNG/app/src/main/java/com/v2ray/ang/core/CoreOutboundBuilder.kt @@ -255,6 +255,7 @@ object CoreOutboundBuilder { outboundBean?.settings?.let { wireguard -> wireguard.secretKey = profileItem.secretKey wireguard.address = addresses + wireguard.port = null wireguard.peers?.firstOrNull()?.let { peer -> peer.publicKey = profileItem.publicKey.orEmpty() peer.preSharedKey = profileItem.preSharedKey?.nullIfBlank()