aboutsummaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/apiMenuItemDeobfuscator.ts82
-rw-r--r--src/plugins/betterRoleDot.ts7
-rw-r--r--src/plugins/emoteCloner.tsx2
-rw-r--r--src/plugins/messageLogger/index.tsx2
-rw-r--r--src/plugins/reverseImageSearch.tsx2
-rw-r--r--src/plugins/spotifyControls/index.tsx1
-rw-r--r--src/plugins/viewIcons.tsx2
7 files changed, 10 insertions, 88 deletions
diff --git a/src/plugins/apiMenuItemDeobfuscator.ts b/src/plugins/apiMenuItemDeobfuscator.ts
deleted file mode 100644
index 4b8554f..0000000
--- a/src/plugins/apiMenuItemDeobfuscator.ts
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Vencord, a modification for Discord's desktop app
- * Copyright (c) 2022 Vendicated and contributors
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <https://www.gnu.org/licenses/>.
-*/
-
-import { migratePluginSettings } from "@api/settings";
-import { Devs } from "@utils/constants";
-import definePlugin from "@utils/types";
-
-// duplicate values have multiple branches with different types. Just include all to be safe
-const nameMap = {
- radio: "MenuRadioItem",
- separator: "MenuSeparator",
- checkbox: "MenuCheckboxItem",
- groupstart: "MenuGroup",
-
- control: "MenuControlItem",
- compositecontrol: "MenuControlItem",
-
- item: "MenuItem",
- customitem: "MenuItem",
-};
-
-migratePluginSettings("MenuItemDeobfuscatorAPI", "MenuItemDeobfuscatorApi");
-export default definePlugin({
- name: "MenuItemDeobfuscatorAPI",
- description: "Deobfuscates Discord's Menu Item module",
- authors: [Devs.Ven],
- patches: [
- {
- find: '"Menu API',
- replacement: {
- match: /function.{0,80}type===(\i)\).{0,50}navigable:.+?Menu API/s,
- replace: (m, mod) => {
- let nicenNames = "";
- const redefines = [] as string[];
- // if (t.type === m.MenuItem)
- const typeCheckRe = /\(.{1,3}\.type===(.{1,5})\)/g;
- // push({type:"item"})
- const pushTypeRe = /type:"(\w+)"/g;
-
- let typeMatch: RegExpExecArray | null;
- // for each if (t.type === ...)
- while ((typeMatch = typeCheckRe.exec(m)) !== null) {
- // extract the current menu item
- const item = typeMatch[1];
- // Set the starting index of the second regex to that of the first to start
- // matching from after the if
- pushTypeRe.lastIndex = typeCheckRe.lastIndex;
- // extract the first type: "..."
- const type = pushTypeRe.exec(m)?.[1];
- if (type && type in nameMap) {
- const name = nameMap[type];
- nicenNames += `Object.defineProperty(${item},"name",{value:"${name}"});`;
- redefines.push(`${name}:${item}`);
- }
- }
- if (redefines.length < 6) {
- console.warn("[ApiMenuItemDeobfuscator] Expected to at least remap 6 items, only remapped", redefines.length);
- }
-
- // Merge all our redefines with the actual module
- return `${nicenNames}Object.assign(${mod},{${redefines.join(",")}});${m}`;
- },
- },
- },
- ],
-});
-
diff --git a/src/plugins/betterRoleDot.ts b/src/plugins/betterRoleDot.ts
index 62068c7..481077b 100644
--- a/src/plugins/betterRoleDot.ts
+++ b/src/plugins/betterRoleDot.ts
@@ -45,6 +45,13 @@ export default definePlugin({
replace: "true",
},
},
+ {
+ find: ".colorPickerFooter",
+ replacement: {
+ match: /function (\i).{0,200}\.colorPickerFooter/,
+ replace: "$self.ColorPicker=$1;$&"
+ }
+ }
],
options: {
diff --git a/src/plugins/emoteCloner.tsx b/src/plugins/emoteCloner.tsx
index 3bcc694..4a018ec 100644
--- a/src/plugins/emoteCloner.tsx
+++ b/src/plugins/emoteCloner.tsx
@@ -238,7 +238,7 @@ export default definePlugin({
name: "EmoteCloner",
description: "Adds a Clone context menu item to emotes to clone them your own server",
authors: [Devs.Ven, Devs.Nuckyz],
- dependencies: ["MenuItemDeobfuscatorAPI", "ContextMenuAPI"],
+ dependencies: ["ContextMenuAPI"],
start() {
addContextMenuPatch("message", messageContextMenuPatch);
diff --git a/src/plugins/messageLogger/index.tsx b/src/plugins/messageLogger/index.tsx
index ef9a0ec..8199271 100644
--- a/src/plugins/messageLogger/index.tsx
+++ b/src/plugins/messageLogger/index.tsx
@@ -76,7 +76,7 @@ export default definePlugin({
name: "MessageLogger",
description: "Temporarily logs deleted and edited messages.",
authors: [Devs.rushii, Devs.Ven],
- dependencies: ["ContextMenuAPI", "MenuItemDeobfuscatorAPI"],
+ dependencies: ["ContextMenuAPI"],
start() {
addDeleteStyle();
diff --git a/src/plugins/reverseImageSearch.tsx b/src/plugins/reverseImageSearch.tsx
index 7a3d6d9..4e0a361 100644
--- a/src/plugins/reverseImageSearch.tsx
+++ b/src/plugins/reverseImageSearch.tsx
@@ -76,7 +76,7 @@ export default definePlugin({
name: "ReverseImageSearch",
description: "Adds ImageSearch to image context menus",
authors: [Devs.Ven, Devs.Nuckyz],
- dependencies: ["MenuItemDeobfuscatorAPI", "ContextMenuAPI"],
+ dependencies: ["ContextMenuAPI"],
patches: [
{
find: ".Messages.MESSAGE_ACTIONS_MENU_LABEL",
diff --git a/src/plugins/spotifyControls/index.tsx b/src/plugins/spotifyControls/index.tsx
index ce1bf67..3a5802a 100644
--- a/src/plugins/spotifyControls/index.tsx
+++ b/src/plugins/spotifyControls/index.tsx
@@ -39,7 +39,6 @@ export default definePlugin({
name: "SpotifyControls",
description: "Spotify Controls",
authors: [Devs.Ven, Devs.afn, Devs.KraXen72],
- dependencies: ["MenuItemDeobfuscatorAPI"],
options: {
hoverControls: {
description: "Show controls on hover",
diff --git a/src/plugins/viewIcons.tsx b/src/plugins/viewIcons.tsx
index 7d56538..b60fb75 100644
--- a/src/plugins/viewIcons.tsx
+++ b/src/plugins/viewIcons.tsx
@@ -35,8 +35,6 @@ export default definePlugin({
authors: [Devs.Ven],
description: "Makes Avatars/Banners in user profiles clickable, and adds Guild Context Menu Entries to View Banner/Icon.",
- dependencies: ["MenuItemDeobfuscatorAPI"],
-
openImage(url: string) {
const u = new URL(url);
u.searchParams.set("size", "512");