From 457c2c2b502c14f3fa126702e61f04ab5ecafa5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=89=8B=E7=93=9C=E4=B8=80=E5=8D=81=E9=9B=AA?= Date: Tue, 17 Sep 2024 11:06:07 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E6=8E=A8=E8=BF=9B2.6.0=E5=A4=A7=E5=B9=85?= =?UTF-8?q?=E5=BA=A6=E9=87=8D=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manifest.json | 2 +- package.json | 2 +- src/common/version.ts | 2 +- src/webui/ui/NapCat.ts | 2 +- static/assets/renderer.js | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/manifest.json b/manifest.json index de431b15..039890c0 100644 --- a/manifest.json +++ b/manifest.json @@ -4,7 +4,7 @@ "name": "NapCatQQ", "slug": "NapCat.Framework", "description": "高性能的 OneBot 11 协议实现", - "version": "2.5.5", + "version": "2.6.0", "icon": "./logo.png", "authors": [ { diff --git a/package.json b/package.json index 1be22bf9..54f28970 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "napcat", "private": true, "type": "module", - "version": "2.5.5", + "version": "2.6.0", "scripts": { "build:framework": "vite build --mode framework", "build:shell": "vite build --mode shell", diff --git a/src/common/version.ts b/src/common/version.ts index c125fbaa..c11d116c 100644 --- a/src/common/version.ts +++ b/src/common/version.ts @@ -1 +1 @@ -export const napCatVersion = '2.5.5'; +export const napCatVersion = '2.6.0'; diff --git a/src/webui/ui/NapCat.ts b/src/webui/ui/NapCat.ts index 0f912154..b744c571 100644 --- a/src/webui/ui/NapCat.ts +++ b/src/webui/ui/NapCat.ts @@ -30,7 +30,7 @@ async function onSettingWindowCreated(view: Element) { SettingItem( 'Napcat', undefined, - SettingButton('V2.5.5', 'napcat-update-button', 'secondary'), + SettingButton('V2.6.0', 'napcat-update-button', 'secondary'), ), ]), SettingList([ diff --git a/static/assets/renderer.js b/static/assets/renderer.js index fb7280d0..69c8712a 100644 --- a/static/assets/renderer.js +++ b/static/assets/renderer.js @@ -164,7 +164,7 @@ async function onSettingWindowCreated(view) { SettingItem( 'Napcat', void 0, - SettingButton("V2.5.5", "napcat-update-button", "secondary") + SettingButton("V2.6.0", "napcat-update-button", "secondary") ) ]), SettingList([ From b1fc72d696c61297e8002095f151195b00d7ca19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=89=8B=E7=93=9C=E4=B8=80=E5=8D=81=E9=9B=AA?= Date: Tue, 17 Sep 2024 11:08:47 +0800 Subject: [PATCH 2/4] =?UTF-8?q?chore:=20=E7=A7=BB=E9=99=A4=E6=97=A7?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/BootWay.03.ps1 | 45 ------------- script/BootWay05.bat | 90 ------------------------- script/BootWay05.ps1 | 123 ---------------------------------- script/BootWay05.utf8.bat | 93 ------------------------- script/BootWay05_init.bat | 77 --------------------- script/BootWay05_run.bat | 10 --- script/BootWay05_run.utf8.bat | 13 ---- script/dbghelp.dll | Bin 13824 -> 0 bytes vite.config.ts | 8 +-- 9 files changed, 3 insertions(+), 456 deletions(-) delete mode 100644 script/BootWay.03.ps1 delete mode 100644 script/BootWay05.bat delete mode 100644 script/BootWay05.ps1 delete mode 100644 script/BootWay05.utf8.bat delete mode 100644 script/BootWay05_init.bat delete mode 100644 script/BootWay05_run.bat delete mode 100644 script/BootWay05_run.utf8.bat delete mode 100644 script/dbghelp.dll diff --git a/script/BootWay.03.ps1 b/script/BootWay.03.ps1 deleted file mode 100644 index d4fb6707..00000000 --- a/script/BootWay.03.ps1 +++ /dev/null @@ -1,45 +0,0 @@ -# Dont Use This Script -# 2024.7.3 -function Get-QQpath { - try { - $key = Get-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\QQ" - $uninstallString = $key.UninstallString - return [System.IO.Path]::GetDirectoryName($uninstallString) + "\QQ.exe" - } - catch { - throw "get QQ path error: $_" - } -} -function Select-QQPath { - Add-Type -AssemblyName System.Windows.Forms - [System.Windows.Forms.Application]::EnableVisualStyles() - - $dialogTitle = "Select QQ.exe" - - $filePicker = New-Object System.Windows.Forms.OpenFileDialog - $filePicker.Title = $dialogTitle - $filePicker.Filter = "Executable Files (*.exe)|*.exe|All Files (*.*)|*.*" - $filePicker.FilterIndex = 1 - $null = $filePicker.ShowDialog() - if (-not ($filePicker.FileName)) { - throw "User did not select an .exe file." - } - return $filePicker.FileName -} - -$params = $args -join " " -Try { - $QQpath = Get-QQpath -} -Catch { - $QQpath = Select-QQPath -} - -if (!(Test-Path $QQpath)) { - throw "provided QQ path is invalid: $QQpath" -} - -$Bootfile = Join-Path $PSScriptRoot "napcat.mjs" -$env:ELECTRON_RUN_AS_NODE = 1 -$commandInfo = Get-Command $QQpath -ErrorAction Stop -Start-Process powershell -ArgumentList "-noexit", "-noprofile", "-command &{& chcp 65001;& '$($commandInfo.Path)' --enable-logging }" \ No newline at end of file diff --git a/script/BootWay05.bat b/script/BootWay05.bat deleted file mode 100644 index 06d2ee3b..00000000 --- a/script/BootWay05.bat +++ /dev/null @@ -1,90 +0,0 @@ -@echo off -REM 检查当前会话是否具有管理员权限 -openfiles >nul 2>&1 -if %errorlevel% neq 0 ( - REM 如果不是管理员,则重新启动脚本以管理员模式运行 - echo 请求管理员权限... - powershell -Command "Start-Process cmd -ArgumentList '/c %~f0 %*' -Verb RunAs" - exit /b -) - -REM 设置当前工作目录 -cd /d %~dp0 - -REM 获取当前目录路径 -set currentPath=%cd% -set currentPath=%currentPath:\=/% - -REM 生成JavaScript代码 -set "jsCode=(async () =^>await import('file:///%currentPath%/napcat.mjs'))();" - -REM 将JavaScript代码保存到文件中 -echo %jsCode% > loadScript.js -echo JavaScript code has been generated and saved to loadScript.js - -REM 设置NAPCAT_PATH环境变量为 当前目录的loadScript.js地址 -set NAPCAT_PATH=%cd%\loadScript.js - -REM 获取QQ路径 - - -:loop_read -for /f "tokens=2*" %%a in ('reg query "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\QQ" /v "UninstallString"') do ( - set RetString=%%b - goto :napcat_boot -) - -:napcat_boot -for %%a in (%RetString%) do ( - set "pathWithoutUninstall=%%~dpa" -) - -SET QQPath=%pathWithoutUninstall%QQ.exe - -REM 拿不到QQ路径则退出 -if not exist "%QQpath%" ( - echo provided QQ path is invalid: %QQpath% - pause - exit /b -) - -REM 收集dbghelp.dll路径和HASH信息 -set QQdir=%~dp0 -set oldDllPath=%QQdir%dbghelp.dll -set newDllPath=%currentPath%\dbghelp.dll - -for /f "tokens=*" %%A in ('certutil -hashfile "%oldDllPath%" MD5') do ( - if not defined oldDllHash set oldDllHash=%%A -) -for /f "tokens=*" %%A in ('certutil -hashfile "%newDllPath%" MD5') do ( - if not defined newDllHash set newDllHash=%%A -) - -REM 如果文件一致则跳过 -if "%oldDllHash%" neq "%newDllHash%" ( - tasklist /fi "imagename eq QQ.exe" 2>nul | find /i "QQ.exe" >nul - if %errorlevel% equ 0 ( - REM 文件占用则退出 - echo dbghelp.dll is in use, cannot continue. - ) else ( - REM 文件未占用则尝试覆盖 - copy /y "%newDllPath%" "%oldDllPath%" - if %errorlevel% neq 0 ( - echo Failed to copy dbghelp.dll - pause - exit /b - ) else ( - echo dbghelp.dll has been copied to %QQdir% - ) - ) -) - -REM 带参数启动QQ -REM 判断wt是否存在,存在则通过wt启动,不存在则通过cmd启动 -REM %QQPath% --enable-logging %* -where wt >nul 2>nul -if %errorlevel% equ 0 ( - wt "cmd" /c "%QQPath%" --enable-logging %* -) else ( - "%QQPath%" --enable-logging %* -) diff --git a/script/BootWay05.ps1 b/script/BootWay05.ps1 deleted file mode 100644 index 862281ef..00000000 --- a/script/BootWay05.ps1 +++ /dev/null @@ -1,123 +0,0 @@ -# 检查当前会话是否具有管理员权限 -function Test-Administrator { - $user = [Security.Principal.WindowsIdentity]::GetCurrent() - (New-Object Security.Principal.WindowsPrincipal $user).IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator) -} - -if (-not (Test-Administrator)) { - # 如果不是管理员,则重新启动脚本以管理员模式运行 - $scriptPath = $myInvocation.MyCommand.Path - if (-not $scriptPath) { - $scriptPath = $PSCommandPath - } - $newProcess = New-Object System.Diagnostics.ProcessStartInfo "powershell"; - $newProcess.Arguments = "-File `"$scriptPath`" $args" - $newProcess.Verb = "runas"; - [System.Diagnostics.Process]::Start($newProcess); - exit -} - -function Get-QQpath { - try { - $key = Get-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\QQ" - $uninstallString = $key.UninstallString - return [System.IO.Path]::GetDirectoryName($uninstallString) + "\QQ.exe" - } - catch { - throw "get QQ path error: $_" - } -} -function Select-QQPath { - Add-Type -AssemblyName System.Windows.Forms - [System.Windows.Forms.Application]::EnableVisualStyles() - - $dialogTitle = "Select QQ.exe" - - $filePicker = New-Object System.Windows.Forms.OpenFileDialog - $filePicker.Title = $dialogTitle - $filePicker.Filter = "Executable Files (*.exe)|*.exe|All Files (*.*)|*.*" - $filePicker.FilterIndex = 1 - $null = $filePicker.ShowDialog() - if (-not ($filePicker.FileName)) { - throw "User did not select an .exe file." - } - return $filePicker.FileName -} - -# 设置当前工作目录 -$scriptDirectory = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent -Set-Location $scriptDirectory - -# 获取当前目录路径 -$currentPath = Get-Location - -# 替换\为/ -$currentPath = $currentPath -replace '\\', '/' - -# 生成JavaScript代码 -$jsCode = @" -(async () => { - await import('file:///$currentPath/napcat.mjs'); -})(); -"@ - -# 将JavaScript代码保存到文件中 -$jsFilePath = Join-Path $currentPath "loadScript.js" -$jsCode | Out-File -FilePath $jsFilePath -Encoding UTF8 - -Write-Output "JavaScript code has been generated and saved to $jsFilePath" -# 设置NAPCAT_PATH环境变量为 当前目录的loadScript.js地址 -$env:NAPCAT_PATH = $jsFilePath - -$params = $args -join " " -Try { - $QQpath = Get-QQpath -} -Catch { - $QQpath = Select-QQPath -} -# 拿不到QQ路径则退出 -if (!(Test-Path $QQpath)) { - Write-Output "provided QQ path is invalid: $QQpath" - Read-Host "Press any key to continue..." - exit -} - -$commandInfo = Get-Command $QQpath -ErrorAction Stop - -# 收集dbghelp.dll路径和HASH信息 -$QQpath = Split-Path $QQpath -$oldDllPath = Join-Path $QQpath "dbghelp.dll" -$oldDllHash = Get-FileHash $oldDllPath -Algorithm MD5 -$newDllPath = Join-Path $currentPath "dbghelp.dll" -$newDllHash = Get-FileHash $newDllPath -Algorithm MD5 -# 如果文件一致则跳过 -if ($oldDllHash.Hash -ne $newDllHash.Hash) { - $processes = Get-Process -Name QQ -ErrorAction SilentlyContinue - if ($processes) { - # 文件占用则退出 - Write-Output "dbghelp.dll is in use by the following processes:" - $processes | ForEach-Object { Write-Output "$($_.Id) $($_.Name) $($_.Path)" } - Write-Output "dbghelp.dll is in use, cannot continue." - Read-Host "Press any key to continue..." - exit - } else { - # 文件未占用则尝试覆盖 - try { - Copy-Item -Path "$newDllPath" -Destination "$oldDllPath" -Force - Write-Output "dbghelp.dll has been copied to $QQpath" - } catch { - Write-Output "Failed to copy dbghelp.dll: $_" - Read-Host "Press any key to continue..." - exit - } - } -} - -# 带参数启动QQ -try { - Start-Process powershell -ArgumentList '-noexit', '-noprofile', "-command &{& chcp 65001;& '$($commandInfo.Path)' --enable-logging $params}" -NoNewWindow -ErrorAction Stop -} catch { - Write-Output "Failed to start process as administrator: $_" - Read-Host "Press any key to continue..." -} \ No newline at end of file diff --git a/script/BootWay05.utf8.bat b/script/BootWay05.utf8.bat deleted file mode 100644 index 2836a38a..00000000 --- a/script/BootWay05.utf8.bat +++ /dev/null @@ -1,93 +0,0 @@ -@echo off -REM 检查当前会话是否具有管理员权限 -openfiles >nul 2>&1 -if %errorlevel% neq 0 ( - REM 如果不是管理员,则重新启动脚本以管理员模式运行 - echo 请求管理员权限... - where wt >nul 2>nul - if %errorlevel% equ 0 ( - powershell -Command "Start-Process cmd -ArgumentList ' /c %~f0 %*' -Verb RunAs" - ) else ( - powershell -Command "Start-Process wt -ArgumentList 'cmd /c %~f0 %*' -Verb RunAs" - ) - - REM wt "cmd" /c "%~f0 %*" - exit /b -) - -REM 设置当前工作目录 -cd /d %~dp0 - -REM 获取当前目录路径 -set currentPath=%cd% -set currentPath=%currentPath:\=/% - -REM 生成JavaScript代码 -set "jsCode=(async () =^>await import('file:///%currentPath%/napcat.mjs'))();" - -REM 将JavaScript代码保存到文件中 -echo %jsCode% > loadScript.js -echo JavaScript code has been generated and saved to loadScript.js - -REM 设置NAPCAT_PATH环境变量为 当前目录的loadScript.js地址 -set NAPCAT_PATH=%cd%\loadScript.js - -REM 获取QQ路径 - - -:loop_read -for /f "tokens=2*" %%a in ('reg query "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\QQ" /v "UninstallString"') do ( - set RetString=%%b - goto :napcat_boot -) - -:napcat_boot -for %%a in (%RetString%) do ( - set "pathWithoutUninstall=%%~dpa" -) - -SET QQPath=%pathWithoutUninstall%QQ.exe - -REM 拿不到QQ路径则退出 -if not exist "%QQpath%" ( - echo provided QQ path is invalid: %QQpath% - pause - exit /b -) - -REM 收集dbghelp.dll路径和HASH信息 -set QQdir=%~dp0 -set oldDllPath=%QQdir%dbghelp.dll -set newDllPath=%currentPath%\dbghelp.dll - -for /f "tokens=*" %%A in ('certutil -hashfile "%oldDllPath%" MD5') do ( - if not defined oldDllHash set oldDllHash=%%A -) -for /f "tokens=*" %%A in ('certutil -hashfile "%newDllPath%" MD5') do ( - if not defined newDllHash set newDllHash=%%A -) - -REM 如果文件一致则跳过 -if "%oldDllHash%" neq "%newDllHash%" ( - tasklist /fi "imagename eq QQ.exe" 2>nul | find /i "QQ.exe" >nul - if %errorlevel% equ 0 ( - REM 文件占用则退出 - echo dbghelp.dll is in use, cannot continue. - ) else ( - REM 文件未占用则尝试覆盖 - copy /y "%newDllPath%" "%oldDllPath%" - if %errorlevel% neq 0 ( - echo Failed to copy dbghelp.dll - pause - exit /b - ) else ( - echo dbghelp.dll has been copied to %QQdir% - ) - ) -) - -REM 带参数启动QQ -REM 判断wt是否存在,存在则通过wt启动,不存在则通过cmd启动 -REM %QQPath% --enable-logging %* -chcp 65001 -"%QQPath%" --enable-logging %* diff --git a/script/BootWay05_init.bat b/script/BootWay05_init.bat deleted file mode 100644 index 654f80fe..00000000 --- a/script/BootWay05_init.bat +++ /dev/null @@ -1,77 +0,0 @@ -@echo off -REM Check if the script is running as administrator -openfiles >nul 2>&1 -if %errorlevel% neq 0 ( - REM If not, restart the script in administrator mode - echo Requesting administrator privileges... - powershell -Command "Start-Process cmd -ArgumentList '/c %~f0 %*' -Verb RunAs" - exit /b -) - -cd /d %~dp0 - -set currentPath=%cd% -set currentPath=%currentPath:\=/% - -REM Generate JavaScript code -set "jsCode=(async () =^>await import('file:///%currentPath%/napcat.mjs'))();" - -REM Save JavaScript code to a file -echo %jsCode% > loadScript.js -echo JavaScript code has been generated and saved to loadScript.js - -REM Set NAPCAT_PATH environment variable to the address of loadScript.js in the current directory -set NAPCAT_PATH=%cd%\loadScript.js - -REM Get QQ path and cache it -:loop_read -for /f "tokens=2*" %%a in ('reg query "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\QQ" /v "UninstallString"') do ( - set "RetString=%%b" -) - -set "pathWithoutUninstall=%RetString:Uninstall.exe=%" - -SET QQPath=%pathWithoutUninstall%QQ.exe -echo %QQPath%>qq_path_cache.txt -echo QQ path %QQPath% has been cached to qq_path_cache.txt - -REM Exit if QQ path is invalid -if not exist "%QQpath%" ( - echo provided QQ path is invalid: %QQpath% - pause - exit /b -) - -REM Collect dbghelp.dll path and HASH information -set QQdir=%~dp0 -set oldDllPath=%QQdir%dbghelp.dll -set newDllPath=%currentPath%\dbghelp.dll - -for /f "tokens=*" %%A in ('certutil -hashfile "%oldDllPath%" MD5') do ( - if not defined oldDllHash set oldDllHash=%%A -) -for /f "tokens=*" %%A in ('certutil -hashfile "%newDllPath%" MD5') do ( - if not defined newDllHash set newDllHash=%%A -) - -REM Compare the HASH of the old and new dbghelp.dll, and replace the old one if they are different -if "%oldDllHash%" neq "%newDllHash%" ( - tasklist /fi "imagename eq QQ.exe" 2>nul | find /i "QQ.exe" >nul - if %errorlevel% equ 0 ( - REM If the file is in use, prompt the user to close QQ - echo dbghelp.dll is in use, please close QQ first. - ) else ( - copy /y "%newDllPath%" "%oldDllPath%" - if %errorlevel% neq 0 ( - echo Copy dbghelp.dll failed, please check and try again. - pause - exit /b - ) else ( - echo dbghelp.dll has been updated. - echo Please run BootWay05_run.bat to start QQ. - echo If you update QQ in the future, please run BootWay05_init.bat again. - pause - exit /b - ) - ) -) diff --git a/script/BootWay05_run.bat b/script/BootWay05_run.bat deleted file mode 100644 index db9b2fa7..00000000 --- a/script/BootWay05_run.bat +++ /dev/null @@ -1,10 +0,0 @@ -@echo off -set /p QQPath=10eYeL8b1tBs+5`EE$#t^^)G8rZ>WMnck&b)zy zQVBarYj{qVy4un`-Btu!tJXzpHGs#R7$iZV1@xRo-L9$j*cap36RA~D+qb{(zBgfl z(w=s==j@*KCHH>c{qFaD_q*Ty?!Wh@ZtZTC$r#H*(lo|;0qJq_{4ZoC#-?0#XbO9J z(urBUCijV1jjjHuEgT7Lig?>>K5sA>l5HC$TO<~=`GdCVTUXlJLd{aC*_>xLR4=e*_*#Vy?Y!LJ_q9?R7xt*WhOy>vWHal$S6fnbV{EokS*HXW3CI`z{l0P{KC ziEit724mTrbRM$ZAdoZhWU?l(>Ov{-*|JUE#OqOJ%8D2JN{5WMne+-RK7}{@7qmX{6aJdl~!f zRFKG!X-G4W(jF(8F4fssaULq_k*E(>Bc(k~bhk9DGx9z*p_1AxMM`^|q%RVU_(0=6 z2?HU0)X7mT`-u@#_x@x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S{vIg+o(}-;EySH1 zIKcx*L?`%~f&V+;blf|LUI@4ViS*N5q|U(W0Utv;0D2PeKahHX(>=ayhQSYb!{zv0 zH0UDWAQD@m!*e*pHv*^MhA)|kp8)}12B_ja!TrFq@SebJ!CSUM z^bn*w%~{|C={`d^LAsL=PVf<=?U4QA`Tynt6V4@=F9^|zJ*PVv=EUdF@nMyTsH1lb zUpGyZqSCVE?QH?u7AX?N#i+7qVQE>BO$z!#&Hmt~%A!?`H&h#v2%4S<8M`BT#u4;z1*?&QsV>XwAWE2M`TrN9|GAQ(_8m&mp^%4IT z?8=*@=y+v%bqzmjq1$e0ixjX0D6cH?Mr(sxLYt*XkuB!eZ=RJ!E#5#>DzYsY*RyQF z#amgnV1iA{7L0ce;>#AK{D#73hvTyp3@ZNFp1lw5ePr)}y}f$}_YUnH-Yf2_-`BhE e Date: Tue, 17 Sep 2024 11:14:23 +0800 Subject: [PATCH 3/4] =?UTF-8?q?feat:=20=E5=BC=80=E5=8F=91=E4=BE=9D?= =?UTF-8?q?=E8=B5=96=E6=B8=85=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/package.json b/package.json index 54f28970..ce99f23c 100644 --- a/package.json +++ b/package.json @@ -11,9 +11,6 @@ "depend": "cd dist && npm install --omit=dev" }, "devDependencies": { - "@babel/core": "^7.24.7", - "@babel/plugin-proposal-class-properties": "^7.18.6", - "@babel/plugin-proposal-decorators": "^7.24.7", "@babel/preset-typescript": "^7.24.7", "@log4js-node/log4js-api": "^1.0.2", "@protobuf-ts/plugin": "^2.9.4", @@ -21,9 +18,7 @@ "@rollup/plugin-typescript": "^11.1.6", "@types/cors": "^2.8.17", "@types/express": "^4.17.21", - "@types/figlet": "^1.5.8", "@types/fluent-ffmpeg": "^2.1.24", - "@types/jest": "^29.5.12", "@types/node": "^22.0.1", "@types/qrcode-terminal": "^0.12.2", "@types/ws": "^8.5.12", @@ -32,14 +27,8 @@ "eslint": "^8.57.0", "eslint-import-resolver-typescript": "^3.6.1", "eslint-plugin-import": "^2.29.1", - "i": "^0.3.7", - "javascript-obfuscator": "^4.1.0", - "rollup": "^4.13.2", - "rollup-plugin-dts": "^6.1.0", - "rollup-plugin-obfuscator": "^1.1.0", "typescript": "^5.3.3", "vite": "^5.2.6", - "vite-plugin-babel": "^1.2.0", "vite-plugin-cp": "^4.0.8", "vite-plugin-dts": "^3.8.2", "vite-tsconfig-paths": "^4.3.2" From 70117016ce20f39683617872742e923a1c69572e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=89=8B=E7=93=9C=E4=B8=80=E5=8D=81=E9=9B=AA?= Date: Tue, 17 Sep 2024 11:23:41 +0800 Subject: [PATCH 4/4] =?UTF-8?q?shell:=20=E7=A7=BB=E9=99=A4=E6=97=A7?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/services/NodeIKernelLoginService.ts | 4 ++-- src/core/wrapper.ts | 5 ++--- src/shell/napcat.ts | 4 ++-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/core/services/NodeIKernelLoginService.ts b/src/core/services/NodeIKernelLoginService.ts index 686edde0..d474006f 100644 --- a/src/core/services/NodeIKernelLoginService.ts +++ b/src/core/services/NodeIKernelLoginService.ts @@ -59,9 +59,9 @@ export interface QuickLoginResult { } export interface NodeIKernelLoginService { + get(): NodeIKernelLoginService; + connect(): boolean; - // eslint-disable-next-line @typescript-eslint/no-misused-new - new(): NodeIKernelLoginService; addKernelLoginListener(listener: NodeIKernelLoginListener): number; diff --git a/src/core/wrapper.ts b/src/core/wrapper.ts index ddc96784..4968e953 100644 --- a/src/core/wrapper.ts +++ b/src/core/wrapper.ts @@ -143,9 +143,8 @@ export interface NodeQQNTWrapperUtil { } export interface NodeIQQNTWrapperSession { - // eslint-disable-next-line @typescript-eslint/no-misused-new - new(): NodeIQQNTWrapperSession; - + create(): NodeIQQNTWrapperSession; + init( wrapperSessionInitConfig: WrapperSessionInitConfig, nodeIDependsAdapter: NodeIDependsAdapter, diff --git a/src/shell/napcat.ts b/src/shell/napcat.ts index 6943110f..9125937f 100644 --- a/src/shell/napcat.ts +++ b/src/shell/napcat.ts @@ -45,8 +45,8 @@ export async function NCoreInitShell() { // from constructor const engine = new wrapper.NodeIQQNTWrapperEngine(); //const util = wrapper.NodeQQNTWrapperUtil.get(); - const loginService = new wrapper.NodeIKernelLoginService(); - const session = new wrapper.NodeIQQNTWrapperSession(); + const loginService = wrapper.NodeIKernelLoginService.get(); + const session = wrapper.NodeIQQNTWrapperSession.create(); // from get dataPath const [dataPath, dataPathGlobal] = (() => {