Compare commits
No commits in common. "8c3abc8cf69a9b013d9bcd3c8e823c2dca6dd9ce" and "06460a9d441927a9d78071191d96da8875bea2f9" have entirely different histories.
8c3abc8cf6
...
06460a9d44
3
.gitmodules
vendored
|
@ -1,3 +0,0 @@
|
|||
[submodule "mods/goosemod"]
|
||||
path = mods/goosemod
|
||||
url = https://github.com/GooseMod/Extension
|
|
@ -19,10 +19,8 @@ Alternatively you can run ArmCord from source (npm, nodejs required):
|
|||
-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~~ (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.
|
||||
-Yes! ArmCord should work normally under Windows, Mac OS, Linux as long as it has NodeJS, npm and Electron support.
|
||||
|
||||
-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)
|
||||
|
|
Before Width: | Height: | Size: 81 KiB |
BIN
ac_plug.ico
Before Width: | Height: | Size: 107 KiB |
BIN
ac_plug.png
Before Width: | Height: | Size: 38 KiB |
BIN
build/icon.ico
Before Width: | Height: | Size: 107 KiB After Width: | Height: | Size: 361 KiB |
BIN
build/icon.png
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 423 KiB |
BIN
discord.ico
Normal file
After Width: | Height: | Size: 361 KiB |
BIN
discord.png
Normal file
After Width: | Height: | Size: 28 KiB |
8
main.js
|
@ -11,10 +11,10 @@ if (require("./utils/ArmCord.js").Titlebar === "native") {
|
|||
}
|
||||
|
||||
if (os.type() == 'Linux'){
|
||||
var iconformat = __dirname + "/ac_icon_transparent.png"
|
||||
} else {
|
||||
var iconformat = __dirname + "/discord.png"
|
||||
} else { //test this
|
||||
console.log("Running Non-Linux")
|
||||
var iconformat = __dirname + "/ac_plug.ico";
|
||||
var iconformat = __dirname + "/discord.ico";
|
||||
}
|
||||
|
||||
contextMenu({
|
||||
|
@ -105,7 +105,7 @@ function createWindow() {
|
|||
// Some APIs can only be used after this event occurs.
|
||||
app.whenReady().then(() => {
|
||||
createWindow();
|
||||
require("./utils/mod.js");
|
||||
//require("./utils/csp.js");
|
||||
require("./utils/plugin.js");
|
||||
session
|
||||
.fromPartition("some-partition")
|
||||
|
|
|
@ -1,42 +0,0 @@
|
|||
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']
|
||||
);
|
|
@ -1,9 +0,0 @@
|
|||
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);
|
|
@ -1,25 +0,0 @@
|
|||
{
|
||||
"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
|
||||
}
|
1609
package-lock.json
generated
14
package.json
|
@ -1,10 +1,10 @@
|
|||
{
|
||||
"name": "ArmCord",
|
||||
"version": "2.6.0",
|
||||
"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": {
|
||||
"start": "./build.sh",
|
||||
"start": "electron .",
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"package": "electron-builder --dir",
|
||||
"make": "electron-builder",
|
||||
|
@ -14,21 +14,15 @@
|
|||
"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-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": "^13.3.0",
|
||||
"electron": "latest",
|
||||
"electron-builder": "^22.11.7"
|
||||
},
|
||||
"repository": {
|
||||
|
@ -47,8 +41,6 @@
|
|||
"category": "Network"
|
||||
},
|
||||
"linux": {
|
||||
"category": "Network",
|
||||
"extraResources": ["./mods/cumcord/*"],
|
||||
"maintainer": "smartfridge1337@protonmail.com",
|
||||
"target": [
|
||||
"deb",
|
||||
|
|
|
@ -4,7 +4,6 @@ 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({
|
||||
|
@ -22,7 +21,7 @@ window.addEventListener("DOMContentLoaded", () => {
|
|||
require("shell").openExternal("https://support.discord.com/");
|
||||
});
|
||||
electronLocalshortcut.register(currentWindow, "F2", () => {
|
||||
window.location.href = "https://discord.gg/invite/F25bc4RYDt";
|
||||
window.location.href = "/invite/F25bc4RYDt";
|
||||
});
|
||||
electronLocalshortcut.register(currentWindow, "F4", () => {
|
||||
currentWindow.loadFile("./manager.html");
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
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
|
@ -1,23 +0,0 @@
|
|||
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,7 +3,50 @@ 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 {
|
||||
|
|