2021-12-26 18:58:05 +00:00
|
|
|
import "./bridge";
|
2022-01-15 18:31:51 +00:00
|
|
|
import "./capturer";
|
|
|
|
import * as fs from "fs";
|
|
|
|
import * as path from "path";
|
2021-12-26 18:58:05 +00:00
|
|
|
import { injectTitlebar } from "./titlebar";
|
2022-01-15 18:31:51 +00:00
|
|
|
import { sleep, addStyle } from "../utils";
|
2021-12-26 21:41:09 +00:00
|
|
|
import { ipcRenderer } from "electron";
|
|
|
|
|
|
|
|
const clientMods = {
|
|
|
|
goosemod: "https://api.goosemod.com/inject.js",
|
|
|
|
cumcord:
|
|
|
|
"https://raw.githubusercontent.com/Cumcord/Cumcord/stable/dist/build.js",
|
|
|
|
flicker: "https://raw.githubusercontent.com/FlickerMod/dist/main/build.js",
|
|
|
|
};
|
|
|
|
async function injectJS(inject: string) {
|
|
|
|
const js = await (await fetch(`${inject}`)).text();
|
|
|
|
|
|
|
|
const el = document.createElement("script");
|
|
|
|
|
|
|
|
el.appendChild(document.createTextNode(js));
|
|
|
|
|
|
|
|
document.body.appendChild(el);
|
|
|
|
}
|
2021-12-26 18:58:05 +00:00
|
|
|
|
|
|
|
console.log("ArmCord");
|
2021-12-26 21:41:09 +00:00
|
|
|
if (window.location.href.indexOf("splash.html") > -1) {
|
|
|
|
console.log("Skipping titlebar injection and client mod injection.");
|
|
|
|
} else {
|
|
|
|
injectTitlebar();
|
2022-01-15 18:31:51 +00:00
|
|
|
sleep(5000).then(() => {
|
|
|
|
const cssPath = path.join(__dirname, "../", "/content/css/discord.css");
|
|
|
|
addStyle(fs.readFileSync(cssPath, "utf8"));
|
|
|
|
|
|
|
|
switch (ipcRenderer.sendSync("clientmod")) {
|
|
|
|
case "goosemod":
|
|
|
|
injectJS(clientMods.goosemod);
|
|
|
|
console.log("Loading GooseMod...");
|
|
|
|
break;
|
|
|
|
case "cumcord":
|
|
|
|
injectJS(clientMods.cumcord);
|
|
|
|
console.log("Loading Cumcord...");
|
|
|
|
break;
|
|
|
|
case "flicker":
|
|
|
|
injectJS(clientMods.flicker);
|
|
|
|
console.log("Loading FlickerMod...");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
});
|
2021-12-26 21:41:09 +00:00
|
|
|
}
|