diff --git a/main.js b/main.js index dd0ff40..0b97d8d 100644 --- a/main.js +++ b/main.js @@ -73,6 +73,9 @@ function createWindow() { }, }, ]); + appIcon.on("click", () => { + mainWindow.show() + }); appIcon.setContextMenu(contextMenu); @@ -98,9 +101,7 @@ function createWindow() { // Some APIs can only be used after this event occurs. app.whenReady().then(() => { createWindow(); - session.defaultSession.loadExtension( - `${require("electron").app.getAppPath()}/goosemod/` - ); + require("./utils/plugin.js"); session .fromPartition("some-partition") .setPermissionRequestHandler((webContents, permission, callback) => { diff --git a/package-lock.json b/package-lock.json index d73bdd4..0ac6700 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4029,6 +4029,12 @@ "node": ">=0.10.0" } }, + "node_modules/hosted-git-info": { + "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", + "dev": true + }, "node_modules/http-cache-semantics": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz", @@ -4428,9 +4434,9 @@ } }, "node_modules/lodash": { - "version": "4.17.20", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", - "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==", + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", "dev": true }, "node_modules/lodash._reinterpolate": { @@ -5090,12 +5096,6 @@ "validate-npm-package-license": "^3.0.1" } }, - "node_modules/normalize-package-data/node_modules/hosted-git-info": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", - "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", - "dev": true - }, "node_modules/normalize-package-data/node_modules/semver": { "version": "5.7.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", @@ -5639,14 +5639,14 @@ } }, "node_modules/plist": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/plist/-/plist-3.0.1.tgz", - "integrity": "sha512-GpgvHHocGRyQm74b6FWEZZVRroHKE1I0/BTjAmySaohK+cUn+hZpbqXkc3KWgW3gQYkqcQej35FohcT0FRlkRQ==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/plist/-/plist-3.0.2.tgz", + "integrity": "sha512-MSrkwZBdQ6YapHy87/8hDU8MnIcyxBKjeF+McXnr5A9MtffPewTs7G3hlpodT5TacyfIyFTaJEhh3GGcmasTgQ==", "dev": true, "dependencies": { - "base64-js": "^1.2.3", + "base64-js": "^1.5.1", "xmlbuilder": "^9.0.7", - "xmldom": "0.1.x" + "xmldom": "^0.5.0" }, "engines": { "node": ">=6" @@ -6916,12 +6916,12 @@ } }, "node_modules/xmldom": { - "version": "0.1.31", - "resolved": "https://registry.npmjs.org/xmldom/-/xmldom-0.1.31.tgz", - "integrity": "sha512-yS2uJflVQs6n+CyjHoaBmVSqIDevTAWrzMmjG1Gc7h1qQ7uVozNhEPJAwZXWyGQ/Gafo3fCwrcaokezLPupVyQ==", + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/xmldom/-/xmldom-0.5.0.tgz", + "integrity": "sha512-Foaj5FXVzgn7xFzsKeNIde9g6aFBxTPi37iwsno8QvApmtg7KYrr+OPyRHcJF7dud2a5nGRBXK3n0dL62Gf7PA==", "dev": true, "engines": { - "node": ">=0.1" + "node": ">=10.0.0" } }, "node_modules/xtend": { @@ -10308,6 +10308,12 @@ "parse-passwd": "^1.0.0" } }, + "hosted-git-info": { + "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", + "dev": true + }, "http-cache-semantics": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz", @@ -10624,9 +10630,9 @@ } }, "lodash": { - "version": "4.17.20", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", - "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==", + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", "dev": true }, "lodash._reinterpolate": { @@ -11155,12 +11161,6 @@ "validate-npm-package-license": "^3.0.1" }, "dependencies": { - "hosted-git-info": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", - "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", - "dev": true - }, "semver": { "version": "5.7.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", @@ -11579,14 +11579,14 @@ } }, "plist": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/plist/-/plist-3.0.1.tgz", - "integrity": "sha512-GpgvHHocGRyQm74b6FWEZZVRroHKE1I0/BTjAmySaohK+cUn+hZpbqXkc3KWgW3gQYkqcQej35FohcT0FRlkRQ==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/plist/-/plist-3.0.2.tgz", + "integrity": "sha512-MSrkwZBdQ6YapHy87/8hDU8MnIcyxBKjeF+McXnr5A9MtffPewTs7G3hlpodT5TacyfIyFTaJEhh3GGcmasTgQ==", "dev": true, "requires": { - "base64-js": "^1.2.3", + "base64-js": "^1.5.1", "xmlbuilder": "^9.0.7", - "xmldom": "0.1.x" + "xmldom": "^0.5.0" } }, "prepend-http": { @@ -12615,9 +12615,9 @@ "dev": true }, "xmldom": { - "version": "0.1.31", - "resolved": "https://registry.npmjs.org/xmldom/-/xmldom-0.1.31.tgz", - "integrity": "sha512-yS2uJflVQs6n+CyjHoaBmVSqIDevTAWrzMmjG1Gc7h1qQ7uVozNhEPJAwZXWyGQ/Gafo3fCwrcaokezLPupVyQ==", + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/xmldom/-/xmldom-0.5.0.tgz", + "integrity": "sha512-Foaj5FXVzgn7xFzsKeNIde9g6aFBxTPi37iwsno8QvApmtg7KYrr+OPyRHcJF7dud2a5nGRBXK3n0dL62Gf7PA==", "dev": true }, "xtend": { diff --git a/package.json b/package.json index 3bdc6e9..3ff0d25 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,6 @@ "main": "main.js", "scripts": { "start": "electron-forge start", - "dist": "electron-builder", "test": "echo \"Error: no test specified\" && exit 1", "package": "electron-forge package", "publish": "electron-forge publish", @@ -44,7 +43,9 @@ "homepage": "https://github.com/smartfrigde/armcord#readme", "config": { "forge": { - "packagerConfig": {}, + "packagerConfig": { + "icon": "discord.png" + }, "makers": [ { "name": "@electron-forge/maker-squirrel", diff --git a/renderer.js b/renderer.js deleted file mode 100644 index d2ec9f5..0000000 --- a/renderer.js +++ /dev/null @@ -1,55 +0,0 @@ -// This file is required by the index.html file and will -// be executed in the renderer process for that window. -// All of the Node.js APIs are available in this process. -const remote = require('electron').remote; - -const win = remote.getCurrentWindow(); /* Note this is different to the -html global `window` variable */ - -// When document has loaded, initialise -document.onreadystatechange = (event) => { - if (document.readyState == "complete") { - handleWindowControls(); - - document.getElementById('electron-ver').innerHTML = `${process.versions.electron}` - } -}; - -window.onbeforeunload = (event) => { - /* If window is reloaded, remove win event listeners - (DOM element listeners get auto garbage collected but not - Electron win listeners as the win is not dereferenced unless closed) */ - win.removeAllListeners(); -} - -function handleWindowControls() { - // Make minimise/maximise/restore/close buttons work when they are clicked - document.getElementById('min-button').addEventListener("click", event => { - win.minimize(); - }); - - document.getElementById('max-button').addEventListener("click", event => { - win.maximize(); - }); - - document.getElementById('restore-button').addEventListener("click", event => { - win.unmaximize(); - }); - - document.getElementById('close-button').addEventListener("click", event => { - win.close(); - }); - - // Toggle maximise/restore buttons when maximisation/unmaximisation occurs - toggleMaxRestoreButtons(); - win.on('maximize', toggleMaxRestoreButtons); - win.on('unmaximize', toggleMaxRestoreButtons); - - function toggleMaxRestoreButtons() { - if (win.isMaximized()) { - document.body.classList.add('maximized'); - } else { - document.body.classList.remove('maximized'); - } - } -} \ No newline at end of file diff --git a/theme.html b/theme.html new file mode 100644 index 0000000..c035ebc --- /dev/null +++ b/theme.html @@ -0,0 +1,91 @@ + + + + + ArmCord Theme Manager + + + + + + +
+ + diff --git a/utils/plugin.js b/utils/plugin.js new file mode 100644 index 0000000..d569d67 --- /dev/null +++ b/utils/plugin.js @@ -0,0 +1,23 @@ +const fs = require("fs"); +const { app, session } = require("electron"); +const pluginFolder = __dirname + "/plugins/"; +app.whenReady().then(() => { +fs.readdirSync(pluginFolder).forEach((file) => { + console.log(file); + try { + const manifest = fs.readFileSync( + `${__dirname}/plugins/${file}/manifest.json`, + "utf8" + ); + var pluginFile = JSON.parse(manifest); + console.log(pluginFile); + session.defaultSession.loadExtension(`${__dirname}/plugins/${file}/`); + console.log( + `%cLoaded ${pluginFile.name} made by ${pluginFile.author}`, + "color:red" + ); + } catch (err) { + console.error(err); + } +}); +}); diff --git a/goosemod/CSP.js b/utils/plugins/goosemod/CSP.js similarity index 100% rename from goosemod/CSP.js rename to utils/plugins/goosemod/CSP.js diff --git a/goosemod/LICENSE b/utils/plugins/goosemod/LICENSE similarity index 100% rename from goosemod/LICENSE rename to utils/plugins/goosemod/LICENSE diff --git a/goosemod/gm.js b/utils/plugins/goosemod/gm.js similarity index 100% rename from goosemod/gm.js rename to utils/plugins/goosemod/gm.js diff --git a/goosemod/manifest.json b/utils/plugins/goosemod/manifest.json similarity index 93% rename from goosemod/manifest.json rename to utils/plugins/goosemod/manifest.json index 5d71e59..f073a57 100644 --- a/goosemod/manifest.json +++ b/utils/plugins/goosemod/manifest.json @@ -1,6 +1,7 @@ { "name": "GooseMod", "version": "1.0", + "author": "AAGaming00", "description": "Loads GooseMod, a discord client modification", "background": { "scripts": [ diff --git a/utils/theme.js b/utils/theme.js new file mode 100644 index 0000000..b58dc05 --- /dev/null +++ b/utils/theme.js @@ -0,0 +1,25 @@ +const fs = require("fs"); +const armcord = require("./armcord.js"); +const themeFolder = __dirname + "/themes/"; +window.addEventListener("DOMContentLoaded", () => { + fs.readdirSync(themeFolder).forEach((file) => { + console.log(file); + try { + const manifest = fs.readFileSync(`${__dirname}/themes/${file}/manifest.json`, "utf8"); + var themeFile = JSON.parse(manifest); + console.log(themeFile.theme); + console.log(themeFile) + const theme = fs.readFileSync(`${__dirname}/themes/${file}/${themeFile.theme}`, "utf8"); + if (themeFile.theme.endsWith(".scss")) { + console.log( + `%cCouldn't load ${themeFile.name} made by ${themeFile.author}. ArmCord doesn't support scss files if you want to have this theme ported feel free to reach out https://discord.gg/F25bc4RYDt `, + "color:red; font-weight: bold; font-size: 50px;color: red;" + ); + } + armcord.addStyle(theme); + console.log(`%cLoaded ${themeFile.name} made by ${themeFile.author}`, "color:red"); + } catch (err) { + console.error(err); + } + }); +}); diff --git a/utils/themes/GT-RevertRebrand-main/LICENSE b/utils/themes/GT-RevertRebrand-main/LICENSE new file mode 100644 index 0000000..3cf6dad --- /dev/null +++ b/utils/themes/GT-RevertRebrand-main/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2021 GooseNest + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/utils/themes/GT-RevertRebrand-main/README.md b/utils/themes/GT-RevertRebrand-main/README.md new file mode 100644 index 0000000..3fb7430 --- /dev/null +++ b/utils/themes/GT-RevertRebrand-main/README.md @@ -0,0 +1,3 @@ +# GT-RevertRebrand ArmCord + +Reverts Discord's 2021 rebrand (font, colors, reactions, mentions, loading screen, home icon, reply ping color, and more) diff --git a/utils/themes/GT-RevertRebrand-main/RevertRebrand.theme.css b/utils/themes/GT-RevertRebrand-main/RevertRebrand.theme.css new file mode 100644 index 0000000..c342047 --- /dev/null +++ b/utils/themes/GT-RevertRebrand-main/RevertRebrand.theme.css @@ -0,0 +1,9 @@ +/** + * @name Revert Rebrand + * @author GooseNest + * @description Reverts Discord's 2021 rebrand (font, colors, reactions, mentions, loading screen, home icon, reply ping color, and more) + * @invite neMncS2 + * @version 3.0 +*/ + +@import url('https://Goose-Nest.github.io/GT-RevertRebrand/src/main.css'); \ No newline at end of file diff --git a/utils/themes/GT-RevertRebrand-main/manifest.json b/utils/themes/GT-RevertRebrand-main/manifest.json new file mode 100644 index 0000000..9af1803 --- /dev/null +++ b/utils/themes/GT-RevertRebrand-main/manifest.json @@ -0,0 +1,8 @@ +{ + "name": "Revert Rebrand", + "description": "Reverts Discord's 2021 rebrand (font, colors, reactions, mentions, loading screen, home icon, reply ping color, and more)", + "version": "3.0", + "author": "GooseNest", + "license": "MIT", + "theme": "RevertRebrand.theme.css" +} \ No newline at end of file