Skip to content

Commit

Permalink
Added support Win 11 build 25120
Browse files Browse the repository at this point in the history
400 => 266
401 => 267
402 => 268
  • Loading branch information
Inestic committed May 26, 2022
1 parent 9e4d206 commit f727108
Show file tree
Hide file tree
Showing 5 changed files with 135 additions and 107 deletions.
13 changes: 9 additions & 4 deletions SophiApp/SophiApp/Customisations/CustomisationConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ internal static class CustomisationConstants
internal const byte _261_DISABLED_VALUE = 1;
internal const string _261_DISALLOW_WINDOWS_SHAKE = "DisallowShaking";
internal const byte _261_ENABLED_VALUE = 0;
internal const int _263_MIN_SUPPORTED_VERSION = 22509;
internal const byte _266_DISABLED_VALUE = 1;
internal const string _266_HIDE_ADDED_APPS = "HideRecentlyAddedApps";
internal const string _267_APP_SUGGESTIONS = "SubscribedContent-338388Enabled";
internal const byte _302_STORAGE_POLICY_MONTH_VALUE = 30;
internal const string _304_STORAGE_POLICY_04 = "04";
internal const byte _305_ENABLED_VALUE = 1;
Expand Down Expand Up @@ -211,9 +215,6 @@ internal static class CustomisationConstants
internal const string _349_VC_REDISTRX64_UNINSTALL_ARGS = "/uninstall /passive /norestart";
internal const string _349_VC_VERSION_URL = "https://raw.githubusercontent.com/aaronparker/vcredist/main/VcRedist/VisualCRedistributables.json";
internal const string _349_VERSION_NAME = "Version";
internal const byte _400_DISABLED_VALUE = 1;
internal const string _400_HIDE_ADDED_APPS = "HideRecentlyAddedApps";
internal const string _401_APP_SUGGESTIONS = "SubscribedContent-338388Enabled";
internal const string _500_ADGUARD_LINK = "https://store.rg-adguard.net/api/GetFiles";
internal const string _500_HEVC_APPX_NAME = "Microsoft.HEVCVideoExtension_x64__8wekyb3d8bbwe.Appx";
internal const string _500_HEVC_LINK = "https://github.com/Sophia-Community/SophiApp/raw/master/AppX/Microsoft.HEVCVideoExtension_x64__8wekyb3d8bbwe.Appx";
Expand Down Expand Up @@ -656,6 +657,10 @@ function MinimizeWindow
internal const string SIUF_PATH = @"SOFTWARE\Microsoft\Siuf\Rules";
internal const string SIUF_PERIOD = "NumberOfSIUFInPeriod";
internal const string SOPHIA_SCRIPT_SCHEDULED_PATH = "Sophia Script";
internal const string START_LAYOUT = "Start_Layout";
internal const byte START_LAYOUT_DEFAULT_VALUE = 0;
internal const byte START_LAYOUT_PINS_VALUE = 1;
internal const byte START_LAYOUT_RECOMMENDATIONS_VALUE = 2;
internal const string START_PANEL_EXPLORER_PATH = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel";
internal const string STARTUP_PAGE = "StartupPage";
internal const byte STARTUP_PAGE_CATEGORY_VALUE = 0;
Expand Down Expand Up @@ -691,9 +696,9 @@ function MinimizeWindow
internal const string X64 = "x64";
internal static readonly string _203_WIN10_EXPLORER_INPROC_PATH = $@"{_203_WIN10_EXPLORER_PATH}\InprocServer32";
internal static readonly DateTime _21_PM_TASK_START = DateTime.Today.AddHours(21);
internal static readonly string _268_POWERSHELL_LNK = $@"{Environment.GetEnvironmentVariable("APPDATA")}\Microsoft\Windows\Start Menu\Programs\Windows PowerShell\Windows PowerShell.lnk";
internal static readonly string _315_DELIVERY_OPT_PATH = $@"{Environment.GetEnvironmentVariable("SystemRoot")}\SoftwareDistribution\DeliveryOptimization";
internal static readonly string _348_INSTALLER_PATH = $@"{Environment.GetEnvironmentVariable("SystemRoot")}\Installer";
internal static readonly string _402_POWERSHELL_LNK = $@"{Environment.GetEnvironmentVariable("APPDATA")}\Microsoft\Windows\Start Menu\Programs\Windows PowerShell\Windows PowerShell.lnk";

internal static readonly Dictionary<string, string> _500_ADGUARD_WEB_PARAMS = new Dictionary<string, string>()
{
Expand Down
73 changes: 44 additions & 29 deletions SophiApp/SophiApp/Customisations/CustomisationOs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,50 @@ public static void _258(bool IsChecked)
: _261_DISABLED_VALUE,
RegistryValueKind.DWord);

public static void _263(bool _) => RegHelper.SetValue(RegistryHive.CurrentUser,
ADVANCED_EXPLORER_PATH,
START_LAYOUT,
START_LAYOUT_DEFAULT_VALUE);

public static void _264(bool _) => RegHelper.SetValue(RegistryHive.CurrentUser,
ADVANCED_EXPLORER_PATH,
START_LAYOUT,
START_LAYOUT_PINS_VALUE);

public static void _265(bool _) => RegHelper.SetValue(RegistryHive.CurrentUser,
ADVANCED_EXPLORER_PATH,
START_LAYOUT,
START_LAYOUT_RECOMMENDATIONS_VALUE);

public static void _266(bool IsChecked)
{
if (IsChecked)
{
RegHelper.DeleteKey(RegistryHive.LocalMachine, POLICIES_EXPLORER_PATH, _266_HIDE_ADDED_APPS);
return;
}

RegHelper.SetValue(RegistryHive.LocalMachine, POLICIES_EXPLORER_PATH, _266_HIDE_ADDED_APPS, _266_DISABLED_VALUE, RegistryValueKind.DWord);
}

public static void _267(bool IsChecked)
{
if (IsChecked)
{
RegHelper.SetValue(RegistryHive.CurrentUser, CONTENT_DELIVERY_MANAGER_PATH, _267_APP_SUGGESTIONS, ENABLED_VALUE, RegistryValueKind.DWord);
return;
}

RegHelper.SetValue(RegistryHive.CurrentUser, CONTENT_DELIVERY_MANAGER_PATH, _267_APP_SUGGESTIONS, DISABLED_VALUE, RegistryValueKind.DWord);
}

public static void _268(bool IsChecked)
{
var bytes = File.ReadAllBytes(_268_POWERSHELL_LNK);
bytes[0x15] = (byte)(IsChecked ? bytes[0x15] | 0x20 : bytes[0x15] ^ 0x20);
File.WriteAllBytes(_268_POWERSHELL_LNK, bytes);
}

public static void _300(bool IsChecked) => RegHelper.SetValue(RegistryHive.CurrentUser,
STORAGE_POLICY_PATH,
STORAGE_POLICY_01,
Expand Down Expand Up @@ -907,35 +951,6 @@ public static void _355(bool _)
}
}

public static void _400(bool IsChecked)
{
if (IsChecked)
{
RegHelper.DeleteKey(RegistryHive.LocalMachine, POLICIES_EXPLORER_PATH, _400_HIDE_ADDED_APPS);
return;
}

RegHelper.SetValue(RegistryHive.LocalMachine, POLICIES_EXPLORER_PATH, _400_HIDE_ADDED_APPS, _400_DISABLED_VALUE, RegistryValueKind.DWord);
}

public static void _401(bool IsChecked)
{
if (IsChecked)
{
RegHelper.SetValue(RegistryHive.CurrentUser, CONTENT_DELIVERY_MANAGER_PATH, _401_APP_SUGGESTIONS, ENABLED_VALUE, RegistryValueKind.DWord);
return;
}

RegHelper.SetValue(RegistryHive.CurrentUser, CONTENT_DELIVERY_MANAGER_PATH, _401_APP_SUGGESTIONS, DISABLED_VALUE, RegistryValueKind.DWord);
}

public static void _402(bool IsChecked)
{
var bytes = File.ReadAllBytes(_402_POWERSHELL_LNK);
bytes[0x15] = (byte)(IsChecked ? bytes[0x15] | 0x20 : bytes[0x15] ^ 0x20);
File.WriteAllBytes(_402_POWERSHELL_LNK, bytes);
}

public static void _500(bool IsChecked)
{
if (IsChecked)
Expand Down
20 changes: 14 additions & 6 deletions SophiApp/SophiApp/Customisations/CustomisationStatus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,20 @@ public static bool _259() => RegHelper.GetNullableIntValue(RegistryHive.CurrentU

public static bool _261() => RegHelper.GetNullableIntValue(RegistryHive.CurrentUser, ADVANCED_EXPLORER_PATH, _261_DISALLOW_WINDOWS_SHAKE) != ENABLED_VALUE;

public static bool _263() => OsHelper.GetVersion().Build >= _263_MIN_SUPPORTED_VERSION
? RegHelper.GetNullableIntValue(RegistryHive.CurrentUser, ADVANCED_EXPLORER_PATH, START_LAYOUT) == START_LAYOUT_DEFAULT_VALUE
: throw new WindowsEditionNotSupportedException();

public static bool _264() => RegHelper.GetNullableIntValue(RegistryHive.CurrentUser, ADVANCED_EXPLORER_PATH, START_LAYOUT) == START_LAYOUT_PINS_VALUE;

public static bool _265() => RegHelper.GetNullableIntValue(RegistryHive.CurrentUser, ADVANCED_EXPLORER_PATH, START_LAYOUT) == START_LAYOUT_RECOMMENDATIONS_VALUE;

public static bool _266() => RegHelper.GetNullableIntValue(RegistryHive.LocalMachine, POLICIES_EXPLORER_PATH, _266_HIDE_ADDED_APPS) != _266_DISABLED_VALUE;

public static bool _267() => RegHelper.GetNullableIntValue(RegistryHive.CurrentUser, CONTENT_DELIVERY_MANAGER_PATH, _267_APP_SUGGESTIONS) == ENABLED_VALUE;

public static bool _268() => (File.ReadAllBytes(_268_POWERSHELL_LNK)[0x15] == 2).Invert();

public static bool _300() => RegHelper.GetNullableIntValue(RegistryHive.CurrentUser, STORAGE_POLICY_PATH, STORAGE_POLICY_01)
.HasNullOrValue(DISABLED_VALUE)
.Invert();
Expand Down Expand Up @@ -429,12 +443,6 @@ public static bool _355() => VisualRedistrLibsHelper.IsInstalled()
? false
: throw new VisualRedistrLibsNotInstalled();

public static bool _400() => RegHelper.GetNullableIntValue(RegistryHive.LocalMachine, POLICIES_EXPLORER_PATH, _400_HIDE_ADDED_APPS) != _400_DISABLED_VALUE;

public static bool _401() => RegHelper.GetNullableIntValue(RegistryHive.CurrentUser, CONTENT_DELIVERY_MANAGER_PATH, _401_APP_SUGGESTIONS) == ENABLED_VALUE;

public static bool _402() => (File.ReadAllBytes(_402_POWERSHELL_LNK)[0x15] == 2).Invert();

public static bool _500() => HttpHelper.IsOnline
? UwpHelper.PackageExist(UWP_MS_WIN_PHOTOS)
? UwpHelper.PackageExist(_500_UWP_HEVC_VIDEO)
Expand Down
134 changes: 67 additions & 67 deletions SophiApp/SophiApp/Resources/UIData.json
Original file line number Diff line number Diff line change
Expand Up @@ -1949,6 +1949,72 @@
"Windows10Supported": false,
"Windows11Supported": true
},
{
"Id": 266,
"Header": {
"EN": "Show recently added apps in the Start menu",
"RU": "Показывать недавно добавленные приложения в меню \"Пуск\"",
"DE": "Zuletzt hinzugefügte Apps im Startmenü anzeigen",
"UA": "Відображати нещодавно додані додатки в меню \"Пуск\"",
"IT": "Mostra app aggiunte di recente nel menu Start"
},
"Description": {
"EN": "",
"RU": "",
"DE": "",
"UA": "",
"IT": ""
},
"Type": "CheckBox",
"Tag": "StartMenu",
"ViewId": 266,
"Windows10Supported": true,
"Windows11Supported": false
},
{
"Id": 267,
"Header": {
"EN": "Show app suggestions in the Start menu",
"RU": "Показывать рекомендации в меню \"Пуск\"",
"DE": "App-Vorschläge im Startmenü anzeigen",
"UA": "Відображати рекомендації в меню \"Пуск\"",
"IT": "Mostra suggerimenti app nel menu Start"
},
"Description": {
"EN": "",
"RU": "",
"DE": "",
"UA": "",
"IT": ""
},
"Type": "CheckBox",
"Tag": "StartMenu",
"ViewId": 267,
"Windows10Supported": true,
"Windows11Supported": false
},
{
"Id": 268,
"Header": {
"EN": "Run the Windows PowerShell shortcut from the Start menu as Administrator",
"RU": "Запускать ярлык Windows PowerShell в меню \"Пуск\" от имени Администратора",
"DE": "Windows PowerShell als Administrator im Startmenü ausführen",
"UA": "Запускати ярлик Windows PowerShell у меню \"Пуск\" від імені Адміністратора",
"IT": "Eseguire il collegamento di Windows PowerShell dal menu Start come amministratore"
},
"Description": {
"EN": "",
"RU": "",
"DE": "",
"UA": "",
"IT": ""
},
"Type": "CheckBox",
"Tag": "StartMenu",
"ViewId": 268,
"Windows10Supported": true,
"Windows11Supported": true
},
{
"Id": 300,
"Header": {
Expand Down Expand Up @@ -3059,72 +3125,6 @@
"Windows10Supported": true,
"Windows11Supported": true
},
{
"Id": 400,
"Header": {
"EN": "Show recently added apps in the Start menu",
"RU": "Показывать недавно добавленные приложения в меню \"Пуск\"",
"DE": "Zuletzt hinzugefügte Apps im Startmenü anzeigen",
"UA": "Відображати нещодавно додані додатки в меню \"Пуск\"",
"IT": "Mostra app aggiunte di recente nel menu Start"
},
"Description": {
"EN": "",
"RU": "",
"DE": "",
"UA": "",
"IT": ""
},
"Type": "CheckBox",
"Tag": "StartMenu",
"ViewId": 400,
"Windows10Supported": true,
"Windows11Supported": false
},
{
"Id": 401,
"Header": {
"EN": "Show app suggestions in the Start menu",
"RU": "Показывать рекомендации в меню \"Пуск\"",
"DE": "App-Vorschläge im Startmenü anzeigen",
"UA": "Відображати рекомендації в меню \"Пуск\"",
"IT": "Mostra suggerimenti app nel menu Start"
},
"Description": {
"EN": "",
"RU": "",
"DE": "",
"UA": "",
"IT": ""
},
"Type": "CheckBox",
"Tag": "StartMenu",
"ViewId": 401,
"Windows10Supported": true,
"Windows11Supported": false
},
{
"Id": 402,
"Header": {
"EN": "Run the Windows PowerShell shortcut from the Start menu as Administrator",
"RU": "Запускать ярлык Windows PowerShell в меню \"Пуск\" от имени Администратора",
"DE": "Windows PowerShell als Administrator im Startmenü ausführen",
"UA": "Запускати ярлик Windows PowerShell у меню \"Пуск\" від імені Адміністратора",
"IT": "Eseguire il collegamento di Windows PowerShell dal menu Start come amministratore"
},
"Description": {
"EN": "",
"RU": "",
"DE": "",
"UA": "",
"IT": ""
},
"Type": "CheckBox",
"Tag": "StartMenu",
"ViewId": 402,
"Windows10Supported": true,
"Windows11Supported": true
},
{
"Id": 500,
"Header": {
Expand Down Expand Up @@ -4318,4 +4318,4 @@
"Windows10Supported": true,
"Windows11Supported": false
}
]
]
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public bool Invoke()
var ubr = OsHelper.GetUpdateBuildRevision();
var build = OsHelper.GetBuild();
var hasProblem = OsHelper.IsWindows11()
? ubr >= OsHelper.WIN11_MIN_SUPPORTED_UBR || build >= OsHelper.WIN11_MIN_SUPPORTED_INSIDER_BUILD
? build >= OsHelper.WIN11_MIN_SUPPORTED_BUILD
: ubr >= OsHelper.WIN10_MIN_SUPPORTED_UBR;

return HasProblem = hasProblem.Invert();
Expand Down

0 comments on commit f727108

Please sign in to comment.