pull/188/head
2dust 2019-10-21 14:17:28 +08:00
parent 53494341fc
commit e6ca25462e
10 changed files with 51 additions and 24 deletions

View File

@ -6,7 +6,9 @@ using System.Net;
using System.Net.Sockets;
using System.Threading;
using v2rayN.Mode;
using v2rayN.Properties;
using v2rayN.Protos.Statistics;
using v2rayN.Tool;
namespace v2rayN.Handler
{
@ -66,6 +68,23 @@ namespace v2rayN.Handler
public StatisticsHandler(Mode.Config config, Action<ulong, ulong, ulong, ulong, List<Mode.ServerStatistics>> update)
{
try
{
if (Environment.Is64BitOperatingSystem)
{
FileManager.UncompressFile(Utils.GetPath("grpc_csharp_ext.x64.dll"), Resources.grpc_csharp_ext_x64_dll);
}
else
{
FileManager.UncompressFile(Utils.GetPath("grpc_csharp_ext.x86.dll"), Resources.grpc_csharp_ext_x86_dll);
}
}
catch (IOException ex)
{
Utils.SaveLog(ex.Message, ex);
}
config_ = config;
enabled_ = config.enableStatistics;
UpdateUI = false;

View File

@ -34,7 +34,6 @@ namespace v2rayN.HttpProxyHandler
_privoxyJob = new Job();
FileManager.UncompressFile(Utils.GetTempPath("v2ray_privoxy.exe"), Resources.privoxy_exe);
FileManager.UncompressFile(Utils.GetTempPath("mgwz.dll"), Resources.mgwz_dll);
}
catch (IOException ex)
{

View File

@ -19,7 +19,7 @@ namespace v2rayN.Properties {
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
@ -91,25 +91,35 @@ namespace v2rayN.Properties {
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// 查找 System.Byte[] 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap help {
internal static byte[] grpc_csharp_ext_x64_dll {
get {
object obj = ResourceManager.GetObject("help", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
object obj = ResourceManager.GetObject("grpc_csharp_ext_x64_dll", resourceCulture);
return ((byte[])(obj));
}
}
/// <summary>
/// 查找 System.Byte[] 类型的本地化资源。
/// </summary>
internal static byte[] mgwz_dll {
internal static byte[] grpc_csharp_ext_x86_dll {
get {
object obj = ResourceManager.GetObject("mgwz_dll", resourceCulture);
object obj = ResourceManager.GetObject("grpc_csharp_ext_x86_dll", resourceCulture);
return ((byte[])(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap help {
get {
object obj = ResourceManager.GetObject("help", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
@ -157,6 +167,7 @@ namespace v2rayN.Properties {
///show-on-task-bar 0
///activity-animation 0
///forward-socks5 / 127.0.0.1:__SOCKS_PORT__ .
///max-client-connections 2048
///hide-console
/// 的本地化字符串。
/// </summary>

View File

@ -127,12 +127,15 @@
<data name="checkupdate" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\resources\checkupdate.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="grpc_csharp_ext_x64_dll" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\resources\grpc_csharp_ext.x64.dll.gz;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="grpc_csharp_ext_x86_dll" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\resources\grpc_csharp_ext.x86.dll.gz;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="help" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\resources\help.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="mgwz_dll" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\resources\mgwz.dll.gz;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="minimize" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\minimize.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -198,6 +198,11 @@
<Compile Include="Mode\ServerStatistics.cs" />
<Compile Include="Mode\SysproxyConfig.cs" />
<Compile Include="Mode\EConfigType.cs" />
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Resx\ResUI.zh-Hans.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
@ -319,14 +324,9 @@
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<EmbeddedResource Include="app.config">
<SubType>Designer</SubType>
</EmbeddedResource>
@ -342,6 +342,8 @@
</Compile>
<Protobuf Include="Protos\Statistics.proto" />
<None Include="Resources\abp.js.gz" />
<None Include="Resources\grpc_csharp_ext.x64.dll.gz" />
<None Include="Resources\grpc_csharp_ext.x86.dll.gz" />
<None Include="Resources\pac.txt.gz" />
<None Include="Resources\sysproxy.exe.gz" />
<None Include="Resources\sysproxy64.exe.gz" />
@ -392,7 +394,6 @@
<EmbeddedResource Include="Sample\SampleServerConfig.txt" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\mgwz.dll.gz" />
<None Include="Resources\privoxy.exe.gz" />
<None Include="Resources\restart.png" />
</ItemGroup>
@ -420,12 +421,6 @@
<EmbeddedResource Include="LIB\System.Runtime.CompilerServices.Unsafe.dll" />
<EmbeddedResource Include="LIB\zxing.dll" />
<EmbeddedResource Include="LIB\zxing.presentation.dll" />
<Content Include="grpc_csharp_ext.x64.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="grpc_csharp_ext.x86.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<EmbeddedResource Include="LIB\netstandard.dll" />
<Content Include="Resources\help.png" />
<None Include="Resources\notify.png" />