From 2705b97c638dea29f5ee59292ee920bf1cf3f45f Mon Sep 17 00:00:00 2001 From: byeoon <47872200+byeoon@users.noreply.github.com> Date: Thu, 24 Oct 2024 13:09:37 +0000 Subject: [PATCH] attempting to fix splash --- src/index.ts | 2 +- src/lib/security.ts | 26 ++++++++++++++++++++---- src/ui/settings/components/AddonPage.tsx | 3 ++- 3 files changed, 25 insertions(+), 6 deletions(-) diff --git a/src/index.ts b/src/index.ts index c978cba4..7d3b66f4 100644 --- a/src/index.ts +++ b/src/index.ts @@ -33,7 +33,7 @@ export default async () => { // Once done, load plugins unloads.push(await initPlugins()); - // shitass feature unloads.push(await initSplash()); + unloads.push(await initSplash()); // We good :D logger.log("Opti is ready!"); diff --git a/src/lib/security.ts b/src/lib/security.ts index 405c465e..8fd7da47 100644 --- a/src/lib/security.ts +++ b/src/lib/security.ts @@ -1,15 +1,33 @@ import AssetBrowser from "@/ui/settings/pages/AssetBrowser"; import Developer from "@/ui/settings/pages/Developer"; import { ReactNative as RN, NavigationNative } from "@metro/common"; - +import { findByProps } from "./metro/filters"; +const { hideActionSheet } = findByProps("openLazy", "hideActionSheet"); export function initSplash() { - const navigation = NavigationNative.useNavigation(); - // hm + const { showSimpleActionSheet } = findByProps("showSimpleActionSheet"); console.log("Loading Opti Security"); window.alert("This is a test."); + if(window.vendetta.settings.developerSettings) { + showSimpleActionSheet({ + key: "OptiPostload", + header: { + title: "Opti Post Loader", + onClose: () => hideActionSheet(), + }, + options: [ + // TODO: add logic + { label: "Toggle Safe Mode", onPress: (o : any) => { + window.vendetta.settings.safeMode = o; } + }, + { label: "Load without Opti",onPress: () =>{ + alert("no"); + } }, + ], + }) +} + } // navigation.push("VendettaCustomPage", { // title: "Asset Browser", // render: AssetBrowser, // }) -} \ No newline at end of file diff --git a/src/ui/settings/components/AddonPage.tsx b/src/ui/settings/components/AddonPage.tsx index a493a8e2..6a78a984 100644 --- a/src/ui/settings/components/AddonPage.tsx +++ b/src/ui/settings/components/AddonPage.tsx @@ -12,7 +12,8 @@ interface AddonPageProps { } export default function AddonPage({ items, safeModeMessage, safeModeExtras, card: CardComponent }: AddonPageProps) { - useProxy(settings) + //@ts-ignore fuck this error. why does it always show up, i dont know + useProxy(settings); useProxy(items); const [search, setSearch] = React.useState("");