Browse Source

Update default configs to include externals

bdbai 4 years ago
parent
commit
b93376c8d0
4 changed files with 25 additions and 13 deletions
  1. 8 11
      Maple.App/Config/default.conf
  2. 12 0
      Maple.App/Config/default.json
  3. 4 1
      Maple.App/Model/Netif.cpp
  4. 1 1
      leaf

+ 8 - 11
Maple.App/Config/default.conf

@@ -40,29 +40,26 @@ Tryall = tryall, Trojan, VMessWSS, delay-base=0
 Random = random, Trojan, VMessWSS
 
 [Rule]
-# Not supported yet
 # 执行文件目录当中必需有 `site.dat` 文件
-# EXTERNAL, site:category-ads-all, Reject
+EXTERNAL, site:category-ads-all, Reject
 
-# Not supported yet
-# 也可以指定 `dat` 文件所在绝对路径,不支持相对路径
-# EXTERNAL, site:/tmp/geosite.dat:category-ads-all, Reject
+# Arbitrary file access is forbidden within an app container.
+# Make sure `geosite.dat` exists in the config folder.
+# 也可以指定 `dat` 文件所在路径
+EXTERNAL, site:geosite.dat:category-ads-all, Reject
 
 IP-CIDR, 8.8.8.8/32, Fallback
 DOMAIN, www.google.com, Fallback
 DOMAIN-SUFFIX, google.com, Fallback
 DOMAIN-KEYWORD, google, Fallback
 
-# Not supported yet
 # 等效于 EXTERNAL, mmdb:us, Fallback
-# GEOIP, us, Fallback
+GEOIP, us, Fallback
 
-# Not supported yet
-# EXTERNAL, site:geolocation-!cn, Fallback
+EXTERNAL, site:geolocation-!cn, Fallback
 
-# Not supported yet
 # 执行文件目录当中必需有 `geo.mmdb` 文件
-# EXTERNAL, mmdb:us, Fallback
+EXTERNAL, mmdb:us, Fallback
 
 FINAL, Direct
 

+ 12 - 0
Maple.App/Config/default.json

@@ -160,6 +160,18 @@
         "google"
       ],
       "target": "failover_out"
+    },
+    {
+      "external": [
+        "site:cn"
+      ],
+      "target": "direct_out"
+    },
+    {
+      "external": [
+        "mmdb:cn"
+      ],
+      "target": "direct_out"
     }
   ]
 }

+ 4 - 1
Maple.App/Model/Netif.cpp

@@ -58,7 +58,10 @@ namespace winrt::Maple_App::implementation
         // Allocate a 15 KB buffer to start with.
         outBufLen = WORKING_BUFFER_SIZE;
         std::array<WCHAR, ADDR_BUFFER_SIZE> addrBuf{};
-        const auto& sniffed = Netif::SniffOutboundAddress();
+        auto sniffed = Netif::SniffOutboundAddress();
+        if (sniffed == L"192.168.3.1") {
+            sniffed = {};
+        }
 
         do {
 

+ 1 - 1
leaf

@@ -1 +1 @@
-Subproject commit 1303763fd33659402a5e970152bce914f6d67319
+Subproject commit b27543c8278a497465f50d7208b2fdc9332570b5