From 64027dfa0d182da575101c0c6fe482fa01e3fbd2 Mon Sep 17 00:00:00 2001 From: everestmcarthur <280397636+everestmcarthur@users.noreply.github.com> Date: Sat, 1 Aug 2026 20:27:40 -0400 Subject: [PATCH] Key Inspector: expand Eval scope to findByTypeName/findByStoreName/instead/before/after/getAssetIDByName --- plugins/key-inspector/src/lib/evalTool.ts | 20 +++++++++++++++++++- plugins/key-inspector/src/ui/Settings.tsx | 8 +++++--- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/plugins/key-inspector/src/lib/evalTool.ts b/plugins/key-inspector/src/lib/evalTool.ts index d542074..02349a3 100644 --- a/plugins/key-inspector/src/lib/evalTool.ts +++ b/plugins/key-inspector/src/lib/evalTool.ts @@ -1,5 +1,7 @@ -import { findByProps, findByName, find } from "@vendetta/metro"; +import { findByProps, findByName, findByTypeName, findByStoreName, findByPropsAll, findByNameAll, find } from "@vendetta/metro"; import { React, ReactNative, FluxDispatcher } from "@vendetta/metro/common"; +import { instead, before, after } from "@vendetta/patcher"; +import { getAssetIDByName } from "@vendetta/ui/assets"; import { rawFind, rawFindByTypeName, rawFindByProps, rawFindByName, rawFindByStoreName } from "@shared/lib/rawFind"; declare const window: any; @@ -50,12 +52,20 @@ export async function runEval(code: string): Promise { const fn = new Function( "findByProps", "findByName", + "findByTypeName", + "findByStoreName", + "findByPropsAll", + "findByNameAll", "find", "rawFind", "rawFindByTypeName", "rawFindByProps", "rawFindByName", "rawFindByStoreName", + "instead", + "before", + "after", + "getAssetIDByName", "React", "ReactNative", "FluxDispatcher", @@ -66,12 +76,20 @@ export async function runEval(code: string): Promise { const result = await fn( findByProps, findByName, + findByTypeName, + findByStoreName, + findByPropsAll, + findByNameAll, find, rawFind, rawFindByTypeName, rawFindByProps, rawFindByName, rawFindByStoreName, + instead, + before, + after, + getAssetIDByName, React, ReactNative, FluxDispatcher, diff --git a/plugins/key-inspector/src/ui/Settings.tsx b/plugins/key-inspector/src/ui/Settings.tsx index e5db5f5..62f2465 100644 --- a/plugins/key-inspector/src/ui/Settings.tsx +++ b/plugins/key-inspector/src/ui/Settings.tsx @@ -80,10 +80,12 @@ function EvalSection() { )} Runs as the body of an async function - a bare expression, `return ...`, or - `await ...` all work. findByProps/findByName/find, the raw* passive variants + `await ...` all work. In scope: findByProps/findByName/findByTypeName/ + findByStoreName/findByPropsAll/findByNameAll/find, the raw* passive variants (rawFind/rawFindByTypeName/rawFindByProps/rawFindByName/rawFindByStoreName), - React, ReactNative, FluxDispatcher, and window are already in scope. Nothing runs - until you tap the button. + instead/before/after, getAssetIDByName, React, ReactNative, FluxDispatcher, and + window - enough to prototype a real patch here before it goes in a plugin. + Nothing runs until you tap the button.