Skip to content

Commit

Permalink
Merge branch 'release/1.24.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
mindaugasveblauskas committed Nov 11, 2021
2 parents fa481b4 + bd5c577 commit 67ae811
Show file tree
Hide file tree
Showing 136 changed files with 1,903 additions and 2,770 deletions.
5 changes: 3 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -167,14 +167,15 @@ include:
file: '/jobs/sync-crowdin.gitlab-ci.yml'

i18n-sync-crowdin:
when: manual
variables:
I18N_SYNC_CROWDIN_PROJECT: 'windows-vpn'
extends: .i18n-sync-crowdin-shared-windows
extends: .i18n-sync-crowdin-common

i18n-manual-sync-crowdin:
when: manual
only:
- branches
variables:
I18N_SYNC_CROWDIN_PROJECT: 'windows-vpn'
extends: .i18n-sync-crowdin-shared-windows
extends: .i18n-sync-crowdin-common
2 changes: 2 additions & 0 deletions ProtonVPN.RestoreInternet/ProtonVPN.RestoreInternet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
Expand All @@ -31,6 +32,7 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<PropertyGroup>
<ApplicationManifest>app.manifest</ApplicationManifest>
Expand Down
6 changes: 3 additions & 3 deletions Setup/ProtonVPN.aip
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
<ROW Property="Manufacturer" Value="Proton Technologies AG"/>
<ROW Property="MsiLogging" MultiBuildValue="DefaultBuild:vp"/>
<ROW Property="PENDING_REBOOT" Value="0"/>
<ROW Property="ProductCode" Value="1031:{F3E73A9C-83B2-41B3-92CA-F116607FE318} 1033:{F3E73A9C-83B2-41B3-92CA-F116607FE318} 1036:{F3E73A9C-83B2-41B3-92CA-F116607FE318} 1040:{F3E73A9C-83B2-41B3-92CA-F116607FE318} 1043:{F3E73A9C-83B2-41B3-92CA-F116607FE318} 1045:{F3E73A9C-83B2-41B3-92CA-F116607FE318} 1046:{F3E73A9C-83B2-41B3-92CA-F116607FE318} 1049:{F3E73A9C-83B2-41B3-92CA-F116607FE318} 1065:{F3E73A9C-83B2-41B3-92CA-F116607FE318} 2070:{F3E73A9C-83B2-41B3-92CA-F116607FE318} 3082:{F3E73A9C-83B2-41B3-92CA-F116607FE318} " Type="16"/>
<ROW Property="ProductCode" Value="1031:{57C4E518-CE13-4F6B-BA1C-647667ECACFE} 1033:{57C4E518-CE13-4F6B-BA1C-647667ECACFE} 1036:{57C4E518-CE13-4F6B-BA1C-647667ECACFE} 1040:{57C4E518-CE13-4F6B-BA1C-647667ECACFE} 1043:{57C4E518-CE13-4F6B-BA1C-647667ECACFE} 1045:{57C4E518-CE13-4F6B-BA1C-647667ECACFE} 1046:{57C4E518-CE13-4F6B-BA1C-647667ECACFE} 1049:{57C4E518-CE13-4F6B-BA1C-647667ECACFE} 1065:{57C4E518-CE13-4F6B-BA1C-647667ECACFE} 2070:{57C4E518-CE13-4F6B-BA1C-647667ECACFE} 3082:{57C4E518-CE13-4F6B-BA1C-647667ECACFE} " Type="16"/>
<ROW Property="ProductLanguage" Value="1033"/>
<ROW Property="ProductName" Value="ProtonVPN"/>
<ROW Property="ProductVersion" Value="1.24.0" Type="32"/>
<ROW Property="ProductVersion" Value="1.24.1" Type="32"/>
<ROW Property="REBOOT" MultiBuildValue="DefaultBuild:ReallySuppress"/>
<ROW Property="SecureCustomProperties" Value="OLDPRODUCTS;AI_NEWERPRODUCTFOUND;AI_SETUPEXEPATH;SETUPEXEDIR"/>
<ROW Property="SelectedLanguage" Value="This will be set by custom action"/>
Expand Down Expand Up @@ -82,7 +82,7 @@
</COMPONENT>
<COMPONENT cid="caphyon.advinst.msicomp.MsiCompsComponent">
<ROW Component="A7C0318B44EF690B391D753065B05" ComponentId="{8DFC0212-F989-444F-81FB-9D221A745FE8}" Directory_="APPDIR" Attributes="0" Options="2"/>
<ROW Component="AI_CustomARPName" ComponentId="{6BDED770-B13D-4888-BE7B-AF2D94F84CA4}" Directory_="APPDIR" Attributes="4" KeyPath="DisplayName" Options="1"/>
<ROW Component="AI_CustomARPName" ComponentId="{7AAF5EB8-E529-4356-B1B3-46F0ACFABF83}" Directory_="APPDIR" Attributes="4" KeyPath="DisplayName" Options="1"/>
<ROW Component="AI_ExePath" ComponentId="{47427A21-60A2-43B4-A150-6CBA74CF4A07}" Directory_="APPDIR" Attributes="4" KeyPath="AI_ExePath"/>
<ROW Component="APPDIR" ComponentId="{75DDD993-CDFE-4D39-8C1A-07484ADD1A4E}" Directory_="APPDIR" Attributes="0"/>
<ROW Component="ARSoft.Tools.Net.dll" ComponentId="{05CE9A73-14A8-494D-B2D3-8438A2A16DDB}" Directory_="APPDIR" Attributes="0" KeyPath="ARSoft.Tools.Net.dll"/>
Expand Down
Binary file modified Setup/wireguard-nt/amd64/wireguard.dll
Binary file not shown.
Binary file modified Setup/wireguard-nt/x86/wireguard.dll
Binary file not shown.
4 changes: 2 additions & 2 deletions src/GlobalAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

[assembly: AssemblyVersion("1.24.0.0")]
[assembly: AssemblyFileVersion("1.24.0.0")]
[assembly: AssemblyVersion("1.24.1.0")]
[assembly: AssemblyFileVersion("1.24.1.0")]
[assembly: ComVisible(false)]
[assembly: AssemblyInformationalVersion("$AssemblyVersion")]
2 changes: 0 additions & 2 deletions src/ProtonVPN.App/Account/VpnPlanHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ public static string GetPlanName(string vpnPlan)
case "vpnbasic":
case "vpnplus":
case "visionary":
case "trial":
return Translation.Get($"VpnPlan_val_{vpnPlan.FirstCharToUpper()}");
default:
return "Unknown plan";
Expand All @@ -48,7 +47,6 @@ public static string GetPlanColor(string vpnPlan)
case "vpnbasic":
return "#fb7454";
case "vpnplus":
case "trial":
return "#8ec122";
case "visionary":
return "#54d8fd";
Expand Down
21 changes: 0 additions & 21 deletions src/ProtonVPN.App/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,6 @@
<setting name="WelcomeModalShown" serializeAs="String">
<value>False</value>
</setting>
<setting name="TrialExpirationTime" serializeAs="String">
<value>0</value>
</setting>
<setting name="AboutToExpireModalShown" serializeAs="String">
<value>False</value>
</setting>
<setting name="ExpiredModalShown" serializeAs="String">
<value>False</value>
</setting>
<setting name="OnboardingStep" serializeAs="String">
<value>0</value>
</setting>
Expand Down Expand Up @@ -195,9 +186,6 @@
<setting name="UserDelinquent" serializeAs="String">
<value />
</setting>
<setting name="UserExpirationTime" serializeAs="String">
<value />
</setting>
<setting name="UserMaxConnect" serializeAs="String">
<value />
</setting>
Expand All @@ -213,15 +201,6 @@
<setting name="UserWelcomeModalShown" serializeAs="String">
<value />
</setting>
<setting name="UserTrialExpirationTime" serializeAs="String">
<value />
</setting>
<setting name="UserAboutToExpireModalShown" serializeAs="String">
<value />
</setting>
<setting name="UserExpiredModalShown" serializeAs="String">
<value />
</setting>
<setting name="UserOnboardingStep" serializeAs="String">
<value />
</setting>
Expand Down
22 changes: 2 additions & 20 deletions src/ProtonVPN.App/Core/AppSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ public CachedProfileDataContract Profiles
set => SetPerUser(value);
}

public IReadOnlyList<AnnouncementItem> Announcements
public IReadOnlyList<Announcement> Announcements
{
get => GetPerUser<IReadOnlyList<AnnouncementItem>>() ?? new List<AnnouncementItem>();
get => GetPerUser<IReadOnlyList<Announcement>>() ?? new List<Announcement>();
set => SetPerUser(value);
}

Expand Down Expand Up @@ -212,30 +212,12 @@ public bool WelcomeModalShown
set => SetPerUser(value);
}

public long TrialExpirationTime
{
get => GetPerUser<long>();
set => SetPerUser(value);
}

public bool AboutToExpireModalShown
{
get => GetPerUser<bool>();
set => SetPerUser(value);
}

public bool NetShieldModalShown
{
get => GetPerUser<bool>();
set => SetPerUser(value);
}

public bool ExpiredModalShown
{
get => GetPerUser<bool>();
set => SetPerUser(value);
}

public int OnboardingStep
{
get => GetPerUser<int>();
Expand Down
96 changes: 18 additions & 78 deletions src/ProtonVPN.App/Core/Bootstraper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Net.Http;
using System.ServiceModel;
Expand All @@ -33,7 +32,6 @@
using ProtonVPN.Common.Abstract;
using ProtonVPN.Common.Extensions;
using ProtonVPN.Common.Logging;
using ProtonVPN.Common.OS.Processes;
using ProtonVPN.Common.OS.Services;
using ProtonVPN.Common.Storage;
using ProtonVPN.Common.Vpn;
Expand Down Expand Up @@ -66,6 +64,7 @@
using ProtonVPN.Map;
using ProtonVPN.Map.ViewModels;
using ProtonVPN.Modals.ApiActions;
using ProtonVPN.Modals.Welcome;
using ProtonVPN.Notifications;
using ProtonVPN.Onboarding;
using ProtonVPN.P2PDetection;
Expand All @@ -77,7 +76,6 @@
using ProtonVPN.Sidebar.Announcements;
using ProtonVPN.Streaming;
using ProtonVPN.Translations;
using ProtonVPN.Trial;
using ProtonVPN.ViewModels;
using ProtonVPN.Vpn.Connectors;
using ProtonVPN.Windows;
Expand Down Expand Up @@ -111,8 +109,7 @@ protected override void Configure()
.RegisterModule<BugReportingModule>()
.RegisterModule<LoginModule>()
.RegisterModule<P2PDetectionModule>()
.RegisterModule<ProfilesModule>()
.RegisterModule<TrialModule>();
.RegisterModule<ProfilesModule>();

_container = builder.Build();
}
Expand Down Expand Up @@ -142,7 +139,13 @@ protected override async void OnStartup(object sender, StartupEventArgs e)
SetHardwareAcceleration();
RegisterEvents();
Resolve<Language>().Initialize(_args);
await ShowInitialWindow();

if (Resolve<IAppSettings>().StartMinimized == StartMinimizedMode.Disabled)
{
ShowInitialWindow();
}

await StartAllServices();

if (Resolve<IUserStorage>().User().Empty() || !await IsUserValid() || await SessionExpired())
{
Expand All @@ -156,26 +159,10 @@ protected override async void OnStartup(object sender, StartupEventArgs e)
public void OnExit()
{
Resolve<TrayIcon>().Hide();
Resolve<VpnSystemService>().StopAsync();
Resolve<MonitoredVpnService>().StopAsync();
Resolve<AppUpdateSystemService>().StopAsync();
}

private async Task StartVpnService()
{
if (!Resolve<BaseFilteringEngineService>().Running())
{
return;
}

MonitoredVpnService service = Resolve<MonitoredVpnService>();
if (!service.Enabled())
{
return;
}

await StartService(service);
}

private async Task<bool> SessionExpired()
{
if (string.IsNullOrEmpty(Resolve<ITokenStorage>().AccessToken))
Expand Down Expand Up @@ -235,26 +222,19 @@ private async Task<bool> IsUserValid()

private async Task StartAllServices()
{
await StartVpnService();
await StartService(Resolve<VpnSystemService>());
await StartService(Resolve<AppUpdateSystemService>());
await InitializeStateFromService();
}

private async Task ShowInitialWindow()
private void ShowInitialWindow()
{
if (Resolve<IAppSettings>().StartMinimized != StartMinimizedMode.Disabled)
{
return;
}

LoginWindow loginWindow = Resolve<LoginWindow>();
LoginWindowViewModel loginWindowViewModel = Resolve<LoginWindowViewModel>();
Application.Current.MainWindow = loginWindow;
loginWindowViewModel.CurrentPageViewModel = Resolve<LoadingViewModel>();
loginWindow.DataContext = loginWindowViewModel;
loginWindow.Show();

await StartAllServices();
}

private void RegisterEvents()
Expand Down Expand Up @@ -284,7 +264,7 @@ private void RegisterEvents()
}
};

Resolve<IAnnouncements>().AnnouncementsChanged += (sender, e) =>
Resolve<IAnnouncementService>().AnnouncementsChanged += (sender, e) =>
{
IEnumerable<IAnnouncementsAware> instances = Resolve<IEnumerable<IAnnouncementsAware>>();
foreach (IAnnouncementsAware instance in instances)
Expand Down Expand Up @@ -436,24 +416,6 @@ private void RegisterEvents()
}
};

Resolve<TrialTimer>().TrialTimerTicked += (sender, e) =>
{
IEnumerable<ITrialDurationAware> instances = Resolve<IEnumerable<ITrialDurationAware>>();
foreach (ITrialDurationAware instance in instances)
{
instance.OnTrialSecondElapsed(e);
}
};

Resolve<Trial.Trial>().StateChanged += async (sender, e) =>
{
IEnumerable<ITrialStateAware> instances = Resolve<IEnumerable<ITrialStateAware>>();
foreach (ITrialStateAware instance in instances)
{
await instance.OnTrialStateChangedAsync(e);
}
};

Resolve<GuestHoleState>().GuestHoleStateChanged += (sender, active) =>
{
IEnumerable<IGuestHoleStateAware> instances = Resolve<IEnumerable<IGuestHoleStateAware>>();
Expand Down Expand Up @@ -547,9 +509,9 @@ private async Task SwitchToAppWindow(bool autoLogin)
Resolve<LoginWindow>().Hide();

Resolve<PlanDowngradeHandler>();
await Resolve<Trial.Trial>().Load();
Resolve<WelcomeModalManager>().Load();
await Resolve<IUserLocationService>().Update();
await Resolve<IAnnouncements>().Update();
await Resolve<IAnnouncementService>().Update();
await Resolve<SystemTimeValidator>().Validate();
await Resolve<AutoConnect>().Load(autoLogin);
Resolve<SyncProfiles>().Sync();
Expand Down Expand Up @@ -583,24 +545,10 @@ private async Task InitializeStateFromService()
private async Task StartService(IConcurrentService service)
{
Result result = await service.StartAsync();

if (result.Failure)
if (result.Failure && result.Exception != null)
{
ReportException(result.Exception);

AppConfig config = Resolve<AppConfig>();
string filename = config.ErrorMessageExePath;
string error = GetServiceErrorMessage(service.Name, result.Exception);
try
{
Resolve<IOsProcesses>().Process(filename, error).Start();
}
catch (Exception e)
{
string serviceName = Path.GetFileNameWithoutExtension(filename);
Resolve<ILogger>().Error($"Failed to start {serviceName} process: {e.CombinedMessage()}");
ReportException(e);
}
Resolve<ILogger>().Error($"[Bootstrapper] Failed to start {service.Name} service.", result.Exception);
}
}

Expand All @@ -614,14 +562,6 @@ private void ReportException(Exception e)
});
}

private string GetServiceErrorMessage(string serviceName, Exception e)
{
string error = e.InnerException?.Message ?? e.Message;
string failedToStart = string.Format(Translation.Get("Dialogs_ServiceStart_msg_FailedToStart"), serviceName);

return $"\"{failedToStart}\" \"{error}\"";
}

private void RegisterMigrations(ISupportsMigration subject, IEnumerable<IMigration> migrations)
{
foreach (IMigration migration in migrations)
Expand All @@ -635,4 +575,4 @@ public void OnToastNotificationUserAction(NotificationUserAction data)
_notificationUserActionHandler?.Handle(data);
}
}
}
}
Loading

0 comments on commit 67ae811

Please sign in to comment.