the shit is broken + new building system

This commit is contained in:
smartfridge 2021-06-29 17:23:52 +02:00
parent fdabb6b4de
commit 1d84e24825
9 changed files with 2381 additions and 9463 deletions

3
.gitignore vendored
View file

@ -1,2 +1,3 @@
node_modules node_modules
out/ out/
dist

BIN
build/icon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 361 KiB

BIN
build/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

View file

@ -101,6 +101,7 @@ function createWindow() {
// Some APIs can only be used after this event occurs. // Some APIs can only be used after this event occurs.
app.whenReady().then(() => { app.whenReady().then(() => {
createWindow(); createWindow();
require("./utils/csp.js");
require("./utils/plugin.js"); require("./utils/plugin.js");
session session
.fromPartition("some-partition") .fromPartition("some-partition")

11745
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -4,11 +4,12 @@
"description": "ArmCord is a Discord client made for ARM Linux that allows you to customize your experience.", "description": "ArmCord is a Discord client made for ARM Linux that allows you to customize your experience.",
"main": "main.js", "main": "main.js",
"scripts": { "scripts": {
"start": "electron-forge start", "start": "electron .",
"test": "echo \"Error: no test specified\" && exit 1", "test": "echo \"Error: no test specified\" && exit 1",
"package": "electron-forge package", "package": "electron-builder --dir",
"publish": "electron-forge publish", "make": "electron-builder",
"make": "electron-forge make" "linux-build": "electron-builder --linux deb tar.gz rpm AppImage",
"windows-build": "electron-builder --windows nsis portable zip appx"
}, },
"author": "smartfrigde", "author": "smartfrigde",
"license": "MIT", "license": "MIT",
@ -16,18 +17,12 @@
"custom-electron-titlebar": "3.2.7", "custom-electron-titlebar": "3.2.7",
"electron-context-menu": "^3.0.0", "electron-context-menu": "^3.0.0",
"electron-localshortcut": "^3.2.1", "electron-localshortcut": "^3.2.1",
"electron-squirrel-startup": "^1.0.0",
"electron-store": "^8.0.0", "electron-store": "^8.0.0",
"v8-compile-cache": "^2.3.0" "v8-compile-cache": "^2.3.0"
}, },
"devDependencies": { "devDependencies": {
"@electron-forge/cli": "^6.0.0-beta.54", "electron": "latest",
"@electron-forge/maker-deb": "^6.0.0-beta.55", "electron-builder": "^22.11.7"
"@electron-forge/maker-rpm": "^6.0.0-beta.55",
"@electron-forge/maker-squirrel": "^6.0.0-beta.55",
"@electron-forge/maker-zip": "^6.0.0-beta.55",
"@electron-forge/publisher-github": "*",
"electron": "latest"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
@ -38,48 +33,16 @@
"discord", "discord",
"electron" "electron"
], ],
"build": {
"appId": "com.smartfridge.armcord",
"productName": "ArmCord",
"asar": "false",
"mac": {
"category": "Internet"
}
},
"bugs": { "bugs": {
"url": "https://github.com/smartfrigde/armcord/issues" "url": "https://github.com/smartfrigde/armcord/issues"
}, },
"homepage": "https://github.com/smartfrigde/armcord#readme", "homepage": "https://github.com/smartfrigde/armcord#readme"
"config": {
"forge": {
"packagerConfig": {
"icon": "discord.png"
},
"makers": [
{
"name": "@electron-forge/maker-squirrel",
"config": {
"name": "ArmCord"
}
},
{
"name": "@electron-forge/maker-zip",
"platforms": [
"darwin"
]
},
{
"name": "@electron-forge/maker-deb",
"config": {}
},
{
"name": "@electron-forge/maker-rpm",
"config": {}
}
],
"publishers": [
{
"name": "@electron-forge/publisher-github",
"config": {
"repository": {
"owner": "erikhofer",
"name": "electron-publish-example"
}
}
}
]
}
}
} }

View file

@ -1,6 +1,7 @@
const { remote } = require("electron");
const currentWindow = remote.getCurrentWindow();
const customTitlebar = require("custom-electron-titlebar"); const customTitlebar = require("custom-electron-titlebar");
const electronLocalshortcut = require("electron-localshortcut"); const electronLocalshortcut = require("electron-localshortcut");
const { remote } = require("electron");
const ArmCord = require("./utils/ArmCord.js"); const ArmCord = require("./utils/ArmCord.js");
require("./utils/theme.js"); require("./utils/theme.js");
window.addEventListener("DOMContentLoaded", () => { window.addEventListener("DOMContentLoaded", () => {
@ -8,8 +9,7 @@ window.addEventListener("DOMContentLoaded", () => {
backgroundColor: customTitlebar.Color.fromHex("#202225"), backgroundColor: customTitlebar.Color.fromHex("#202225"),
menu: false, menu: false,
}); });
const currentWindow = remote.getCurrentWindow();
electronLocalshortcut.register(currentWindow, "F5", () => { electronLocalshortcut.register(currentWindow, "F5", () => {
location.reload(); location.reload();
}); });
@ -23,7 +23,7 @@ window.addEventListener("DOMContentLoaded", () => {
window.location.href = "/invite/F25bc4RYDt"; window.location.href = "/invite/F25bc4RYDt";
}); });
electronLocalshortcut.register(currentWindow, "F4", () => { electronLocalshortcut.register(currentWindow, "F4", () => {
currentWindow.loadFile("./manager.html") currentWindow.loadFile("./manager.html");
}); });
require("./utils/capturer.js"); require("./utils/capturer.js");
@ -94,5 +94,4 @@ div.menubar[role="menubar"] {
); );
document.getElementById("ac-channel").innerHTML = ArmCord.Channel; document.getElementById("ac-channel").innerHTML = ArmCord.Channel;
}); });

15
utils/csp.js Normal file
View file

@ -0,0 +1,15 @@
const { session } = require("electron");
session.defaultSession.webRequest.onHeadersReceived.addListener(
(h) => {
h.responseHeaders.forEach((e, i) => {
if (e.name.toLowerCase() === "content-security-policy") {
e.value = "";
}
});
return { responseHeaders: h.responseHeaders };
},
{ urls: ["*://*.discord.com/*"] },
["blocking", "responseHeaders"]
);
//csp thingz

View file

@ -11,7 +11,7 @@ fs.readdirSync(pluginFolder).forEach((file) => {
); );
var pluginFile = JSON.parse(manifest); var pluginFile = JSON.parse(manifest);
console.log(pluginFile); console.log(pluginFile);
session.defaultSession.loadExtension(`${__dirname}/plugins/${file}/`); session.defaultSession.loadExtension(`${__dirname}\\plugins\\${file}`);
console.log( console.log(
`%cLoaded ${pluginFile.name} made by ${pluginFile.author}`, `%cLoaded ${pluginFile.name} made by ${pluginFile.author}`,
"color:red" "color:red"