Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/+about-datenschutz.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Über FwAssist links to the Datenschutzerklärung, as Google Play requires inside the app.
2 changes: 1 addition & 1 deletion docs/play/listing-de-DE.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Quelltext (MIT): https://github.com/CodeForFire/FwAssist
| Kategorie | Tools |
| Kontakt-E-Mail | *(vom Play-Konto)* |
| Website | `https://codeforfire.github.io/` |
| Datenschutzerklärung | *(noch anzulegen)* |
| Datenschutzerklärung | `https://codeforfire.github.io/fwassist/datenschutz/` |

## Hinweise für die Prüfung (App-Zugriff → Anleitung)

Expand Down
12 changes: 10 additions & 2 deletions src/FwAssist.AppLogic/ViewModels/AboutViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ public AboutViewModel(IExternalLinks links, string appVersion)

public string RepositoryText { get; init; } = "https://www.github.com/codeforfire/FwAssist";

/// <summary>The Datenschutzerklärung, which Google Play requires to be reachable inside the app.</summary>
public string PrivacyPolicyText { get; init; } = "https://codeforfire.github.io/fwassist/datenschutz/";

/// <summary>Why the link did not open, in German; <see langword="null"/> when it did.</summary>
[ObservableProperty]
private string? _error;
Expand All @@ -32,9 +35,14 @@ public AboutViewModel(IExternalLinks links, string appVersion)
public void Refresh() => Error = null;

[RelayCommand]
private void OpenRepository()
private void OpenRepository() => Open(RepositoryText);

[RelayCommand]
private void OpenPrivacyPolicy() => Open(PrivacyPolicyText);

private void Open(string address)
{
Error = HttpUrlValidator.TryGetHttpUri(RepositoryText, out var uri) && _links.TryOpen(uri)
Error = HttpUrlValidator.TryGetHttpUri(address, out var uri) && _links.TryOpen(uri)
? null
: "Link konnte nicht geöffnet werden.";
}
Expand Down
23 changes: 17 additions & 6 deletions src/FwAssist.Ui/Views/AboutView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,28 @@
<TextBlock x:Name="Version" Classes="mono" Text="{Binding VersionText}" />
</StackPanel>
<TextBlock Classes="secondary" TextWrapping="Wrap" Text="Ein Projekt von CodeForFire" />
<Button x:Name="RepositoryLink" HorizontalAlignment="Stretch"
HorizontalContentAlignment="Left"
MinHeight="{StaticResource ControlHeight}"
Command="{Binding OpenRepositoryCommand}"
AutomationProperties.Name="Projekt auf GitHub öffnen">
<TextBlock Text="{Binding RepositoryText}" TextWrapping="Wrap" />
</Button>
<!-- Google Play requires the privacy policy to be reachable inside the app. -->
<StackPanel Spacing="4">
<Button x:Name="RepositoryLink" HorizontalAlignment="Stretch"
<TextBlock Classes="overline" Text="DATENSCHUTZ" />
<TextBlock Classes="secondary" TextWrapping="Wrap"
Text="Kein Konto, keine Werbung, keine Telemetrie. Den Standort speichert und sendet die App nie." />
<Button x:Name="PrivacyPolicyLink" HorizontalAlignment="Stretch"
HorizontalContentAlignment="Left"
MinHeight="{StaticResource ControlHeight}"
Command="{Binding OpenRepositoryCommand}"
AutomationProperties.Name="Projekt auf GitHub öffnen">
<TextBlock Text="{Binding RepositoryText}" TextWrapping="Wrap" />
Command="{Binding OpenPrivacyPolicyCommand}"
AutomationProperties.Name="Datenschutzerklärung öffnen">
<TextBlock Text="{Binding PrivacyPolicyText}" TextWrapping="Wrap" />
</Button>
<TextBlock x:Name="Error" Classes="field-error" Text="{Binding Error}"
IsVisible="{Binding Error, Converter={x:Static ObjectConverters.IsNotNull}}" />
</StackPanel>
<TextBlock x:Name="Error" Classes="field-error" Text="{Binding Error}"
IsVisible="{Binding Error, Converter={x:Static ObjectConverters.IsNotNull}}" />
<TextBlock Classes="secondary" TextWrapping="Wrap" Text="Veröffentlicht unter der MIT-Lizenz." />
<TextBlock Classes="secondary" TextWrapping="Wrap" Text="Copyright (C) 2026 Christian Arlt" />
</StackPanel>
Expand Down
7 changes: 7 additions & 0 deletions tests/FwAssist.Acceptance.Tests/DemoFlowRenderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,13 @@ public void Info_on_the_home_screen_opens_the_about_page()
Assert.Contains("Copyright (C) 2026 Christian Arlt", texts);
Assert.True(phone.Window.GetVisualDescendants().OfType<Button>().Single(b => b.Name == "RepositoryLink").Bounds.Height >= 48);

// Google Play wants the privacy policy reachable inside the app, not only on the listing.
Assert.Contains("DATENSCHUTZ", texts);
Assert.Contains("https://codeforfire.github.io/fwassist/datenschutz/", texts);
var privacy = phone.Window.GetVisualDescendants().OfType<Button>().Single(b => b.Name == "PrivacyPolicyLink");
Assert.True(privacy.IsEffectivelyVisible);
Assert.True(privacy.Bounds.Height >= 48, $"the privacy link is {privacy.Bounds.Height} high");

phone.Capture("11-info.png");
}

Expand Down
33 changes: 33 additions & 0 deletions tests/FwAssist.AppLogic.Tests/AboutViewModelTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,39 @@ public void An_address_that_is_not_http_never_reaches_the_platform()
Assert.Equal(Failed, about.Error);
}

[Fact]
public void The_privacy_link_opens_the_privacy_policy()
{
var about = About();

about.OpenPrivacyPolicyCommand.Execute(null);

Assert.Equal(new Uri("https://codeforfire.github.io/fwassist/datenschutz/"), Assert.Single(_links.Opened));
Assert.Null(about.Error);
}

[Fact]
public void A_privacy_link_the_platform_cannot_open_says_so()
{
_links.Refuse = true;
var about = About();

about.OpenPrivacyPolicyCommand.Execute(null);

Assert.Equal(Failed, about.Error);
}

[Fact]
public void A_privacy_address_that_is_not_http_never_reaches_the_platform()
{
var about = new AboutViewModel(_links, "1.2.3") { PrivacyPolicyText = "javascript:alert(1)" };

about.OpenPrivacyPolicyCommand.Execute(null);

Assert.Empty(_links.Opened);
Assert.Equal(Failed, about.Error);
}

[Fact]
public void A_null_version_is_refused() =>
Assert.Throws<ArgumentNullException>(() => new AboutViewModel(_links, null!));
Expand Down