Compare commits

..

5 commits

Author SHA1 Message Date
smartfridge
c76cf4f6cf Update versions and license in package.json 2021-07-14 18:48:23 +02:00
smartfridge
d2dcb69d38 Remove unused csp.js 2021-07-14 18:46:55 +02:00
smartfridge
5b9e1c13c0 Remove update.rocks updater 2021-07-14 18:46:25 +02:00
smartfridge
6df4446369 Update build script for easier development on Linux 2021-07-14 18:45:57 +02:00
smartfridge
57c40ffa4f Remove additional logging from plugin/theme loading, fix one grammar mistake 2021-07-14 18:45:36 +02:00
8 changed files with 11 additions and 97 deletions

4
build.sh Normal file → Executable file
View file

@ -1,2 +1,2 @@
npm i npm run package
npm run make ./dist/linux-unpacked/armcord

View file

@ -4,7 +4,7 @@ const path = require("path");
const contextMenu = require("electron-context-menu"); const contextMenu = require("electron-context-menu");
const os = require("os"); const os = require("os");
require("v8-compile-cache"); require("v8-compile-cache");
require("./utils/updater");
if (os.type() == 'Linux'){ if (os.type() == 'Linux'){
var iconformat = __dirname + "/discord.png" var iconformat = __dirname + "/discord.png"

5
package-lock.json generated
View file

@ -1,13 +1,12 @@
{ {
"name": "ArmCord", "name": "armcord",
"version": "2.5.0", "version": "2.5.0",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "ArmCord",
"version": "2.5.0", "version": "2.5.0",
"license": "MIT", "license": "OSL-3.0",
"dependencies": { "dependencies": {
"custom-electron-titlebar": "3.2.7", "custom-electron-titlebar": "3.2.7",
"electron-context-menu": "^3.0.0", "electron-context-menu": "^3.0.0",

View file

@ -1,6 +1,6 @@
{ {
"name": "ArmCord", "name": "armcord",
"version": "2.5.0-TESTING", "version": "2.5.0",
"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": {
@ -12,7 +12,7 @@
"windows-build": "electron-builder --windows nsis portable zip appx" "windows-build": "electron-builder --windows nsis portable zip appx"
}, },
"author": "smartfrigde <smartfridge1337@protonmail.com>", "author": "smartfrigde <smartfridge1337@protonmail.com>",
"license": "MIT", "license": "OSL-3.0",
"dependencies": { "dependencies": {
"custom-electron-titlebar": "3.2.7", "custom-electron-titlebar": "3.2.7",
"electron-context-menu": "^3.0.0", "electron-context-menu": "^3.0.0",
@ -46,7 +46,8 @@
"deb", "deb",
"tar.gz", "tar.gz",
"rpm", "rpm",
"AppImage"] "AppImage"
]
} }
}, },
"bugs": { "bugs": {

View file

@ -1,15 +0,0 @@
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

@ -37,7 +37,7 @@ if (!fs.existsSync(pluginFolder)) {
electron.dialog.showMessageBox({ electron.dialog.showMessageBox({
title: "ArmCord", title: "ArmCord",
type: "warning", type: "warning",
message: "ArmCord installed GooseMod onto your client.", message: "ArmCord has installed GooseMod onto your client.",
detail: detail:
"If you wish to use it restart your ArmCord completely using tray icon. It should appear in next session. GooseMod is reccomended to every user of ArmCord due to various improvements and bugfixes it ships with.", "If you wish to use it restart your ArmCord completely using tray icon. It should appear in next session. GooseMod is reccomended to every user of ArmCord due to various improvements and bugfixes it ships with.",
}); });
@ -49,14 +49,12 @@ if (!fs.existsSync(pluginFolder)) {
} }
app.whenReady().then(() => { app.whenReady().then(() => {
fs.readdirSync(pluginFolder).forEach((file) => { fs.readdirSync(pluginFolder).forEach((file) => {
console.log(file);
try { try {
const manifest = fs.readFileSync( const manifest = fs.readFileSync(
`${userDataPath}/plugins/${file}/manifest.json`, `${userDataPath}/plugins/${file}/manifest.json`,
"utf8" "utf8"
); );
var pluginFile = JSON.parse(manifest); var pluginFile = JSON.parse(manifest);
console.log(pluginFile);
session.defaultSession.loadExtension(`${userDataPath}/plugins/${file}`); session.defaultSession.loadExtension(`${userDataPath}/plugins/${file}`);
console.log( console.log(
`%cLoaded ${pluginFile.name} made by ${pluginFile.author}`, `%cLoaded ${pluginFile.name} made by ${pluginFile.author}`,

View file

@ -11,12 +11,9 @@ if (!fs.existsSync(themeFolder)) {
window.addEventListener("DOMContentLoaded", () => { window.addEventListener("DOMContentLoaded", () => {
console.log("Theme Module Loaded"); console.log("Theme Module Loaded");
fs.readdirSync(themeFolder).forEach((file) => { fs.readdirSync(themeFolder).forEach((file) => {
console.log(file);
try { try {
const manifest = fs.readFileSync(`${userDataPath}/themes/${file}/manifest.json`, "utf8"); const manifest = fs.readFileSync(`${userDataPath}/themes/${file}/manifest.json`, "utf8");
var themeFile = JSON.parse(manifest); var themeFile = JSON.parse(manifest);
console.log(themeFile.theme);
console.log(themeFile)
const theme = fs.readFileSync(`${userDataPath}/themes/${file}/${themeFile.theme}`, "utf8"); const theme = fs.readFileSync(`${userDataPath}/themes/${file}/${themeFile.theme}`, "utf8");
if (themeFile.theme.endsWith(".scss")) { if (themeFile.theme.endsWith(".scss")) {
console.log( console.log(

View file

@ -1,66 +0,0 @@
const electron = require("electron");
const APP_VERSION = require("../package.json").version;
/* IMPORTANT!
This url will need to be modified for yours */
// The url that the application is going to query for new release
const AUTO_UPDATE_URL =
'https://api.update.rocks/update/github.com/smartfrigde/armcord/stable/' + process.platform + '/' + APP_VERSION
function init() {
if (process.platform === "linux") {
/* There is no auto update for linux however you can still
notify the user that a new update has been released
our service will return an answer with the latest version. */
console.log("Auto updates not available on linux");
} else {
initDarwinWin32();
}
}
function initDarwinWin32() {
electron.autoUpdater.on("error", (err) =>
console.error(`Update error: ${err.message}`)
);
electron.autoUpdater.on("checking-for-update", () =>
console.log("Checking for update")
);
electron.autoUpdater.on("update-available", () =>
console.log("Update available")
);
electron.autoUpdater.on("update-not-available", () =>
console.log("No update available")
);
// Ask the user if he wants to update if update is available
electron.autoUpdater.on(
"update-downloaded",
(event, releaseNotes, releaseName) => {
dialog.showMessageBox(
window,
{
type: "question",
buttons: ["Update", "Cancel"],
defaultId: 0,
message: `Version ${releaseName} is available, do you want to install it now?`,
title: "Update available",
},
(response) => {
if (response === 0) {
electron.autoUpdater.quitAndInstall();
}
}
);
}
);
electron.autoUpdater.setFeedURL(AUTO_UPDATE_URL);
electron.autoUpdater.checkForUpdates();
}
module.exports = {
init,
};