From 57c40ffa4faa0b3cde66c0a7b3a1fb9664ddfc4f Mon Sep 17 00:00:00 2001 From: smartfridge <37928912+smartfrigde@users.noreply.github.com> Date: Wed, 14 Jul 2021 18:45:36 +0200 Subject: [PATCH 1/5] Remove additional logging from plugin/theme loading, fix one grammar mistake --- utils/plugin.js | 4 +--- utils/theme.js | 3 --- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/utils/plugin.js b/utils/plugin.js index 46997e0..14af4a5 100644 --- a/utils/plugin.js +++ b/utils/plugin.js @@ -37,7 +37,7 @@ if (!fs.existsSync(pluginFolder)) { electron.dialog.showMessageBox({ title: "ArmCord", type: "warning", - message: "ArmCord installed GooseMod onto your client.", + message: "ArmCord has installed GooseMod onto your client.", 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.", }); @@ -49,14 +49,12 @@ if (!fs.existsSync(pluginFolder)) { } app.whenReady().then(() => { fs.readdirSync(pluginFolder).forEach((file) => { - console.log(file); try { const manifest = fs.readFileSync( `${userDataPath}/plugins/${file}/manifest.json`, "utf8" ); var pluginFile = JSON.parse(manifest); - console.log(pluginFile); session.defaultSession.loadExtension(`${userDataPath}/plugins/${file}`); console.log( `%cLoaded ${pluginFile.name} made by ${pluginFile.author}`, diff --git a/utils/theme.js b/utils/theme.js index 9b98d90..da5bacf 100644 --- a/utils/theme.js +++ b/utils/theme.js @@ -11,12 +11,9 @@ if (!fs.existsSync(themeFolder)) { window.addEventListener("DOMContentLoaded", () => { console.log("Theme Module Loaded"); fs.readdirSync(themeFolder).forEach((file) => { - console.log(file); try { const manifest = fs.readFileSync(`${userDataPath}/themes/${file}/manifest.json`, "utf8"); var themeFile = JSON.parse(manifest); - console.log(themeFile.theme); - console.log(themeFile) const theme = fs.readFileSync(`${userDataPath}/themes/${file}/${themeFile.theme}`, "utf8"); if (themeFile.theme.endsWith(".scss")) { console.log( From 6df444636967ceba3a46ac6e6f677b6aec90e739 Mon Sep 17 00:00:00 2001 From: smartfridge <37928912+smartfrigde@users.noreply.github.com> Date: Wed, 14 Jul 2021 18:45:57 +0200 Subject: [PATCH 2/5] Update build script for easier development on Linux --- build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) mode change 100644 => 100755 build.sh diff --git a/build.sh b/build.sh old mode 100644 new mode 100755 index feb23a5..ec70316 --- a/build.sh +++ b/build.sh @@ -1,2 +1,2 @@ -npm i -npm run make +npm run package +./dist/linux-unpacked/armcord From 5b9e1c13c084162a8daaa31aa86f42e95a944e1b Mon Sep 17 00:00:00 2001 From: smartfridge <37928912+smartfrigde@users.noreply.github.com> Date: Wed, 14 Jul 2021 18:46:25 +0200 Subject: [PATCH 3/5] Remove update.rocks updater --- main.js | 2 +- utils/updater.js | 66 ------------------------------------------------ 2 files changed, 1 insertion(+), 67 deletions(-) delete mode 100644 utils/updater.js diff --git a/main.js b/main.js index 0ba5b21..45091cd 100644 --- a/main.js +++ b/main.js @@ -4,7 +4,7 @@ const path = require("path"); const contextMenu = require("electron-context-menu"); const os = require("os"); require("v8-compile-cache"); -require("./utils/updater"); + if (os.type() == 'Linux'){ var iconformat = __dirname + "/discord.png" diff --git a/utils/updater.js b/utils/updater.js deleted file mode 100644 index ba21936..0000000 --- a/utils/updater.js +++ /dev/null @@ -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, -}; From d2dcb69d38cb0d2752fd52612e46878b5057bed3 Mon Sep 17 00:00:00 2001 From: smartfridge <37928912+smartfrigde@users.noreply.github.com> Date: Wed, 14 Jul 2021 18:46:55 +0200 Subject: [PATCH 4/5] Remove unused csp.js --- utils/csp.js | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 utils/csp.js diff --git a/utils/csp.js b/utils/csp.js deleted file mode 100644 index f2cbd51..0000000 --- a/utils/csp.js +++ /dev/null @@ -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 From c76cf4f6cf964f962484577a1aefa24df8fa246e Mon Sep 17 00:00:00 2001 From: smartfridge <37928912+smartfrigde@users.noreply.github.com> Date: Wed, 14 Jul 2021 18:48:23 +0200 Subject: [PATCH 5/5] Update versions and license in package.json --- package-lock.json | 5 ++--- package.json | 9 +++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index d83411e..4897a2b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,13 +1,12 @@ { - "name": "ArmCord", + "name": "armcord", "version": "2.5.0", "lockfileVersion": 2, "requires": true, "packages": { "": { - "name": "ArmCord", "version": "2.5.0", - "license": "MIT", + "license": "OSL-3.0", "dependencies": { "custom-electron-titlebar": "3.2.7", "electron-context-menu": "^3.0.0", diff --git a/package.json b/package.json index 7efe416..12c855a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "ArmCord", - "version": "2.5.0-TESTING", + "name": "armcord", + "version": "2.5.0", "description": "ArmCord is a Discord client made for ARM Linux that allows you to customize your experience.", "main": "main.js", "scripts": { @@ -12,7 +12,7 @@ "windows-build": "electron-builder --windows nsis portable zip appx" }, "author": "smartfrigde ", - "license": "MIT", + "license": "OSL-3.0", "dependencies": { "custom-electron-titlebar": "3.2.7", "electron-context-menu": "^3.0.0", @@ -46,7 +46,8 @@ "deb", "tar.gz", "rpm", - "AppImage"] + "AppImage" + ] } }, "bugs": {