Compare commits
11 commits
f2e9ce56a5
...
839a0d1a88
Author | SHA1 | Date | |
---|---|---|---|
|
839a0d1a88 | ||
|
154c4e034d | ||
|
64c6c1f118 | ||
|
06460a9d44 | ||
|
10cc7949f9 | ||
|
64b0f6eeba | ||
|
f8c4e139fc | ||
|
12df5e6b09 | ||
|
ae926c6548 | ||
|
0df9689bd1 | ||
|
e7ae65bfbb |
4
.github/workflows/build.yml
vendored
|
@ -29,9 +29,9 @@ jobs:
|
|||
skip_build: true
|
||||
# If the commit is tagged with a version (e.g. "v1.0.0"),
|
||||
# release the app after building
|
||||
# release: ${{ startsWith(github.ref, 'refs/tags/v') }} disabled for now as it caused problems
|
||||
release: ${{ startsWith(github.ref, 'refs/tags/v') }} #disabled for now as it caused problems (nvm)
|
||||
- name: Archive production builds
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: dist folder
|
||||
path: dist/**
|
||||
path: dist/**
|
||||
|
|
3
.gitmodules
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
[submodule "mods/goosemod"]
|
||||
path = mods/goosemod
|
||||
url = https://github.com/GooseMod/Extension
|
13
README.md
|
@ -3,8 +3,8 @@
|
|||
ArmCord is a custom alternative Discord client made for people on lower-end devices and ARM architecture that want custom Discord experience. It uses [GooseMod](https://goosemod.com) for custom themes and plugins!
|
||||
|
||||
# How to run/install it?
|
||||
Check releases tab for precompiled deb(ARM64), rpm(ARM64), tar.gz(ARM64), Windows builds.
|
||||
Alternative (npm, nodejs required):
|
||||
Check releases tab for precompiled packages for Linux, Windows and Mac OS (experimental).
|
||||
Alternatively you can run ArmCord from source (npm, nodejs required):
|
||||
1.Run `npm install`
|
||||
2.Run `npm start`
|
||||
3.Compile/Package with `npm run make`
|
||||
|
@ -13,21 +13,22 @@ Alternative (npm, nodejs required):
|
|||
# FAQ
|
||||
## 1.Will I get banned from using it?
|
||||
|
||||
-You are breaking Discord ToS since we are using GooseMod for themes and plugins. But no one ever got banned from using ArmCord or GooseMod as of now
|
||||
-You are breaking Discord ToS since we are using GooseMod for themes and plugins. But no one ever got banned from using ArmCord or GooseMod as of now. If you wish to remove GooseMod, you can find it in your plugins folder.
|
||||
## 2.How does this work?
|
||||
|
||||
-We are using official web app and adding GooseMod to it with some other tweaks.
|
||||
## 3.Can I use this on other architectures or operating systems?
|
||||
|
||||
-Yes! ArmCord should work normally under Windows, Mac OS, Linux as long as it has NodeJS, npm and Electron support.
|
||||
-Yes! ArmCord should work normally under Windows, ~~Mac OS~~ (Mac OS is broken see [#48](https://github.com/ArmCord/ArmCord/issues/48)), Linux as long as it has NodeJS, npm and Electron support.
|
||||
## 4.Code is big spaghetti.
|
||||
|
||||
-I'm aware. I'm slowly rewriting everything. This branch is mostly fixes only.
|
||||
|
||||
# Credits
|
||||
[ArmCord UI Elements and few features](https://github.com/kckarnige)
|
||||
[GooseMod](https://github.com/GooseMod/GooseMod)
|
||||
[GooseMod Extension](https://github.com/GooseMod/extension)
|
||||
[update.rocks](https://www.update.rocks)
|
||||
[electron-discord-webapp](https://github.com/SpacingBat3/electron-discord-webapp)
|
||||
[custom-electron-titlebar](https://github.com/AlexTorresSk/custom-electron-titlebar)
|
||||
[electron-localshortcut](https://github.com/parro-it/electron-localshortcut)
|
||||
[electron-forge](https://www.npmjs.com/package/electron-forge)
|
||||
[electron-builder](https://electron.build)
|
||||
|
|
BIN
ac_icon_transparent.png
Normal file
After Width: | Height: | Size: 81 KiB |
BIN
ac_plug.ico
Normal file
After Width: | Height: | Size: 107 KiB |
BIN
ac_plug.png
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
build/icon.ico
Before Width: | Height: | Size: 361 KiB After Width: | Height: | Size: 107 KiB |
BIN
build/icon.png
Before Width: | Height: | Size: 423 KiB After Width: | Height: | Size: 38 KiB |
BIN
discord.ico
Before Width: | Height: | Size: 361 KiB |
BIN
discord.png
Before Width: | Height: | Size: 28 KiB |
18
main.js
|
@ -4,13 +4,17 @@ const path = require("path");
|
|||
const contextMenu = require("electron-context-menu");
|
||||
const os = require("os");
|
||||
require("v8-compile-cache");
|
||||
|
||||
if (require("./utils/ArmCord.js").Titlebar === "native") {
|
||||
var frame = true
|
||||
} else {
|
||||
var frame = false
|
||||
}
|
||||
|
||||
if (os.type() == 'Linux'){
|
||||
var iconformat = __dirname + "/discord.png"
|
||||
} else { //test this
|
||||
var iconformat = __dirname + "/ac_icon_transparent.png"
|
||||
} else {
|
||||
console.log("Running Non-Linux")
|
||||
var iconformat = __dirname + "/discord.ico";
|
||||
var iconformat = __dirname + "/ac_plug.ico";
|
||||
}
|
||||
|
||||
contextMenu({
|
||||
|
@ -31,7 +35,7 @@ function createWindow() {
|
|||
height: 600,
|
||||
icon: iconformat,
|
||||
title: "ArmCord",
|
||||
frame: false,
|
||||
frame: frame,
|
||||
webPreferences: {
|
||||
preload: path.join(__dirname, "preload.js"),
|
||||
enableRemoteModule: true,
|
||||
|
@ -90,7 +94,7 @@ function createWindow() {
|
|||
try {
|
||||
appIcon();
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
//console.error(error);
|
||||
// expected output: TypeError: appIcon is not a function
|
||||
}
|
||||
});
|
||||
|
@ -101,7 +105,7 @@ function createWindow() {
|
|||
// Some APIs can only be used after this event occurs.
|
||||
app.whenReady().then(() => {
|
||||
createWindow();
|
||||
//require("./utils/csp.js");
|
||||
require("./utils/mod.js");
|
||||
require("./utils/plugin.js");
|
||||
session
|
||||
.fromPartition("some-partition")
|
||||
|
|
13
manager.css
|
@ -36,7 +36,11 @@ span {
|
|||
font-size: 32px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.disabled {
|
||||
text-align: center;
|
||||
font-weight: normal;
|
||||
font-family: Helvetica, sans-serif;
|
||||
}
|
||||
.container {
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
|
@ -107,7 +111,12 @@ button#open-themes-btn:active {
|
|||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
}
|
||||
|
||||
#tm-disabled {
|
||||
position: absolute;
|
||||
top: 100px;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
}
|
||||
#tm-list-item {
|
||||
background: #23272a;
|
||||
font-family: Whitney, Helvetica Neue, Helvetica, Arial, sans-serif;
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<button id="open-themes-btn">Themes Folder</button>
|
||||
<p class="logo">Cord Manager</p>
|
||||
<div id="tm-list"></div>
|
||||
<p>Disabled Themes:</p>
|
||||
<p class="disabled">Disabled Themes:</p>
|
||||
<div id="tm-disabled"></div>
|
||||
<p id="ac-channel"></p>
|
||||
</body>
|
||||
|
|
42
mods/cumcord/background.js
Normal file
|
@ -0,0 +1,42 @@
|
|||
const cspAllowAll = [
|
||||
'connect-src',
|
||||
'style-src',
|
||||
'img-src',
|
||||
'font-src'
|
||||
];
|
||||
const corsAllowUrls = [
|
||||
'https://github.com/GooseMod/GooseMod/releases/download/dev/index.js',
|
||||
'https://github-releases.githubusercontent.com/',
|
||||
'https://api.goosemod.com/inject.js',
|
||||
'https://raw.githubusercontent.com/Cumcord/Cumcord/stable/dist/build.js'
|
||||
];
|
||||
|
||||
chrome.webRequest.onHeadersReceived.addListener(({ responseHeaders, url }) => {
|
||||
let csp = responseHeaders.find((x) => x.name === 'content-security-policy');
|
||||
|
||||
if (csp) {
|
||||
for (let p of cspAllowAll) {
|
||||
csp.value = csp.value.replace(`${p}`, `${p} * blob: data:`); // * does not include data: URIs
|
||||
}
|
||||
|
||||
// Fix Discord's broken CSP which disallows unsafe-inline due to having a nonce (which they don't even use?)
|
||||
csp.value = csp.value.replace(/'nonce-.*?' /, '');
|
||||
}
|
||||
if (corsAllowUrls.some((x) => url.startsWith(x))) {
|
||||
let cors = responseHeaders.find((x) => x.name === 'access-control-allow-origin');
|
||||
cors.value = '*';
|
||||
}
|
||||
return {
|
||||
responseHeaders
|
||||
};
|
||||
|
||||
},
|
||||
|
||||
{
|
||||
urls: [
|
||||
'*://*.discord.com/*'
|
||||
]
|
||||
},
|
||||
|
||||
['blocking', 'responseHeaders']
|
||||
);
|
9
mods/cumcord/content.js
Normal file
|
@ -0,0 +1,9 @@
|
|||
const load = async () => {
|
||||
console.log("[CCExt] Loading Cumcord...");
|
||||
const response = await fetch("https://raw.githubusercontent.com/Cumcord/Cumcord/stable/dist/build.js");
|
||||
const text = await response.text()
|
||||
eval(text);
|
||||
}
|
||||
const el = document.createElement('script');
|
||||
el.appendChild(document.createTextNode(`(${load.toString()})();`));
|
||||
document.body.appendChild(el);
|
25
mods/cumcord/manifest.json
Normal file
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
"name": "Cumcord for Web",
|
||||
"description": "A heavy, throbbing, and easy to use cum expeller; now in your browser.",
|
||||
"version": "0.0.1",
|
||||
"author": "Drake",
|
||||
"background": {
|
||||
"scripts": [
|
||||
"background.js"
|
||||
]
|
||||
},
|
||||
|
||||
"content_scripts": [
|
||||
{
|
||||
"matches": ["*://*.discord.com/*"],
|
||||
"js": ["content.js"]
|
||||
}
|
||||
],
|
||||
"permissions": [
|
||||
"storage",
|
||||
"webRequest",
|
||||
"webRequestBlocking",
|
||||
"*://*.discord.com/*"
|
||||
],
|
||||
"manifest_version": 2
|
||||
}
|
1646
package-lock.json
generated
16
package.json
|
@ -1,10 +1,10 @@
|
|||
{
|
||||
"name": "ArmCord",
|
||||
"version": "2.5.0",
|
||||
"version": "2.6.0",
|
||||
"description": "ArmCord is a Discord client made for ARM Linux that allows you to customize your experience.",
|
||||
"main": "main.js",
|
||||
"scripts": {
|
||||
"start": "electron .",
|
||||
"start": "./build.sh",
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"package": "electron-builder --dir",
|
||||
"make": "electron-builder",
|
||||
|
@ -14,15 +14,21 @@
|
|||
"author": "smartfrigde <smartfridge1337@protonmail.com>",
|
||||
"license": "OSL-3.0",
|
||||
"dependencies": {
|
||||
"@rollup/plugin-commonjs": "^21.0.1",
|
||||
"@rollup/plugin-json": "^4.1.0",
|
||||
"@rollup/plugin-node-resolve": "^13.0.6",
|
||||
"custom-electron-titlebar": "3.2.7",
|
||||
"electron-context-menu": "^3.0.0",
|
||||
"electron-context-menu": "^3.1.1",
|
||||
"electron-dl": "^3.2.1",
|
||||
"electron-localshortcut": "^3.2.1",
|
||||
"electron-store": "^8.0.0",
|
||||
"rollup": "^2.58.0",
|
||||
"rollup-plugin-terser": "^7.0.2",
|
||||
"unzipper": "^0.10.1",
|
||||
"v8-compile-cache": "^2.3.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"electron": "latest",
|
||||
"electron": "^13.3.0",
|
||||
"electron-builder": "^22.11.7"
|
||||
},
|
||||
"repository": {
|
||||
|
@ -41,6 +47,8 @@
|
|||
"category": "Network"
|
||||
},
|
||||
"linux": {
|
||||
"category": "Network",
|
||||
"extraResources": ["./mods/cumcord/*"],
|
||||
"maintainer": "smartfridge1337@protonmail.com",
|
||||
"target": [
|
||||
"deb",
|
||||
|
|
|
@ -4,11 +4,13 @@ const customTitlebar = require("custom-electron-titlebar");
|
|||
const electronLocalshortcut = require("electron-localshortcut");
|
||||
const ArmCord = require("./utils/ArmCord.js");
|
||||
require("./utils/theme.js");
|
||||
require("./utils/bridge.js")
|
||||
window.addEventListener("DOMContentLoaded", () => {
|
||||
if (require("./utils/ArmCord.js").Titlebar === "native") {console.log("Using native titlebar")} else {
|
||||
new customTitlebar.Titlebar({
|
||||
backgroundColor: customTitlebar.Color.fromHex("#202225"),
|
||||
menu: false,
|
||||
});
|
||||
});}
|
||||
|
||||
electronLocalshortcut.register(currentWindow, "F5", () => {
|
||||
location.reload();
|
||||
|
@ -20,7 +22,7 @@ window.addEventListener("DOMContentLoaded", () => {
|
|||
require("shell").openExternal("https://support.discord.com/");
|
||||
});
|
||||
electronLocalshortcut.register(currentWindow, "F2", () => {
|
||||
window.location.href = "/invite/F25bc4RYDt";
|
||||
window.location.href = "https://discord.gg/invite/F25bc4RYDt";
|
||||
});
|
||||
electronLocalshortcut.register(currentWindow, "F4", () => {
|
||||
currentWindow.loadFile("./manager.html");
|
||||
|
|
|
@ -10,7 +10,7 @@ if (!fs.existsSync(settingsFile)) {
|
|||
console.log("Created settings.json file");
|
||||
}
|
||||
exports.Channel = require(settingsFile).channel;
|
||||
|
||||
exports.Titlebar = require(settingsFile).titlebar;
|
||||
exports.addStyle = function(styleString) {
|
||||
const style = document.createElement('style');
|
||||
style.textContent = styleString;
|
||||
|
|
13
utils/bridge.js
Normal file
|
@ -0,0 +1,13 @@
|
|||
const { contextBridge, remote, desktopCapturer } = require("electron");
|
||||
const currentWindow = remote.getCurrentWindow();
|
||||
contextBridge.exposeInMainWorld("electron", {
|
||||
window: {
|
||||
show: () => currentWindow.show(),
|
||||
hide: () => currentWindow.hide(),
|
||||
minimize: () => currentWindow.minimize(),
|
||||
maximize: () => currentWindow.maximize(),
|
||||
},
|
||||
version: process.versions.electron,
|
||||
desktopCapturer: desktopCapturer,
|
||||
|
||||
});
|
23
utils/mod.js
Normal file
|
@ -0,0 +1,23 @@
|
|||
const fs = require("fs");
|
||||
const { app, session } = require("electron");
|
||||
const electron = require("electron");
|
||||
const path = require ('path');
|
||||
const execPath = path.dirname (process.execPath);
|
||||
app.whenReady().then(() => {
|
||||
fs.readdirSync(`${execPath}/resources/mods/`).forEach((file) => {
|
||||
try {
|
||||
const manifest = fs.readFileSync(
|
||||
`${execPath}/resources/mods/${file}/manifest.json`,
|
||||
"utf8"
|
||||
);
|
||||
var pluginFile = JSON.parse(manifest);
|
||||
session.defaultSession.loadExtension(`${execPath}/resources/mods/${file}`);
|
||||
console.log(
|
||||
`%cLoaded ${pluginFile.name} made by ${pluginFile.author}`,
|
||||
"color:red"
|
||||
);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
});
|
||||
});
|
|
@ -3,50 +3,7 @@ const { app, session } = require("electron");
|
|||
const electron = require("electron");
|
||||
const userDataPath = (electron.app || electron.remote.app).getPath("userData");
|
||||
const pluginFolder = userDataPath + "/plugins/";
|
||||
if (!fs.existsSync(pluginFolder)) {
|
||||
fs.mkdirSync(pluginFolder);
|
||||
console.log("Created plugin folder")
|
||||
try {
|
||||
console.log("Attempting to download GooseMod Extension")
|
||||
const https = require("https");
|
||||
|
||||
function download(url, dest, cb) {
|
||||
const file = fs.createWriteStream(dest);
|
||||
const request = https
|
||||
.get(url, function (response) {
|
||||
response.pipe(file);
|
||||
file.on("finish", function () {
|
||||
file.close(cb); // close() is async, call cb after close completes.
|
||||
});
|
||||
})
|
||||
.on("error", function (err) {
|
||||
// Handle errors
|
||||
fs.unlink(dest); // Delete the file async. (But we don't check the result)
|
||||
if (cb) cb(err.message);
|
||||
});
|
||||
}
|
||||
|
||||
// Download latest archive from GitHub to temp folder
|
||||
const dest = userDataPath + "/Cache/GooseMod.zip";
|
||||
const url =
|
||||
"https://codeload.github.com/GooseMod/Extension/zip/refs/heads/main";
|
||||
download(url, dest, function () {
|
||||
console.log("Downloaded, attempting to install.");
|
||||
const unzip = require("unzipper")
|
||||
fs.createReadStream(dest).pipe(unzip.Extract({ path: pluginFolder }));
|
||||
electron.dialog.showMessageBox({
|
||||
title: "ArmCord",
|
||||
type: "warning",
|
||||
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. You won't be able to load themes or see any of ArmCord specific CSS patches including fixed font logo at the top.",
|
||||
});
|
||||
});
|
||||
}
|
||||
catch (e){
|
||||
console.error(`GooseMod failed to download. Error: ${e}`)
|
||||
}
|
||||
}
|
||||
app.whenReady().then(() => {
|
||||
fs.readdirSync(pluginFolder).forEach((file) => {
|
||||
try {
|
||||
|
|