Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
trudyhood committed Jun 24, 2024
2 parents f8a85d3 + 689db9e commit df9b2fc
Show file tree
Hide file tree
Showing 41 changed files with 214 additions and 130 deletions.
133 changes: 68 additions & 65 deletions CHANGELOG.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Pub/PubVersion.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"Version": "4.5.531",
"BumpTime": "2024-06-16T22:38:49.4194931Z",
"Version": "4.5.535",
"BumpTime": "2024-06-24T05:03:47.2884293Z",
"Prerelease": false,
"DeprecatedVersion": "4.0.00"
}
4 changes: 0 additions & 4 deletions Pub/PublishToGitHub.ps1
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
. "$PSScriptRoot/Core/Common.ps1"

# update maui nugets
Push-Location -Path "$solutionDir/VpnHood.Client.App.Maui.Common";

# update CHANGELOG
$text = Get-Content "$solutionDir/CHANGELOG.md" -Raw;

Expand All @@ -19,7 +16,6 @@ $changeLog | Out-File -FilePath "$solutionDir/CHANGELOG.md" -Encoding utf8 -For
$releaseNote = $changeLog;
$releaseNote = $releaseNote.SubString($releaseNote.IndexOf("`n")); # remove version tag
$releaseNote = $releaseNote.SubString(0, $releaseNote.IndexOf("`n# ")); # remove other version
# $releaseNote += "To see a list of all changes visit: [Changelog](https://github.com/vpnhood/VpnHood/blob/main/CHANGELOG.md)";
$releaseNote | Out-File -FilePath "$packagesRootDir/ReleaseNote.txt" -Encoding utf8 -Force -NoNewline;
if ($isLatest)
{
Expand Down
4 changes: 2 additions & 2 deletions Tests/VpnHood.Test/Tests/ClientAppTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ public async Task IpFilters(bool usePassthru, bool isDnsServerSupported)
// ************
// *** TEST ***: Test Include ip filter
app.UserSettings.IncludeIpRanges = customIps;
app.UserSettings.ExcludeIpRanges = null;
app.UserSettings.ExcludeIpRanges = [];
await app.Connect(clientProfile.ClientProfileId);
await TestHelper.WaitForAppState(app, AppConnectionState.Connected);
await TestHelper.Test_Ping(ipAddress: TestConstants.PingV4Address1);
Expand All @@ -465,7 +465,7 @@ public async Task IpFilters(bool usePassthru, bool isDnsServerSupported)

// ************
// *** TEST ***: Test Exclude ip filters
app.UserSettings.IncludeIpRanges = null;
app.UserSettings.IncludeIpRanges = [];
app.UserSettings.ExcludeIpRanges = customIps;
await app.Connect(clientProfile.ClientProfileId);
await TestHelper.WaitForAppState(app, AppConnectionState.Connected);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<PackageIcon>VpnHood.png</PackageIcon>
<PackageProjectUrl>https://github.com/vpnhood/vpnhood</PackageProjectUrl>
<RepositoryUrl>https://github.com/vpnhood/vpnhood</RepositoryUrl>
<Version>4.5.531</Version>
<Version>4.5.535</Version>
<FileVersion>$([System.DateTime]::Now.ToString("yyyy.M.d.HHmm"))</FileVersion>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Android.Gms.Ads.AppOpen;
using VpnHood.Client.App.Abstractions;
using VpnHood.Client.App.Droid.Ads.VhAdMob.AdNetworkCallBackFix;
using VpnHood.Client.App.Exceptions;
using VpnHood.Client.Device;
using VpnHood.Client.Device.Droid;
using VpnHood.Common.Exceptions;
Expand Down Expand Up @@ -123,7 +124,10 @@ protected override void OnAdLoaded(AppOpenAd appOpenAd)

public override void OnAdFailedToLoad(LoadAdError addError)
{
_loadedCompletionSource.TrySetException(new LoadAdException(addError.Message));
_loadedCompletionSource.TrySetException(
addError.Message.Contains("No fill.", StringComparison.OrdinalIgnoreCase)
? new NoFillAdException(addError.Message)
: new LoadAdException(addError.Message));
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Android.Gms.Ads;
using Android.Gms.Ads.Interstitial;
using VpnHood.Client.App.Abstractions;
using VpnHood.Client.App.Exceptions;
using VpnHood.Client.Device;
using VpnHood.Client.Device.Droid;
using VpnHood.Common.Exceptions;
Expand Down Expand Up @@ -111,7 +112,10 @@ protected override void OnAdLoaded(InterstitialAd interstitialAd)

public override void OnAdFailedToLoad(LoadAdError addError)
{
_loadedCompletionSource.TrySetException(new LoadAdException(addError.Message));
_loadedCompletionSource.TrySetException(
addError.Message.Contains("No fill.", StringComparison.OrdinalIgnoreCase)
? new NoFillAdException(addError.Message)
: new LoadAdException(addError.Message));
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Android.Gms.Ads;
using Android.Gms.Ads.Rewarded;
using VpnHood.Client.App.Abstractions;
using VpnHood.Client.App.Exceptions;
using VpnHood.Client.Device;
using VpnHood.Client.Device.Droid;
using VpnHood.Common.Exceptions;
Expand Down Expand Up @@ -110,9 +111,13 @@ protected override void OnAdLoaded(RewardedAd rewardedAd)

public override void OnAdFailedToLoad(LoadAdError addError)
{
_loadedCompletionSource.TrySetException(new LoadAdException(addError.Message));
_loadedCompletionSource.TrySetException(
addError.Message.Contains("No fill.", StringComparison.OrdinalIgnoreCase)
? new NoFillAdException(addError.Message)
: new LoadAdException(addError.Message));
}
}

private class MyFullScreenContentCallback : FullScreenContentCallback
{
private readonly TaskCompletionSource _dismissedCompletionSource = new();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<PackageIcon>VpnHood.png</PackageIcon>
<PackageProjectUrl>https://github.com/vpnhood/vpnhood</PackageProjectUrl>
<RepositoryUrl>https://github.com/vpnhood/vpnhood</RepositoryUrl>
<Version>4.5.531</Version>
<Version>4.5.535</Version>
<FileVersion>$([System.DateTime]::Now.ToString("yyyy.M.d.HHmm"))</FileVersion>
<BaseIntermediateOutputPath />
</PropertyGroup>
Expand Down
15 changes: 12 additions & 3 deletions VpnHood.Client.App.Android.Common/AndroidAppWebViewClient.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using Android.Content;
using Android.Webkit;
using Microsoft.Extensions.Logging;
using VpnHood.Common.Logging;

namespace VpnHood.Client.App.Droid.Common;

Expand All @@ -23,9 +25,16 @@ public override bool ShouldOverrideUrlLoading(WebView? webView, string? url)
if (uri.AbsolutePath == "/" || string.IsNullOrEmpty(uri.AbsolutePath))
return false;

var intent = new Intent(Intent.ActionView, Android.Net.Uri.Parse(url));
intent.SetFlags(ActivityFlags.NewTask);
Application.Context.StartActivity(intent);
try
{
var intent = new Intent(Intent.ActionView, Android.Net.Uri.Parse(url));
intent.SetFlags(ActivityFlags.NewTask);
Application.Context.StartActivity(intent);
}
catch (Exception ex)
{
VhLogger.Instance.LogError(ex, $"Could not launch any activity for {url}");
}

return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<PackageIcon>VpnHood.png</PackageIcon>
<PackageProjectUrl>https://github.com/vpnhood/vpnhood</PackageProjectUrl>
<RepositoryUrl>https://github.com/vpnhood/vpnhood</RepositoryUrl>
<Version>4.5.531</Version>
<Version>4.5.535</Version>
<FileVersion>$([System.DateTime]::Now.ToString("yyyy.M.d.HHmm"))</FileVersion>
<BaseIntermediateOutputPath />
</PropertyGroup>
Expand Down
4 changes: 1 addition & 3 deletions VpnHood.Client.App.Android.Connect/App.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using Firebase.Crashlytics;
using Firebase;
using VpnHood.Client.App.Droid.Ads.VhAdMob;
using VpnHood.Client.App.Droid.Ads.VhUnityAds;
using VpnHood.Client.App.Droid.Common;
using VpnHood.Client.App.Droid.GooglePlay;
using VpnHood.Client.App.Resources;
Expand Down Expand Up @@ -37,7 +36,7 @@ protected override AppOptions CreateAppOptions()
var resources = DefaultAppResource.Resource;
resources.Colors.NavigationBarColor = Color.FromArgb(100, 32, 25, 81);
resources.Colors.WindowBackgroundColor = Color.FromArgb(100, 32, 25, 81);

return new AppOptions
{
StorageFolderPath = storageFolderPath,
Expand All @@ -52,7 +51,6 @@ protected override AppOptions CreateAppOptions()
AdServices = [
AdMobInterstitialAdService.Create(appSettings.AdMobInterstitialAdUnitId, true),
AdMobInterstitialAdService.Create(appSettings.AdMobInterstitialNoVideoAdUnitId, false),
UnityAdService.Create(appSettings.UnityAdGameId, appSettings.UnityAdInterstitialPlacementId, AppSettings.IsDebugMode)
],
UiService = new AndroidAppUiService()
};
Expand Down
4 changes: 2 additions & 2 deletions VpnHood.Client.App.Android.Connect/AppSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ internal class AppSettings : Singleton<AppSettings>

// This is a test access key, you should replace it with your own access key.
// It is limited and can not be used in production.
public string DefaultAccessKey { get; init; } = "vh://eyJ2Ijo0LCJuYW1lIjoiVnBuSG9vZCBTYW1wbGUiLCJzaWQiOiIxMzAwIiwidGlkIjoiYTM0Mjk4ZDktY2YwYi00MGEwLWI5NmMtZGJhYjYzMWQ2MGVjIiwiaWF0IjoiMjAyNC0wNi0xNFQyMjozMjo1NS44OTQ5ODAyWiIsInNlYyI6Im9wcTJ6M0M0ak9rdHNodXl3c0VKNXc9PSIsInNlciI6eyJjdCI6IjIwMjQtMDYtMDVUMDQ6MTU6MzZaIiwiaG5hbWUiOiJtby5naXdvd3l2eS5uZXQiLCJocG9ydCI6MCwiaXN2IjpmYWxzZSwic2VjIjoidmFCcVU5UkMzUUhhVzR4RjVpYllGdz09IiwiY2giOiIzZ1hPSGU1ZWN1aUM5cStzYk83aGxMb2tRYkE9IiwidXJsIjoiaHR0cHM6Ly9yYXcuZ2l0aHVidXNlcmNvbnRlbnQuY29tL3Zwbmhvb2QvVnBuSG9vZC5GYXJtS2V5cy9tYWluL0ZyZWVfZW5jcnlwdGVkX3Rva2VuLnR4dCIsImVwIjpbIjUxLjgxLjIxMC4xNjQ6NDQzIiwiWzI2MDQ6MmRjMDoyMDI6MzAwOjo1Y2VdOjQ0MyJdLCJsb2MiOlsiVVMvT3JlZ29uIiwiVVMvVmlyZ2luaWEiXX19";
public string DefaultAccessKey { get; init; } = ClientOptions.SampleAccessKey;

// Google sign-in (It is created through Firebase)
public string GoogleSignInClientId { get; init; } = "000000000000-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com"; //YOUR_FIREBASE_CLIENT_ID
Expand All @@ -24,7 +24,7 @@ internal class AppSettings : Singleton<AppSettings>
// VpnHood Store server
public Uri StoreBaseUri { get; init; } = new ("https://store-api.vpnhood.com");
public Guid StoreAppId { get; init; } = Guid.Parse("00000000-0000-0000-0000-000000000000"); //YOUR_VPNHOOD_STORE_APP_ID
public bool StoreIgnoreSslVerification { get; init; }
public bool StoreIgnoreSslVerification { get; init; } = IsDebugMode;

// AdMob
// Default value is AdMob test AdUnit id, References: https://developers.google.com/admob/android/test-ads
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<RootNamespace>VpnHood.Client.App.Droid.Connect</RootNamespace>
<OutputType>Exe</OutputType>
<ApplicationId>com.vpnhood.connect.android</ApplicationId>
<ApplicationVersion>530</ApplicationVersion>
<ApplicationDisplayVersion>4.5.530</ApplicationDisplayVersion>
<ApplicationVersion>534</ApplicationVersion>
<ApplicationDisplayVersion>4.5.534</ApplicationDisplayVersion>
<SupportedOSPlatformVersion>23.0</SupportedOSPlatformVersion>
</PropertyGroup>

Expand All @@ -30,7 +30,7 @@
<PackageIcon>VpnHood.png</PackageIcon>
<PackageProjectUrl>https://github.com/vpnhood/vpnhood</PackageProjectUrl>
<RepositoryUrl>https://github.com/vpnhood/vpnhood</RepositoryUrl>
<Version>4.5.530</Version>
<Version>4.5.534</Version>
<FileVersion>$([System.DateTime]::Now.ToString("yyyy.M.d.HHmm"))</FileVersion>
<BaseIntermediateOutputPath />
</PropertyGroup>
Expand Down Expand Up @@ -68,8 +68,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="VpnHood.Client.App.Android.Ads.UnityAds" Version="4.5.532" />
<PackageReference Include="Xamarin.Firebase.Crashlytics" Version="118.6.2.1" />
<PackageReference Include="Xamarin.Firebase.Crashlytics" Version="119.0.0" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public void OnStateUpdate(InstallState state)
break;

case InstallStatus.Canceled:
_taskCompletionSource.SetCanceled();
_taskCompletionSource.TrySetCanceled();
break;

case InstallStatus.Failed:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<PackageIcon>VpnHood.png</PackageIcon>
<PackageProjectUrl>https://github.com/vpnhood/vpnhood</PackageProjectUrl>
<RepositoryUrl>https://github.com/vpnhood/vpnhood</RepositoryUrl>
<Version>4.5.531</Version>
<Version>4.5.535</Version>
<FileVersion>$([System.DateTime]::Now.ToString("yyyy.M.d.HHmm"))</FileVersion>
<BaseIntermediateOutputPath />
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<PackageIcon>VpnHood.png</PackageIcon>
<PackageProjectUrl>https://github.com/vpnhood/vpnhood</PackageProjectUrl>
<RepositoryUrl>https://github.com/vpnhood/vpnhood</RepositoryUrl>
<Version>4.5.531</Version>
<Version>4.5.535</Version>
<FileVersion>$([System.DateTime]::Now.ToString("yyyy.M.d.HHmm"))</FileVersion>
<BaseIntermediateOutputPath />
</PropertyGroup>
Expand All @@ -34,8 +34,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Xamarin.GooglePlayServices.Auth" Version="121.0.0.2" />
<PackageReference Include="Xamarin.Android.Google.BillingClient" Version="6.1.0.3" />
<PackageReference Include="Xamarin.GooglePlayServices.Auth" Version="121.1.1" />
<PackageReference Include="Xamarin.Android.Google.BillingClient" Version="6.2.1" />
</ItemGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions VpnHood.Client.App.Android/App.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public class App(IntPtr javaReference, JniHandleOwnership transfer)
protected override AppOptions CreateAppOptions() => new()
{
Resource = DefaultAppResource.Resource,
AccessKeys = AssemblyInfo.IsDebugMode ? [ClientOptions.SampleAccessKey] : [],
UpdateInfoUrl = AssemblyInfo.UpdateInfoUrl,
IsAddAccessKeySupported = true,
UpdaterService = AssemblyInfo.CreateUpdaterService(),
Expand Down
6 changes: 3 additions & 3 deletions VpnHood.Client.App.Android/VpnHood.Client.App.Android.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<RootNamespace>VpnHood.Client.App.Droid</RootNamespace>
<OutputType>Exe</OutputType>
<ApplicationId>com.vpnhood.client.android.web</ApplicationId>
<ApplicationVersion>531</ApplicationVersion>
<ApplicationDisplayVersion>4.5.531</ApplicationDisplayVersion>
<ApplicationVersion>535</ApplicationVersion>
<ApplicationDisplayVersion>4.5.535</ApplicationDisplayVersion>
<SupportedOSPlatformVersion>23.0</SupportedOSPlatformVersion>
</PropertyGroup>

Expand All @@ -30,7 +30,7 @@
<PackageIcon>VpnHood.png</PackageIcon>
<PackageProjectUrl>https://github.com/vpnhood/vpnhood</PackageProjectUrl>
<RepositoryUrl>https://github.com/vpnhood/vpnhood</RepositoryUrl>
<Version>4.5.531</Version>
<Version>4.5.535</Version>
<FileVersion>$([System.DateTime]::Now.ToString("yyyy.M.d.HHmm"))</FileVersion>
<BaseIntermediateOutputPath />
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<PackageIcon>VpnHood.png</PackageIcon>
<PackageProjectUrl>https://github.com/vpnhood/vpnhood</PackageProjectUrl>
<RepositoryUrl>https://github.com/vpnhood/vpnhood</RepositoryUrl>
<Version>4.5.531</Version>
<Version>4.5.535</Version>
<FileVersion>$([System.DateTime]::Now.ToString("yyyy.M.d.HHmm"))</FileVersion>
<BaseOutputPath></BaseOutputPath>
<BaseIntermediateOutputPath />
Expand Down
Binary file modified VpnHood.Client.App.Resources/Resources/SPA.zip
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<PackageIcon>VpnHood.png</PackageIcon>
<PackageProjectUrl>https://github.com/vpnhood/vpnhood</PackageProjectUrl>
<RepositoryUrl>https://github.com/vpnhood/vpnhood</RepositoryUrl>
<Version>4.5.531</Version>
<Version>4.5.535</Version>
<FileVersion>$([System.DateTime]::Now.ToString("yyyy.M.d.HHmm"))</FileVersion>
</PropertyGroup>

Expand Down
4 changes: 2 additions & 2 deletions VpnHood.Client.App.Store/VpnHood.Client.App.Store.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<PackageIcon>VpnHood.png</PackageIcon>
<PackageProjectUrl>https://github.com/vpnhood/vpnhood</PackageProjectUrl>
<RepositoryUrl>https://github.com/vpnhood/vpnhood</RepositoryUrl>
<Version>4.5.531</Version>
<Version>4.5.535</Version>
<FileVersion>$([System.DateTime]::Now.ToString("yyyy.M.d.HHmm"))</FileVersion>
</PropertyGroup>

Expand All @@ -35,7 +35,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="VpnHood.Store.Api" Version="1.0.39-alpha" />
<PackageReference Include="VpnHood.Store.Api" Version="1.0.47" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<PackageIcon>VpnHood.png</PackageIcon>
<PackageProjectUrl>https://github.com/vpnhood/vpnhood</PackageProjectUrl>
<RepositoryUrl>https://github.com/vpnhood/vpnhood</RepositoryUrl>
<Version>4.5.531</Version>
<Version>4.5.535</Version>
<FileVersion>$([System.DateTime]::Now.ToString("yyyy.M.d.HHmm"))</FileVersion>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<PackageIcon>VpnHood.png</PackageIcon>
<PackageProjectUrl>https://github.com/vpnhood/vpnhood</PackageProjectUrl>
<RepositoryUrl>https://github.com/vpnhood/vpnhood</RepositoryUrl>
<Version>4.5.531</Version>
<Version>4.5.535</Version>
<FileVersion>$([System.DateTime]::Now.ToString("yyyy.M.d.HHmm"))</FileVersion>
</PropertyGroup>

Expand Down
4 changes: 2 additions & 2 deletions VpnHood.Client.App.Win/VpnHood.Client.App.Win.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<PackageIcon>VpnHood.png</PackageIcon>
<PackageProjectUrl>https://github.com/vpnhood/vpnhood</PackageProjectUrl>
<RepositoryUrl>https://github.com/vpnhood/vpnhood</RepositoryUrl>
<Version>4.5.531</Version>
<Version>4.5.535</Version>
<FileVersion>$([System.DateTime]::Now.ToString("yyyy.M.d.HHmm"))</FileVersion>
</PropertyGroup>

Expand All @@ -48,7 +48,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.2535.41" />
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.2592.51" />
</ItemGroup>


Expand Down
14 changes: 14 additions & 0 deletions VpnHood.Client.App/Exceptions/NoFillAdException.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using VpnHood.Common.Exceptions;

namespace VpnHood.Client.App.Exceptions;

public class NoFillAdException : LoadAdException
{
public NoFillAdException(string message) : base(message)
{
}

public NoFillAdException(string message, Exception innerException) : base(message, innerException)
{
}
}
Loading

0 comments on commit df9b2fc

Please sign in to comment.