Browse Source

external pac

tags/4.1.9.2-nbbnu
Student Main 5 years ago
parent
commit
e7ff2bfa31
5 changed files with 10 additions and 83 deletions
  1. +1
    -1
      shadowsocks-csharp/Controller/Service/GfwListUpdater.cs
  2. +9
    -8
      shadowsocks-csharp/Controller/Service/PACDaemon.cs
  3. +0
    -65
      shadowsocks-csharp/Properties/Resources.Designer.cs
  4. +0
    -9
      shadowsocks-csharp/Properties/Resources.resx
  5. BIN
      shadowsocks-csharp/libsscrypto.dll

+ 1
- 1
shadowsocks-csharp/Controller/Service/GfwListUpdater.cs View File

@@ -69,7 +69,7 @@ namespace Shadowsocks.Controller
}
else
{
abpContent = Resources.abp_js;
abpContent = File.ReadAllText(Utils.GetDataPath("abp.js"));
}

List<string> userruleLines = new List<string>();


+ 9
- 8
shadowsocks-csharp/Controller/Service/PACDaemon.cs View File

@@ -39,7 +39,9 @@ namespace Shadowsocks.Controller
{
if (!File.Exists(PAC_FILE))
{
File.WriteAllText(PAC_FILE, Resources.default_abp_rule + Resources.abp_js);
string defaultRule = File.ReadAllText(Utils.GetDataPath("default-abp-rule.js"));
string abpJs = File.ReadAllText(Utils.GetDataPath("abp.js"));
File.WriteAllText(PAC_FILE, defaultRule + abpJs);
}
return PAC_FILE;
}
@@ -48,21 +50,20 @@ namespace Shadowsocks.Controller
{
if (!File.Exists(USER_RULE_FILE))
{
File.WriteAllText(USER_RULE_FILE, Resources.user_rule);
File.WriteAllText(USER_RULE_FILE, Utils.GetDataPath("user-rule.txt"));
}
return USER_RULE_FILE;
}
internal string GetPACContent()
{
if (File.Exists(PAC_FILE))
{
return File.ReadAllText(PAC_FILE, Encoding.UTF8);
}
else
if (!File.Exists(PAC_FILE))
{
return Resources.default_abp_rule + Resources.abp_js;
string defaultRule = File.ReadAllText(Utils.GetDataPath("default-abp-rule.js"));
string abpJs = File.ReadAllText(Utils.GetDataPath("abp.js"));
File.WriteAllText(PAC_FILE, defaultRule + abpJs);
}
return File.ReadAllText(PAC_FILE, Encoding.UTF8);
}


+ 0
- 65
shadowsocks-csharp/Properties/Resources.Designer.cs View File

@@ -60,60 +60,6 @@ namespace Shadowsocks.Properties {
}
}
/// <summary>
/// 查找类似 /* eslint-disable */
///// Was generated by gfwlist2pac in precise mode
///// https://github.com/clowwindy/gfwlist2pac
///
///// 2019-10-06: More &apos;javascript&apos; way to interaction with main program
///// 2019-02-08: Updated to support shadowsocks-windows user rules.
///
///var proxy = __PROXY__;
///var userrules = __USERRULES__;
///var rules = __RULES__;
///
////*
///* This file is part of Adblock Plus &lt;http://adblockplus.org/&gt;,
///* Copyright (C) 2006-2014 Eyeo GmbH
///*
///* Adblock Plus is free software: you can redistribute it and/or [字符串的其余部分被截断]&quot;; 的本地化字符串。
/// </summary>
internal static string abp_js {
get {
return ResourceManager.GetString("abp_js", resourceCulture);
}
}
/// <summary>
/// 查找类似 var __USERRULES__ = [];
///var __RULES__ = [
/// &quot;|http://85.17.73.31/&quot;,
/// &quot;||agnesb.fr&quot;,
/// &quot;||akiba-web.com&quot;,
/// &quot;||altrec.com&quot;,
/// &quot;||angela-merkel.de&quot;,
/// &quot;||angola.org&quot;,
/// &quot;||apartmentratings.com&quot;,
/// &quot;||apartments.com&quot;,
/// &quot;||arena.taipei&quot;,
/// &quot;||asianspiss.com&quot;,
/// &quot;||assimp.org&quot;,
/// &quot;||athenaeizou.com&quot;,
/// &quot;||azubu.tv&quot;,
/// &quot;||bankmobilevibe.com&quot;,
/// &quot;||banorte.com&quot;,
/// &quot;||bash-hackers.org&quot;,
/// &quot;||beeg.com&quot;,
/// &quot;||global.bing.com&quot;,
/// &quot;||bloombergview.com&quot;,
/// &quot; [字符串的其余部分被截断]&quot;; 的本地化字符串。
/// </summary>
internal static string default_abp_rule {
get {
return ResourceManager.GetString("default_abp_rule", resourceCulture);
}
}
/// <summary>
/// 查找 System.Byte[] 类型的本地化资源。
/// </summary>
@@ -200,16 +146,5 @@ namespace Shadowsocks.Properties {
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找类似 ! Put user rules line by line in this file.
///! See https://adblockplus.org/en/filter-cheatsheet
/// 的本地化字符串。
/// </summary>
internal static string user_rule {
get {
return ResourceManager.GetString("user_rule", resourceCulture);
}
}
}
}

+ 0
- 9
shadowsocks-csharp/Properties/Resources.resx View File

@@ -118,12 +118,6 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="abp_js" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Data\abp.js;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;gb2312</value>
</data>
<data name="default_abp_rule" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Data\default-abp-rule.js;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data>
<data name="libsscrypto" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Data\libsscrypto.dll;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
@@ -148,7 +142,4 @@
<data name="ssw128" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\ssw128.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="user_rule" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\data\user-rule.txt;System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data>
</root>

BIN
shadowsocks-csharp/libsscrypto.dll View File


Loading…
Cancel
Save