mirror of
https://github.com/HugoAura/Seewo-HugoAura.git
synced 2026-06-21 15:44:26 +08:00
Compare commits
20 Commits
vAutoBuild
...
v0.1.1-bet
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5a29e909f2 | ||
|
|
2b9d1c97c5 | ||
|
|
abd5a10d24 | ||
|
|
c857f00771 | ||
|
|
6b64481e2e | ||
|
|
fb01b27d1d | ||
|
|
585f1713a9 | ||
|
|
2ff4a28b70 | ||
|
|
d5b4c4b61e | ||
|
|
774d999752 | ||
|
|
ae2e2ff62d | ||
|
|
b8f27d9f7c | ||
|
|
807ac913da | ||
|
|
f6a30351fd | ||
|
|
0494394fd8 | ||
|
|
6be31652f9 | ||
|
|
a638a29cc6 | ||
|
|
dae0f033a5 | ||
|
|
bd2f2e4154 | ||
|
|
290cbfed53 |
3
.github/ISSUE_TEMPLATE/bugReport.yml
vendored
3
.github/ISSUE_TEMPLATE/bugReport.yml
vendored
@@ -54,10 +54,11 @@ body:
|
|||||||
- type: textarea
|
- type: textarea
|
||||||
attributes:
|
attributes:
|
||||||
label: 日志 / Logs
|
label: 日志 / Logs
|
||||||
description: 请前往 `用户文件夹/Documents/HugoAura/logs` 取得日志
|
description: 请前往 `偏好设置` - `调试选项` 打开日志文件夹
|
||||||
placeholder: |
|
placeholder: |
|
||||||
[LOG] Logger initialized. Log file: C:\...
|
[LOG] Logger initialized. Log file: C:\...
|
||||||
[LOG] [HugoAura / Loaded] Aura is loaded!
|
[LOG] [HugoAura / Loaded] Aura is loaded!
|
||||||
|
render: bash
|
||||||
validations:
|
validations:
|
||||||
required: false
|
required: false
|
||||||
|
|
||||||
|
|||||||
2
.github/ISSUE_TEMPLATE/other.yml
vendored
2
.github/ISSUE_TEMPLATE/other.yml
vendored
@@ -16,5 +16,5 @@ body:
|
|||||||
attributes:
|
attributes:
|
||||||
label: 提交前请确认 / Confirm before submit
|
label: 提交前请确认 / Confirm before submit
|
||||||
options:
|
options:
|
||||||
- label: 请勿利用此 Issue 类型进行灌水 / 闲聊, 如果您有相关需求, 可留意后续 HugoAura 的论坛 / 用户讨论群开放情况
|
- label: 请勿利用此 Issue 类型进行闲聊 / 灌水, 如需闲聊, 可移步至 HugoAura 社区 (forum.aurax.cc)
|
||||||
required: true
|
required: true
|
||||||
|
|||||||
157
.github/workflows/pack.yml
vendored
157
.github/workflows/pack.yml
vendored
@@ -1,136 +1,89 @@
|
|||||||
name: Patch ASAR & Pack source code
|
name: Pack source code & Create CI/CD Release
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: '0 5 * * *'
|
||||||
push:
|
push:
|
||||||
branches: [dev, stable]
|
branches: [dev, stable]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [dev, stable, main, master]
|
branches: [dev, stable, main, master]
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions: write-all
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
pack:
|
pack:
|
||||||
name: Patch & Pack
|
name: Pack
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Setup Node.JS 20 LTS
|
|
||||||
uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: "20"
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: |
|
|
||||||
sudo apt update
|
|
||||||
sudo apt install -y p7zip-full wget
|
|
||||||
npm install -g asar
|
|
||||||
|
|
||||||
- name: Checkout repository code
|
- name: Checkout repository code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
path: "./HugoAura-Code"
|
path: "./HugoAura-Code"
|
||||||
|
|
||||||
- name: Download SeewoServiceSetup
|
- name: Create aura.zip
|
||||||
run: |
|
|
||||||
echo "[DEBUG] Working DIR:"
|
|
||||||
pwd
|
|
||||||
|
|
||||||
wget -nv -O "SeewoService.exe" "https://e.seewo.com/download/file?code=SeewoServiceSetup"
|
|
||||||
echo "[DEBUG] Listing downloaded file"
|
|
||||||
ls -la SeewoService*
|
|
||||||
|
|
||||||
- name: Extract SeewoServiceSetup as zip
|
|
||||||
run: |
|
|
||||||
mkdir -p SeewoServiceSource
|
|
||||||
7z x "SeewoService.exe" -o"./SeewoServiceSource/" -y
|
|
||||||
|
|
||||||
echo "[DEBUG] Listing extracted files"
|
|
||||||
ls -la SeewoServiceSource/
|
|
||||||
|
|
||||||
- name: Extract ASAR file
|
|
||||||
run: |
|
|
||||||
cd SeewoServiceSource
|
|
||||||
SEEWO_DIR=$(find . -name "SeewoService_*" -type d | head -1)
|
|
||||||
echo "[INFO] Found SeewoService directory: $SEEWO_DIR"
|
|
||||||
|
|
||||||
cd "$SEEWO_DIR/SeewoServiceAssistant/resources/"
|
|
||||||
|
|
||||||
asar extract ./app.asar ./app-unpacked
|
|
||||||
|
|
||||||
- name: Move app-unpacked and clean SSASource
|
|
||||||
run: |
|
|
||||||
mkdir -p SSARes
|
|
||||||
|
|
||||||
cd SeewoServiceSource
|
|
||||||
SEEWO_DIR=$(find . -name "SeewoService_*" -type d | head -1)
|
|
||||||
mv "$SEEWO_DIR/SeewoServiceAssistant/resources/app-unpacked" "../SSARes/"
|
|
||||||
|
|
||||||
cd ..
|
|
||||||
rm -rf SeewoServiceSource
|
|
||||||
rm -rf *.exe
|
|
||||||
echo "[DEBUG] Listing Working DIR"
|
|
||||||
ls -la
|
|
||||||
|
|
||||||
- name: Patch main.js
|
|
||||||
run: |
|
|
||||||
cd SSARes/app-unpacked
|
|
||||||
|
|
||||||
### cp main.js main.js.bak
|
|
||||||
|
|
||||||
cat > patch_main.js << 'EOF'
|
|
||||||
const fs = require('fs');
|
|
||||||
|
|
||||||
let content = fs.readFileSync('main.js', 'utf8');
|
|
||||||
|
|
||||||
content = 'const hook = require("./hook.js");\n' + content;
|
|
||||||
|
|
||||||
content = content.replace(/n\.m=e/, ';const zeron = require("./zeron.js");n = zeron(n);n.m=e');
|
|
||||||
|
|
||||||
content = content.replace(/let f=new s\(Object\.assign\(\{\},\{transparent:!0,/, ';hook({ central: n, windowName: this.wname, config: c });let f=new s(Object.assign({},{transparent:!0,');
|
|
||||||
|
|
||||||
content = content.replace(/c\.canOpenDevTool/, 'c.canOpenDevTool,preload: __dirname + "\\\\preload.js"');
|
|
||||||
|
|
||||||
fs.writeFileSync('main.js', content);
|
|
||||||
|
|
||||||
console.log('[SUCCESS] main.js has been modified successfully');
|
|
||||||
EOF
|
|
||||||
|
|
||||||
echo "[DEBUG] Running patch_main.js"
|
|
||||||
node ./patch_main.js
|
|
||||||
|
|
||||||
rm -rf patch_main.js
|
|
||||||
|
|
||||||
- name: Copy HugoAura core files
|
|
||||||
run: |
|
|
||||||
cp -r HugoAura-Code/src/core/* SSARes/app-unpacked/
|
|
||||||
|
|
||||||
echo "[DEBUG] Listing files under <Working DIR>/SSARes/app-unpacked/"
|
|
||||||
ls -la SSARes/app-unpacked/
|
|
||||||
|
|
||||||
- name: Create artifacts DIR and re-pack ASAR
|
|
||||||
run: |
|
run: |
|
||||||
echo "[DEBUG] Creating artifacts directory"
|
echo "[DEBUG] Creating artifacts directory"
|
||||||
mkdir -p Artifacts
|
mkdir -p Artifacts
|
||||||
|
cd ./HugoAura-Code/src/aura
|
||||||
asar pack SSARes/app-unpacked Artifacts/app-patched.asar
|
|
||||||
|
|
||||||
- name: Create aura.zip
|
|
||||||
run: |
|
|
||||||
cd HugoAura-Code/src/aura
|
|
||||||
zip -r ../../../Artifacts/aura.zip .
|
zip -r ../../../Artifacts/aura.zip .
|
||||||
|
cd ../core
|
||||||
|
zip -r ../../../Artifacts/core.zip .
|
||||||
cd ../../..
|
cd ../../..
|
||||||
|
|
||||||
echo "[DEBUG] Files in <Working DIR>/Artifacts directory:"
|
echo "[DEBUG] Files in <Working DIR>/Artifacts directory:"
|
||||||
ls -la Artifacts/
|
ls -la Artifacts/
|
||||||
|
|
||||||
- name: Upload patched ASAR
|
- name: Get commit hash & build time
|
||||||
uses: actions/upload-artifact@v4
|
run: |
|
||||||
with:
|
cd ./HugoAura-Code
|
||||||
name: asar-patched
|
SHORT_HASH=$(git rev-parse --short=7 HEAD)
|
||||||
path: Artifacts/app-patched.asar
|
FULL_HASH=$(git rev-parse HEAD)
|
||||||
|
echo "SHORT_HASH=$SHORT_HASH" >> $GITHUB_ENV
|
||||||
|
echo "FULL_HASH=$FULL_HASH" >> $GITHUB_ENV
|
||||||
|
echo "BUILDTIME=$(TZ=Asia/Shanghai date)" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Create release content
|
||||||
|
run: |
|
||||||
|
cat > rel_msg.txt << 'EOF'
|
||||||
|
## 这是 HugoAura 的 CI 自动构建版本
|
||||||
|
|
||||||
|
### 版本类型: 🔁 自动构建版
|
||||||
|
|
||||||
|
### 版本号: `vAutoBuild-${{ env.SHORT_HASH }}`
|
||||||
|
|
||||||
|
### 对应 Commit: [`${{ env.SHORT_HASH }}`](https://github.com/HugoAura/Seewo-HugoAura/commit/${{ env.FULL_HASH }})
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### ⚠ 注意: CI 自动构建版本可能不稳定 / 存在较多 Bug, 更新时请留意
|
||||||
|
|
||||||
|
#### 🕘 构建时间: ${{ env.BUILDTIME }}
|
||||||
|
EOF
|
||||||
|
|
||||||
- name: Upload aura.zip
|
- name: Upload aura.zip
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: aura-code
|
name: aura-code
|
||||||
path: Artifacts/aura.zip
|
path: Artifacts/aura.zip
|
||||||
|
|
||||||
|
- name: Upload core.zip
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: aura-core
|
||||||
|
path: Artifacts/core.zip
|
||||||
|
|
||||||
|
- name: Upload release
|
||||||
|
uses: softprops/action-gh-release@v2
|
||||||
|
with:
|
||||||
|
tag_name: vAutoBuild
|
||||||
|
name: "[CI] HugoAura Auto Build Release"
|
||||||
|
body_path: rel_msg.txt
|
||||||
|
prerelease: true
|
||||||
|
generate_release_notes: false
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
files: |
|
||||||
|
Artifacts/aura.zip
|
||||||
|
Artifacts/core.zip
|
||||||
|
|||||||
26
.github/workflows/trigger-install-upd.yml
vendored
Normal file
26
.github/workflows/trigger-install-upd.yml
vendored
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
name: Trigger Aura Install static JSON update
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
trigger-dispatch:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
if: github.event.release.tag_name != 'vAutoBuild'
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Trigger repository dispatch
|
||||||
|
uses: peter-evans/repository-dispatch@v3
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.AURA_INSTALL_REPO_PAT }}
|
||||||
|
repository: HugoAura/HugoAura-Install
|
||||||
|
event-type: hugoaura_rel
|
||||||
|
client-payload: |
|
||||||
|
{
|
||||||
|
"tag_name": "${{ github.event.release.tag_name }}",
|
||||||
|
"release_name": "${{ github.event.release.name }}",
|
||||||
|
"release_url": "${{ github.event.release.html_url }}",
|
||||||
|
"repository": "${{ github.repository }}"
|
||||||
|
}
|
||||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -22,3 +22,6 @@ desktop.ini
|
|||||||
|
|
||||||
# Editor Files
|
# Editor Files
|
||||||
.vscode/
|
.vscode/
|
||||||
|
|
||||||
|
# Misc
|
||||||
|
*.bak
|
||||||
|
|||||||
32
README.md
32
README.md
@@ -3,16 +3,28 @@
|
|||||||
<h1 align="center">HugoAura</h1>
|
<h1 align="center">HugoAura</h1>
|
||||||
<h4 align="center">下一代希沃管家注入式修改方案</h4>
|
<h4 align="center">下一代希沃管家注入式修改方案</h4>
|
||||||
<div align="center">
|
<div align="center">
|
||||||
<a href="https://github.com/HugoAura/HugoAura">首页</a> · <a href="https://hugoaura.org/about">关于</a> · <a href="https://github.com/HugoAura/HugoAura/wiki">文档</a> · <a href="https://github.com/HugoAura/HugoAura/issues">反馈</a>
|
<a href="https://github.com/HugoAura/HugoAura">首页</a> · <a href="https://hugo.aurax.cc/about">关于</a> · <a href="https://github.com/HugoAura/HugoAura/wiki">文档</a> · <a href="https://github.com/HugoAura/HugoAura/issues">反馈</a> · <a href="https://forum.aurax.cc/">社区</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
|
|
||||||
> [!TIP]
|
> [!TIP]
|
||||||
> HugoAura 的首个预览版已发布! [查看安装教程](https://github.com/HugoAura/HugoAura/wiki)
|
> 在[此处](https://github.com/HugoAura/HugoAura/wiki)查看 HugoAura 的安装教程
|
||||||
|
|
||||||
> [!IMPORTANT]
|
> [!IMPORTANT]
|
||||||
> 已经过测试的希沃管家版本: v1.5.4.3824
|
> 已经过测试的希沃管家版本: v1.5.5.3878
|
||||||
|
|
||||||
|
> [!CAUTION]
|
||||||
|
> 由于作者高三学业繁忙, 项目正处于缓慢更新阶段。
|
||||||
|
>
|
||||||
|
> 作者将尽可能抽出时间维护项目, 但新功能的实现速度将大幅降低。
|
||||||
|
|
||||||
|
> [!WARNING]
|
||||||
|
> 我们正在使用 C++ 重构 PLS, 新的子项目代号为 [Aikari](https://github.com/HugoAura/HugoAura-Aikari)。其将集成 MQTT 消息中转、HugoAura 自动更新、特权操作辅助等功能。
|
||||||
|
>
|
||||||
|
> 在 Aikari 的首个 Alpha 版本发布前, HugoAura 主项目与 [PLS](https://github.com/HugoAura/HugoAura-PLS) 的新功能更新频率将减弱。
|
||||||
|
>
|
||||||
|
> 您依然可以提出 Feature Request 或 Bug Report。开发者将在能力 / 时间限度内尽可能处理。
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
@@ -33,7 +45,7 @@
|
|||||||
- [x] 修改希沃管家密码认证组件 (自定义密码 / 解除密码 / 重设认证方式 / ...)
|
- [x] 修改希沃管家密码认证组件 (自定义密码 / 解除密码 / 重设认证方式 / ...)
|
||||||
- [x] 阻止希沃管家前端 Audit 上报行为
|
- [x] 阻止希沃管家前端 Audit 上报行为
|
||||||
- [x] 屏蔽屏幕锁 / 自定义屏幕锁行为
|
- [x] 屏蔽屏幕锁 / 自定义屏幕锁行为
|
||||||
- [ ] Aura 代理层服务 (篡改上报数据 / 欺骗冰冻状态)
|
- [x] Aura 代理层服务 (篡改上报数据 / 欺骗冰冻状态)
|
||||||
- [ ] 窥屏提醒
|
- [ ] 窥屏提醒
|
||||||
- [ ] 插件功能
|
- [ ] 插件功能
|
||||||
|
|
||||||
@@ -55,6 +67,18 @@
|
|||||||
|
|
||||||
请参阅 [Wiki](https://github.com/HugoAura/HugoAura/wiki) 以了解安装流程。
|
请参阅 [Wiki](https://github.com/HugoAura/HugoAura/wiki) 以了解安装流程。
|
||||||
|
|
||||||
|
## 🤖 AIGC 声明
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
## 📦 贡献准则
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
## 🎉 鸣谢
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
## ❗ 免责声明
|
## ❗ 免责声明
|
||||||
|
|
||||||
本项目仅用于研究或教育目的, 请勿将本项目用于可能违反当地法律、侵犯著作权或其他软件 EULA 的用途。若将本项目用于非法用途, 一切后果由使用者承担。开发者不承担此类行为带来的任何后果或责任。
|
本项目仅用于研究或教育目的, 请勿将本项目用于可能违反当地法律、侵犯著作权或其他软件 EULA 的用途。若将本项目用于非法用途, 一切后果由使用者承担。开发者不承担此类行为带来的任何后果或责任。
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "HugoAura",
|
"name": "HugoAura",
|
||||||
"version": "0.1.1-pre-IV",
|
"version": "0.1.1-beta-patch-1",
|
||||||
"description": "Aura for SeewoHugo",
|
"description": "Aura for SeewoHugo",
|
||||||
"main": "app.asar/main.js",
|
"main": "app.asar/main.js",
|
||||||
"dependencies": {},
|
"dependencies": {},
|
||||||
|
|||||||
@@ -77,6 +77,7 @@ const buildIpcMain = (electron) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const { applyBaseIpcHandler } = require("./ipcModules/baseIpcHandler");
|
const { applyBaseIpcHandler } = require("./ipcModules/baseIpcHandler");
|
||||||
|
const { applyDebugIpcHandler } = require("./ipcModules/debugIpcHandler");
|
||||||
const { applyConfigIpcHandler } = require("./ipcModules/configIpcHandler");
|
const { applyConfigIpcHandler } = require("./ipcModules/configIpcHandler");
|
||||||
const { applyFsIpcHandler } = require("./ipcModules/fsIpcHandler");
|
const { applyFsIpcHandler } = require("./ipcModules/fsIpcHandler");
|
||||||
const { applyPlsIpcHandler } = require("./ipcModules/plsIpcHandler");
|
const { applyPlsIpcHandler } = require("./ipcModules/plsIpcHandler");
|
||||||
@@ -87,6 +88,7 @@ const buildIpcMain = (electron) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
applyBaseIpcHandler(ipcMain);
|
applyBaseIpcHandler(ipcMain);
|
||||||
|
applyDebugIpcHandler(ipcMain);
|
||||||
applyConfigIpcHandler(ipcMain);
|
applyConfigIpcHandler(ipcMain);
|
||||||
applyFsIpcHandler(ipcMain);
|
applyFsIpcHandler(ipcMain);
|
||||||
applyPlsIpcHandler(ipcMain);
|
applyPlsIpcHandler(ipcMain);
|
||||||
|
|||||||
@@ -1,59 +1,73 @@
|
|||||||
// @ts-check
|
// @ts-check
|
||||||
|
|
||||||
const { BrowserWindow } = require("electron");
|
const { BrowserWindow } = require("electron");
|
||||||
|
|
||||||
const composables = {
|
const composables = {
|
||||||
getBrowserWindowInstance: (windowKey) => {
|
getBrowserWindowInstance: (windowKey) => {
|
||||||
if (!global.__HUGO_AURA__.hookedWindows) return null;
|
if (!global.__HUGO_AURA__.hookedWindows) return null;
|
||||||
const hookedWindowIns = global.__HUGO_AURA__.hookedWindows.get(windowKey);
|
const hookedWindowIns = global.__HUGO_AURA__.hookedWindows.get(windowKey);
|
||||||
if (!hookedWindowIns) return undefined;
|
if (!hookedWindowIns) return undefined;
|
||||||
const browserWindowIns = BrowserWindow.fromWebContents(
|
const browserWindowIns = BrowserWindow.fromWebContents(
|
||||||
hookedWindowIns.webContents
|
hookedWindowIns.webContents
|
||||||
);
|
);
|
||||||
return browserWindowIns;
|
return browserWindowIns;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param {import("electron").IpcMain} ipcMain
|
* @param {import("electron").IpcMain} ipcMain
|
||||||
*/
|
*/
|
||||||
const applyBaseIpcHandler = (ipcMain) => {
|
const applyBaseIpcHandler = (ipcMain) => {
|
||||||
const methodBase = "$aura.base";
|
const methodBase = "$aura.base";
|
||||||
|
|
||||||
ipcMain.on(
|
ipcMain.on(
|
||||||
`${methodBase}.minimizeWindow`,
|
`${methodBase}.minimizeWindow`,
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param {import("electron").IpcMainEvent} _event
|
* @param {import("electron").IpcMainEvent} _event
|
||||||
* @param {{ targetWindowKey: string }} arg
|
* @param {{ targetWindowKey: string }} arg
|
||||||
*/
|
*/
|
||||||
(_event, arg) => {
|
(_event, arg) => {
|
||||||
const browserWindowIns = composables.getBrowserWindowInstance(
|
const browserWindowIns = composables.getBrowserWindowInstance(
|
||||||
arg.targetWindowKey
|
arg.targetWindowKey
|
||||||
);
|
);
|
||||||
if (!browserWindowIns) return;
|
if (!browserWindowIns) return;
|
||||||
|
|
||||||
browserWindowIns.minimize();
|
browserWindowIns.minimize();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
ipcMain.on(
|
ipcMain.on(
|
||||||
`${methodBase}.closeWindow`,
|
`${methodBase}.closeWindow`,
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param {import("electron").IpcMainEvent} _event
|
* @param {import("electron").IpcMainEvent} _event
|
||||||
* @param {{ targetWindowKey: string }} arg
|
* @param {{ targetWindowKey: string }} arg
|
||||||
*/
|
*/
|
||||||
(_event, arg) => {
|
(_event, arg) => {
|
||||||
const browserWindowIns = composables.getBrowserWindowInstance(
|
const browserWindowIns = composables.getBrowserWindowInstance(
|
||||||
arg.targetWindowKey
|
arg.targetWindowKey
|
||||||
);
|
);
|
||||||
if (!browserWindowIns) return;
|
if (!browserWindowIns) return;
|
||||||
|
|
||||||
browserWindowIns.close();
|
browserWindowIns.close();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
};
|
|
||||||
|
ipcMain.handle(`${methodBase}.getAuraDirAsync`, (_evt, _arg) => {
|
||||||
module.exports = { applyBaseIpcHandler };
|
return {
|
||||||
|
success: true,
|
||||||
|
data: global.__HUGO_AURA__.auraDir,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
ipcMain.on(`${methodBase}.getAuraDirSync`, (event, _arg) => {
|
||||||
|
event.returnValue = {
|
||||||
|
success: true,
|
||||||
|
data: global.__HUGO_AURA__.auraDir,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports = { applyBaseIpcHandler };
|
||||||
|
|||||||
13
src/aura/init/main/ipcModules/debugIpcHandler.js
Normal file
13
src/aura/init/main/ipcModules/debugIpcHandler.js
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
// @ts-check
|
||||||
|
|
||||||
|
const __SCOPE = "main";
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {import("electron").IpcMain} ipcMain
|
||||||
|
*/
|
||||||
|
const applyDebugIpcHandler = (ipcMain) => {
|
||||||
|
const methodBase = "$aura.debug";
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports = { applyDebugIpcHandler };
|
||||||
@@ -227,7 +227,7 @@ const applyPlsIpcHandler = (ipcMain) => {
|
|||||||
launched: false,
|
launched: false,
|
||||||
detached: isPlsDetached,
|
detached: isPlsDetached,
|
||||||
connected: false,
|
connected: false,
|
||||||
version: "未知",
|
version: "unknown",
|
||||||
status: "dead",
|
status: "dead",
|
||||||
authToken: global.__HUGO_AURA_CONFIG__.plsToken,
|
authToken: global.__HUGO_AURA_CONFIG__.plsToken,
|
||||||
};
|
};
|
||||||
@@ -418,7 +418,7 @@ const applyPlsIpcHandler = (ipcMain) => {
|
|||||||
*/
|
*/
|
||||||
(_event, arg) => {
|
(_event, arg) => {
|
||||||
ipcMain.send(
|
ipcMain.send(
|
||||||
"desktopAssistant",
|
"auraWsKeepAlive",
|
||||||
`${methodBase}.ws.post.onReqSendMsg`,
|
`${methodBase}.ws.post.onReqSendMsg`,
|
||||||
arg
|
arg
|
||||||
);
|
);
|
||||||
@@ -490,12 +490,42 @@ const applyPlsIpcHandler = (ipcMain) => {
|
|||||||
PLS_BIN_PATH,
|
PLS_BIN_PATH,
|
||||||
"--startup auto install"
|
"--startup auto install"
|
||||||
);
|
);
|
||||||
case "rmSvc":
|
case "rmSvc": {
|
||||||
return await functions.execCommand(logHeader, PLS_BIN_PATH, "remove");
|
const result = await functions.execCommand(
|
||||||
|
logHeader,
|
||||||
|
PLS_BIN_PATH,
|
||||||
|
"remove"
|
||||||
|
);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
case "startSvc":
|
case "startSvc":
|
||||||
return await functions.execCommand(logHeader, PLS_BIN_PATH, "start");
|
return await functions.execCommand(logHeader, PLS_BIN_PATH, "start");
|
||||||
case "stopSvc":
|
case "stopSvc": {
|
||||||
return await functions.execCommand(logHeader, PLS_BIN_PATH, "stop");
|
const result = await functions.execCommand(
|
||||||
|
logHeader,
|
||||||
|
PLS_BIN_PATH,
|
||||||
|
"stop"
|
||||||
|
);
|
||||||
|
if (result.success && global.__HUGO_AURA__.plsStats) {
|
||||||
|
global.__HUGO_AURA__.plsStats.connected = false;
|
||||||
|
global.__HUGO_AURA__.plsStats.launched = false;
|
||||||
|
global.__HUGO_AURA__.plsStats.version = "unknown";
|
||||||
|
global.__HUGO_AURA__.plsStats.status = "dead";
|
||||||
|
|
||||||
|
ipcMain.send(
|
||||||
|
"assistant",
|
||||||
|
`${methodBase}.post.onPlsStatsUpdate`,
|
||||||
|
global.__HUGO_AURA__.plsStats
|
||||||
|
);
|
||||||
|
|
||||||
|
ipcMain.send(
|
||||||
|
"auraWsKeepAlive",
|
||||||
|
`${methodBase}.post.plsStopped`,
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
case "rmBin":
|
case "rmBin":
|
||||||
const unlinkPromise = new Promise((resolve) => {
|
const unlinkPromise = new Promise((resolve) => {
|
||||||
fs.unlink(PLS_BIN_PATH, (error) => {
|
fs.unlink(PLS_BIN_PATH, (error) => {
|
||||||
@@ -521,6 +551,19 @@ const applyPlsIpcHandler = (ipcMain) => {
|
|||||||
|
|
||||||
const unlinkRet = await unlinkPromise;
|
const unlinkRet = await unlinkPromise;
|
||||||
|
|
||||||
|
if (unlinkRet.success && global.__HUGO_AURA__.plsStats) {
|
||||||
|
global.__HUGO_AURA__.plsStats.connected = false;
|
||||||
|
global.__HUGO_AURA__.plsStats.launched = false;
|
||||||
|
global.__HUGO_AURA__.plsStats.installed = false;
|
||||||
|
global.__HUGO_AURA__.plsStats.version = "unknown";
|
||||||
|
|
||||||
|
ipcMain.send(
|
||||||
|
"assistant",
|
||||||
|
`${methodBase}.post.onPlsStatsUpdate`,
|
||||||
|
global.__HUGO_AURA__.plsStats
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return unlinkRet;
|
return unlinkRet;
|
||||||
default:
|
default:
|
||||||
return { success: false, errorObj: new Error("Method not found") };
|
return { success: false, errorObj: new Error("Method not found") };
|
||||||
@@ -568,7 +611,7 @@ const applyPlsIpcHandler = (ipcMain) => {
|
|||||||
status: "Already",
|
status: "Already",
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
ipcMain.send("desktopAssistant", `${methodBase}.retryPlsConnect`, arg);
|
ipcMain.send("auraWsKeepAlive", `${methodBase}.retryPlsConnect`, arg);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
success: true,
|
success: true,
|
||||||
|
|||||||
@@ -8,7 +8,10 @@ const util = require("util");
|
|||||||
* @param {import("../aura/types/main/core").WindowName} windowName
|
* @param {import("../aura/types/main/core").WindowName} windowName
|
||||||
*/
|
*/
|
||||||
const initLogger = (windowName) => {
|
const initLogger = (windowName) => {
|
||||||
const logDir = path.join(os.homedir(), "Documents", "HugoAura", "logs");
|
const logDir = path.join(global.__HUGO_AURA__.auraDir, "logs");
|
||||||
|
|
||||||
|
global.__HUGO_AURA__.logDir = logDir;
|
||||||
|
|
||||||
if (!fs.existsSync(logDir)) {
|
if (!fs.existsSync(logDir)) {
|
||||||
fs.mkdirSync(logDir, { recursive: true });
|
fs.mkdirSync(logDir, { recursive: true });
|
||||||
}
|
}
|
||||||
@@ -64,25 +67,22 @@ const initLogger = (windowName) => {
|
|||||||
console.error("[CRITICAL] UNCAUGHT EXCEPTION:", err);
|
console.error("[CRITICAL] UNCAUGHT EXCEPTION:", err);
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log(
|
console.log("[HugoAura / Logger] Logger initialized. Log file:", logFile);
|
||||||
"[HugoAura / Logger] Logger initialized. Log file:",
|
|
||||||
logFile
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const cleanupOldLogs = (logDir) => {
|
const cleanupOldLogs = (logDir) => {
|
||||||
try {
|
try {
|
||||||
const files = fs.readdirSync(logDir);
|
const files = fs.readdirSync(logDir);
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
const sevenDaysAgo = new Date(now.getTime() - 30 * 24 * 60 * 60 * 1000);
|
const daysAgo = new Date(now.getTime() - 15 * 24 * 60 * 60 * 1000);
|
||||||
|
|
||||||
files.forEach((file) => {
|
files.forEach((file) => {
|
||||||
if (file.endsWith(".log")) {
|
if (file.endsWith(".log")) {
|
||||||
const filePath = path.join(logDir, file);
|
const filePath = path.join(logDir, file);
|
||||||
const stats = fs.statSync(filePath);
|
const stats = fs.statSync(filePath);
|
||||||
|
|
||||||
// 如果文件创建时间超过 30 天, 则删除
|
// 如果文件创建时间超过两周, 则删除
|
||||||
if (stats.birthtime < sevenDaysAgo) {
|
if (stats.birthtime < daysAgo) {
|
||||||
fs.unlinkSync(filePath);
|
fs.unlinkSync(filePath);
|
||||||
console.log(
|
console.log(
|
||||||
`[HugoAura / Logger / Cleanup] Cleaned log file: ${file}`
|
`[HugoAura / Logger / Cleanup] Cleaned log file: ${file}`
|
||||||
@@ -91,7 +91,10 @@ const cleanupOldLogs = (logDir) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("[HugoAura / Logger / Cleanup] Unexpected error occurred cleaning log file:", error);
|
console.error(
|
||||||
|
"[HugoAura / Logger / Cleanup] Unexpected error occurred cleaning log file:",
|
||||||
|
error
|
||||||
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ class WindowHooksManager {
|
|||||||
|
|
||||||
const hooksPath = path.join(__dirname, "../../../aura/mainProcess/hooks");
|
const hooksPath = path.join(__dirname, "../../../aura/mainProcess/hooks");
|
||||||
|
|
||||||
/** @type {import("../../types/main/core").HooksMap} */
|
/** @type {import("../../types/main/core").UIHooksMap} */
|
||||||
const hooks = new Map();
|
const hooks = new Map();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -55,6 +55,9 @@ class WindowHooksManager {
|
|||||||
browserWindowInstance
|
browserWindowInstance
|
||||||
) {
|
) {
|
||||||
const stripWindowName = windowName.split("_")[0];
|
const stripWindowName = windowName.split("_")[0];
|
||||||
|
|
||||||
|
if (!global.__HUGO_AURA__.windowHooks) return;
|
||||||
|
|
||||||
if (!global.__HUGO_AURA__.windowHooks.has(stripWindowName)) {
|
if (!global.__HUGO_AURA__.windowHooks.has(stripWindowName)) {
|
||||||
console.log(
|
console.log(
|
||||||
`[HugoAura / Init / WDH] Window ${windowName} has no corresponding main process hooks, ignoring...`
|
`[HugoAura / Init / WDH] Window ${windowName} has no corresponding main process hooks, ignoring...`
|
||||||
|
|||||||
@@ -168,8 +168,8 @@
|
|||||||
observers.set(moduleKey, observer);
|
observers.set(moduleKey, observer);
|
||||||
};
|
};
|
||||||
|
|
||||||
const loadResources = async (resources, type, moduleKey, isRevive) => {
|
const loadResources = async (resources, type, moduleKey) => {
|
||||||
if (!resources || isRevive) return [];
|
if (!resources) return [];
|
||||||
|
|
||||||
const resourceArray = Array.isArray(resources) ? resources : [resources];
|
const resourceArray = Array.isArray(resources) ? resources : [resources];
|
||||||
const loadedResources = [];
|
const loadedResources = [];
|
||||||
@@ -232,12 +232,11 @@
|
|||||||
const resources = new Set();
|
const resources = new Set();
|
||||||
moduleResources.set(moduleKey, resources);
|
moduleResources.set(moduleKey, resources);
|
||||||
|
|
||||||
if (config.pageCSS) {
|
if (config.pageCSS && !isRevive) {
|
||||||
const cssResources = await loadResources(
|
const cssResources = await loadResources(
|
||||||
config.pageCSS,
|
config.pageCSS,
|
||||||
"css",
|
"css",
|
||||||
moduleKey,
|
moduleKey
|
||||||
isRevive
|
|
||||||
);
|
);
|
||||||
cssResources.forEach((resource) => resources.add(resource));
|
cssResources.forEach((resource) => resources.add(resource));
|
||||||
}
|
}
|
||||||
@@ -250,16 +249,22 @@
|
|||||||
insertElement(target, container, config.selectorMode);
|
insertElement(target, container, config.selectorMode);
|
||||||
monitorParent(moduleKey, target, container, config.selectorMode);
|
monitorParent(moduleKey, target, container, config.selectorMode);
|
||||||
|
|
||||||
if (config.pageScript) {
|
if (config.pageScript && !isRevive) {
|
||||||
const jsResources = await loadResources(
|
const jsResources = await loadResources(
|
||||||
config.pageScript,
|
config.pageScript,
|
||||||
"js",
|
"js",
|
||||||
moduleKey,
|
moduleKey
|
||||||
isRevive
|
|
||||||
);
|
);
|
||||||
jsResources.forEach((resource) => resources.add(resource));
|
jsResources.forEach((resource) => resources.add(resource));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isRevive) {
|
||||||
|
const onReviveEvent = new CustomEvent(
|
||||||
|
`onLoaderElRevive:${moduleKey}`
|
||||||
|
);
|
||||||
|
document.dispatchEvent(onReviveEvent);
|
||||||
|
}
|
||||||
|
|
||||||
const observer = new MutationObserver(() => {
|
const observer = new MutationObserver(() => {
|
||||||
if (
|
if (
|
||||||
!document.contains(container) &&
|
!document.contains(container) &&
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ const deepMerge = (target, source) => {
|
|||||||
|
|
||||||
class ConfigManager {
|
class ConfigManager {
|
||||||
constructor() {
|
constructor() {
|
||||||
this.configDir = path.join(os.homedir(), "Documents", "HugoAura");
|
this.configDir = global.__HUGO_AURA__.auraDir;
|
||||||
this.configPath = path.join(this.configDir, "config.json");
|
this.configPath = path.join(this.configDir, "config.json");
|
||||||
this.encConfigPath = path.join(this.configDir, ".cache_2eafc8d0.dat"); // (雾
|
this.encConfigPath = path.join(this.configDir, ".cache_2eafc8d0.dat"); // (雾
|
||||||
/* ↑ 不使用 .tmp 扩展名, 不然容易真被清理了 */
|
/* ↑ 不使用 .tmp 扩展名, 不然容易真被清理了 */
|
||||||
@@ -78,10 +78,10 @@ class ConfigManager {
|
|||||||
this.isConfigReadFailed = false;
|
this.isConfigReadFailed = false;
|
||||||
this.side = "unknown";
|
this.side = "unknown";
|
||||||
|
|
||||||
if (fs.existsSync(this.configPath)) {
|
if (fs.existsSync(this.encConfigPath)) {
|
||||||
this.useEncConfig = false;
|
|
||||||
} else {
|
|
||||||
this.useEncConfig = true;
|
this.useEncConfig = true;
|
||||||
|
} else {
|
||||||
|
this.useEncConfig = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (global.__HUGO_AURA_EVENT_BUS__) {
|
if (global.__HUGO_AURA_EVENT_BUS__) {
|
||||||
@@ -95,6 +95,38 @@ class ConfigManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
migrateOldConfigFile() {
|
||||||
|
if (this.configDir === path.join(os.homedir(), "Documents", "HugoAura")) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const oldConfigPath = path.join(
|
||||||
|
os.homedir(),
|
||||||
|
"Documents",
|
||||||
|
"HugoAura",
|
||||||
|
"config.json"
|
||||||
|
);
|
||||||
|
const oldEncConfigPath = path.join(
|
||||||
|
os.homedir(),
|
||||||
|
"Documents",
|
||||||
|
"HugoAura",
|
||||||
|
".cache_2eafc8d0.dat"
|
||||||
|
);
|
||||||
|
|
||||||
|
if (fs.existsSync(oldConfigPath)) {
|
||||||
|
fs.copyFileSync(oldConfigPath, this.configPath);
|
||||||
|
fs.unlinkSync(oldConfigPath);
|
||||||
|
} else if (fs.existsSync(oldEncConfigPath)) {
|
||||||
|
fs.copyFileSync(oldEncConfigPath, this.encConfigPath);
|
||||||
|
fs.unlinkSync(oldEncConfigPath);
|
||||||
|
this.useEncConfig = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(
|
||||||
|
`[HugoAura / Config] Moved old config file to ${this.configDir}`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
getHugoAuraConfigPath() {
|
getHugoAuraConfigPath() {
|
||||||
return path.dirname(
|
return path.dirname(
|
||||||
this.useEncConfig ? this.encConfigPath : this.configPath
|
this.useEncConfig ? this.encConfigPath : this.configPath
|
||||||
|
|||||||
@@ -26,11 +26,23 @@
|
|||||||
"enabled": true
|
"enabled": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"ssa": {
|
||||||
|
"ux": {
|
||||||
|
"easiAssistant": {
|
||||||
|
"autoHide": false,
|
||||||
|
"notDisplay": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"auraSettings": {
|
"auraSettings": {
|
||||||
"settingsPasswordEnabled": false,
|
"settingsPasswordEnabled": false,
|
||||||
"settingsPasswordWithSalt": "32703D292460CC9A3B867494D6AD9A8E4A3ADF0FAA4D6867BC4D412CC3927D02E47C6D0B1763BB53E57B2241C6193433561CDA09D7C48CA03983072B876F0965",
|
"settingsPasswordWithSalt": "32703D292460CC9A3B867494D6AD9A8E4A3ADF0FAA4D6867BC4D412CC3927D02E47C6D0B1763BB53E57B2241C6193433561CDA09D7C48CA03983072B876F0965",
|
||||||
"encryptConfig": false,
|
"encryptConfig": false,
|
||||||
"appearance": {},
|
"appearance": {
|
||||||
|
"appBar": {
|
||||||
|
"actionBtnsOnRight": false
|
||||||
|
}
|
||||||
|
},
|
||||||
"uiAccessMethod": {
|
"uiAccessMethod": {
|
||||||
"showEntryIcon": true,
|
"showEntryIcon": true,
|
||||||
"fallbackAccessMethods": {
|
"fallbackAccessMethods": {
|
||||||
|
|||||||
@@ -6,7 +6,12 @@ const { exec, execSync } = require("child_process");
|
|||||||
|
|
||||||
const LOG_PREFIX = "[HugoAura / Init / Reg";
|
const LOG_PREFIX = "[HugoAura / Init / Reg";
|
||||||
const LOG_PREFIX_FUNC = "[HugoAura / Reg";
|
const LOG_PREFIX_FUNC = "[HugoAura / Reg";
|
||||||
const AURA_REGISTRY_PATH = ["HKEY_USERS", ".DEFAULT", "SOFTWARE", "HugoAura"].join("\\");
|
const AURA_REGISTRY_PATH = [
|
||||||
|
"HKEY_USERS",
|
||||||
|
".DEFAULT",
|
||||||
|
"SOFTWARE",
|
||||||
|
"HugoAura",
|
||||||
|
].join("\\");
|
||||||
|
|
||||||
class RegistryManager {
|
class RegistryManager {
|
||||||
/**
|
/**
|
||||||
@@ -341,19 +346,27 @@ class RegistryManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} relativePath
|
* @param {string} keyPath
|
||||||
* @param {string} keyName
|
* @param {string} keyName
|
||||||
* @param {boolean | undefined} silent
|
* @param {boolean | undefined} silent
|
||||||
|
* @param {boolean} absolute
|
||||||
|
* @param {any} regex
|
||||||
* @returns {Promise<{ success: boolean, data: string | null, error: Error | null }>}
|
* @returns {Promise<{ success: boolean, data: string | null, error: Error | null }>}
|
||||||
*/
|
*/
|
||||||
async readRegKey(relativePath, keyName, silent = false) {
|
async readRegKey(
|
||||||
|
keyPath,
|
||||||
|
keyName,
|
||||||
|
silent = false,
|
||||||
|
absolute = false,
|
||||||
|
regex = null
|
||||||
|
) {
|
||||||
try {
|
try {
|
||||||
const { stdout } = await new Promise((resolve, reject) => {
|
const { stdout } = await new Promise((resolve, reject) => {
|
||||||
exec(
|
exec(
|
||||||
[
|
[
|
||||||
"reg",
|
"reg",
|
||||||
"query",
|
"query",
|
||||||
[AURA_REGISTRY_PATH, relativePath].join("\\"),
|
absolute ? keyPath : [AURA_REGISTRY_PATH, keyPath].join("\\"),
|
||||||
"/v",
|
"/v",
|
||||||
`\"${keyName}\"`,
|
`\"${keyName}\"`,
|
||||||
].join(" "),
|
].join(" "),
|
||||||
@@ -367,12 +380,12 @@ class RegistryManager {
|
|||||||
|
|
||||||
if (!silent) {
|
if (!silent) {
|
||||||
console.debug(
|
console.debug(
|
||||||
`${LOG_PREFIX_FUNC} / SUCCESS] Successfully read reg key ${relativePath}/${keyName}, stdout:`,
|
`${LOG_PREFIX_FUNC} / SUCCESS] Successfully read reg key ${keyPath}/${keyName}, stdout:`,
|
||||||
stdout
|
stdout
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const match = stdout.match(/REG_SZ\s+(.+)/);
|
const match = regex ? stdout.match(regex) : stdout.match(/REG_SZ\s+(.+)/);
|
||||||
|
|
||||||
if (!match) {
|
if (!match) {
|
||||||
console.warn(`${LOG_PREFIX} / WARN] Data not found in stdout`);
|
console.warn(`${LOG_PREFIX} / WARN] Data not found in stdout`);
|
||||||
@@ -390,10 +403,7 @@ class RegistryManager {
|
|||||||
error: null,
|
error: null,
|
||||||
};
|
};
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(
|
console.error(`${LOG_PREFIX} / ERROR] Failed to read reg key, error:`, e);
|
||||||
`${LOG_PREFIX} / ERROR] Failed to read reg key, error:`,
|
|
||||||
e
|
|
||||||
);
|
|
||||||
return {
|
return {
|
||||||
success: false,
|
success: false,
|
||||||
data: null,
|
data: null,
|
||||||
@@ -403,18 +413,26 @@ class RegistryManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} relativePath
|
* @param {string} keyPath
|
||||||
* @param {string} keyName
|
* @param {string} keyName
|
||||||
* @param {boolean | undefined} silent
|
* @param {boolean | undefined} silent
|
||||||
|
* @param {boolean} absolute
|
||||||
|
* @param {any} regex
|
||||||
* @returns {{ success: boolean, data: string | null, error: Error | null }}
|
* @returns {{ success: boolean, data: string | null, error: Error | null }}
|
||||||
*/
|
*/
|
||||||
readRegKeySync(relativePath, keyName, silent = false) {
|
readRegKeySync(
|
||||||
|
keyPath,
|
||||||
|
keyName,
|
||||||
|
silent = false,
|
||||||
|
absolute = false,
|
||||||
|
regex = null
|
||||||
|
) {
|
||||||
try {
|
try {
|
||||||
const readResult = execSync(
|
const readResult = execSync(
|
||||||
[
|
[
|
||||||
"reg",
|
"reg",
|
||||||
"query",
|
"query",
|
||||||
[AURA_REGISTRY_PATH, relativePath].join("\\"),
|
absolute ? keyPath : [AURA_REGISTRY_PATH, keyPath].join("\\"),
|
||||||
"/v",
|
"/v",
|
||||||
`\"${keyName}\"`,
|
`\"${keyName}\"`,
|
||||||
].join(" "),
|
].join(" "),
|
||||||
@@ -424,11 +442,13 @@ class RegistryManager {
|
|||||||
if (readResult) {
|
if (readResult) {
|
||||||
if (!silent) {
|
if (!silent) {
|
||||||
console.debug(
|
console.debug(
|
||||||
`${LOG_PREFIX_FUNC} / SUCCESS] Successfully read reg key ${relativePath}/${keyName}, stdout:`,
|
`${LOG_PREFIX_FUNC} / SUCCESS] Successfully read reg key ${keyPath}/${keyName}, stdout:`,
|
||||||
readResult
|
readResult
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
const match = readResult.match(/REG_SZ\s+(.+)/);
|
const match = regex
|
||||||
|
? readResult.match(regex)
|
||||||
|
: readResult.match(/REG_SZ\s+(.+)/);
|
||||||
|
|
||||||
if (!match) {
|
if (!match) {
|
||||||
console.warn(`${LOG_PREFIX} / WARN] Data not found in stdout`);
|
console.warn(`${LOG_PREFIX} / WARN] Data not found in stdout`);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
const buildClass = (n) => {
|
const buildClass = (n) => {
|
||||||
// >>> BEGIN OF SEEWO HUGO ORIGINAL CODE <<< //
|
// >>> BEGIN OF SEEWO HUGO ORIGINAL CODE <<< //
|
||||||
const s = n(237),
|
const s = n(239),
|
||||||
o = n(7);
|
o = n(7);
|
||||||
class WebSocketManager {
|
class WebSocketManager {
|
||||||
constructor(e, t) {
|
constructor(e, t) {
|
||||||
|
|||||||
10
src/aura/jsRewrite/vendor/passwordValidation.js
vendored
10
src/aura/jsRewrite/vendor/passwordValidation.js
vendored
@@ -46,8 +46,8 @@ const newFunction = function (e, t, b) {
|
|||||||
_ = b(14),
|
_ = b(14),
|
||||||
M = b(44),
|
M = b(44),
|
||||||
g = b(22),
|
g = b(22),
|
||||||
w = (b(432), b(7)),
|
w = (b(433), b(7)),
|
||||||
D = b(17),
|
D = b(15),
|
||||||
T = b.n(D),
|
T = b.n(D),
|
||||||
j = b(10),
|
j = b(10),
|
||||||
E = b.n(j),
|
E = b.n(j),
|
||||||
@@ -56,7 +56,7 @@ const newFunction = function (e, t, b) {
|
|||||||
z = b(19),
|
z = b(19),
|
||||||
Y = b(78),
|
Y = b(78),
|
||||||
L = b.n(Y);
|
L = b.n(Y);
|
||||||
b(444);
|
b(445);
|
||||||
var x,
|
var x,
|
||||||
k = 2,
|
k = 2,
|
||||||
S = 0,
|
S = 0,
|
||||||
@@ -178,7 +178,7 @@ const newFunction = function (e, t, b) {
|
|||||||
value: s,
|
value: s,
|
||||||
size: n.width || null,
|
size: n.width || null,
|
||||||
})
|
})
|
||||||
: v.a.createElement("img", { src: b(447) })
|
: v.a.createElement("img", { src: b(448) })
|
||||||
),
|
),
|
||||||
d !== C &&
|
d !== C &&
|
||||||
d !== O &&
|
d !== O &&
|
||||||
@@ -386,8 +386,8 @@ const newFunction = function (e, t, b) {
|
|||||||
} else {
|
} else {
|
||||||
originalFunc();
|
originalFunc();
|
||||||
}
|
}
|
||||||
|
// ### EOR ### //
|
||||||
break;
|
break;
|
||||||
// ### EOR ### //
|
|
||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
16
src/aura/jsRewrite/vendor/screenLock.js
vendored
16
src/aura/jsRewrite/vendor/screenLock.js
vendored
@@ -30,12 +30,12 @@ const newFunction = function (e, t, n) {
|
|||||||
p = n.n(h),
|
p = n.n(h),
|
||||||
_ = n(41),
|
_ = n(41),
|
||||||
M = n.n(_),
|
M = n.n(_),
|
||||||
g = (n(808), n(7)),
|
g = (n(814), n(7)),
|
||||||
b = n(9),
|
b = n(9),
|
||||||
y = n(8),
|
y = n(8),
|
||||||
v = n.n(y),
|
v = n.n(y),
|
||||||
w =
|
w =
|
||||||
(n(810),
|
(n(816),
|
||||||
{
|
{
|
||||||
"./numberKeyboard.less": {
|
"./numberKeyboard.less": {
|
||||||
"ps-icon": "numberKeyboard__ps-icon__1KO_WOCz",
|
"ps-icon": "numberKeyboard__ps-icon__1KO_WOCz",
|
||||||
@@ -530,7 +530,7 @@ const newFunction = function (e, t, n) {
|
|||||||
password: "password",
|
password: "password",
|
||||||
},
|
},
|
||||||
G = n(19);
|
G = n(19);
|
||||||
n(812);
|
n(818);
|
||||||
function W(e) {
|
function W(e) {
|
||||||
var t = e.canvasRender,
|
var t = e.canvasRender,
|
||||||
n = void 0 === t || t,
|
n = void 0 === t || t,
|
||||||
@@ -589,12 +589,12 @@ const newFunction = function (e, t, n) {
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
n(815);
|
n(821);
|
||||||
var J = n(64),
|
var J = n(64),
|
||||||
V = n(20);
|
V = n(20);
|
||||||
var q,
|
var q,
|
||||||
Z,
|
Z,
|
||||||
X = n(16);
|
X = n(17);
|
||||||
function K(r) {
|
function K(r) {
|
||||||
var a = (function () {
|
var a = (function () {
|
||||||
if ("undefined" == typeof Reflect || !Reflect.construct) return !1;
|
if ("undefined" == typeof Reflect || !Reflect.construct) return !1;
|
||||||
@@ -805,7 +805,7 @@ const newFunction = function (e, t, n) {
|
|||||||
);
|
);
|
||||||
})(h.PureComponent))
|
})(h.PureComponent))
|
||||||
) || Z,
|
) || Z,
|
||||||
oe = (n(817), n(137).a);
|
oe = (n(823), n(137).a);
|
||||||
function se(t, e) {
|
function se(t, e) {
|
||||||
var n = Object.keys(t);
|
var n = Object.keys(t);
|
||||||
if (Object.getOwnPropertySymbols) {
|
if (Object.getOwnPropertySymbols) {
|
||||||
@@ -913,6 +913,7 @@ const newFunction = function (e, t, n) {
|
|||||||
});
|
});
|
||||||
}),
|
}),
|
||||||
(o.checkPasswordCorrect = function () {
|
(o.checkPasswordCorrect = function () {
|
||||||
|
// ### BOR ### //
|
||||||
const originalAuthFailed = () => {
|
const originalAuthFailed = () => {
|
||||||
o.failCount++,
|
o.failCount++,
|
||||||
o.passwordCheckFail(),
|
o.passwordCheckFail(),
|
||||||
@@ -955,6 +956,7 @@ const newFunction = function (e, t, n) {
|
|||||||
o.state.inputPassword.join("") === o.password
|
o.state.inputPassword.join("") === o.password
|
||||||
? (o.props.onActivationCorrect(), (o.failCount = 0))
|
? (o.props.onActivationCorrect(), (o.failCount = 0))
|
||||||
: customAuthFailed();
|
: customAuthFailed();
|
||||||
|
// ### EOR ### //
|
||||||
}),
|
}),
|
||||||
(o.insertHtml = function () {
|
(o.insertHtml = function () {
|
||||||
return p.a.createElement(
|
return p.a.createElement(
|
||||||
@@ -1002,7 +1004,7 @@ const newFunction = function (e, t, n) {
|
|||||||
n
|
n
|
||||||
);
|
);
|
||||||
})(I),
|
})(I),
|
||||||
me = (n(819), n(38));
|
me = (n(825), n(38));
|
||||||
function fe(r) {
|
function fe(r) {
|
||||||
var a = (function () {
|
var a = (function () {
|
||||||
if ("undefined" == typeof Reflect || !Reflect.construct) return !1;
|
if ("undefined" == typeof Reflect || !Reflect.construct) return !1;
|
||||||
|
|||||||
2
src/aura/types/render/global.d.ts
vendored
2
src/aura/types/render/global.d.ts
vendored
@@ -8,7 +8,7 @@ interface AssistantHugoAuraGlobal extends HugoAuraGlobal {
|
|||||||
plsSettings: Record<any, any>;
|
plsSettings: Record<any, any>;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface DesktopAssistantHugoAuraGlobal extends HugoAuraGlobal {
|
interface AuraWSKeepAliveWindowHugoAuraGlobal extends HugoAuraGlobal {
|
||||||
plsWs: WebSocket | null;
|
plsWs: WebSocket | null;
|
||||||
plsStats: PLSStatus;
|
plsStats: PLSStatus;
|
||||||
}
|
}
|
||||||
|
|||||||
1
src/aura/types/shared/global.d.ts
vendored
1
src/aura/types/shared/global.d.ts
vendored
@@ -14,6 +14,7 @@ interface GlobalHugoAuraInfo {
|
|||||||
fsTasks?: MainProcessOnlyVal<FSTasks>;
|
fsTasks?: MainProcessOnlyVal<FSTasks>;
|
||||||
hookedWindows?: MainProcessOnlyVal<HookedWindowsMap>;
|
hookedWindows?: MainProcessOnlyVal<HookedWindowsMap>;
|
||||||
ipcInit?: MainProcessOnlyVal<boolean>;
|
ipcInit?: MainProcessOnlyVal<boolean>;
|
||||||
|
auraDir: MainProcessOnlyVal<string>;
|
||||||
plsRules?: Record<any, any> | null;
|
plsRules?: Record<any, any> | null;
|
||||||
plsSettings?: Record<any, any> | null;
|
plsSettings?: Record<any, any> | null;
|
||||||
plsStats?: PLSStatus | null;
|
plsStats?: PLSStatus | null;
|
||||||
|
|||||||
@@ -145,9 +145,10 @@ const renderInputArea = (entry, operationArea, descriptionArea) => {
|
|||||||
inputEl.value = entry.valueGetter();
|
inputEl.value = entry.valueGetter();
|
||||||
inputEl.placeholder = entry.placeHolder;
|
inputEl.placeholder = entry.placeHolder;
|
||||||
inputEl.id = entry.id;
|
inputEl.id = entry.id;
|
||||||
inputEl.addEventListener("change", async (event) => {
|
|
||||||
|
const handleSubmit = async (event = null) => {
|
||||||
const result = await entry.callbackFn(
|
const result = await entry.callbackFn(
|
||||||
event.target.value,
|
event ? event.target.value : inputEl.value,
|
||||||
inputEl,
|
inputEl,
|
||||||
operationArea,
|
operationArea,
|
||||||
descriptionArea
|
descriptionArea
|
||||||
@@ -166,10 +167,37 @@ const renderInputArea = (entry, operationArea, descriptionArea) => {
|
|||||||
descriptionArea.textContent = result.hint;
|
descriptionArea.textContent = result.hint;
|
||||||
descriptionArea.classList.add("ase-desc-error-hint");
|
descriptionArea.classList.add("ase-desc-error-hint");
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
inputEl.addEventListener("change", async (event) => {
|
||||||
|
await handleSubmit(event);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
inputEl.onsubmit = async (evt) => {
|
||||||
|
evt.preventDefault();
|
||||||
|
await handleSubmit();
|
||||||
|
};
|
||||||
|
|
||||||
operationArea.classList.add("ase-operation-area-expanded");
|
operationArea.classList.add("ase-operation-area-expanded");
|
||||||
return inputEl;
|
return inputEl;
|
||||||
}
|
}
|
||||||
|
case "button": {
|
||||||
|
const btnEl = document.createElement("button");
|
||||||
|
btnEl.type = "button";
|
||||||
|
btnEl.classList.add("btn");
|
||||||
|
switch (entry.style) {
|
||||||
|
case "outline":
|
||||||
|
default:
|
||||||
|
btnEl.classList.add("btn-outline-primary");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
btnEl.innerHTML = entry.buttonContent;
|
||||||
|
btnEl.onclick = entry.callbackFn;
|
||||||
|
(async () => {
|
||||||
|
descriptionArea.innerHTML = await entry.valueGetter();
|
||||||
|
})();
|
||||||
|
return btnEl;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
2
src/aura/ui/hookDefinitions/desktopAssistant.js
Executable file → Normal file
2
src/aura/ui/hookDefinitions/desktopAssistant.js
Executable file → Normal file
@@ -6,7 +6,7 @@
|
|||||||
const def = {
|
const def = {
|
||||||
targets: {},
|
targets: {},
|
||||||
globalStyles: ["ui/css/global.css"],
|
globalStyles: ["ui/css/global.css"],
|
||||||
globalJS: ["ui/js/global.js", "ui/js/plsConnectionManager.js"],
|
globalJS: ["ui/js/global.js", "ui/js/pageGlobal/desktopAssistant.js"],
|
||||||
onLoaded: `
|
onLoaded: `
|
||||||
console.log('[HugoAura / UI / Hooks / Desktop Assistant] Page loaded.');
|
console.log('[HugoAura / UI / Hooks / Desktop Assistant] Page loaded.');
|
||||||
`,
|
`,
|
||||||
|
|||||||
23
src/aura/ui/js/pageGlobal/desktopAssistant.js
Normal file
23
src/aura/ui/js/pageGlobal/desktopAssistant.js
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
// @ts-check
|
||||||
|
|
||||||
|
(() => {
|
||||||
|
const applyHideSettings = () => {
|
||||||
|
if (global.__HUGO_AURA_CONFIG__.ssa.ux.easiAssistant.autoHide) {
|
||||||
|
const minimizeBtnEl = document.getElementsByClassName(
|
||||||
|
"index__button2__2mhwC3oY"
|
||||||
|
)[0].children[0];
|
||||||
|
// @ts-expect-error
|
||||||
|
minimizeBtnEl.click();
|
||||||
|
} else if (global.__HUGO_AURA_CONFIG__.ssa.ux.easiAssistant.notDisplay) {
|
||||||
|
const rootEl = document.getElementById("root");
|
||||||
|
// @ts-expect-error
|
||||||
|
rootEl.style["display"] = "none";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const onMounted = () => {
|
||||||
|
applyHideSettings();
|
||||||
|
};
|
||||||
|
|
||||||
|
onMounted();
|
||||||
|
})();
|
||||||
@@ -1,5 +1,12 @@
|
|||||||
// @ts-check
|
// @ts-check
|
||||||
(() => {
|
(() => {
|
||||||
|
if (!global.__HUGO_AURA__)
|
||||||
|
global.__HUGO_AURA__ = {
|
||||||
|
configInit: true,
|
||||||
|
auraDir: "",
|
||||||
|
version: "",
|
||||||
|
};
|
||||||
|
|
||||||
if (!global.__HUGO_AURA__.plsStats)
|
if (!global.__HUGO_AURA__.plsStats)
|
||||||
global.__HUGO_AURA__.plsStats = {
|
global.__HUGO_AURA__.plsStats = {
|
||||||
installed: false,
|
installed: false,
|
||||||
@@ -7,13 +14,13 @@
|
|||||||
connected: false,
|
connected: false,
|
||||||
launched: false,
|
launched: false,
|
||||||
status: "dead",
|
status: "dead",
|
||||||
version: "未知",
|
version: "unknown",
|
||||||
authToken: "",
|
authToken: "",
|
||||||
};
|
};
|
||||||
|
|
||||||
const IPC_METHOD_BASE = "$aura.pls";
|
const IPC_METHOD_BASE = "$aura.pls";
|
||||||
const REQUIRE_BASE = "../../aura/ui";
|
const REQUIRE_BASE = "../../..";
|
||||||
const __SCOPE = "desktopAssistant";
|
const __SCOPE = "auraWsKeepAlive";
|
||||||
|
|
||||||
const PLS_REG_PATH = "ProxyLayerServices";
|
const PLS_REG_PATH = "ProxyLayerServices";
|
||||||
|
|
||||||
@@ -45,8 +52,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
const calcFullAuthToken = (/** @type {string} */ authToken) => {
|
const calcFullAuthToken = (/** @type {string} */ authToken) => {
|
||||||
const trustToken = window._ACCEPT_DATA.getData("deviceId");
|
const conjToken = authToken + "AuraXAuth 0xFFFFFF NeverEnds";
|
||||||
const conjToken = authToken + "AuraXAuth" + trustToken + "NeverEnds";
|
|
||||||
const crypto = require("crypto");
|
const crypto = require("crypto");
|
||||||
return crypto.createHash("sha512").update(conjToken).digest("hex");
|
return crypto.createHash("sha512").update(conjToken).digest("hex");
|
||||||
};
|
};
|
||||||
@@ -151,6 +157,13 @@
|
|||||||
sendRetryStatusToMain(false);
|
sendRetryStatusToMain(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (global.__HUGO_AURA__.plsStats.launched === false) {
|
||||||
|
console.warn(
|
||||||
|
"[HugoAura / UI / PLS Manager / WARN] PLS stopped, closing WebSocket connection."
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
console.error(
|
console.error(
|
||||||
@@ -268,7 +281,7 @@
|
|||||||
launched: false,
|
launched: false,
|
||||||
detached: false,
|
detached: false,
|
||||||
connected: false,
|
connected: false,
|
||||||
version: "未知",
|
version: "unknown",
|
||||||
status: "dead",
|
status: "dead",
|
||||||
authToken: "66ccff0d000721114514191981023333",
|
authToken: "66ccff0d000721114514191981023333",
|
||||||
};
|
};
|
||||||
@@ -313,7 +326,7 @@
|
|||||||
const onSetup = () => {
|
const onSetup = () => {
|
||||||
if (!global.ipcRenderer) {
|
if (!global.ipcRenderer) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
global.ipcRenderer = require("electron").global.ipcRenderer;
|
global.ipcRenderer = require("electron").ipcRenderer;
|
||||||
}
|
}
|
||||||
|
|
||||||
initPlsConnection();
|
initPlsConnection();
|
||||||
@@ -326,6 +339,16 @@
|
|||||||
initPlsConnection();
|
initPlsConnection();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
global.ipcRenderer.on(
|
||||||
|
`${IPC_METHOD_BASE}.post.plsStopped`,
|
||||||
|
(_evt, _arg) => {
|
||||||
|
if (!global.__HUGO_AURA__.plsStats) return;
|
||||||
|
global.__HUGO_AURA__.plsStats.launched = false;
|
||||||
|
global.__HUGO_AURA__.plsStats.connected = false;
|
||||||
|
global.__HUGO_AURA__.plsStats.version = "unknown";
|
||||||
|
}
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
|||||||
@@ -13,18 +13,27 @@
|
|||||||
<!-- Chevron Left Icon -->
|
<!-- Chevron Left Icon -->
|
||||||
</div>
|
</div>
|
||||||
<p>雨光之环</p>
|
<p>雨光之环</p>
|
||||||
<div class="aura-config-page-app-bar-hr-vertical"></div>
|
<div
|
||||||
|
class="aura-config-page-app-bar-hr-vertical"
|
||||||
|
id="auraConfigPageAppBarVerticalHr"
|
||||||
|
></div>
|
||||||
|
<div class="aura-config-page-app-bar-spacer space-none"></div>
|
||||||
<div
|
<div
|
||||||
onclick="global.__HUGO_AURA_UI_FUNCTIONS__.config.handleNavHome()"
|
onclick="global.__HUGO_AURA_UI_FUNCTIONS__.config.handleNavHome()"
|
||||||
style="-webkit-app-region: no-drag; z-index: 2000; margin-left: 6px"
|
style="
|
||||||
|
-webkit-app-region: no-drag;
|
||||||
|
z-index: 2000;
|
||||||
|
margin-left: 6px;
|
||||||
|
margin-right: 0.5rem;
|
||||||
|
"
|
||||||
>
|
>
|
||||||
<svg
|
<svg
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
width="21"
|
width="22"
|
||||||
height="21"
|
height="22"
|
||||||
viewBox="0 0 24 24"
|
viewBox="0 0 24 24"
|
||||||
class="iconfont"
|
class="iconfont"
|
||||||
style="margin-top: -1.5px"
|
style="margin-top: -1.35px"
|
||||||
>
|
>
|
||||||
<path
|
<path
|
||||||
fill="currentColor"
|
fill="currentColor"
|
||||||
@@ -136,8 +145,8 @@
|
|||||||
<div class="aura-config-page-operation-body">
|
<div class="aura-config-page-operation-body">
|
||||||
<img src="../../aura/ui/static/config/no_limitations.svg" />
|
<img src="../../aura/ui/static/config/no_limitations.svg" />
|
||||||
<div>
|
<div>
|
||||||
<p class="config-operation-title">限制解除</p>
|
<p class="config-operation-title">行为改写</p>
|
||||||
<p class="config-operation-description">禁用密码、关闭功能</p>
|
<p class="config-operation-description">覆写密码、禁用能力</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -149,7 +158,7 @@
|
|||||||
<div class="aura-config-page-operation-body">
|
<div class="aura-config-page-operation-body">
|
||||||
<img src="../../aura/ui/static/config/behaviour_mon.svg" />
|
<img src="../../aura/ui/static/config/behaviour_mon.svg" />
|
||||||
<div>
|
<div>
|
||||||
<p class="config-operation-title">行为管控</p>
|
<p class="config-operation-title">操作管控</p>
|
||||||
<p class="config-operation-description">窥屏提醒、数据欺骗</p>
|
<p class="config-operation-description">窥屏提醒、数据欺骗</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -235,6 +235,11 @@ global.__HUGO_AURA_UI_FUNCTIONS__.config = {
|
|||||||
inputEl.value = "";
|
inputEl.value = "";
|
||||||
inputEl.classList.remove("invalid");
|
inputEl.classList.remove("invalid");
|
||||||
inputEl.classList.remove("is-invalid");
|
inputEl.classList.remove("is-invalid");
|
||||||
|
|
||||||
|
global.__HUGO_AURA_UI_FUNCTIONS__.config.resetAuthDialogInputElOnSubmit(
|
||||||
|
global.__HUGO_AURA_UI_FUNCTIONS__.config.verifyAuthPassword
|
||||||
|
);
|
||||||
|
|
||||||
acpDialogConfirmBtnEl.onclick = (_evt) => {
|
acpDialogConfirmBtnEl.onclick = (_evt) => {
|
||||||
global.__HUGO_AURA_UI_FUNCTIONS__.config.verifyAuthPassword();
|
global.__HUGO_AURA_UI_FUNCTIONS__.config.verifyAuthPassword();
|
||||||
};
|
};
|
||||||
@@ -243,6 +248,16 @@ global.__HUGO_AURA_UI_FUNCTIONS__.config = {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
resetAuthDialogInputElOnSubmit: (func) => {
|
||||||
|
const inputEl = document.getElementById("acp-auth-user-input");
|
||||||
|
inputEl.onsubmit = (evt) => evt.preventDefault();
|
||||||
|
inputEl.onkeydown = (event) => {
|
||||||
|
if (event.key === "Enter") {
|
||||||
|
func();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
handleACSNShow: async () => {
|
handleACSNShow: async () => {
|
||||||
const acsnRootEl = document.getElementsByClassName(
|
const acsnRootEl = document.getElementsByClassName(
|
||||||
"acp-config-status-notify"
|
"acp-config-status-notify"
|
||||||
@@ -294,6 +309,27 @@ global.__HUGO_AURA_UI_FUNCTIONS__.config = {
|
|||||||
// TODO: Error handling
|
// TODO: Error handling
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
initCustomUIProps: async (refresh = false) => {
|
||||||
|
const verticalHrEl = document.getElementById(
|
||||||
|
"auraConfigPageAppBarVerticalHr"
|
||||||
|
);
|
||||||
|
const spacerElArr = document.getElementsByClassName(
|
||||||
|
"aura-config-page-app-bar-spacer"
|
||||||
|
);
|
||||||
|
if (
|
||||||
|
global.__HUGO_AURA_CONFIG__.auraSettings.appearance.appBar
|
||||||
|
.actionBtnsOnRight
|
||||||
|
) {
|
||||||
|
verticalHrEl.classList.add("hidden");
|
||||||
|
spacerElArr[0].classList.remove("space-none");
|
||||||
|
spacerElArr[1].classList.add("space-none");
|
||||||
|
} else if (refresh) {
|
||||||
|
verticalHrEl.classList.remove("hidden");
|
||||||
|
spacerElArr[0].classList.add("space-none");
|
||||||
|
spacerElArr[1].classList.remove("space-none");
|
||||||
|
}
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
(() => {
|
(() => {
|
||||||
@@ -338,7 +374,8 @@ global.__HUGO_AURA_UI_FUNCTIONS__.config = {
|
|||||||
let timeout = 0;
|
let timeout = 0;
|
||||||
Array.from(operationElArr).forEach((el) => {
|
Array.from(operationElArr).forEach((el) => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
el.className = "operation-el-show aura-config-page-operation-el";
|
el.classList.remove("operation-el-hidden");
|
||||||
|
el.classList.add("operation-el-show");
|
||||||
}, timeout);
|
}, timeout);
|
||||||
timeout += 150;
|
timeout += 150;
|
||||||
});
|
});
|
||||||
@@ -364,6 +401,9 @@ global.__HUGO_AURA_UI_FUNCTIONS__.config = {
|
|||||||
"aura-config-page-header-area"
|
"aura-config-page-header-area"
|
||||||
)[0];
|
)[0];
|
||||||
acsDialogAreaEl.style = "";
|
acsDialogAreaEl.style = "";
|
||||||
|
global.__HUGO_AURA_UI_FUNCTIONS__.config.resetAuthDialogInputElOnSubmit(
|
||||||
|
global.__HUGO_AURA_UI_FUNCTIONS__.config.verifyAuthPassword
|
||||||
|
);
|
||||||
await window.__HUGO_AURA_GLOBAL__.utils.sleep(500);
|
await window.__HUGO_AURA_GLOBAL__.utils.sleep(500);
|
||||||
acsDialogAreaEl.classList.remove("acp-ada-hidden");
|
acsDialogAreaEl.classList.remove("acp-ada-hidden");
|
||||||
acpAppBarEl.classList.add("color-reverse");
|
acpAppBarEl.classList.add("color-reverse");
|
||||||
@@ -391,6 +431,7 @@ global.__HUGO_AURA_UI_FUNCTIONS__.config = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onMounted = () => {
|
const onMounted = () => {
|
||||||
|
global.__HUGO_AURA_UI_FUNCTIONS__.config.initCustomUIProps();
|
||||||
applyVersionInfo();
|
applyVersionInfo();
|
||||||
|
|
||||||
showAnimation();
|
showAnimation();
|
||||||
|
|||||||
@@ -58,6 +58,10 @@
|
|||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.aura-config-page-app-bar-spacer.space-none {
|
||||||
|
flex-grow: 0;
|
||||||
|
}
|
||||||
|
|
||||||
.aura-config-page-app-bar-hr-vertical {
|
.aura-config-page-app-bar-hr-vertical {
|
||||||
position: relative;
|
position: relative;
|
||||||
margin-left: 8px;
|
margin-left: 8px;
|
||||||
@@ -66,3 +70,7 @@
|
|||||||
height: 12px;
|
height: 12px;
|
||||||
transition: background 0.5s;
|
transition: background 0.5s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.aura-config-page-app-bar-hr-vertical.hidden {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|||||||
@@ -331,6 +331,10 @@ if (!global.__HUGO_AURA_UI_REACTIVES__.subConfig)
|
|||||||
);
|
);
|
||||||
if (ret.success) {
|
if (ret.success) {
|
||||||
lifecycleStatus.svcRunning = false;
|
lifecycleStatus.svcRunning = false;
|
||||||
|
global.__HUGO_AURA__.plsStats.launched = false;
|
||||||
|
global.__HUGO_AURA__.plsStats.version = "unknown";
|
||||||
|
global.__HUGO_AURA__.plsStats.status = "dead";
|
||||||
|
|
||||||
global.__HUGO_AURA_UI_FUNCTIONS__.subConfig.plsStatus.updateToast(
|
global.__HUGO_AURA_UI_FUNCTIONS__.subConfig.plsStatus.updateToast(
|
||||||
"success",
|
"success",
|
||||||
"PLS 已停止",
|
"PLS 已停止",
|
||||||
@@ -442,11 +446,11 @@ if (!global.__HUGO_AURA_UI_REACTIVES__.subConfig)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (curPlsStats.version && curPlsStats.version !== "未知") {
|
const versionTextEl = document.getElementById("acs-bc-psp-version-text");
|
||||||
const versionTextEl = document.getElementById(
|
if (curPlsStats.version && curPlsStats.version !== "unknown") {
|
||||||
"acs-bc-psp-version-text"
|
|
||||||
);
|
|
||||||
versionTextEl.textContent = "v" + curPlsStats.version;
|
versionTextEl.textContent = "v" + curPlsStats.version;
|
||||||
|
} else {
|
||||||
|
versionTextEl.textContent = "不可用"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -31,6 +31,20 @@
|
|||||||
上报屏蔽
|
上报屏蔽
|
||||||
</button>
|
</button>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="nav-item" role="presentation">
|
||||||
|
<button
|
||||||
|
class="nav-link"
|
||||||
|
id="appearance-ctl-tab"
|
||||||
|
data-bs-toggle="pill"
|
||||||
|
data-bs-target="#appearance-ctl-subpage"
|
||||||
|
type="button"
|
||||||
|
role="tab"
|
||||||
|
aria-controls="appearance-ctl-subpage"
|
||||||
|
aria-selected="false"
|
||||||
|
>
|
||||||
|
外观与体验
|
||||||
|
</button>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="tab-content">
|
<div class="tab-content">
|
||||||
<div
|
<div
|
||||||
@@ -45,5 +59,11 @@
|
|||||||
role="tabpanel"
|
role="tabpanel"
|
||||||
aria-labelledby="disable-audit-tab"
|
aria-labelledby="disable-audit-tab"
|
||||||
></div>
|
></div>
|
||||||
|
<div
|
||||||
|
class="tab-pane fade"
|
||||||
|
id="appearance-ctl-subpage"
|
||||||
|
role="tabpanel"
|
||||||
|
aria-labelledby="appearance-ctl-tab"
|
||||||
|
></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
} = require("../../aura/ui/composables/settingsRenderer");
|
} = require("../../aura/ui/composables/settingsRenderer");
|
||||||
const { authSettings } = require(`${pathBase}/auth`);
|
const { authSettings } = require(`${pathBase}/auth`);
|
||||||
const { banAuditSettings } = require(`${pathBase}/audit`);
|
const { banAuditSettings } = require(`${pathBase}/audit`);
|
||||||
|
const { uxAndAppearanceSettings } = require(`${pathBase}/uxAppearance`);
|
||||||
|
|
||||||
const initAuthSubPage = () => {
|
const initAuthSubPage = () => {
|
||||||
const authSubPageEl = document.getElementById("auth-subpage");
|
const authSubPageEl = document.getElementById("auth-subpage");
|
||||||
@@ -18,9 +19,17 @@
|
|||||||
settingsRenderer(banAuditSubPageEl, banAuditSettings);
|
settingsRenderer(banAuditSubPageEl, banAuditSettings);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const initUxAndAppearanceSubPage = () => {
|
||||||
|
const uxAndAppearancePageEl = document.getElementById(
|
||||||
|
"appearance-ctl-subpage"
|
||||||
|
);
|
||||||
|
settingsRenderer(uxAndAppearancePageEl, uxAndAppearanceSettings);
|
||||||
|
};
|
||||||
|
|
||||||
const onMounted = () => {
|
const onMounted = () => {
|
||||||
initAuthSubPage();
|
initAuthSubPage();
|
||||||
initBanAuditSubPage();
|
initBanAuditSubPage();
|
||||||
|
initUxAndAppearanceSubPage();
|
||||||
|
|
||||||
const rootEl = document.getElementById("acs-disable-limit-root-el");
|
const rootEl = document.getElementById("acs-disable-limit-root-el");
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
|||||||
@@ -0,0 +1,62 @@
|
|||||||
|
const uxAndAppearanceSettings = [
|
||||||
|
{
|
||||||
|
id: 0,
|
||||||
|
categoryName: "管家助手",
|
||||||
|
child: [
|
||||||
|
{
|
||||||
|
index: 0,
|
||||||
|
id: "autoHideEasiAssistant",
|
||||||
|
type: "switch",
|
||||||
|
name: "自动最小化管家助手",
|
||||||
|
description: "管家启动后, 自动将桌面右下角管家助手最小化至 Fab 形态",
|
||||||
|
restart: true,
|
||||||
|
reload: false,
|
||||||
|
associateVal: ["ssa.ux.easiAssistant.notDisplay"],
|
||||||
|
auraIf: () => true,
|
||||||
|
defaultValue: false,
|
||||||
|
auraDisable: () => {
|
||||||
|
if (global.__HUGO_AURA_CONFIG__.ssa.ux.easiAssistant.notDisplay) {
|
||||||
|
return { value: true, tooltip: '禁用 "隐藏管家助手" 以继续' };
|
||||||
|
} else {
|
||||||
|
return { value: false };
|
||||||
|
}
|
||||||
|
},
|
||||||
|
valueGetter: () => {
|
||||||
|
return global.__HUGO_AURA_CONFIG__.ssa.ux.easiAssistant.autoHide;
|
||||||
|
},
|
||||||
|
callbackFn: (newVal) => {
|
||||||
|
if (typeof newVal !== "boolean") return;
|
||||||
|
global.__HUGO_AURA_CONFIG__.ssa.ux.easiAssistant.autoHide = newVal;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
index: 1,
|
||||||
|
id: "notDisplayEasiAssistant",
|
||||||
|
type: "switch",
|
||||||
|
name: "隐藏管家助手",
|
||||||
|
description: "管家启动后, 管家助手窗口将不再显示",
|
||||||
|
restart: true,
|
||||||
|
reload: false,
|
||||||
|
associateVal: ["ssa.ux.easiAssistant.autoHide"],
|
||||||
|
auraIf: () => true,
|
||||||
|
defaultValue: false,
|
||||||
|
auraDisable: () => {
|
||||||
|
if (global.__HUGO_AURA_CONFIG__.ssa.ux.easiAssistant.autoHide) {
|
||||||
|
return { value: true, tooltip: '禁用 "自动最小化管家助手" 以继续' };
|
||||||
|
} else {
|
||||||
|
return { value: false };
|
||||||
|
}
|
||||||
|
},
|
||||||
|
valueGetter: () => {
|
||||||
|
return global.__HUGO_AURA_CONFIG__.ssa.ux.easiAssistant.notDisplay;
|
||||||
|
},
|
||||||
|
callbackFn: (newVal) => {
|
||||||
|
if (typeof newVal !== "boolean") return;
|
||||||
|
global.__HUGO_AURA_CONFIG__.ssa.ux.easiAssistant.notDisplay = newVal;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
module.exports = { uxAndAppearanceSettings };
|
||||||
@@ -17,6 +17,20 @@
|
|||||||
Aura 设置
|
Aura 设置
|
||||||
</button>
|
</button>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="nav-item" role="presentation">
|
||||||
|
<button
|
||||||
|
class="nav-link"
|
||||||
|
id="debug-subpage-tab"
|
||||||
|
data-bs-toggle="pill"
|
||||||
|
data-bs-target="#debug-subpage"
|
||||||
|
type="button"
|
||||||
|
role="tab"
|
||||||
|
aria-controls="debug-subpage"
|
||||||
|
aria-selected="false"
|
||||||
|
>
|
||||||
|
调试选项
|
||||||
|
</button>
|
||||||
|
</li>
|
||||||
<li class="nav-item" role="presentation">
|
<li class="nav-item" role="presentation">
|
||||||
<button
|
<button
|
||||||
class="nav-link"
|
class="nav-link"
|
||||||
@@ -26,7 +40,7 @@
|
|||||||
type="button"
|
type="button"
|
||||||
role="tab"
|
role="tab"
|
||||||
aria-controls="about-subpage"
|
aria-controls="about-subpage"
|
||||||
aria-selected="true"
|
aria-selected="false"
|
||||||
>
|
>
|
||||||
关于项目
|
关于项目
|
||||||
</button>
|
</button>
|
||||||
@@ -39,6 +53,12 @@
|
|||||||
role="tabpanel"
|
role="tabpanel"
|
||||||
aria-labelledby="aura-subpage-tab"
|
aria-labelledby="aura-subpage-tab"
|
||||||
></div>
|
></div>
|
||||||
|
<div
|
||||||
|
class="tab-pane fade"
|
||||||
|
id="debug-subpage"
|
||||||
|
role="tabpanel"
|
||||||
|
aria-labelledby="debug-subpage-tab"
|
||||||
|
></div>
|
||||||
<div
|
<div
|
||||||
class="tab-pane fade"
|
class="tab-pane fade"
|
||||||
id="about-subpage"
|
id="about-subpage"
|
||||||
|
|||||||
@@ -5,13 +5,21 @@
|
|||||||
settingsRenderer,
|
settingsRenderer,
|
||||||
} = require("../../aura/ui/composables/settingsRenderer");
|
} = require("../../aura/ui/composables/settingsRenderer");
|
||||||
const { auraSettings } = require(`${pathBase}/aura`);
|
const { auraSettings } = require(`${pathBase}/aura`);
|
||||||
|
const { debugSettings } = require(`${pathBase}/debug`);
|
||||||
|
|
||||||
const initAuraSubPage = () => {
|
const initAuraSubPage = () => {
|
||||||
const auraSettingsSubPageEl = document.getElementById("aura-subpage");
|
const auraSettingsSubPageEl = document.getElementById("aura-subpage");
|
||||||
settingsRenderer(auraSettingsSubPageEl, auraSettings);
|
settingsRenderer(auraSettingsSubPageEl, auraSettings);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const initDebugSubPage = () => {
|
||||||
|
const debugSubPageEl = document.getElementById("debug-subpage");
|
||||||
|
settingsRenderer(debugSubPageEl, debugSettings);
|
||||||
|
};
|
||||||
|
|
||||||
const onMounted = () => {
|
const onMounted = () => {
|
||||||
initAuraSubPage();
|
initAuraSubPage();
|
||||||
|
initDebugSubPage();
|
||||||
|
|
||||||
const rootEl = document.getElementById("acs-preferences-root-el");
|
const rootEl = document.getElementById("acs-preferences-root-el");
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
|||||||
@@ -142,6 +142,10 @@ const functions = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
global.__HUGO_AURA_UI_FUNCTIONS__.config.resetAuthDialogInputElOnSubmit(
|
||||||
|
verifyPassword
|
||||||
|
);
|
||||||
|
|
||||||
// @ts-expect-error
|
// @ts-expect-error
|
||||||
acpDialogConfirmBtnEl.onclick = verifyPassword;
|
acpDialogConfirmBtnEl.onclick = verifyPassword;
|
||||||
// @ts-expect-error
|
// @ts-expect-error
|
||||||
@@ -441,6 +445,35 @@ const auraSettings = [
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
id: 2,
|
||||||
|
categoryName: "外观",
|
||||||
|
child: [
|
||||||
|
{
|
||||||
|
index: 0,
|
||||||
|
id: "actionBtnsOnRight",
|
||||||
|
type: "switch",
|
||||||
|
name: "顶栏操作类按钮右置",
|
||||||
|
description: "启用后, 顶栏的<b>返回首页按钮</b>将靠右放置",
|
||||||
|
restart: false,
|
||||||
|
reload: false,
|
||||||
|
auraIf: () => {
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
defaultValue: false,
|
||||||
|
valueGetter: () => {
|
||||||
|
return global.__HUGO_AURA_CONFIG__.auraSettings.appearance.appBar
|
||||||
|
.actionBtnsOnRight;
|
||||||
|
},
|
||||||
|
callbackFn: async (newVal) => {
|
||||||
|
if (typeof newVal !== "boolean") return;
|
||||||
|
global.__HUGO_AURA_CONFIG__.auraSettings.appearance.appBar.actionBtnsOnRight =
|
||||||
|
newVal;
|
||||||
|
global.__HUGO_AURA_UI_FUNCTIONS__.config.initCustomUIProps(true);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
module.exports = { auraSettings };
|
module.exports = { auraSettings };
|
||||||
|
|||||||
@@ -0,0 +1,45 @@
|
|||||||
|
const IPC_METHOD_BASE = "$aura.debug";
|
||||||
|
|
||||||
|
const path = require("path");
|
||||||
|
|
||||||
|
const debugSettings = [
|
||||||
|
{
|
||||||
|
id: 0,
|
||||||
|
categoryName: "日志与输出",
|
||||||
|
child: [
|
||||||
|
{
|
||||||
|
index: 0,
|
||||||
|
id: "openHugoAuraLogDir",
|
||||||
|
type: "button",
|
||||||
|
style: "outline",
|
||||||
|
name: "HugoAura 日志目录",
|
||||||
|
description: "",
|
||||||
|
restart: false,
|
||||||
|
reload: false,
|
||||||
|
associateVal: null,
|
||||||
|
auraIf: () => true,
|
||||||
|
buttonContent: "打开",
|
||||||
|
valueGetter: async () => {
|
||||||
|
if (
|
||||||
|
global.__HUGO_AURA__.auraDir &&
|
||||||
|
global.__HUGO_AURA__.auraDir !== ""
|
||||||
|
) {
|
||||||
|
return (
|
||||||
|
"目录位置: " + path.join(global.__HUGO_AURA__.auraDir, "logs")
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return "未能获取日志目录位置";
|
||||||
|
}
|
||||||
|
},
|
||||||
|
callbackFn: async (event) => {
|
||||||
|
const childProc = require("child_process");
|
||||||
|
childProc.spawn(`explorer.exe`, [
|
||||||
|
`${path.join(global.__HUGO_AURA__.auraDir, "logs")}`,
|
||||||
|
]);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
module.exports = { debugSettings };
|
||||||
@@ -7,7 +7,7 @@
|
|||||||
transition: opacity 0.25s;
|
transition: opacity 0.25s;
|
||||||
}
|
}
|
||||||
|
|
||||||
.aura-header-icon.aura-header-icon-hidden {
|
#root.aura-header-icon-hidden .aura-header-icon {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,15 +9,19 @@ global.__HUGO_AURA_UI_FUNCTIONS__.headerIcon = {
|
|||||||
let clickCounter = 0;
|
let clickCounter = 0;
|
||||||
let clickTimeout = null;
|
let clickTimeout = null;
|
||||||
|
|
||||||
const onMounted = () => {
|
const onMounted = (revive = false) => {
|
||||||
if (!global.__HUGO_AURA_CONFIG__.auraSettings.uiAccessMethod.showEntryIcon) {
|
if (
|
||||||
const iconEl = document.getElementsByClassName("aura-header-icon")[0];
|
!global.__HUGO_AURA_CONFIG__.auraSettings.uiAccessMethod.showEntryIcon &&
|
||||||
iconEl.classList.add("aura-header-icon-hidden");
|
!revive
|
||||||
|
) {
|
||||||
|
const rootEl = document.getElementById("root");
|
||||||
|
rootEl.classList.add("aura-header-icon-hidden");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
global.__HUGO_AURA_CONFIG__.auraSettings.uiAccessMethod
|
global.__HUGO_AURA_CONFIG__.auraSettings.uiAccessMethod
|
||||||
.fallbackAccessMethods.hotkey
|
.fallbackAccessMethods.hotkey &&
|
||||||
|
!revive
|
||||||
) {
|
) {
|
||||||
document.addEventListener("keydown", (event) => {
|
document.addEventListener("keydown", (event) => {
|
||||||
if (event.ctrlKey && event.shiftKey && event.key === "A") {
|
if (event.ctrlKey && event.shiftKey && event.key === "A") {
|
||||||
@@ -51,4 +55,11 @@ global.__HUGO_AURA_UI_FUNCTIONS__.headerIcon = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
onMounted();
|
onMounted();
|
||||||
|
|
||||||
|
document.addEventListener(
|
||||||
|
"onLoaderElRevive:Aura.UI.Assistant.HeaderEntry",
|
||||||
|
() => {
|
||||||
|
onMounted(true);
|
||||||
|
}
|
||||||
|
);
|
||||||
})();
|
})();
|
||||||
|
|||||||
16
src/aura/ui/pages/windows/auraWsKeepAlive/index.html
Normal file
16
src/aura/ui/pages/windows/auraWsKeepAlive/index.html
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Aura WebSocket KeepAlive Window</title>
|
||||||
|
<style>
|
||||||
|
:root {
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<script>
|
||||||
|
let global = window;
|
||||||
|
</script>
|
||||||
|
<script src="../../../js/plsConnectionManager.js"></script>
|
||||||
|
</head>
|
||||||
|
<body></body>
|
||||||
|
</html>
|
||||||
40
src/aura/utils/pls.js
Normal file
40
src/aura/utils/pls.js
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
// @ts-check
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {Electron} electron
|
||||||
|
*/
|
||||||
|
const createWsWindow = (electron) => {
|
||||||
|
const path = require("path");
|
||||||
|
const { BrowserWindow } = electron;
|
||||||
|
const window = new BrowserWindow({
|
||||||
|
width: 0,
|
||||||
|
height: 0,
|
||||||
|
frame: false,
|
||||||
|
skipTaskbar: true,
|
||||||
|
transparent: true,
|
||||||
|
alwaysOnTop: false,
|
||||||
|
webPreferences: {
|
||||||
|
nodeIntegration: true,
|
||||||
|
contextIsolation: false,
|
||||||
|
devTools: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
window.setIgnoreMouseEvents(true);
|
||||||
|
window.minimize();
|
||||||
|
window.loadFile(
|
||||||
|
path.join(
|
||||||
|
__dirname,
|
||||||
|
"..",
|
||||||
|
"ui",
|
||||||
|
"pages",
|
||||||
|
"windows",
|
||||||
|
"auraWsKeepAlive",
|
||||||
|
"index.html"
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return window;
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports = { createWsWindow };
|
||||||
@@ -6,6 +6,7 @@ if (!global.__HUGO_AURA__) {
|
|||||||
configInit: false,
|
configInit: false,
|
||||||
central: () => {},
|
central: () => {},
|
||||||
ipcInit: false,
|
ipcInit: false,
|
||||||
|
auraDir: "",
|
||||||
plsStats: null,
|
plsStats: null,
|
||||||
plsSettings: null,
|
plsSettings: null,
|
||||||
plsRules: null,
|
plsRules: null,
|
||||||
@@ -24,7 +25,7 @@ if (!global.__HUGO_AURA_API__) {
|
|||||||
"https://api-aura.asaka.site",
|
"https://api-aura.asaka.site",
|
||||||
"https://api.hugoaura.dpdns.org",
|
"https://api.hugoaura.dpdns.org",
|
||||||
"https://api-aura-projekts.minorice.moe",
|
"https://api-aura-projekts.minorice.moe",
|
||||||
"https://api.aura.vim.moe"
|
"https://api.aura.vim.moe",
|
||||||
],
|
],
|
||||||
plsUpdate: "/api/getPLSLatestVersion",
|
plsUpdate: "/api/getPLSLatestVersion",
|
||||||
auraUpdate: "/api/getAuraLatestVersion",
|
auraUpdate: "/api/getAuraLatestVersion",
|
||||||
@@ -36,15 +37,46 @@ if (!global.__HUGO_AURA_CONFIG__) {
|
|||||||
global.__HUGO_AURA_CONFIG__ = {};
|
global.__HUGO_AURA_CONFIG__ = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const path = require("path");
|
||||||
|
const os = require("os");
|
||||||
|
|
||||||
const MainProcessHooksManager = require("../aura/init/main/windowHooksManager");
|
const MainProcessHooksManager = require("../aura/init/main/windowHooksManager");
|
||||||
const RendererHooksManager = require("../aura/init/rendererHook/uiHooksManager");
|
const RendererHooksManager = require("../aura/init/rendererHook/uiHooksManager");
|
||||||
const EventBus = require("../aura/utils/eventBus");
|
const EventBus = require("../aura/utils/eventBus");
|
||||||
const NetworkHook = require("../aura/init/rendererHook/networkHook");
|
const NetworkHook = require("../aura/init/rendererHook/networkHook");
|
||||||
const ConfigManager = require("../aura/init/shared/configManager");
|
const ConfigManager = require("../aura/init/shared/configManager");
|
||||||
|
const RegistryManager = require("../aura/init/shared/registryManager");
|
||||||
const { buildIpcMain } = require("../aura/init/main/ipcHandler");
|
const { buildIpcMain } = require("../aura/init/main/ipcHandler");
|
||||||
|
const plsUtils = require("../aura/utils/pls");
|
||||||
|
|
||||||
const { initLogger } = require("../aura/init/main/logger");
|
const { initLogger } = require("../aura/init/main/logger");
|
||||||
|
|
||||||
|
const getUserDocumentsDirPath = () => {
|
||||||
|
const registryManager = new RegistryManager();
|
||||||
|
const pathInfo = registryManager.readRegKeySync(
|
||||||
|
'"HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders"',
|
||||||
|
"Personal",
|
||||||
|
false,
|
||||||
|
true,
|
||||||
|
/REG_EXPAND_SZ\s+(.+)/
|
||||||
|
);
|
||||||
|
if (pathInfo.success && pathInfo.data) {
|
||||||
|
const resolvedPath = pathInfo.data.replace(
|
||||||
|
/%([^%]+)%/g,
|
||||||
|
(match, varName) => {
|
||||||
|
return process.env[varName] || match;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
return resolvedPath;
|
||||||
|
} else {
|
||||||
|
console.error(
|
||||||
|
"[HugoAura / Init / Logger] Failed to get the path of documents dir, using default val."
|
||||||
|
);
|
||||||
|
return path.join(os.homedir(), "Documents");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param {import("../aura/types/main/core").LauncherArgs} param0
|
* @param {import("../aura/types/main/core").LauncherArgs} param0
|
||||||
@@ -66,6 +98,11 @@ const launcher = ({ central, windowName, config }) => {
|
|||||||
app.exit(0);
|
app.exit(0);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
global.__HUGO_AURA__.auraDir = path.join(
|
||||||
|
getUserDocumentsDirPath(),
|
||||||
|
"HugoAura"
|
||||||
|
);
|
||||||
|
|
||||||
// >>> Init Logger <<< //
|
// >>> Init Logger <<< //
|
||||||
initLogger(windowName);
|
initLogger(windowName);
|
||||||
|
|
||||||
@@ -79,6 +116,7 @@ const launcher = ({ central, windowName, config }) => {
|
|||||||
// >>> Init Config <<< //
|
// >>> Init Config <<< //
|
||||||
const configManager = new ConfigManager();
|
const configManager = new ConfigManager();
|
||||||
configManager.side = "main";
|
configManager.side = "main";
|
||||||
|
configManager.migrateOldConfigFile();
|
||||||
configManager.ensureConfigExists();
|
configManager.ensureConfigExists();
|
||||||
const loadedConfig = configManager.loadConfig();
|
const loadedConfig = configManager.loadConfig();
|
||||||
if (!global.__HUGO_AURA__.configInit) global.__HUGO_AURA__.configInit = true;
|
if (!global.__HUGO_AURA__.configInit) global.__HUGO_AURA__.configInit = true;
|
||||||
@@ -112,6 +150,13 @@ const launcher = ({ central, windowName, config }) => {
|
|||||||
config.canOpenDevTool = true;
|
config.canOpenDevTool = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// >>> Create WebSocket KeepAlive Window <<< //
|
||||||
|
if (!global.__HUGO_AURA__.hookedWindows?.has("auraWsKeepAlive")) {
|
||||||
|
const wsKaWin = plsUtils.createWsWindow(electron);
|
||||||
|
// @ts-expect-error
|
||||||
|
global.__HUGO_AURA__.hookedWindows.set("auraWsKeepAlive", wsKaWin);
|
||||||
|
}
|
||||||
|
|
||||||
// >>> Listeners <<< //
|
// >>> Listeners <<< //
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,13 +1,18 @@
|
|||||||
// @ts-check
|
// @ts-check
|
||||||
|
|
||||||
const __AURA_VERSION__ = "0.1.1-pre-IV";
|
const __AURA_VERSION__ = "0.1.1-beta-patch-1";
|
||||||
|
|
||||||
(() => {
|
(() => {
|
||||||
if (require.main) return; // 如果只是导入 Aura Version, 不运行闭包逻辑
|
if (require.main) return; // 如果只是导入 Aura Version, 不运行闭包逻辑
|
||||||
|
|
||||||
|
const auraDir = require("electron").ipcRenderer.sendSync(
|
||||||
|
"$aura.base.getAuraDirSync"
|
||||||
|
);
|
||||||
|
|
||||||
// >>> Init Global Vars <<< //
|
// >>> Init Global Vars <<< //
|
||||||
if (!global.__HUGO_AURA__) {
|
if (!global.__HUGO_AURA__) {
|
||||||
global.__HUGO_AURA__ = {
|
global.__HUGO_AURA__ = {
|
||||||
|
auraDir: auraDir.data,
|
||||||
configInit: true, // preload 始终比 hook 晚, 默认 config 已初始化
|
configInit: true, // preload 始终比 hook 晚, 默认 config 已初始化
|
||||||
// ↑ 保留此参数的目的 -> 用于 configManager 中, configManager 的行为在 Renderer 和 Main 中是一致的
|
// ↑ 保留此参数的目的 -> 用于 configManager 中, configManager 的行为在 Renderer 和 Main 中是一致的
|
||||||
version: __AURA_VERSION__,
|
version: __AURA_VERSION__,
|
||||||
|
|||||||
Reference in New Issue
Block a user