Browse Source

🏗 Now it finally builds!

pull/3073/head
database64128 3 years ago
parent
commit
c8efddfb80
No known key found for this signature in database GPG Key ID: 1CA27546BEDB8B01
28 changed files with 147 additions and 74 deletions
  1. +18
    -0
      Shadowsocks.WPF/Models/Group.cs
  2. +30
    -0
      Shadowsocks.WPF/Models/Server.cs
  3. +0
    -3
      Shadowsocks.WPF/Models/Settings.cs
  4. +2
    -2
      Shadowsocks.WPF/Properties/PublishProfiles/FolderProfile.pubxml
  5. +2
    -2
      Shadowsocks.WPF/Properties/PublishProfiles/win-arm.pubxml
  6. +2
    -2
      Shadowsocks.WPF/Properties/PublishProfiles/win-x64.pubxml
  7. +2
    -2
      Shadowsocks.WPF/Properties/PublishProfiles/win-x86.pubxml
  8. +1
    -1
      Shadowsocks.WPF/Services/OnlineConfigService.cs
  9. +2
    -2
      Shadowsocks.WPF/Services/Sip003Plugin.cs
  10. +6
    -1
      Shadowsocks.WPF/Services/UpdateChecker.cs
  11. +3
    -4
      Shadowsocks.WPF/Shadowsocks.WPF.csproj
  12. +1
    -1
      Shadowsocks.WPF/ViewModels/ServerSharingViewModel.cs
  13. +1
    -1
      Shadowsocks.WPF/Views/DashboardView.xaml.cs
  14. +2
    -2
      Shadowsocks.WPF/Views/ForwardProxyView.xaml.cs
  15. +13
    -5
      Shadowsocks.WPF/Views/MainWindow.xaml
  16. +1
    -1
      Shadowsocks.WPF/Views/MainWindow.xaml.cs
  17. +2
    -2
      Shadowsocks.WPF/Views/OnlineConfigView.xaml.cs
  18. +1
    -1
      Shadowsocks.WPF/Views/RoutingView.xaml.cs
  19. +2
    -3
      Shadowsocks.WPF/Views/ServerSharingView.xaml.cs
  20. +1
    -1
      Shadowsocks.WPF/Views/ServersView.xaml.cs
  21. +1
    -1
      Shadowsocks.WPF/Views/SettingsView.xaml.cs
  22. +2
    -3
      Shadowsocks.WPF/Views/VersionUpdatePromptView.xaml.cs
  23. +0
    -0
      Shadowsocks.WPF/shadowsocks.ico
  24. +9
    -27
      Shadowsocks/Models/Group.cs
  25. +17
    -0
      Shadowsocks/Models/IGroup.cs
  26. +19
    -0
      Shadowsocks/Models/IServer.cs
  27. +3
    -3
      Shadowsocks/Models/Server.cs
  28. +4
    -4
      appveyor.yml

+ 18
- 0
Shadowsocks.WPF/Models/Group.cs View File

@@ -0,0 +1,18 @@
namespace Shadowsocks.WPF.Models
{
public class Group : Shadowsocks.Models.Group
{
/// <summary>
/// Gets or sets the URL of SIP008 online configuration delivery source.
/// </summary>
public string OnlineConfigSource { get; set; }

public Group() : this(string.Empty)
{ }

public Group(string name) : base(name)
{
OnlineConfigSource = "";
}
}
}

+ 30
- 0
Shadowsocks.WPF/Models/Server.cs View File

@@ -0,0 +1,30 @@
namespace Shadowsocks.WPF.Models
{
public class Server : Shadowsocks.Models.Server
{
/// <summary>
/// Gets or sets the arguments passed to the plugin process.
/// </summary>
public string PluginArgs { get; set; }

public Server()
{
PluginArgs = "";
}

public Server(
string name,
string uuid,
string host,
int port,
string password,
string method,
string plugin = "",
string pluginOpts = "",
string pluginArgs = "")
: base(name, uuid, host, port, password, method, plugin, pluginOpts)
{
PluginArgs = pluginArgs;
}
}
}

+ 0
- 3
Shadowsocks.WPF/Models/Settings.cs View File

@@ -1,10 +1,7 @@
using Shadowsocks.Interop.Settings; using Shadowsocks.Interop.Settings;
using Shadowsocks.Models;
using Shadowsocks.Net.Settings; using Shadowsocks.Net.Settings;
using Shadowsocks.PAC; using Shadowsocks.PAC;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text;


namespace Shadowsocks.WPF.Models namespace Shadowsocks.WPF.Models
{ {


+ 2
- 2
Shadowsocks.WPF/Properties/PublishProfiles/FolderProfile.pubxml View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<!-- <!--
https://go.microsoft.com/fwlink/?LinkID=208121. https://go.microsoft.com/fwlink/?LinkID=208121.
--> -->
@@ -6,7 +6,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<PropertyGroup> <PropertyGroup>
<Configuration>Release</Configuration> <Configuration>Release</Configuration>
<Platform>Any CPU</Platform> <Platform>Any CPU</Platform>
<PublishDir>bin\Release\net5.0-windows\publish\</PublishDir>
<PublishDir>bin\Release\net5.0-windows10.0.19041.0\publish\</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol> <PublishProtocol>FileSystem</PublishProtocol>
</PropertyGroup> </PropertyGroup>
</Project> </Project>

+ 2
- 2
Shadowsocks.WPF/Properties/PublishProfiles/win-arm.pubxml View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<!-- <!--
https://go.microsoft.com/fwlink/?LinkID=208121. https://go.microsoft.com/fwlink/?LinkID=208121.
--> -->
@@ -6,7 +6,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<PropertyGroup> <PropertyGroup>
<Configuration>Release</Configuration> <Configuration>Release</Configuration>
<Platform>Any CPU</Platform> <Platform>Any CPU</Platform>
<PublishDir>bin\Release\net5.0-windows\win-arm\publish\</PublishDir>
<PublishDir>bin\Release\net5.0-windows10.0.19041.0\win-arm\publish\</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol> <PublishProtocol>FileSystem</PublishProtocol>
<TargetFramework>net5.0-windows</TargetFramework> <TargetFramework>net5.0-windows</TargetFramework>
<RuntimeIdentifier>win-arm</RuntimeIdentifier> <RuntimeIdentifier>win-arm</RuntimeIdentifier>


+ 2
- 2
Shadowsocks.WPF/Properties/PublishProfiles/win-x64.pubxml View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<!-- <!--
https://go.microsoft.com/fwlink/?LinkID=208121. https://go.microsoft.com/fwlink/?LinkID=208121.
--> -->
@@ -6,7 +6,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<PropertyGroup> <PropertyGroup>
<Configuration>Release</Configuration> <Configuration>Release</Configuration>
<Platform>Any CPU</Platform> <Platform>Any CPU</Platform>
<PublishDir>bin\Release\net5.0-windows\win-x64\publish\</PublishDir>
<PublishDir>bin\Release\net5.0-windows10.0.19041.0\win-x64\publish\</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol> <PublishProtocol>FileSystem</PublishProtocol>
<TargetFramework>net5.0-windows</TargetFramework> <TargetFramework>net5.0-windows</TargetFramework>
<RuntimeIdentifier>win-x64</RuntimeIdentifier> <RuntimeIdentifier>win-x64</RuntimeIdentifier>


+ 2
- 2
Shadowsocks.WPF/Properties/PublishProfiles/win-x86.pubxml View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<!-- <!--
https://go.microsoft.com/fwlink/?LinkID=208121. https://go.microsoft.com/fwlink/?LinkID=208121.
--> -->
@@ -6,7 +6,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<PropertyGroup> <PropertyGroup>
<Configuration>Release</Configuration> <Configuration>Release</Configuration>
<Platform>Any CPU</Platform> <Platform>Any CPU</Platform>
<PublishDir>bin\Release\net5.0-windows\win-x86\publish\</PublishDir>
<PublishDir>bin\Release\net5.0-windows10.0.19041.0\win-x86\publish\</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol> <PublishProtocol>FileSystem</PublishProtocol>
<TargetFramework>net5.0-windows</TargetFramework> <TargetFramework>net5.0-windows</TargetFramework>
<RuntimeIdentifier>win-x86</RuntimeIdentifier> <RuntimeIdentifier>win-x86</RuntimeIdentifier>


+ 1
- 1
Shadowsocks.WPF/Services/OnlineConfigService.cs View File

@@ -1,4 +1,4 @@
using Shadowsocks.Models;
using Shadowsocks.WPF.Models;
using Splat; using Splat;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;


+ 2
- 2
Shadowsocks.WPF/Services/Sip003Plugin.cs View File

@@ -1,4 +1,4 @@
using Shadowsocks.Models;
using Shadowsocks.WPF.Models;
using System; using System;
using System.Collections.Specialized; using System.Collections.Specialized;
using System.Diagnostics; using System.Diagnostics;
@@ -34,7 +34,7 @@ namespace Shadowsocks.WPF.Services
return new Sip003Plugin( return new Sip003Plugin(
server.Plugin, server.Plugin,
server.PluginOpts, server.PluginOpts,
server.plugin_args,
server.PluginArgs,
server.Host, server.Host,
server.Port, server.Port,
showPluginOutput); showPluginOutput);


+ 6
- 1
Shadowsocks.WPF/Services/UpdateChecker.cs View File

@@ -9,6 +9,7 @@ using System.Windows;
using NLog; using NLog;
using Shadowsocks.WPF.Localization; using Shadowsocks.WPF.Localization;
using Shadowsocks.WPF.Models; using Shadowsocks.WPF.Models;
using Shadowsocks.WPF.ViewModels;
using Shadowsocks.WPF.Views; using Shadowsocks.WPF.Views;
using Splat; using Splat;


@@ -98,6 +99,10 @@ namespace Shadowsocks.WPF.Services
{ {
if (versionUpdatePromptWindow == null) if (versionUpdatePromptWindow == null)
{ {
var versionUpdatePromptView = new VersionUpdatePromptView()
{
ViewModel = new VersionUpdatePromptViewModel(releaseObject),
};
versionUpdatePromptWindow = new Window() versionUpdatePromptWindow = new Window()
{ {
Title = LocalizationProvider.GetLocalizedValue<string>("VersionUpdate"), Title = LocalizationProvider.GetLocalizedValue<string>("VersionUpdate"),
@@ -105,7 +110,7 @@ namespace Shadowsocks.WPF.Services
Width = 640, Width = 640,
MinHeight = 480, MinHeight = 480,
MinWidth = 640, MinWidth = 640,
Content = new VersionUpdatePromptView(releaseObject)
Content = versionUpdatePromptView,
}; };
versionUpdatePromptWindow.Closed += VersionUpdatePromptWindow_Closed; versionUpdatePromptWindow.Closed += VersionUpdatePromptWindow_Closed;
versionUpdatePromptWindow.Show(); versionUpdatePromptWindow.Show();


+ 3
- 4
Shadowsocks.WPF/Shadowsocks.WPF.csproj View File

@@ -2,13 +2,13 @@


<PropertyGroup> <PropertyGroup>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<TargetFramework>net5.0-windows</TargetFramework>
<TargetFramework>net5.0-windows10.0.19041.0</TargetFramework>
<UseWPF>true</UseWPF> <UseWPF>true</UseWPF>
<ApplicationManifest>App.manifest</ApplicationManifest> <ApplicationManifest>App.manifest</ApplicationManifest>
<Product>Shadowsocks for Windows WPF GUI</Product> <Product>Shadowsocks for Windows WPF GUI</Product>
<Authors>Clowwindy &amp; The Community</Authors> <Authors>Clowwindy &amp; The Community</Authors>
<Version>5.0.0</Version> <Version>5.0.0</Version>
<ApplicationIcon>Assets\shadowsocks.ico</ApplicationIcon>
<ApplicationIcon>shadowsocks.ico</ApplicationIcon>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<Copyright>© 2020 Clowwindy &amp; The Community</Copyright> <Copyright>© 2020 Clowwindy &amp; The Community</Copyright>
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile> <PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
@@ -36,7 +36,6 @@
<None Remove="Resources\RobotoMono\RobotoMono-SemiBoldItalic.ttf" /> <None Remove="Resources\RobotoMono\RobotoMono-SemiBoldItalic.ttf" />
<None Remove="Resources\RobotoMono\RobotoMono-Thin.ttf" /> <None Remove="Resources\RobotoMono\RobotoMono-Thin.ttf" />
<None Remove="Resources\RobotoMono\RobotoMono-ThinItalic.ttf" /> <None Remove="Resources\RobotoMono\RobotoMono-ThinItalic.ttf" />
<None Remove="Resources\shadowsocks.ico" />
<None Remove="Resources\ss128.pdn" /> <None Remove="Resources\ss128.pdn" />
<None Remove="Resources\ss32.pdn" /> <None Remove="Resources\ss32.pdn" />
<None Remove="Resources\ss32Fill.png" /> <None Remove="Resources\ss32Fill.png" />
@@ -60,6 +59,7 @@
<PackageReference Include="ReactiveUI.WPF" Version="12.1.5" /> <PackageReference Include="ReactiveUI.WPF" Version="12.1.5" />
<PackageReference Include="Splat.NLog" Version="9.7.1" /> <PackageReference Include="Splat.NLog" Version="9.7.1" />
<PackageReference Include="System.CommandLine" Version="2.0.0-beta1.20371.2" /> <PackageReference Include="System.CommandLine" Version="2.0.0-beta1.20371.2" />
<PackageReference Include="System.Reactive" Version="5.0.0" />
<PackageReference Include="WPFLocalizeExtension" Version="3.8.0" /> <PackageReference Include="WPFLocalizeExtension" Version="3.8.0" />
<PackageReference Include="ZXing.Net" Version="0.16.6" /> <PackageReference Include="ZXing.Net" Version="0.16.6" />
</ItemGroup> </ItemGroup>
@@ -113,7 +113,6 @@
<Resource Include="Resources\RobotoMono\RobotoMono-SemiBoldItalic.ttf" /> <Resource Include="Resources\RobotoMono\RobotoMono-SemiBoldItalic.ttf" />
<Resource Include="Resources\RobotoMono\RobotoMono-Thin.ttf" /> <Resource Include="Resources\RobotoMono\RobotoMono-Thin.ttf" />
<Resource Include="Resources\RobotoMono\RobotoMono-ThinItalic.ttf" /> <Resource Include="Resources\RobotoMono\RobotoMono-ThinItalic.ttf" />
<Resource Include="Resources\shadowsocks.ico" />
<Resource Include="Resources\ss128.pdn" /> <Resource Include="Resources\ss128.pdn" />
<Resource Include="Resources\ss32.pdn" /> <Resource Include="Resources\ss32.pdn" />
<Resource Include="Resources\ss32Fill.png" /> <Resource Include="Resources\ss32Fill.png" />


+ 1
- 1
Shadowsocks.WPF/ViewModels/ServerSharingViewModel.cs View File

@@ -1,6 +1,6 @@
using ReactiveUI; using ReactiveUI;
using ReactiveUI.Fody.Helpers; using ReactiveUI.Fody.Helpers;
using Shadowsocks.Models;
using Shadowsocks.WPF.Models;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Drawing; using System.Drawing;


+ 1
- 1
Shadowsocks.WPF/Views/DashboardView.xaml.cs View File

@@ -18,7 +18,7 @@ namespace Shadowsocks.WPF.Views
/// <summary> /// <summary>
/// Interaction logic for DashboardView.xaml /// Interaction logic for DashboardView.xaml
/// </summary> /// </summary>
public partial class DashboardView : ReactiveUserControl<DashboardViewModel>
public partial class DashboardView
{ {
public DashboardView() public DashboardView()
{ {


+ 2
- 2
Shadowsocks.WPF/Views/ForwardProxyView.xaml.cs View File

@@ -1,4 +1,4 @@
using ReactiveUI;
using ReactiveUI;
using Shadowsocks.WPF.ViewModels; using Shadowsocks.WPF.ViewModels;
using System.Reactive.Disposables; using System.Reactive.Disposables;


@@ -7,7 +7,7 @@ namespace Shadowsocks.WPF.Views
/// <summary> /// <summary>
/// Interaction logic for ForwardProxyView.xaml /// Interaction logic for ForwardProxyView.xaml
/// </summary> /// </summary>
public partial class ForwardProxyView : ReactiveUserControl<ForwardProxyViewModel>
public partial class ForwardProxyView
{ {
public ForwardProxyView() public ForwardProxyView()
{ {


+ 13
- 5
Shadowsocks.WPF/Views/MainWindow.xaml View File

@@ -13,7 +13,7 @@
lex:ResxLocalizationProvider.DefaultAssembly="Shadowsocks" lex:ResxLocalizationProvider.DefaultAssembly="Shadowsocks"
lex:ResxLocalizationProvider.DefaultDictionary="Strings" lex:ResxLocalizationProvider.DefaultDictionary="Strings"
mc:Ignorable="d" mc:Ignorable="d"
Title="Shadowsocks" Width="800" Height="600" MinWidth="800" MinHeight="600"
Title="Shadowsocks" Width="960" Height="720" MinWidth="800" MinHeight="600"
TextElement.Foreground="{DynamicResource MaterialDesignBody}" TextElement.Foreground="{DynamicResource MaterialDesignBody}"
TextElement.FontWeight="Regular" TextElement.FontWeight="Regular"
TextElement.FontSize="13" TextElement.FontSize="13"
@@ -25,7 +25,9 @@
<Grid> <Grid>
<TabControl Style="{StaticResource MaterialDesignNavigatilRailTabControl}"> <TabControl Style="{StaticResource MaterialDesignNavigatilRailTabControl}">
<TabItem x:Name="dashboardTabItem" <TabItem x:Name="dashboardTabItem"
Style="{StaticResource MaterialDesignNavigationRailTabItem}">
Style="{StaticResource MaterialDesignNavigationRailTabItem}"
Height="56"
Width="56">
<TabItem.Header> <TabItem.Header>
<materialDesign:PackIcon <materialDesign:PackIcon
Kind="Speedometer" Kind="Speedometer"
@@ -34,7 +36,9 @@
</TabItem.Header> </TabItem.Header>
</TabItem> </TabItem>
<TabItem x:Name="serversTabItem" <TabItem x:Name="serversTabItem"
Style="{StaticResource MaterialDesignNavigationRailTabItem}">
Style="{StaticResource MaterialDesignNavigationRailTabItem}"
Height="56"
Width="56">
<TabItem.Header> <TabItem.Header>
<materialDesign:PackIcon <materialDesign:PackIcon
Kind="Server" Kind="Server"
@@ -43,7 +47,9 @@
</TabItem.Header> </TabItem.Header>
</TabItem> </TabItem>
<TabItem x:Name="routingTabItem" <TabItem x:Name="routingTabItem"
Style="{StaticResource MaterialDesignNavigationRailTabItem}">
Style="{StaticResource MaterialDesignNavigationRailTabItem}"
Height="56"
Width="56">
<TabItem.Header> <TabItem.Header>
<materialDesign:PackIcon <materialDesign:PackIcon
Kind="RouterNetwork" Kind="RouterNetwork"
@@ -52,7 +58,9 @@
</TabItem.Header> </TabItem.Header>
</TabItem> </TabItem>
<TabItem x:Name="settingsTabItem" <TabItem x:Name="settingsTabItem"
Style="{StaticResource MaterialDesignNavigationRailTabItem}">
Style="{StaticResource MaterialDesignNavigationRailTabItem}"
Height="56"
Width="56">
<TabItem.Header> <TabItem.Header>
<materialDesign:PackIcon <materialDesign:PackIcon
Kind="SettingsOutline" Kind="SettingsOutline"


+ 1
- 1
Shadowsocks.WPF/Views/MainWindow.xaml.cs View File

@@ -7,7 +7,7 @@ namespace Shadowsocks.WPF.Views
/// <summary> /// <summary>
/// Interaction logic for MainWindow.xaml /// Interaction logic for MainWindow.xaml
/// </summary> /// </summary>
public partial class MainWindow : ReactiveWindow<MainWindowViewModel>
public partial class MainWindow
{ {
public MainWindow() public MainWindow()
{ {


+ 2
- 2
Shadowsocks.WPF/Views/OnlineConfigView.xaml.cs View File

@@ -1,4 +1,4 @@
using ReactiveUI;
using ReactiveUI;
using Shadowsocks.WPF.ViewModels; using Shadowsocks.WPF.ViewModels;
using System.Reactive.Disposables; using System.Reactive.Disposables;


@@ -7,7 +7,7 @@ namespace Shadowsocks.WPF.Views
/// <summary> /// <summary>
/// Interaction logic for OnlineConfigView.xaml /// Interaction logic for OnlineConfigView.xaml
/// </summary> /// </summary>
public partial class OnlineConfigView : ReactiveUserControl<OnlineConfigViewModel>
public partial class OnlineConfigView
{ {
public OnlineConfigView() public OnlineConfigView()
{ {


+ 1
- 1
Shadowsocks.WPF/Views/RoutingView.xaml.cs View File

@@ -18,7 +18,7 @@ namespace Shadowsocks.WPF.Views
/// <summary> /// <summary>
/// Interaction logic for RoutingView.xaml /// Interaction logic for RoutingView.xaml
/// </summary> /// </summary>
public partial class RoutingView : ReactiveUserControl<RoutingViewModel>
public partial class RoutingView
{ {
public RoutingView() public RoutingView()
{ {


+ 2
- 3
Shadowsocks.WPF/Views/ServerSharingView.xaml.cs View File

@@ -1,4 +1,4 @@
using ReactiveUI;
using ReactiveUI;
using Shadowsocks.WPF.ViewModels; using Shadowsocks.WPF.ViewModels;
using System.Reactive.Disposables; using System.Reactive.Disposables;
using System.Windows.Input; using System.Windows.Input;
@@ -8,12 +8,11 @@ namespace Shadowsocks.WPF.Views
/// <summary> /// <summary>
/// Interaction logic for ServerSharingView.xaml /// Interaction logic for ServerSharingView.xaml
/// </summary> /// </summary>
public partial class ServerSharingView : ReactiveUserControl<ServerSharingViewModel>
public partial class ServerSharingView
{ {
public ServerSharingView() public ServerSharingView()
{ {
InitializeComponent(); InitializeComponent();
ViewModel = new ServerSharingViewModel();
this.WhenActivated(disposables => this.WhenActivated(disposables =>
{ {
this.OneWayBind(ViewModel, this.OneWayBind(ViewModel,


+ 1
- 1
Shadowsocks.WPF/Views/ServersView.xaml.cs View File

@@ -18,7 +18,7 @@ namespace Shadowsocks.WPF.Views
/// <summary> /// <summary>
/// Interaction logic for ServersView.xaml /// Interaction logic for ServersView.xaml
/// </summary> /// </summary>
public partial class ServersView : ReactiveUserControl<ServersViewModel>
public partial class ServersView
{ {
public ServersView() public ServersView()
{ {


+ 1
- 1
Shadowsocks.WPF/Views/SettingsView.xaml.cs View File

@@ -18,7 +18,7 @@ namespace Shadowsocks.WPF.Views
/// <summary> /// <summary>
/// Interaction logic for SettingsView.xaml /// Interaction logic for SettingsView.xaml
/// </summary> /// </summary>
public partial class SettingsView : ReactiveUserControl<SettingsViewModel>
public partial class SettingsView
{ {
public SettingsView() public SettingsView()
{ {


+ 2
- 3
Shadowsocks.WPF/Views/VersionUpdatePromptView.xaml.cs View File

@@ -8,12 +8,11 @@ namespace Shadowsocks.WPF.Views
/// <summary> /// <summary>
/// Interaction logic for VersionUpdatePromptView.xaml /// Interaction logic for VersionUpdatePromptView.xaml
/// </summary> /// </summary>
public partial class VersionUpdatePromptView : ReactiveUserControl<VersionUpdatePromptViewModel>
public partial class VersionUpdatePromptView
{ {
public VersionUpdatePromptView(JsonElement releaseObject)
public VersionUpdatePromptView()
{ {
InitializeComponent(); InitializeComponent();
ViewModel = new VersionUpdatePromptViewModel(releaseObject);
DataContext = ViewModel; // for compatibility with MdXaml DataContext = ViewModel; // for compatibility with MdXaml
this.WhenActivated(disposables => this.WhenActivated(disposables =>
{ {


Shadowsocks.WPF/Resources/shadowsocks.ico → Shadowsocks.WPF/shadowsocks.ico View File


+ 9
- 27
Shadowsocks/Models/Group.cs View File

@@ -5,61 +5,43 @@ using System.Text.Json.Serialization;


namespace Shadowsocks.Models namespace Shadowsocks.Models
{ {
public class Group
public class Group : IGroup<Server>
{ {
/// <summary> /// <summary>
/// Group name.
/// Gets or sets the group name.
/// </summary> /// </summary>
public string Name { get; set; } public string Name { get; set; }
/// <summary> /// <summary>
/// UUID of the group.
/// Gets or sets the UUID of the group.
/// </summary> /// </summary>
public Guid Id { get; set; } public Guid Id { get; set; }


/// <summary>
/// URL of SIP008 online configuration delivery source.
/// </summary>
public string OnlineConfigSource { get; set; }

/// <summary>
/// SIP008 configuration version.
/// </summary>
/// <inheritdoc/>
public int Version { get; set; } public int Version { get; set; }


/// <summary>
/// A list of servers in the group.
/// </summary>
/// <inheritdoc/>
public List<Server> Servers { get; set; } public List<Server> Servers { get; set; }


/// <summary> /// <summary>
/// Data used in bytes.
/// Gets or sets the data usage in bytes.
/// The value is fetched from SIP008 provider. /// The value is fetched from SIP008 provider.
/// </summary> /// </summary>
public ulong BytesUsed { get; set; } public ulong BytesUsed { get; set; }


/// <summary> /// <summary>
/// Data remaining to be used in bytes.
/// Gets or sets the data remaining to be used in bytes.
/// The value is fetched from SIP008 provider. /// The value is fetched from SIP008 provider.
/// </summary> /// </summary>
public ulong BytesRemaining { get; set; } public ulong BytesRemaining { get; set; }


public Group()
{
Name = "";
Id = new Guid();
OnlineConfigSource = "";
Version = 1;
BytesUsed = 0UL;
BytesRemaining = 0UL;
Servers = new List<Server>();
}
public Group() : this(string.Empty)
{ }


public Group(string name) public Group(string name)
{ {
Name = name; Name = name;
Id = new Guid(); Id = new Guid();
OnlineConfigSource = "";
Version = 1; Version = 1;
BytesUsed = 0UL; BytesUsed = 0UL;
BytesRemaining = 0UL; BytesRemaining = 0UL;


+ 17
- 0
Shadowsocks/Models/IGroup.cs View File

@@ -0,0 +1,17 @@
using System.Collections.Generic;

namespace Shadowsocks.Models
{
public interface IGroup<T>
{
/// <summary>
/// Gets or sets the SIP008 configuration version.
/// </summary>
public int Version { get; set; }

/// <summary>
/// Gets or sets the list of servers in the group.
/// </summary>
public List<T> Servers { get; set; }
}
}

+ 19
- 0
Shadowsocks/Models/IServer.cs View File

@@ -0,0 +1,19 @@
using System;
using System.Text.Json.Serialization;

namespace Shadowsocks.Models
{
public interface IServer : IEquatable<IServer>
{
[JsonPropertyName("server")]
public string Host { get; set; }
[JsonPropertyName("server_port")]
public int Port { get; set; }
public string Password { get; set; }
public string Method { get; set; }
public string Plugin { get; set; }
public string PluginOpts { get; set; }
[JsonPropertyName("remarks")]
public string Name { get; set; }
}
}

+ 3
- 3
Shadowsocks/Models/Server.cs View File

@@ -5,7 +5,7 @@ using System.Text.Json.Serialization;


namespace Shadowsocks.Models namespace Shadowsocks.Models
{ {
public class Server
public class Server : IServer
{ {
[JsonPropertyName("server")] [JsonPropertyName("server")]
public string Host { get; set; } public string Host { get; set; }
@@ -52,8 +52,8 @@ namespace Shadowsocks.Models
Uuid = uuid; Uuid = uuid;
} }


public override bool Equals(object? obj) => obj is Server server && Uuid == server.Uuid;
public override int GetHashCode() => base.GetHashCode();
public bool Equals(IServer? other) => other is Server anotherServer && Uuid == anotherServer.Uuid;
public override int GetHashCode() => Uuid.GetHashCode();
public override string ToString() => Name; public override string ToString() => Name;


/// <summary> /// <summary>


+ 4
- 4
appveyor.yml View File

@@ -144,10 +144,10 @@ after_build:
$ZipMinimal = "$WorkingFolder\shadowsocks-windows-$env:APPVEYOR_BUILD_VERSION-minimal.zip" $ZipMinimal = "$WorkingFolder\shadowsocks-windows-$env:APPVEYOR_BUILD_VERSION-minimal.zip"
$ZipSingleExeX64 = "$WorkingFolder\shadowsocks-windows-$env:APPVEYOR_BUILD_VERSION-portable-x64.zip" $ZipSingleExeX64 = "$WorkingFolder\shadowsocks-windows-$env:APPVEYOR_BUILD_VERSION-portable-x64.zip"
$ZipSingleExeX86 = "$WorkingFolder\shadowsocks-windows-$env:APPVEYOR_BUILD_VERSION-portable-x86.zip" $ZipSingleExeX86 = "$WorkingFolder\shadowsocks-windows-$env:APPVEYOR_BUILD_VERSION-portable-x86.zip"
7z a $ZipDev "$env:APPVEYOR_BUILD_FOLDER\Shadowsocks.WPF\bin\$env:CONFIGURATION\netcoreapp3.1\*"
7z a $ZipMinimal "$env:APPVEYOR_BUILD_FOLDER\Shadowsocks.WPF\bin\Any CPU\$env:CONFIGURATION\netcoreapp3.1\publish\*"
7z a $ZipSingleExeX64 "$env:APPVEYOR_BUILD_FOLDER\Shadowsocks.WPF\bin\Any CPU\$env:CONFIGURATION\netcoreapp3.1\win-x64\publish\Shadowsocks.exe"
7z a $ZipSingleExeX86 "$env:APPVEYOR_BUILD_FOLDER\Shadowsocks.WPF\bin\Any CPU\$env:CONFIGURATION\netcoreapp3.1\win-x86\publish\Shadowsocks.exe"
7z a $ZipDev "$env:APPVEYOR_BUILD_FOLDER\Shadowsocks.WPF\bin\$env:CONFIGURATION\net5.0-windows10.0.19041.0\*"
7z a $ZipMinimal "$env:APPVEYOR_BUILD_FOLDER\Shadowsocks.WPF\bin\Any CPU\$env:CONFIGURATION\net5.0-windows10.0.19041.0\publish\*"
7z a $ZipSingleExeX64 "$env:APPVEYOR_BUILD_FOLDER\Shadowsocks.WPF\bin\Any CPU\$env:CONFIGURATION\net5.0-windows10.0.19041.0\win-x64\publish\Shadowsocks.exe"
7z a $ZipSingleExeX86 "$env:APPVEYOR_BUILD_FOLDER\Shadowsocks.WPF\bin\Any CPU\$env:CONFIGURATION\net5.0-windows10.0.19041.0\win-x86\publish\Shadowsocks.exe"
Calculate-Hash -file $ZipDev | Out-File -FilePath $HashFile -Append Calculate-Hash -file $ZipDev | Out-File -FilePath $HashFile -Append
Calculate-Hash -file $ZipMinimal | Out-File -FilePath $HashFile -Append Calculate-Hash -file $ZipMinimal | Out-File -FilePath $HashFile -Append
Calculate-Hash -file $ZipSingleExeX64 | Out-File -FilePath $HashFile -Append Calculate-Hash -file $ZipSingleExeX64 | Out-File -FilePath $HashFile -Append


Loading…
Cancel
Save