added electron

This commit is contained in:
kitbyte
2025-01-01 15:48:14 +02:00
parent 61e5b5594d
commit 1a67918384
4 changed files with 66 additions and 5 deletions
+10
View File
@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
Setup with electron
</body>
</html>
+26
View File
@@ -0,0 +1,26 @@
const { app, BrowserWindow } = require('electron')
const path = require('path')
app.disableHardwareAcceleration()
app.commandLine.appendSwitch('disable-http-cache')
function createWindow () {
const win = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
nodeIntegration: true,
contextIsolation: false,
spellcheck: false
},
autoHideMenuBar: true
})
win.loadFile('index.html')
}
app.whenReady().then(createWindow)
app.on('window-all-closed', () => {
app.quit()
})
+28 -3
View File
@@ -3,13 +3,38 @@
"version": "1.0.0", "version": "1.0.0",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"test": "echo \"Error: no test specified\" && exit 1" "start": "electron .",
"build": "electron-builder --win portable"
}, },
"keywords": [], "keywords": [],
"author": "", "author": "kitbyte",
"license": "ISC", "license": "Apache-2.0",
"description": "", "description": "",
"dependencies": { "dependencies": {
"asar": "^3.2.0" "asar": "^3.2.0"
},
"devDependencies": {
"electron": "^33.2.1",
"electron-builder": "^25.1.8"
},
"build": {
"appId": "kitbyte.wemod-patcher",
"productName": "WeMod Patcher",
"directories": {
"output": "dist"
},
"asar": true,
"win": {
"target": [{
"target": "portable",
"arch": ["x64"]
}],
"artifactName": "${productName}.exe"
},
"compression": "maximum",
"removePackageScripts": true,
"removePackageKeywords": true,
"extraResources": false,
"electronLanguages": ["en-US"]
} }
} }
+2 -2
View File
@@ -5,7 +5,7 @@ const asar = require('asar');
const patchBySignature = require("./memoryScanner"); const patchBySignature = require("./memoryScanner");
const regex = /getUserAccount\(\)\{.*?return\s+this\.#\w+\.fetch\(\{.*?\}\).*?\}/g; const regex = /getUserAccount\(\)\{.*?return\s+this\.#\w+\.fetch\(\{.*?}\).*?}/g;
const asarPatch = "getUserAccount(){return this.#<fetch_field_name>.fetch({endpoint:\"/v3/account\",method:\"GET\",name:\"/v3/account\",collectMetrics:0}).then(response=>{response.subscription={period:\"yearly\",state:\"active\"};response.flags=78;return response;})}" const asarPatch = "getUserAccount(){return this.#<fetch_field_name>.fetch({endpoint:\"/v3/account\",method:\"GET\",name:\"/v3/account\",collectMetrics:0}).then(response=>{response.subscription={period:\"yearly\",state:\"active\"};response.flags=78;return response;})}"
const signature = "E8 ?? ?? ?? ?? 85 C0 75 ?? F6 C3 01 74 ?? 48 89 F9 E8 ?? ?? ?? ??" const signature = "E8 ?? ?? ?? ?? 85 C0 75 ?? F6 C3 01 74 ?? 48 89 F9 E8 ?? ?? ?? ??"
const patchBytes = [0x31] const patchBytes = [0x31]
@@ -150,7 +150,7 @@ if(fs.existsSync(defaultDir)) {
.filter(item => item.isDirectory() && /^app-\w+/.test(item.name)) .filter(item => item.isDirectory() && /^app-\w+/.test(item.name))
.map(item => { .map(item => {
const folderPath = path.join(defaultDir, item.name); const folderPath = path.join(defaultDir, item.name);
const stats = fs.statSync(folderPath); // Получаем информацию о папке const stats = fs.statSync(folderPath);
return { return {
name: item.name, name: item.name,
path: folderPath, path: folderPath,