This commit is contained in:
龙腾猫跃
2026-05-21 01:15:20 +08:00
parent 8c3896da36
commit c86fdc3af1
36 changed files with 275 additions and 255 deletions
@@ -3,7 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:PCL;assembly="
x:Name="PanBack" Height="44"
RenderTransformOrigin="0.5,0.5" Background="{StaticResource ColorBrushSemiTransparent}" SnapsToDevicePixels="True" Cursor="Hand">
RenderTransformOrigin="0.5,0.5" Background="{StaticResource ColorBrushSemiTransparent}" SnapsToDevicePixels="True">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="6" />
<ColumnDefinition Width="34" />
@@ -222,6 +222,15 @@
<StackPanel Margin="30,0,0,0" x:Name="PanOptionsSaves"
Visibility="{Binding Checked, ElementName=CheckOptionsSaves, Converter={StaticResource BooleanToVisibilityConverter}}">
</StackPanel>
<local:MyCheckBox>
<local:MyCheckBox.Tag>
<local:ExportOption
Title="协议"
Description="Licence 文件"
Rules="LICEN*"
DefaultChecked="True" />
</local:MyCheckBox.Tag>
</local:MyCheckBox>
<local:MyCheckBox>
<local:MyCheckBox.Tag>
<local:ExportOption
@@ -119,7 +119,7 @@ Public Class PageInstanceExport
If Rule.StartsWithF("!") Then Return False '只看正向规则
'检查前两级
Try
If AllEntries.Any(Function(Entry) Entry Like Rule) Then Return True
If AllEntries.Any(Function(Entry) Entry.Lower Like Rule.Lower) Then Return True
Catch ex As Exception
Logger.Error(ex, $"错误的规则:{Rule}", LogBehavior.Toast)
Return False
@@ -482,7 +482,7 @@ Public Class PageInstanceExport
Dim ShouldKeep As Boolean = False
For Each Rule In AllRules
Dim Revert = Rule.StartsWithF("!")
If RelativePath Like Rule.TrimStart("!") Then ShouldKeep = Not Revert
If RelativePath.Lower Like Rule.TrimStart("!").Lower Then ShouldKeep = Not Revert
Next
If Not ShouldKeep Then Continue For
Dim TargetPath As String = OverridesFolder & RelativePath
@@ -641,7 +641,7 @@ Public Class PageInstanceExport
Dim ModFile As LocalResourceFile = Pair.Key
Files.Add(New JObject From {
{"path", PathUtils.RemoveExtendedPrefix(ModFile.File.FullName).AfterFirst(OverridesFolder).Replace("\", "/")},
{"hashes", New JObject From {{"sha1", ModFile.ModrinthHash}, {"sha512", HashUtils.ComputeFromFile(ModFile.File.FullName, HashUtils.HashMethod.Sha512)}}},
{"hashes", New JObject From {{"sha1", ModFile.ModrinthHash}, {"sha512", CryptographyUtils.ComputeFileHash(ModFile.File.FullName, CryptographyUtils.HashMethod.Sha512)}}},
{"downloads", New JArray(Pair.Value.OrderBy(Function(u) u.Contains("modrinth.com")))}, '不优先选择 Modrinth
{"fileSize", ModFile.File.Length}
})
@@ -483,7 +483,7 @@ Install:
If FileUtils.Exists(NewPath) Then
If FileUtils.Exists(ModEntity.File.FullName) Then
'同时存在两个名称的 Mod
If HashUtils.ComputeFromFile(ModEntity.File.FullName, HashUtils.HashMethod.Md5) <> HashUtils.ComputeFromFile(NewPath, HashUtils.HashMethod.Md5) Then
If CryptographyUtils.ComputeFileHash(ModEntity.File.FullName) <> CryptographyUtils.ComputeFileHash(NewPath) Then
MyMsgBox($"目前同时存在启用和禁用的两个 Mod 文件:{vbCrLf} - {PathUtils.GetLastPart(NewPath)}{vbCrLf} - {ModEntity.File.Name}{vbCrLf}{vbCrLf}注意,这两个文件的内容并不相同。{vbCrLf}在手动删除或重命名其中一个文件后,才能继续操作。", "存在文件冲突")
Continue For
End If
@@ -608,8 +608,8 @@ Install:
Next
For Each Entry As KeyValuePair(Of String, String) In FileCopyList
If FileUtils.Exists(Entry.Value) Then
FileUtils.Delete(Entry.Value, True)
Logger.Warn($"更新后的 Mod 文件已存在,将会把它放入回收站:{Entry.Value}")
FileUtils.Delete(Entry.Value, True)
End If
If DirectoryUtils.Exists(PathUtils.RemoveLastPart(Entry.Value)) Then
FileUtils.Move(Entry.Key, Entry.Value)
@@ -723,18 +723,10 @@ Install:
End If
'显示结果提示
If Not IsSuccessful Then Return
If IsShiftPressed Then
If ModList.IsSingle Then
Hint($"已彻底删除 {ModList.Single.File.Name}!", HintType.Green)
Else
Hint($"已彻底删除 {ModList.Count} 个文件!", HintType.Green)
End If
If ModList.IsSingle Then
Hint($"已删除 {ModList.Single.File.Name}!", HintType.Green)
Else
If ModList.IsSingle Then
Hint($"已将 {ModList.Single.File.Name} 删除到回收站!", HintType.Green)
Else
Hint($"已将 {ModList.Count} 个文件删除到回收站!", HintType.Green)
End If
Hint($"已删除 {ModList.Count} 个文件!", HintType.Green)
End If
Catch ex As OperationCanceledException
Logger.Warn(ex, "删除 Mod 被主动取消")
@@ -149,7 +149,7 @@
RunInThread(
Sub()
Try
Hint("正在刷新头像……")
Hint("正在刷新皮肤……")
'清空缓存
Logger.Info("正在清空皮肤缓存")
If DirectoryUtils.Exists(PathTemp & "Cache\Skin") Then DirectoryUtils.Delete(PathTemp & "Cache\Skin")
@@ -162,7 +162,7 @@
For Each SkinLoader In If(sender IsNot Nothing, {sender}, {PageLaunchLeft.SkinLegacy, PageLaunchLeft.SkinMs})
SkinLoader.WaitForExit(IsForceRestart:=True)
Next
Hint("已刷新头像!", HintType.Green)
Hint("已刷新皮肤!", HintType.Green)
Catch ex As Exception
Logger.Error(ex, "刷新皮肤缓存失败", LogBehavior.Alert)
End Try
@@ -216,13 +216,13 @@
Hint("登录失败,无法更改披风!", HintType.Red)
Return
End If
Hint("正在获取披风列表,请稍候……")
If McLoginMsLoader.State <> LoadState.Finished Then Hint("正在获取披风列表,请稍候……")
IsChanging = True
'开始实际获取
RunInNewThread(
Sub()
Try
Retry:
Try
'获取登录信息
If McLoginMsLoader.State <> LoadState.Finished Then McLoginMsLoader.WaitForExit(PageLoginMsSkin.GetLoginData())
If McLoginMsLoader.State <> LoadState.Finished Then
@@ -256,7 +256,7 @@ Retry:
Next
SelectedIndex = MyMsgBoxSelect(SelectionControl, "选择披风", "确定", "取消")
Catch ex As Exception
Logger.Error(ex, "获取玩家披风列表失败")
Logger.Error(ex, "获取玩家皮肤列表失败")
End Try
End Sub)
If SelectedIndex Is Nothing Then Return
@@ -279,7 +279,29 @@ Retry:
McLoginMsLoader.Output.ProfileJson = SkinData.ToString()
End If
Catch ex As Exception
Logger.Error(ex, "更改披风失败", LogBehavior.Toast)
If TypeOf ex Is HttpRequestCodeException Then
Dim requestException As HttpRequestCodeException = CType(ex, HttpRequestCodeException)
Select Case requestException.StatusCode
Case HttpStatusCode.BadRequest
Logger.Warn(ex, "更改披风时遭遇 400 错误")
If requestException.Response?.Contains("""error""") Then
Hint("更改披风失败:" & GetJson(requestException.Response)("error").ToString, HintType.Red)
Return
ElseIf requestException.Response?.Contains("""errorMessage""") Then
Hint("更改披风失败:" & GetJson(requestException.Response)("errorMessage").ToString, HintType.Red)
Return
End If
Case HttpStatusCode.Unauthorized
Logger.Warn(ex, "更改披风时遭遇 401 错误")
Hint("正在重新登录,将在登录后自动更改披风……")
McLoginMsLoader.Start(PageLoginMsSkin.GetLoginData(), IsForceRestart:=True)
GoTo Retry
End Select
ElseIf ex.IsBadNetwork Then
Hint("更改披风失败:连接 Mojang 服务器超时,请稍后再试,或使用 VPN 改善网络环境", HintType.Red)
Else
Logger.Error(ex, "更改披风失败", LogBehavior.Toast)
End If
Finally
IsChanging = False
End Try
@@ -170,7 +170,7 @@ Public Class PageLaunchRight
Settings.Set("CacheSavedPageVersion", Version)
FileUtils.Write(PathTemp & "Cache\Custom.xaml", FileContent)
'若内容变更则要求刷新
If LoadedContentHash <> FileContent.GetHashCode() AndAlso ShouldRefresh Then Refresh()
If LoadedContentHash <> FileContent.GetStableHashCode() AndAlso ShouldRefresh Then Refresh()
Catch ex As Exception
Logger.Error(ex, $"下载主页失败({Address})", If(ModeDebug, LogBehavior.Alert, LogBehavior.Toast))
End Try
@@ -196,7 +196,7 @@ Public Class PageLaunchRight
''' 清空主页缓存信息。
''' </summary>
Private Sub ClearCache()
LoadedContentHash = -1
LoadedContentHash = Nothing
OnlineLoader.Input = ("", True)
Settings.Set("CacheSavedPageUrl", "")
Settings.Set("CacheSavedPageVersion", "")
@@ -211,7 +211,7 @@ Public Class PageLaunchRight
Try
SyncLock LoadContentLock
'如果加载目标内容一致则不加载
Dim Hash = If(Content, "").GetHashCode()
Dim Hash = If(Content, "").GetStableHashCode()
If Hash = LoadedContentHash Then Return
LoadedContentHash = Hash
'实际加载内容
@@ -261,7 +261,7 @@ Public Class PageLaunchRight
OnLoadContentFailed(e.Exception)
End Sub
Private LoadedContentHash As Integer = -1
Private LoadedContentHash As ULong? = Nothing
Private LoadContentLock As New Object
#End Region
@@ -23,11 +23,11 @@
<local:MyIconButton.ContextMenu>
<ContextMenu Closed="HidePanel" HorizontalOffset="10" VerticalOffset="18">
<local:MyMenuItem Click="BtnSkinEdit_Click" Header="修改皮肤"/>
<local:MyMenuItem Click="BtnSkinRefresh_Click" Header="刷新皮肤"/>
<local:MyMenuItem Click="BtnSkinSave_Click" Header="保存皮肤文件"/>
<Separator />
<local:MyMenuItem Click="BtnSkinCape_Click" Header="修改披风"/>
<Separator />
<local:MyMenuItem Click="BtnSkinRefresh_Click" Header="刷新"/>
<local:MyMenuItem Click="BtnSkinCapeRefresh_Click" Header="刷新披风列表"/>
</ContextMenu>
</local:MyIconButton.ContextMenu>
</local:MyIconButton>
@@ -18,8 +18,8 @@
''' <summary>
''' 获取当前页面的登录信息。
''' </summary>
Public Shared Function GetLoginData(Optional IgnoreState As Boolean = False) As McLoginMs
If IgnoreState OrElse McLoginMsLoader.State = LoadState.Finished Then
Public Shared Function GetLoginData() As McLoginMs
If McLoginMsLoader.State = LoadState.Finished Then
Return New McLoginMs With {.OAuthRefreshToken = Settings.Get(Of String)("CacheMsV2OAuthRefresh"), .UserName = Settings.Get(Of String)("CacheMsV2Name"), .AccessToken = Settings.Get(Of String)("CacheMsV2Access"), .Uuid = Settings.Get(Of String)("CacheMsV2Uuid"), .ProfileJson = Settings.Get(Of String)("CacheMsV2ProfileJson")}
Else
Return New McLoginMs With {.OAuthRefreshToken = Settings.Get(Of String)("CacheMsV2OAuthRefresh"), .UserName = Settings.Get(Of String)("CacheMsV2Name")}
@@ -105,9 +105,6 @@ Retry:
Hint("正在重新登录,将在登录后自动更改皮肤……")
McLoginMsLoader.Start(GetLoginData(), IsForceRestart:=True)
GoTo Retry
ElseIf Result.Contains("""error""") Then
Hint("更改皮肤失败:" & GetJson(Result)("error").ToString, HintType.Red)
Return
End If
'获取新皮肤地址
Logger.Info($"皮肤修改返回值:{vbCrLf}{Result}")
@@ -121,13 +118,26 @@ Retry:
Next
Throw New Exception("未知错误(" & Result & ")")
Catch ex As Exception
If ex.IsBadNetwork Then
Hint("更改皮肤失败:连接皮肤服务器超时,请稍后再试,或使用 VPN 改善网络环境", HintType.Red)
ElseIf TypeOf ex Is HttpRequestCodeException AndAlso CType(ex, HttpRequestCodeException).StatusCode = HttpStatusCode.Unauthorized Then
Logger.Warn(ex, "更改皮肤时遭遇 401 错误")
Hint("正在重新登录,将在登录后自动更改皮肤……")
McLoginMsLoader.Start(GetLoginData(), IsForceRestart:=True)
GoTo Retry
If TypeOf ex Is HttpRequestCodeException Then
Dim requestException As HttpRequestCodeException = CType(ex, HttpRequestCodeException)
Select Case requestException.StatusCode
Case HttpStatusCode.BadRequest
Logger.Warn(ex, "更改皮肤时遭遇 400 错误")
If requestException.Response?.Contains("""error""") Then
Hint("更改皮肤失败:" & GetJson(requestException.Response)("error").ToString, HintType.Red)
Return
ElseIf requestException.Response?.Contains("""errorMessage""") Then
Hint("更改皮肤失败:" & GetJson(requestException.Response)("errorMessage").ToString, HintType.Red)
Return
End If
Case HttpStatusCode.Unauthorized
Logger.Warn(ex, "更改皮肤时遭遇 401 错误")
Hint("正在重新登录,将在登录后自动更改皮肤……")
McLoginMsLoader.Start(GetLoginData(), IsForceRestart:=True)
GoTo Retry
End Select
ElseIf ex.IsBadNetwork Then
Hint("更改皮肤失败:连接 Mojang 服务器超时,请稍后再试,或使用 VPN 改善网络环境", HintType.Red)
Else
Logger.Error(ex, "更改皮肤失败", LogBehavior.Toast)
End If
@@ -151,6 +161,24 @@ Retry:
Skin.BtnSkinCape_Click()
End Sub
'刷新披风
Public Sub BtnSkinCapeRefresh_Click(sender As Object, e As RoutedEventArgs)
RunInThread(
Sub()
Try
Hint("正在刷新披风列表……")
If McLaunchLoader.State = LoadState.Loading Then
McLoginMsLoader.WaitForExit()
Else
McLoginMsLoader.WaitForExit(GetLoginData(), IsForceRestart:=True)
End If
Hint("已刷新披风列表!", HintType.Green)
Catch ex As Exception
Logger.Error(ex, "刷新披风列表失败", LogBehavior.Toast)
End Try
End Sub)
End Sub
#End Region
End Class
@@ -522,7 +522,7 @@ Public Class PageLinkMain
'获取启动参数
Dim Arguments As String = ServerConfig("Link")("Argument")
Arguments += $" --network-name={NetworkName} --network-secret={NetworkSecret} --listeners {ListenersPort} --rpc-portal {RPCPort} --private-mode true"
Dim HostName = If(IsServerSide, "Server-", "Client-") & Math.Abs(Identify.GetHashCode).ConvertRadix(36)
Dim HostName = If(IsServerSide, "Server-", "Client-") & Identify.GetStableHashCode().ConvertRadix(36).TrimStart("-"c).EnsureLength("0", 6)
If IsServerSide Then
Arguments += $" -i 10.114.114.114 --hostname={HostName} --tcp-whitelist={ServerPort} --udp-whitelist={ServerPort}"
Else
@@ -123,6 +123,7 @@
<TextBlock Margin="0,1.5,6,0" Text="IT" />
<TextBlock Margin="0,1.5,6,0" Text="卓" />
<TextBlock Margin="0,1.5,6,0" Text="玖" />
<TextBlock Margin="0,1.5,6,0" Text="自" />
<TextBlock Margin="0,1.5,6,0" Text="辰" />
<TextBlock Margin="0,1.5,6,0" Text="顺" />
<TextBlock Margin="0,1.5,6,0" Text="茧" />
@@ -150,6 +151,8 @@
<TextBlock Margin="0,1.5,6,0" Text="柒ᝰ" />
<TextBlock Margin="0,1.5,6,0" Text="廖" />
<TextBlock Margin="0,1.5,6,0" Text="烨" />
<TextBlock Margin="0,1.5,6,0" Text="煌" />
<TextBlock Margin="0,1.5,6,0" Text="雲" />
<TextBlock Margin="0,1.5,6,0" Text="yu" />
<TextBlock Margin="0,1.5,6,0" Text="💬" />
<TextBlock Margin="0,1.5,6,0" Text="7%" />
@@ -164,7 +167,9 @@
<TextBlock Margin="0,1.5,6,0" Text="PFF" />
<TextBlock Margin="0,1.5,6,0" Text="ZYL" />
<TextBlock Margin="0,1.5,6,0" Text="LSP" />
<TextBlock Margin="0,1.5,6,0" Text="110" />
<TextBlock Margin="0,1.5,6,0" Text="Van" />
<TextBlock Margin="0,1.5,6,0" Text="TKK" />
<TextBlock Margin="0,1.5,6,0" Text="hhh" />
<TextBlock Margin="0,1.5,6,0" Text="bbb" />
<TextBlock Margin="0,1.5,6,0" Text="阿宅" />
@@ -179,6 +184,7 @@
<TextBlock Margin="0,1.5,6,0" Text="沐清" />
<TextBlock Margin="0,1.5,6,0" Text="阳仔" />
<TextBlock Margin="0,1.5,6,0" Text="吸管" />
<TextBlock Margin="0,1.5,6,0" Text="灭宇" />
<TextBlock Margin="0,1.5,6,0" Text="冰块" />
<TextBlock Margin="0,1.5,6,0" Text="莫林" />
<TextBlock Margin="0,1.5,6,0" Text="Gun" />
@@ -198,6 +204,7 @@
<TextBlock Margin="0,1.5,6,0" Text="白芷" />
<TextBlock Margin="0,1.5,6,0" Text="汤圆" />
<TextBlock Margin="0,1.5,6,0" Text="黑猫" />
<TextBlock Margin="0,1.5,6,0" Text="言慎" />
<TextBlock Margin="0,1.5,6,0" Text="柠檬" />
<TextBlock Margin="0,1.5,6,0" Text="愚者" />
<TextBlock Margin="0,1.5,6,0" Text="久蛊" />
@@ -236,25 +243,40 @@
<TextBlock Margin="0,1.5,6,0" Text="玄狐" />
<TextBlock Margin="0,1.5,6,0" Text="tusk" />
<TextBlock Margin="0,1.5,6,0" Text="星甲" />
<TextBlock Margin="0,1.5,6,0" Text="亚心" />
<TextBlock Margin="0,1.5,6,0" Text="千羽" />
<TextBlock Margin="0,1.5,6,0" Text="阿勺" />
<TextBlock Margin="0,1.5,6,0" Text="小鱼" />
<TextBlock Margin="0,1.5,6,0" Text="白杨" />
<TextBlock Margin="0,1.5,6,0" Text="蜼鸣" />
<TextBlock Margin="0,1.5,6,0" Text="皮皮" />
<TextBlock Margin="0,1.5,6,0" Text="YmY" />
<TextBlock Margin="0,1.5,6,0" Text="Enss" />
<TextBlock Margin="0,1.5,6,0" Text="ZHH" />
<TextBlock Margin="0,1.5,6,0" Text="z666" />
<TextBlock Margin="0,1.5,6,0" Text="GUO" />
<TextBlock Margin="0,1.5,6,0" Text="gino" />
<TextBlock Margin="0,1.5,6,0" Text="luoo" />
<TextBlock Margin="0,1.5,6,0" Text="9787" />
<TextBlock Margin="0,1.5,6,0" Text="Ilyen" />
<TextBlock Margin="0,1.5,6,0" Text="1950" />
<TextBlock Margin="0,1.5,6,0" Text="QAQ" />
<TextBlock Margin="0,1.5,6,0" Text="AL76" />
<TextBlock Margin="0,1.5,6,0" Text="WAR" />
<TextBlock Margin="0,1.5,6,0" Text="yfble" />
<TextBlock Margin="0,1.5,6,0" Text="。_。" />
<TextBlock Margin="0,1.5,6,0" Text="vbird" />
<TextBlock Margin="0,1.5,6,0" Text="空调c" />
<TextBlock Margin="0,1.5,6,0" Text="Brant" />
<TextBlock Margin="0,1.5,6,0" Text="⁣    ​" />
<TextBlock Margin="0,1.5,6,0" Text="RKRK" />
<TextBlock Margin="0,1.5,6,0" Text="Neko" />
<TextBlock Margin="0,1.5,6,0" Text="verge" />
<TextBlock Margin="0,1.5,6,0" Text="ciel希" />
<TextBlock Margin="0,1.5,6,0" Text="Tarka" />
<TextBlock Margin="0,1.5,6,0" Text="Elysia" />
<TextBlock Margin="0,1.5,6,0" Text="onlye" />
<TextBlock Margin="0,1.5,6,0" Text="Spark" />
<TextBlock Margin="0,1.5,6,0" Text="Eiligo" />
<TextBlock Margin="0,1.5,6,0" Text="友人A" />
<TextBlock Margin="0,1.5,6,0" Text="jiagar" />
@@ -266,6 +288,7 @@
<TextBlock Margin="0,1.5,6,0" Text="ToTxT" />
<TextBlock Margin="0,1.5,6,0" Text="HzzzT" />
<TextBlock Margin="0,1.5,6,0" Text="EAger" />
<TextBlock Margin="0,1.5,6,0" Text="fufulb" />
<TextBlock Margin="0,1.5,6,0" Text="ziqian" />
<TextBlock Margin="0,1.5,6,0" Text="kunsir" />
<TextBlock Margin="0,1.5,6,0" Text="LiarCT" />
@@ -273,11 +296,15 @@
<TextBlock Margin="0,1.5,6,0" Text="Lloora" />
<TextBlock Margin="0,1.5,6,0" Text="咕咕柒" />
<TextBlock Margin="0,1.5,6,0" Text="xuque" />
<TextBlock Margin="0,1.5,6,0" Text="绮晓络" />
<TextBlock Margin="0,1.5,6,0" Text="希希希" />
<TextBlock Margin="0,1.5,6,0" Text="飞猪侠" />
<TextBlock Margin="0,1.5,6,0" Text="门东山" />
<TextBlock Margin="0,1.5,6,0" Text="流星陨" />
<TextBlock Margin="0,1.5,6,0" Text="狐猫喵" />
<TextBlock Margin="0,1.5,6,0" Text="祤之锌" />
<TextBlock Margin="0,1.5,6,0" Text="柳贯一" />
<TextBlock Margin="0,1.5,6,0" Text="汐月语" />
<TextBlock Margin="0,1.5,6,0" Text="徐炳文" />
<TextBlock Margin="0,1.5,6,0" Text="大鱻鱼" />
<TextBlock Margin="0,1.5,6,0" Text="颠修钩" />
@@ -323,6 +350,17 @@
<TextBlock Margin="0,1.5,6,0" Text="陈两仪" />
<TextBlock Margin="0,1.5,6,0" Text="叶辛梓" />
<TextBlock Margin="0,1.5,6,0" Text="窗锁昼" />
<TextBlock Margin="0,1.5,6,0" Text="泠晖晖" />
<TextBlock Margin="0,1.5,6,0" Text="悠悠子" />
<TextBlock Margin="0,1.5,6,0" Text="Kiheki" />
<TextBlock Margin="0,1.5,6,0" Text="顾冉竹" />
<TextBlock Margin="0,1.5,6,0" Text="小化哥" />
<TextBlock Margin="0,1.5,6,0" Text="27A03" />
<TextBlock Margin="0,1.5,6,0" Text="白逍遥" />
<TextBlock Margin="0,1.5,6,0" Text="陈钫浩" />
<TextBlock Margin="0,1.5,6,0" Text="滑稽君" />
<TextBlock Margin="0,1.5,6,0" Text="悔轮台" />
<TextBlock Margin="0,1.5,6,0" Text="懒洋洋" />
<TextBlock Margin="0,1.5,6,0" Text="ITMTX" />
<TextBlock Margin="0,1.5,6,0" Text="SEKGY" />
<TextBlock Margin="0,1.5,6,0" Text="111sui" />
@@ -343,11 +381,13 @@
<TextBlock Margin="0,1.5,6,0" Text="cmly03" />
<TextBlock Margin="0,1.5,6,0" Text="jiduhui" />
<TextBlock Margin="0,1.5,6,0" Text="424241" />
<TextBlock Margin="0,1.5,6,0" Text="Rig_kill" />
<TextBlock Margin="0,1.5,6,0" Text="XIruotE" />
<TextBlock Margin="0,1.5,6,0" Text="Dr.Ayin" />
<TextBlock Margin="0,1.5,6,0" Text="onlong" />
<TextBlock Margin="0,1.5,6,0" Text="zuozhe" />
<TextBlock Margin="0,1.5,6,0" Text="Secular" />
<TextBlock Margin="0,1.5,6,0" Text="之苏ing" />
<TextBlock Margin="0,1.5,6,0" Text="zxxxfan" />
<TextBlock Margin="0,1.5,6,0" Text="MY17IT" />
<TextBlock Margin="0,1.5,6,0" Text="張 懙 李" />
@@ -367,6 +407,7 @@
<TextBlock Margin="0,1.5,6,0" Text="Flawless" />
<TextBlock Margin="0,1.5,6,0" Text="Buyihan" />
<TextBlock Margin="0,1.5,6,0" Text="我不在线" />
<TextBlock Margin="0,1.5,6,0" Text="憨憨剑踏" />
<TextBlock Margin="0,1.5,6,0" Text="跳水的鱼" />
<TextBlock Margin="0,1.5,6,0" Text="咸鱼雷音" />
<TextBlock Margin="0,1.5,6,0" Text="云映鹤影" />
@@ -374,12 +415,15 @@
<TextBlock Margin="0,1.5,6,0" Text="气息荒古" />
<TextBlock Margin="0,1.5,6,0" Text="milenter" />
<TextBlock Margin="0,1.5,6,0" Text="霜木翔凤" />
<TextBlock Margin="0,1.5,6,0" Text="丨丨丨丨" />
<TextBlock Margin="0,1.5,6,0" Text="唐吉課德" />
<TextBlock Margin="0,1.5,6,0" Text="童年的梦" />
<TextBlock Margin="0,1.5,6,0" Text="时灵风逝" />
<TextBlock Margin="0,1.5,6,0" Text="望月悠月" />
<TextBlock Margin="0,1.5,6,0" Text="三金知日" />
<TextBlock Margin="0,1.5,6,0" Text="有事掘坟" />
<TextBlock Margin="0,1.5,6,0" Text="爱源神!" />
<TextBlock Margin="0,1.5,6,0" Text="亮黑晚钟" />
<TextBlock Margin="0,1.5,6,0" Text="鸡鸡鸡鸡" />
<TextBlock Margin="0,1.5,6,0" Text="阿元颜月" />
<TextBlock Margin="0,1.5,6,0" Text="不想社交" />
@@ -390,6 +434,7 @@
<TextBlock Margin="0,1.5,6,0" Text="凌瑶雪莹" />
<TextBlock Margin="0,1.5,6,0" Text="wswsing" />
<TextBlock Margin="0,1.5,6,0" Text="漆黑噤默" />
<TextBlock Margin="0,1.5,6,0" Text="爆炎龙王" />
<TextBlock Margin="0,1.5,6,0" Text="云水莫伊" />
<TextBlock Margin="0,1.5,6,0" Text="孤星隐耀" />
<TextBlock Margin="0,1.5,6,0" Text="蓝莓蛋糕" />
@@ -427,8 +472,14 @@
<TextBlock Margin="0,1.5,6,0" Text="阿克华孜" />
<TextBlock Margin="0,1.5,6,0" Text="yunwuyi" />
<TextBlock Margin="0,1.5,6,0" Text="落幕星空" />
<TextBlock Margin="0,1.5,6,0" Text="黑耀黄昏" />
<TextBlock Margin="0,1.5,6,0" Text="金木萧雨" />
<TextBlock Margin="0,1.5,6,0" Text="隔壁的熊" />
<TextBlock Margin="0,1.5,6,0" Text="星辰彼方" />
<TextBlock Margin="0,1.5,6,0" Text="霜笙雪落" />
<TextBlock Margin="0,1.5,6,0" Text="muming" />
<TextBlock Margin="0,1.5,6,0" Text="纸币ORZ" />
<TextBlock Margin="0,1.5,6,0" Text="Thorium" />
<TextBlock Margin="0,1.5,6,0" Text="西蛮qwq" />
<TextBlock Margin="0,1.5,6,0" Text="nyanmjc" />
<TextBlock Margin="0,1.5,6,0" Text="J_danzai" />
@@ -443,6 +494,7 @@
<TextBlock Margin="0,1.5,6,0" Text="xiaoyuya" />
<TextBlock Margin="0,1.5,6,0" Text="N3W04H" />
<TextBlock Margin="0,1.5,6,0" Text="久遠 蓮華" />
<TextBlock Margin="0,1.5,6,0" Text="小山7132" />
<TextBlock Margin="0,1.5,6,0" Text="HHHbbb" />
<TextBlock Margin="0,1.5,6,0" Text="Whelone" />
<TextBlock Margin="0,1.5,6,0" Text="Beholder" />
@@ -457,6 +509,7 @@
<TextBlock Margin="0,1.5,6,0" Text="CHLSama" />
<TextBlock Margin="0,1.5,6,0" Text="wanglizhi" />
<TextBlock Margin="0,1.5,6,0" Text="chen0701" />
<TextBlock Margin="0,1.5,6,0" Text="FXXKGUN" />
<TextBlock Margin="0,1.5,6,0" Text="江寒_John" />
<TextBlock Margin="0,1.5,6,0" Text="bentianjia" />
<TextBlock Margin="0,1.5,6,0" Text="yukihomu" />
@@ -469,6 +522,7 @@
<TextBlock Margin="0,1.5,6,0" Text="飞天大锅饭" />
<TextBlock Margin="0,1.5,6,0" Text="烟熏秋刀鱼" />
<TextBlock Margin="0,1.5,6,0" Text="人海不可爱" />
<TextBlock Margin="0,1.5,6,0" Text="安静不会错" />
<TextBlock Margin="0,1.5,6,0" Text="摆地摊的王" />
<TextBlock Margin="0,1.5,6,0" Text="团结起来!" />
<TextBlock Margin="0,1.5,6,0" Text="BeiWu_CN" />
@@ -496,14 +550,19 @@
<TextBlock Margin="0,1.5,6,0" Text="落雨乄北辰" />
<TextBlock Margin="0,1.5,6,0" Text="一条闲鲨鱼" />
<TextBlock Margin="0,1.5,6,0" Text="一只木元鸽" />
<TextBlock Margin="0,1.5,6,0" Text="这是江江叭" />
<TextBlock Margin="0,1.5,6,0" Text="柒月贰拾捌" />
<TextBlock Margin="0,1.5,6,0" Text="kiboAlong" />
<TextBlock Margin="0,1.5,6,0" Text="W.D.gaster" />
<TextBlock Margin="0,1.5,6,0" Text="星野源.小毅" />
<TextBlock Margin="0,1.5,6,0" Text="Kimonomc" />
<TextBlock Margin="0,1.5,6,0" Text="翎安Lingan" />
<TextBlock Margin="0,1.5,6,0" Text="Michael_蒋" />
<TextBlock Margin="0,1.5,6,0" Text="Stevens520" />
<TextBlock Margin="0,1.5,6,0" Text="123456。?" />
<TextBlock Margin="0,1.5,6,0" Text="蛋白质_变质" />
<TextBlock Margin="0,1.5,6,0" Text="LMY666888" />
<TextBlock Margin="0,1.5,6,0" Text="青灯诗酒Lily" />
<TextBlock Margin="0,1.5,6,0" Text="sheng_1062" />
<TextBlock Margin="0,1.5,6,0" Text="Zerovaluelh" />
<TextBlock Margin="0,1.5,6,0" Text="JUST LIKE IT" />
@@ -511,6 +570,7 @@
<TextBlock Margin="0,1.5,6,0" Text="一叶,知秋~" />
<TextBlock Margin="0,1.5,6,0" Text="joinwick789" />
<TextBlock Margin="0,1.5,6,0" Text="250的敌敌畏" />
<TextBlock Margin="0,1.5,6,0" Text="-ET0RN1TY-" />
<TextBlock Margin="0,1.5,6,0" Text="forever_晨风" />
<TextBlock Margin="0,1.5,6,0" Text="Fakecaptain" />
<TextBlock Margin="0,1.5,6,0" Text="C.肥宅快乐水" />
@@ -518,6 +578,7 @@
<TextBlock Margin="0,1.5,6,0" Text="while(true){}" />
<TextBlock Margin="0,1.5,6,0" Text="Haobot2026" />
<TextBlock Margin="0,1.5,6,0" Text="粉色妖精小姐" />
<TextBlock Margin="0,1.5,6,0" Text="打包还是带走" />
<TextBlock Margin="0,1.5,6,0" Text="Romarunner" />
<TextBlock Margin="0,1.5,6,0" Text="双狼天下第一" />
<TextBlock Margin="0,1.5,6,0" Text="丿地狱天使丿" />
@@ -528,16 +589,19 @@
<TextBlock Margin="0,1.5,6,0" Text="这位是非人类" />
<TextBlock Margin="0,1.5,6,0" Text="红白巫女です" />
<TextBlock Margin="0,1.5,6,0" Text="吃满保底之人" />
<TextBlock Margin="0,1.5,6,0" Text="转电表的霍格" />
<TextBlock Margin="0,1.5,6,0" Text="Sylph_茜尔芙" />
<TextBlock Margin="0,1.5,6,0" Text="dadadadada" />
<TextBlock Margin="0,1.5,6,0" Text="longmao666" />
<TextBlock Margin="0,1.5,6,0" Text="Awolfofcolor" />
<TextBlock Margin="0,1.5,6,0" Text="请不要打luosi" />
<TextBlock Margin="0,1.5,6,0" Text="Fly with You!!" />
<TextBlock Margin="0,1.5,6,0" Text="ン黑色幽默🏮" />
<TextBlock Margin="0,1.5,6,0" Text="Rinshonagon" />
<TextBlock Margin="0,1.5,6,0" Text="esj554611445" />
<TextBlock Margin="0,1.5,6,0" Text="Chara&Chara" />
<TextBlock Margin="0,1.5,6,0" Text="lightning_bolt" />
<TextBlock Margin="0,1.5,6,0" Text="卡壬纳_Karena" />
<TextBlock Margin="0,1.5,6,0" Text="123456789000" />
<TextBlock Margin="0,1.5,6,0" Text="捞猴子的月亮呐" />
<TextBlock Margin="0,1.5,6,0" Text="躁郁钢管大魅魔" />
@@ -549,11 +613,13 @@
<TextBlock Margin="0,1.5,6,0" Text="再来一笼小笼包" />
<TextBlock Margin="0,1.5,6,0" Text="玩魔术的暗杀者" />
<TextBlock Margin="0,1.5,6,0" Text="只留清白在人间" />
<TextBlock Margin="0,1.5,6,0" Text="最美不过你深爱" />
<TextBlock Margin="0,1.5,6,0" Text="maboyuaneasy" />
<TextBlock Margin="0,1.5,6,0" Text="Kiana Kasiana" />
<TextBlock Margin="0,1.5,6,0" Text="南ིྀ熙ིྀ寒ིྀ笙ིྀ" />
<TextBlock Margin="0,1.5,6,0" Text="18949212459aa" />
<TextBlock Margin="0,1.5,6,0" Text="M3GALOVANIA" />
<TextBlock Margin="0,1.5,6,0" Text="Samuel Bridges" />
<TextBlock Margin="0,1.5,6,0" Text="WeimingFanzhe" />
<TextBlock Margin="0,1.5,6,0" Text="筱筱雨吖_Official" />
<TextBlock Margin="0,1.5,6,0" Text="大笨蛋你在里面吗" />
@@ -564,7 +630,9 @@
<TextBlock Margin="0,1.5,6,0" Text="好好吃饭好好睡觉" />
<TextBlock Margin="0,1.5,6,0" Text="六月に舞う雪の鳶" />
<TextBlock Margin="0,1.5,6,0" Text="AAALLLAAANNN" />
<TextBlock Margin="0,1.5,6,0" Text="a cat wear a hear" />
<TextBlock Margin="0,1.5,6,0" Text="Minecraft_DeBug" />
<TextBlock Margin="0,1.5,6,0" Text="爱吃蛋白的丶圆周率" />
<TextBlock Margin="0,1.5,6,0" Text="祖国未来的狗尾巴草" />
<TextBlock Margin="0,1.5,6,0" Text="化权埵萨柯摩,隆奎" />
<TextBlock Margin="0,1.5,6,0" Text="AAA今州耙耙柑批发" />
@@ -574,6 +642,7 @@
<TextBlock Margin="0,1.5,6,0" Text="牛至涂芥末越冲越上头" />
<TextBlock Margin="0,1.5,6,0" Text="正电荷PositiveCharge" />
<TextBlock Margin="0,1.5,6,0" Text="(ꐦ°᷄д°᷅)咱也不敢问啊" />
<TextBlock Margin="0,1.5,6,0" Text="༺东༃方༒闲༒人༃家༻" />
<TextBlock Margin="0,1.5,6,0" Text="去撞南墙再撞北墙然后西墙最后东墙" />
</WrapPanel>
<Grid Height="35">
@@ -1,4 +1,5 @@
Public Class Settings
'TODO: 目前仅有此处在使用 DES 加密,后续考虑更换加密算法
Public Shared ReadOnly Entries As Dictionary(Of String, Setting) = (New List(Of Setting) From {
New Setting("Identify", "", Source:=Sources.Registry),
New Setting("WindowHeight", 550),
@@ -248,7 +249,7 @@
If Encrypted Then
Try
If Value Is Nothing Then Value = ""
Value = SecretEncrypt(Value, "PCL" & Identify)
Value = CryptographyUtils.DesEncrypt(Value, "PCL" & Identify)
Catch ex As Exception
Logger.Warn(ex, $"加密设置失败:{Key}")
End Try
@@ -318,7 +319,7 @@
'正常读取
Try
Dim GotValue As String = Nothing '先用 String 储存,避免类型转换
Dim DefaultValue As String = If(Entry.Encrypted, SecretEncrypt(Entry.DefaultValue, "PCL" & Identify), Entry.DefaultValue)
Dim DefaultValue As String = If(Entry.Encrypted, CryptographyUtils.DesEncrypt(Entry.DefaultValue, "PCL" & Identify), Entry.DefaultValue)
Select Case Entry.Source
Case Sources.Normal
GotValue = ReadIni("Setup", Key, DefaultValue)
@@ -336,7 +337,7 @@
GotValue = Entry.DefaultValue
Else
Try
GotValue = SecretDecrypt(GotValue, "PCL" & Identify)
GotValue = CryptographyUtils.DesDecrypt(GotValue, "PCL" & Identify)
Catch ex As Exception
Logger.Warn(ex, $"解密设置失败:{Key}")
GotValue = Entry.DefaultValue