From 61cfa0e86d83671374e02c453fdf68e4f3c78420 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: Wed, 3 Jul 2024 14:30:55 +0800 Subject: [PATCH] release: 1.6.4 --- docs/changelogs/CHANGELOG.v1.6.4.md | 18 ++++++++ docs/changelogs/{ => old}/CHANGELOG.v1.6.3.md | 0 package.json | 2 +- script/BootWay.03.ps1 | 45 +++++++++++++++++++ script/index.js | 20 +++++++++ src/onebot11/version.ts | 2 +- src/webui/ui/NapCat.ts | 2 +- static/assets/renderer.js | 2 +- 8 files changed, 87 insertions(+), 4 deletions(-) create mode 100644 docs/changelogs/CHANGELOG.v1.6.4.md rename docs/changelogs/{ => old}/CHANGELOG.v1.6.3.md (100%) create mode 100644 script/BootWay.03.ps1 create mode 100644 script/index.js diff --git a/docs/changelogs/CHANGELOG.v1.6.4.md b/docs/changelogs/CHANGELOG.v1.6.4.md new file mode 100644 index 000000000..210fa0947 --- /dev/null +++ b/docs/changelogs/CHANGELOG.v1.6.4.md @@ -0,0 +1,18 @@ +# v1.6.4 + +QQ Version: Windows 9.9.12-26000 / Linux 3.2.9-26000 +## 使用前警告 +1. 在最近版本由于QQ本体大幅变动,为了保证NapCat可用性,NapCat近期启动与安装方式将将大幅变动,请关注文档和社群获取。 +2. 在Core上完全执行开源,请不要用于违法用途,如此可能造成NapCat完全停止更新。 +3. 针对原启动方式的围堵,NapCat研发了多种方式,除此其余理论与扩展的分析和思路将部分展示于Docs,以便各位参与开发与维护NapCat。 +## 其余·备注 +启动方式: WayBoot.03 (Electron Main进程为Node 直接注入代码 同理项目: LiteLoader) + +## 修复与优化 +1. 支持Win平台 9.9.12 +2. 修复部分发送图片下载异常情况 + +## 新增与调整 +没有哦 + +新增的 API 详细见[API文档](https://napneko.github.io/zh-CN/develop/extends_api) diff --git a/docs/changelogs/CHANGELOG.v1.6.3.md b/docs/changelogs/old/CHANGELOG.v1.6.3.md similarity index 100% rename from docs/changelogs/CHANGELOG.v1.6.3.md rename to docs/changelogs/old/CHANGELOG.v1.6.3.md diff --git a/package.json b/package.json index 17c758b01..740897236 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "napcat", "private": true, "type": "module", - "version": "1.6.3", + "version": "1.6.4", "scripts": { "watch:dev": "vite --mode development", "watch:prod": "vite --mode production", diff --git a/script/BootWay.03.ps1 b/script/BootWay.03.ps1 new file mode 100644 index 000000000..7f97070cd --- /dev/null +++ b/script/BootWay.03.ps1 @@ -0,0 +1,45 @@ +# 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 $params}" \ No newline at end of file diff --git a/script/index.js b/script/index.js new file mode 100644 index 000000000..cb658ca8e --- /dev/null +++ b/script/index.js @@ -0,0 +1,20 @@ +// -------------------- +// 2024.7.3 9.9.12 BootWay.03 其余方法暂不公开(此方案为临时方案 Win平台已验证) +// 缺陷 (已知) +// 1.与非入侵式不同 现在破坏本体代码 +// 2.重启代码与正常启动代码失效 +// 3.Win需要补丁 +// 4.更新后丢失内容 需要重写此文件 +// 5.安装难度上升与周围基础设施失效 +// -------------------- + +const path = require('path'); +const CurrentPath = path.dirname(__filename) +const hasNapcatParam = process.argv.includes('--enable-logging'); +if (hasNapcatParam) { + (async () => { + await import("file://" + path.join(CurrentPath, './napcat/napcat.mjs')); + })(); +} else { + require('./launcher.node').load('external_index', module); +} \ No newline at end of file diff --git a/src/onebot11/version.ts b/src/onebot11/version.ts index d2ce968b4..7a76e174c 100644 --- a/src/onebot11/version.ts +++ b/src/onebot11/version.ts @@ -1 +1 @@ -export const version = '1.6.3'; +export const version = '1.6.4'; diff --git a/src/webui/ui/NapCat.ts b/src/webui/ui/NapCat.ts index ec406c0ad..1e034d492 100644 --- a/src/webui/ui/NapCat.ts +++ b/src/webui/ui/NapCat.ts @@ -29,7 +29,7 @@ async function onSettingWindowCreated(view: Element) { SettingItem( 'Napcat', undefined, - SettingButton('V1.6.3', 'napcat-update-button', 'secondary') + SettingButton('V1.6.4', 'napcat-update-button', 'secondary') ), ]), SettingList([ diff --git a/static/assets/renderer.js b/static/assets/renderer.js index 6a9196adc..3cb1eb494 100644 --- a/static/assets/renderer.js +++ b/static/assets/renderer.js @@ -167,7 +167,7 @@ async function onSettingWindowCreated(view) { SettingItem( 'Napcat', void 0, - SettingButton("V1.6.3", "napcat-update-button", "secondary") + SettingButton("V1.6.4", "napcat-update-button", "secondary") ) ]), SettingList([