diff --git a/PCL.Test/BaseXTest.cs b/PCL.Test/BaseXTest.cs
index 14c96623..6139fe8b 100644
--- a/PCL.Test/BaseXTest.cs
+++ b/PCL.Test/BaseXTest.cs
@@ -1,6 +1,6 @@
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
-using PCL.Core.Extension;
+using PCL.Core.Utils.Exts;
namespace PCL.Test;
diff --git a/PCL.Test/DiffTest.cs b/PCL.Test/DiffTest.cs
index 0247c5ed..09c28dc5 100644
--- a/PCL.Test/DiffTest.cs
+++ b/PCL.Test/DiffTest.cs
@@ -2,7 +2,7 @@
using System.IO;
using System.Threading.Tasks;
using Microsoft.VisualStudio.TestTools.UnitTesting;
-using PCL.Core.Update.Diff;
+using PCL.Core.Utils.Diff;
namespace PCL.Test;
diff --git a/PCL.Test/SemVerTest.cs b/PCL.Test/SemVerTest.cs
index 32ba68c9..347d2ee9 100644
--- a/PCL.Test/SemVerTest.cs
+++ b/PCL.Test/SemVerTest.cs
@@ -1,6 +1,6 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
-using PCL.Core.Update;
+using PCL.Core.Utils;
namespace PCL.Test
{
diff --git a/PCL.Test/SnapLiteTest.cs b/PCL.Test/SnapLiteTest.cs
index cb287fa6..36f02eee 100644
--- a/PCL.Test/SnapLiteTest.cs
+++ b/PCL.Test/SnapLiteTest.cs
@@ -2,7 +2,7 @@ using System;
using System.IO;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Threading.Tasks;
-using PCL.Core.VersionControl;
+using PCL.Core.Utils.VersionControl;
namespace PCL.Test;
diff --git a/PCL.Test/ToastTest.cs b/PCL.Test/ToastTest.cs
index fbf70e4a..7098fa50 100644
--- a/PCL.Test/ToastTest.cs
+++ b/PCL.Test/ToastTest.cs
@@ -1,6 +1,6 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
-using static PCL.Core.Native.ToastNotification;
+using static PCL.Core.UI.ToastNotification;
namespace PCL.Test;
diff --git a/PCL.Test/WebServerTest.cs b/PCL.Test/WebServerTest.cs
index a4173939..1242b3eb 100644
--- a/PCL.Test/WebServerTest.cs
+++ b/PCL.Test/WebServerTest.cs
@@ -1,7 +1,7 @@
using System;
using System.Threading.Tasks;
using Microsoft.VisualStudio.TestTools.UnitTesting;
-using PCL.Core.Network;
+using PCL.Core.Net;
using PCL.Core.Utils;
namespace PCL.Test;
diff --git a/Plain Craft Launcher 2/Application.xaml.vb b/Plain Craft Launcher 2/Application.xaml.vb
index 9fd8b254..1234bf0f 100644
--- a/Plain Craft Launcher 2/Application.xaml.vb
+++ b/Plain Craft Launcher 2/Application.xaml.vb
@@ -1,6 +1,5 @@
Imports System.Windows.Threading
-Imports System.IO.Compression
-Imports PCL.Core.LifecycleManagement
+Imports PCL.Core.App
Public Class Application
diff --git a/Plain Craft Launcher 2/Controls/MinecraftServer.xaml.vb b/Plain Craft Launcher 2/Controls/MinecraftServer.xaml.vb
index c3ca275b..c111e6e2 100644
--- a/Plain Craft Launcher 2/Controls/MinecraftServer.xaml.vb
+++ b/Plain Craft Launcher 2/Controls/MinecraftServer.xaml.vb
@@ -1,6 +1,5 @@
Imports System.Net
Imports System.Net.Sockets
-Imports System.Security.Policy
Imports System.Threading.Tasks
Imports PCL.Core.Link
diff --git a/Plain Craft Launcher 2/Controls/MinecraftServerQuery.xaml.vb b/Plain Craft Launcher 2/Controls/MinecraftServerQuery.xaml.vb
index ff8f14d3..a5da7d2b 100644
--- a/Plain Craft Launcher 2/Controls/MinecraftServerQuery.xaml.vb
+++ b/Plain Craft Launcher 2/Controls/MinecraftServerQuery.xaml.vb
@@ -1,8 +1,4 @@
-Imports System.Net
-Imports System.Net.Sockets
-Imports System.Security.Policy
-Imports System.Threading.Tasks
-Imports PCL.Core.Link
+
Class MinecraftServerQuery
Inherits Grid
diff --git a/Plain Craft Launcher 2/FormMain.xaml.vb b/Plain Craft Launcher 2/FormMain.xaml.vb
index 632dc4a1..7c51806e 100644
--- a/Plain Craft Launcher 2/FormMain.xaml.vb
+++ b/Plain Craft Launcher 2/FormMain.xaml.vb
@@ -1,7 +1,7 @@
Imports System.ComponentModel
Imports System.Runtime.InteropServices
Imports System.Windows.Interop
-Imports PCL.Core.LifecycleManagement
+Imports PCL.Core.App
Public Class FormMain
diff --git a/Plain Craft Launcher 2/Modules/Base/ModBase.vb b/Plain Craft Launcher 2/Modules/Base/ModBase.vb
index ecdff190..e68e0289 100644
--- a/Plain Craft Launcher 2/Modules/Base/ModBase.vb
+++ b/Plain Craft Launcher 2/Modules/Base/ModBase.vb
@@ -1,16 +1,14 @@
Imports System.Globalization
Imports System.IO.Compression
Imports System.Runtime.CompilerServices
-Imports System.Runtime.InteropServices
Imports System.Security.Cryptography
Imports System.Security.Principal
Imports System.Text.RegularExpressions
Imports System.Xaml
Imports System.Threading.Tasks
Imports Newtonsoft.Json
-Imports Newtonsoft.Json.Serialization
+Imports PCL.Core.App
Imports PCL.Core.Logging
-Imports PCL.Core.Native
Public Module ModBase
@@ -43,11 +41,11 @@ Public Module ModBase
'''
''' 程序可执行文件所在目录,以“\”结尾。
'''
- Public Path As String = If(NativeInterop.ExecutableDirectory.EndsWith("\"), NativeInterop.ExecutableDirectory, NativeInterop.ExecutableDirectory & "\")
+ Public Path As String = If(Basics.ExecutableDirectory.EndsWith("\"), Basics.ExecutableDirectory, Basics.ExecutableDirectory & "\")
'''
''' 程序可执行文件完整路径。
'''
- Public PathWithName As String = NativeInterop.ExecutablePath
+ Public PathWithName As String = Basics.ExecutablePath
'''
''' 程序内嵌图片文件夹路径,以“/”结尾。
'''
diff --git a/Plain Craft Launcher 2/Modules/Base/ModNativeInterop.vb b/Plain Craft Launcher 2/Modules/Base/ModNativeInterop.vb
index 70d9edc4..1ad0f687 100644
--- a/Plain Craft Launcher 2/Modules/Base/ModNativeInterop.vb
+++ b/Plain Craft Launcher 2/Modules/Base/ModNativeInterop.vb
@@ -1,5 +1,6 @@
Imports Newtonsoft.Json
-Imports PCL.Core.Native
+Imports PCL.Core.App
+Imports PCL.Core.IO
Public Module ModNativeInterop
@@ -124,7 +125,7 @@ Public Module ModNativeInterop
If OpenLogPipes.Contains(id) Then Return RPCResponse.Err("日志 ID 正在使用")
Dim pipeName = LogPipePrefix & RandomInteger(10000, 99999)
OpenLogPipes.Add(id)
- NativeInterop.StartPipeServer($"Log({id})", pipeName,
+ PipeComm.StartPipeServer($"Log({id})", pipeName,
Function(r, w, c) LogPipeCallback(r, w, request),
Sub() OpenLogPipes.Remove(id),
True, {clientProcess.Id})
diff --git a/Plain Craft Launcher 2/Modules/Base/ModNet.vb b/Plain Craft Launcher 2/Modules/Base/ModNet.vb
index a2cea406..819f4c24 100644
--- a/Plain Craft Launcher 2/Modules/Base/ModNet.vb
+++ b/Plain Craft Launcher 2/Modules/Base/ModNet.vb
@@ -3,10 +3,9 @@ Imports System.Net.Http
Imports System.Runtime.InteropServices
Imports System.Threading.Tasks
Imports System.IO.Compression
-Imports LiteDB
Imports CacheCow.Client
Imports CacheCow.Common
-Imports PCL.Core.Network
+Imports PCL.Core.Net
Imports PCL.Core.Utils.Hash
Public Module ModNet
diff --git a/Plain Craft Launcher 2/Modules/Minecraft/ModLaunch.vb b/Plain Craft Launcher 2/Modules/Minecraft/ModLaunch.vb
index a6892046..d612f535 100644
--- a/Plain Craft Launcher 2/Modules/Minecraft/ModLaunch.vb
+++ b/Plain Craft Launcher 2/Modules/Minecraft/ModLaunch.vb
@@ -1,8 +1,5 @@
-Imports System.Diagnostics.Eventing.Reader
+
Imports System.IO.Compression
-Imports System.Threading.Tasks
-Imports Microsoft.Identity.Client
-Imports Microsoft.Identity.Client.Broker
Imports PCL.Core.Minecraft
Public Module ModLaunch
diff --git a/Plain Craft Launcher 2/Modules/ModLink.vb b/Plain Craft Launcher 2/Modules/ModLink.vb
index d7c71d70..c863884a 100644
--- a/Plain Craft Launcher 2/Modules/ModLink.vb
+++ b/Plain Craft Launcher 2/Modules/ModLink.vb
@@ -4,11 +4,11 @@ Imports System.Net.Sockets
Imports Makaretu.Nat
Imports STUN
Imports System.Threading.Tasks
-Imports PCL.Core.Extension
Imports PCL.Core.IO
Imports PCL.Core.Link
-Imports PCL.Core.Native
-Imports PCL.Core.Network
+Imports PCL.Core.Net
+Imports PCL.Core.Utils.Exts
+Imports PCL.Core.Utils.OS
Public Module ModLink
@@ -226,7 +226,7 @@ Public Module ModLink
End Function
Public Function GetLauncherBrand(pid As Integer) As String
Try
- Dim cmd = NativeInterop.GetCommandLine(pid)
+ Dim cmd = ProcessInterop.GetCommandLine(pid)
If cmd.Contains("-Dminecraft.launcher.brand=") Then
Return cmd.AfterFirst("-Dminecraft.launcher.brand=").BeforeFirst("-").TrimEnd("'", " ")
Else
diff --git a/Plain Craft Launcher 2/Modules/ModMusic.vb b/Plain Craft Launcher 2/Modules/ModMusic.vb
index 5bdbf004..6fce63d3 100644
--- a/Plain Craft Launcher 2/Modules/ModMusic.vb
+++ b/Plain Craft Launcher 2/Modules/ModMusic.vb
@@ -1,5 +1,4 @@
Imports Windows.Media
-Imports Windows.Storage
Imports Windows.Storage.Streams
Public Module ModMusic
diff --git a/Plain Craft Launcher 2/Modules/ModSecret.vb b/Plain Craft Launcher 2/Modules/ModSecret.vb
index 6cdd2afd..ba2a190b 100644
--- a/Plain Craft Launcher 2/Modules/ModSecret.vb
+++ b/Plain Craft Launcher 2/Modules/ModSecret.vb
@@ -3,11 +3,9 @@ Imports System.Net.Http
Imports System.Security.Cryptography
Imports System.Management
Imports PCL.Core.IO
-Imports PCL.Core.Secret
Imports PCL.Core.UI
-Imports PCL.Core.Update
Imports PCL.Core.Utils
-Imports PCL.Core.VersionControl
+Imports PCL.Core.Utils.Secret
Friend Module ModSecret
diff --git a/Plain Craft Launcher 2/Modules/ModWebServer.vb b/Plain Craft Launcher 2/Modules/ModWebServer.vb
index 3740c5e3..58a276ab 100644
--- a/Plain Craft Launcher 2/Modules/ModWebServer.vb
+++ b/Plain Craft Launcher 2/Modules/ModWebServer.vb
@@ -1,8 +1,7 @@
Imports System.Net.NetworkInformation
Imports System.Threading.Tasks
Imports Newtonsoft.Json
-Imports PCL.Core.Network
-Imports PCL.Core.Utils
+Imports PCL.Core.Net
Public Module ModWebServer
diff --git a/Plain Craft Launcher 2/Modules/Updates/IUpdateSource.vb b/Plain Craft Launcher 2/Modules/Updates/IUpdateSource.vb
index 80d983b0..21b736f6 100644
--- a/Plain Craft Launcher 2/Modules/Updates/IUpdateSource.vb
+++ b/Plain Craft Launcher 2/Modules/Updates/IUpdateSource.vb
@@ -1,5 +1,4 @@
-Imports PCL.Core.Update
-Imports PCL.Core.VersionControl
+Imports PCL.Core.Utils
Public Interface IUpdateSource
'''
diff --git a/Plain Craft Launcher 2/Modules/Updates/UpdatesMinioModel.vb b/Plain Craft Launcher 2/Modules/Updates/UpdatesMinioModel.vb
index 7a022019..180b4ccd 100644
--- a/Plain Craft Launcher 2/Modules/Updates/UpdatesMinioModel.vb
+++ b/Plain Craft Launcher 2/Modules/Updates/UpdatesMinioModel.vb
@@ -1,7 +1,6 @@
Imports System.IO.Compression
-Imports PCL.Core.Update
-Imports PCL.Core.Update.Diff
-Imports PCL.Core.VersionControl
+Imports PCL.Core.Utils
+Imports PCL.Core.Utils.Diff
Public Class UpdatesMinioModel '社区自己的更新系统格式
Implements IUpdateSource
diff --git a/Plain Craft Launcher 2/Modules/Updates/UpdatesMirrorChyanModel.vb b/Plain Craft Launcher 2/Modules/Updates/UpdatesMirrorChyanModel.vb
index 223a5c4f..4416229e 100644
--- a/Plain Craft Launcher 2/Modules/Updates/UpdatesMirrorChyanModel.vb
+++ b/Plain Craft Launcher 2/Modules/Updates/UpdatesMirrorChyanModel.vb
@@ -1,7 +1,6 @@
-Imports System.Text.Json
-Imports PCL.Core.Update
-Imports PCL.Core.VersionControl
+
+Imports PCL.Core.Utils
Public Class UpdatesMirrorChyanModel 'Mirror 酱的更新格式
Implements IUpdateSource
diff --git a/Plain Craft Launcher 2/Modules/Updates/UpdatesRandomModel.vb b/Plain Craft Launcher 2/Modules/Updates/UpdatesRandomModel.vb
index 6e5cacb0..195d156b 100644
--- a/Plain Craft Launcher 2/Modules/Updates/UpdatesRandomModel.vb
+++ b/Plain Craft Launcher 2/Modules/Updates/UpdatesRandomModel.vb
@@ -1,5 +1,4 @@
-Imports PCL.Core.Update
-Imports PCL.Core.VersionControl
+Imports PCL.Core.Utils
Public Class UpdatesRandomModel '社区自己的更新系统格式
Implements IUpdateSource
diff --git a/Plain Craft Launcher 2/Modules/Updates/UpdatesWrapperModel.vb b/Plain Craft Launcher 2/Modules/Updates/UpdatesWrapperModel.vb
index 9aadcd22..09736fbd 100644
--- a/Plain Craft Launcher 2/Modules/Updates/UpdatesWrapperModel.vb
+++ b/Plain Craft Launcher 2/Modules/Updates/UpdatesWrapperModel.vb
@@ -1,5 +1,4 @@
-Imports PCL.Core.Update
-Imports PCL.Core.VersionControl
+Imports PCL.Core.Utils
Public Class UpdatesWrapperModel
Implements IUpdateSource
diff --git a/Plain Craft Launcher 2/My Project/Resources.Designer.vb b/Plain Craft Launcher 2/My Project/Resources.Designer.vb
index 739863b4..9b00b3bb 100644
--- a/Plain Craft Launcher 2/My Project/Resources.Designer.vb
+++ b/Plain Craft Launcher 2/My Project/Resources.Designer.vb
@@ -11,7 +11,6 @@
Option Strict On
Option Explicit On
-Imports System
Namespace My.Resources
diff --git a/Plain Craft Launcher 2/Pages/PageDownload/Comp/PageDownloadCompDetail.xaml.vb b/Plain Craft Launcher 2/Pages/PageDownload/Comp/PageDownloadCompDetail.xaml.vb
index 3b7b17ca..95c73217 100644
--- a/Plain Craft Launcher 2/Pages/PageDownload/Comp/PageDownloadCompDetail.xaml.vb
+++ b/Plain Craft Launcher 2/Pages/PageDownload/Comp/PageDownloadCompDetail.xaml.vb
@@ -1,4 +1,4 @@
-Imports System.Security.Cryptography
+
Public Class PageDownloadCompDetail
Private CompItem As MyCompItem = Nothing
diff --git a/Plain Craft Launcher 2/Pages/PageInstance/PageInstanceSaves.xaml.vb b/Plain Craft Launcher 2/Pages/PageInstance/PageInstanceSaves.xaml.vb
index 2e089f3b..bc75f839 100644
--- a/Plain Craft Launcher 2/Pages/PageInstance/PageInstanceSaves.xaml.vb
+++ b/Plain Craft Launcher 2/Pages/PageInstance/PageInstanceSaves.xaml.vb
@@ -1,4 +1,4 @@
-Imports System.Security.Principal
+
Public Class PageInstanceSaves
Implements IRefreshable
diff --git a/Plain Craft Launcher 2/Pages/PageInstance/PageInstanceSaves/PageInstanceSavesBackup.xaml.vb b/Plain Craft Launcher 2/Pages/PageInstance/PageInstanceSaves/PageInstanceSavesBackup.xaml.vb
index d68f1f87..36aa8693 100644
--- a/Plain Craft Launcher 2/Pages/PageInstance/PageInstanceSaves/PageInstanceSavesBackup.xaml.vb
+++ b/Plain Craft Launcher 2/Pages/PageInstance/PageInstanceSaves/PageInstanceSavesBackup.xaml.vb
@@ -1,5 +1,5 @@
Imports PCL.Core.IO
-Imports PCL.Core.VersionControl
+Imports PCL.Core.Utils.VersionControl
Class PageInstanceSavesBackup
Implements IRefreshable
diff --git a/Plain Craft Launcher 2/Pages/PageInstance/PageInstanceSaves/PageInstanceSavesLeft.xaml.vb b/Plain Craft Launcher 2/Pages/PageInstance/PageInstanceSaves/PageInstanceSavesLeft.xaml.vb
index e4321bae..1e2a688a 100644
--- a/Plain Craft Launcher 2/Pages/PageInstance/PageInstanceSaves/PageInstanceSavesLeft.xaml.vb
+++ b/Plain Craft Launcher 2/Pages/PageInstance/PageInstanceSaves/PageInstanceSavesLeft.xaml.vb
@@ -1,4 +1,4 @@
-Imports System.Threading.Tasks
+
Public Class PageInstanceSavesLeft
Implements IRefreshable
diff --git a/Plain Craft Launcher 2/Pages/PageInstance/PageInstanceScreenshot.xaml.vb b/Plain Craft Launcher 2/Pages/PageInstance/PageInstanceScreenshot.xaml.vb
index 5355627a..e870adca 100644
--- a/Plain Craft Launcher 2/Pages/PageInstance/PageInstanceScreenshot.xaml.vb
+++ b/Plain Craft Launcher 2/Pages/PageInstance/PageInstanceScreenshot.xaml.vb
@@ -1,5 +1,4 @@
-Imports System.Security.Principal
-Imports Imazen.WebP.Extern
+
Public Class PageInstanceScreenshot
Implements IRefreshable
diff --git a/Plain Craft Launcher 2/Pages/PageLink/PageLinkLobby.xaml.vb b/Plain Craft Launcher 2/Pages/PageLink/PageLinkLobby.xaml.vb
index aa88622c..ff43d8b1 100644
--- a/Plain Craft Launcher 2/Pages/PageLink/PageLinkLobby.xaml.vb
+++ b/Plain Craft Launcher 2/Pages/PageLink/PageLinkLobby.xaml.vb
@@ -1,7 +1,8 @@
-Imports PCL.Core.Extension
+
Imports PCL.Core.Link
-Imports PCL.Core.Native
+Imports PCL.Core.UI
+Imports PCL.Core.Utils.Exts
Public Class PageLinkLobby
'记录的启动情况
diff --git a/Plain Craft Launcher 2/Pages/PageOther/PageOtherTest.xaml.vb b/Plain Craft Launcher 2/Pages/PageOther/PageOtherTest.xaml.vb
index 4de251b8..da07c761 100644
--- a/Plain Craft Launcher 2/Pages/PageOther/PageOtherTest.xaml.vb
+++ b/Plain Craft Launcher 2/Pages/PageOther/PageOtherTest.xaml.vb
@@ -1,10 +1,9 @@
Imports System.Net
Imports System.Runtime.ConstrainedExecution
Imports System.Runtime.InteropServices
+Imports PCL.Core.App
Imports PCL.Core.IO
-Imports PCL.Core.Link
-Imports PCL.Core.Native
Public Class PageOtherTest
Public Sub New()
@@ -502,7 +501,7 @@ Public Class PageOtherTest
If choice = 1 Then Exit Sub
Dim shortcutPath = If(choice = 2, desktop, start)
Dim locationName = If(choice = 2, desktopName, startName)
- Files.CreateShortcut(shortcutPath, NativeInterop.ExecutablePath)
+ Files.CreateShortcut(shortcutPath, Basics.ExecutablePath)
Hint("已在" & locationName & "创建快捷方式", HintType.Finish)
End Sub
diff --git a/Plain Craft Launcher 2/Pages/PageOther/PageOtherVote.xaml.vb b/Plain Craft Launcher 2/Pages/PageOther/PageOtherVote.xaml.vb
index 2c6463f8..a44cce38 100644
--- a/Plain Craft Launcher 2/Pages/PageOther/PageOtherVote.xaml.vb
+++ b/Plain Craft Launcher 2/Pages/PageOther/PageOtherVote.xaml.vb
@@ -1,9 +1,5 @@
-Imports System.Net.Http
+
Imports System.Text.RegularExpressions
-Imports System.Windows.Forms
-Imports System.Windows.Forms.LinkLabel
-Imports System.Xml
-Imports NAudio.Gui
Public Class PageOtherVote
Public Class Vote
diff --git a/Plain Craft Launcher 2/Pages/PageSetup/ModSetup.vb b/Plain Craft Launcher 2/Pages/PageSetup/ModSetup.vb
index c0112dfd..ee123425 100644
--- a/Plain Craft Launcher 2/Pages/PageSetup/ModSetup.vb
+++ b/Plain Craft Launcher 2/Pages/PageSetup/ModSetup.vb
@@ -1,4 +1,4 @@
-Imports PCL.Core.Network
+Imports PCL.Core.Net
Public Class ModSetup
diff --git a/Plain Craft Launcher 2/Pages/PageSpeedLeft.xaml.vb b/Plain Craft Launcher 2/Pages/PageSpeedLeft.xaml.vb
index 1c499499..7669eb80 100644
--- a/Plain Craft Launcher 2/Pages/PageSpeedLeft.xaml.vb
+++ b/Plain Craft Launcher 2/Pages/PageSpeedLeft.xaml.vb
@@ -1,4 +1,4 @@
-Imports System.Threading.Tasks
+
Public Class PageSpeedLeft
Private Const WatcherInterval As Integer = 300
diff --git a/Plain Craft Launcher 2/Program.vb b/Plain Craft Launcher 2/Program.vb
index 5ddf982a..73e562a8 100644
--- a/Plain Craft Launcher 2/Program.vb
+++ b/Plain Craft Launcher 2/Program.vb
@@ -1,5 +1,5 @@
-Imports PCL.Core.LifecycleManagement
-Imports PCL.Core.UI
+
+Imports PCL.Core.App
Module Program