mirror of
https://github.com/MetaCubeX/ClashMetaForAndroid.git
synced 2025-03-29 19:59:54 +03:00
Fix: fix dns fake-ip patch
This commit is contained in:
parent
3397cdd95f
commit
25936c8361
2 changed files with 14 additions and 8 deletions
|
@ -20,4 +20,5 @@ var (
|
||||||
// Nintendo Switch
|
// Nintendo Switch
|
||||||
"*.n.n.srv.nintendo.net",
|
"*.n.n.srv.nintendo.net",
|
||||||
}
|
}
|
||||||
|
defaultFakeIPRange = "28.0.0.0/8"
|
||||||
)
|
)
|
||||||
|
|
|
@ -62,19 +62,24 @@ func patchProfile(cfg *config.RawConfig, _ string) error {
|
||||||
|
|
||||||
func patchDns(cfg *config.RawConfig, _ string) error {
|
func patchDns(cfg *config.RawConfig, _ string) error {
|
||||||
if !cfg.DNS.Enable {
|
if !cfg.DNS.Enable {
|
||||||
cfg.DNS.Enable = true
|
cfg.DNS = config.RawDNS{
|
||||||
cfg.DNS.IPv6 = false
|
Enable: true,
|
||||||
cfg.DNS.NameServer = defaultNameServers
|
UseHosts: true,
|
||||||
cfg.DNS.EnhancedMode = C.DNSFakeIP
|
DefaultNameserver: defaultNameServers,
|
||||||
cfg.DNS.FakeIPRange = "28.0.0.0/8"
|
NameServer: defaultNameServers,
|
||||||
cfg.DNS.DefaultNameserver = defaultNameServers
|
EnhancedMode: C.DNSFakeIP,
|
||||||
cfg.DNS.FakeIPFilter = defaultFakeIPFilter
|
FakeIPRange: defaultFakeIPRange,
|
||||||
|
FakeIPFilter: defaultFakeIPFilter,
|
||||||
|
FallbackFilter: config.RawFallbackFilter{
|
||||||
|
GeoIP: false,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
cfg.ClashForAndroid.AppendSystemDNS = true
|
cfg.ClashForAndroid.AppendSystemDNS = true
|
||||||
}
|
}
|
||||||
|
|
||||||
if cfg.ClashForAndroid.AppendSystemDNS {
|
if cfg.ClashForAndroid.AppendSystemDNS {
|
||||||
cfg.DNS.NameServer = append(cfg.DNS.NameServer, "dhcp://" + dns.SystemDNSPlaceholder)
|
cfg.DNS.NameServer = append(cfg.DNS.NameServer, "dhcp://"+dns.SystemDNSPlaceholder)
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|
Loading…
Add table
Reference in a new issue