alroyso vor 7 Monaten
Ursprung
Commit
2701778e46
2 geänderte Dateien mit 20 neuen und 14 gelöschten Zeilen
  1. 16 14
      app/Components/Protocols/SingBox.php
  2. 4 0
      app/Http/Controllers/DownloadControllers.php

+ 16 - 14
app/Components/Protocols/SingBox.php

@@ -75,29 +75,31 @@ class SingBox
         ];
 
         // 先创建 "proxy" 组并添加到配置的最前面
-        $proxyOutbound = $this->buildOutbound("proxy", "selector", "hk", []);
+        $proxyOutbound = $this->buildOutbound("proxy", "selector", "", []);
         array_unshift($config['outbounds'], $proxyOutbound);
 
         // 创建每个地区的代理组
-        foreach ($regions as $regionTag => $pattern) {
-            $tags = $this->buildTags($proxies, $pattern);
-            $this->updateOrAddOutbound($config['outbounds'], $this->buildOutbound($regionTag, "selector", "", $tags));
-            $usedTags = array_merge($usedTags, $tags);
-            $regionTags[] = $regionTag;
-        }
+//        foreach ($regions as $regionTag => $pattern) {
+//            $tags = $this->buildTags($proxies, $pattern);
+//            $this->updateOrAddOutbound($config['outbounds'], $this->buildOutbound($regionTag, "selector", "", $tags));
+//            $usedTags = array_merge($usedTags, $tags);
+//            $regionTags[] = $regionTag;
+//        }
 
         // 创建 "其他" 代理组
-        $allTags = array_column($proxies, 'tag');
-        $otherTags = array_diff($allTags, $usedTags);
-        $this->updateOrAddOutbound($config['outbounds'], $this->buildOutbound("other", "selector", "", $otherTags));
-        $regionTags[] = "other";
-        $this->updateOrAddOutbound($config['outbounds'],$this->buildOutbound("dns", "selector", "", $this->buildTags($proxies,"")));
+//        $allTags = array_column($proxies, 'tag');
+//        $otherTags = array_diff($allTags, $usedTags);
+//        $this->updateOrAddOutbound($config['outbounds'], $this->buildOutbound("other", "selector", "", $otherTags));
+//        $regionTags[] = "other";
+//        $this->updateOrAddOutbound($config['outbounds'],$this->buildOutbound("dns", "selector", "", $this->buildTags($proxies,"")));
 
 //        $this->updateOrAddOutbound($config['outbounds'],$this->buildOutbound("用户中心", "selector", "", [$uri]));
         $this->updateOrAddOutbound($config['outbounds'], $userConfig);
-
+        foreach ($proxies as $proxy){
+            $regionTags[]  = $proxy["tag"];
+        }
         $usedCus = array_merge($regionTags, [$uri]);
-        // 更新 "proxy" 组,包含所有地区和其他代理组的 tag
+//        // 更新 "proxy" 组,包含所有地区和其他代理组的 tag
         $config['outbounds'][0]['outbounds'] = $usedCus;
         //$config['outbounds'][0]['outbounds'] = ;
         // 将所有 $proxies 加入到 $config['outbounds']

+ 4 - 0
app/Http/Controllers/DownloadControllers.php

@@ -77,8 +77,12 @@ class DownloadControllers extends Controller
                    "wx"                 => Article::whereId(10)->first(),
                     "ios"                 => Article::whereId(7)->first(),
                     "sp"                 => Article::whereId(13)->first(),
+                //nekoray://install-config?url=[CONFIG_URL]&name=[CONFIG_NAME]
+                "nekoray" =>  'nekoray://install-config?url='.$subscribe_link.'&name='.sysConfig('website_name'),
+                "nekorayA" =>  'nekoray://install-config?url='.$subscribe_link.'&name='.sysConfig('website_name'),
                 //sing-box://import-remote-profile?url=urlEncodedURL#urlEncodedName
                 "singBox"                   => 'sing-box://import-remote-profile?url=' . urlencode($subscribe_linkH).'#'.sysConfig('website_name'),
+                "singBoxA"                   => 'sing-box://import-remote-profile?url=' . urlencode($subscribe_link).'#'.sysConfig('website_name'),
                 'subUrl'                  => sysConfig('subscribe_domain') . "/s/" . $subscribe->code,
                 'sub'                     => $data,
                 'paying_user'             => auth()->user()->activePayingUser(), // 付费用户判断