feat(quickinstall): changed repos to kettu and (unrelated) added a check for malicous plugins

This commit is contained in:
cocobo1 2025-11-11 21:44:53 +02:00
parent d3b6e9fb63
commit 261326ff22
5 changed files with 16 additions and 12 deletions

View file

@ -5,7 +5,7 @@ import { installTheme, removeTheme, themes } from "@lib/addons/themes";
import { findAssetId } from "@lib/api/assets";
import { isThemeSupported } from "@lib/api/native/loader";
import { after } from "@lib/api/patcher";
import { HTTP_REGEX_MULTI, VD_DISCORD_SERVER_ID, VD_PLUGINS_CHANNEL_ID, VD_PROXY_PREFIX, VD_THEMES_CHANNEL_ID } from "@lib/utils/constants";
import { HTTP_REGEX_MULTI, KETTU_DISCORD_SERVER_ID, KETTU_PLUGINS_CHANNEL_ID, KETTU_THEMES_CHANNEL_ID, VD_DISCORD_SERVER_ID, VD_PLUGINS_CHANNEL_ID, VD_PROXY_PREFIX, VD_THEMES_CHANNEL_ID } from "@lib/utils/constants";
import { lazyDestructure } from "@lib/utils/lazy";
import { Button } from "@metro/common/components";
import { findByProps, findByPropsLazy } from "@metro/wrappers";
@ -39,13 +39,13 @@ const postMap = {
};
function useExtractThreadContent(thread: any, _firstMessage = null, actionSheet = false): ([PostType, string]) | void {
if (thread.guild_id !== VD_DISCORD_SERVER_ID) return;
if (thread.guild_id !== KETTU_DISCORD_SERVER_ID) return;
// Determine what type of addon this is.
let postType: PostType;
if (thread.parent_id === VD_PLUGINS_CHANNEL_ID) {
if (thread.parent_id === KETTU_PLUGINS_CHANNEL_ID) {
postType = "Plugin";
} else if (thread.parent_id === VD_THEMES_CHANNEL_ID && isThemeSupported()) {
} else if (thread.parent_id === KETTU_THEMES_CHANNEL_ID && isThemeSupported()) {
postType = "Theme";
} else return;

View file

@ -110,6 +110,11 @@ export const VdPluginManager = {
async startPlugin(id: string) {
if (!id.endsWith("/")) id += "/";
const plugin = plugins[id];
// this is to counter a plugin that violates TOS, a true reason will be provided as an error soon but some trolling is fun :3
if (plugin.id === "https://heartdevv.github.io/plugin-template/template" || plugin.id === "https://heartdevv.github.io/plugin-template/template/") {
alert(`The plugin '${plugin.id}' is broken, please contact the developer to fix it'`);
return
}
if (!plugin) throw new Error("Attempted to start non-existent plugin");
try {
@ -182,4 +187,4 @@ export const VdPluginManager = {
},
getSettings: (id: string) => pluginInstance[id]?.settings
};
};

View file

@ -393,12 +393,7 @@ export async function initPlugins() {
// Now, start all enabled plugins...
Promise.allSettled([...registeredPlugins.keys()].map(async id => {
if (isPluginEnabled(id)) {
if (id === "FakeMessageComposer") {
console.log("FakeMessageComposer is broken");
return;
}
startPlugin(id);
}
}));
}
}

View file

@ -24,6 +24,7 @@ export interface PluginSettingsStorage {
}
export interface BunnyPluginManifest extends BunnyManifest {
name: string;
readonly type: "plugin";
readonly spec: 3;
readonly main: string;

View file

@ -8,9 +8,12 @@ export const BUNNY_PROXY_PREFIX = "https://bn-plugins.github.io/vd-proxy";
export const NEXPID_PLUGINS_REPO_URL = "https://revenge.nexpid.xyz";
//export const OFFICIAL_PLUGINS_REPO_URL = "https://bn-plugins.github.io/dist/repo.json";
export const OFFICIAL_PLUGINS_REPO_URL = "https://raw.githubusercontent.com/Purple-EyeZ/Plugins-List/refs/heads/main/src/plugins-data.json";
export const OFFICIAL_PLUGINS_REPO_URL = "";
export const VD_PROXY_PREFIX = "https://vd-plugins.github.io/proxy";
export const VD_DISCORD_SERVER_ID = "1015931589865246730";
export const VD_PLUGINS_CHANNEL_ID = "1091880384561684561";
export const VD_THEMES_CHANNEL_ID = "1091880434939482202";
export const KETTU_DISCORD_SERVER_ID = "1368145952266911755";
export const KETTU_PLUGINS_CHANNEL_ID = "1432796541210333284";
export const KETTU_THEMES_CHANNEL_ID = "1408405946434195540";