From 75b8240f1fdcc60d6ff02c1aafe08826b3693914 Mon Sep 17 00:00:00 2001 From: Der_Googler <54764558+DerGoogler@users.noreply.github.com> Date: Sat, 16 Sep 2023 20:32:55 +0200 Subject: [PATCH] Fixes --- Website/src/activitys/MainActivity.tsx | 8 +++++++- Website/src/activitys/SettingsActivity.tsx | 6 ++---- .../activitys/fragments/DeviceModuleFragment.tsx | 15 +++++++++------ Website/src/components/onsenui/Page.tsx | 1 - Website/src/native/Shell.ts | 14 ++++++++++++++ 5 files changed, 32 insertions(+), 12 deletions(-) diff --git a/Website/src/activitys/MainActivity.tsx b/Website/src/activitys/MainActivity.tsx index 5f9a40f2..edcb0d74 100644 --- a/Website/src/activitys/MainActivity.tsx +++ b/Website/src/activitys/MainActivity.tsx @@ -33,9 +33,14 @@ const MainActivity = (): JSX.Element => { setIsSplitterOpen(true); }; + const erudaRef = React.useRef(null); + React.useEffect(() => { if (settings.eruda_console_enabled) { - eruda.init(); + eruda.init({ + container: erudaRef.current as HTMLElement, + tool: ["console", "elements", "resources", "info"], + }); } else { if ((window as any).eruda) { eruda.destroy(); @@ -179,6 +184,7 @@ const MainActivity = (): JSX.Element => { return ( { return ( diff --git a/Website/src/activitys/SettingsActivity.tsx b/Website/src/activitys/SettingsActivity.tsx index 5b9549c2..dcdb1390 100644 --- a/Website/src/activitys/SettingsActivity.tsx +++ b/Website/src/activitys/SettingsActivity.tsx @@ -141,14 +141,12 @@ function SettingsActivity() { id="switch-list-__experimental_local_install" primary={"Enable local install"} secondary={ - <> - Allows you to install local *.zip files (Experimental). Disabled due KernelSU support. - + <>Allows you to install local *.zip files (Experimental). {Shell.isKernelSU && Disabled due KernelSU.} } /> { setSettings("__experimental_local_install", e.target.checked); }} diff --git a/Website/src/activitys/fragments/DeviceModuleFragment.tsx b/Website/src/activitys/fragments/DeviceModuleFragment.tsx index 8b72e2df..131fbae3 100644 --- a/Website/src/activitys/fragments/DeviceModuleFragment.tsx +++ b/Website/src/activitys/fragments/DeviceModuleFragment.tsx @@ -5,6 +5,9 @@ import { useActivity } from "@Hooks/useActivity"; import { useSettings } from "@Hooks/useSettings"; import { Page } from "@Components/onsenui/Page"; import Stack from "@mui/material/Stack"; +import { Shell } from "@Native/Shell"; +import { Box, Card, Typography } from "@mui/material"; +import TerminalActivity from "@Activitys/TerminalActivity"; const DeviceModuleFragment = () => { const { context } = useActivity(); @@ -15,7 +18,7 @@ const DeviceModuleFragment = () => { const dir = SuFile.list(settings.def_mod_path).split(","); const regex = settings.mod_filt.map(function (re) { - return new RegExp("\\b" + re + "\\b", "i"); + return new RegExp("\\b" + re + "\\b", "gmi"); }); setModules( @@ -32,9 +35,9 @@ const DeviceModuleFragment = () => { return ( - {/* {settings.__experimental_local_install && ( - { // @ts-ignore Chooser.getFile( @@ -61,8 +64,8 @@ const DeviceModuleFragment = () => { - - )} */} + + )} {modules.map((module) => ( diff --git a/Website/src/components/onsenui/Page.tsx b/Website/src/components/onsenui/Page.tsx index cefc46d9..9ff9c8de 100644 --- a/Website/src/components/onsenui/Page.tsx +++ b/Website/src/components/onsenui/Page.tsx @@ -83,7 +83,6 @@ const RelativeContent = styled(Content)((props: ContentProps) => { return { boxSizing: "border-box", - height: "100%", minWidth: props.minWidth ? props.minWidth : 200, maxWidth: props.maxWidth ? props.maxWidth : 980, margin: "0 auto", diff --git a/Website/src/native/Shell.ts b/Website/src/native/Shell.ts index d73f489c..cadde084 100644 --- a/Website/src/native/Shell.ts +++ b/Website/src/native/Shell.ts @@ -106,6 +106,20 @@ class ShellClass extends Native { return "0:SU"; } } + + /** + * Determine if MMRL runs with KernelSU + */ + public get isKernelSU(): boolean { + return /(\d+\.\d+\.\d+):KernelSU/i.test(this.VERSION_NAME()) ? true : false; + } + + /** + * Determine if MMRL runs with Magisk + */ + public get isMagisk(): boolean { + return /(\d+\.\d+):MAGISKSU/i.test(this.VERSION_NAME()) ? true : false; + } } export const Shell: ShellClass = new ShellClass();