Skip to content

Commit

Permalink
release 4.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
next-autumn committed May 25, 2021
1 parent 888e981 commit 97ae49c
Show file tree
Hide file tree
Showing 40 changed files with 1,242 additions and 171 deletions.
4 changes: 2 additions & 2 deletions ProxySU_Core/App.config
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
Expand All @@ -11,4 +11,4 @@
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
</configuration>
55 changes: 24 additions & 31 deletions ProxySU_Core/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 13 additions & 16 deletions ProxySU_Core/Properties/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 11 additions & 10 deletions ProxySU_Core/ProxySU_Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<OutputType>WinExe</OutputType>
<RootNamespace>ProxySU_Core</RootNamespace>
<AssemblyName>ProxySU_Core</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
Expand All @@ -32,6 +32,7 @@
<UseApplicationTrust>false</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
Expand Down Expand Up @@ -74,14 +75,14 @@
<Reference Include="MahApps.Metro, Version=2.0.0.0, Culture=neutral, PublicKeyToken=51482d6f650b2b3f, processorArchitecture=MSIL">
<HintPath>..\packages\MahApps.Metro.2.4.5\lib\net46\MahApps.Metro.dll</HintPath>
</Reference>
<Reference Include="MaterialDesignColors, Version=2.0.0.2422, Culture=neutral, PublicKeyToken=df2a72020bd7962a, processorArchitecture=MSIL">
<HintPath>..\packages\MaterialDesignColors.2.0.0\lib\net452\MaterialDesignColors.dll</HintPath>
<Reference Include="MaterialDesignColors, Version=2.0.1.2556, Culture=neutral, PublicKeyToken=df2a72020bd7962a, processorArchitecture=MSIL">
<HintPath>..\packages\MaterialDesignColors.2.0.1\lib\net452\MaterialDesignColors.dll</HintPath>
</Reference>
<Reference Include="MaterialDesignThemes.MahApps, Version=0.1.6.2422, Culture=neutral, PublicKeyToken=df2a72020bd7962a, processorArchitecture=MSIL">
<HintPath>..\packages\MaterialDesignThemes.MahApps.0.1.6\lib\net452\MaterialDesignThemes.MahApps.dll</HintPath>
<Reference Include="MaterialDesignThemes.MahApps, Version=0.1.7.2556, Culture=neutral, PublicKeyToken=df2a72020bd7962a, processorArchitecture=MSIL">
<HintPath>..\packages\MaterialDesignThemes.MahApps.0.1.7\lib\net452\MaterialDesignThemes.MahApps.dll</HintPath>
</Reference>
<Reference Include="MaterialDesignThemes.Wpf, Version=4.0.0.2422, Culture=neutral, PublicKeyToken=df2a72020bd7962a, processorArchitecture=MSIL">
<HintPath>..\packages\MaterialDesignThemes.4.0.0\lib\net452\MaterialDesignThemes.Wpf.dll</HintPath>
<Reference Include="MaterialDesignThemes.Wpf, Version=4.1.0.2556, Culture=neutral, PublicKeyToken=df2a72020bd7962a, processorArchitecture=MSIL">
<HintPath>..\packages\MaterialDesignThemes.4.1.0\lib\net452\MaterialDesignThemes.Wpf.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Xaml.Behaviors, Version=1.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Xaml.Behaviors.Wpf.1.1.31\lib\net45\Microsoft.Xaml.Behaviors.dll</HintPath>
Expand Down Expand Up @@ -451,12 +452,12 @@
<Resource Include="ProxySU.ico" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\MaterialDesignThemes.4.0.0\build\MaterialDesignThemes.targets" Condition="Exists('..\packages\MaterialDesignThemes.4.0.0\build\MaterialDesignThemes.targets')" />
<ProjectExtensions />
<Import Project="..\packages\MaterialDesignThemes.4.1.0\build\MaterialDesignThemes.targets" Condition="Exists('..\packages\MaterialDesignThemes.4.1.0\build\MaterialDesignThemes.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\MaterialDesignThemes.4.0.0\build\MaterialDesignThemes.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MaterialDesignThemes.4.0.0\build\MaterialDesignThemes.targets'))" />
<Error Condition="!Exists('..\packages\MaterialDesignThemes.4.1.0\build\MaterialDesignThemes.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MaterialDesignThemes.4.1.0\build\MaterialDesignThemes.targets'))" />
</Target>
<ProjectExtensions />
</Project>
87 changes: 87 additions & 0 deletions ProxySU_Core/Views/ClientInfo/ClientInfoWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,92 @@ public ClientInfoWindow(Record record)
Settings = new XraySettingsViewModel(record.Settings);
DataContext = this;
}

private void BuildQrCode(object sender, SelectionChangedEventArgs e)
{
var tabControl = e.Source as TabControl;
var item = (tabControl.SelectedItem as TabItem);
if (item == null) return;
var type = (XrayType)item.Tag;
BuildQrCode(type);
}

private void SaveImage(object sender, RoutedEventArgs e)
{
SaveFileDialog sfd = new SaveFileDialog();
sfd.FileName += QrImage.Tag;
sfd.Filter = "Image Files (*.bmp, *.png, *.jpg)|*.bmp;*.png;*.jpg | All Files | *.*";
sfd.RestoreDirectory = true;//保存对话框是否记忆上次打开的目录
if (sfd.ShowDialog() == true)
{
var encoder = new PngBitmapEncoder();
encoder.Frames.Add(BitmapFrame.Create((BitmapSource)QrImage.Source));
using (FileStream stream = new FileStream(sfd.FileName, FileMode.Create))
encoder.Save(stream);
}
}

private void BuildQrCode(XrayType type)
{
string shareLink = string.Empty;
switch (type)
{
case XrayType.VLESS_TCP_XTLS:
shareLink = Settings.VLESS_TCP_XTLS_ShareLink;
break;
case XrayType.VLESS_TCP:
shareLink = Settings.VLESS_TCP_ShareLink;
break;
case XrayType.VLESS_WS:
shareLink = Settings.VLESS_WS_ShareLink;
break;
case XrayType.VLESS_H2:
break;
case XrayType.VLESS_KCP:
shareLink = Settings.VLESS_KCP_ShareLink;
break;
case XrayType.VLESS_gRPC:
shareLink = Settings.VLESS_gRPC_ShareLink;
break;
case XrayType.VMESS_TCP:
shareLink = Settings.VMESS_TCP_ShareLink;
break;
case XrayType.VMESS_WS:
shareLink = Settings.VMESS_WS_ShareLink;
break;
case XrayType.VMESS_H2:
break;
case XrayType.VMESS_KCP:
shareLink = Settings.VMESS_KCP_ShareLink;
break;
case XrayType.Trojan_TCP:
shareLink = Settings.Trojan_TCP_ShareLink;
break;
case XrayType.Trojan_WS:
break;
case XrayType.ShadowsocksAEAD:
shareLink = Settings.ShadowSocksShareLink;
break;
default:
break;
}


QRCodeGenerator qrGenerator = new QRCodeGenerator();
QRCodeData qrCodeData = qrGenerator.CreateQrCode(shareLink, QRCodeGenerator.ECCLevel.Q);
QRCode qrCode = new QRCode(qrCodeData);

Bitmap qrCodeImage = qrCode.GetGraphic(20);
MemoryStream ms = new MemoryStream();
qrCodeImage.Save(ms, System.Drawing.Imaging.ImageFormat.Bmp);
byte[] bytes = ms.GetBuffer();
ms.Close();
BitmapImage image = new BitmapImage();
image.BeginInit();
image.StreamSource = new MemoryStream(bytes);
image.EndInit();
QrImage.Source = image;
QrImage.Tag = type.ToString();
}
}
}
10 changes: 5 additions & 5 deletions ProxySU_Core/packages.config
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="ControlzEx" version="5.0.0" targetFramework="net461" />
<package id="MahApps.Metro" version="2.4.5" targetFramework="net461" />
<package id="MaterialDesignColors" version="2.0.0" targetFramework="net461" />
<package id="MaterialDesignThemes" version="4.0.0" targetFramework="net461" />
<package id="MaterialDesignThemes.MahApps" version="0.1.6" targetFramework="net461" />
<package id="ControlzEx" version="5.0.0" targetFramework="net461" requireReinstallation="true" />
<package id="MahApps.Metro" version="2.4.5" targetFramework="net461" requireReinstallation="true" />
<package id="MaterialDesignColors" version="2.0.1" targetFramework="net472" />
<package id="MaterialDesignThemes" version="4.1.0" targetFramework="net472" />
<package id="MaterialDesignThemes.MahApps" version="0.1.7" targetFramework="net472" />
<package id="Microsoft.Xaml.Behaviors.Wpf" version="1.1.31" targetFramework="net461" />
<package id="Newtonsoft.Json" version="13.0.1" targetFramework="net461" />
<package id="QRCoder" version="1.4.1" targetFramework="net461" />
Expand Down
5 changes: 5 additions & 0 deletions ProxySuper.Core/Helpers/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,10 @@ public static T DeepClone<T>(T obj) where T : class
var serialized = JsonConvert.SerializeObject(obj);
return JsonConvert.DeserializeObject<T>(serialized);
}

public static string GetTickID()
{
return DateTime.Now.Ticks.ToString();
}
}
}
2 changes: 2 additions & 0 deletions ProxySuper.Core/Models/Projects/NaiveProxySettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,7 @@ public NaiveProxySettings()
public string UserName { get; set; }

public string Password { get; set; }

public string MaskDomain { get; set; }
}
}
Loading

0 comments on commit 97ae49c

Please sign in to comment.