Skip to content

Commit

Permalink
Unify codebase (#6)
Browse files Browse the repository at this point in the history
* Simplify root directory

* Rename solution

* Add `ReboundDefrag`

* Add `ReboundDiskCleanup`

* Add `ReboundRun`

* Add `ReboundSysInfo`

* Add `ReboundTpm`

* Add `ReboundWinver`

* Change namespaces

* Format `.gitignore`

* Simplify app directory names
  • Loading branch information
Lamparter authored Oct 5, 2024
1 parent 229a253 commit 1da4b2d
Show file tree
Hide file tree
Showing 597 changed files with 9,801 additions and 188 deletions.
4 changes: 2 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@
#*.PDF diff=astextplain
#*.rtf diff=astextplain
#*.RTF diff=astextplain
/Rebound11Files/AppPackages/ReboundDefrag.msix filter=lfs diff=lfs merge=lfs -text
D:/Ivirius[[:space:]]Community/Source[[:space:]]Code/Current[[:space:]]Apps/Rebound[[:space:]]Hub/ReboundHub/Rebound11Files/Executables/QuickFullComputerCleanup.exe filter=lfs diff=lfs merge=lfs -text
/Rebound11Files/AppPackages/Rebound.Defrag.msix filter=lfs diff=lfs merge=lfs -text
D:/Ivirius[[:space:]]Community/Source[[:space:]]Code/Current[[:space:]]Apps/Rebound[[:space:]]Hub/Rebound/Rebound11Files/Executables/QuickFullComputerCleanup.exe filter=lfs diff=lfs merge=lfs -text
*.msix filter=lfs diff=lfs merge=lfs -text
File renamed without changes.
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore

# Custom files

/Rebound/Rebound11Files/Executables/Quick Full Computer Cleanup.exe
/Rebound/Rebound11Files/Executables/QuickFullComputerCleanup.exe

# User-specific files
*.rsuser
*.suo
Expand Down Expand Up @@ -361,5 +366,3 @@ MigrationBackup/

# Fody - auto-generated XML schema
FodyWeavers.xsd
/ReboundHub/Rebound11Files/Executables/Quick Full Computer Cleanup.exe
/ReboundHub/Rebound11Files/Executables/QuickFullComputerCleanup.exe
16 changes: 16 additions & 0 deletions About/App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<Application
x:Class="Rebound.About.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Rebound.About">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />
<!-- Other merged dictionaries here -->
</ResourceDictionary.MergedDictionaries>
<!-- Other app resources here -->
</ResourceDictionary>
</Application.Resources>
</Application>
50 changes: 50 additions & 0 deletions About/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Controls.Primitives;
using Microsoft.UI.Xaml.Data;
using Microsoft.UI.Xaml.Input;
using Microsoft.UI.Xaml.Media;
using Microsoft.UI.Xaml.Navigation;
using Microsoft.UI.Xaml.Shapes;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.ApplicationModel;
using Windows.ApplicationModel.Activation;
using Windows.Foundation;
using Windows.Foundation.Collections;

// To learn more about WinUI, the WinUI project structure,
// and more about our project templates, see: http://aka.ms/winui-project-info.

namespace Rebound.About
{
/// <summary>
/// Provides application-specific behavior to supplement the default Application class.
/// </summary>
public partial class App : Application
{
/// <summary>
/// Initializes the singleton application object. This is the first line of authored code
/// executed, and as such is the logical equivalent of main() or WinMain().
/// </summary>
public App()
{
this.InitializeComponent();
}

/// <summary>
/// Invoked when the application is launched.
/// </summary>
/// <param name="args">Details about the launch request and process.</param>
protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs args)
{
m_window = new MainWindow();
m_window.Activate();
}

private Window m_window;
}
}
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
70 changes: 70 additions & 0 deletions About/MainWindow.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<?xml version="1.0" encoding="utf-8"?>
<winuiex:WindowEx
x:Class="Rebound.About.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Rebound.About"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:winuiex="using:WinUIEx"
mc:Ignorable="d">
<Grid>
<StackPanel Orientation="Horizontal" Spacing="75" VerticalAlignment="Top" HorizontalAlignment="Center" Margin="-15" x:Name="WinverPanel">
<Path VerticalAlignment="Center" Data="M 0 1 C 0 0.5 0.5 0 1 0 L 7 0 L 7 7 L 0 7 M 1 6 M 8 0 L 14 0 C 14.5 0 15 0.5 15 1 L 15 7 L 8 7 M 9 6 M 7 8 L 0 8 L 0 14 C 0 14.5 0.5 15 1 15 L 7 15 M 6 14 M 8 8 L 15 8 L 15 14 C 15 14.5 14.5 15 14 15 L 8 15 M 9 14 M 0 0 L 16 16">
<Path.Fill>
<LinearGradientBrush StartPoint="0, 0" EndPoint="1, 1">
<LinearGradientBrush.GradientStops>
<GradientStop Color="#a8f4ff"/>
<GradientStop Color="#0073d5" Offset="1"/>
</LinearGradientBrush.GradientStops>
</LinearGradientBrush>
</Path.Fill>
<Path.RenderTransform>
<ScaleTransform ScaleX="5" ScaleY="5"/>
</Path.RenderTransform>
</Path>
<TextBlock Text="Windows 11" x:Name="WindowsVer" FontSize="45" FontWeight="Bold" VerticalAlignment="Center" Margin="0, 50, 0, 0"/>
</StackPanel>
<InfoBar IsOpen="True" Margin="15, 150, 15, 0" IsClosable="False" Title="Microsoft Windows">
<StackPanel Margin="0, 0, 25, 25">
<TextBlock Text="Version" x:Name="Version" TextWrapping="WrapWholeWords"/>
<TextBlock Text="© Microsoft Corporation. All rights reserved."/>
<TextBlock Text=" "/>
<TextBlock Text="The Windows 11 Pro operating system and its user interface are protected by trademark and other pending or existing intellectual property rights in the United States and other countries/regions." x:Name="LegalStuff" TextWrapping="WrapWholeWords"/>
<TextBlock Text=" "/>
<TextBlock>
<Run Text="This product is licensed under the" />
<Hyperlink NavigateUri="https://support.microsoft.com/en-us/windows/microsoft-software-license-terms-e26eedad-97a2-5250-2670-aad156b654bd">
<Run Text="Microsoft Software License Terms"/>
</Hyperlink>
<Run Text="to:" />
</TextBlock>
<TextBlock Text="Le" x:Name="User"/>
</StackPanel>
</InfoBar>
<InfoBar IsOpen="True" Margin="15, 410, 15, 0" IsClosable="False" Title="Rebound 11">
<StackPanel Margin="0, 0, 25, 25">
<TextBlock Text="Version 0.0.3 ALPHA" TextWrapping="WrapWholeWords" x:Name="ReboundVer"/>
<TextBlock Text=" "/>
<TextBlock Text="Rebound 11 is a Windows mod that does not interfere with the system. The current Windows installation contains additional apps to run Rebound 11." TextWrapping="WrapWholeWords"/>
</StackPanel>
</InfoBar>
<Border Grid.ColumnSpan="2" BorderThickness="0,1,0,0" Height="75" Background="{ThemeResource SystemControlBackgroundAltMediumLowBrush}" BorderBrush="#338A8A8A" VerticalAlignment="Bottom"/>
<Grid Grid.ColumnSpan="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="8"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="8"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Button Grid.Column="2" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Content="Legacy winver" Margin="0, 20, 0, 20" Click="Button_Click"/>
<Button Grid.Column="4" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Content="Close" Margin="0, 20, 20, 20" Click="Button_Click_1"/>
<Button Grid.Column="0" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Margin="20, 20, 0, 20" Content="Copy" Click="Button_Click_2">
<Button.KeyboardAccelerators>
<KeyboardAccelerator Modifiers="Control" Key="C" IsEnabled="True"/>
</Button.KeyboardAccelerators>
</Button>
</Grid>
</Grid>
</winuiex:WindowEx>
168 changes: 168 additions & 0 deletions About/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Media;
using Microsoft.Win32;
using System;
using System.Diagnostics;
using System.Linq;
using System.Management;
using System.Threading.Tasks;
using Windows.ApplicationModel.DataTransfer;
using WinUIEx;

namespace Rebound.About
{
public sealed partial class MainWindow : WindowEx
{
public MainWindow()
{
this.InitializeComponent();
this.AppWindow.DefaultTitleBarShouldMatchAppModeTheme = true;
this.IsMaximizable = false;
this.IsMinimizable = false;
this.MinWidth = 650;
this.MoveAndResize(25, 25, 650, 690);
this.Title = "About Windows";
this.IsResizable = false;
this.SystemBackdrop = new MicaBackdrop();
this.SetIcon($"{AppContext.BaseDirectory}\\Assets\\Rebound.ico");
User.Text = GetCurrentUserName();
Version.Text = GetDetailedWindowsVersion();
LegalStuff.Text = GetLegalInfo();
Load();
}

public async void Load()
{
await Task.Delay(100);

this.SetWindowSize(WinverPanel.ActualWidth + 60, 690);
}

public static string GetDetailedWindowsVersion()
{
try
{
// Open the registry key
using (var key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion"))
{
if (key != null)
{
// Retrieve build number and revision
var versionName = key.GetValue("DisplayVersion", "Unknown") as string;
var buildNumber = key.GetValue("CurrentBuildNumber", "Unknown") as string;
var buildLab = key.GetValue("UBR", "Unknown");

return $"Version {versionName} (OS Build {buildNumber}.{buildLab})";
}
}
}
catch (Exception ex)
{
return $"Error retrieving OS version details: {ex.Message}";
}

return "Registry key not found";
}

public string GetLegalInfo()
{
try
{
var searcher = new ManagementObjectSearcher("SELECT * FROM Win32_OperatingSystem");

foreach (ManagementObject os in searcher.Get().Cast<ManagementObject>())
{
var caption = os["Caption"];
var version = os["Version"];
var buildNumber = os["BuildNumber"];

if (caption.ToString().Contains("10")) windowsVer = "Windows 10";
else windowsVer = "Windows 11";

WindowsVer.Text = caption.ToString().Replace("Microsoft ", "");

return $"The {caption.ToString().Replace("Microsoft ", "")} operating system and its user interface are protected by trademark and other pending or existing intellectual property rights in the United States and other countries/regions.";
}
}
catch (Exception ex)
{
return $"Error retrieving OS edition details: {ex.Message}";
}

return "WMI query returned no results";
}

public static string GetCurrentUserName()
{
try
{
// Open the registry key
using (var key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion"))
{
if (key != null)
{
// Retrieve build number and revision
var owner = key.GetValue("RegisteredOwner", "Unknown") as string;

return owner;
}
}
}
catch (Exception ex)
{
return $"Error retrieving OS version details: {ex.Message}";
}

return "Registry key not found";
}

private async void Button_Click(object sender, RoutedEventArgs e)
{
var info = new ProcessStartInfo()
{
FileName = "powershell",
Arguments = "winver",
UseShellExecute = false,
CreateNoWindow = true
};

var proc = Process.Start(info);

await proc.WaitForExitAsync();

Close();
}

private void Button_Click_1(object sender, RoutedEventArgs e)
{
Close();
}

string windowsVer = "Windows";

private void Button_Click_2(object sender, RoutedEventArgs e)
{
string content = $@"==========================
---Microsoft {windowsVer}---
==========================
{GetDetailedWindowsVersion()}
� Microsoft Corporation. All rights reserved.
{GetLegalInfo()}
This product is licensed under the [Microsoft Software License Terms] (https://support.microsoft.com/en-us/windows/microsoft-software-license-terms-e26eedad-97a2-5250-2670-aad156b654bd) to: {GetCurrentUserName()}
==========================
--------Rebound 11--------
==========================
{ReboundVer.Text}
Rebound 11 is a Windows mod that does not interfere with the system. The current Windows installation contains additional apps to run Rebound 11.";
var package = new DataPackage();
package.SetText(content);
Clipboard.SetContent(package);
}
}
}
52 changes: 52 additions & 0 deletions About/Package.appxmanifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="utf-8"?>

<Package
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
IgnorableNamespaces="uap rescap">

<Identity
Name="039b9731-7b33-49de-bb09-5b81d5978d1c"
Publisher="CN=Ivirius"
Version="0.0.3.0" />

<mp:PhoneIdentity PhoneProductId="039b9731-7b33-49de-bb09-5b81d5978d1c" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>

<Properties>
<DisplayName>Rebound.About</DisplayName>
<PublisherDisplayName>Lenovo</PublisherDisplayName>
<Logo>Assets\StoreLogo.png</Logo>
</Properties>

<Dependencies>
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.17763.0" MaxVersionTested="10.0.19041.0" />
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.17763.0" MaxVersionTested="10.0.19041.0" />
</Dependencies>

<Resources>
<Resource Language="x-generate"/>
</Resources>

<Applications>
<Application Id="App"
Executable="$targetnametoken$.exe"
EntryPoint="$targetentrypoint$">
<uap:VisualElements
DisplayName="Rebound Winver"
Description="Rebound Winver"
BackgroundColor="transparent"
Square150x150Logo="Assets\Square150x150Logo.png"
Square44x44Logo="Assets\Square44x44Logo.png"
AppListEntry="none">
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png" Square71x71Logo="Assets\SmallTile.png" Square310x310Logo="Assets\LargeTile.png"/>
<uap:SplashScreen Image="Assets\SplashScreen.png" />
</uap:VisualElements>
</Application>
</Applications>

<Capabilities>
<rescap:Capability Name="runFullTrust" />
</Capabilities>
</Package>
10 changes: 10 additions & 0 deletions About/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"profiles": {
"Rebound.About (Package)": {
"commandName": "MsixPackage"
},
"Rebound.About (Unpackaged)": {
"commandName": "Project"
}
}
}
Loading

0 comments on commit 1da4b2d

Please sign in to comment.