Compare commits

..

1 commit

Author SHA1 Message Date
dependabot[bot]
f2e9ce56a5
Bump electron-context-menu from 3.0.0 to 3.1.1
Bumps [electron-context-menu](https://github.com/sindresorhus/electron-context-menu) from 3.0.0 to 3.1.1.
- [Release notes](https://github.com/sindresorhus/electron-context-menu/releases)
- [Commits](https://github.com/sindresorhus/electron-context-menu/compare/v3.0.0...v3.1.1)

---
updated-dependencies:
- dependency-name: electron-context-menu
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-17 15:25:08 +00:00
23 changed files with 479 additions and 1370 deletions

View file

@ -29,7 +29,7 @@ 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 (nvm)
# release: ${{ startsWith(github.ref, 'refs/tags/v') }} disabled for now as it caused problems
- name: Archive production builds
uses: actions/upload-artifact@v2
with:

3
.gitmodules vendored
View file

@ -1,3 +0,0 @@
[submodule "mods/goosemod"]
path = mods/goosemod
url = https://github.com/GooseMod/Extension

View file

@ -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 packages for Linux, Windows and Mac OS (experimental).
Alternatively you can run ArmCord from source (npm, nodejs required):
Check releases tab for precompiled deb(ARM64), rpm(ARM64), tar.gz(ARM64), Windows builds.
Alternative (npm, nodejs required):
1.Run `npm install`
2.Run `npm start`
3.Compile/Package with `npm run make`
@ -13,22 +13,21 @@ Alternatively you can run ArmCord from source (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. If you wish to remove GooseMod, you can find it in your plugins folder.
-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
## 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~~ (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)
[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-builder](https://electron.build)
[electron-forge](https://www.npmjs.com/package/electron-forge)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 107 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 107 KiB

After

Width:  |  Height:  |  Size: 361 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 423 KiB

Before After
Before After

BIN
discord.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 361 KiB

BIN
discord.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

18
main.js
View file

@ -4,17 +4,13 @@ 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 + "/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({
@ -35,7 +31,7 @@ function createWindow() {
height: 600,
icon: iconformat,
title: "ArmCord",
frame: frame,
frame: false,
webPreferences: {
preload: path.join(__dirname, "preload.js"),
enableRemoteModule: true,
@ -94,7 +90,7 @@ function createWindow() {
try {
appIcon();
} catch (error) {
//console.error(error);
console.error(error);
// expected output: TypeError: appIcon is not a function
}
});
@ -105,7 +101,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")

View file

@ -36,11 +36,7 @@ span {
font-size: 32px;
text-align: center;
}
.disabled {
text-align: center;
font-weight: normal;
font-family: Helvetica, sans-serif;
}
.container {
position: fixed;
top: 50%;
@ -111,12 +107,7 @@ 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;

View file

@ -11,7 +11,7 @@
<button id="open-themes-btn">Themes Folder</button>
<p class="logo">Cord Manager</p>
<div id="tm-list"></div>
<p class="disabled">Disabled Themes:</p>
<p>Disabled Themes:</p>
<div id="tm-disabled"></div>
<p id="ac-channel"></p>
</body>

View file

@ -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']
);

View file

@ -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);

View file

@ -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
}

1613
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -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.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": "^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",

View file

@ -4,13 +4,11 @@ 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();
@ -22,7 +20,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");

View file

@ -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;

View file

@ -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,
});

View file

@ -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);
}
});
});

View file

@ -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 {