Compare commits

..
Author SHA1 Message Date
RMBGAME b40dac00b9 🐛 修复战网安装有多个存在时保存账号闪退问题 2024-12-01 01:18:46 +08:00
Aigio Liu 35be6db96e 🔖 rc.13 2024-12-01 00:39:38 +08:00
RMBGAME 35641d5c79 🐛 修复战网账号切换对旧版本数据支持问题 2024-11-30 20:57:44 +08:00
Aigio Liu 07f1a9f43b 🐛 CLR: Assert failure(PID 16164 [0x00003f24], Thread: 8032 [0x1f60]): !AreShadowStacksEnabled() || UseSpecialUserModeApc()
File: D:\a\_work\1\s\src\coreclr\vm\threads.cpp:7938 Image:
2024-11-30 12:49:45 +08:00
Mossimo 002e550149 ✨ 设置 macOS 菜单 2024-11-29 17:27:55 +08:00
10 changed files with 85 additions and 7 deletions
+1 -1
View File
@@ -21,7 +21,7 @@ public static partial class AssemblyInfo
/// <summary>
/// RC 版本号,范围 0~9,只增不减
/// </summary>
const string ver_for_rc = "12";
const string ver_for_rc = "13";
public const string FileVersion = $"{Version2}.{ver_for_rc}1{ver_for_preview}.0";
+3 -1
View File
@@ -4,10 +4,12 @@
<dict>
<key>CFBundleName</key>
<string>Watt Toolkit</string>
<key>CFBundleDisplayName</key>
<string>Watt Toolkit</string>
<key>CFBundleShortVersionString</key>
<string>3.0.0</string>
<key>CFBundleVersion</key>
<string>3.0.0.0</string>
<string>3.0.1219.0</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
@@ -175,6 +175,10 @@ partial class Program
{
RenderingMode = GetRenderingMode().ToArray(),
});
builder.With(new MacOSPlatformOptions
{
DisableDefaultApplicationMenuItems = true,
});
#elif LINUX
builder.With(new X11PlatformOptions
{
@@ -13,8 +13,16 @@ public sealed partial class App : Application
public App()
{
Name = AssemblyInfo.Trademark;
OpenBrowserCommand = ReactiveCommand.Create<object?>(OpenBrowserCommandCore);
CopyToClipboardCommand = ReactiveCommand.Create<object?>(CopyToClipboardCommandCore);
#if MACOS
var menus = new NativeMenu();
menus.Add(new NativeMenuItem { Header = Strings.Settings, Command = ReactiveCommand.Create(() => { INavigationService.Instance.Navigate(typeof(SettingsPage)); }) });
menus.Add(new NativeMenuItemSeparator());
menus.Add(new NativeMenuItem { Header = Strings.Exit, Command = ReactiveCommand.Create(() => { Shutdown(); }) });
NativeMenu.SetMenu(this, menus);
#endif
}
/// <summary>
@@ -91,6 +91,12 @@
CommandParameter="{Binding Data.AssemblyLocation}"
Content="{Binding Path=Res.Plugin_OpenFolder, Mode=OneWay, Source={x:Static s:ResourceService.Current}}"
IsClickEnabled="True" />
<ui:SettingsExpanderItem
ActionIconSource="Open"
Command="{Binding $parent[spp:Settings_Plugin].((spp:SettingsPageViewModel)DataContext).OpenPluginCacheDirectory_Click}"
CommandParameter="{Binding Data.AppDataDirectory}"
Content="{Binding Path=Res.Plugin_OpenAppDataFolder, Mode=OneWay, Source={x:Static s:ResourceService.Current}}"
IsClickEnabled="True" />
<ui:SettingsExpanderItem
ActionIconSource="Open"
Command="{Binding $parent[spp:Settings_Plugin].((spp:SettingsPageViewModel)DataContext).OpenPluginCacheDirectory_Click}"
@@ -1,5 +1,6 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System.Text.Json.Nodes;
using AppResources = BD.WTTS.Client.Resources.Strings;
namespace BD.WTTS.Services.Implementation;
@@ -82,7 +83,8 @@ public sealed class BasicPlatformSwitcher : IPlatformSwitcher
var selector = accFile.Split("::")[2];
if (!JTokenHelper.ReplaceVarInJsonFile(path, selector, jToken))
{
Toast.Show(ToastIcon.Error, AppResources.Error_ModifyJsonFileFailed);
//Toast.Show(ToastIcon.Error, AppResources.Error_ModifyJsonFileFailed);
Log.Error(nameof(BasicPlatformSwitcher), $"Failed to modify JSON file: {path}");
//return false;
}
continue;
@@ -179,7 +181,7 @@ public sealed class BasicPlatformSwitcher : IPlatformSwitcher
{
var path = uniqueIdFile.Split("::")[0];
var selector = uniqueIdFile.Split("::")[1];
JTokenHelper.ReplaceVarInJsonFile(path, selector, "");
JTokenHelper.ReplaceVarInJsonFile(path, selector, string.Empty);
}
if (platform.UniqueIdType != UniqueIdType.CREATE_ID_FILE) return true;
@@ -514,7 +516,47 @@ public sealed class BasicPlatformSwitcher : IPlatformSwitcher
if (js == null)
continue;
var originalValue = js.SelectToken(selector);
JToken? originalValue = null;
try
{
originalValue = js.SelectToken(selector);
}
catch (Exception ex)
{
Log.Error(nameof(CurrnetUserAdd), ex, $"Failed to select token: {selector}");
}
if (originalValue == null)
{
// 尝试以数组形式再次寻找
try
{
var tokens = js.SelectTokens(selector);
//暂时将就写一个临时的战网处理方法解决问题
if (platform.Platform == ThirdpartyPlatform.BattleNet)
{
originalValue = tokens.FirstOrDefault(x =>
{
var temp = x.Parent?.Parent?.Parent?.Parent?["Path"]?.Value<string>();
var temp2 = platform.FolderPath;
if (temp != null && temp2 != null)
return string.Equals(
temp.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar),
temp2.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar),
StringComparison.OrdinalIgnoreCase);
return false;
});
}
originalValue ??= tokens.FirstOrDefault();
}
catch (Exception ex)
{
Log.Error(nameof(CurrnetUserAdd), ex, $"Failed to select tokens: {selector}");
}
}
if (originalValue == null)
continue;
@@ -148,7 +148,10 @@
"PlatformIds": [ "b", "bnet", "battlenet", "blizzard" ],
"DefaultExePath": "%ProgramFiles(x86)%\\Battle.net\\Battle.net.exe",
"ExesToEnd": [ "Battle.net" ],
"ClearPaths": [ "SAME_AS_LOGIN_FILES" ],
"ClearPaths": [
"JSON_SELECT_FIRST,::%AppData%\\Battle.net\\Battle.net.config::$.Client.SavedAccountNames",
"%AppData%\\Battle.net\\WattToolkit.id"
],
"LoginFiles": {
"JSON_SELECT_FIRST,::%AppData%\\Battle.net\\Battle.net.config::$.Client.SavedAccountNames": "email.json",
"JSON_SELECT_FIRST,::%AppData%\\Battle.net\\Battle.net.config::$..Services.LastLoginRegion": "LastLoginRegion",
+9
View File
@@ -5414,6 +5414,15 @@ namespace BD.WTTS.Client.Resources {
}
}
/// <summary>
/// 查找类似 打开插件 AppData 文件夹 的本地化字符串。
/// </summary>
public static string Plugin_OpenAppDataFolder {
get {
return ResourceManager.GetString("Plugin_OpenAppDataFolder", resourceCulture);
}
}
/// <summary>
/// 查找类似 打开插件缓存文件夹 的本地化字符串。
/// </summary>
@@ -2267,6 +2267,9 @@
</data>
<data name="Plugin_OpenCacheFolder" xml:space="preserve">
<value>打开插件缓存文件夹</value>
</data>
<data name="Plugin_OpenAppDataFolder" xml:space="preserve">
<value>打开插件 AppData 文件夹</value>
</data>
<data name="Plugin_OpenFolder" xml:space="preserve">
<value>打开插件文件夹</value>
+2 -1
View File
@@ -23,7 +23,8 @@
<ValidateExecutableReferencesMatchSelfContained>false</ValidateExecutableReferencesMatchSelfContained>
<Deterministic>true</Deterministic>
<CheckEolWorkloads>false</CheckEolWorkloads>
<DefineConstants>REMOVE_DNS_INTERCEPT;$(DefineConstants)</DefineConstants>
<!--<DefineConstants>REMOVE_DNS_INTERCEPT;$(DefineConstants)</DefineConstants>-->
<CETCompat>false</CETCompat>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\AssemblyInfo.cs">