Skip to content

Commit 8842682

Browse files
committed
Merge branch 'merge-upstream'
2 parents 9a7ead9 + b132b0d commit 8842682

File tree

7 files changed

+15
-183
lines changed

7 files changed

+15
-183
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- name: Setup Golang
2727
uses: actions/setup-go@v5
2828
with:
29-
go-version: '1.22'
29+
go-version: '1.22.2'
3030

3131
- name: Install gomobile
3232
run: |
Lines changed: 2 additions & 132 deletions
Original file line numberDiff line numberDiff line change
@@ -1,132 +1,2 @@
1-
domain:12306.com,
2-
domain:51ym.me,
3-
domain:52pojie.cn,
4-
domain:8686c.com,
5-
domain:abercrombie.com,
6-
domain:adobesc.com,
7-
domain:air-matters.com,
8-
domain:air-matters.io,
9-
domain:airtable.com,
10-
domain:akadns.net,
11-
domain:apache.org,
12-
domain:api.crisp.chat,
13-
domain:api.termius.com,
14-
domain:appshike.com,
15-
domain:appstore.com,
16-
domain:aweme.snssdk.com,
17-
domain:bababian.com,
18-
domain:battle.net,
19-
domain:beatsbydre.com,
20-
domain:bet365.com,
21-
domain:bilibili.cn,
22-
domain:ccgslb.com,
23-
domain:ccgslb.net,
24-
domain:chunbo.com,
25-
domain:chunboimg.com,
26-
domain:clashroyaleapp.com,
27-
domain:cloudsigma.com,
28-
domain:cloudxns.net,
29-
domain:cmfu.com,
30-
domain:culturedcode.com,
31-
domain:dct-cloud.com,
32-
domain:didialift.com,
33-
domain:douyutv.com,
34-
domain:duokan.com,
35-
domain:dytt8.net,
36-
domain:easou.com,
37-
domain:ecitic.net,
38-
domain:eclipse.org,
39-
domain:eudic.net,
40-
domain:ewqcxz.com,
41-
domain:fir.im,
42-
domain:frdic.com,
43-
domain:fresh-ideas.cc,
44-
domain:godic.net,
45-
domain:goodread.com,
46-
domain:haibian.com,
47-
domain:hdslb.net,
48-
domain:hollisterco.com,
49-
domain:hongxiu.com,
50-
domain:hxcdn.net,
51-
domain:images.unsplash.com,
52-
domain:img4me.com,
53-
domain:ipify.org,
54-
domain:ixdzs.com,
55-
domain:jd.hk,
56-
domain:jianshuapi.com,
57-
domain:jomodns.com,
58-
domain:jsboxbbs.com,
59-
domain:knewone.com,
60-
domain:kuaidi100.com,
61-
domain:lemicp.com,
62-
domain:letvcloud.com,
63-
domain:lizhi.io,
64-
domain:localizecdn.com,
65-
domain:lucifr.com,
66-
domain:luoo.net,
67-
domain:mai.tn,
68-
domain:maven.org,
69-
domain:miwifi.com,
70-
domain:moji.com,
71-
domain:moke.com,
72-
domain:mtalk.google.com,
73-
domain:mxhichina.com,
74-
domain:myqcloud.com,
75-
domain:myunlu.com,
76-
domain:netease.com,
77-
domain:nfoservers.com,
78-
domain:nssurge.com,
79-
domain:nuomi.com,
80-
domain:ourdvs.com,
81-
domain:overcast.fm,
82-
domain:paypal.com,
83-
domain:paypalobjects.com,
84-
domain:pgyer.com,
85-
domain:qdaily.com,
86-
domain:qdmm.com,
87-
domain:qin.io,
88-
domain:qingmang.me,
89-
domain:qingmang.mobi,
90-
domain:qqurl.com,
91-
domain:rarbg.to,
92-
domain:rrmj.tv,
93-
domain:ruguoapp.com,
94-
domain:sm.ms,
95-
domain:snwx.com,
96-
domain:soku.com,
97-
domain:startssl.com,
98-
domain:store.steampowered.com,
99-
domain:symcd.com,
100-
domain:teamviewer.com,
101-
domain:tmzvps.com,
102-
domain:trello.com,
103-
domain:trellocdn.com,
104-
domain:ttmeiju.com,
105-
domain:udache.com,
106-
domain:uxengine.net,
107-
domain:weather.bjango.com,
108-
domain:weather.com,
109-
domain:webqxs.com,
110-
domain:weico.cc,
111-
domain:wenku8.net,
112-
domain:werewolf.53site.com,
113-
domain:windowsupdate.com,
114-
domain:wkcdn.com,
115-
domain:workflowy.com,
116-
domain:xdrig.com,
117-
domain:xiaojukeji.com,
118-
domain:xiaomi.net,
119-
domain:xiaomicp.com,
120-
domain:ximalaya.com,
121-
domain:xitek.com,
122-
domain:xmcdn.com,
123-
domain:xslb.net,
124-
domain:xteko.com,
125-
domain:yach.me,
126-
domain:yixia.com,
127-
domain:yunjiasu-cdn.net,
128-
domain:zealer.com,
129-
domain:zgslb.net,
130-
domain:zimuzu.tv,
131-
domain:zmz002.com,
132-
domain:samsungdm.com,
1+
geosite:cn,
2+
geosite:geolocation-cn
Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1 @@
1-
geosite:google,
2-
geosite:github,
3-
geosite:netflix,
4-
geosite:steam,
5-
geosite:telegram,
6-
geosite:tumblr,
7-
geosite:speedtest,
8-
geosite:bbc,
9-
domain:gvt1.com,
10-
domain:textnow.com,
11-
domain:twitch.tv,
12-
domain:wikileaks.org,
13-
domain:naver.com,
14-
91.108.4.0/22,
15-
91.108.8.0/22,
16-
91.108.12.0/22,
17-
91.108.20.0/22,
18-
91.108.36.0/23,
19-
91.108.38.0/23,
20-
91.108.56.0/22,
21-
149.154.160.0/20,
22-
149.154.164.0/22,
23-
149.154.172.0/22,
24-
74.125.0.0/16,
25-
173.194.0.0/16,
26-
172.217.0.0/16,
27-
216.58.200.0/24,
28-
216.58.220.0/24,
29-
91.108.56.116,
30-
91.108.56.0/24,
31-
109.239.140.0/24,
32-
149.154.167.0/24,
33-
149.154.175.0/24,
1+
geosite:geolocation-!cn

V2rayNG/app/src/main/kotlin/com/v2ray/yilink/dto/V2rayConfig.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ data class V2rayConfig(
456456
var rules: ArrayList<RulesBean>,
457457
val balancers: List<Any>? = null) {
458458

459-
data class RulesBean(var type: String = "",
459+
data class RulesBean(
460460
var ip: ArrayList<String>? = null,
461461
var domain: ArrayList<String>? = null,
462462
var outboundTag: String = "",
@@ -489,8 +489,8 @@ data class V2rayConfig(
489489
var poolSize: Int = 10000) // roughly 10 times smaller than total ip pool
490490

491491
fun getProxyOutbound(): OutboundBean? {
492-
outbounds?.forEach { outbound ->
493-
EConfigType.values().forEach {
492+
outbounds.forEach { outbound ->
493+
EConfigType.entries.forEach {
494494
if (outbound.protocol.equals(it.name, true)) {
495495
return outbound
496496
}

V2rayNG/app/src/main/kotlin/com/v2ray/yilink/service/V2RayVpnService.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ class V2RayVpnService : VpnService(), ServiceControl {
111111
val builder = Builder()
112112
//val enableLocalDns = defaultDPreference.getPrefBoolean(AppConfig.PREF_LOCAL_DNS_ENABLED, false)
113113

114-
val routingMode = settingsStorage?.decodeString(AppConfig.PREF_ROUTING_MODE) ?: ERoutingMode.GLOBAL_PROXY.value
114+
val routingMode = settingsStorage?.decodeString(AppConfig.PREF_ROUTING_MODE)
115+
?: ERoutingMode.BYPASS_LAN_MAINLAND.value
115116

116117
builder.setMtu(VPN_MTU)
117118
builder.addAddress(PRIVATE_VLAN4_CLIENT, 30)

V2rayNG/app/src/main/kotlin/com/v2ray/yilink/util/V2rayConfigUtil.kt

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -191,11 +191,10 @@ object V2rayConfigUtil {
191191
?: "IPIfNonMatch"
192192
// v2rayConfig.routing.domainMatcher = "mph"
193193
val routingMode = settingsStorage?.decodeString(AppConfig.PREF_ROUTING_MODE)
194-
?: ERoutingMode.GLOBAL_PROXY.value
194+
?: ERoutingMode.BYPASS_LAN_MAINLAND.value
195195

196196
// Hardcode googleapis.cn
197197
val googleapisRoute = V2rayConfig.RoutingBean.RulesBean(
198-
type = "field",
199198
outboundTag = AppConfig.TAG_AGENT,
200199
domain = arrayListOf("domain:googleapis.cn")
201200
)
@@ -207,18 +206,19 @@ object V2rayConfigUtil {
207206

208207
ERoutingMode.BYPASS_MAINLAND.value -> {
209208
routingGeo("", "cn", AppConfig.TAG_DIRECT, v2rayConfig)
209+
routingGeo("domain", "geolocation-cn", AppConfig.TAG_DIRECT, v2rayConfig)
210210
v2rayConfig.routing.rules.add(0, googleapisRoute)
211211
}
212212

213213
ERoutingMode.BYPASS_LAN_MAINLAND.value -> {
214214
routingGeo("ip", "private", AppConfig.TAG_DIRECT, v2rayConfig)
215215
routingGeo("", "cn", AppConfig.TAG_DIRECT, v2rayConfig)
216+
routingGeo("domain", "geolocation-cn", AppConfig.TAG_DIRECT, v2rayConfig)
216217
v2rayConfig.routing.rules.add(0, googleapisRoute)
217218
}
218219

219220
ERoutingMode.GLOBAL_DIRECT.value -> {
220221
val globalDirect = V2rayConfig.RoutingBean.RulesBean(
221-
type = "field",
222222
outboundTag = AppConfig.TAG_DIRECT,
223223
port = "0-65535"
224224
)
@@ -243,7 +243,6 @@ object V2rayConfigUtil {
243243
//IP
244244
if (ipOrDomain == "ip" || ipOrDomain == "") {
245245
val rulesIP = V2rayConfig.RoutingBean.RulesBean()
246-
rulesIP.type = "field"
247246
rulesIP.outboundTag = tag
248247
rulesIP.ip = ArrayList()
249248
rulesIP.ip?.add("geoip:$code")
@@ -253,7 +252,6 @@ object V2rayConfigUtil {
253252
if (ipOrDomain == "domain" || ipOrDomain == "") {
254253
//Domain
255254
val rulesDomain = V2rayConfig.RoutingBean.RulesBean()
256-
rulesDomain.type = "field"
257255
rulesDomain.outboundTag = tag
258256
rulesDomain.domain = ArrayList()
259257
rulesDomain.domain?.add("geosite:$code")
@@ -270,13 +268,11 @@ object V2rayConfigUtil {
270268
if (!TextUtils.isEmpty(userRule)) {
271269
//Domain
272270
val rulesDomain = V2rayConfig.RoutingBean.RulesBean()
273-
rulesDomain.type = "field"
274271
rulesDomain.outboundTag = tag
275272
rulesDomain.domain = ArrayList()
276273

277274
//IP
278275
val rulesIP = V2rayConfig.RoutingBean.RulesBean()
279-
rulesIP.type = "field"
280276
rulesIP.outboundTag = tag
281277
rulesIP.ip = ArrayList()
282278

@@ -381,7 +377,6 @@ object V2rayConfigUtil {
381377
// DNS routing tag
382378
v2rayConfig.routing.rules.add(
383379
0, V2rayConfig.RoutingBean.RulesBean(
384-
type = "field",
385380
inboundTag = arrayListOf("dns-in"),
386381
outboundTag = "dns-out",
387382
domain = null
@@ -424,10 +419,10 @@ object V2rayConfigUtil {
424419
?: ""
425420
)
426421
val routingMode = settingsStorage?.decodeString(AppConfig.PREF_ROUTING_MODE)
427-
?: ERoutingMode.GLOBAL_PROXY.value
422+
?: ERoutingMode.BYPASS_LAN_MAINLAND.value
428423
if (directDomain.size > 0 || routingMode == ERoutingMode.BYPASS_MAINLAND.value || routingMode == ERoutingMode.BYPASS_LAN_MAINLAND.value) {
429424
val domesticDns = Utils.getDomesticDnsServers()
430-
val geositeCn = arrayListOf("geosite:cn")
425+
val geositeCn = arrayListOf("geosite:cn","geosite:geolocation-cn")
431426
val geoipCn = arrayListOf("geoip:cn")
432427
if (directDomain.size > 0) {
433428
servers.add(
@@ -452,7 +447,6 @@ object V2rayConfigUtil {
452447
if (Utils.isPureIpAddress(domesticDns.first())) {
453448
v2rayConfig.routing.rules.add(
454449
0, V2rayConfig.RoutingBean.RulesBean(
455-
type = "field",
456450
outboundTag = AppConfig.TAG_DIRECT,
457451
port = "53",
458452
ip = arrayListOf(domesticDns.first()),
@@ -483,7 +477,6 @@ object V2rayConfigUtil {
483477
if (Utils.isPureIpAddress(remoteDns.first())) {
484478
v2rayConfig.routing.rules.add(
485479
0, V2rayConfig.RoutingBean.RulesBean(
486-
type = "field",
487480
outboundTag = AppConfig.TAG_AGENT,
488481
port = "53",
489482
ip = arrayListOf(remoteDns.first()),

V2rayNG/app/src/main/res/xml/pref_settings.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
android:title="@string/title_pref_routing_custom" />
5151

5252
<ListPreference
53-
android:defaultValue="0"
53+
android:defaultValue="3"
5454
android:entries="@array/routing_mode"
5555
android:entryValues="@array/routing_mode_value"
5656
android:key="pref_routing_mode"

0 commit comments

Comments
 (0)