Compare commits

...

11 commits

Author SHA1 Message Date
dependabot[bot]
839a0d1a88
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-11-01 10:59:51 +00:00
smartfridge
154c4e034d Bump version 2021-11-01 11:59:01 +01:00
smartfridge
64c6c1f118 2.6.0 2021-11-01 11:47:32 +01:00
smartfridge
06460a9d44
Update README.md 2021-07-22 14:50:30 +02:00
smartfridge
10cc7949f9
Update README.md 2021-07-18 15:10:33 +02:00
smartfridge
64b0f6eeba v2.5.0 2021-07-17 17:55:10 +02:00
smartfridge
f8c4e139fc Merge branch 'main' of https://github.com/smartfrigde/armcord 2021-07-17 17:44:23 +02:00
smartfridge
12df5e6b09 v2.5.0 2021-07-17 17:43:37 +02:00
smartfridge
ae926c6548
Update build.yml 2021-07-17 17:43:09 +02:00
smartfridge
0df9689bd1 Add option to use native titlebar 2021-07-17 17:33:21 +02:00
smartfridge
e7ae65bfbb Theme Manager Stuff 2021-07-17 17:25:25 +02:00
23 changed files with 1386 additions and 492 deletions

View file

@ -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
View file

@ -0,0 +1,3 @@
[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 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

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

BIN
ac_plug.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 KiB

BIN
ac_plug.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 361 KiB

After

Width:  |  Height:  |  Size: 107 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 423 KiB

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 361 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

18
main.js
View file

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

View file

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

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>Disabled Themes:</p>
<p class="disabled">Disabled Themes:</p>
<div id="tm-disabled"></div>
<p id="ac-channel"></p>
</body>

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

View 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

File diff suppressed because it is too large Load diff

View file

@ -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",

View file

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

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;

13
utils/bridge.js Normal file
View 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
View 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);
}
});
});

View file

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