2021-12-26 18:58:05 +00:00
|
|
|
import "./bridge";
|
2022-01-15 18:31:51 +00:00
|
|
|
import "./capturer";
|
2022-03-04 17:53:18 +00:00
|
|
|
import "./patch";
|
2022-01-15 18:31:51 +00:00
|
|
|
import * as fs from "fs";
|
|
|
|
import * as path from "path";
|
2022-03-04 17:53:18 +00:00
|
|
|
import {injectTitlebar} from "./titlebar";
|
|
|
|
import {sleep, addStyle, injectJS} from "../utils";
|
|
|
|
import {ipcRenderer} from "electron";
|
|
|
|
import {injectTabs} from "./tabs";
|
2022-05-22 11:52:26 +00:00
|
|
|
var version = ipcRenderer.sendSync("get-app-version", "app-version");
|
|
|
|
|
2022-01-30 19:48:32 +00:00
|
|
|
declare global {
|
2022-03-04 17:53:18 +00:00
|
|
|
interface Window {
|
|
|
|
armcord: any;
|
|
|
|
}
|
2022-01-30 19:48:32 +00:00
|
|
|
}
|
2021-12-26 21:41:09 +00:00
|
|
|
const clientMods = {
|
2022-03-04 17:53:18 +00:00
|
|
|
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"
|
2021-12-26 21:41:09 +00:00
|
|
|
};
|
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) {
|
2022-03-04 17:53:18 +00:00
|
|
|
console.log("Skipping titlebar injection and client mod injection.");
|
2021-12-26 21:41:09 +00:00
|
|
|
} else {
|
2022-03-04 17:53:18 +00:00
|
|
|
if (ipcRenderer.sendSync("titlebar")) {
|
|
|
|
injectTitlebar();
|
2022-01-15 18:31:51 +00:00
|
|
|
}
|
2022-03-04 17:53:18 +00:00
|
|
|
if (ipcRenderer.sendSync("tabs")) {
|
|
|
|
injectTabs();
|
|
|
|
}
|
|
|
|
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
|
|
|
}
|
2022-05-23 13:42:13 +00:00
|
|
|
/*
|
|
|
|
MIT License
|
2022-05-22 11:52:26 +00:00
|
|
|
|
2022-05-23 13:42:13 +00:00
|
|
|
Copyright (c) 2022 GooseNest
|
|
|
|
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
of this software and associated documentation files (the "Software"), to deal
|
|
|
|
in the Software without restriction, including without limitation the rights
|
|
|
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
copies of the Software, and to permit persons to whom the Software is
|
|
|
|
furnished to do so, subject to the following conditions:
|
|
|
|
|
|
|
|
The above copyright notice and this permission notice shall be included in all
|
|
|
|
copies or substantial portions of the Software.
|
|
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
|
SOFTWARE.
|
|
|
|
*/
|
|
|
|
// Settings info version injection
|
2022-05-22 11:52:26 +00:00
|
|
|
setInterval(() => {
|
|
|
|
const host = document.getElementsByClassName("info-3pQQBb")[0];
|
|
|
|
if (!host || document.querySelector("#ac-ver")) return;
|
|
|
|
const el = document.createElement("span");
|
|
|
|
el.id = "ac-ver";
|
|
|
|
el.classList.add("text-xs-normal-3SiVjE", "line-18uChy");
|
|
|
|
|
|
|
|
el.textContent = `\nArmCord Version: ${version}`;
|
|
|
|
el.onclick = () => ipcRenderer.send("openSettingsWindow");
|
|
|
|
|
|
|
|
host.append(el);
|
|
|
|
}, 2000);
|