[Feat] Bump version to 0.1.0-beta && 1st rel

This commit is contained in:
Minoricew
2025-04-18 19:20:46 +08:00
parent d976184e42
commit 7edf6ec364
40 changed files with 2234 additions and 20 deletions

29
.gitignore vendored Normal file
View File

@@ -0,0 +1,29 @@
# Dependencies
node_modules/
.npm
.yarn
# ESLint Cache
.eslintcache
# NYC Test Output
.nyc_output
# Build Artifacts
/dist
/buikd
# dotEnv Files
.env
.env*
# Misc
.DS_Store
*.log
*.bak

View File

@@ -1,6 +1,61 @@
## HugoAura
<center><img src="https://s2.loli.net/2025/04/18/IpZL7qMw2KFEi8o.png" /></center>
这是第一个可用的生产版本。
<h1 align="center">HugoAura</h1>
<h4 align="center">下一代希沃管家注入式修改方案</h4>
<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>
</div>
<br />
> [!TIP]
> 由于今天太晚了, 使用指南将于明日更新。
> HugoAura 的首个预览版已发布! [查看安装教程](https://github.com/HugoAura/HugoAura/wiki)
## ✨ 概览
[天下](https://www.bilibili.com/video/BV1UN4y1k7bA) [苦希沃管家](https://www.bilibili.com/video/BV18Z421j7Lf) [久矣](https://github.com/255doesnotexist/SeewoAssistantPasswordRecovery), 如此~~好用~~的一款集控软件, 让广大电教委员对它~~爱不释手~~。
~~古往今来~~, 无数仁人志士尝试破解希沃管家, 却无不被希沃官方修复。
然而, 如果看看希沃管家的安装目录...
<center><img src="https://s2.loli.net/2025/04/18/uc7tOQdwYbFkeWK.png" /></center>
好吧... Electron 受害者 +1
## 💻 功能
- [x] 修改希沃管家密码认证组件 (自定义密码 / 解除密码 / 重设认证方式 / ...)
- [x] 阻止希沃管家前端 Audit 上报行为
- [ ] Aura 代理层服务 (篡改上报数据 / 欺骗冰冻状态)
- [ ] 屏蔽屏幕锁 / 自定义屏幕锁行为
- [ ] 窥屏提醒
- [ ] 插件功能
> [!WARNING]
> 画饼中.jpeg
## 📷 屏幕截图
> [!IMPORTANT]
> 演示图片, 请以实际安装后效果为准
<center><img src="https://s2.loli.net/2025/04/18/2KoGaXR9463tAgP.png" /></center>
<center><img src="https://s2.loli.net/2025/04/18/2lANiTpX79FcwfC.png" /></center>
<center><img src="https://s2.loli.net/2025/04/18/VNrdt7IC1PgXSpl.png" /></center>
## ⚡ 安装与使用
请参阅 [Wiki](https://github.com/HugoAura/HugoAura/wiki) 以了解安装流程。
## ❗ 免责声明
本项目仅用于研究或教育目的, 请勿将本项目用于可能违反当地法律、侵犯著作权或其他软件 EULA 的用途。若将本项目用于非法用途, 一切后果由使用者承担。开发者不承担此类行为带来的任何后果或责任。
## ⚖ 许可证
本项目基于 [GNU GPL-3.0](https://github.com/HugoAura/HugoAura/blob/master/LICENSE) 许可证开源。

1
scripts/cd.bat Normal file
View File

@@ -0,0 +1 @@
cd "C:\Program Files (x86)\Seewo\SeewoService\SeewoService_*\SeewoServiceAssistant"

6
scripts/kar.bat Normal file
View File

@@ -0,0 +1,6 @@
cd "C:\Program Files (x86)\Seewo\SeewoService\SeewoService_*\SeewoServiceAssistant"
cls
taskkill /f /im SeewoServiceAssistant.exe
taskkill /f /im SeewoServiceAssistant.exe
taskkill /f /im SeewoServiceAssistant.exe
.\SeewoServiceAssistant.exe --inspect 9229 --aura-debug

View File

@@ -0,0 +1,10 @@
const buildIpcMain = (electron) => {
const { app, ipcMain } = electron;
ipcMain.handle("$aura.base.restartApplication", async () => {
app.relaunch();
app.exit(0);
});
};
module.exports = { buildIpcMain };

View File

@@ -0,0 +1,300 @@
const fs = require("fs");
const path = require("path");
const os = require("os");
class NetworkHook {
ruleCache = new Map();
loadRewriteRules(config) {
const networkConfig = config.networkRewrite || {};
const rules = [];
Object.entries(networkConfig).forEach(([rulePath, ruleConfig]) => {
if (this.ruleCache.has(rulePath) && !ruleConfig.enabled) {
console.log(
`[HugoAura / NetworkHook] Skipping disabled rule: ${rulePath}`
);
return;
}
try {
let rule = this.ruleCache.get(rulePath);
if (!rule) {
rule = require(path.join(
__dirname,
"../../../aura/jsRewrite/network",
rulePath
));
this.ruleCache.set(rulePath, rule);
}
if (ruleConfig.enabled) {
rules.push({
id: rulePath,
type: rule.type, // 'localResource' or 'networkRequest'
urlPattern: rule.urlPattern,
requestHook: rule.requestHook || null,
responseHook: rule.responseHook || null,
beginOfHook: rule.beginOfHook || null,
endOfHook: rule.endOfHook || null,
hookedContent: rule.hookedContent || null,
hookedContentFunc: rule.hookedContentFunc || null,
});
console.log(`[HugoAura / NetworkHook] Loaded rule: ${rulePath}`);
}
} catch (err) {
console.error(
`[HugoAura / NetworkHook] Failed to load rule ${rulePath}:`,
err
);
}
});
return rules;
}
installHook(session, config) {
const rules = this.loadRewriteRules(config);
if (rules.length === 0) return;
session.webRequest.onBeforeRequest(
{ urls: ["*://*/*", "file://*"] },
(details, callback) => {
let modified = false;
let redirectURL = null;
let newBody = null;
if (details.url.includes("hugo-aura-temp")) {
callback({});
return;
}
for (const rule of rules) {
if (this.matchUrl(rule.urlPattern, details.url)) {
console.log(
`[HugoAura / NetworkHook] Rule ${rule.id} matched URL: ${details.url}`
);
if (
rule.type === "localResource" &&
details.url.startsWith("file://")
) {
console.log(
`[HugoAura / NetworkHook] Processing rule ${rule.id}, mode: localResource`
);
modified = true;
redirectURL = this.processLocalResource(
rule,
details
).redirectURL;
} else if (rule.type === "networkRequest" && rule.requestHook) {
console.log(
`[HugoAura / NetworkHook] Processing rule ${rule.id}, mode: networkRequest`
);
try {
const originalRequest = JSON.parse(JSON.stringify(details));
const result = rule.requestHook(originalRequest);
if (result) {
if (result.redirectURL) {
redirectURL = result.redirectURL;
modified = true;
}
if (result.requestBody) {
newBody = result.requestBody;
modified = true;
}
}
} catch (err) {
console.error(
`[HugoAura / NetworkHook] Error in request hook:`,
err
);
}
}
if (modified) break;
}
}
if (modified && redirectURL) {
callback({ redirectURL });
} else if (modified && newBody) {
callback({ requestBody: newBody });
} else {
callback({});
}
}
);
session.webRequest.onHeadersReceived(
{ urls: ["*://*/*", "file://*"] },
(details, callback) => {
for (const rule of rules) {
if (
rule.type === "networkRequest" &&
rule.responseHook &&
this.matchUrl(rule.urlPattern, details.url)
) {
try {
const originalResponse = JSON.parse(JSON.stringify(details));
const result = rule.responseHook(originalResponse);
if (result && result.responseHeaders) {
callback({ responseHeaders: result.responseHeaders });
return;
}
} catch (err) {
console.error(
`[HugoAura / NetworkHook] Error in response hook:`,
err
);
}
}
}
callback({});
}
);
}
processLocalResource(rule, details) {
try {
const filePath = new URL(details.url).pathname;
const normalizedPath = decodeURIComponent(
process.platform === "win32" ? filePath.substring(1) : filePath
);
if (fs.existsSync(normalizedPath)) {
let content = fs.readFileSync(normalizedPath, "utf8");
if (
(rule.beginOfHook || rule.beginOfHookRegex) &&
(rule.endOfHook || rule.endOfHookRegex) &&
(rule.hookedContent || rule.hookedContentFunc)
) {
let startIdx = -1,
endIdx = -1;
if (rule.beginOfHookRegex) {
const beginRegex = new RegExp(rule.beginOfHookRegex);
const beginMatch = content.match(beginRegex);
if (beginMatch) {
startIdx = beginMatch.index;
}
} else if (rule.beginOfHook) {
startIdx = content.indexOf(rule.beginOfHook);
}
if (rule.endOfHookRegex) {
const endRegex = new RegExp(rule.endOfHookRegex);
const endContent = content.substring(startIdx);
const endMatch = endContent.match(endRegex);
if (endMatch) {
endIdx = startIdx + endMatch.index + endMatch[0].length;
}
} else if (rule.endOfHook) {
const endContent = content.substring(startIdx);
const relativeEndIdx = endContent.indexOf(rule.endOfHook);
if (relativeEndIdx !== -1) {
endIdx = startIdx + relativeEndIdx + rule.endOfHook.length;
}
}
if (startIdx !== -1 && endIdx !== -1) {
let beginHook =
rule.beginOfHook ||
(rule.beginOfHookRegex
? content.substring(
startIdx,
startIdx + content.substring(startIdx).search(/[;\s{]/)
)
: "");
let endHook =
rule.endOfHook ||
(rule.endOfHookRegex
? content.substring(
endIdx,
endIdx + content.substring(endIdx).search(/[;\s{]/)
)
: "");
let hookContent;
if (rule.hookedContentFunc) {
hookContent = rule.hookedContentFunc
.toString()
.match(/{([\s\S]*)}/)[1]
.trim();
} else {
hookContent = rule.hookedContent;
}
hookContent = this.minifyCode(hookContent);
content =
content.substring(0, startIdx) +
beginHook +
hookContent +
endHook +
content.substring(endIdx);
const tempDir = path.join(os.tmpdir(), "hugo-aura-temp");
if (!fs.existsSync(tempDir)) {
fs.mkdirSync(tempDir, { recursive: true });
}
const tempFile = path.join(tempDir, path.basename(normalizedPath));
fs.writeFileSync(tempFile, content, "utf8");
return {
redirectURL: `file://${
process.platform === "win32" ? "/" : ""
}${encodeURI(tempFile.replace(/\\/g, "/"))}`, // Seewo Hugo is still on Node 12 / Electron 8 TwT
};
} else {
console.warn(
`[HugoAura / NetworkHook] Could not find match points in file: ${normalizedPath}`
);
return undefined;
}
} else {
console.error(
`[HugoAura / NetworkHook] Error processing rule:`,
rule
);
}
} else {
console.error(
`[HugoAura / NetworkHook] Error processing local file: normalizedPath not exists`,
normalizedPath
);
}
} catch (err) {
console.error(
`[HugoAura / NetworkHook] Error processing local file:`,
err
);
return null;
}
}
minifyCode(code) {
return code.replace(/\s+/g, " ").trim();
}
matchUrl(pattern, url) {
if (typeof pattern === "string") {
return url.includes(pattern);
} else if (pattern instanceof RegExp) {
return pattern.test(url);
} else if (typeof pattern === "function") {
return pattern(url);
}
return false;
}
}
module.exports = NetworkHook;

View File

@@ -4,9 +4,18 @@
"enabled": true,
"type": "customPassword",
"customPassword": {
"passwordWithSalt": "770f27b0379ee6ba0f11731e49aa7af1",
"passwordWithSalt": "89f6c4d57d0202a05c32d37cc6a2c6a0",
"salt": "aura"
}
},
"authModeRewrite": "default"
}
},
"networkRewrite": {
"disableFriday": {
"enabled": true
},
"disableBehaviorAudit": {
"enabled": true
}
},
"devTools": false

View File

@@ -0,0 +1,112 @@
const buildClass = (n) => {
// >>> BEGIN OF SEEWO HUGO ORIGINAL CODE <<< //
const s = n(237),
o = n(7);
class WebSocketManager {
constructor(e, t) {
// ### BOR ### //
console.debug(
"[HugoAura / Zeron / WebSocket Hook] Created new WebSocketManager instance."
),
// ### EOR ### //
(this.host = e),
(this.isNotWss = t),
(this.intervals = 0),
(this.onMessage = this.onMessage.bind(this)),
(this.onClose = this.onClose.bind(this)),
(this.onLinkOk = this.onLinkOk.bind(this)),
(this.sendMessage = this.sendMessage.bind(this)),
(this.setHost = this.setHost.bind(this)),
(this.onDisconnectMessage = this.onDisconnectMessage.bind(this)),
(this.ws = ""),
(this.start = !1),
(this.ready = !1),
(this.relink = !1),
(this.shouldRelink = !0);
}
create() {
const { host: e, onLinkOk: t, onClose: n, onMessage: i } = this;
if (e) {
this.start = !0;
let r = this.isNotWss
? { secureProtocol: "TLSv1_2_method" }
: { rejectUnauthorized: !1, secureProtocol: "TLSv1_2_method" };
const a = new s(e, r);
!this.relink && o.info(this.host + "创建连接!"),
a.on("open", () => {
(this.intervals = 0),
(this.ready = !0),
(this.relink = !1),
o.info(e + "连接成功!"),
t();
}),
a.on("error", (t) => {
!this.relink && o.error(e + "," + t);
}),
a.on("close", () => {
(this.ready = !1),
!this.relink && this.onDisconnectMessage(),
!this.relink && o.info(e + "断开连接!"),
n();
}),
a.on("message", (t) => {
o.info("主进程接受数据", e, t),
// ### BOR ### //
console.debug(
"[HugoAura / Zeron / WebSocket Hook] New WebSocket data received:",
e,
"|",
t
),
// ### EOR ### //
i(t);
}),
(this.ws = a);
}
}
setHost(e) {
if (((this.host = e), this.ready))
try {
this.ws.close();
} catch (e) {
(this.ws = ""), this.create();
}
this.start || this.create();
}
sendMessage(e) {
const { ws: t } = this;
// ### BOR ### //
console.debug(
"[HugoAura / Zeron / WebSocket Hook] New WebSocket data sent:",
message
);
// ### EOR ### //
this.ready ? t.send(JSON.stringify(e)) : this.onDisconnectMessage(e);
}
onDisconnectMessage(e) {}
onMessage(e) {}
onLinkOk() {}
onClose() {
this.shouldRelink && this.relinkFun();
}
relinkFun() {
!this.relink &&
o.error(this.host + ", 开始重连") &&
this.onDisconnectMessage(),
(this.relink = !0),
1e4 !== this.intervals && (this.intervals += 2e3),
setTimeout(() => {
this.create();
}, this.intervals);
}
}
// >>> END OF SEEWO HUGO ORIGINAL CODE <<< //
return WebSocketManager;
};
const genHookedWS = (central) => {
return buildClass(central);
};
module.exports = genHookedWS;

View File

@@ -0,0 +1,13 @@
/// Rewrite rules basic config section begins ///
const type = "networkRequest";
const urlPattern = "device/behaviorAudit";
/// End of the rewrite rules basic config section ///
const requestHook = (originalReq) => {
return { redirectURL: "https://127.0.255.255:1145/" };
};
module.exports = { type, urlPattern, requestHook };

View File

@@ -0,0 +1,27 @@
/// Rewrite rules basic config section begins ///
const type = "localResource";
const urlPattern = "preLoad.js";
const beginOfHook = "window._faq=window._faq||[],";
const endOfHook = ",p=document,";
/// End of the rewrite rules basic config section ///
let hookedContentFunc = () => {
f =
"https://monday.cvte.local/agent/sdk/js/v2/genshin.js?_appId=" +
window.webConfig.fridayAppId;
};
hookedContentFunc = hookedContentFunc.toString().replace(";", "");
module.exports = {
type,
urlPattern,
beginOfHook,
endOfHook,
hookedContentFunc,
};

View File

@@ -11,6 +11,19 @@ const __config =
/// End of the rewrite rules basic config section ///
// >> Begin of Notes << //
/*
adminAuthMode -> mount on window._ACCEPT_DATA.data.adminAuthMode
0 == Hybrid (remoteAuth === true: 密码 / 二维码, remoteAuth === false: 密码)
1 == 仅二维码 (remoteAuth === true, 若 !remoteAuth, 页面样式会出问题)
2 == 仅密码
Reference: https://cstore-public.seewo.com/faq-service/ab2a474d022b4ddabfab788c50359115
*/
// >> End of Notes << //
const newFunction = function (e, t, b) {
"use strict";
var n,
@@ -326,6 +339,7 @@ const newFunction = function (e, t, b) {
a.setState({ isError: !0, errorText: "" });
break;
case G:
// ### BOR ### //
const originalFunc = () => {
w.a.send("passwordInputLockError", {
name: q,
@@ -351,7 +365,8 @@ const newFunction = function (e, t, b) {
a.state.crypto
.createHash("md5")
.update(
a.state.password.toString() + __config.customPassword.salt
a.state.password.toString() +
__config.customPassword.salt
)
.digest("hex") ===
__config.customPassword.passwordWithSalt
@@ -362,14 +377,17 @@ const newFunction = function (e, t, b) {
}
break;
case "bypass":
default:
a.handleSuccess();
break;
default:
originalFunc();
break;
}
} else {
originalFunc();
}
break;
// ### EOR ### //
default:
return;
}
@@ -441,6 +459,26 @@ const newFunction = function (e, t, b) {
{
key: "componentDidUpdate",
value: function (e) {
// ### BOR ### //
if (__config.authModeRewrite !== "default") {
switch (__config.authModeRewrite) {
case "hybrid":
window._ACCEPT_DATA.data.adminAuthMode = 0;
window._ACCEPT_DATA.data.remoteAuth = true;
break;
case "remoteOnly":
window._ACCEPT_DATA.data.adminAuthMode = 1;
window._ACCEPT_DATA.data.remoteAuth = true;
break;
case "passwordOnly":
window._ACCEPT_DATA.data.adminAuthMode = 2;
window._ACCEPT_DATA.data.remoteAuth = false;
break;
default:
break;
}
}
// ### EOR ### //
this.state.show
? this.refs.password &&
this.refs.password.addEventListener(

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,212 @@
const showReloadToast = () => {
const prevToast = document.getElementById("relaunchNotifyToast");
const prevToastBs = bootstrap.Toast.getOrCreateInstance(prevToast);
if (prevToastBs.isShown()) return;
const toast = document.getElementById("reloadNotifyToast");
const toastBs = bootstrap.Toast.getOrCreateInstance(toast);
if (!toastBs.isShown()) toastBs.show();
};
const showRelaunchToast = () => {
const prevToast = document.getElementById("reloadNotifyToast");
const prevToastBs = bootstrap.Toast.getOrCreateInstance(prevToast);
if (prevToastBs.isShown()) prevToastBs.hide();
const toast = document.getElementById("relaunchNotifyToast");
const toastBs = bootstrap.Toast.getOrCreateInstance(toast);
if (!toastBs.isShown()) toastBs.show();
};
const showToast = (entry) => {
if (entry.reload) {
showReloadToast();
} else if (entry.restart) {
showRelaunchToast();
}
};
const settingsRenderer = (pendingEl, settingsObj) => {
const formEl = document.createElement("form");
formEl.classList.add("aura-settings-form");
for (const category of settingsObj) {
const categoryTitleEl = document.createElement("p");
categoryTitleEl.classList.add("aura-settings-category-header");
categoryTitleEl.textContent = category.categoryName;
formEl.appendChild(categoryTitleEl);
for (const entry of category.child) {
const entryContainerEl = document.createElement("div");
entryContainerEl.classList.add("aura-settings-entry");
entryContainerEl.id = `${entry.id}Container`;
const entryInfoContainerEl = document.createElement("div");
entryInfoContainerEl.classList.add("aura-settings-entry-info-container");
const entryTitle = document.createElement("p");
entryTitle.classList.add("aura-settings-entry-title");
entryTitle.textContent = entry.name;
if (entry.restart) {
const powerIcon = document.createElement("i");
powerIcon.classList.add(
"layui-icon",
"layui-icon-logout",
"aura-settings-entry-property-icon"
);
powerIcon.setAttribute("data-bs-toggle", "tooltip");
powerIcon.setAttribute("data-bs-placement", "top");
powerIcon.setAttribute("data-bs-title", "需要重启 Electron 进程");
entryTitle.appendChild(powerIcon);
}
if (entry.reload) {
const reloadIcon = document.createElement("i");
reloadIcon.classList.add(
"layui-icon",
"layui-icon-refresh",
"aura-settings-entry-property-icon"
);
reloadIcon.setAttribute("data-bs-toggle", "tooltip");
reloadIcon.setAttribute("data-bs-placement", "top");
reloadIcon.setAttribute("data-bs-title", "需要重载页面");
entryTitle.appendChild(reloadIcon);
}
if (entry.tip) {
const tipIcon = document.createElement("i");
tipIcon.classList.add(
"layui-icon",
"layui-icon-tips",
"aura-settings-entry-property-icon"
);
tipIcon.setAttribute("data-bs-toggle", "tooltip");
tipIcon.setAttribute("data-bs-placement", "top");
tipIcon.setAttribute("data-bs-title", entry.tipTitle);
entryTitle.appendChild(tipIcon);
}
const entryDescription = document.createElement("p");
entryDescription.classList.add("aura-settings-entry-desc");
entryDescription.textContent = entry.description;
entryInfoContainerEl.appendChild(entryTitle);
entryInfoContainerEl.appendChild(entryDescription);
entryContainerEl.appendChild(entryInfoContainerEl);
const entryOperationArea = document.createElement("div");
entryOperationArea.classList.add("aura-settings-entry-operation-area");
switch (entry.type) {
case "switch":
{
const switchEl = document.createElement("input");
switchEl.classList.add("form-check-input");
switchEl.type = "checkbox";
switchEl.role = "switch";
switchEl.id = entry.id;
const elValue = entry.valueGetter();
switchEl.value = elValue;
switchEl.checked = elValue;
switchEl.addEventListener("change", (event) => {
showToast(entry);
entry.callbackFn(event.target.checked);
});
entryOperationArea.classList.add("form-check", "form-switch");
entryOperationArea.appendChild(switchEl);
}
break;
case "radio":
{
const elValue = entry.valueGetter();
for (const template of entry.templates) {
const inlineContainerEl = document.createElement("div");
inlineContainerEl.classList.add(
"form-check",
"form-check-inline"
);
const radioEl = document.createElement("input");
radioEl.value = template;
radioEl.classList.add("form-check-input");
radioEl.type = "radio";
radioEl.name = `${entry.id}Radios`;
radioEl.id = `${entry.id}Radio${entry.templates.indexOf(
template
)}`;
radioEl.checked = template === elValue ? true : false;
radioEl.addEventListener("change", (event) => {
if (event.target.checked) {
showToast(entry);
entry.callbackFn(event.target.value);
}
});
inlineContainerEl.appendChild(radioEl);
const labelEl = document.createElement("label");
labelEl.classList.add("form-check-label");
labelEl.setAttribute("for", radioEl.id);
labelEl.textContent =
entry.templateLabels[entry.templates.indexOf(template)];
inlineContainerEl.appendChild(labelEl);
entryOperationArea.appendChild(inlineContainerEl);
}
}
break;
case "input":
{
const inputEl = document.createElement("input");
inputEl.classList.add("form-control");
inputEl.type = entry.subType;
inputEl.value = entry.valueGetter();
inputEl.placeholder = entry.placeHolder;
inputEl.id = entry.id;
inputEl.addEventListener("change", (event) => {
const result = entry.callbackFn(event.target.value);
const success = result.valid;
if (success) {
showToast(entry);
if (inputEl.className.includes("is-invalid")) {
inputEl.classList.remove("is-invalid");
entryDescription.textContent = entry.description;
entryDescription.classList.remove("ase-desc-error-hint");
}
} else {
inputEl.classList.add("is-invalid");
entryDescription.textContent = result.hint;
entryDescription.classList.add("ase-desc-error-hint");
}
});
entryOperationArea.classList.add("ase-operation-area-expanded");
entryOperationArea.appendChild(inputEl);
}
break;
default:
break;
}
entryContainerEl.appendChild(entryOperationArea);
const isShow = entry.auraIf();
if (!isShow) entryContainerEl.classList.add("aura-settings-entry-hidden");
if (entry.associateVal) {
document.addEventListener("onHugoAuraConfigUpdate", (event) => {
if (!entry.associateVal.includes(event.detail.path.join("."))) return;
const cls = entryContainerEl.classList;
const isShow = entry.auraIf();
isShow
? cls.remove("aura-settings-entry-hidden")
: cls.add("aura-settings-entry-hidden");
});
}
formEl.appendChild(entryContainerEl);
}
const hrEl = document.createElement("hr");
hrEl.classList.add("aura-settings-hr-horizontal");
formEl.appendChild(hrEl);
}
pendingEl.appendChild(formEl);
const tooltipTriggerList = document.querySelectorAll(
'[data-bs-toggle="tooltip"]'
);
[...tooltipTriggerList].map(
(tooltipTriggerEl) => new bootstrap.Tooltip(tooltipTriggerEl)
);
};
module.exports = { settingsRenderer };

70
src/aura/ui/css/form.css Normal file
View File

@@ -0,0 +1,70 @@
.aura-settings-form {
padding: 0.5rem 1.5rem;
}
.aura-settings-category-header {
font-size: x-large;
margin-bottom: 1.5rem;
}
.aura-settings-entry {
display: flex;
flex-direction: row;
margin-top: 1.5rem;
}
.aura-settings-entry.aura-settings-entry-hidden {
display: none;
}
.aura-settings-entry-info-container {
flex: 1;
}
.aura-settings-entry-title {
font-size: 15px;
}
.aura-settings-entry-desc {
font-size: small;
opacity: 0.5;
margin-top: 0.25rem;
}
.aura-settings-entry-desc.ase-desc-error-hint {
color: rgba(230, 0, 0);
opacity: 0.875;
}
.aura-settings-entry-operation-area {
display: flex !important;
align-items: center;
justify-content: center;
}
.aura-settings-entry-operation-area.ase-operation-area-expanded {
flex: 0.75;
}
.aura-settings-entry-operation-area.form-switch {
transform: scale(1.2);
}
.aura-settings-hr-horizontal {
margin-top: 1rem;
margin-bottom: 1.75rem;
border-bottom: 0.75px solid rgba(0, 0, 0, 0.25);
}
.aura-settings-entry-property-icon {
margin-left: 0.5rem;
font-size: 15px;
}
.aura-settings-entry-property-icon.layui-icon-logout {
color: rgb(226, 113, 17);
}
.aura-settings-entry-property-icon.layui-icon-refresh {
color: rgb(0, 106, 188);
}

View File

@@ -0,0 +1,27 @@
:root {
/* Bootstrap var overrides */
--bs-body-bg: transparent !important;
--bs-border-color: #00000036 !important;
--bs-link-color: #383838 !important;
--bs-link-hover-color: #5d5d5d !important;
--bs-emphasis-color: #1a1a1a !important;
--bs-border-radius: 0.2rem !important;
}
/* Bootstrap Component Styles Overrides */
button.nav-link {
margin: 0.5rem 1rem;
}
.nav {
margin-left: 0.5rem;
}
.nav-underline {
--bs-nav-underline-link-active-color: #0d6efd !important;
}

View File

@@ -13,13 +13,30 @@ module.exports = {
active: false,
pageURI: "ui/pages/config/config.html",
pageScript: "ui/pages/config/config.js",
pageSelector: ".index__homepage__KtQOPvrN",
pageSelector: "#root",
selectorMode: "appendChild",
pageCSS: "ui/pages/config/config.css",
},
"Aura.UI.Assistant.Config.DisableLimitations": {
active: false,
pageURI:
"ui/pages/configSubPages/disableLimitations/disableLimitations.html",
pageScript:
"ui/pages/configSubPages/disableLimitations/disableLimitations.js",
pageSelector: ".aura-config-page-subpage-container",
selectorMode: "appendChild",
pageCSS:
"ui/pages/configSubPages/disableLimitations/disableLimitations.css",
},
},
globalStyles: ["ui/css/global.css", "ui/css/assistant.css", "ui/layui/css/layui.css"],
globalJS: ["ui/layui/layui.js"],
globalStyles: [
"ui/css/global.css",
"ui/css/assistant.css",
"ui/css/form.css",
"ui/layui/css/layui.css",
"ui/bootstrap/bootstrap.min.css",
],
globalJS: ["ui/js/global.js", "ui/bootstrap/bootstrap.bundle.min.js"],
onLoaded: `
console.log('[HugoAura / UI / Hooks / Assistant] Page loaded.');
`,

9
src/aura/ui/js/global.js Normal file
View File

@@ -0,0 +1,9 @@
(() => {
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
if (!window.__HUGO_AURA_GLOBAL__) window.__HUGO_AURA_GLOBAL__ = {};
window.__HUGO_AURA_GLOBAL__.utils = {
sleep,
};
})();

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,409 @@
/* General */
#aura-container-Aura-UI-Assistant-Config {
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 100%;
z-index: 1000;
}
.aura-config-page-root {
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 100%;
background: url("../../../../app.asar/public/ae247697b4639c92bd008d0ea7d13b53.png");
/* 这里不用 background-size: cover; 的效果反而更舒服一些... */
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
opacity: 1;
transform: scale(1);
transition: all 0.5s;
}
.aura-config-page-root-inactive {
opacity: 0;
transform: scale(1.5);
}
/* Header */
.aura-config-page-header-area {
flex: 1;
display: flex;
flex-direction: row;
justify-content: flex-start;
width: 100%;
padding-left: 8px;
padding-right: 8px;
color: white;
opacity: 1;
transform: translateY(0);
transition: all 0.5s;
}
.aura-config-page-header-area .iconfont {
font-size: 24px;
transition: all 0.25s;
}
.aura-config-page-header-area .iconfont:hover {
opacity: 0.75;
cursor: pointer;
}
.aura-config-page-header-area .iconfont:active {
opacity: 0.375;
}
.aura-config-page-header-area p {
margin-top: -2px;
}
.aura-config-page-header-area.header-collapsed {
transform: translateY(-1rem);
opacity: 0;
}
.aura-config-page-app-bar {
height: 40px;
display: flex;
justify-content: flex-start;
align-items: center;
width: 100%;
}
/* Status */
.aura-config-page-status-container {
flex: 1;
width: 100%;
align-self: center;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
opacity: 1;
transition: all 0.5s;
}
.aura-config-page-status-container-hidden {
position: absolute;
opacity: 0;
}
.aura-config-page-status-main,
.aura-config-page-status-description {
width: 100%;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
}
.aura-config-page-status-description {
margin-top: 0.5rem;
transform: translateY(0);
opacity: 1;
transition: all 0.5s;
}
.aura-config-page-status-description.status-description-hidden {
transform: translateY(-2rem);
opacity: 0;
}
.aura-config-page-status-description p {
font-size: 18px;
margin-left: 15px;
margin-top: -2px;
color: white;
font-family: "Consolas", "Microsoft YaHei", sans-serif;
}
.aura-config-page-status-description i {
color: white;
}
.aura-config-page-central-aura-logo {
margin: 0.5rem 3rem;
width: 17.5%;
}
.aura-config-hr-vertical {
height: 3.75rem;
width: 1px;
background-color: rgba(255, 255, 255, 0.3);
margin-left: 30px;
margin-right: 30px;
border: none;
}
.aura-config-page-status-el {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-family: "Consolas", monospace;
color: white;
/*
.version-type {
content: "I want to use scss plz 😇"
}
*/
}
.aura-config-page-status-side {
height: 30%;
display: flex;
flex-direction: row;
align-items: center;
flex: 1;
transform: translateX(0);
opacity: 1;
transition: transform 0.5s, opacity 0.5s;
}
.aura-config-page-status-side.left-side {
justify-content: flex-end;
}
.aura-config-page-status-side.left-side.status-side-hidden {
transform: translateX(5rem);
opacity: 0;
}
.aura-config-page-status-side.right-side {
justify-content: flex-start;
}
.aura-config-page-status-side.right-side.status-side-hidden {
transform: translateX(-5rem);
opacity: 0;
}
.aura-config-page-status-el .version-type {
font-size: 20px;
font-weight: 500;
}
.aura-config-page-status-el .version-content {
font-size: 16px;
margin-top: 5px;
opacity: 0.625;
}
/* Operation */
.aura-config-page-operation-area {
display: flex;
flex-direction: column;
align-items: center;
justify-content: flex-end;
flex: 1;
width: 100%;
overflow-y: auto;
}
.aura-config-page-operation-area::-webkit-scrollbar {
display: none;
}
.aura-config-page-operation-area.subpage-expanded {
flex: 15;
}
.aura-config-page-subpage-container {
width: 100%;
height: 0;
background-color: rgba(255, 255, 255, 0.825);
z-index: 6000;
overflow-y: scroll;
opacity: 0;
transition: all 0.5s;
}
.aura-config-page-subpage-container::-webkit-scrollbar {
display: none;
}
.aura-config-page-operation-area.subpage-expanded
.aura-config-page-subpage-container {
height: calc(100% - 40px - 4rem);
opacity: 1;
}
.aura-config-page-operation-container {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
background-color: rgba(255, 255, 255, 0.1);
padding-left: 1rem;
padding-right: 1rem;
}
.aura-config-page-operation-container.hide-other-operations
.aura-config-page-operation-el:not(.preserve-operation) {
max-width: 0;
opacity: 0;
}
.aura-config-page-operation-container.hide-other-operations
.aura-config-page-operation-el.preserve-operation {
flex: 0.25;
}
.aura-config-page-operation-el {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
flex: 1;
padding-top: 2rem;
padding-bottom: 2rem;
overflow: hidden;
white-space: nowrap;
max-width: 25%;
opacity: 1;
transform: translateY(0);
transition: opacity 0.5s, transform 0.5s,
max-width cubic-bezier(0, 0.42, 0.18, 1) 0.5s;
}
.aura-config-page-operation-el.operation-el-show:hover {
cursor: pointer;
}
.aura-config-page-operation-el.operation-el-show[aura-disabled="true"]:hover {
cursor: not-allowed;
}
.aura-config-page-operation-el.operation-el-hidden {
transform: translateY(2rem);
opacity: 0;
}
.aura-config-page-operation-el.operation-el-show
.aura-config-page-operation-body {
opacity: 1;
transition: opacity 0.25s;
}
.aura-config-page-operation-el.operation-el-show[aura-disabled="true"]
.aura-config-page-operation-body {
transition: opacity 0.5s;
}
.aura-config-page-operation-el.operation-el-show:not(.preserve-operation):hover
.aura-config-page-operation-body {
opacity: 0.625;
}
.aura-config-page-operation-el.operation-el-show[aura-disabled="true"]:hover
.aura-config-page-operation-body {
opacity: 0.25;
}
.aura-config-page-operation-el.operation-el-show:not(.preserve-operation):active
.aura-config-page-operation-body {
opacity: 0.25;
}
.aura-config-page-operation-el.operation-el-show[aura-disabled="true"]::after {
content: "别急嘛, 还在开发呢...";
font-size: 16px;
opacity: 0;
color: white;
position: absolute;
transition: all 0.5s;
}
.aura-config-page-operation-el.operation-el-show[aura-disabled="true"]:hover::after,
.aura-config-page-operation-el.operation-el-show[aura-disabled="true"]:active::after {
opacity: 1;
}
.aura-config-page-operation-body {
display: flex;
align-items: center;
justify-content: center;
}
.aura-config-page-operation-el img {
max-width: 40px;
margin-right: 20px;
}
.aura-config-page-operation-el .config-operation-title {
color: white;
font-size: large;
}
.aura-config-page-operation-el .config-operation-description {
color: white;
opacity: 0.75;
font-size: small;
}
/* Toast */
.aura-config-page-toast-area {
z-index: 9000;
}
.aura-config-page-toast-area .toast {
--bs-toast-border-width: 0 !important;
--bs-toast-bg: #fff !important;
}
.aura-config-page-toast-area .toast-header {
background-color: rgb(255, 234, 202);
border-top-left-radius: var(--bs-toast-border-radius);
border-top-right-radius: var(--bs-toast-border-radius);
}
.aura-config-page-toast-area .toast.acp-toast-emerg .toast-header {
background-color: rgb(255, 202, 202);
}
.aura-config-page-toast-area .toast-header * {
color: rgba(234, 126, 14, 0.85);
}
.aura-config-page-toast-area .toast.acp-toast-emerg .toast-header * {
color: rgba(234, 65, 14, 0.85);
}
.aura-config-page-toast-area .toast-body p {
margin-bottom: var(--bs-toast-padding-x);
}
.aura-config-page-toast-area .toast-header .layui-icon {
font-weight: bolder;
margin-right: 0.5rem;
font-size: 18px;
}

View File

@@ -0,0 +1,166 @@
<div class="aura-config-page-root-inactive aura-config-page-root">
<div class="header-collapsed aura-config-page-header-area">
<div class="aura-config-page-app-bar" style="-webkit-app-region: drag">
<div
onclick="global.__HUGO_AURA_UI_FUNCTIONS__.config.handleNavBack()"
style="-webkit-app-region: no-drag; z-index: 2000"
>
<i class="iconfont"></i>
</div>
<p>雨光之环</p>
</div>
</div>
<div class="aura-config-page-status-container">
<div class="aura-config-page-status-main">
<div
class="aura-config-page-status-side left-side status-side-hidden"
id="leftStatusContainer"
>
<div class="aura-config-page-status-el">
<p class="version-type">Node</p>
<p class="version-content" id="nodeVersion">
v{{ versionInfo.node }}
</p>
<!-- I want to use Vue plz 😭😭😭 -->
</div>
<hr class="aura-config-hr-vertical" />
<div class="aura-config-page-status-el">
<p class="version-type">Electron</p>
<p class="version-content" id="electronVersion">
v{{ versionInfo.electron }}
</p>
</div>
</div>
<img
src="../../aura/ui/static/aura.svg"
class="aura-config-page-central-aura-logo"
/>
<div
class="aura-config-page-status-side right-side status-side-hidden"
id="rightStatusContainer"
>
<div class="aura-config-page-status-el">
<p class="version-type">Hugo</p>
<p class="version-content" id="hugoVersion">
v{{ versionInfo.hugo }}
</p>
</div>
<hr class="aura-config-hr-vertical" />
<div class="aura-config-page-status-el">
<p class="version-type">Aura</p>
<p class="version-content" id="auraVersion">
v{{ versionInfo.aura }}
</p>
</div>
</div>
</div>
<div class="status-description-hidden aura-config-page-status-description">
<i class="layui-icon layui-icon-ok" style="font-size: 24px"></i>
<p>HugoAura 正常运行中</p>
</div>
</div>
<div class="aura-config-page-operation-area">
<div class="aura-config-page-subpage-container"></div>
<div class="aura-config-page-operation-container">
<div
class="operation-el-hidden aura-config-page-operation-el"
onclick="window.__HUGO_AURA_UI_FUNCTIONS__.config.toggleSubConfig('disableLimitations', true)"
>
<div class="aura-config-page-operation-body">
<img src="../../aura/ui/static/config/no_limitations.svg" />
<div>
<p class="config-operation-title">限制解除</p>
<p class="config-operation-description">禁用密码、关闭冰点</p>
</div>
</div>
</div>
<div
class="operation-el-hidden aura-config-page-operation-el"
aura-disabled="true"
>
<div class="aura-config-page-operation-body">
<img src="../../aura/ui/static/config/behaviour_mon.svg" />
<div>
<p class="config-operation-title">行为管控</p>
<p class="config-operation-description">窥屏提醒、数据欺骗</p>
</div>
</div>
</div>
<div
class="operation-el-hidden aura-config-page-operation-el"
aura-disabled="true"
>
<div class="aura-config-page-operation-body">
<img src="../../aura/ui/static/config/plugin.svg" />
<div>
<p class="config-operation-title">插件管理</p>
<p class="config-operation-description">插件列表、安装插件</p>
</div>
</div>
</div>
<div class="operation-el-hidden aura-config-page-operation-el">
<div class="aura-config-page-operation-body">
<img src="../../aura/ui/static/config/about.svg" />
<div>
<p class="config-operation-title">关于项目</p>
<p class="config-operation-description">使用文档、获取帮助</p>
</div>
</div>
</div>
</div>
</div>
<div class="aura-config-page-toast-area">
<div class="toast-container position-fixed bottom-0 end-0 p-3">
<div
id="reloadNotifyToast"
class="toast"
aria-atomic="true"
data-bs-autohide="false"
>
<div class="toast-header">
<i class="layui-icon layui-icon-tips"></i>
<strong class="me-auto">重载页面以应用设置</strong>
</div>
<div class="toast-body">
<p>请重载当前窗口以应用修改的设置</p>
<button
type="button"
class="btn btn-primary btn-sm"
onclick="window.location.reload()"
>
重载页面
</button>
</div>
</div>
</div>
<div class="toast-container position-fixed bottom-0 end-0 p-3">
<div
id="relaunchNotifyToast"
class="toast acp-toast-emerg"
aria-atomic="true"
data-bs-autohide="false"
>
<div class="toast-header">
<i class="layui-icon layui-icon-tips"></i>
<strong class="me-auto">重启进程以应用设置</strong>
</div>
<div class="toast-body">
<p>请重启 Electron 进程以应用修改的设置</p>
<button
type="button"
class="btn btn-primary btn-sm"
onclick="ipcRenderer.invoke('$aura.base.restartApplication')"
>
重启进程
</button>
</div>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,180 @@
global.__HUGO_AURA_UI_REACTIVES__.config = {
isInSubPage: false,
currentActiveSubPage: "",
};
global.__HUGO_AURA_UI_FUNCTIONS__.config = {
handleNavBack: () => {
if (global.__HUGO_AURA_UI_REACTIVES__.config.isInSubPage) {
global.__HUGO_AURA_UI_FUNCTIONS__.config.toggleSubConfig(
global.__HUGO_AURA_UI_REACTIVES__.config.currentActiveSubPage,
false
);
} else {
global.__HUGO_AURA_UI_FUNCTIONS__.config.hideConfigPage();
}
},
hideConfigPage: async () => {
const defaultHeader = document.getElementsByClassName(
"index__header__16DmR2a5"
)[0];
defaultHeader.style = "-webkit-app-region: drag;";
const auraConfigPageRoot = document.getElementsByClassName(
"aura-config-page-root"
)[0];
auraConfigPageRoot.className =
"aura-config-page-root-inactive aura-config-page-root";
await window.__HUGO_AURA_GLOBAL__.utils.sleep(500);
window.__HUGO_AURA_LOADER__["Aura.UI.Assistant.Config"].active = false;
},
toggleSubConfig: (subPage, side) => {
if (side === global.__HUGO_AURA_UI_REACTIVES__.config.isInSubPage) return;
if (!side) {
side = !global.__HUGO_AURA_UI_REACTIVES__.config.isInSubPage;
}
const operationContainerEl = document.getElementsByClassName(
"aura-config-page-operation-container"
)[0];
side
? operationContainerEl.classList.add("hide-other-operations")
: operationContainerEl.classList.remove("hide-other-operations");
const operationElArr = document.getElementsByClassName(
"aura-config-page-operation-el"
);
let pendingSubPageId = "";
switch (subPage) {
case "disableLimitations":
side
? operationElArr[0].classList.add("preserve-operation")
: operationElArr[0].classList.remove("preserve-operation");
pendingSubPageId = "Aura.UI.Assistant.Config.DisableLimitations";
break;
default:
break;
}
const operationAreaEl = document.getElementsByClassName(
"aura-config-page-operation-area"
)[0];
if (side) {
operationAreaEl.classList.add("subpage-expanded");
} else {
operationAreaEl.style = "flex: 15;";
operationAreaEl.classList.remove("subpage-expanded");
setTimeout(() => {
operationAreaEl.style = "";
}, 500);
}
const statusContainerEl = document.getElementsByClassName(
"aura-config-page-status-container"
)[0];
if (side) {
statusContainerEl.classList.add(
"aura-config-page-status-container-hidden"
);
} else {
setTimeout(() => {
statusContainerEl.classList.remove(
"aura-config-page-status-container-hidden"
);
}, 500);
}
setTimeout(
() => {
window.__HUGO_AURA_LOADER__[pendingSubPageId].active = side;
},
side ? 0 : 500
);
global.__HUGO_AURA_UI_REACTIVES__.config.currentActiveSubPage = side
? subPage
: "";
global.__HUGO_AURA_UI_REACTIVES__.config.isInSubPage = side;
},
};
(() => {
const applyVersionInfo = () => {
const nodeVersionEl = document.getElementById("nodeVersion");
const electronVersionEl = document.getElementById("electronVersion");
const hugoVersionEl = document.getElementById("hugoVersion");
const auraVersionEl = document.getElementById("auraVersion");
nodeVersionEl.textContent = window.process.versions.node;
electronVersionEl.textContent = window.process.versions.electron;
hugoVersionEl.textContent = window.CUSTOM_CONFIG.root
.replace(/\\/g, "/")
.split("SeewoService_")[1]
.split("/")[0];
auraVersionEl.textContent = window.__HUGO_AURA__.version;
};
const showVersionContainerAnimation = () => {
const leftSidePane = document.getElementById("leftStatusContainer");
const rightSidePane = document.getElementById("rightStatusContainer");
leftSidePane.className = "aura-config-page-status-side left-side";
rightSidePane.className = "aura-config-page-status-side right-side";
const descriptionEl = document.getElementsByClassName(
"aura-config-page-status-description"
)[0];
descriptionEl.className = "aura-config-page-status-description";
};
const showHeaderAnimation = () => {
const headerEl = document.getElementsByClassName(
"aura-config-page-header-area"
)[0];
headerEl.className = "aura-config-page-header-area";
};
const showOperationsAnimation = () => {
const operationElArr = document.getElementsByClassName(
"aura-config-page-operation-el"
);
let timeout = 0;
Array.from(operationElArr).forEach((el) => {
setTimeout(() => {
el.className = "operation-el-show aura-config-page-operation-el";
}, timeout);
timeout += 150;
});
};
const showAnimation = async () => {
const defaultHeader = document.getElementsByClassName(
"index__header__16DmR2a5"
)[0];
const auraConfigPageRoot = document.getElementsByClassName(
"aura-config-page-root"
)[0];
await window.__HUGO_AURA_GLOBAL__.utils.sleep(200);
auraConfigPageRoot.className = "aura-config-page-root";
await window.__HUGO_AURA_GLOBAL__.utils.sleep(500);
defaultHeader.style = "display: none;";
showVersionContainerAnimation();
showHeaderAnimation();
await window.__HUGO_AURA_GLOBAL__.utils.sleep(500);
showOperationsAnimation();
};
const onMounted = () => {
applyVersionInfo();
showAnimation();
};
onMounted();
})();

View File

@@ -0,0 +1,9 @@
.aura-config-subpage-disable-limit-root {
opacity: 1;
transition: opacity 0.5s;
}
.aura-config-subpage-disable-limit-root.acs-disable-limit-root-hidden {
opacity: 0;
}

View File

@@ -0,0 +1,49 @@
<div
id="acs-disable-limit-root-el"
class="aura-config-subpage-disable-limit-root acs-disable-limit-root-hidden"
>
<ul class="nav nav-underline mb-3" role="tablist">
<li class="nav-item" role="presentation">
<button
class="nav-link active"
id="auth-subpage-tab"
data-bs-toggle="pill"
data-bs-target="#auth-subpage"
type="button"
role="tab"
aria-controls="auth-subpage"
aria-selected="true"
>
认证与基础设施
</button>
</li>
<li class="nav-item" role="presentation">
<button
class="nav-link"
id="disable-audit-tab"
data-bs-toggle="pill"
data-bs-target="#disable-audit-subpage"
type="button"
role="tab"
aria-controls="disable-audit-subpage"
aria-selected="false"
>
上报屏蔽
</button>
</li>
</ul>
<div class="tab-content">
<div
class="tab-pane fade show active"
id="auth-subpage"
role="tabpanel"
aria-labelledby="auth-subpage-tab"
></div>
<div
class="tab-pane fade"
id="disable-audit-subpage"
role="tabpanel"
aria-labelledby="disable-audit-tab"
></div>
</div>
</div>

View File

@@ -0,0 +1,32 @@
(() => {
const pathBase =
"../../aura/ui/pages/configSubPages/disableLimitations/settings";
const {
settingsRenderer,
} = require("../../aura/ui/composables/settingsRenderer");
const { authSettings } = require(`${pathBase}/auth`);
const { banAuditSettings } = require(`${pathBase}/audit`);
const initAuthSubPage = () => {
const authSubPageEl = document.getElementById("auth-subpage");
settingsRenderer(authSubPageEl, authSettings);
};
const initBanAuditSubPage = () => {
const banAuditSubPageEl = document.getElementById("disable-audit-subpage");
settingsRenderer(banAuditSubPageEl, banAuditSettings);
};
const onMounted = () => {
initAuthSubPage();
initBanAuditSubPage();
const rootEl = document.getElementById("acs-disable-limit-root-el");
setTimeout(() => {
rootEl.classList.remove("acs-disable-limit-root-hidden");
}, 500);
};
onMounted();
})();

View File

@@ -0,0 +1,60 @@
const banAuditSettings = [
{
id: 0,
categoryName: "数据收集与分析",
child: [
{
index: 0,
id: "disableFridayReport",
type: "switch",
name: "禁用 Friday 错误统计",
description: "重置 CVTE 的 Friday 错误收集服务载入 URL, 避免意外的信息上传",
restart: true,
reload: false,
associateVal: null,
auraIf: () => true,
defaultValue: false,
valueGetter: () => {
return global.__HUGO_AURA_CONFIG__.networkRewrite.disableFriday
.enabled;
},
callbackFn: (newVal) => {
if (typeof newVal !== "boolean") return;
global.__HUGO_AURA_CONFIG__.networkRewrite.disableFriday.enabled =
newVal;
},
},
],
},
{
id: 1,
categoryName: "行为上报",
child: [
{
index: 0,
id: "disableBehaviorAudit",
type: "switch",
name: "禁用行为上报",
description: "禁止希沃管家前端在进行敏感操作时, 向希沃基础服务上报行为",
restart: true,
reload: false,
tip: true,
tipTitle: '启用后, 可能造成部分操作出现较长延迟 (如冰点操作)。希沃管家会尝试五次上报, 均失败后才会进行下一步操作',
associateVal: null,
auraIf: () => true,
defaultValue: false,
valueGetter: () => {
return global.__HUGO_AURA_CONFIG__.networkRewrite.disableBehaviorAudit
.enabled;
},
callbackFn: (newVal) => {
if (typeof newVal !== "boolean") return;
global.__HUGO_AURA_CONFIG__.networkRewrite.disableBehaviorAudit.enabled =
newVal;
},
},
],
},
];
module.exports = { banAuditSettings };

View File

@@ -0,0 +1,161 @@
const authSettings = [
{
id: 0,
categoryName: "身份验证",
child: [
{
index: 0,
id: "enableAuthOverride",
type: "switch",
name: "启用身份验证覆写功能",
description: "覆写希沃管家的身份验证组件, 实现限制解除",
restart: false,
reload: true,
associateVal: null,
auraIf: () => true,
defaultValue: false,
valueGetter: () => {
return global.__HUGO_AURA_CONFIG__.rewrite[
"vendor/passwordValidation"
].enabled;
},
callbackFn: (newVal) => {
if (typeof newVal !== "boolean") return;
global.__HUGO_AURA_CONFIG__.rewrite[
"vendor/passwordValidation"
].enabled = newVal;
},
},
{
index: 1,
id: "authOverrideType",
type: "radio",
name: "密码覆写模式",
description: "自定义密码 / 完全解除密码 / 仅使用学校密码",
restart: false,
reload: false,
tip: true,
tipTitle: '使用 "任意" 选项后, 仍需输入至少一位密码才能继续操作',
associateVal: ["rewrite.vendor/passwordValidation.enabled"],
auraIf: () => {
return global.__HUGO_AURA_CONFIG__.rewrite[
"vendor/passwordValidation"
].enabled;
},
defaultValue: "none",
templates: ["customPassword", "bypass", "none"],
templateLabels: ["自定义", "任意", "不修改"],
valueGetter: () => {
return global.__HUGO_AURA_CONFIG__.rewrite[
"vendor/passwordValidation"
].type;
},
callbackFn: (newVal) => {
global.__HUGO_AURA_CONFIG__.rewrite[
"vendor/passwordValidation"
].type = newVal;
},
},
{
index: 2,
id: "customPassword",
type: "input",
subType: "password",
name: "自定义密码",
description: "设置一个自定义密码, 可与原管理密码共用",
restart: false,
reload: false,
associateVal: [
"rewrite.vendor/passwordValidation.enabled",
"rewrite.vendor/passwordValidation.type",
],
auraIf: () => {
return (
global.__HUGO_AURA_CONFIG__.rewrite["vendor/passwordValidation"]
.enabled &&
global.__HUGO_AURA_CONFIG__.rewrite["vendor/passwordValidation"]
.type === "customPassword"
);
},
defaultValue: "",
placeHolder: "留空表示不修改, 保留已设置值",
valueGetter: () => {
return "";
},
callbackFn: (newVal) => {
if (newVal === "" || !newVal) return { valid: true };
if (newVal.length < 6)
return { valid: false, hint: "请输入至少 6 位密码" };
const __config =
global.__HUGO_AURA_CONFIG__.rewrite["vendor/passwordValidation"];
const crypto = require("crypto");
const result = crypto
.createHash("md5")
.update(newVal + __config.customPassword.salt)
.digest("hex");
__config.customPassword.passwordWithSalt = result;
return { valid: true };
},
},
{
index: 3,
id: "authModeRewriteType",
type: "radio",
name: "验证方式覆写",
description: "密码 + 二维码混合 / 仅二维码 / 仅密码",
restart: false,
reload: false,
tip: true,
tipTitle: '一般选择 "混合" 或 "仅密码" 即可',
associateVal: ["rewrite.vendor/passwordValidation.enabled"],
auraIf: () => {
return global.__HUGO_AURA_CONFIG__.rewrite[
"vendor/passwordValidation"
].enabled;
},
defaultValue: "hybrid",
templates: ["hybrid", "remoteOnly", "passwordOnly"],
templateLabels: ["混合", "仅二维码", "仅密码"],
valueGetter: () => {
return global.__HUGO_AURA_CONFIG__.rewrite[
"vendor/passwordValidation"
].authModeRewrite;
},
callbackFn: (newVal) => {
global.__HUGO_AURA_CONFIG__.rewrite[
"vendor/passwordValidation"
].authModeRewrite = newVal;
},
},
],
},
{
id: 1,
categoryName: "基础设施",
child: [
{
index: 0,
id: "enableDevTools",
type: "switch",
name: "启用开发者工具",
description: "修改希沃管家的全局配置, 允许打开 DevTools",
restart: true,
reload: false,
tip: true,
tipTitle: "启用后, 按下 Ctrl + Shift + I 即可打开 DevTools",
associateVal: null,
auraIf: () => true,
defaultValue: false,
valueGetter: () => {
return global.__HUGO_AURA_CONFIG__.devTools;
},
callbackFn: (newVal) => {
if (typeof newVal !== "boolean") return;
global.__HUGO_AURA_CONFIG__.devTools = newVal;
},
},
],
},
];
module.exports = { authSettings };

View File

@@ -3,6 +3,16 @@
height: 40px;
-webkit-app-region: no-drag;
position: relative;
transition: opacity 0.25s;
}
.aura-header-icon:hover {
opacity: 0.75;
}
.aura-header-icon:active {
opacity: 0.375;
}
.aura-header-icon img {

View File

@@ -1,6 +1,8 @@
<div class="aura-header-icon">
<div class="buttonClick__button-click__3bNeY1Ax"></div>
<img
src="../../aura/ui/static/aura.svg"
/>
<div
class="buttonClick__button-click__3bNeY1Ax"
onclick="global.__HUGO_AURA_UI_FUNCTIONS__.headerIcon.showAuraConfig()"
></div>
<img src="../../aura/ui/static/aura.svg" />
<!-- src is relative to app.asar/public/assistant.html ! -->
</div>

View File

@@ -0,0 +1,5 @@
global.__HUGO_AURA_UI_FUNCTIONS__.headerIcon = {
showAuraConfig: () => {
window.__HUGO_AURA_LOADER__["Aura.UI.Assistant.Config"].active = true;
},
};

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<svg width="162" height="162" viewBox="0 0 162 162" fill="none" xmlns="http://www.w3.org/2000/svg">
<g>
<g transform="translate(13.5 13.5)">
<path d="M3.48998 0.768768L3.41573 0.782272L2.93649 1.01852L2.80148 1.04552L2.70698 1.01852C2.70698 1.01852 2.22773 0.782272 2.22773 0.782272C2.15573 0.759781 2.10173 0.771027 2.06573 0.816025C2.06573 0.816025 2.03873 0.883514 2.03873 0.883514L1.92398 3.77252L1.95773 3.90753L2.02523 3.99529L2.72723 4.49478L2.82848 4.52177L2.90948 4.49478L3.61149 3.99529L3.69249 3.88727L3.71948 3.77252C3.71948 3.77252 3.60474 0.890274 3.60474 0.890274C3.58673 0.818253 3.54848 0.777771 3.48998 0.768768M5.2788 0.00617981L5.19106 0.0196838L3.94231 0.647446L3.8748 0.714935L3.85455 0.789185L3.97605 3.6917L4.0098 3.77269L4.0638 3.81995C4.0638 3.81995 5.42056 4.44769 5.42056 4.44769C5.50605 4.47018 5.5713 4.45219 5.6163 4.39369C5.6163 4.39369 5.6433 4.29919 5.6433 4.29919C5.6433 4.29919 5.4138 0.154694 5.4138 0.154694C5.3913 0.0737 5.3463 0.0241852 5.27879 0.00619507M0.452255 0.019577C0.390457 -0.0178986 0.31012 -4.57764e-05 0.269997 0.0600739C0.269997 0.0600739 0.2295 0.154572 0.2295 0.154572C0.2295 0.154572 0 4.29909 0 4.29909C0.00450134 4.38008 0.0427475 4.43408 0.114754 4.46109C0.114754 4.46109 0.216003 4.44757 0.216003 4.44757L1.57275 3.81982L1.64026 3.76582L1.66725 3.69157L1.78201 0.789078L1.76176 0.708084L1.69425 0.640579C1.69425 0.640579 0.452255 0.019577 0.452255 0.019577Z" transform="translate(68.013 142.723)" />
<path d="M67.5 0C104.78 0 135 30.2198 135 67.5C135 104.78 104.78 135 67.5 135C30.2198 135 0 104.78 0 67.5C0 30.2197 30.2198 0 67.5 0C67.5 0 67.5 0 67.5 0ZM67.5 13.5C37.6766 13.5 13.5 37.6766 13.5 67.5C13.5 97.3234 37.6766 121.5 67.5 121.5C97.3234 121.5 121.5 97.3234 121.5 67.5C121.5 37.6766 97.3234 13.5 67.5 13.5C67.5 13.5 67.5 13.5 67.5 13.5Z" fill="#B3DCFF" fill-rule="evenodd" />
<path d="M6.70886 0C10.1068 0 12.9225 2.20725 13.4409 5.09744L13.4409 47.2394C12.4596 47.7267 11.334 48 10.1514 48L6.84387 48C3.07861 48 0.0263672 45.2869 0.0263672 41.94L0.0263672 12L0 12L0 0L6.70886 0L6.70886 0Z" fill="#FFFFFF" fill-rule="evenodd" transform="translate(60.724 56)" />
<path d="M6.75 0C10.4779 0 13.5 3.02208 13.5 6.75C13.5 10.4779 10.4779 13.5 6.75 13.5C3.02208 13.5 0 10.4779 0 6.75C0 3.02208 3.02208 0 6.75 0C6.75 0 6.75 0 6.75 0Z" fill="#FFFFFF" fill-rule="evenodd" transform="translate(60.75 33.75)" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<svg width="162" height="162" viewBox="0 0 162 162" fill="none" xmlns="http://www.w3.org/2000/svg">
<g>
<g transform="translate(16.2 11.7)">
<g>
<path d="M64.7781 0C36.7599 0 14.0466 22.7133 14.0466 50.7316C14.0466 50.7316 14.0466 76.3003 14.0466 76.3003C14.0477 77.4243 13.7872 78.5334 13.2857 79.5396C13.2857 79.5396 0.842023 104.42 0.842023 104.42C-0.394028 106.891 -0.262085 109.827 1.19072 112.177C2.64353 114.528 5.20998 115.958 7.97329 115.958C7.97329 115.958 121.583 115.958 121.583 115.958C124.346 115.958 126.913 114.528 128.365 112.177C129.818 109.827 129.95 106.892 128.714 104.42C128.714 104.42 116.278 79.5399 116.278 79.5399C115.774 78.5343 115.511 77.4252 115.51 76.3003C115.51 76.3003 115.51 50.7316 115.51 50.7316C115.51 22.7133 92.7964 0 64.7781 0C64.7781 0 64.7781 0 64.7781 0ZM64.7781 137.7C55.56 137.705 47.3408 131.896 44.2681 123.205C44.2681 123.205 85.2882 123.205 85.2882 123.205C82.2155 131.896 73.9963 137.705 64.7782 137.7C64.7782 137.7 64.7781 137.7 64.7781 137.7Z" />
<path d="M80.5297 130.958C82.6024 128.784 84.243 126.161 85.2882 123.205L44.2681 123.205C45.3132 126.161 46.9538 128.784 49.0266 130.958C53.0477 135.175 58.6955 137.703 64.7781 137.7C70.8608 137.703 76.5085 135.175 80.5297 130.958ZM103.76 115.958L121.583 115.958C124.346 115.958 126.913 114.528 128.365 112.177C129.818 109.827 129.95 106.892 128.714 104.42L116.278 79.5399C115.774 78.5343 115.511 77.4252 115.51 76.3003L115.51 50.7316C115.51 22.7133 92.7964 0 64.7781 0C36.7599 0 14.0466 22.7133 14.0466 50.7316L14.0466 76.3003C14.0477 77.4243 13.7872 78.5334 13.2857 79.5396L0.842023 104.42C-0.394028 106.891 -0.262085 109.827 1.19072 112.177C2.64353 114.528 5.20998 115.958 7.97329 115.958L103.76 115.958ZM39.5121 25.4655Q49.9776 15 64.7781 15Q79.5786 15 90.0441 25.4655Q100.51 35.9311 100.51 50.7316L100.51 76.3164Q100.515 81.567 102.861 86.2465L110.214 100.958L19.345 100.958L26.711 86.23Q29.0517 81.5331 29.0466 76.3003L29.0466 50.7316Q29.0466 35.9311 39.5121 25.4655Z" fill="#B3DCFF" fill-rule="evenodd" />
</g>
</g>
<g transform="translate(59 59)">
<g transform="translate(8.583 8.583)">
<path d="M2.22293 0.488846L2.17142 0.497437L1.86672 0.647644L1.78088 0.66481L1.7208 0.647644C1.7208 0.647644 1.41609 0.493149 1.41609 0.493149C1.37031 0.481705 1.33598 0.490288 1.31309 0.518898C1.31309 0.518898 1.29593 0.561813 1.29593 0.561813L1.22297 2.39865L1.24442 2.48448L1.28734 2.54028L1.73367 2.85786L1.79805 2.87502L1.84955 2.85786L2.29589 2.54028L2.34739 2.4716L2.36455 2.39865C2.36455 2.39865 2.29159 0.566109 2.29159 0.566109C2.28015 0.520325 2.25726 0.494576 2.22293 0.488853M3.35603 0.00384521L3.29594 0.0124359L2.50628 0.41156L2.46336 0.454483L2.45048 0.501686L2.52773 2.34711L2.54919 2.39861L2.58352 2.43293C2.58352 2.43293 3.44615 2.82776 3.44615 2.82776C3.50051 2.84206 3.542 2.83062 3.57061 2.79343C3.57061 2.79343 3.58778 2.73335 3.58778 2.73335C3.58778 2.73335 3.44186 0.098259 3.44186 0.098259C3.42755 0.0438995 3.39894 0.0124359 3.35602 0.00384521M0.287544 0.0124435C0.248253 -0.0113754 0.197178 -2.28882e-05 0.171665 0.0381927C0.171665 0.0381927 0.14592 0.0982742 0.14592 0.0982742C0.14592 0.0982742 0 2.73336 0 2.73336C0.00286102 2.78486 0.0271797 2.8192 0.0729599 2.83636C0.0729599 2.83636 0.137337 2.82778 0.137337 2.82778L0.999962 2.42865L1.04288 2.39432L1.05576 2.34711L1.133 0.501694L1.12013 0.450195L1.07721 0.40728C1.07721 0.40728 0.287544 0.0124435 0.287544 0.0124435Z" transform="translate(43.243 90.743)" />
<path d="M34.3333 4.29167C34.3333 1.92145 32.4119 0 30.0417 0C27.6714 0 25.75 1.92145 25.75 4.29167C25.75 4.29167 25.75 12.875 25.75 12.875C25.75 15.2452 27.6714 17.1667 30.0417 17.1667C32.4119 17.1667 34.3333 15.2452 34.3333 12.875C34.3333 12.875 34.3333 4.29167 34.3333 4.29167ZM14.8664 8.79794C13.7888 7.68229 12.1932 7.23486 10.6927 7.62761C9.19218 8.02037 8.02037 9.19219 7.62761 10.6927C7.23486 12.1932 7.68229 13.7888 8.79794 14.8664C8.79794 14.8664 14.8664 20.9434 14.8664 20.9434C15.952 22.029 17.5345 22.4529 19.0175 22.0554C20.5005 21.6578 21.6587 20.4992 22.0558 19.0161C22.4528 17.5329 22.0284 15.9506 20.9423 14.8653C20.9423 14.8653 14.8664 8.79794 14.8664 8.79794ZM33.4364 26.6512C29.2392 25.2521 25.2522 29.2391 26.647 33.4321C26.647 33.4321 41.8095 78.9152 41.8095 78.9152C43.3416 83.5158 49.7061 83.8849 51.7618 79.4902C51.7618 79.4902 60.5812 60.5812 60.5812 60.5812C60.5812 60.5812 79.4903 51.7618 79.4903 51.7618C83.885 49.7104 83.5159 43.3415 78.9152 41.8094C78.9152 41.8094 33.4364 26.6512 33.4364 26.6512ZM51.2855 8.79799C52.9609 10.4739 52.9609 13.1905 51.2855 14.8664C51.2855 14.8664 45.2171 20.9434 45.2171 20.9434C44.1324 22.0288 42.551 22.4529 41.0688 22.056C39.5865 21.659 38.4288 20.5012 38.0318 19.019C37.6348 17.5368 38.059 15.9554 39.1444 14.8707C39.1444 14.8707 45.2171 8.80228 45.2171 8.80228C46.893 7.12689 49.6096 7.12689 51.2855 8.80228C51.2855 8.80228 51.2855 8.79799 51.2855 8.79799ZM0 30.0417C0 27.6714 1.92145 25.75 4.29167 25.75C4.29167 25.75 12.875 25.75 12.875 25.75C15.2452 25.75 17.1667 27.6714 17.1667 30.0417C17.1667 32.4119 15.2452 34.3333 12.875 34.3333C12.875 34.3333 4.29167 34.3333 4.29167 34.3333C1.92145 34.3333 0 32.4119 0 30.0417C0 30.0417 0 30.0417 0 30.0417ZM20.939 45.2171C22.0244 44.1324 22.4486 42.551 22.0516 41.0688C21.6546 39.5865 20.4969 38.4288 19.0146 38.0318C17.5324 37.6348 15.951 38.059 14.8663 39.1444C14.8663 39.1444 8.79791 45.2171 8.79791 45.2171C7.68228 46.2946 7.23486 47.8902 7.62762 49.3907C8.02037 50.8912 9.19218 52.063 10.6927 52.4558C12.1931 52.8485 13.7888 52.4011 14.8663 51.2855C14.8663 51.2855 20.939 45.2171 20.939 45.2171Z" fill="#FFFFFF" fill-rule="evenodd" />
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 5.6 KiB

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<svg width="162" height="162" viewBox="0 0 162 162" fill="none" xmlns="http://www.w3.org/2000/svg">
<g>
<g transform="translate(16.2 8.107)">
<path d="M66.1689 0.106313C66.1689 0.106313 125.736 9.17831 125.736 9.17831C127.96 9.51446 129.6 11.4261 129.6 13.6738C129.6 13.6738 129.6 88.7365 129.6 88.7365C129.6 111.145 109.054 129.957 67.959 145.181C65.9206 145.936 63.6794 145.936 61.641 145.181C20.5457 129.957 0 111.145 0 88.7365C0 88.7365 0 13.6738 0 13.6738C0 11.4261 1.64025 9.51446 3.8637 9.17831C3.8637 9.17831 63.4311 0.106313 63.4311 0.106313C64.3383 -0.0354376 65.2617 -0.0354376 66.1689 0.106313C66.1689 0.106313 66.1689 0.106313 66.1689 0.106313Z" />
<path d="M125.736 9.17831L66.1689 0.106313C65.2617 -0.0354376 64.3383 -0.0354376 63.4311 0.106313L3.8637 9.17831C1.64025 9.51446 0 11.4261 0 13.6738L0 88.7365C0 111.145 20.5457 129.957 61.641 145.181C63.6794 145.936 65.9206 145.936 67.959 145.181C109.054 129.957 129.6 111.145 129.6 88.7365L129.6 13.6738C129.6 11.4261 127.96 9.51446 125.736 9.17831ZM64.8 15.0708L15 22.6552L15 88.7365Q15 111.444 64.8 130.346Q114.6 111.444 114.6 88.7365L114.6 22.6552L64.8 15.0708Z" fill="#B3DCFF" fill-rule="evenodd" />
</g>
<path d="M48.6 0L0 7.4034C0 7.4034 0 72.4545 0 72.4545C0 85.9451 14.8959 99.9054 48.6 112.78C82.3041 99.9054 97.2 85.945 97.2 72.4545C97.2 72.4545 97.2 7.4034 97.2 7.4034L48.6 0L48.6 0Z" transform="translate(32.4 24.389)" />
<path d="M6 0C9.31416 0 12 2.68584 12 6L12 46C12 49.3142 9.31416 52 6 52L6 52C2.68584 52 0 49.3142 0 46L0 6C0 2.68584 2.68584 0 6 0Z" fill="#FFFFFF" transform="translate(75 41)" />
<path d="M6 0C9.31416 0 12 2.68584 12 6L12 6C12 9.31416 9.31416 12 6 12L6 12C2.68584 12 0 9.31416 0 6L0 6C0 2.68584 2.68584 0 6 0Z" fill="#FFFFFF" transform="translate(75 101)" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<svg width="162" height="162" viewBox="0 0 162 162" fill="none" xmlns="http://www.w3.org/2000/svg">
<g>
<g transform="translate(13.5 13.5)">
<path d="M3.48976 0.768814L3.41551 0.782318L2.93626 1.01855L2.80126 1.04556L2.70676 1.01855C2.70676 1.01855 2.22751 0.782318 2.22751 0.782318C2.15551 0.759827 2.10151 0.771057 2.06551 0.816055C2.06551 0.816055 2.03851 0.88356 2.03851 0.88356L1.92376 3.77255L1.9575 3.90756L2.02501 3.99532L2.72701 4.49481L2.82826 4.5218L2.90926 4.49481L3.61127 3.99532L3.69227 3.8873L3.71926 3.77255C3.71926 3.77255 3.60452 0.890305 3.60452 0.890305C3.58651 0.818298 3.54826 0.777802 3.48976 0.768814M5.27851 0.00605774L5.19077 0.0195618L3.94201 0.647308L3.87451 0.714813L3.85426 0.789063L3.97575 3.69156L4.00951 3.77255L4.06351 3.81981C4.06351 3.81981 5.42027 4.44756 5.42027 4.44756C5.50576 4.47005 5.57101 4.45206 5.61601 4.39355C5.61601 4.39355 5.64301 4.29906 5.64301 4.29906C5.64301 4.29906 5.41351 0.154556 5.41351 0.154556C5.39101 0.0735626 5.34601 0.0240631 5.27851 0.00605774M0.452255 0.0195618C0.390457 -0.0178986 0.310127 -4.57764e-05 0.269997 0.0600739C0.269997 0.0600739 0.2295 0.154572 0.2295 0.154572C0.2295 0.154572 0 4.29907 0 4.29907C0.00450134 4.38007 0.0427475 4.43408 0.114754 4.46107C0.114754 4.46107 0.216003 4.44757 0.216003 4.44757L1.57275 3.81982L1.64026 3.76582L1.66726 3.69157L1.78201 0.789078L1.76176 0.708084L1.69425 0.640579C1.69425 0.640579 0.452255 0.0195618 0.452255 0.0195618Z" transform="translate(68.013 142.723)" />
<path d="M57.375 13.5C53.9315 13.4994 50.7332 15.2818 48.9223 18.2106C47.1113 21.1395 46.946 24.7972 48.4852 27.8775C48.4852 27.8775 49.5855 30.0713 49.5855 30.0713C50.7053 32.3061 50.5863 34.9618 49.271 37.0875C47.9557 39.2132 45.6322 40.5048 43.1325 40.5C43.1325 40.5 20.25 40.5 20.25 40.5C16.5221 40.5 13.5 43.5221 13.5 47.25C13.5 47.25 13.5 55.3095 13.5 55.3095C25.785 54.5738 37.125 64.2938 37.125 77.625C37.125 90.9563 25.785 100.676 13.5 99.9405C13.5 99.9405 13.5 114.75 13.5 114.75C13.5 118.478 16.5221 121.5 20.25 121.5C20.25 121.5 35.0595 121.5 35.0595 121.5C34.3237 109.215 44.0438 97.875 57.375 97.875C70.7062 97.875 80.4262 109.215 79.6905 121.5C79.6905 121.5 87.75 121.5 87.75 121.5C91.4779 121.5 94.5 118.478 94.5 114.75C94.5 114.75 94.5 91.8675 94.5 91.8675C94.5 86.508 100.136 83.025 104.929 85.4145C104.929 85.4145 107.116 86.5147 107.116 86.5147C111.295 88.6011 116.363 87.4949 119.293 83.8568C122.222 80.2187 122.222 75.0313 119.293 71.3932C116.363 67.7551 111.295 66.6489 107.116 68.7353C107.116 68.7353 104.929 69.8355 104.929 69.8355C102.694 70.9553 100.038 70.8363 97.9125 69.521C95.7868 68.2057 94.4952 65.8822 94.5 63.3825C94.5 63.3825 94.5 47.25 94.5 47.25C94.5 43.5221 91.4779 40.5 87.75 40.5C87.75 40.5 71.6175 40.5 71.6175 40.5C66.258 40.5 62.775 34.8638 65.1645 30.0712C65.1645 30.0712 66.2647 27.8775 66.2647 27.8775C67.804 24.7972 67.6387 21.1395 65.8277 18.2106C64.0168 15.2818 60.8185 13.4994 57.375 13.5C57.375 13.5 57.375 13.5 57.375 13.5ZM34.182 27C32.049 13.3853 42.4845 0 57.375 0C72.2655 0 82.701 13.3853 80.568 27C80.568 27 87.75 27 87.75 27C98.9338 27 108 36.0662 108 47.25C108 47.25 108 54.432 108 54.432C121.615 52.299 135 62.7345 135 77.625C135 92.5155 121.615 102.951 108 100.818C108 100.818 108 114.75 108 114.75C108 125.934 98.9338 135 87.75 135C87.75 135 71.5028 135 71.5028 135C69.0912 135.006 66.8387 133.797 65.511 131.784C64.1834 129.771 63.9592 127.224 64.9148 125.01C64.9148 125.01 65.4885 123.68 65.4885 123.68C67.0753 119.983 65.9612 115.68 62.7793 113.217C59.5974 110.754 55.1526 110.754 51.9707 113.217C48.7888 115.68 47.6747 119.983 49.2615 123.68C49.2615 123.68 49.8353 125.017 49.8353 125.017C51.8603 129.742 48.3908 135 43.2473 135C43.2473 135 20.25 135 20.25 135C9.06623 135 0 125.934 0 114.75C0 114.75 0 91.7528 0 91.7528C0 86.6093 5.25825 83.1398 9.99 85.1648C9.99 85.1648 11.3198 85.7385 11.3198 85.7385C15.0174 87.3253 19.3203 86.2112 21.7832 83.0293C24.2462 79.8474 24.2462 75.4026 21.7832 72.2207C19.3203 69.0388 15.0174 67.9247 11.3198 69.5115C11.3198 69.5115 9.98325 70.0853 9.98325 70.0853C5.25825 72.1103 0 68.6408 0 63.4973C0 63.4973 0 47.25 0 47.25C1.60933e-06 36.0662 9.06623 27 20.25 27C20.25 27 34.182 27 34.182 27Z" fill="#B3DCFF" fill-rule="evenodd" />
</g>
<path d="M40.5001 0C42.9854 5.24521e-06 45.0001 2.01472 45.0001 4.5C45.0001 4.5 45.0001 18 45.0001 18C45.0001 20.4853 42.9854 22.5 40.5001 22.5C38.0148 22.5 36.0001 20.4853 36.0001 18C36.0001 18 36.0001 4.5 36.0001 4.5C36.0001 2.01472 38.0148 0 40.5001 0C40.5001 0 40.5001 0 40.5001 0ZM69.1384 11.8617C70.8951 13.619 70.8951 16.4674 69.1384 18.2247C69.1384 18.2247 59.5939 27.7737 59.5939 27.7737C57.8355 29.532 54.9847 29.532 53.2264 27.7737C51.468 26.0154 51.468 23.1645 53.2264 21.4062C53.2264 21.4062 62.7754 11.8617 62.7754 11.8617C64.5326 10.105 67.3811 10.105 69.1384 11.8617C69.1384 11.8617 69.1384 11.8617 69.1384 11.8617ZM81 40.5001C81 42.9854 78.9854 45.0001 76.5001 45.0001C76.5001 45.0001 63.0001 45.0001 63.0001 45.0001C60.5148 45.0001 58.5001 42.9854 58.5001 40.5001C58.5001 38.0149 60.5148 36.0001 63.0001 36.0001C63.0001 36.0001 76.5001 36.0001 76.5001 36.0001C78.9854 36.0001 81.0001 38.0149 81.0001 40.5001C81.0001 40.5001 81 40.5001 81 40.5001ZM69.1384 69.1377C67.3811 70.8944 64.5326 70.8944 62.7754 69.1377C62.7754 69.1377 53.2264 59.5932 53.2264 59.5932C51.468 57.8349 51.468 54.9841 53.2264 53.2257C54.9847 51.4674 57.8355 51.4674 59.5939 53.2257C59.5939 53.2257 69.1384 62.7747 69.1384 62.7747C70.8951 64.532 70.8951 67.3805 69.1384 69.1377C69.1384 69.1377 69.1384 69.1377 69.1384 69.1377ZM40.5001 80.9997C38.0148 80.9997 36.0001 78.9849 36.0001 76.4997C36.0001 76.4997 36.0001 62.9997 36.0001 62.9997C36.0022 60.5159 38.0163 58.5035 40.5001 58.5035C42.9839 58.5035 44.998 60.5159 45.0001 62.9997C45.0001 62.9997 45.0001 76.4997 45.0001 76.4997C45.0001 78.985 42.9854 80.9997 40.5001 80.9997C40.5001 80.9997 40.5001 80.9997 40.5001 80.9997ZM11.8624 69.1377C10.1057 67.3805 10.1057 64.532 11.8624 62.7747C11.8624 62.7747 21.4069 53.2257 21.4069 53.2257C23.1652 51.4674 26.016 51.4674 27.7744 53.2257C29.5327 54.9841 29.5327 57.8349 27.7744 59.5932C27.7744 59.5932 18.2254 69.1377 18.2254 69.1377C16.4681 70.8944 13.6196 70.8944 11.8624 69.1377C11.8624 69.1377 11.8624 69.1377 11.8624 69.1377ZM7.62939e-05 40.5001C7.62939e-05 38.0149 2.01479 36.0001 4.50007 36.0001C4.50007 36.0001 18.0001 36.0001 18.0001 36.0001C20.4838 36.0023 22.4962 38.0164 22.4962 40.5002C22.4962 42.984 20.4838 44.9981 18 45.0001C18 45.0001 4.49999 45.0001 4.49999 45.0001C2.01472 45.0001 0 42.9854 0 40.5001C0 40.5001 7.62939e-05 40.5001 7.62939e-05 40.5001ZM11.8624 11.8617C13.6196 10.105 16.4681 10.105 18.2254 11.8617C18.2254 11.8617 27.7744 21.4062 27.7744 21.4062C29.5327 23.1645 29.5327 26.0154 27.7744 27.7737C26.016 29.532 23.1652 29.532 21.4069 27.7737C21.4069 27.7737 11.8624 18.2247 11.8624 18.2247C10.1057 16.4674 10.1057 13.6189 11.8624 11.8617C11.8624 11.8617 11.8624 11.8617 11.8624 11.8617Z" fill="#FFFFFF" transform="translate(72 6)" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 6.9 KiB

View File

@@ -6,22 +6,102 @@ if (!global.__HUGO_AURA__) {
};
}
const HooksManager = require("../aura/init/hook/hooksManager");
const fs = require("fs");
const util = require("util");
const path = require("path");
const os = require("os");
const HooksManager = require("../aura/init/rendererHook/hooksManager");
const NetworkHook = require("../aura/init/rendererHook/networkHook");
const configManager = require("../aura/init/shared/configManager");
const { buildIpcMain } = require("../aura/init/main/ipcHandler");
const initLogger = () => {
const logDir = path.join(os.homedir(), "Documents", "HugoAura", "logs");
if (!fs.existsSync(logDir)) {
fs.mkdirSync(logDir, { recursive: true });
}
const logFile = path.join(
logDir,
`main-process-${new Date().toISOString().replace(/:/g, "-")}.log`
);
const logStream = fs.createWriteStream(logFile, { flags: "a" });
const originalConsole = {
log: console.log,
error: console.error,
warn: console.warn,
info: console.info,
debug: console.debug,
};
console.log = function (...args) {
const msg = util.format("[LOG] ", ...args) + "\n";
logStream.write(msg);
originalConsole.log.apply(console, args);
};
console.error = function (...args) {
const msg = util.format("[ERROR] ", ...args) + "\n";
logStream.write(msg);
originalConsole.error.apply(console, args);
};
console.warn = function (...args) {
const msg = util.format("[WARN] ", ...args) + "\n";
logStream.write(msg);
originalConsole.warn.apply(console, args);
};
console.info = function (...args) {
const msg = util.format("[INFO] ", ...args) + "\n";
logStream.write(msg);
originalConsole.info.apply(console, args);
};
console.debug = function (...args) {
if (!process.argv.includes("--aura-debug")) return;
const msg = util.format("[DEBUG] ", ...args) + "\n";
logStream.write(msg);
originalConsole.debug.apply(console, args);
};
process.on("uncaughtException", (err) => {
console.error("UNCAUGHT EXCEPTION:", err);
});
console.log("Logger initialized. Log file:", logFile);
};
module.exports = function ({ central, windowName, config }) {
process.stdout.isTTY = true;
process.stderr.isTTY = true;
const electron = central(0);
const electron = central(1);
const app = electron.app;
if (!global.__HUGO_AURA__.central) global.__HUGO_AURA__.central = central;
global.reloadApp = () => {
app.relaunch({ args: process.argv.slice(1).concat(["--inspect 5858"]) });
app.exit(0);
};
initLogger();
console.log("[HugoAura / Loaded] Aura is loaded!");
if (!global.__HUGO_AURA__.ipcInit) {
buildIpcMain(electron);
global.__HUGO_AURA__.ipcInit = true;
}
const hooksManager = new HooksManager();
configManager.ensureConfigExists();
const loadedConfig = configManager.loadConfig();
if (!global.__HUGO_AURA__.configInit) global.__HUGO_AURA__.configInit = true;
const hooks = hooksManager.loadHooks();
if (loadedConfig.devTools && !config.canOpenDevTool) {
@@ -30,6 +110,18 @@ module.exports = function ({ central, windowName, config }) {
const webContentsCreatedListener = (_event, webContents) => {
const hookConfig = hooks.get(windowName);
const initNetworkHook = () => {
const networkHook = new NetworkHook();
networkHook.installHook(webContents.session, loadedConfig);
console.debug(
`[HugoAura / Init / Done / NetworkHook] Network Hook for ${windowName} installed.`
);
};
initNetworkHook();
if (hookConfig) {
hooksManager.handleWindowHook(webContents, hookConfig, windowName);
} else {

View File

@@ -1,9 +1,21 @@
const __AURA_VERSION__ = "0.1.0-beta";
(() => {
if (!global.__HUGO_AURA__) {
global.__HUGO_AURA__ = {
configInit: true,
configInit: true, // preload 始终比 hook 晚, 默认 config 已初始化
version: __AURA_VERSION__,
};
}
if (!global.__HUGO_AURA_UI_FUNCTIONS__) {
global.__HUGO_AURA_UI_FUNCTIONS__ = {};
}
if (!global.__HUGO_AURA_UI_REACTIVES__) {
global.__HUGO_AURA_UI_REACTIVES__ = {};
}
const configManager = require("../aura/init/shared/configManager");
const WebpackHook = require("../aura/init/preload/webpackHook");
@@ -19,10 +31,17 @@
},
set(target, prop, value) {
target[prop] = value;
const configUpdateEvent = new CustomEvent("onHugoAuraConfigUpdate", {
detail: {
path: [...path, prop],
value,
},
});
document.dispatchEvent(configUpdateEvent);
console.log(
`[HugoAura / Config] Config changed at path: ${[...path, prop].join(
"."
)}`
)}, new value: ${value}`
);
configManager.writeConfig(window.__HUGO_AURA_CONFIG__);
return true;

23
src/core/zeron.js Normal file
View File

@@ -0,0 +1,23 @@
// Ex-Early Load Pro Plus Max ++
console.debug("[HugoAura / Zeron] Early load script loaded.");
module.exports = function (central) {
const originalCentral = { ...central };
const genHookedWS = require("../aura/init/zeron/hookWS");
console.debug(
"[HugoAura / Zeron / WebSocket Hook] WebSocket hooked class generated."
);
return new Proxy(central, {
apply(target, thisArg, args) {
switch (args[0]) {
case 18:
return genHookedWS(central);
default:
return Reflect.apply(target, thisArg, args);
}
},
});
};